Aller au contenu

Utilisateur:Yopyop456/Brouillon/hsk3.0

Une page de Wikipédia, l'encyclopédie libre.

身份证
岁数
未婚
名字
性别
出生日
离异
国籍
男性
出生地
介绍
民族
女性

自我介绍
护照
男人
婚姻状况
认识
身份
女人
已婚

简历
学位
联系方式
办公电话
学历
职业
地址
个人电话
教育程度
工作经历
电话号码
业余爱好
专业
希望职位
电子邮箱地址
性格

样子
皱纹
金黄头发
隐形眼镜
外貌

黑头发
胡子
身材

褐色头发
美丽
个子
强壮
红头发
漂亮
好看
体重

秃顶

难看
肤色

眼镜

态度
开朗
可靠
粗心
人格
个性
可爱
老实

性格
好奇
认真
可恶
脾气
有耐心
细心
自私
热情
安静
敏感
自大
大方
有礼貌
害羞
虚伪
城市
紧张
懒惰

爷爷
祖父
堂哥
侄女
奶奶
祖母
叔母
表弟
儿子
父亲
姑姑
哥哥
孙子
伯母
姑父
弟弟
侄子
孙女

/*
https://server.chinesezerotohero.com/sketch-engine-proxy.php?https://api.sketchengine.eu/bonito/run.cgi/wsketch?corpname=preloaded/zhtenten17_simplified_stf2&lemma=

https://server.chinesezerotohero.com/sketch-engine-proxy.php?https://app.sketchengine.eu/bonito/run.cgi/thes?corpname=preloaded/zhtenten17_simplified_stf2&lpos=&clusteritems=0&maxthesitems=100&minthesscore=0&minsim=0.3&lemma=关上


https://server.chinesezerotohero.com/sketch-engine-proxy.php?https://app.sketchengine.eu/bonito/run.cgi/thes?corpname=preloaded/zhtenten17_simplified_stf2&lpos=&clusteritems=0&maxthesitems=100&minthesscore=0&minsim=0.3&lemma=%E6%8C%A8%E5%AE%B6%E6%8C%A8%E6%88%B7

{"lpos":"","wpos":"","default_attr":"word","attrs":"word","refs":"=doc.website","ctxattrs":"word","attr_allpos":"all","usesubcorp":"","viewmode":"kwic","cup_hl":"q","cup_err":"true","cup_corr":"","cup_err_code":"true","structs":"s,g","gdex_enabled":0,"fromp":1,"pagesize":50,"concordance_query":[{"queryselector":"iqueryrow","iquery":"挨家挨户"}],"kwicleftctx":"100#","kwicrightctx":"100#"}

https://server.chinesezerotohero.com/sketch-engine-proxy.php?https://api.sketchengine.eu/bonito/run.cgi/wordlist?corpname=preloaded/zhtenten17_simplified_stf2&ngrams_n=2&ngrams_max_n=4&wlattr=word&wlpat=.*\b更\b.*

https://server.chinesezerotohero.com/sketch-engine-proxy.php?https://api.sketchengine.eu/bonito/run.cgi/wordlist?corpname=preloaded%2Fzhtenten17_simplified_stf2&wlattr=word&wlminfreq=5&wlmaxitems=20000&wlicase=0&wlsort=frq&include_nonwords=0&wlmaxfreq=0&ngrams_n=2&ngrams_max_n=4&nest_ngrams=0&simple_n=1&relfreq=1&reldocf=1&usengrams=1&wlpat=.*%5Cb八%5Cb.*

for(i of out) out2.push(await fetch('https://api.sketchengine.eu/bonito/run.cgi/thes?corpname=preloaded/zhtenten17_simplified_stf2&lpos=&clusteritems=0&maxthesitems=100&minthesscore=0&minsim=0.3&lemma='+i).then(x=>x.text()))

65f6ef5c59678cf8ddcf6aeae769066b

await fetch('https://api.sketchengine.eu/bonito/run.cgi/wordlist?corpname=preloaded%2Fzhtenten17_simplified_stf2&wlattr=word&wlminfreq=5&wlmaxitems=20000&wlicase=0&wlsort=frq&include_nonwords=0&wlmaxfreq=0&ngrams_n=2&ngrams_max_n=4&nest_ngrams=0&simple_n=1&relfreq=1&reldocf=1&usengrams=1&wlpat=.*%5Cb八%5Cb.*',{
  headers: {Authorization: 'Bearer 65f6ef5c59678cf8ddcf6aeae769066b'}
})

out2 = {}
for(i of out) out[i] = await fetch('https://api.sketchengine.eu/bonito/run.cgi/wordlist?corpname=preloaded%2Fzhtenten17_simplified_stf2&wlattr=word&wlminfreq=5&wlmaxitems=20000&wlicase=0&wlsort=frq&include_nonwords=0&wlmaxfreq=0&ngrams_n=2&ngrams_max_n=4&nest_ngrams=0&simple_n=1&relfreq=1&reldocf=1&usengrams=1&wlpat=.*%5Cb'+i+'%5Cb.*',{
  headers: {Authorization: 'Bearer 65f6ef5c59678cf8ddcf6aeae769066b'}
})

*/

(async ()=>{
  window._ ??= await import('/js/0utils/utils3.mjs')
})()

async function scrape_sketchengine(){

  let out, i, list
  list = await fetch(dict._path + 'final/char.txt').then(x=>x.text())
  list = list.split('\n')
  out = {}
  for(i=0; i<list.length; i++){
    out['' + list[i]] = ''
  }

  out = {}
  out = await fetch(dict._path + 'final/thesaurus.json').then(x=>x.json())
  for(i in out) if(!out[i].includes('"status":"success"')) {
    out[i] = ''
  }

  _.fetchAll(out, {max: 8, urlmodif: x=>{
    return {
      url: 'https://server.chinesezerotohero.com/sketch-engine-proxy.php?https://app.sketchengine.eu/bonito/run.cgi/thes?corpname=preloaded/zhtenten17_simplified_stf2', 
      postbody: 'lemma='+x+'&lpos=&clusteritems=0&maxthesitems=100&minthesscore=0&minsim=0.3'
    }}
  })

  window.scrape = out
}

async function process_sketchengine_col(){

  let out, i, j, k, list, tmp
  list = await fetch(dict._path + 'final/coloc-5000.json').then(x=>x.json())

  for(i in list){
    list[i] = list[i].replaceAll(/\\u[a-f0-9]{4}/g, (...p)=>{
      return JSON.parse('"'+p[0]+'"')
    })
    list[i] = JSON.parse(list[i])

    if(list[i].status != 'success') {
      debugger
      console.warn(list[i].status)
    }
  }

  out = {}
  for(i in list){
    if(!list[i].data.Gramrels) continue
    tmp = []
    for(j of list[i].data.Gramrels){
      for(k of j.Words){
        tmp.push(k)
      }
    }

    tmp.sort((a,b)=>a.count>b.count?-1:a.count<b.count?1:0)
    j = []
    for(k of tmp){
      if(j.includes(k.cm)) continue
      j.push(k.cm)
      if(j.length == 10) break
    }

    out[i] = j.join('、')
  }

  window.scrape2 = list
  window.scrape3 = out
}


async function process_sketchengine_thes(){

  let out, i, j, k, list, list2, tmp
  list = await fetch(dict._path + 'final/thesaurus.json').then(x=>x.json())
  list2 = await fetch(dict._path + 'final/thesaurus2.json').then(x=>x.json())
  
  tmp = await fetch(dict._path + 'final/thesaurus3.json').then(x=>x.json())
  list2.push(...tmp)

  for(i in list2){
    list2[i] = list2[i].replaceAll(/\\u[a-f0-9]{4}/g, (...p)=>{
      return JSON.parse('"'+p[0]+'"')
    })
    if(list2[i].includes('429 Too Many')) continue

    list2[i] = JSON.parse(list2[i])
    list[list2[i].request.lemma] = list2[i]
  }

  tmp = []
  for(i in list){
    if(typeof list[i] != 'string') continue

    list[i] = list[i].replaceAll(/\\u[a-f0-9]{4}/g, (...p)=>{
      return JSON.parse('"'+p[0]+'"')
    })
    list[i] = JSON.parse(list[i])

    if(list[i].status != 'success') {
      debugger
      tmp.push(i)
    }
  }

  out = {}
  for(i in list){
    if(!list[i].data){
      list[i].data = list[i]
    }
    if(!list[i].data.Words) continue
    
    tmp = []
    for(j of list[i].data.Words){
      tmp.push(j.word)
    }

    out[i] = tmp
  }

  window.scrape2 = list
  window.scrape3 = out

  window.discard = tmp
}

/*

http://wap.51bc.net/xhy/page/xhy539.html

http://xh.51bc.net/html3/22525.html

http://xh.51bc.net/html4/16.html
{"derivation": "清·赵翼《论诗》诗矮人看戏何曾见,都是随人说短长。”", "example": "无", "explanation": "比喻只知道附和别人,自己没有主见。也比喻见识不广。", "pinyin": "ǎi rén kàn xì", "word": "矮人看戏", "abbreviation": "arkx"}
http://xh.51bc.net/html4/31250.html

{"ci":"", "explanation":""}
http://xh.51bc.net/html5/372021.html
*/

async function process_xinhua_ci(x){
  let txt = await fetch(dict._path + 'final/xinhua-'+x+'.json').then(x=>x.json())
  let out = []

  for(let i in txt){
    txt[i] = txt[i].replaceAll('<br>','')
    let kk = txt[i].match(/center>([^<]+)<\/td>/s)?.at(1)
    if(!kk) continue
    let vv = txt[i].match(/'1'>(.+?)</s).at(1).trim()
    out.push({ci: kk, explanation: vv})
  }

  scrape = txt
  scrape2 = out

  return out

  // aze = {}; [0, 50_000, 100_000, 150_000, 200_000, 250_000, 300_000, 350_000].forEach(async (x)=>{aze[x] = await process_xinhua_ci(x)})
  // aze.final = []; [0, 50_000, 100_000, 150_000, 200_000, 250_000, 300_000, 350_000].forEach(async (x)=>aze.final.push(...aze[x]))
}

async function process_xinhua_chengyu(x){
  let txt = await fetch(dict._path + 'final/chengyu-0.json').then(x=>x.json())
  let out = []

  for(let i in txt){
    let word = txt[i].match(/3><b>([^<]+?)</s)?.at(1)?.trim() || ''
    let pinyin = txt[i].match(/拼音.+?'40%'>([^<]+?)</s)?.at(1)?.trim() || ''
    let explanation = txt[i].match(/解释.+?'5'>([^<]+?)</s)?.at(1)?.trim() || ''
    let example = txt[i].match(/例子.+?'5'>([^<]+?)</s)?.at(1)?.trim() || ''
    let abbreviation = ''
    let derivation = txt[i].match(/出处.+?'5'>([^<]+?)</s)?.at(1)?.trim() || ''
    debugger
    out.push({
      derivation,
      example,
      explanation,
      pinyin,
      word,
      abbreviation
    })
  }

  scrape = txt
  scrape2 = out

}

async function process_xinhua_pageciyu(x){
  let txt = await fetch(dict._path + 'final/words-0.json').then(x=>x.json())
  let out = {}

  for(let i in txt){
    let ciyu = txt[i].match(/ciyu\/(.+\.html)>更多相关成语/s)
    if(ciyu) out[ciyu.at(1)] = ciyu.at(2)
    //out.push(ciyu)
  }

  scrape = txt
  scrape2 = out

}

async function process_xinhua_pageciyu(x){
  let txt = await fetch(dict._path + 'final/words-0.json').then(x=>x.json())
  let out = {}

  for(let i in txt){
    let ciyu = txt[i].match(/ciyu\/(.+\.html)>更多有关(.*?)的词语/s)
    if(ciyu) out[ciyu.at(1)] = ciyu.at(2)
    //out.push(ciyu)
  }

  scrape = txt
  scrape2 = out

}

async function process_xinhua_pageciyu0(x){
  let txt = await fetch(dict._path + 'final/pageciyu-0.json').then(x=>x.json())
  let out = []

  for(let i in txt){
    let ciyu = txt[i].match(/z[a-zA-Z0-9].+?\.html/) || []
    //if(ciyu) out[ciyu.at(1)] = ciyu.at(2)
    out.push(...ciyu)
  }

  scrape = txt
  scrape2 = out

}

async function process_xinhua_pageciyu1(x){
  let txt = await fetch(dict._path + 'final/pageciyu-1.json').then(x=>x.json())
  let out = {}

  for(let i in txt){
    let ciyu = txt[i].match(/title1>([^<]+?)</s)?.at(1)
    let def = txt[i].match(/body4'><br>(.+?)<\/div>/s)?.at(1).replaceAll('<br>','').trim()
    //if(ciyu) out[ciyu.at(1)] = ciyu.at(2)
    out[ciyu] = def
  }

  scrape = txt
  scrape2 = out

}

async function scrape_xinhua_ci(x=0){
  _ = window

  let out, i, list

  if(typeof scrape != 'undefined') out = scrape
  else {
    out = {}
    for(i=x*50000+1; i<=539 && i<(x+1)*50000+1; i++){
      out['' + i] = ''
    }
  }

  _.fetchAll(out, {
    max: 8,
    responsetype: 'arrayBuffer',
    // urlmodif: x=>'http://xh.5156edu.com/html5/'+x+'.html',
    urlmodif: x=>'http://wap.51bc.net/xhy/page/xhy'+x+'.html',
    valmodif: x=>{
      let z = (new TextDecoder("gb2312")).decode(x)
      x = z.includes('utf') ? (new TextDecoder("utf-8")).decode(x) : z
      // x = x.match(/<table border=.+?<hr.+?<hr/s)?.at(0)
      // debugger
      return x
    },
  })

  window.scrape = out

  // for(i in scrape) if(!scrape[i]){console.log(i); scrape[i] = ''}
  // download(JSON.stringify(scrape), 'xinhua-100000.txt')
}

async function load_baidu(x=''){
  let out = []
  let txt = await fetch(dict._path + 'final/baidu'+x+'.json').then(x=>x.json())
  for(let i in txt){
    let sub = txt[i].match(/synonym.+antonym/s)?.at(0)
    if(!sub) continue
    let mm = sub.matchAll(/zici">([^<]+)/g)
    let vv
    let tt = txt[i].match(/<title>([^_]+)/s)?.at(1)
    for(vv=mm.next(); !vv.done; vv=mm.next()){
      if(!out.includes(tt + '\t' + vv.value[1])) {
        out.push(tt + '\t' + vv.value[1])
      }
      else if(!out.includes(vv.value[1] + '\t' + tt)) {
        out.push(vv.value[1] + '\t' + tt)
      }
    }
    // break
  }
  return out
}

async function scrape_baidu(){

  let out, i, list, list2
  list = await fetch(dict._path + 'final/char.txt').then(x=>x.text())
  list = list.split('\n')
  out = []

  list2 = await fetch(dict._path + 'final/baidu-final.json').then(x=>x.json())
  list2 = list2.join('\t').split('\t')

  for(i of list2) if(!list.includes(i) && i.length == 2) out.push(i)
  console.log(list2.length, out.length)

  list2 = await fetch(dict._path + 'Keson96_SynoCN/syno_from_baidu_hanyu.txt').then(x=>x.text())
  list2.replaceAll('\n', '\t').split('\t')
  for(i of list2) if(!list.includes(i) && i.length == 2) out.push(i)
  console.log(list2.length, out.length)

  window.scrape = out
}

async function load_zdic3(){
  let i, out, txt

  txt = await fetch(dict._path + 'final/xinhua-final.json').then(x=>x.json())
  out = {}
  for(i=0; i<txt.length; i++){
    if(out[txt[i].ci]){
      console.warn(txt[i].ci)
      out[txt[i].ci] += '\n+ ' + txt[i].explanation
    }
    else out[txt[i].ci] = '+ ' + txt[i].explanation
  }
  dict._zdic3 = out

}

/** **/

// wojmepwam27+

window.dict = {}
dict._path = '/tmp2/cnchar2/scripts_and_data/'

function get(x, val){
  let idx = this.key2[x] || this.key.indexOf(x)
  if(val) {
    if(typeof val == 'object') Object.assign(this.val[idx], val)
    else this.val[idx] = val
  }
  else return this.val[idx]
}

function get_si_tr(si){
  let tr = ''
  entry = dict._cedict[si]
  if(entry){
    tr = entry[0]
  }
  else {
    si.split('').forEach(a=>tr+=dict._cedict[a][0])
  }
  return tr
}

function get_cc_def(si, lng = 'e'){
  let def, i, out
  def = dict['_c'+lng+'dict'][si]

  if(!def) return ''
  else def = def[3].split('/')

  def = def.slice(1, -1)
  out = []
  for(i=0; i<def.length; i++){
    if(def[i].includes(';')) {
      out.push(def[i])
      break
    }

    if(def[i].match(/[^a-z ;,\(\)\.]/)) continue
    out.push(def[i])
  }

  if(!out.length) out.push(def[0])

  return out.slice(0, 3).join('; ')
}

function get_zdic_ci(si){
  let out, more, i
  more = dict._zdic[si[0]].more
  more = more.split('\n')
  out = []
  i = more.indexOf(si)
  if(i<0) return

  out.push(more[i], more[i+1])
  for(i+=2; i<more.length; i++){
    if(!(more[i][0] == '[') && more[i].match(/[a-z]/)) break
    out.push(more[i])
  }
  out.pop()
  return out
}

function get_decomp(si){
  si = si.split('')
  let i, tmp, out = {decomp: [], phon: [], up:[]}
  si.forEach(char=>{
    tmp = dict._decomp[char].decomposition
    if(dict._decomp[char].etymology?.phonetic) tmp = tmp.replace(dict._decomp[char].etymology.phonetic, dict._decomp[char].etymology.phonetic + 'p')
    if(dict._decomp[char].radical) tmp = tmp.replace(dict._decomp[char].radical, dict._decomp[char].radical + 'r')
    if(char == dict._decomp[char].radical) tmp = 'r' + tmp
    out.decomp.push(tmp)
  })

  out.decomp.forEach(char=>{
    out.phon.push([])
    if(char.includes('p')){
      tmp = char.match(/(.)p/)[1]
      for(i in dict._decomp){
        if(dict._decomp[i].etymology?.phonetic == tmp){
          out.phon.at(-1).push(dict._decomp[i].character)
        }
      }
    }
  })

  si.forEach(char=>{
    out.up.push([])
    for(i in dict._decomp){
      if(dict._decomp[i].decomposition.includes(char)){
        out.up.at(-1).push(dict._decomp[i].character)
      }
    }

  })

  return out
}

async function all_load(){
  await load_ccdict('cfdict/cfdict.u8')
  await load_ccdict('cedict/cedict_1_0_ts_utf-8_mdbg.txt')
  await load_hsk3off()
  await load_hsk3elk()
  await load_hsk3yar()
  await check_hsk3off_hsk3elk()

  await load_hsk2()
  await load_hsk2uni()
  //await loadhsk3def()

  await load_gtrans()
  await load_xiandai()
  await load_zdic()
  await load_decomp()

  await load_hydcd()
  await load_coloc()

  await merge_hsk()
  // return await mergeHSK()

}

async function load_ccdict(s){
  let txt, out
  out = {}
  txt = await fetch(dict._path + s).then(x=>x.text())
  txt = txt.replaceAll('\r', '').split('\n')
  txt.forEach((a, b)=>{
    let w, x, y, z
    x = a.indexOf(' ')
    y = a.indexOf(' ', x+1)
    z = a.indexOf(']', y+1)+1

    w = a.slice(x+1, y)
    if(!out[w]) out[w] = [a.slice(0, x), a.slice(x+1, y), a.slice(y+1, z), a.slice(z+1)]
    else {
      out[w][2] += ', ' + a.slice(y+1, z)
      out[w][3] += a.slice(z+2)
    }
  })

  dict['_'+s.slice(0, 6)] = out
}

async function load_hsk3off(){
  let txt

  txt = await fetch(dict._path + 'shawkynasr_HSK-official-Query-System/词汇 2022.csv').then(x=>x.text())
  txt = txt.replaceAll('\r','').split('\n')
  txt.shift()
  txt.forEach((a, b)=>txt[b]=a.split(','))

  dict._hsk3off = txt
}

async function load_hsk3elk(){
  let txt, line, n, m

  dict._hsk3elk = []
  txt = await fetch(dict._path + 'elkmovie_hsk30/wordlist.txt').then(x=>x.text())
  txt = txt.split('\n')
  m = 0

  for(line of txt){
    n = line.match(/^\d+/)
    if(n == 1) m++
    
    if(!n) continue
    dict._hsk3elk.push({
      simplified: line.replace(n + ' ', ''),
      level : 'hsk-' + m
    })
  }
  
}

async function check_hsk3off_hsk3elk(){
  dict._hsk3off.sort((a,b)=>{
    let lvl = '一二三四五六高'
    if(lvl.indexOf(a[1][0]) > lvl.indexOf(b[1][0])){
      return 1
    }
    else if(lvl.indexOf(a[1][0]) < lvl.indexOf(b[1][0])){
      return -1
    }
    else return 0
  })

  let key1 = []
  let key2 = []
  let n = dict._hsk3elk.length
  for(let i=0; i<n; i++){
    key1.push(dict._hsk3elk[i].simplified
      .replace(/[\|\|\∣].+/, '')
      .replace(/[\(\(].+[\)\)]/, '')
      .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
      // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
      )
    key2.push(dict._hsk3off[i][2]
      .replace(/[\|\|\∣].+/, '')
      .replace(/[\(\(].+[\)\)]/, '')
      .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
      // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
      )
  }

  for(let i=0; i<n; i++){
    let j = key1.indexOf(key2[i])
    if(j >= 0){
      key1[j] = ''
      key2[i] = ''
      dict._hsk3off[i].push(j)
    }
    else{
      console.warn(key2[i])
    }
  }

  dict._hsk3off.sort((a,b)=>{
    if(a[5] > b[5]){
      return 1
    }
    if(a[5] < b[5]){
      return -1
    }
    else return 0
  })

}

async function load_hsk2(){
  let out = []

  let txt = await fetch(dict._path + 'glxxyz_hskhsk.com/hskhsk.txt').then(x=>x.text())
  txt = txt.split('\n')
  let n = 0

  for(i=0; i<txt.length; i++){
    if(txt[i].includes('--HSK')) {
      ++n
      continue
    }
    txt[i] = txt[i].split('\t')
    out.push({
      level: 'hsk-' + n,
      simplified: txt[i][0],
      definition_en: txt[i][4],
      pinyin: txt[i][3],
    })
  }

  dict._hsk2 = out
}

async function load_hsk3yar(){
  let txt = await fetch(dict._path + 'cultureyard/cultureyard.json').then(x=>x.json())
  dict._hsk3yar = txt
}

async function load_hsk2uni(){
  let txt = await fetch(dict._path + 'unige/unige.json').then(x=>x.json())
  dict._hsk2uni = txt.value
}

async function load_gtrans(){
  let out, txt = await fetch(dict._path + 'gtranslate/gtranslate.txt').then(x=>x.text())
  out = {}
  txt = txt.replaceAll('\r', '').split('\n')
  for(let i=0; i<txt.length; i++){
    txt[i] = txt[i].split('\t')
    out[txt[i][0]] = txt[i].slice(1)
  }
  dict._gtrans = out
}

async function load_xiandai(){
  let i, out, txt
  txt = await fetch(dict._path + 'CNMAN_XDHYCD7th/XDHYCD7th.txt').then(x=>x.text())
  txt = txt.replaceAll('\r', '').split('\n')
  out = {}
  for(i=0; i<txt.length; i++){
    txt[i] = txt[i].slice(1).split('】')
    if(out[txt[i][0]]){
      out[txt[i][0]] += '\n+ ' + txt[i][1]
    }
    else out[txt[i][0]] = '+ ' + txt[i][1]
  }
  dict._xiandai = out
}

async function load_zdic(){
  let i, out, txt

  txt = await fetch(dict._path + 'pwxcoo_chinese-xinhua/data/ci.json').then(x=>x.json())
  out = {}
  for(i=0; i<txt.length; i++){
    if(out[txt[i].ci]){
      // console.warn(txt[i].ci)
      out[txt[i].ci] += '\n+ ' + txt[i].explanation
    }
    else out[txt[i].ci] = '+ ' + txt[i].explanation
  }
  dict._zdic2 = out

  txt = await fetch(dict._path + 'pwxcoo_chinese-xinhua/data/word.json').then(x=>x.json())
  out = {}
  for(i=0; i<txt.length; i++){
    if(out[txt[i].word]){
      // console.warn(txt[i].word)
      out[txt[i].word].explanation += '\n--\n' + txt[i].pinyin + '\n' + txt[i].explanation
      out[txt[i].word].more += '\n--\n' + txt[i].pinyin + '\n' + txt[i].explanation
    }
    else out[txt[i].word] = txt[i]
  }
  dict._zdic = out
}

async function load_decomp(){
  let i, out, txt = await fetch(dict._path + 'skishore_makemeahanzi/dictionary.txt').then(x=>x.text())
  txt = '[' + txt.trim().replaceAll('\n', ',\n') + ']'
  txt = JSON.parse(txt)
  out = {}
  for(i=0; i<txt.length; i++) {
    if(out[txt[i].character]) console.error(out[txt[i].character])
    out[txt[i].character] = txt[i]
  }
  dict._decomp = out
}

async function load_hydcd(){
  let i, out, txt
  txt = await fetch(dict._path + 'lxs602_Chinese-Mandarin-Dictionaries/Hànyǔ Dà Cídiǎn - dāncí biǎo - word list.tab').then(x=>x.text())
  txt = txt.replaceAll(/\t.+$/gm, '').replaceAll(/^.+\|/gm, '').split('\n')
  dict._hydcd = txt
}

async function load_coloc(){
  let i, out, txt
  txt = await fetch(dict._path + 'final/coloc-final.json').then(x=>x.json())
  dict._coloc = txt
}

/*
11437
out2 = [...(new Set(out))]
11441
for(i=0; i<out2.length; i++) if(!dict.key.includes(out2[i])) console.warn(out2[i])
*/

async function merge_hsk(){
  dict.key = []
  dict.key2 = {}
  dict.val = []
  dict.get = get.bind(dict)

  let char, i, entry, tmp

  tmp = [...dict._hsk3elk]
  for(i=0; i<dict._hsk3off.length; i++){
    if(dict._hsk3off[i][2].includes('儿')){
      if(tmp[i].simplified.includes('儿')){
        if(dict._hsk3off[i][3].includes('ér')){

        }
        else {
          tmp[i].simplified = tmp[i].simplified.replace('儿', '')
        }
        //debugger
      }
      else{
        console.error(tmp[i])
      }
    }
  }

  // GET ID SIMPLIFIED LEVEL

  for(i=0; i<tmp.length; i++){
    char = tmp[i].simplified

    char = char
    .replace(/[\|\|\∣].+/, '')
    .replace(/[\(\(].+[\)\)]/, '')
    .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
    // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
    // .replace(/(.+)儿$/, '$1')

    if(!dict.key.includes(char)){
      dict.key.push(char)
      dict.val.push({
        id: dict.val.length,
        si: char,
        le: 'new-' + tmp[i].level.slice(-1)
      })
    }
  }

  for(i=0; i<dict._hsk2.length; i++){
    char = dict._hsk2[i].simplified

    char = char
    .replace(/[\|\|\∣].+/, '')
    .replace(/[\(\(].+[\)\)]/, '')
    .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
    // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
    
    if(char.includes('儿')){
      if(!dict.key.includes(char)){
        char = char.replace(/(.+)儿$/, '$1')
      }
      if(!dict.key.includes(char)){
        console.warn(char)
      }
      
    }

    if(!dict.key.includes(char)){
      dict.key.push(char)
      dict.val.push({
        id: dict.val.length,
        si: char,
        le: 'old-' + dict._hsk2[i].level.slice(-1)
      })
    }
    else {
      if(!dict.get(char).le.includes('|')){
        dict.get(char).le += ' | old-' + dict._hsk2[i].level.slice(-1)
      }
    }
  }

  // GET TRADITIONAL

  for(i=0; i<dict.val.length; i++){
    dict.val[i].tr = get_si_tr(dict.val[i].si)
  }

  // GET PINYIN AND PART OF SPEECH HSK3
  for(i=0; i<dict._hsk3off.length; i++){
    char = dict._hsk3off[i][2]

    char = char
    .replace(/[\|\|\∣].+/, '')
    .replace(/[\(\(].+[\)\)]/, '')
    .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
    // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
    // .replace(/(.+)儿$/, '$1')
    
    entry = dict.get(char)
    if(!entry) entry = dict.get(char.replace('儿', ''))

    if(!entry.pi){
      entry.pi = dict._hsk3off[i][3]
      entry.po = dict._hsk3off[i][4]
    }
    else {
      entry.pi += ' | ' + dict._hsk3off[i][3]
      entry.po += ' | ' + dict._hsk3off[i][4]
    }
  }

  // CLEAN UP PINYIN

  tmp = dict.val
  for(i=0; i<tmp.length; i++){
    if(!tmp[i].pi) continue
    // debugger
    if(tmp[i].pi.match(/\∣[^ ]+/)){
      tmp[i].pi = tmp[i].pi.replace(/∣([^ ]+)/, '($1)')
    }
    else if(!tmp[i].pi.includes(' | ') && tmp[i].pi.match(/[^é]r$/)){
      tmp[i].pi = tmp[i].pi.slice(0, -1) + ' | ' + tmp[i].pi
    }
  }
  // GET ENGLISH HSK3

  tmp = dict._hsk3yar
  for(i=0; i<tmp.length; i++){
    char = tmp[i].simplified

    char = char
    .replace(/[\|\|\∣].+/, '')
    .replace(/[\(\(].+[\)\)]/, '')
    .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
    // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
    // .replace(/(.+)儿$/, '$1')
    
    entry = dict.get(char)
    if(!entry) entry = dict.get(char.replace('儿', ''))

    if(!entry.en){
      entry.en = tmp[i].definition_en
    }
    else {
      entry.en += ' | ' + tmp[i].definition_en
    }
  }

  // GET ENGLISH PINYIN POS HSK2

  tmp = dict._hsk2
  for(i=0; i<tmp.length; i++){
    char = tmp[i].simplified

    char = char
    .replace(/[\|\|\∣].+/, '')
    .replace(/[\(\(].+[\)\)]/, '')
    .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
    // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
    // .replace(/(.+)儿$/, '$1')
    
    entry = dict.get(char)
    if(!entry) entry = dict.get(char.replace('儿', ''))

    if(entry.le.includes('new')) continue

    entry.po = ''
    if(!entry.en){
      entry.en = tmp[i].definition_en
      entry.pi = tmp[i].pinyin
    }
    else {
      entry.en += ' | ' + tmp[i].definition_en
      entry.pi += ' | ' + tmp[i].pinyin
    }
  }

    // GET FRENCH HSK2

  tmp = dict._hsk2uni
  for(i=0; i<tmp.length; i++){
    let char2
    char = tmp[i].simplified

    char = char
    .replace(/[\|\|\∣].+/, '')
    .replace(/[\(\(].+[\)\)]/, '')
    .replaceAll(/[¹²∙…\|\(\)12\|\(\)\∣、]/g, '')
    // .replaceAll(/(.+?)[形名动介副量数连助代叹]+/g, '$1')
    // .replace(/(.+)儿$/, '$1')

    if(tmp[i].level.includes('C')) continue

    entry = dict.get(char)
    if(!entry) entry = dict.get(char.replace('儿', ''))

    if(!entry && tmp[i].level.length == 5 && tmp[i].level.startsWith('hsk-')){
      char2 = char.slice(2)
      char = char.slice(0, 2)
      tmp[i].definition_fr = tmp[i].definition_fr + ' (' + char + '……' + char2 + '……)'

      entry = dict.get(char2)
      if(!entry.fr){
        entry.fr = tmp[i].definition_fr
      }
      else {
        entry.fr += ' | ' + tmp[i].definition_fr
      }
      entry = dict.get(char)
    }

    if(!entry){
      // console.log(tmp[i].simplified, get_cc_def(tmp[i].simplified))
      dict.key.push(tmp[i].simplified)
      dict.val.push({
        en: get_cc_def(tmp[i].simplified),
        fr: tmp[i].definition_fr,
        id: dict.val.length,
        le: tmp[i].level.replace('A', '+').replace('B', '+').replace('hsk', 'old'),
        pi: tmp[i].pinyin,
        po: '',
        si: tmp[i].simplified,
        tr: get_si_tr(tmp[i].simplified),
      })
    }
    else if(!entry.fr){
      entry.fr = tmp[i].definition_fr
    }
    else {
      entry.fr += ' | ' + tmp[i].definition_fr
    }
  }

  // ADD EXAMPLE FR
  
  tmp = dict._hsk2uni
  for(i=0; i<tmp.length; i++){
    if(!tmp[i].example) continue
    entry = dict.get(tmp[i].simplified)
    if(!entry) entry = dict.get(tmp[i].simplified.replace('儿',''))
    entry.fr += '; ' + tmp[i].example
  }
  

  // ADD ALL FRENCH

  tmp = dict.val
  for(i=0; i<tmp.length; i++){
    if(tmp[i].fr) continue
    tmp[i].fr = get_cc_def(tmp[i].si, 'f')
    // console.log(tmp[i].si, get_cc_def(tmp[i].si, 'f'))
  }

  // ADD MISSING TRANSLATE EN

  tmp = dict.val
  for(i=0; i<tmp.length; i++){
    if(!tmp[i].en) tmp[i].en = get_cc_def(tmp[i].si)
    if(!tmp[i].en) tmp[i].en = dict._gtrans[tmp[i].si][1] + '<tr>'
    if(!tmp[i].fr) tmp[i].fr = dict._gtrans[tmp[i].si][0] + '<tr>'
  }
return
  // ADD ZH DEF

  tmp = dict.val
  for(i=0; i<tmp.length; i++){
    entry = dict._xiandai[tmp[i].si]
    entry ??= get_zdic_ci(tmp[i].si)
    entry ??= dict._zdic2[tmp[i].si]

    if(!entry) {
      // console.log(tmp[i].si)
      tmp[i].zh = ''
      continue
    }
    tmp[i].zh = entry
  }

  // ADD COLOCATION

  entry = []
  tmp = dict.val
  for(i=0; i<tmp.length; i++){
    tmp[i].co = dict._coloc[tmp[i].si]
    if(!tmp[i].co) entry.push(tmp[i].si)
  }
  window.discard = entry

  return

  // CHECK ENTRIES HYDCD

  tmp = dict.key
  entry = []
  for(i=0; 0 && i<tmp.length; i++){
    if(!dict._hydcd.includes(tmp[i]))
      entry.push(tmp[i])
  }
  dict.discard = entry

}

/** **/


<script>
function shapeSpell(txt){
  if(!txt) {
    return ''
  }

  let tmp, i, j, out
  try{
  tmp = cnchar.shapeSpell(txt, true)
  }
  catch(e){
    console.warn(txt)
    return ''
  }
  tmp = tmp.replace(/^\W+/, '')

  for(i=1; i<tmp.length; i++){
    if(!cnchar.dict.spell[tmp.slice(0, i+1)]) {
      if(!cnchar.dict.spell[tmp.slice(0, i+2)]) {
        if(!cnchar.dict.spell[tmp.slice(0, i+3)]) {
          break
        }
      }
    }
  }

  if(tmp[i-1].match(/[^AEIOUaeiou0-9]/) && tmp[i].match(/[AEIOUaeiou0-9\u0080-\u0F00]/) && i+1 != tmp.length){
    if(cnchar.dict.spell[tmp.slice(0, i-1)]) i--
  }

  j = tmp.slice(0, i) + tmp.slice(-1)
  if(j.length == 2) {
    console.warn(j)
    return ''
  }
  out = j
  out += shapeSpell(tmp.slice(i, -1))
  return out
}
</script>

/** **/

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="daisy.css">
  <link rel="stylesheet" href="daisy-search.css">
  <link rel="stylesheet" href="prism-material-dark.css">
  <script>
window.addEventListener('load', start)

function start(){
  let elms, node
  while(elms = document.querySelectorAll('section')){
    if(!elms.length) break
    elms.forEach(elm=>{
      node = document.querySelector('template#' + elm.dataset.template)
      elm.replaceWith(node.content.cloneNode(true))
      
    })
  }

  if(typeof start2 == 'function') start2()
}
  </script>

  <script src="script/main.js"></script>
</head>

<body>

<section data-template="drawer"></section>

<template id="drawer">
  <div class="bg-base-100 drawer lg:drawer-open">
    <input id="drawer" type="checkbox" class="drawer-toggle">
    <div class="drawer-content">
    
      <section data-template="drawer-head"></section>
      <section data-template="drawer-content"></section>
      
    </div>
    <div class="drawer-side z-40" style="scroll-behavior: smooth; scroll-padding-top: 5rem;">
      <label for="drawer" class="drawer-overlay" aria-label="Close menu"></label>

      <section data-template="drawer-aside"></section>

    </div>
  </div>
</template>

<template id="drawer-aside">
  <aside class="bg-base-100 min-h-screen w-80">
    <section data-template="drawer-aside-head"></section>
    <section data-template="drawer-aside-search"></section>
    <div class="h-4"></div>
    <section data-template="drawer-aside-list"></section>
    <section data-template="drawer-aside-foot"></section>
  </aside>
</template>

<template id="drawer-aside-head">
  <div class="bg-base-100 sticky top-0 z-20 hidden items-center gap-2 bg-opacity-90 px-4 py-2 backdrop-blur lg:flex ">
    <a href="/" aria-current="page" aria-label="Homepage" class="flex-0 btn btn-ghost px-2" > 
      <!--
      <svg width="32" height="32" viewBox="0 0 415 415" xmlns="http://www.w3.org/2000/svg">
      </svg>
      -->
      <div class="font-title inline-flex text-lg md:text-2xl">
        mcyk
      </div>
    </a>
    <div class="dropdown">
      <div tabindex="0" role="button" class="link link-hover inline-block font-mono text-xs">4.6.0</div>
      <ul tabindex="0" class="dropdown-content menu menu-sm bg-base-200 rounded-box mt-7 w-36 border border-white/5 p-2 shadow-2xl outline outline-1 outline-black/5">
        <li>
          <a href="/docs/changelog/">
            <!--
            <svg width="14" height="14" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
            </svg>
            -->
            Changelog
          </a>
        </li>
        <li></li>
        <li><a target="_blank" rel="noopener, noreferrer" href="https://v3.daisyui.com/">Version 3.x</a></li>
        <li><a target="_blank" rel="noopener, noreferrer" href="https://v2.daisyui.com/">Version 2.x</a></li>
        <li><a target="_blank" rel="noopener, noreferrer" href="https://v1.daisyui.com/">Version 1.x</a></li>
      </ul>
    </div>
   </div>
</template>

<template id="drawer-aside-search">
  <div class="bg-base-100 grid-row-2 sticky top-0 z-10 grid w-full gap-y-2 bg-opacity-90 px-2 py-3 backdrop-blur lg:hidden">
    <div class="flex w-full">
      <label class="searchbox relative mx-3 w-full">
        <svg class="pointer-events-none absolute z-10 my-3.5 ms-4 stroke-current opacity-60 text-base-content" width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
        </svg>
        <!--
        <div data-svelte-typeahead="" role="combobox" aria-haspopup="listbox" aria-controls="typeahead-0.40hpcrf0o6m-listbox" aria-expanded="true" id="typeahead-0.40hpcrf0o6m-typeahead" class="svelte-4tg1b1 dropdown">
        -->
        <div data-svelte-typeahead="" role="combobox" aria-haspopup="listbox" aria-controls="typeahead-0.40hpcrf0o6m-listbox" aria-expanded="false" id="typeahead-0.40hpcrf0o6m-typeahead" class="svelte-4tg1b1">
          <form data-svelte-search="">
            <!--
            <label id="typeahead-0.40hpcrf0o6m-label" for="typeahead-0.40hpcrf0o6m" class="svelte-wqugyy">Search</label>
            -->
            <input name="search" type="search" placeholder="Search…" autocomplete="off" spellcheck="false" aria-autocomplete="list" aria-controls="typeahead-0.40hpcrf0o6m-listbox" aria-labelledby="typeahead-0.40hpcrf0o6m-label" id="typeahead-0.40hpcrf0o6m" class="svelte-wqugyy">
          </form>
          <!--
          <ul role="listbox" aria-labelledby="typeahead-0.40hpcrf0o6m-label" id="typeahead-0.40hpcrf0o6m-listbox" class="svelte-4tg1b1 svelte-typeahead-list">
            <li role="option" id="typeahead-0.wie33agxj5-result-1" aria-selected="false" class="svelte-4tg1b1"><div class="py-1 text-sm font-normal">Install</div> </li>
          </ul>
          -->

        </div>
        
        <!--
        <div class="pointer-events-none absolute end-10 top-2.5 gap-1 opacity-50 rtl:flex-row-reverse hidden lg:flex">
          <kbd class="kbd kbd-sm"></kbd>
          <kbd class="kbd kbd-sm">K</kbd>
        </div>
        -->
        
      </label>
    </div>
  </div>
</template>

<template id="drawer-aside-list">
  <ul class="menu px-4 py-0">
    <li><a>Sidebar Item 1</a></li>
    <li><a>Sidebar Item 2</a></li>
    <li></li>
    <li> <a href="/store/"><span>Store</span> <span class="badge badge-sm font-mono badge-primary">new</span> </a></li>
    <li>
      <details id="disclosure-docs" open>
        <summary class="group"><span><svg width="18" height="18" viewBox="0 0 48 48" class="text-orange-400 h-5 w-5" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path d="M5 7H16C20.4183 7 24 10.5817 24 15V42C24 38.6863 21.3137 36 18 36H5V7Z" fill="none" stroke="currentColor" stroke-width="4" stroke-linejoin="bevel" />
              <path d="M43 7H32C27.5817 7 24 10.5817 24 15V42C24 38.6863 26.6863 36 30 36H43V7Z" fill="none" stroke="currentColor" stroke-width="4" stroke-linejoin="bevel" />
            </svg></span> Docs</summary>
        <ul>
          <li> <a href="/docs/use/" class="group   "> <span>Use</span> </a></li>
          <li> <a href="/docs/customize/" class="group   "> <span>Customize components</span> </a></li>
          <li> <a href="/docs/config/" class="group   "> <span>Config</span> <span class="badge badge-sm font-mono null">updated</span> </a></li>
          <li>
            <h2 class="menu-title flex items-center gap-4 px-1.5"><span class="text-base-content"><svg width="18" height="18" viewBox="0 0 48 48" fill="none" stroke="currentColor" class="w-5 h-5" xmlns="http://www.w3.org/2000/svg">
                  <path d="M24 4V12" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
                  <path fill-rule="evenodd" clip-rule="evenodd" d="M22 22L42 26L36 30L42 36L36 42L30 36L26 42L22 22Z" fill="none" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
                  <path d="M38.1421 9.85789L32.4853 15.5147" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
                  <path d="M9.85787 38.1421L15.5147 32.4853" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
                  <path d="M4 24H12" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
                  <path d="M9.85795 9.85787L15.5148 15.5147" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
                </svg></span> Actions</h2>
            <ul>
              <li> <a href="/components/button/" class="group active  active "> <span>Button</span> </a></li>
              <li> <a href="/components/dropdown/" class="group    "> <span>Dropdown</span> </a></li>
            </ul>
          </li>
        </ul>
      </details>
    </li>
    <li></li>
    <li>
      <a href="https://opencollective.com/daisyui" target="_blank" rel="noopener noreferrer" class="group    ">
        <span class>
          <svg width="18" class="h-5 w-5" height="18" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M15 8C8.92487 8 4 12.9249 4 19C4 30 17 40 24 42.3262C31 40 44 30 44 19C44 12.9249 39.0751 8 33 8C29.2797 8 25.9907 9.8469 24 12.6738C22.0093 9.8469 18.7203 8 15 8Z" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel" />
          </svg>
        </span>
        <span>Support daisyUI</span>
        <svg width="12" height="12" class="opacity-0 transition-opacity duration-300 ease-out group-hover:opacity-100" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path d="M19 11H37V29" stroke="currentColor" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel"></path>
          <path d="M11.5439 36.4559L36.9997 11" stroke="currentColor" stroke-width="4" stroke-linecap="butt" stroke-linejoin="bevel"></path>
        </svg>
      </a>
    </li>
  </ul>
</template>

<template id="drawer-aside-foot">
  <div class="bg-base-100 pointer-events-none sticky bottom-0 flex h-40 [mask-image:linear-gradient(transparent,#000000)]"></div>
</template>

<template id="drawer-head">
  <div class="
bg-base-100 text-base-content sticky top-0 z-30 flex h-16 w-full justify-center bg-opacity-90 backdrop-blur transition-shadow duration-100 [transform:translate3d(0,0,0)] 

">
    <nav class="navbar w-full">
      <section data-template="drawer-head-1"></section>
      <section data-template="drawer-head-2"></section>
    </nav>
  </div>
</template>

<template id="drawer-head-1">
  <div class="flex flex-1 md:gap-1 lg:gap-2">

    <span class="tooltip tooltip-bottom before:text-xs before:content-[attr(data-tip)]" >
      <label aria-label="Open menu" for="drawer" class="btn btn-square btn-ghost drawer-button lg:hidden ">
        <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="inline-block h-5 w-5 stroke-current md:h-6 md:w-6">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
        </svg>
      </label>
    </span>


  <div class="flex items-center gap-2 lg:hidden">
    <a  aria-current="page" aria-label="daisyUI" class="flex-0 btn btn-ghost gap-1 px-2 md:gap-2" >
      <!--
      <svg class="h-6 w-6 md:h-8 md:w-8" width="32" height="32" viewBox="0 0 415 415" xmlns="http://www.w3.org/2000/svg">
      </svg>
      -->
    <span class="font-title text-base-content text-lg md:text-2xl">mcyk</span></a>

    <div class="dropdown">
      Dropdown...
    </div>
  </div>

  <div class="hidden w-full max-w-sm lg:flex">
    <label class="searchbox relative mx-3 w-full">
      Search...
    </label>
  </div>

  </div>
</template>

<template id="drawer-head-2">
  <div class="flex-0">

    <div class="hidden flex-none items-center lg:block"><a href="/components/" class="btn btn-ghost drawer-button font-normal">Components</a></div>

    <div class="btn btn-ghost cursor-wait" >
      <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="h-5 w-5 stroke-current md:hidden">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"></path>
      </svg>
      <span class="hidden font-normal md:inline">Theme</span>
      <svg width="12px" height="12px" class="hidden h-2 w-2 fill-current opacity-60 sm:inline-block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
        <path d="M1799 349l242 241-1017 1017L7 590l242-241 775 775 775-775z"></path>
      </svg>
    </div>

    <div title="Change Theme" class="dropdown dropdown-end hidden [@supports(color:oklch(0%_0_0))]:block ">
      <div tabindex="0" role="button" class="btn btn-ghost">
        <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="h-5 w-5 stroke-current md:hidden">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"></path>
        </svg>
        <span class="hidden font-normal md:inline">Theme</span>
        <svg width="12px" height="12px" class="hidden h-2 w-2 fill-current opacity-60 sm:inline-block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
          <path d="M1799 349l242 241-1017 1017L7 590l242-241 775 775 775-775z"></path>
        </svg>
      </div>
      <div tabindex="0" class="dropdown-content bg-base-200 text-base-content rounded-box top-px h-[28.6rem] max-h-[calc(100vh-10rem)] w-56 overflow-y-auto border border-white/5 shadow-2xl outline outline-1 outline-black/5 mt-16">
        <div class="grid grid-cols-1 gap-3 p-3">
          <button class="outline-base-content text-start outline-offset-4 [&amp;_svg]:visible" data-set-theme="light" data-act-class="[&amp;_svg]:visible"><span data-theme="light" class="bg-base-100 rounded-btn text-base-content block w-full cursor-pointer font-sans"><span class="grid grid-cols-5 grid-rows-3"><span class="col-span-5 row-span-3 row-start-1 flex items-center gap-2 px-4 py-3"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" class="invisible h-3 w-3 shrink-0">
                    <path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"></path>
                  </svg> <span class="flex-grow text-sm">light</span> <span class="flex h-full shrink-0 flex-wrap gap-1"><span class="bg-primary rounded-badge w-2"></span> <span class="bg-secondary rounded-badge w-2"></span> <span class="bg-accent rounded-badge w-2"></span> <span class="bg-neutral rounded-badge w-2"></span></span></span></span></span></button>
          <button class="outline-base-content text-start outline-offset-4" data-set-theme="dark" data-act-class="[&amp;_svg]:visible"><span data-theme="dark" class="bg-base-100 rounded-btn text-base-content block w-full cursor-pointer font-sans"><span class="grid grid-cols-5 grid-rows-3"><span class="col-span-5 row-span-3 row-start-1 flex items-center gap-2 px-4 py-3"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" class="invisible h-3 w-3 shrink-0">
                    <path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"></path>
                  </svg> <span class="flex-grow text-sm">dark</span> <span class="flex h-full shrink-0 flex-wrap gap-1"><span class="bg-primary rounded-badge w-2"></span> <span class="bg-secondary rounded-badge w-2"></span> <span class="bg-accent rounded-badge w-2"></span> <span class="bg-neutral rounded-badge w-2"></span></span></span></span></span></button>

          <a class="outline-base-content overflow-hidden rounded-lg" href="/theme-generator/">
            <div class="hover:bg-neutral hover:text-neutral-content w-full cursor-pointer font-sans">
              <div class="flex gap-2 p-3">
                <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 fill-current" viewBox="0 0 512 512">
                </svg>
                <div class="flex-grow text-sm font-bold">Make your theme!</div>
              </div>
            </div>
          </a>
        </div>
      </div>
    </div>

    <div title="Change Language" class="dropdown dropdown-end">
      <div tabindex="0" role="button" class="btn btn-ghost" aria-label="Language"><svg class="h-5 w-5 fill-current" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 512 512">
          <path d="M363,176,246,464h47.24l24.49-58h90.54l24.49,58H480ZM336.31,362,363,279.85,389.69,362Z"></path>
          <path d="M272,320c-.25-.19-20.59-15.77-45.42-42.67,39.58-53.64,62-114.61,71.15-143.33H352V90H214V48H170V90H32v44H251.25c-9.52,26.95-27.05,69.5-53.79,108.36-32.68-43.44-47.14-75.88-47.33-76.22L143,152l-38,22,6.87,13.86c.89,1.56,17.19,37.9,54.71,86.57.92,1.21,1.85,2.39,2.78,3.57-49.72,56.86-89.15,79.09-89.66,79.47L64,368l23,36,19.3-11.47c2.2-1.67,41.33-24,92-80.78,24.52,26.28,43.22,40.83,44.3,41.67L255,362Z"></path>
        </svg> <svg width="12px" height="12px" class="hidden h-2 w-2 fill-current opacity-60 sm:inline-block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
          <path d="M1799 349l242 241-1017 1017L7 590l242-241 775 775 775-775z"></path>
        </svg></div>
      <div tabindex="0" class="dropdown-content bg-base-200 text-base-content rounded-box top-px mt-16 max-h-[calc(100vh-10rem)] w-56 overflow-y-auto border border-white/5 shadow-2xl outline outline-1 outline-black/5">
        <ul class="menu menu-sm gap-1">
          <li><button><span class="badge badge-sm badge-outline !pl-1.5 !pr-1 pt-px font-mono !text-[.6rem] font-bold tracking-widest opacity-50">AR</span> <span class="font-[sans-serif]">عربي</span> </button> </li>
          <li><button><span class="badge badge-sm badge-outline !pl-1.5 !pr-1 pt-px font-mono !text-[.6rem] font-bold tracking-widest opacity-50">DE</span> <span class="font-[sans-serif]">Deutsch</span> </button> </li>
        </ul>
      </div>
    </div>

  </div>
</template>


<template id="drawer-content">
  <div class="max-w-[100vw] px-6 pb-16 xl:pr-2">
    <!--<div class="flex flex-col-reverse justify-between gap-6 xl:flex-row">-->
    <div class="flex flex-col-reverse justify-center gap-6 xl:flex-row">
      <div class="prose prose-sm md:prose-base w-full max-w-4xl flex-grow pt-10">
        <section data-template="content-main"></section>
      </div>
    </div>
  </div>

  <section data-template="content-end"></section>
</template>

<template id="content-main">
  <h1>Button</h1>

<!-- The button to open modal -->
<label for="dict_options" class="btn">open modal</label>

<h3>Vocabulary</h3>
  
<table class="table-xs md:table-sm table-pin-rows table w-full" id="dict_table">
  <thead>
  </thead>
  <tbody>
    <!--
    <tr>
      <td>
        <span>大家好</span><span>【大家好】</span>&#12288;<span>da jia hao</span><br>
        <span>n.</span>&#12288;<span>Hello world, how are you</span><br>
        <span>example</span><br>
        <span>#1</span>&#12288;<span>hsk-2</span>
      </td>
    </tr>
    -->
  </tbody>
</table>

</template>

<template id="content-end">
  <!-- Put this part before </body> tag -->
  <input type="checkbox" id="dict_options" class="modal-toggle" />
  <div class="modal" role="dialog" id="dict_options_modal">
    <div class="modal-box">
      <!--
      <h3 class="text-lg font-bold">Hello!</h3>
      <p class="py-4">This modal works with a hidden checkbox!</p>
      <button class="btn btn-outline btn-accent btn-xs sm:btn-sm">Accent</button>
      -->
    </div>
    <label class="modal-backdrop" for="dict_options">Close</label>
  </div>

</template>

</body>

</html>