koishi-plugin-cchess 0.0.2

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.
Files changed (407) hide show
  1. package/lib/assets/wasm/EngineHelperWorker.js +16 -0
  2. package/lib/assets/wasm/data/pikafish.data +0 -0
  3. package/lib/assets/wasm/pikafish.js +5253 -0
  4. package/lib/assets/wasm/pikafish.wasm +0 -0
  5. package/lib/assets/wasm/pikafish.worker.js +154 -0
  6. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/ba.webp +0 -0
  7. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/bb.webp +0 -0
  8. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/bc.webp +0 -0
  9. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/bk.webp +0 -0
  10. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/bn.webp +0 -0
  11. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/bp.webp +0 -0
  12. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/br.webp +0 -0
  13. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wa.webp +0 -0
  14. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wb.webp +0 -0
  15. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wc.webp +0 -0
  16. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wk.webp +0 -0
  17. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wn.webp +0 -0
  18. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wp.webp +0 -0
  19. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/345/255/220/wr.webp +0 -0
  20. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/ba.webp +0 -0
  21. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/bb.webp +0 -0
  22. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/bc.webp +0 -0
  23. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/bk.webp +0 -0
  24. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/bn.webp +0 -0
  25. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/bp.webp +0 -0
  26. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/br.webp +0 -0
  27. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wa.webp +0 -0
  28. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wb.webp +0 -0
  29. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wc.webp +0 -0
  30. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wk.webp +0 -0
  31. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wn.webp +0 -0
  32. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wp.webp +0 -0
  33. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//345/210/230/347/202/263/346/243/256/347/272/242/351/273/221/347/211/233/350/247/222/351/232/266/344/271/246/346/243/213/345/255/220/wr.webp +0 -0
  34. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/ba.webp +0 -0
  35. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/bb.webp +0 -0
  36. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/bc.webp +0 -0
  37. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/bk.webp +0 -0
  38. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/bn.webp +0 -0
  39. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/bp.webp +0 -0
  40. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/br.webp +0 -0
  41. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wa.webp +0 -0
  42. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wb.webp +0 -0
  43. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wc.webp +0 -0
  44. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wk.webp +0 -0
  45. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wn.webp +0 -0
  46. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wp.webp +0 -0
  47. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/345/255/220/wr.webp +0 -0
  48. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/ba.webp +0 -0
  49. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/bb.webp +0 -0
  50. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/bc.webp +0 -0
  51. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/bk.webp +0 -0
  52. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/bn.webp +0 -0
  53. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/bp.webp +0 -0
  54. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/br.webp +0 -0
  55. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wa.webp +0 -0
  56. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wb.webp +0 -0
  57. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wc.webp +0 -0
  58. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wk.webp +0 -0
  59. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wn.webp +0 -0
  60. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wp.webp +0 -0
  61. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/346/243/213/345/255/220/wr.webp +0 -0
  62. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/ba.webp +0 -0
  63. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/bb.webp +0 -0
  64. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/bc.webp +0 -0
  65. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/bk.webp +0 -0
  66. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/bn.webp +0 -0
  67. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/bp.webp +0 -0
  68. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/br.webp +0 -0
  69. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wa.webp +0 -0
  70. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wb.webp +0 -0
  71. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wc.webp +0 -0
  72. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wk.webp +0 -0
  73. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wn.webp +0 -0
  74. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wp.webp +0 -0
  75. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/345/255/220/wr.webp +0 -0
  76. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/ba.webp +0 -0
  77. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/bb.webp +0 -0
  78. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/bc.webp +0 -0
  79. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/bk.webp +0 -0
  80. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/bn.webp +0 -0
  81. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/bp.webp +0 -0
  82. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/br.webp +0 -0
  83. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wa.webp +0 -0
  84. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wb.webp +0 -0
  85. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wc.webp +0 -0
  86. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wk.webp +0 -0
  87. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wn.webp +0 -0
  88. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wp.webp +0 -0
  89. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/345/255/220/wr.webp +0 -0
  90. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/ba.webp +0 -0
  91. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/bb.webp +0 -0
  92. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/bc.webp +0 -0
  93. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/bk.webp +0 -0
  94. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/bn.webp +0 -0
  95. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/bp.webp +0 -0
  96. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/br.webp +0 -0
  97. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wa.webp +0 -0
  98. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wb.webp +0 -0
  99. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wc.webp +0 -0
  100. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wk.webp +0 -0
  101. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wn.webp +0 -0
  102. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wp.webp +0 -0
  103. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/255/243/346/243/213/345/255/220/wr.webp +0 -0
  104. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/ba.webp +0 -0
  105. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/bb.webp +0 -0
  106. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/bc.webp +0 -0
  107. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/bk.webp +0 -0
  108. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/bn.webp +0 -0
  109. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/bp.webp +0 -0
  110. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/br.webp +0 -0
  111. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wa.webp +0 -0
  112. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wb.webp +0 -0
  113. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wc.webp +0 -0
  114. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wk.webp +0 -0
  115. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wn.webp +0 -0
  116. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wp.webp +0 -0
  117. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/243/213/350/200/205/350/261/241/346/243/213/346/243/213/345/255/220/wr.webp +0 -0
  118. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/ba.webp +0 -0
  119. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bb.webp +0 -0
  120. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bc.webp +0 -0
  121. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bk.webp +0 -0
  122. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bn.webp +0 -0
  123. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bp.webp +0 -0
  124. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/br.webp +0 -0
  125. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wa.webp +0 -0
  126. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wb.webp +0 -0
  127. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wc.webp +0 -0
  128. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wk.webp +0 -0
  129. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wn.webp +0 -0
  130. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wp.webp +0 -0
  131. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/245/267/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wr.webp +0 -0
  132. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/ba.webp +0 -0
  133. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/bb.webp +0 -0
  134. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/bc.webp +0 -0
  135. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/bk.webp +0 -0
  136. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/bn.webp +0 -0
  137. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/bp.webp +0 -0
  138. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/br.webp +0 -0
  139. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wa.webp +0 -0
  140. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wb.webp +0 -0
  141. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wc.webp +0 -0
  142. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wk.webp +0 -0
  143. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wn.webp +0 -0
  144. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wp.webp +0 -0
  145. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/345/255/220/wr.webp +0 -0
  146. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/ba.webp +0 -0
  147. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/bb.webp +0 -0
  148. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/bc.webp +0 -0
  149. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/bk.webp +0 -0
  150. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/bn.webp +0 -0
  151. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/bp.webp +0 -0
  152. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/br.webp +0 -0
  153. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wa.webp +0 -0
  154. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wb.webp +0 -0
  155. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wc.webp +0 -0
  156. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wk.webp +0 -0
  157. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wn.webp +0 -0
  158. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wp.webp +0 -0
  159. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/211/233/347/232/256/347/272/270/345/215/216/345/272/267/351/207/221/346/226/207/346/243/213/345/255/220/wr.webp +0 -0
  160. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/ba.webp +0 -0
  161. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/bb.webp +0 -0
  162. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/bc.webp +0 -0
  163. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/bk.webp +0 -0
  164. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/bn.webp +0 -0
  165. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/bp.webp +0 -0
  166. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/br.webp +0 -0
  167. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wa.webp +0 -0
  168. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wb.webp +0 -0
  169. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wc.webp +0 -0
  170. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wk.webp +0 -0
  171. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wn.webp +0 -0
  172. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wp.webp +0 -0
  173. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/345/255/220/wr.webp +0 -0
  174. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/ba.webp +0 -0
  175. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/bb.webp +0 -0
  176. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/bc.webp +0 -0
  177. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/bk.webp +0 -0
  178. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/bn.webp +0 -0
  179. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/bp.webp +0 -0
  180. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/br.webp +0 -0
  181. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wa.webp +0 -0
  182. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wb.webp +0 -0
  183. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wc.webp +0 -0
  184. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wk.webp +0 -0
  185. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wn.webp +0 -0
  186. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wp.webp +0 -0
  187. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/350/223/235/347/245/245/351/232/266/346/243/213/345/255/220/wr.webp +0 -0
  188. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/ba.webp +0 -0
  189. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/bb.webp +0 -0
  190. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/bc.webp +0 -0
  191. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/bk.webp +0 -0
  192. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/bn.webp +0 -0
  193. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/bp.webp +0 -0
  194. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/br.webp +0 -0
  195. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wa.webp +0 -0
  196. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wb.webp +0 -0
  197. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wc.webp +0 -0
  198. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wk.webp +0 -0
  199. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wn.webp +0 -0
  200. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wp.webp +0 -0
  201. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/227/240/351/230/264/345/275/261/346/243/213/345/255/220/wr.webp +0 -0
  202. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/ba.webp +0 -0
  203. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/bb.webp +0 -0
  204. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/bc.webp +0 -0
  205. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/bk.webp +0 -0
  206. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/bn.webp +0 -0
  207. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/bp.webp +0 -0
  208. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/br.webp +0 -0
  209. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wa.webp +0 -0
  210. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wb.webp +0 -0
  211. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wc.webp +0 -0
  212. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wk.webp +0 -0
  213. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wn.webp +0 -0
  214. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wp.webp +0 -0
  215. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//347/272/242/351/273/221/347/262/276/345/205/270/346/243/213/345/255/220/wr.webp +0 -0
  216. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/ba.webp +0 -0
  217. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bb.webp +0 -0
  218. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bc.webp +0 -0
  219. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bk.webp +0 -0
  220. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bn.webp +0 -0
  221. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/bp.webp +0 -0
  222. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/br.webp +0 -0
  223. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wa.webp +0 -0
  224. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wb.webp +0 -0
  225. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wc.webp +0 -0
  226. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wk.webp +0 -0
  227. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wn.webp +0 -0
  228. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wp.webp +0 -0
  229. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/241/214/344/271/246/347/216/211/347/237/263/346/243/213/345/255/220/wr.webp +0 -0
  230. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/ba.webp +0 -0
  231. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/bb.webp +0 -0
  232. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/bc.webp +0 -0
  233. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/bk.webp +0 -0
  234. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/bn.webp +0 -0
  235. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/bp.webp +0 -0
  236. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/br.webp +0 -0
  237. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wa.webp +0 -0
  238. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wb.webp +0 -0
  239. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wc.webp +0 -0
  240. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wk.webp +0 -0
  241. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wn.webp +0 -0
  242. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wp.webp +0 -0
  243. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//350/261/241/347/224/262/346/243/213/345/255/220/wr.webp +0 -0
  244. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/ba.webp +0 -0
  245. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/bb.webp +0 -0
  246. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/bc.webp +0 -0
  247. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/bk.webp +0 -0
  248. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/bn.webp +0 -0
  249. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/bp.webp +0 -0
  250. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/br.webp +0 -0
  251. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/ra.webp +0 -0
  252. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/rb.webp +0 -0
  253. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/rc.webp +0 -0
  254. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/rk.webp +0 -0
  255. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/rn.webp +0 -0
  256. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/rp.webp +0 -0
  257. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/rr.webp +0 -0
  258. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wa.webp +0 -0
  259. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wb.webp +0 -0
  260. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wc.webp +0 -0
  261. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wk.webp +0 -0
  262. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wn.webp +0 -0
  263. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wp.webp +0 -0
  264. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/207/221/345/261/236/346/243/213/345/255/220/347/257/206/344/275/223/346/243/213/345/255/220/wr.webp +0 -0
  265. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/ba.webp +0 -0
  266. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/bb.webp +0 -0
  267. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/bc.webp +0 -0
  268. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/bk.webp +0 -0
  269. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/bn.webp +0 -0
  270. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/bp.webp +0 -0
  271. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/br.webp +0 -0
  272. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wa.webp +0 -0
  273. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wb.webp +0 -0
  274. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wc.webp +0 -0
  275. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wk.webp +0 -0
  276. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wn.webp +0 -0
  277. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wp.webp +0 -0
  278. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/223/266/347/201/260/345/260/206/345/206/233/344/275/223/346/243/213/345/255/220/wr.webp +0 -0
  279. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/ba.webp +0 -0
  280. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/bb.webp +0 -0
  281. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/bc.webp +0 -0
  282. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/bk.webp +0 -0
  283. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/bn.webp +0 -0
  284. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/bp.webp +0 -0
  285. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/br.webp +0 -0
  286. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wa.webp +0 -0
  287. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wb.webp +0 -0
  288. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wc.webp +0 -0
  289. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wk.webp +0 -0
  290. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wn.webp +0 -0
  291. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wp.webp +0 -0
  292. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/225/214/345/210/273/345/215/216/345/275/251/346/243/213/345/255/220/wr.webp +0 -0
  293. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/ba.webp +0 -0
  294. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/bb.webp +0 -0
  295. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/bc.webp +0 -0
  296. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/bk.webp +0 -0
  297. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/bn.webp +0 -0
  298. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/bp.webp +0 -0
  299. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/br.webp +0 -0
  300. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wa.webp +0 -0
  301. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wb.webp +0 -0
  302. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wc.webp +0 -0
  303. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wk.webp +0 -0
  304. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wn.webp +0 -0
  305. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wp.webp +0 -0
  306. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/345/255/220/wr.webp +0 -0
  307. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/ba.webp +0 -0
  308. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/bb.webp +0 -0
  309. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/bc.webp +0 -0
  310. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/bk.webp +0 -0
  311. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/bn.webp +0 -0
  312. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/bp.webp +0 -0
  313. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/br.webp +0 -0
  314. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wa.webp +0 -0
  315. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wb.webp +0 -0
  316. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wc.webp +0 -0
  317. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wk.webp +0 -0
  318. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wn.webp +0 -0
  319. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wp.webp +0 -0
  320. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/345/255/220/wr.webp +0 -0
  321. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/ba.webp +0 -0
  322. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/bb.webp +0 -0
  323. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/bc.webp +0 -0
  324. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/bk.webp +0 -0
  325. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/bn.webp +0 -0
  326. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/bp.webp +0 -0
  327. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/br.webp +0 -0
  328. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wa.webp +0 -0
  329. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wb.webp +0 -0
  330. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wc.webp +0 -0
  331. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wk.webp +0 -0
  332. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wn.webp +0 -0
  333. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wp.webp +0 -0
  334. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/345/255/220/wr.webp +0 -0
  335. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/ba.webp +0 -0
  336. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/bb.webp +0 -0
  337. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/bc.webp +0 -0
  338. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/bk.webp +0 -0
  339. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/bn.webp +0 -0
  340. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/bp.webp +0 -0
  341. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/br.webp +0 -0
  342. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wa.webp +0 -0
  343. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wb.webp +0 -0
  344. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wc.webp +0 -0
  345. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wk.webp +0 -0
  346. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wn.webp +0 -0
  347. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wp.webp +0 -0
  348. package/lib/assets//346/243/213/345/255/220/347/232/256/350/202/244//351/276/231/350/205/276/345/233/233/346/265/267/346/243/213/345/255/220/wr.webp +0 -0
  349. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//344/270/200/351/270/243/346/203/212/344/272/272/346/243/213/347/233/230.webp +0 -0
  350. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//344/270/211/346/230/237/345/240/206/346/243/213/347/233/230.webp +0 -0
  351. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//344/272/221/345/272/223/346/234/250/345/210/266/346/243/213/347/233/230.webp +0 -0
  352. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//344/272/221/345/277/203/351/271/244/347/234/274/346/243/213/347/233/230.webp +0 -0
  353. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/205/260/344/272/255/351/233/206/345/272/217/346/227/240/345/255/227/346/243/213/347/233/230.webp +0 -0
  354. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/205/260/344/272/255/351/233/206/345/272/217/346/243/213/347/233/230.webp +0 -0
  355. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/207/244/350/210/236/344/271/235/345/244/251/346/243/213/347/233/230.webp +0 -0
  356. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/215/257/345/205/224/346/267/273/347/246/217/346/243/213/347/233/230.webp +0 -0
  357. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/217/261/345/222/244/351/243/216/344/272/221/346/243/213/347/233/230.webp +0 -0
  358. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/220/233/344/270/264/345/244/251/344/270/213/346/243/213/347/233/230.webp +0 -0
  359. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/243/201/347/224/273/345/217/244/346/242/246/346/243/213/347/233/230.webp +0 -0
  360. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/244/226/346/241/206.png +0 -0
  361. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/244/247/351/227/271/345/244/251/345/256/253/346/243/213/347/233/230.webp +0 -0
  362. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/244/251/345/261/261/345/205/261/350/211/262/346/243/213/347/233/230.webp +0 -0
  363. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/245/263/347/245/236/344/271/213/347/272/246/346/243/213/347/233/230.webp +0 -0
  364. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/260/217/345/220/225/351/243/236/345/210/200/346/243/213/347/233/230.webp +0 -0
  365. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//345/261/261/346/265/267/347/273/230/345/215/267/346/243/213/347/233/230.webp +0 -0
  366. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/212/244/347/234/274/347/273/277/346/243/213/347/233/230.webp +0 -0
  367. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/230/237/346/262/263/347/222/200/347/222/250/346/243/213/347/233/230.webp +0 -0
  368. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/234/250/345/210/266/346/243/213/347/233/230.webp +0 -0
  369. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/347/231/275/346/243/213/347/233/230.webp +0 -0
  370. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/234/254/347/272/271/351/232/266/344/271/246/351/273/221/346/243/213/347/233/230.webp +0 -0
  371. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/241/203/350/212/261/346/272/220/350/256/260/346/243/213/347/233/230.webp +0 -0
  372. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/347/233/230.png +0 -0
  373. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/243/213/345/244/251/345/244/247/345/234/243/346/243/213/347/233/230.webp +0 -0
  374. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/243/213/345/244/251/346/227/240/345/244/247/345/234/243/346/243/213/347/233/230.png +0 -0
  375. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/243/213/345/244/251/346/227/240/345/244/247/345/234/243/346/243/213/347/233/230.webp +0 -0
  376. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/243/213/345/274/210/346/227/240/351/231/220/347/272/242/347/273/277/346/243/213/347/233/230.webp +0 -0
  377. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/255/246/344/276/240/346/261/237/346/271/226/346/243/213/347/233/230.webp +0 -0
  378. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/260/264/345/242/250/351/235/222/347/223/267/346/243/213/347/233/230.webp +0 -0
  379. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/270/205/346/202/240/350/214/266/351/201/223/346/243/213/347/233/230.webp +0 -0
  380. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//346/270/270/345/233/255/346/203/212/346/242/246/346/243/213/347/233/230.webp +0 -0
  381. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/211/233/350/275/254/344/271/276/345/235/244/346/243/213/347/233/230.webp +0 -0
  382. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/216/211/347/237/263/345/244/252/346/236/201/346/243/213/347/233/230.webp +0 -0
  383. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/232/223/346/234/210/346/227/240/347/227/225/346/243/213/347/233/230.webp +0 -0
  384. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/232/256/345/215/241/351/261/274/346/243/213/347/233/230.webp +0 -0
  385. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/233/262/346/243/213/347/245/236/350/277/271/346/243/213/347/233/230.webp +0 -0
  386. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/251/272/345/237/216/350/256/241/346/243/213/347/233/230.webp +0 -0
  387. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/253/271/346/263/242/347/203/237/351/233/250/346/243/213/347/233/230.webp +0 -0
  388. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/273/217/345/205/270/346/234/250/346/243/213/347/233/230/346/243/213/347/233/230.webp +0 -0
  389. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//347/273/277/350/211/262/346/243/213/347/233/230.webp +0 -0
  390. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//350/261/241/347/224/2622023/346/243/213/347/233/230.webp +0 -0
  391. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//350/261/241/347/224/262/345/276/201/347/250/213/346/243/213/347/233/230.webp +0 -0
  392. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//350/261/241/347/224/262/351/207/215/347/207/203/346/243/213/347/233/230.webp +0 -0
  393. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/207/221/347/211/233/351/231/215/344/270/226/346/243/213/347/233/230.webp +0 -0
  394. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/207/221/350/231/216/350/264/272/345/262/201/346/243/213/347/233/230.webp +0 -0
  395. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/207/221/350/231/216/350/264/272/345/262/201/357/274/210/347/216/213/345/244/251/344/270/200/347/255/276/345/220/215/347/211/210/357/274/211/346/243/213/347/233/230.webp +0 -0
  396. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/216/217/351/207/221/345/262/201/346/234/210/346/243/213/347/233/230.webp +0 -0
  397. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/234/270/347/216/213/345/210/253/345/247/254/346/243/213/347/233/230.webp +0 -0
  398. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/270/277/351/227/250/345/256/264/346/243/213/347/233/230.webp +0 -0
  399. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/347/233/230.png +0 -0
  400. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/271/217/351/243/236/347/272/242/351/273/221/346/243/213/347/233/230.webp +0 -0
  401. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/271/217/351/243/236/347/273/217/345/205/270/346/243/213/347/233/230.webp +0 -0
  402. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/271/217/351/243/236/347/273/277/351/276/231/346/243/213/347/233/230.webp +0 -0
  403. package/lib/assets//346/243/213/347/233/230/347/232/256/350/202/244//351/276/231/350/205/276/345/244/251/345/235/233/346/243/213/347/233/230.webp +0 -0
  404. package/lib/index.d.ts +88 -0
  405. package/lib/index.js +2247 -0
  406. package/package.json +54 -0
  407. package/readme.md +58 -0
package/lib/index.js ADDED
@@ -0,0 +1,2247 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Config = exports.inject = exports.usage = exports.name = void 0;
27
+ exports.apply = apply;
28
+ const koishi_1 = require("koishi");
29
+ const path = __importStar(require("path"));
30
+ const fs = __importStar(require("fs"));
31
+ exports.name = 'cchess';
32
+ exports.usage = `## 🌈 使用
33
+
34
+ - 建议自行添加别名,如 \`cc\` 等更方便的指令。
35
+ - 请安装并启用所需服务,\`canvas\` 服务可使用 \`puppeteer\` 提供。
36
+ - 支持使用中国象棋纵线(炮二平五/炮8平5)和字母坐标(a0a1)进行移动。[了解详情 - 中国象棋着法表示](https://www.xqbase.com/protocol/cchess_move.htm)
37
+
38
+ ## 🌼 指令
39
+
40
+ - \`cchess.退出\`: 退出当前游戏。
41
+ - \`cchess.结束\`: 强制结束本局游戏。
42
+ - \`cchess.认输\`: 认输结束本局游戏。
43
+ - \`cchess.排行榜.总胜/输场\`: 请求悔棋操作。
44
+ - \`cchess.开始.人人对战\`: 开始人人对战模式。
45
+ - \`cchess.开始.人机对战\`: 开始人机对战模式。
46
+ - \`cchess.悔棋.请求/同意/拒绝\`: 请求悔棋操作。
47
+ - \`cchess.加入 [红/黑]\`: 加入游戏,可选红/黑方。
48
+ - \`cchess.移动 [纵线/字母坐标]\`: 通过指令移动棋子。
49
+ - \`cchess.查看云库残局.DTM统计/DTC统计\`: 查看云库残局统计。
50
+ - \`cchess.查询玩家记录 [@某人 或 不填则查自己]\`: 查询玩家记录。
51
+ - \`cchess.编辑棋盘.导入/导出/使用方法\`: 导入/导出棋盘状态与fen使用方法。`;
52
+ exports.inject = {
53
+ // required: ['monetary', 'database', 'puppeteer', 'canvas'],
54
+ required: ['database', 'puppeteer', 'canvas'],
55
+ optional: ['markdownToImage'],
56
+ };
57
+ const pieceSkins = ["云库木制棋子", "刘炳森红黑牛角隶书棋子", "木制棋子", "本纹隶书棋子", "银灰将军体棋子", "棋弈无限红绿正棋子", "棋弈无限红绿棋子", "棋天大圣棋子", "棋者象棋棋子", "楷书玉石棋子", "水墨青瓷棋子", "牛皮纸华康金文棋子", "皮卡鱼棋子", "红蓝祥隶棋子", "红黑精典无阴影棋子", "红黑精典棋子", "行书玉石棋子", "象甲棋子", "金属棋子篆体棋子", "镌刻华彩棋子", "鹏飞红黑棋子", "鹏飞经典棋子", "鹏飞绿龙棋子", "龙腾四海棋子"];
58
+ const boardSkins = ["棋弈无限红绿棋盘", "一鸣惊人棋盘", "三星堆棋盘", "云库木制棋盘", "云心鹤眼棋盘", "兰亭集序无字棋盘", "兰亭集序棋盘", "凤舞九天棋盘", "卯兔添福棋盘", "叱咤风云棋盘", "君临天下棋盘", "壁画古梦棋盘", "大闹天宫棋盘", "天山共色棋盘", "女神之约棋盘", "小吕飞刀棋盘", "山海绘卷棋盘", "护眼绿棋盘", "星河璀璨棋盘", "木制棋盘", "本纹隶书白棋盘", "本纹隶书黑棋盘", "桃花源记棋盘", "棋天大圣棋盘", "棋天无大圣棋盘", "武侠江湖棋盘", "水墨青瓷棋盘", "清悠茶道棋盘", "游园惊梦棋盘", "牛转乾坤棋盘", "玉石太极棋盘", "皓月无痕棋盘", "皮卡鱼棋盘", "盲棋神迹棋盘", "空城计棋盘", "竹波烟雨棋盘", "经典木棋盘棋盘", "绿色棋盘", "象甲2023棋盘", "象甲征程棋盘", "象甲重燃棋盘", "金牛降世棋盘", "金虎贺岁棋盘", "金虎贺岁(王天一签名版)棋盘", "鎏金岁月棋盘", "霸王别姬棋盘", "鸿门宴棋盘", "鹏飞红黑棋盘", "鹏飞经典棋盘", "鹏飞绿龙棋盘", "龙腾天坛棋盘"];
59
+ exports.Config = koishi_1.Schema.object({
60
+ boardSkin: koishi_1.Schema.union(boardSkins).default('木制棋盘').description(`棋盘皮肤。`),
61
+ pieceSkin: koishi_1.Schema.union(pieceSkins).default('木制棋子').description(`棋子皮肤。`),
62
+ defaultEngineThinkingDepth: koishi_1.Schema.number().min(0).max(100).default(10).description(`默认引擎思考深度,越高 AI 棋力越强。由于 Nodejs 不支持 SIMD,所以不建议设置过高。`),
63
+ defaultMaxLeaderboardEntries: koishi_1.Schema.number().min(0).default(10).description(`显示排行榜时默认的最大人数。`),
64
+ retractDelay: koishi_1.Schema.number().min(0).default(0).description(`自动撤回等待的时间,单位是秒。值为 0 时不启用自动撤回功能。`),
65
+ imageType: koishi_1.Schema.union(['png', 'jpeg', 'webp']).default('png').description(`发送的图片类型。`),
66
+ isTextToImageConversionEnabled: koishi_1.Schema.boolean().default(false).description(`是否开启将文本转为图片的功能(可选),如需启用,需要启用 \`markdownToImage\` 服务。`),
67
+ isChessImageWithOutlineEnabled: koishi_1.Schema.boolean().default(true).description(`是否为象棋图片添加辅助外框,关闭后可以显著提升图片速度,但无辅助外框,玩起来可能会比较累。`),
68
+ });
69
+ function apply(ctx, config) {
70
+ const logger = ctx.logger('cchess');
71
+ // cl*
72
+ const engines = {};
73
+ // fzy*
74
+ ctx.on('dispose', () => {
75
+ const channelIds = Object.keys(engines);
76
+ channelIds.forEach((channelId) => {
77
+ if (engines[channelId]) {
78
+ engines[channelId].send_command('quit');
79
+ engines[channelId] = null;
80
+ }
81
+ });
82
+ });
83
+ const we = 54; // 棋子宽度
84
+ const pe = 33;
85
+ const Pe = 33; // 棋盘边距
86
+ const Be = 50; // 棋子显示大小
87
+ const Ie = 54;
88
+ const Me = 500;
89
+ const ye = 550;
90
+ const ze = 500;
91
+ const ke = 120;
92
+ const weight = 500;
93
+ const height = 550;
94
+ const scale = 2;
95
+ const isFlipBoard = false;
96
+ const engineSettings = {
97
+ Threads: 1,
98
+ Hash: 128,
99
+ MultiPV: 1,
100
+ // "Skill Level": 20,
101
+ };
102
+ const thinkingSettings = {
103
+ moveTime: 1,
104
+ depth: config.defaultEngineThinkingDepth,
105
+ enableHint: true,
106
+ };
107
+ const piecesImgResources = loadPiecesImageResources(config.pieceSkin);
108
+ const outerFrameImg = fs.readFileSync(path.join(__dirname, 'assets', '棋盘皮肤', `外框.png`));
109
+ const boardSkinImg = fs.readFileSync(path.join(__dirname, 'assets', '棋盘皮肤', `${config.boardSkin}.webp`));
110
+ const possibleFigureNames = ["将", "士", "象", "车", "马", "炮", "卒", "帅", "仕", "相", "兵"];
111
+ // tzb*
112
+ ctx.model.extend('cchess_game_records', {
113
+ id: 'unsigned',
114
+ channelId: 'string',
115
+ isStarted: 'boolean',
116
+ isFlipBoard: 'boolean',
117
+ isHistoryMode: 'boolean',
118
+ turn: { type: 'string', initial: 'w' },
119
+ moveList: { type: 'json', initial: [] },
120
+ isDraw: { type: 'boolean', initial: false },
121
+ winSide: { type: 'string', initial: '' },
122
+ loseSide: { type: 'string', initial: '' },
123
+ // lastPV: {type: 'json', initial: null},
124
+ originalState: { type: 'json', initial: {} },
125
+ thinkingDetail: { type: 'json', initial: [] },
126
+ currentMoveId: { type: 'string', initial: '' },
127
+ thinkingSide: { type: 'string', initial: 'w' },
128
+ movesAfterLastEat: { type: 'json', initial: [] },
129
+ isAnalyzing: { type: 'boolean', initial: false },
130
+ turnAfterLastEat: { type: 'string', initial: 'w' },
131
+ isEngineReady: { type: 'boolean', initial: false },
132
+ // multiPvInfoBuffer: {type: 'json', initial: {}},
133
+ isEnginePlayRed: { type: 'boolean', initial: false },
134
+ isEngineAnalyze: { type: 'boolean', initial: false },
135
+ isRegretRequest: { type: 'boolean', initial: false },
136
+ lastMove: { type: 'json', initial: [[0, 0], [0, 0]] },
137
+ isEnginePlayBlack: { type: 'boolean', initial: false },
138
+ ponderHint: { type: 'json', initial: [[0, 0], [0, 0]] },
139
+ // bestMoveHint: {type: 'json', initial: [[0, 0], [0, 0]]},
140
+ fen: { type: 'string', initial: 'rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w' },
141
+ startFen: { type: 'string', initial: 'rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w' },
142
+ board: { type: 'json', initial: fenToBoard('rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w') },
143
+ boardAfterLastEat: {
144
+ type: 'json',
145
+ initial: fenToBoard('rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w')
146
+ },
147
+ moveTreePtr: {
148
+ type: 'json',
149
+ initial: { moveId: '', fen: '', side: '', moveCord: [[0, 0], [0, 0]], move: '', chnMoveName: '', next: null }
150
+ },
151
+ }, {
152
+ primary: 'id',
153
+ autoInc: true,
154
+ });
155
+ ctx.model.extend('cchess_gaming_player_records', {
156
+ id: 'unsigned',
157
+ channelId: 'string',
158
+ userId: 'string',
159
+ username: 'string',
160
+ side: 'string',
161
+ }, {
162
+ primary: 'id',
163
+ autoInc: true,
164
+ });
165
+ ctx.model.extend('cchess_player_records', {
166
+ id: 'unsigned',
167
+ userId: 'string',
168
+ username: 'string',
169
+ win: 'unsigned',
170
+ lose: 'unsigned',
171
+ }, {
172
+ primary: 'id',
173
+ autoInc: true,
174
+ });
175
+ // zjj*
176
+ ctx.middleware(async (session, next) => {
177
+ let { channelId, content, userId } = session;
178
+ const gameRecord = await getGameRecord(channelId);
179
+ if (!gameRecord.isStarted) {
180
+ return await next();
181
+ }
182
+ const playerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
183
+ if (playerRecord.length === 0) {
184
+ return await next();
185
+ }
186
+ else {
187
+ const turn = gameRecord.turn;
188
+ const sideString = turn === 'w' ? '红方' : '黑方';
189
+ if (playerRecord[0].side !== sideString) {
190
+ return await next();
191
+ }
192
+ }
193
+ if (!isMoveString(content) && !isValidFigureMoveName(content)) {
194
+ return await next();
195
+ }
196
+ await session.execute(`cchess.移动 ${content}`);
197
+ });
198
+ // bz*
199
+ ctx.command('cchess', '中国象棋游戏指令帮助')
200
+ .action(async ({ session }) => {
201
+ await session.execute(`cchess -h`);
202
+ });
203
+ // jr* j*
204
+ ctx.command('cchess.加入 [choice:string]', '加入游戏并选择红黑方')
205
+ .action(async ({ session }, choice) => {
206
+ const { username, userId, channelId } = session;
207
+ await updateNameInPlayerRecord(userId, username);
208
+ const gameRecord = await getGameRecord(channelId);
209
+ if (gameRecord.isStarted) {
210
+ const buffer = await drawChessBoard(channelId);
211
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
212
+ return await sendMessage(session, `【@${username}】\n游戏已经开始啦!\n${hImg}`);
213
+ }
214
+ await checkEngine(channelId);
215
+ if (engines[channelId] && !gameRecord.isEngineReady) {
216
+ await ctx.database.set('cchess_game_records', { channelId }, {
217
+ isEngineReady: true
218
+ });
219
+ }
220
+ if (!choice) {
221
+ choice = Math.random() < 0.5 ? '红方' : '黑方';
222
+ }
223
+ else if (choice.includes('红') && choice.includes('黑')) {
224
+ return await sendMessage(session, `【@${username}】\n一次只能选择一方哦!`);
225
+ }
226
+ else if (choice.includes('红')) {
227
+ choice = '红方';
228
+ }
229
+ else if (choice.includes('黑')) {
230
+ choice = '黑方';
231
+ }
232
+ else {
233
+ choice = Math.random() < 0.5 ? '红方' : '黑方';
234
+ }
235
+ const getPlayerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
236
+ const getPlayerRecords = await ctx.database.get('cchess_gaming_player_records', { channelId });
237
+ const playersNum = getPlayerRecords.length;
238
+ if (getPlayerRecord.length === 0) {
239
+ await ctx.database.create('cchess_gaming_player_records', { channelId, userId, username, side: choice });
240
+ return await sendMessage(session, `【@${username}】\n您加入游戏啦!\n您的队伍为:【${choice}】\n当前玩家人数为:【${playersNum + 1}】\n带“黑”或“红”加入游戏可以更换队伍哦~\n例如:\n- 加入指令 红\n- 加入指令 黑`);
241
+ }
242
+ else {
243
+ await ctx.database.set('cchess_gaming_player_records', { channelId, userId }, { side: choice });
244
+ return await sendMessage(session, `【@${username}】\n您已更换队伍为:【${choice}】\n当前玩家人数为:【${playersNum}】`);
245
+ }
246
+ });
247
+ // tc* q*
248
+ ctx.command('cchess.退出', '退出游戏')
249
+ .action(async ({ session }) => {
250
+ const { username, userId, channelId } = session;
251
+ await updateNameInPlayerRecord(userId, username);
252
+ const gameRecord = await getGameRecord(channelId);
253
+ if (gameRecord.isStarted) {
254
+ return await sendMessage(session, `【@${username}】\n游戏已经开始啦~\n不许逃跑哦!`);
255
+ }
256
+ await checkEngine(channelId);
257
+ if (engines[channelId] && !gameRecord.isEngineReady) {
258
+ await ctx.database.set('cchess_game_records', { channelId }, {
259
+ isEngineReady: true
260
+ });
261
+ }
262
+ const getPlayerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
263
+ const getPlayerRecords = await ctx.database.get('cchess_gaming_player_records', { channelId });
264
+ const playersNum = getPlayerRecords.length;
265
+ if (getPlayerRecord.length === 0) {
266
+ return await sendMessage(session, `【@${username}】\n您还未加入游戏呢!`);
267
+ }
268
+ else {
269
+ await ctx.database.remove('cchess_gaming_player_records', { channelId, userId });
270
+ return await sendMessage(session, `【@${username}】\n您已退出游戏!\n剩余玩家人数为:【${playersNum - 1}】`);
271
+ }
272
+ });
273
+ // ksbz* ks*
274
+ ctx.command('cchess.开始', '开始游戏指令帮助')
275
+ .action(async ({ session }) => {
276
+ await session.execute(`cchess.开始 -h`);
277
+ });
278
+ // rrdz*
279
+ ctx.command('cchess.开始.人人对战', '开始人人对战')
280
+ .action(async ({ session }) => {
281
+ const { username, userId, channelId } = session;
282
+ await updateNameInPlayerRecord(userId, username);
283
+ const gameRecord = await getGameRecord(channelId);
284
+ if (gameRecord.isStarted) {
285
+ return await sendMessage(session, `【@${username}】\n游戏已经开始啦!`);
286
+ }
287
+ await checkEngine(channelId);
288
+ if (engines[channelId] && !gameRecord.isEngineReady) {
289
+ await ctx.database.set('cchess_game_records', { channelId }, {
290
+ isEngineReady: true
291
+ });
292
+ }
293
+ const getPlayerRecords = await ctx.database.get('cchess_gaming_player_records', { channelId });
294
+ const playersNum = getPlayerRecords.length;
295
+ let redPlayers = getPlayerRecords.filter((player) => player.side === '红方');
296
+ let blackPlayers = getPlayerRecords.filter((player) => player.side === '黑方');
297
+ let message = '';
298
+ if (playersNum < 2) {
299
+ return await sendMessage(session, `【@${username}】\n当前玩家人数不足 2 人,无法开始游戏!`);
300
+ }
301
+ else {
302
+ if (redPlayers.length !== 1 || blackPlayers.length !== 1) {
303
+ const randomPlayer = getPlayerRecords[Math.floor(Math.random() * getPlayerRecords.length)];
304
+ if (redPlayers.length < 1) {
305
+ randomPlayer.side = '红方';
306
+ message += `【@${randomPlayer.username}】被自动分配到红方。\n`;
307
+ }
308
+ else {
309
+ randomPlayer.side = '黑方';
310
+ message += `【@${randomPlayer.username}】被自动分配到黑方。\n`;
311
+ }
312
+ await ctx.database.set('cchess_gaming_player_records', {
313
+ channelId,
314
+ userId: randomPlayer.userId
315
+ }, { side: randomPlayer.side });
316
+ redPlayers = getPlayerRecords.filter((player) => player.side === '红方');
317
+ blackPlayers = getPlayerRecords.filter((player) => player.side === '黑方');
318
+ }
319
+ message += `红方玩家(${redPlayers.length}):\n${redPlayers.map(player => `【@${player.username}】`).join('\n')}\n\n`;
320
+ message += `黑方玩家(${blackPlayers.length}):\n${blackPlayers.map(player => `【@${player.username}】`).join('\n')}`;
321
+ await ctx.database.set('cchess_game_records', { channelId }, {
322
+ isStarted: true,
323
+ });
324
+ const turn = gameRecord.turn;
325
+ const sideString = convertTurnToString(turn);
326
+ const buffer = await drawChessBoard(channelId);
327
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
328
+ return await sendMessage(session, `游戏开始!\n${message}\n先手方为:【${sideString}】\n${hImg}`);
329
+ }
330
+ });
331
+ // rjdz*
332
+ ctx.command('cchess.开始.人机对战', '开始人机对战')
333
+ .action(async ({ session }) => {
334
+ const { username, userId, channelId } = session;
335
+ await updateNameInPlayerRecord(userId, username);
336
+ const gameRecord = await getGameRecord(channelId);
337
+ if (gameRecord.isStarted) {
338
+ return await sendMessage(session, `【@${username}】\n游戏已经开始啦!`);
339
+ }
340
+ await checkEngine(channelId);
341
+ if (engines[channelId] && !gameRecord.isEngineReady) {
342
+ await ctx.database.set('cchess_game_records', { channelId }, {
343
+ isEngineReady: true
344
+ });
345
+ }
346
+ const getPlayerRecords = await ctx.database.get('cchess_gaming_player_records', { channelId });
347
+ const playersNum = getPlayerRecords.length;
348
+ let redPlayers = getPlayerRecords.filter((player) => player.side === '红方');
349
+ let blackPlayers = getPlayerRecords.filter((player) => player.side === '黑方');
350
+ let message = '';
351
+ let AISide = '';
352
+ if (playersNum < 1) {
353
+ return await sendMessage(session, `【@${username}】\n当前玩家人数不足 1 人,无法开始游戏!`);
354
+ }
355
+ else {
356
+ if (playersNum === 1) {
357
+ if (getPlayerRecords[0].side === '红方') {
358
+ await ctx.database.set('cchess_game_records', { channelId }, { isEnginePlayBlack: true });
359
+ AISide = '黑方';
360
+ message += `人类队伍为:【红方】\n`;
361
+ }
362
+ else {
363
+ await ctx.database.set('cchess_game_records', { channelId }, { isEnginePlayRed: true });
364
+ AISide = '红方';
365
+ message += `人类队伍为:【黑方】\n`;
366
+ }
367
+ }
368
+ else {
369
+ if (redPlayers.length > blackPlayers.length) {
370
+ await ctx.database.set('cchess_game_records', { channelId }, { isEnginePlayBlack: true });
371
+ AISide = '黑方';
372
+ message += `人类队伍为:【红方】\n`;
373
+ for (const player of blackPlayers) {
374
+ await ctx.database.set('cchess_gaming_player_records', {
375
+ channelId,
376
+ userId: player.userId
377
+ }, { side: '红方' });
378
+ }
379
+ }
380
+ else if (redPlayers.length < blackPlayers.length) {
381
+ await ctx.database.set('cchess_game_records', { channelId }, { isEnginePlayRed: true });
382
+ AISide = '红方';
383
+ message += `人类队伍为:【黑方】\n`;
384
+ for (const player of redPlayers) {
385
+ await ctx.database.set('cchess_gaming_player_records', {
386
+ channelId,
387
+ userId: player.userId
388
+ }, { side: '黑方' });
389
+ }
390
+ }
391
+ if (redPlayers.length === blackPlayers.length) {
392
+ const side = Math.random() < 0.5 ? '红方' : '黑方';
393
+ message += `人类队伍为:【${side}】\n`;
394
+ const computerSide = side === '红方' ? '黑方' : '红方';
395
+ AISide = computerSide;
396
+ await ctx.database.set('cchess_game_records', { channelId }, {
397
+ isEnginePlayRed: computerSide === '红方',
398
+ isEnginePlayBlack: computerSide === '黑方'
399
+ });
400
+ for (const player of getPlayerRecords) {
401
+ await ctx.database.set('cchess_gaming_player_records', { channelId, userId: player.userId }, { side: side });
402
+ }
403
+ }
404
+ }
405
+ await ctx.database.set('cchess_game_records', { channelId }, {
406
+ isStarted: true,
407
+ });
408
+ const turn = gameRecord.turn;
409
+ const sideString = convertTurnToString(turn);
410
+ if (AISide === sideString) {
411
+ await ctx.database.set('cchess_game_records', { channelId }, {
412
+ isAnalyzing: true,
413
+ });
414
+ await engineAction(channelId);
415
+ while (true) {
416
+ const gameRecord = await getGameRecord(channelId);
417
+ if (!gameRecord.isAnalyzing) {
418
+ break;
419
+ }
420
+ await (0, koishi_1.sleep)(500);
421
+ }
422
+ }
423
+ const buffer = await drawChessBoard(channelId);
424
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
425
+ return await sendMessage(session, `游戏开始!\n${message}\n先手方为:【${sideString}】\n${hImg}`);
426
+ }
427
+ });
428
+ // js*
429
+ ctx.command('cchess.结束', '强制结束游戏')
430
+ .action(async ({ session }) => {
431
+ const { username, userId, channelId } = session;
432
+ await updateNameInPlayerRecord(userId, username);
433
+ const gameRecord = await getGameRecord(channelId);
434
+ await checkEngine(channelId);
435
+ if (engines[channelId] && !gameRecord.isEngineReady) {
436
+ await ctx.database.set('cchess_game_records', { channelId }, {
437
+ isEngineReady: true
438
+ });
439
+ }
440
+ if (!gameRecord.isStarted) {
441
+ return await sendMessage(session, `【@${username}】\n游戏未开始哦!\n完全没必要强制结束嘛~`);
442
+ }
443
+ else {
444
+ await endGame(channelId);
445
+ return await sendMessage(session, `【@${username}】\n游戏已被强制结束!`);
446
+ }
447
+ });
448
+ // yd*
449
+ ctx.command('cchess.移动 <moveOperation:text>', '进行移动操作')
450
+ .action(async ({ session }, moveOperation) => {
451
+ const { username, userId, channelId } = session;
452
+ await updateNameInPlayerRecord(userId, username);
453
+ if (!isMoveString(moveOperation) && !isValidFigureMoveName(moveOperation)) {
454
+ return await sendMessage(session, `【@${username}】\n无效的移动!`);
455
+ }
456
+ const gameRecord = await getGameRecord(channelId);
457
+ if (!gameRecord.isStarted) {
458
+ return await sendMessage(session, `【@${username}】\n游戏还未开始哦!`);
459
+ }
460
+ if (gameRecord.isRegretRequest) {
461
+ return await sendMessage(session, `【@${username}】\n正在请求悔棋,等待回应中...`);
462
+ }
463
+ const turn = gameRecord.turn;
464
+ const sideString = convertTurnToString(turn);
465
+ const playerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
466
+ if (playerRecord.length === 0) {
467
+ return await sendMessage(session, `【@${username}】\n您还未加入游戏呢!`);
468
+ }
469
+ else if (playerRecord[0].side !== sideString) {
470
+ return await sendMessage(session, `【@${username}】\n还没轮到${sideString}走棋哦!\n当前走棋方为:【${convertTurnToString(gameRecord.turn)}】`);
471
+ }
472
+ await checkEngine(channelId);
473
+ if (engines[channelId] && !gameRecord.isEngineReady) {
474
+ await ctx.database.set('cchess_game_records', { channelId }, {
475
+ isEngineReady: true
476
+ });
477
+ }
478
+ const board = gameRecord.board;
479
+ let selectedPos = undefined;
480
+ let newPos = undefined;
481
+ // 中文纵线
482
+ if (possibleFigureNames.some(figureName => moveOperation.includes(figureName))) {
483
+ const figureName = getFigureNameFromMoveOperation(moveOperation);
484
+ const englishLetter = getEnglishLetterFromFigureName(figureName);
485
+ const processedLetter = processEnglishLetter(englishLetter, turn);
486
+ const letterPositions = findLetterPositions(board, processedLetter);
487
+ const moveInfoList = [];
488
+ for (const pos of letterPositions) {
489
+ const piece = processedLetter;
490
+ const side = getSide(piece);
491
+ const type = getType(piece);
492
+ const moveMap = getValidMoveMap(board, type, side, [pos[1], pos[0]]);
493
+ const legalPositions = findLegalMovePositions(moveMap);
494
+ const fen = getFen(board, side);
495
+ for (const toPos of legalPositions) {
496
+ const moveString = moveToMoveString([[pos[1], pos[0]], [toPos[1], toPos[0]]]);
497
+ const figureMoveName = getFigureMoveName(fen, moveString);
498
+ moveInfoList.push({
499
+ moveCord: [[pos[1], pos[0]], [toPos[1], toPos[0]]],
500
+ moveString: moveString,
501
+ figureMoveName: figureMoveName
502
+ });
503
+ }
504
+ }
505
+ const duplicateMoveInfo = findMoveInfo(moveInfoList, moveOperation);
506
+ if (!duplicateMoveInfo) {
507
+ return await sendMessage(session, `【@${username}】\n无效的移动!`);
508
+ }
509
+ else {
510
+ [selectedPos, newPos] = duplicateMoveInfo.moveCord;
511
+ }
512
+ }
513
+ else {
514
+ // 字母坐标
515
+ // [selectedPos, newPos] = moveStringToMove(moveOperation);
516
+ [selectedPos, newPos] = moveStringToPos(moveOperation);
517
+ }
518
+ const [newCol, newRow] = newPos;
519
+ const piece = getPiece(board, selectedPos);
520
+ const side = getSide(piece);
521
+ const type = getType(piece);
522
+ if (side !== gameRecord.turn) {
523
+ return await sendMessage(session, `【@${username}】\n还没轮到${convertTurnToString(side)}走棋哦!\n当前走棋方为:【${convertTurnToString(gameRecord.turn)}】`);
524
+ }
525
+ const moveMap = getValidMoveMap(board, type, side, selectedPos);
526
+ if (moveMap[newRow][newCol] !== 'go' && moveMap[newRow][newCol] !== 'eat') {
527
+ return await sendMessage(session, `【@${username}】\n无效的移动!`);
528
+ }
529
+ await makeMove(channelId, selectedPos, newPos);
530
+ await ctx.database.set('cchess_game_records', { channelId }, {
531
+ isAnalyzing: true
532
+ });
533
+ await engineAction(channelId);
534
+ while (true) {
535
+ const gameRecord = await getGameRecord(channelId);
536
+ if (!gameRecord.isAnalyzing) {
537
+ break;
538
+ }
539
+ await (0, koishi_1.sleep)(500);
540
+ }
541
+ const newGameRecord = await getGameRecord(channelId);
542
+ if (newGameRecord.winSide !== '') {
543
+ const buffer = await drawChessBoard(channelId);
544
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
545
+ await updatePlayerRecords(channelId, newGameRecord.winSide, newGameRecord.loseSide);
546
+ await endGame(channelId);
547
+ return await sendMessage(session, `【@${username}】\n绝杀!\n游戏结束!\n获胜方为:【${convertTurnToString(newGameRecord.winSide)}】\n${hImg}`);
548
+ }
549
+ if (gameRecord.isEnginePlayRed || gameRecord.isEnginePlayBlack) {
550
+ // 分析人类的局势
551
+ const gameRecord = await getGameRecord(channelId);
552
+ let { movesAfterLastEat, boardAfterLastEat, turnAfterLastEat,
553
+ // multiPvInfoBuffer
554
+ } = gameRecord;
555
+ await ctx.database.set('cchess_game_records', { channelId }, {
556
+ isAnalyzing: true
557
+ });
558
+ await sendCommand(channelId, "fen " + getFenWithMove(movesAfterLastEat, boardAfterLastEat, turnAfterLastEat)),
559
+ await go(channelId, 1e3 * thinkingSettings["movetime"], thinkingSettings["depth"], -1);
560
+ while (true) {
561
+ const gameRecord = await getGameRecord(channelId);
562
+ if (!gameRecord.isAnalyzing) {
563
+ break;
564
+ }
565
+ await (0, koishi_1.sleep)(500);
566
+ }
567
+ const newGameRecord = await getGameRecord(channelId);
568
+ if (newGameRecord.winSide !== '') {
569
+ const buffer = await drawChessBoard(channelId);
570
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
571
+ await updatePlayerRecords(channelId, newGameRecord.winSide, newGameRecord.loseSide);
572
+ await endGame(channelId);
573
+ return await sendMessage(session, `【@${username}】\n绝杀!\n游戏结束!\n获胜方为:【${convertTurnToString(newGameRecord.winSide)}】\n${hImg}`);
574
+ }
575
+ }
576
+ const buffer = await drawChessBoard(channelId);
577
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
578
+ return await sendMessage(session, `${hImg}`);
579
+ });
580
+ // hq*
581
+ ctx.command('cchess.悔棋', '悔棋指令帮助')
582
+ .action(async ({ session }) => {
583
+ await session.execute(`cchess.悔棋 -h`);
584
+ });
585
+ // qqhq*
586
+ ctx.command('cchess.悔棋.请求', '请求悔棋')
587
+ .action(async ({ session }) => {
588
+ const { username, userId, channelId } = session;
589
+ await updateNameInPlayerRecord(userId, username);
590
+ const gameRecord = await getGameRecord(channelId);
591
+ if (!gameRecord.isStarted) {
592
+ return await sendMessage(session, `【@${username}】\n游戏还未开始哦!`);
593
+ }
594
+ await checkEngine(channelId);
595
+ if (engines[channelId] && !gameRecord.isEngineReady) {
596
+ await ctx.database.set('cchess_game_records', { channelId }, {
597
+ isEngineReady: true
598
+ });
599
+ }
600
+ if (gameRecord.isRegretRequest) {
601
+ return await sendMessage(session, `【@${username}】\n已经有悔棋请求了!`);
602
+ }
603
+ const playerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
604
+ if (playerRecord.length === 0) {
605
+ return await sendMessage(session, `【@${username}】\n您还未加入游戏呢!`);
606
+ }
607
+ const turn = gameRecord.turn;
608
+ const sideString = convertTurnToString(turn);
609
+ if (gameRecord.isAnalyzing) {
610
+ return await sendMessage(session, `【@${username}】\n对局分析中,请稍后再试!`);
611
+ }
612
+ if (gameRecord.moveList.length < 1) {
613
+ return await sendMessage(session, `【@${username}】\n当前无法悔棋!`);
614
+ }
615
+ if (gameRecord.isEnginePlayBlack || gameRecord.isEnginePlayRed) {
616
+ await undoMove(channelId);
617
+ await undoMove(channelId);
618
+ const buffer = await drawChessBoard(channelId);
619
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
620
+ return await sendMessage(session, `【@${username}】\n悔棋成功!\n${hImg}`);
621
+ }
622
+ else {
623
+ if (playerRecord[0].side === sideString) {
624
+ return await sendMessage(session, `【@${username}】\n现在轮到你下棋,不可悔棋!`);
625
+ }
626
+ else {
627
+ await ctx.database.set('cchess_game_records', { channelId }, {
628
+ isRegretRequest: true
629
+ });
630
+ return await sendMessage(session, `【@${username}】\n请求悔棋中...\n清对方输入相关指令选择同意或拒绝!`);
631
+ }
632
+ }
633
+ });
634
+ // tyhq*
635
+ ctx.command('cchess.悔棋.同意', '同意悔棋')
636
+ .action(async ({ session }) => {
637
+ const { username, userId, channelId } = session;
638
+ await updateNameInPlayerRecord(userId, username);
639
+ const gameRecord = await getGameRecord(channelId);
640
+ if (!gameRecord.isStarted) {
641
+ return await sendMessage(session, `【@${username}】\n游戏还未开始哦!`);
642
+ }
643
+ await checkEngine(channelId);
644
+ if (engines[channelId] && !gameRecord.isEngineReady) {
645
+ await ctx.database.set('cchess_game_records', { channelId }, {
646
+ isEngineReady: true
647
+ });
648
+ }
649
+ if (gameRecord.isAnalyzing) {
650
+ return await sendMessage(session, `【@${username}】\n对局分析中,请稍后再试!`);
651
+ }
652
+ if (!gameRecord.isRegretRequest) {
653
+ return await sendMessage(session, `【@${username}】\n当前无悔棋请求!`);
654
+ }
655
+ const playerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
656
+ if (playerRecord.length === 0) {
657
+ return await sendMessage(session, `【@${username}】\n您还未加入游戏呢!`);
658
+ }
659
+ const turn = gameRecord.turn;
660
+ const sideString = convertTurnToString(turn);
661
+ if (playerRecord[0].side !== sideString) {
662
+ return await sendMessage(session, `【@${username}】\n您所在的队伍不能做出选择!`);
663
+ }
664
+ else {
665
+ await undoMove(channelId);
666
+ await ctx.database.set('cchess_game_records', { channelId }, {
667
+ isRegretRequest: false
668
+ });
669
+ const buffer = await drawChessBoard(channelId);
670
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
671
+ return await sendMessage(session, `【@${username}】\n由于您同意了对方的悔棋请求!\n悔棋成功!\n${hImg}`);
672
+ }
673
+ });
674
+ // jjhq*
675
+ ctx.command('cchess.悔棋.拒绝', '拒绝悔棋')
676
+ .action(async ({ session }) => {
677
+ const { username, userId, channelId } = session;
678
+ await updateNameInPlayerRecord(userId, username);
679
+ const gameRecord = await getGameRecord(channelId);
680
+ if (!gameRecord.isStarted) {
681
+ return await sendMessage(session, `【@${username}】\n游戏还未开始哦!`);
682
+ }
683
+ await checkEngine(channelId);
684
+ if (engines[channelId] && !gameRecord.isEngineReady) {
685
+ await ctx.database.set('cchess_game_records', { channelId }, {
686
+ isEngineReady: true
687
+ });
688
+ }
689
+ if (gameRecord.isAnalyzing) {
690
+ return await sendMessage(session, `【@${username}】\n对局分析中,请稍后再试!`);
691
+ }
692
+ if (!gameRecord.isRegretRequest) {
693
+ return await sendMessage(session, `【@${username}】\n当前无悔棋请求!`);
694
+ }
695
+ const playerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
696
+ if (playerRecord.length === 0) {
697
+ return await sendMessage(session, `【@${username}】\n您还未加入游戏呢!`);
698
+ }
699
+ const turn = gameRecord.turn;
700
+ const sideString = convertTurnToString(turn);
701
+ if (playerRecord[0].side !== sideString) {
702
+ return await sendMessage(session, `【@${username}】\n您所在的队伍不能做出选择!`);
703
+ }
704
+ else {
705
+ await ctx.database.set('cchess_game_records', { channelId }, {
706
+ isRegretRequest: false
707
+ });
708
+ const buffer = await drawChessBoard(channelId);
709
+ const hImg = koishi_1.h.image(buffer, `image/${config.imageType}`);
710
+ return await sendMessage(session, `【@${username}】\n由于您拒绝了对方的悔棋请求!\n悔棋失败,游戏继续进行!\n${hImg}`);
711
+ }
712
+ });
713
+ // rs*
714
+ ctx.command('cchess.认输', '认输')
715
+ .action(async ({ session }) => {
716
+ const { username, userId, channelId } = session;
717
+ await updateNameInPlayerRecord(userId, username);
718
+ const gameRecord = await getGameRecord(channelId);
719
+ if (!gameRecord.isStarted) {
720
+ return await sendMessage(session, `【@${username}】\n游戏还未开始哦!`);
721
+ }
722
+ await checkEngine(channelId);
723
+ if (engines[channelId] && !gameRecord.isEngineReady) {
724
+ await ctx.database.set('cchess_game_records', { channelId }, {
725
+ isEngineReady: true
726
+ });
727
+ }
728
+ if (gameRecord.isAnalyzing) {
729
+ return await sendMessage(session, `【@${username}】\n对局分析中,请稍后再试!`);
730
+ }
731
+ const playerRecord = await ctx.database.get('cchess_gaming_player_records', { channelId, userId });
732
+ if (playerRecord.length === 0) {
733
+ return await sendMessage(session, `【@${username}】\n您还未加入游戏呢!`);
734
+ }
735
+ const turn = gameRecord.turn;
736
+ const sideString = convertTurnToString(turn);
737
+ if (playerRecord[0].side !== sideString) {
738
+ return await sendMessage(session, `【@${username}】\n还没轮到${sideString}走棋哦!\n当前走棋方为:【${convertTurnToString(gameRecord.turn)}】`);
739
+ }
740
+ const anotherSideString = convertTurnToString(turn === 'w' ? 'b' : 'w');
741
+ await updatePlayerRecords(channelId, turn === 'w' ? 'b' : 'w', turn);
742
+ await endGame(channelId);
743
+ return await sendMessage(session, `【@${username}】\n认输成功!\n游戏结束!\n获胜方为:【${anotherSideString}】`);
744
+ });
745
+ // ykcj*
746
+ ctx.command('cchess.查看云库残局', '云库残局指令帮助')
747
+ .action(async ({ session }) => {
748
+ await session.execute(`cchess.查看云库残局 -h`);
749
+ });
750
+ // DTM*
751
+ ctx.command('cchess.查看云库残局.DTM统计', '云库残局DTM统计')
752
+ .action(async ({ session }) => {
753
+ const { username, userId, channelId } = session;
754
+ await updateNameInPlayerRecord(userId, username);
755
+ await checkEngine(channelId);
756
+ return await sendMessage(session, `【@${username}】\nhttps://www.chessdb.cn/egtb_info_dtm.html`);
757
+ });
758
+ // DTC*
759
+ ctx.command('cchess.查看云库残局.DTC统计', '云库残局DTM统计')
760
+ .action(async ({ session }) => {
761
+ const { username, userId, channelId } = session;
762
+ await updateNameInPlayerRecord(userId, username);
763
+ await checkEngine(channelId);
764
+ return await sendMessage(session, `【@${username}】\nhttps://www.chessdb.cn/egtb_info.html`);
765
+ });
766
+ // bjqp*
767
+ ctx.command('cchess.编辑棋盘', '编辑棋盘指令帮助')
768
+ .action(async ({ session }) => {
769
+ await session.execute(`cchess.编辑棋盘 -h`);
770
+ });
771
+ // dr*
772
+ ctx.command('cchess.编辑棋盘.导入 <fen:text>', '导入FEN串')
773
+ .action(async ({ session }, fen) => {
774
+ const { username, userId, channelId } = session;
775
+ await updateNameInPlayerRecord(userId, username);
776
+ const gameRecord = await getGameRecord(channelId);
777
+ if (gameRecord.isStarted) {
778
+ return await sendMessage(session, `【@${username}】\n游戏已经开始啦~\n不可编辑棋盘!`);
779
+ }
780
+ await checkEngine(channelId);
781
+ if (engines[channelId] && !gameRecord.isEngineReady) {
782
+ await ctx.database.set('cchess_game_records', { channelId }, {
783
+ isEngineReady: true
784
+ });
785
+ }
786
+ if (!fen) {
787
+ return await sendMessage(session, `【@${username}】\n无效的FEN串!`);
788
+ }
789
+ if (!isValidateFen(fen)) {
790
+ return await sendMessage(session, `【@${username}】\n无效的FEN串!`);
791
+ }
792
+ let { turn, board, moveList, movesAfterLastEat, boardAfterLastEat, turnAfterLastEat, lastMove, isHistoryMode, originalState, startFen } = gameRecord;
793
+ const t = fen;
794
+ board = fenToBoard(t);
795
+ turn = "w";
796
+ moveList = [];
797
+ movesAfterLastEat = [];
798
+ boardAfterLastEat = fenToBoard(t);
799
+ turnAfterLastEat = fenToTurn(t);
800
+ t.includes("moves") ? startFen = t.split("moves")[0] : startFen = t;
801
+ isHistoryMode = !1;
802
+ originalState = {};
803
+ lastMove = null;
804
+ await ctx.database.set('cchess_game_records', { channelId }, {
805
+ turn,
806
+ board,
807
+ moveList,
808
+ movesAfterLastEat,
809
+ boardAfterLastEat,
810
+ turnAfterLastEat,
811
+ lastMove,
812
+ isHistoryMode,
813
+ originalState,
814
+ startFen
815
+ });
816
+ await parseFen(channelId, t);
817
+ return await sendMessage(session, `【@${username}】\n棋盘编辑成功!`);
818
+ });
819
+ // dc*
820
+ ctx.command('cchess.编辑棋盘.导出', '导出FEN串')
821
+ .action(async ({ session }) => {
822
+ const { username, userId, channelId } = session;
823
+ await updateNameInPlayerRecord(userId, username);
824
+ const gameRecord = await getGameRecord(channelId);
825
+ if (!gameRecord.isStarted) {
826
+ return await sendMessage(session, `【@${username}】\n游戏还未开始哦!`);
827
+ }
828
+ if (gameRecord.isAnalyzing) {
829
+ return await sendMessage(session, `【@${username}】\n对局分析中,请稍后再试!`);
830
+ }
831
+ await checkEngine(channelId);
832
+ if (engines[channelId] && !gameRecord.isEngineReady) {
833
+ await ctx.database.set('cchess_game_records', { channelId }, {
834
+ isEngineReady: true
835
+ });
836
+ }
837
+ const fenWithFullMove = await getFenWithFullMove(channelId);
838
+ return await sendMessage(session, `【@${username}】\n${fenWithFullMove}`);
839
+ });
840
+ // syff*
841
+ ctx.command('cchess.编辑棋盘.使用方法', '查看编辑棋盘的fen使用方法')
842
+ .action(async ({ session }) => {
843
+ const { username, userId, channelId } = session;
844
+ await updateNameInPlayerRecord(userId, username);
845
+ await checkEngine(channelId);
846
+ return await sendMessage(session, `【@${username}】\nhttps://www.xqbase.com/protocol/cchess_fen.htm`);
847
+ });
848
+ // zsc*
849
+ ctx.command('cchess.排行榜.总胜场 [number:number]', '查看玩家总胜场排行榜')
850
+ .action(async ({ session }, number = config.defaultMaxLeaderboardEntries) => {
851
+ const { channelId, username, userId } = session;
852
+ // 更新玩家记录表中的用户名
853
+ await updateNameInPlayerRecord(userId, username);
854
+ if (typeof number !== 'number' || isNaN(number) || number < 0) {
855
+ return '请输入大于等于 0 的数字作为排行榜的参数。';
856
+ }
857
+ return await getLeaderboard(session, 'win', 'win', '玩家总胜场排行榜', number);
858
+ });
859
+ // zsc*
860
+ ctx.command('cchess.排行榜.总输场 [number:number]', '查看玩家总输场排行榜')
861
+ .action(async ({ session }, number = config.defaultMaxLeaderboardEntries) => {
862
+ const { channelId, username, userId } = session;
863
+ // 更新玩家记录表中的用户名
864
+ await updateNameInPlayerRecord(userId, username);
865
+ if (typeof number !== 'number' || isNaN(number) || number < 0) {
866
+ return '请输入大于等于 0 的数字作为排行榜的参数。';
867
+ }
868
+ return await getLeaderboard(session, 'lose', 'lose', '查看玩家总输场排行榜', number);
869
+ });
870
+ // cx*
871
+ ctx.command('cchess.查询玩家记录 [targetUser:text]', '查询玩家记录')
872
+ .action(async ({ session }, targetUser) => {
873
+ let { channelId, userId, username } = session;
874
+ await updateNameInPlayerRecord(userId, username);
875
+ if (targetUser) {
876
+ const userIdRegex = /<at id="([^"]+)"(?: name="([^"]+)")?\/>/;
877
+ const match = targetUser.match(userIdRegex);
878
+ userId = match?.[1] ?? userId;
879
+ username = match?.[2] ?? username;
880
+ }
881
+ const targetUserRecord = await ctx.database.get('cchess_player_records', { userId });
882
+ if (targetUserRecord.length === 0) {
883
+ await ctx.database.create('cchess_player_records', {
884
+ userId,
885
+ username,
886
+ lose: 0,
887
+ win: 0,
888
+ });
889
+ return sendMessage(session, `【@${session.username}】\n查询对象:${username}
890
+ 无任何游戏记录。`);
891
+ }
892
+ const { win, lose } = targetUserRecord[0];
893
+ return sendMessage(session, `【@${session.username}】\n查询对象:${username}
894
+ 总胜场次数为:${win} 次
895
+ 总输场次数为:${lose} 次
896
+ `);
897
+ });
898
+ // hs*
899
+ async function updatePlayerRecords(channelId, winSide, loseSide) {
900
+ const winnerPlayerRecords = await ctx.database.get('cchess_gaming_player_records', {
901
+ channelId,
902
+ side: convertTurnToString(winSide)
903
+ });
904
+ const loserPlayerRecords = await ctx.database.get('cchess_gaming_player_records', {
905
+ channelId,
906
+ side: convertTurnToString(loseSide)
907
+ });
908
+ for (const winnerPlayerRecord of winnerPlayerRecords) {
909
+ const playerRecord = await ctx.database.get('cchess_player_records', { userId: winnerPlayerRecord.userId });
910
+ await ctx.database.set('cchess_player_records', { userId: winnerPlayerRecord.userId }, { win: playerRecord[0].win + 1 });
911
+ }
912
+ for (const loserPlayerRecord of loserPlayerRecords) {
913
+ const playerRecord = await ctx.database.get('cchess_player_records', { userId: loserPlayerRecord.userId });
914
+ await ctx.database.set('cchess_player_records', { userId: loserPlayerRecord.userId }, { lose: playerRecord[0].lose + 1 });
915
+ }
916
+ }
917
+ async function getLeaderboard(session, type, sortField, title, number) {
918
+ const getPlayers = await ctx.database.get('cchess_player_records', {});
919
+ const sortedPlayers = getPlayers.sort((a, b) => b[sortField] - a[sortField]);
920
+ const topPlayers = sortedPlayers.slice(0, number);
921
+ let result = `${title}:\n`;
922
+ topPlayers.forEach((player, index) => {
923
+ result += `${index + 1}. ${player.username}:${player[sortField]} 次\n`;
924
+ });
925
+ return await sendMessage(session, result);
926
+ }
927
+ async function updateNameInPlayerRecord(userId, username) {
928
+ const userRecord = await ctx.database.get('cchess_player_records', { userId });
929
+ if (userRecord.length === 0) {
930
+ await ctx.database.create('cchess_player_records', {
931
+ userId,
932
+ username,
933
+ });
934
+ return;
935
+ }
936
+ const existingRecord = userRecord[0];
937
+ let isChange = false;
938
+ if (username !== existingRecord.username) {
939
+ existingRecord.username = username;
940
+ isChange = true;
941
+ }
942
+ if (isChange) {
943
+ await ctx.database.set('cchess_player_records', { userId }, {
944
+ username: existingRecord.username,
945
+ });
946
+ }
947
+ }
948
+ async function checkEngine(channelId) {
949
+ if (!engines[channelId]) {
950
+ await ctx.database.set('cchess_game_records', { channelId }, {
951
+ isEngineReady: false
952
+ });
953
+ await initEngine(channelId);
954
+ while (true) {
955
+ const gameRecord = await getGameRecord(channelId);
956
+ if (gameRecord.isEngineReady) {
957
+ break;
958
+ }
959
+ await (0, koishi_1.sleep)(500);
960
+ }
961
+ }
962
+ }
963
+ async function getFenWithFullMove(channelId, t = " ") {
964
+ const gameRecord = await getGameRecord(channelId);
965
+ let {
966
+ // originalState,
967
+ // isHistoryMode,
968
+ startFen } = gameRecord;
969
+ let e = [];
970
+ // , i = this;
971
+ // isHistoryMode && (i = originalState);
972
+ for (let A of gameRecord.moveList)
973
+ e.push(A.move);
974
+ let n = startFen;
975
+ return e.length > 0 && (n += " moves " + e.join(t)),
976
+ n;
977
+ }
978
+ function fenToTurn(t) {
979
+ let e = t.split(" ");
980
+ return "b" == e[1] ? "b" : "w";
981
+ }
982
+ function isValidateFen(t) {
983
+ let e = t.split(" "), i = e[0], n = e[1];
984
+ if (!"rwb".includes(n.toLowerCase()))
985
+ return !1;
986
+ let A = i.split("/");
987
+ if (10 != A.length)
988
+ return !1;
989
+ for (let s = 0; s < A.length; s++) {
990
+ let t = A[s], e = t.length, i = 0;
991
+ for (let n = 0; n < e; n++) {
992
+ let e = t.charAt(n);
993
+ e >= "0" && e <= "9" ? i += parseInt(e) : i++;
994
+ }
995
+ if (9 != i)
996
+ return !1;
997
+ }
998
+ return !0;
999
+ }
1000
+ async function parseFen(channelId, t) {
1001
+ const gameRecord = await getGameRecord(channelId);
1002
+ let { turn, board, } = gameRecord;
1003
+ let e = t.split(" ");
1004
+ board = fenToBoard(e[0]);
1005
+ turn = "b" == e[1] ? "b" : "w";
1006
+ await ctx.database.set('cchess_game_records', { channelId }, {
1007
+ turn,
1008
+ board,
1009
+ });
1010
+ if (e.length > 3 && "moves" == e[2])
1011
+ if (4 == e[3].length)
1012
+ for (let i = 3; i < e.length; i++)
1013
+ await makeMoveByString(channelId, e[i]);
1014
+ else {
1015
+ let t = e[3];
1016
+ for (let e = 0; e < t.length; e += 4)
1017
+ await makeMoveByString(channelId, t.substring(e, e + 4));
1018
+ }
1019
+ }
1020
+ function deepCopy(t) {
1021
+ return JSON.parse(JSON.stringify(t));
1022
+ }
1023
+ async function gotoHistory(channelId, t) {
1024
+ const gameRecord = await getGameRecord(channelId);
1025
+ let { fen, turn, board, moveList, movesAfterLastEat, boardAfterLastEat, turnAfterLastEat, lastMove, isHistoryMode, originalState } = gameRecord;
1026
+ isHistoryMode || (originalState = {
1027
+ fen: getFen(board, turn),
1028
+ turn: turn,
1029
+ board: deepCopy(board),
1030
+ moveList: deepCopy(moveList),
1031
+ movesAfterLastEat: deepCopy(movesAfterLastEat),
1032
+ boardAfterLastEat: deepCopy(boardAfterLastEat),
1033
+ turnAfterLastEat: turnAfterLastEat,
1034
+ lastMove: lastMove
1035
+ },
1036
+ isHistoryMode = !0);
1037
+ let e = t.moveId, i = originalState.moveList.findIndex((t => t.moveId == e));
1038
+ moveList = originalState.moveList.slice(0, i + 1),
1039
+ i = originalState.movesAfterLastEat.findIndex((t => t.moveId == e)),
1040
+ -1 != i ? movesAfterLastEat = originalState.movesAfterLastEat.slice(0, i + 1) : (boardAfterLastEat = fenToBoard(t.fen),
1041
+ turnAfterLastEat = "w" == t.side ? "b" : "w",
1042
+ movesAfterLastEat = []),
1043
+ lastMove = t.moveCord,
1044
+ turn = "w" == t.side ? "b" : "w",
1045
+ board = fenToBoard(t.fen),
1046
+ await ctx.database.set('cchess_game_records', { channelId }, {
1047
+ fen: t.fen,
1048
+ turn,
1049
+ board,
1050
+ moveList,
1051
+ movesAfterLastEat,
1052
+ boardAfterLastEat,
1053
+ turnAfterLastEat,
1054
+ lastMove,
1055
+ originalState,
1056
+ isHistoryMode
1057
+ });
1058
+ }
1059
+ async function gotoStart(channelId) {
1060
+ const gameRecord = await getGameRecord(channelId);
1061
+ let { fen, turn, board, moveList, movesAfterLastEat, boardAfterLastEat, turnAfterLastEat, lastMove, isHistoryMode, originalState, startFen } = gameRecord;
1062
+ isHistoryMode || (originalState = {
1063
+ fen: getFen(board, turn),
1064
+ turn: turn,
1065
+ board: deepCopy(board),
1066
+ moveList: deepCopy(moveList),
1067
+ movesAfterLastEat: deepCopy(movesAfterLastEat),
1068
+ boardAfterLastEat: deepCopy(boardAfterLastEat),
1069
+ turnAfterLastEat: turnAfterLastEat,
1070
+ lastMove: lastMove
1071
+ },
1072
+ isHistoryMode = !0),
1073
+ await parseFen(channelId, startFen),
1074
+ moveList = [],
1075
+ movesAfterLastEat = [],
1076
+ boardAfterLastEat = deepCopy(fenToBoard(fen)),
1077
+ turnAfterLastEat = turn,
1078
+ lastMove = null,
1079
+ await ctx.database.set('cchess_game_records', { channelId }, {
1080
+ moveList,
1081
+ movesAfterLastEat,
1082
+ boardAfterLastEat,
1083
+ turnAfterLastEat,
1084
+ lastMove,
1085
+ originalState,
1086
+ isHistoryMode
1087
+ });
1088
+ }
1089
+ async function undoMove(channelId) {
1090
+ const gameRecord = await getGameRecord(channelId);
1091
+ let { fen, turn, board, moveList, movesAfterLastEat, boardAfterLastEat, turnAfterLastEat, lastMove, isHistoryMode, originalState } = gameRecord;
1092
+ if (isHistoryMode || (originalState = {
1093
+ fen: getFen(board, turn),
1094
+ turn: turn,
1095
+ board: deepCopy(board),
1096
+ moveList: deepCopy(moveList),
1097
+ movesAfterLastEat: deepCopy(movesAfterLastEat),
1098
+ boardAfterLastEat: deepCopy(boardAfterLastEat),
1099
+ turnAfterLastEat: turnAfterLastEat,
1100
+ lastMove: lastMove
1101
+ },
1102
+ isHistoryMode = !0),
1103
+ await ctx.database.set('cchess_game_records', { channelId }, {
1104
+ originalState,
1105
+ isHistoryMode
1106
+ }), moveList.length > 1) {
1107
+ let t = moveList[moveList.length - 2];
1108
+ await gotoHistory(channelId, t);
1109
+ }
1110
+ else
1111
+ await gotoStart(channelId);
1112
+ }
1113
+ async function endGame(channelId) {
1114
+ await ctx.database.remove('cchess_game_records', { channelId });
1115
+ await ctx.database.remove('cchess_gaming_player_records', { channelId });
1116
+ }
1117
+ async function onEngineBestMove(channelId, t, e) {
1118
+ const gameRecord = await getGameRecord(channelId);
1119
+ let { isEnginePlayRed, isEnginePlayBlack,
1120
+ // bestMoveHint,
1121
+ board, turn } = gameRecord;
1122
+ if (!t) {
1123
+ await ctx.database.set('cchess_game_records', { channelId }, {
1124
+ isAnalyzing: false
1125
+ });
1126
+ return;
1127
+ }
1128
+ if ("(none)" === t) {
1129
+ await ctx.database.set('cchess_game_records', { channelId }, {
1130
+ winSide: turn === 'w' ? 'b' : 'w',
1131
+ loseSide: turn,
1132
+ isAnalyzing: false
1133
+ });
1134
+ return;
1135
+ }
1136
+ let i = getSideByMoveString(board, t);
1137
+ if (i !== turn && isEnginePlayRed || i !== turn && isEnginePlayBlack) {
1138
+ await ctx.database.set('cchess_game_records', { channelId }, {
1139
+ winSide: turn,
1140
+ loseSide: turn === 'w' ? 'b' : 'w',
1141
+ isAnalyzing: false
1142
+ });
1143
+ return;
1144
+ }
1145
+ ("w" === i && isEnginePlayRed || "b" === i && isEnginePlayBlack) && (await makeMoveByString(channelId, t));
1146
+ await ctx.database.set('cchess_game_records', { channelId }, {
1147
+ // bestMoveHint,
1148
+ isAnalyzing: false
1149
+ });
1150
+ }
1151
+ function getLocalMoveName(t, e) {
1152
+ let i = {};
1153
+ if ("zh-CN" === e)
1154
+ return t;
1155
+ if ("en-US" === e)
1156
+ i = {
1157
+ "进": "+",
1158
+ "退": "-",
1159
+ "平": "=",
1160
+ "前": "+",
1161
+ "后": "-",
1162
+ "中": "=",
1163
+ "将": "k",
1164
+ "帅": "K",
1165
+ "士": "a",
1166
+ "仕": "A",
1167
+ "象": "b",
1168
+ "相": "B",
1169
+ "车": "r",
1170
+ "马": "n",
1171
+ "炮": "c",
1172
+ "卒": "p",
1173
+ "兵": "P"
1174
+ };
1175
+ else {
1176
+ if ("vi-VN" !== e)
1177
+ return t;
1178
+ i = {
1179
+ "进": ".",
1180
+ "退": "/",
1181
+ "平": "-",
1182
+ "前": ".",
1183
+ "后": "/",
1184
+ "中": "-",
1185
+ "将": "Tg",
1186
+ "帅": "Tg",
1187
+ "士": "S",
1188
+ "仕": "S",
1189
+ "象": "T",
1190
+ "相": "T",
1191
+ "车": "X",
1192
+ "马": "M",
1193
+ "炮": "P",
1194
+ "卒": "B",
1195
+ "兵": "B"
1196
+ };
1197
+ }
1198
+ let n = "一二三四五六七八九", A = "123456789", s = "123456789", a = "", o = -1 !== A.indexOf(t[3]) ? "b" : "w";
1199
+ for (let r of t) {
1200
+ let t = n.indexOf(r), e = A.indexOf(r);
1201
+ a += r in i ? i[r] : -1 !== t ? s[t] : -1 !== e ? s[e] : r;
1202
+ }
1203
+ return a = "w" === o ? a.toUpperCase() : a.toLowerCase(),
1204
+ a;
1205
+ }
1206
+ async function getSerialMoveName(channelId, t, e) {
1207
+ const gameRecord = await getGameRecord(channelId);
1208
+ let i = [];
1209
+ for (let A = 0; A < e.length; A++) {
1210
+ let t = e[A], s = getFigureMoveName(getFen(gameRecord.board, gameRecord.turn), t);
1211
+ i.push(getLocalMoveName(s, 'zh-CN')),
1212
+ await makeMoveByString(channelId, t);
1213
+ }
1214
+ return i.join(" ");
1215
+ }
1216
+ // async function onEngineInfo(channelId, t, e) {
1217
+ // const gameRecord = await getGameRecord(channelId);
1218
+ // let {
1219
+ // isFlipBoard,
1220
+ // bestMoveHint,
1221
+ // ponderHint,
1222
+ // thinkingDetail,
1223
+ // // multiPvInfoBuffer,
1224
+ // thinkingSide
1225
+ // } = gameRecord;
1226
+ // if ("pv" in e) {
1227
+ // let t = e["multipv"]
1228
+ // , n = e["pv"].split(" ");
1229
+ // bestMoveHint[t] = moveStringToPos(n[0]),
1230
+ // n.length > 1 && (ponderHint[t] = moveStringToPos(n[1])),
1231
+ // // drawBoard(),
1232
+ // thinkingSide = gameRecord.turn,
1233
+ // "score" in e && "cp" in e["score"] ? e["score"]["cp"] = e["score"]["cp"] * ("w" == thinkingSide ? 1 : -1) * (isFlipBoard ? -1 : 1) : "score" in e && "mate" in e["score"] && (e["score"]["mate"] = e["score"]["mate"] * ("w" == thinkingSide ? 1 : -1) * (isFlipBoard ? -1 : 1)),
1234
+ // e["board_side"] = isFlipBoard ? "b" : "w",
1235
+ // e["type"] = "engine";
1236
+ // try {
1237
+ // engineSettings.MultiPV > 1 ? e["pv"] = getSerialMoveName(channelId, getFen(gameRecord.board, gameRecord.turn), e["pv"].split(" ").slice(0, 4)) : e["pv"] = getSerialMoveName(channelId, getFen(gameRecord.board, gameRecord.turn), e["pv"].split(" "))
1238
+ // } catch (i) {
1239
+ // }
1240
+ // if (engineSettings.MultiPV > 1) {
1241
+ // if (multiPvInfoBuffer[t] = e,
1242
+ // Object.keys(multiPvInfoBuffer).length === engineSettings.MultiPV) {
1243
+ // for (let t = engineSettings.MultiPV; t >= 1; t--)
1244
+ // thinkingDetail.unshift(multiPvInfoBuffer[t]),
1245
+ // thinkingDetail.length > 50 && thinkingDetail.pop();
1246
+ // multiPvInfoBuffer = {}
1247
+ // }
1248
+ // } else
1249
+ // thinkingDetail.unshift(e),
1250
+ // thinkingDetail.length > 50 && thinkingDetail.pop()
1251
+ // }
1252
+ // await ctx.database.set('cchess_game_records', {channelId}, {
1253
+ // bestMoveHint,
1254
+ // ponderHint,
1255
+ // thinkingDetail,
1256
+ // multiPvInfoBuffer,
1257
+ // thinkingSide
1258
+ // })
1259
+ // }
1260
+ // async function stop(channelId) {
1261
+ // // const gameRecord = await getGameRecord(channelId);
1262
+ // // const lastPV = gameRecord.lastPV;
1263
+ // engines[channelId].terminate()
1264
+ // // engines[channelId].terminate(),
1265
+ // // engines[channelId] = null,
1266
+ // // gameRecord.isAnalyzing = false,
1267
+ // // // null != lastPV && (2 == lastPV.length ? await onEngineInfo(channelId, lastPV[0], lastPV[1]) : await onEngineInfo(channelId, lastPV[0], null)),
1268
+ // // await initEngine(channelId)
1269
+ // }
1270
+ async function go(channelId, t = -1, e = -1, i = -1) {
1271
+ // const gameRecord = await getGameRecord(channelId);
1272
+ // if (gameRecord.isAnalyzing)
1273
+ // return false;
1274
+ {
1275
+ let n = "go";
1276
+ return t > 0 && (n += " movetime " + t),
1277
+ e > 0 && (n += " depth " + e),
1278
+ i > 0 && (n += " nodes " + i),
1279
+ await sendCommand(channelId, n),
1280
+ true;
1281
+ }
1282
+ }
1283
+ async function engineAction(channelId) {
1284
+ const gameRecord = await getGameRecord(channelId);
1285
+ let { isEnginePlayRed, isEnginePlayBlack, turn, movesAfterLastEat, boardAfterLastEat, turnAfterLastEat,
1286
+ // multiPvInfoBuffer
1287
+ } = gameRecord;
1288
+ // if (isEnginePlayRed && "w" === turn || isEnginePlayBlack && "b" === turn) {
1289
+ await sendCommand(channelId, "fen " + getFenWithMove(movesAfterLastEat, boardAfterLastEat, turnAfterLastEat)),
1290
+ // multiPvInfoBuffer = {},
1291
+ await go(channelId, 1e3 * thinkingSettings["movetime"], thinkingSettings["depth"], -1);
1292
+ // }
1293
+ // await ctx.database.set('cchess_game_records', {channelId}, {
1294
+ // multiPvInfoBuffer
1295
+ // })
1296
+ }
1297
+ function moveStringToPos(t) {
1298
+ let e = {
1299
+ a: 0,
1300
+ b: 1,
1301
+ c: 2,
1302
+ d: 3,
1303
+ e: 4,
1304
+ f: 5,
1305
+ g: 6,
1306
+ h: 7,
1307
+ i: 8
1308
+ }, i = {
1309
+ 0: 9,
1310
+ 1: 8,
1311
+ 2: 7,
1312
+ 3: 6,
1313
+ 4: 5,
1314
+ 5: 4,
1315
+ 6: 3,
1316
+ 7: 2,
1317
+ 8: 1,
1318
+ 9: 0
1319
+ }, n = [e[t[0]], i[t[1]]], A = [e[t[2]], i[t[3]]];
1320
+ return [n, A];
1321
+ }
1322
+ async function makeMoveByString(channelId, t) {
1323
+ let e = moveStringToPos(t);
1324
+ await makeMove(channelId, e[0], e[1]);
1325
+ }
1326
+ function getSideByMoveString(board, t) {
1327
+ let e = moveStringToPos(t), i = e[0];
1328
+ return getSide(board[i[1]][i[0]]);
1329
+ }
1330
+ function getFenWithMove(movesAfterLastEat, boardAfterLastEat, turnAfterLastEat) {
1331
+ let t = [];
1332
+ for (let i of movesAfterLastEat)
1333
+ t.push(i.move);
1334
+ let e = boardToFen(boardAfterLastEat, "w", turnAfterLastEat);
1335
+ return t.length > 0 && (e += " moves " + t.join(" ")),
1336
+ e;
1337
+ }
1338
+ async function setOption(channelId, t, e) {
1339
+ await sendCommand(channelId, "setoption name " + t + " value " + e);
1340
+ }
1341
+ async function setOptionList(channelId, t) {
1342
+ for (let e in t)
1343
+ await setOption(channelId, e, t[e]);
1344
+ }
1345
+ // zl*
1346
+ async function sendCommand(channelId, t) {
1347
+ const gameRecord = await getGameRecord(channelId);
1348
+ await checkEngine(channelId);
1349
+ if (engines[channelId] && !gameRecord.isEngineReady) {
1350
+ await ctx.database.set('cchess_game_records', { channelId }, {
1351
+ isEngineReady: true
1352
+ });
1353
+ }
1354
+ if (null !== engines[channelId] || "uci" == t) {
1355
+ engines[channelId].send_command(t);
1356
+ }
1357
+ else {
1358
+ await sendCommand(channelId, t);
1359
+ }
1360
+ }
1361
+ // sc*
1362
+ async function receiveOutput(channelId, t) {
1363
+ try {
1364
+ if (!t)
1365
+ return;
1366
+ let e = t.split(" ");
1367
+ let i = e[0];
1368
+ let keywords = "depth seldepth time nodes pv multipv score currmove currmovenumber hashfull nps tbhits cpuload string refutation currline".split(" ");
1369
+ if (i === "info") {
1370
+ let infoObj = {};
1371
+ for (let j = 1; j < e.length; j++) {
1372
+ switch (e[j]) {
1373
+ case "pv":
1374
+ case "string":
1375
+ infoObj[e[j]] = e.slice(j + 1).join(" ");
1376
+ break;
1377
+ case "score":
1378
+ if (e[j + 1] === "cp") {
1379
+ infoObj[e[j]] = { cp: parseInt(e[j + 2]) };
1380
+ j += 2;
1381
+ }
1382
+ else if (e[j + 1] === "mate") {
1383
+ infoObj[e[j]] = { mate: parseInt(e[j + 2]) };
1384
+ j += 2;
1385
+ }
1386
+ else {
1387
+ infoObj[e[j]] = { cp: parseInt(e[j + 1]) };
1388
+ j++;
1389
+ }
1390
+ break;
1391
+ default:
1392
+ if (e.length > j + 1 && keywords.includes(e[j])) {
1393
+ infoObj[e[j]] = parseInt(e[j + 1]);
1394
+ j++;
1395
+ }
1396
+ else {
1397
+ infoObj[e[j]] = "";
1398
+ }
1399
+ }
1400
+ }
1401
+ if ("pv" in infoObj) {
1402
+ // lastPV = (infoObj["pv"] as string).split(" ");
1403
+ }
1404
+ // await onEngineInfo(channelId, i, infoObj);
1405
+ }
1406
+ else if (i === "bestmove") {
1407
+ // isAnalyzing = false;
1408
+ if (e.length === 4 && e[2] === "ponder") {
1409
+ await onEngineBestMove(channelId, e[1], e[3]);
1410
+ }
1411
+ else {
1412
+ await onEngineBestMove(channelId, e[1], null);
1413
+ }
1414
+ }
1415
+ else if (i === "option" || i === "uciok") {
1416
+ // await ctx.database.set('cchess_game_records', {channelId}, {isEngineReady: true})
1417
+ }
1418
+ }
1419
+ catch (error) {
1420
+ logger.error(error);
1421
+ }
1422
+ }
1423
+ async function engineMessageHandler(channelId, message) {
1424
+ const { command, wasmType, origin } = message;
1425
+ if (!engines[channelId]) {
1426
+ engines[channelId] = null;
1427
+ }
1428
+ if (command !== undefined) {
1429
+ engines[channelId].send_command(command);
1430
+ }
1431
+ else if (wasmType !== undefined) {
1432
+ const wasmOrigin = origin;
1433
+ const wasmScriptPath = path.join(wasmOrigin, 'assets', 'wasm', 'pikafish.js');
1434
+ const Pikafish = require(wasmScriptPath);
1435
+ const instance = await Pikafish({
1436
+ locateFile: (file) => {
1437
+ if (file === "pikafish.data") {
1438
+ return path.join(wasmOrigin, 'assets', 'wasm', 'data', file);
1439
+ }
1440
+ else {
1441
+ return path.join(wasmOrigin, 'assets', 'wasm', file);
1442
+ }
1443
+ },
1444
+ setStatus: (status) => {
1445
+ }
1446
+ });
1447
+ engines[channelId] = instance;
1448
+ engines[channelId].read_stdout = async (stdout) => {
1449
+ // 处理接收到的输出
1450
+ await receiveOutput(channelId, stdout);
1451
+ };
1452
+ // isReady
1453
+ await ctx.database.set('cchess_game_records', { channelId }, { isEngineReady: true });
1454
+ await (0, koishi_1.sleep)(100);
1455
+ // 发送命令 "uci"
1456
+ await sendCommand(channelId, "uci");
1457
+ await (0, koishi_1.sleep)(100);
1458
+ // 设置选项
1459
+ await setOptionList(channelId, engineSettings);
1460
+ }
1461
+ }
1462
+ async function initEngine(channelId) {
1463
+ await engineMessageHandler(channelId, { command: undefined, wasmType: 'single', origin: __dirname });
1464
+ }
1465
+ function findMoveInfo(moveInfoList, moveOperation) {
1466
+ return moveInfoList.find(moveInfo => moveInfo.figureMoveName === moveOperation);
1467
+ }
1468
+ function findLegalMovePositions(moveMap) {
1469
+ const legalPositions = [];
1470
+ for (let i = 0; i < 10; i++) {
1471
+ for (let j = 0; j < 9; j++) {
1472
+ if ((moveMap[i][j] === 'go' || moveMap[i][j] === 'eat')) {
1473
+ legalPositions.push([i, j]);
1474
+ }
1475
+ }
1476
+ }
1477
+ return legalPositions;
1478
+ }
1479
+ function findLetterPositions(board, processedLetter) {
1480
+ const positions = [];
1481
+ for (let i = 0; i < board.length; i++) {
1482
+ for (let j = 0; j < board[i].length; j++) {
1483
+ if (board[i][j] === processedLetter) {
1484
+ positions.push([i, j]);
1485
+ }
1486
+ }
1487
+ }
1488
+ return positions;
1489
+ }
1490
+ function processEnglishLetter(englishLetter, turn) {
1491
+ if (turn === 'w') {
1492
+ return englishLetter.toUpperCase();
1493
+ }
1494
+ else {
1495
+ return englishLetter.toLowerCase();
1496
+ }
1497
+ }
1498
+ const chineseToEnglishMap = {
1499
+ "将": "k",
1500
+ "士": "a",
1501
+ "象": "b",
1502
+ "车": "r",
1503
+ "马": "n",
1504
+ "炮": "c",
1505
+ "卒": "p",
1506
+ "帅": "k",
1507
+ "仕": "a",
1508
+ "相": "b",
1509
+ "兵": "p"
1510
+ };
1511
+ function getEnglishLetterFromFigureName(figureName) {
1512
+ return chineseToEnglishMap[figureName] || null;
1513
+ }
1514
+ function getFigureNameFromMoveOperation(moveOperation) {
1515
+ const figureNamesRegex = new RegExp(possibleFigureNames.join("|"));
1516
+ const figureNameMatches = moveOperation.match(figureNamesRegex);
1517
+ if (figureNameMatches && figureNameMatches.length > 0) {
1518
+ return figureNameMatches[0];
1519
+ }
1520
+ return null;
1521
+ }
1522
+ function isValidFigureMoveName(move) {
1523
+ const possibleActions = ["进", "退", "平"];
1524
+ const possiblePositions = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "9", "8", "7", "6", "5", "4", "3", "2", "1"];
1525
+ const figureNamesRegex = new RegExp(possibleFigureNames.join("|"));
1526
+ const actionRegex = new RegExp(possibleActions.join("|"));
1527
+ const positionRegex = new RegExp(possiblePositions.join("|"), "g");
1528
+ if (move.length !== 4) {
1529
+ return false;
1530
+ }
1531
+ const figureNameMatches = move.match(figureNamesRegex);
1532
+ const actionMatches = move.match(actionRegex);
1533
+ const positionMatches = move.match(positionRegex);
1534
+ return figureNameMatches && figureNameMatches.length === 1 &&
1535
+ actionMatches && actionMatches.length === 1 &&
1536
+ positionMatches && positionMatches.length >= 1 && positionMatches.length <= 2;
1537
+ }
1538
+ function convertTurnToString(turn) {
1539
+ if (turn === 'w') {
1540
+ return '红方';
1541
+ }
1542
+ else if (turn === 'b') {
1543
+ return '黑方';
1544
+ }
1545
+ }
1546
+ async function createImage(buffer) {
1547
+ const canvas = await ctx.canvas.createCanvas(1240, 1560);
1548
+ const context = canvas.getContext('2d');
1549
+ const outerFrame = await ctx.canvas.loadImage(outerFrameImg);
1550
+ context.drawImage(outerFrame, 0, 0, 1240, 1560);
1551
+ const boardImg = await ctx.canvas.loadImage(buffer);
1552
+ context.drawImage(boardImg, 73, 180, 1100, 1210);
1553
+ return canvas.toBuffer('image/png');
1554
+ }
1555
+ function isMoveString(str) {
1556
+ const boardLetters = ["a", "b", "c", "d", "e", "f", "g", "h", "i"];
1557
+ if (str.length !== 4) {
1558
+ return false;
1559
+ }
1560
+ return boardLetters.includes(str[0]) &&
1561
+ boardLetters.includes(str[2]) &&
1562
+ parseInt(str[1]) >= 0 && parseInt(str[1]) <= 9 &&
1563
+ parseInt(str[3]) >= 0 && parseInt(str[3]) <= 9;
1564
+ }
1565
+ function getType(t) {
1566
+ return t.toLowerCase();
1567
+ }
1568
+ function getValidMoveMapKings(board, t, e) {
1569
+ let i, n, A = getEmptyBoard(), s = e[0], a = e[1];
1570
+ a <= 2 ? (i = 0,
1571
+ n = 2) : a >= 7 ? (i = 7,
1572
+ n = 9) : (i = a - 1,
1573
+ n = a + 1);
1574
+ let o = 3, r = 5;
1575
+ if (s + 1 <= r) {
1576
+ let e = getValidType(board, t, [s + 1, a]);
1577
+ "eat" != e && "go" != e || setMoveMap(A, [s + 1, a], e);
1578
+ }
1579
+ if (s - 1 >= o) {
1580
+ let e = getValidType(board, t, [s - 1, a]);
1581
+ "eat" != e && "go" != e || setMoveMap(A, [s - 1, a], e);
1582
+ }
1583
+ if (a + 1 <= n) {
1584
+ let e = getValidType(board, t, [s, a + 1]);
1585
+ "eat" != e && "go" != e || setMoveMap(A, [s, a + 1], e);
1586
+ }
1587
+ if (a - 1 >= i) {
1588
+ let e = getValidType(board, t, [s, a - 1]);
1589
+ "eat" != e && "go" != e || setMoveMap(A, [s, a - 1], e);
1590
+ }
1591
+ return A;
1592
+ }
1593
+ function getValidMoveMapCannons(board, t, e) {
1594
+ let i = getEmptyBoard(), n = e[0], A = e[1], s = !1;
1595
+ for (let a = n; a < 9; a++) {
1596
+ if (a == n)
1597
+ continue;
1598
+ let e = getValidType(board, t, [a, A]);
1599
+ if (s || "block" != e && "eat" != e) {
1600
+ if (s && "eat" == e) {
1601
+ setMoveMap(i, [a, A], "eat");
1602
+ break;
1603
+ }
1604
+ s || "go" != e || setMoveMap(i, [a, A], "go");
1605
+ }
1606
+ else
1607
+ s = !0;
1608
+ }
1609
+ s = !1;
1610
+ for (let a = n; a >= 0; a--) {
1611
+ if (a == n)
1612
+ continue;
1613
+ let e = getValidType(board, t, [a, A]);
1614
+ if (s || "block" != e && "eat" != e) {
1615
+ if (s && "eat" == e) {
1616
+ setMoveMap(i, [a, A], "eat");
1617
+ break;
1618
+ }
1619
+ s || "go" != e || setMoveMap(i, [a, A], "go");
1620
+ }
1621
+ else
1622
+ s = !0;
1623
+ }
1624
+ s = !1;
1625
+ for (let a = A; a < 10; a++) {
1626
+ if (a == A)
1627
+ continue;
1628
+ let e = getValidType(board, t, [n, a]);
1629
+ if (s || "block" != e && "eat" != e) {
1630
+ if (s && "eat" == e) {
1631
+ setMoveMap(i, [n, a], "eat");
1632
+ break;
1633
+ }
1634
+ s || "go" != e || setMoveMap(i, [n, a], "go");
1635
+ }
1636
+ else
1637
+ s = !0;
1638
+ }
1639
+ s = !1;
1640
+ for (let a = A; a >= 0; a--) {
1641
+ if (a == A)
1642
+ continue;
1643
+ let e = getValidType(board, t, [n, a]);
1644
+ if (s || "block" != e && "eat" != e) {
1645
+ if (s && "eat" == e) {
1646
+ setMoveMap(i, [n, a], "eat");
1647
+ break;
1648
+ }
1649
+ s || "go" != e || setMoveMap(i, [n, a], "go");
1650
+ }
1651
+ else
1652
+ s = !0;
1653
+ }
1654
+ return i;
1655
+ }
1656
+ function getSideByKing(board, t) {
1657
+ t[0];
1658
+ let e = t[1];
1659
+ if (e <= 4)
1660
+ for (let i = 3; i <= 5; i++)
1661
+ for (let t = 0; t <= 2; t++) {
1662
+ let e = getPiece(board, [i, t]);
1663
+ if ("K" == e)
1664
+ return "w";
1665
+ if ("k" == e)
1666
+ return "b";
1667
+ }
1668
+ else
1669
+ for (let i = 3; i <= 5; i++)
1670
+ for (let t = 7; t <= 9; t++) {
1671
+ let e = getPiece(board, [i, t]);
1672
+ if ("K" == e)
1673
+ return "w";
1674
+ if ("k" == e)
1675
+ return "b";
1676
+ }
1677
+ return "";
1678
+ }
1679
+ function getValidMoveMapPawns(board, t, e) {
1680
+ let i = getEmptyBoard(), n = e[0], A = e[1], s = getSideByKing(board, e);
1681
+ if (t == s)
1682
+ if (A <= 4) {
1683
+ let e = getValidType(board, t, [n, A + 1]);
1684
+ "eat" != e && "go" != e || setMoveMap(i, [n, A + 1], e);
1685
+ }
1686
+ else {
1687
+ let e = getValidType(board, t, [n, A - 1]);
1688
+ "eat" != e && "go" != e || setMoveMap(i, [n, A - 1], e);
1689
+ }
1690
+ else {
1691
+ if (A <= 4) {
1692
+ let e = getValidType(board, t, [n, A - 1]);
1693
+ "eat" != e && "go" != e || setMoveMap(i, [n, A - 1], e);
1694
+ }
1695
+ else {
1696
+ let e = getValidType(board, t, [n, A + 1]);
1697
+ "eat" != e && "go" != e || setMoveMap(i, [n, A + 1], e);
1698
+ }
1699
+ let e = getValidType(board, t, [n + 1, A]);
1700
+ "eat" != e && "go" != e || setMoveMap(i, [n + 1, A], e),
1701
+ e = getValidType(board, t, [n - 1, A]),
1702
+ "eat" != e && "go" != e || setMoveMap(i, [n - 1, A], e);
1703
+ }
1704
+ return i;
1705
+ }
1706
+ function getValidMoveMapBishops(board, t, e) {
1707
+ let i, n, A = getEmptyBoard(), s = e[0], a = e[1];
1708
+ if (a <= 4 ? (i = 0,
1709
+ n = 4) : a >= 5 ? (i = 5,
1710
+ n = 9) : (i = a - 1,
1711
+ n = a + 1),
1712
+ s + 2 <= 9 && a + 2 <= n) {
1713
+ let e = getPiece(board, [s + 1, a + 1]);
1714
+ if ("" == e) {
1715
+ let e = getValidType(board, t, [s + 2, a + 2]);
1716
+ "eat" != e && "go" != e || setMoveMap(A, [s + 2, a + 2], e);
1717
+ }
1718
+ }
1719
+ if (s - 2 >= 0 && a + 2 <= n) {
1720
+ let e = getPiece(board, [s - 1, a + 1]);
1721
+ if ("" == e) {
1722
+ let e = getValidType(board, t, [s - 2, a + 2]);
1723
+ "eat" != e && "go" != e || setMoveMap(A, [s - 2, a + 2], e);
1724
+ }
1725
+ }
1726
+ if (s + 2 <= 9 && a - 2 >= i) {
1727
+ let e = getPiece(board, [s + 1, a - 1]);
1728
+ if ("" == e) {
1729
+ let e = getValidType(board, t, [s + 2, a - 2]);
1730
+ "eat" != e && "go" != e || setMoveMap(A, [s + 2, a - 2], e);
1731
+ }
1732
+ }
1733
+ if (s - 2 >= 0 && a - 2 >= i) {
1734
+ let e = getPiece(board, [s - 1, a - 1]);
1735
+ if ("" == e) {
1736
+ let e = getValidType(board, t, [s - 2, a - 2]);
1737
+ "eat" != e && "go" != e || setMoveMap(A, [s - 2, a - 2], e);
1738
+ }
1739
+ }
1740
+ return A;
1741
+ }
1742
+ function getValidMoveMap(board, type, side, position) {
1743
+ switch (type) {
1744
+ case "r":
1745
+ return getValidMoveMapRooks(board, side, position);
1746
+ case "n":
1747
+ return getValidMoveMapKnights(board, side, position);
1748
+ case "a":
1749
+ return getValidMoveMapAdvisors(board, side, position);
1750
+ case "b":
1751
+ return getValidMoveMapBishops(board, side, position);
1752
+ case "k":
1753
+ return getValidMoveMapKings(board, side, position);
1754
+ case "c":
1755
+ return getValidMoveMapCannons(board, side, position);
1756
+ case "p":
1757
+ return getValidMoveMapPawns(board, side, position);
1758
+ default:
1759
+ return getEmptyBoard();
1760
+ }
1761
+ }
1762
+ function getValidMoveMapRooks(board, t, e) {
1763
+ let i = getEmptyBoard(), n = e[0], A = e[1];
1764
+ for (let s = n; s < 9; s++) {
1765
+ if (s == n)
1766
+ continue;
1767
+ let e = getValidType(board, t, [s, A]);
1768
+ if ("block" == e)
1769
+ break;
1770
+ if (i[A][s] = e,
1771
+ "eat" == e)
1772
+ break;
1773
+ }
1774
+ for (let s = n; s >= 0; s--) {
1775
+ if (s == n)
1776
+ continue;
1777
+ let e = getValidType(board, t, [s, A]);
1778
+ if ("block" == e)
1779
+ break;
1780
+ if (i[A][s] = e,
1781
+ "eat" == e)
1782
+ break;
1783
+ }
1784
+ for (let s = A; s < 10; s++) {
1785
+ if (s == A)
1786
+ continue;
1787
+ let e = getValidType(board, t, [n, s]);
1788
+ if ("block" == e)
1789
+ break;
1790
+ if (i[s][n] = e,
1791
+ "eat" == e)
1792
+ break;
1793
+ }
1794
+ for (let s = A; s >= 0; s--) {
1795
+ if (s == A)
1796
+ continue;
1797
+ let e = getValidType(board, t, [n, s]);
1798
+ if ("block" == e)
1799
+ break;
1800
+ if (i[s][n] = e,
1801
+ "eat" == e)
1802
+ break;
1803
+ }
1804
+ return i;
1805
+ }
1806
+ function getValidType(board, t, e) {
1807
+ let i = getPiece(board, e);
1808
+ return void 0 == i ? "invalid" : "" == i ? "go" : t != getSide(i) ? "eat" : "block";
1809
+ }
1810
+ function getValidMoveMapAdvisors(board, t, e) {
1811
+ let i, n, A = getEmptyBoard(), s = e[0], a = e[1];
1812
+ a <= 2 ? (i = 0,
1813
+ n = 2) : a >= 7 ? (i = 7,
1814
+ n = 9) : (i = a - 1,
1815
+ n = a + 1);
1816
+ let o = 3, r = 5;
1817
+ if (s + 1 <= r && a + 1 <= n) {
1818
+ let e = getValidType(board, t, [s + 1, a + 1]);
1819
+ "eat" != e && "go" != e || setMoveMap(A, [s + 1, a + 1], e);
1820
+ }
1821
+ if (s - 1 >= o && a + 1 <= n) {
1822
+ let e = getValidType(board, t, [s - 1, a + 1]);
1823
+ "eat" != e && "go" != e || setMoveMap(A, [s - 1, a + 1], e);
1824
+ }
1825
+ if (s + 1 <= r && a - 1 >= i) {
1826
+ let e = getValidType(board, t, [s + 1, a - 1]);
1827
+ "eat" != e && "go" != e || setMoveMap(A, [s + 1, a - 1], e);
1828
+ }
1829
+ if (s - 1 >= o && a - 1 >= i) {
1830
+ let e = getValidType(board, t, [s - 1, a - 1]);
1831
+ "eat" != e && "go" != e || setMoveMap(A, [s - 1, a - 1], e);
1832
+ }
1833
+ return A;
1834
+ }
1835
+ function setMoveMap(t, e, i) {
1836
+ e[0] < 0 || e[0] > 8 || e[1] < 0 || e[1] > 9 || (t[e[1]][e[0]] = i);
1837
+ }
1838
+ function getValidMoveMapKnights(board, t, e) {
1839
+ let i = getEmptyBoard(), n = e[0], A = e[1];
1840
+ return "" == getPiece(board, [n + 1, A]) && (setMoveMap(i, [n + 2, A + 1], getValidType(board, t, [n + 2, A + 1])),
1841
+ setMoveMap(i, [n + 2, A - 1], getValidType(board, t, [n + 2, A - 1]))),
1842
+ "" == getPiece(board, [n - 1, A]) && (setMoveMap(i, [n - 2, A + 1], getValidType(board, t, [n - 2, A + 1])),
1843
+ setMoveMap(i, [n - 2, A - 1], getValidType(board, t, [n - 2, A - 1]))),
1844
+ "" == getPiece(board, [n, A + 1]) && (setMoveMap(i, [n + 1, A + 2], getValidType(board, t, [n + 1, A + 2])),
1845
+ setMoveMap(i, [n - 1, A + 2], getValidType(board, t, [n - 1, A + 2]))),
1846
+ "" == getPiece(board, [n, A - 1]) && (setMoveMap(i, [n + 1, A - 2], getValidType(board, t, [n + 1, A - 2])),
1847
+ setMoveMap(i, [n - 1, A - 2], getValidType(board, t, [n - 1, A - 2]))),
1848
+ i;
1849
+ }
1850
+ var Et = [];
1851
+ Et["w"] = [],
1852
+ Et["b"] = [],
1853
+ Et["w"][0] = "进",
1854
+ Et["w"][1] = "退",
1855
+ Et["b"][0] = "退",
1856
+ Et["b"][1] = "进",
1857
+ Et["p"] = "平";
1858
+ var Ht = [];
1859
+ Ht["w"] = [],
1860
+ Ht["b"] = [],
1861
+ Ht["w"][0] = "前",
1862
+ Ht["w"][1] = "后",
1863
+ Ht["b"][0] = "后",
1864
+ Ht["b"][1] = "前",
1865
+ Ht["m"] = "中";
1866
+ var qt = [];
1867
+ qt["k"] = "将",
1868
+ qt["a"] = "士",
1869
+ qt["b"] = "象",
1870
+ qt["r"] = "车",
1871
+ qt["n"] = "马",
1872
+ qt["c"] = "炮",
1873
+ qt["p"] = "卒",
1874
+ qt["K"] = "帅",
1875
+ qt["A"] = "仕",
1876
+ qt["B"] = "相",
1877
+ qt["R"] = "车",
1878
+ qt["N"] = "马",
1879
+ qt["C"] = "炮",
1880
+ qt["P"] = "兵";
1881
+ var Qt = [];
1882
+ Qt["w"] = [],
1883
+ Qt["b"] = [],
1884
+ Qt["w"][0] = "一",
1885
+ Qt["w"][1] = "二",
1886
+ Qt["w"][2] = "三",
1887
+ Qt["w"][3] = "四",
1888
+ Qt["w"][4] = "五",
1889
+ Qt["w"][5] = "六",
1890
+ Qt["w"][6] = "七",
1891
+ Qt["w"][7] = "八",
1892
+ Qt["w"][8] = "九",
1893
+ // Qt["b"][0] = "9",
1894
+ // Qt["b"][1] = "8",
1895
+ // Qt["b"][2] = "7",
1896
+ // Qt["b"][3] = "6",
1897
+ // Qt["b"][4] = "5",
1898
+ // Qt["b"][5] = "4",
1899
+ // Qt["b"][6] = "3",
1900
+ // Qt["b"][7] = "2",
1901
+ // Qt["b"][8] = "1";
1902
+ Qt["b"][0] = "9",
1903
+ Qt["b"][1] = "8",
1904
+ Qt["b"][2] = "7",
1905
+ Qt["b"][3] = "6",
1906
+ Qt["b"][4] = "5",
1907
+ Qt["b"][5] = "4",
1908
+ Qt["b"][6] = "3",
1909
+ Qt["b"][7] = "2",
1910
+ Qt["b"][8] = "1";
1911
+ function parseChessNotation(fen) {
1912
+ let e = [];
1913
+ for (let s = 0; s < 9; s++) {
1914
+ e[s] = [];
1915
+ for (let t = 0; t < 10; t++)
1916
+ e[s][t] = 0;
1917
+ }
1918
+ let i = fen.split(" ")[0].split("/"), n = ["k", "a", "b", "r", "n", "c", "p", "K", "A", "B", "R", "N", "C", "P"], A = 0;
1919
+ for (let s = 0; s < 10; s++) {
1920
+ let t = i[s], a = 0;
1921
+ for (let i = 0; i < t.length; i++) {
1922
+ let o = t[i];
1923
+ if (o >= "0" && o <= "9")
1924
+ a += parseInt(o);
1925
+ else if (-1 != n.indexOf(o)) {
1926
+ let t = o >= "a" && o <= "z" ? "b" : "w";
1927
+ e[a][s] = t + o + A,
1928
+ a++,
1929
+ A++;
1930
+ }
1931
+ }
1932
+ }
1933
+ return e;
1934
+ }
1935
+ function getFigureMoveName(fen, moveString) {
1936
+ let i = parseChessNotation(fen);
1937
+ var n = moveString.charCodeAt(0) - 97, A = 9 - (moveString.charCodeAt(1) - 48), s = moveString.charCodeAt(2) - 97, a = 9 - (moveString.charCodeAt(3) - 48), o = 0, r = 0, l = 0, d = '';
1938
+ if ("A" != i[n][A].charAt(1) && "B" != i[n][A].charAt(1) && "a" != i[n][A].charAt(1) && "b" != i[n][A].charAt(1)) {
1939
+ for (var g = 0; g < 9; g++)
1940
+ if (g != n) {
1941
+ for (var f = 0; f < 10; f++)
1942
+ 0 != i[g][f] && i[g][f].substring(0, 2) == i[n][A].substring(0, 2) && l++;
1943
+ l < 2 && (l = 0);
1944
+ }
1945
+ for (f = 0; f < 10; f++)
1946
+ 0 != i[n][f] && i[n][f].substring(0, 2) == i[n][A].substring(0, 2) && (f < A ? 0 == l ? (d = Ht[i[n][A].charAt(0)][1] + qt[i[n][A].charAt(1)],
1947
+ o++) : (d = Ht[i[n][A].charAt(0)][1] + Qt[i[n][A].charAt(0)][9 - n - 1],
1948
+ o++) : f == A ? 0 == o ? d = qt[i[n][A].charAt(1)] + Qt[i[n][A].charAt(0)][9 - n - 1] : r = o : 0 == l ? 0 == o ? d = Ht[i[n][A].charAt(0)][0] + qt[i[n][A].charAt(1)] : (d = Ht["m"] + qt[i[n][A].charAt(1)],
1949
+ o++) : 0 == o ? d = Ht[i[n][A].charAt(0)][0] + Qt[i[n][A].charAt(0)][9 - n - 1] : (d = Ht["m"] + Qt[i[n][A].charAt(0)][9 - n - 1],
1950
+ o++));
1951
+ o > 2 && o != r && (d = "w" == i[n][A].charAt(0) ? Qt["w"][r] + qt[i[n][A].charAt(1)] : Qt["w"][o - r] + qt[i[n][A].charAt(1)]);
1952
+ }
1953
+ else
1954
+ d = qt[i[n][A].charAt(1)] + Qt[i[n][A].charAt(0)][9 - n - 1];
1955
+ var h = '';
1956
+ return h = A > a ? n == s ? "w" == i[n][A].charAt(0) ? Et[i[n][A].charAt(0)][0] + Qt[i[n][A].charAt(0)][A - a - 1] : Et[i[n][A].charAt(0)][0] + Qt[i[n][A].charAt(0)][9 - (A - a - 1) - 1] : Et[i[n][A].charAt(0)][0] + Qt[i[n][A].charAt(0)][9 - s - 1] : A == a ? Et["p"] + Qt[i[n][A].charAt(0)][9 - s - 1] : n == s ? "w" == i[n][A].charAt(0) ? Et[i[n][A].charAt(0)][1] + Qt[i[n][A].charAt(0)][a - A - 1] : Et[i[n][A].charAt(0)][1] + Qt[i[n][A].charAt(0)][9 - (a - A - 1) - 1] : Et[i[n][A].charAt(0)][1] + Qt[i[n][A].charAt(0)][9 - s - 1],
1957
+ d + h;
1958
+ }
1959
+ function moveToMoveString(move) {
1960
+ const boardLetters = ["a", "b", "c", "d", "e", "f", "g", "h", "i"];
1961
+ let startSquare = move[0];
1962
+ let endSquare = move[1];
1963
+ let startSquareAlgebraic = boardLetters[startSquare[0]] + (9 - startSquare[1]).toString();
1964
+ let endSquareAlgebraic = boardLetters[endSquare[0]] + (9 - endSquare[1]).toString();
1965
+ return startSquareAlgebraic + endSquareAlgebraic;
1966
+ }
1967
+ function moveStringToMove(moveString) {
1968
+ const boardLetters = ["a", "b", "c", "d", "e", "f", "g", "h", "i"];
1969
+ let startSquareAlgebraic = moveString.substring(0, 2);
1970
+ let endSquareAlgebraic = moveString.substring(2);
1971
+ let startSquare = [boardLetters.indexOf(startSquareAlgebraic[0]), 9 - parseInt(startSquareAlgebraic[1])];
1972
+ let endSquare = [boardLetters.indexOf(endSquareAlgebraic[0]), 9 - parseInt(endSquareAlgebraic[1])];
1973
+ return [startSquare, endSquare];
1974
+ }
1975
+ function genRandomId(length) {
1976
+ let id = "";
1977
+ const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
1978
+ for (let i = 0; i < length; i++) {
1979
+ id += characters.charAt(Math.floor(Math.random() * characters.length));
1980
+ }
1981
+ return id;
1982
+ }
1983
+ async function makeMove(channelId, fromPos, toPos) {
1984
+ const gameRecord = await getGameRecord(channelId);
1985
+ let { turn, board, moveTreePtr, moveList, isHistoryMode, boardAfterLastEat, turnAfterLastEat, movesAfterLastEat } = gameRecord;
1986
+ if (isHistoryMode) {
1987
+ gameRecord.isHistoryMode = false;
1988
+ }
1989
+ const lastMove = [fromPos, toPos];
1990
+ const moveId = genRandomId(8);
1991
+ const pieceAtDestination = board[toPos[1]][toPos[0]] !== "";
1992
+ const side = getSide(getPiece(board, fromPos));
1993
+ const fen = getFen(board, side);
1994
+ if (board[toPos[1]][toPos[0]] === 'K' || board[toPos[1]][toPos[0]] === 'k') {
1995
+ await ctx.database.set('cchess_game_records', { channelId }, {
1996
+ winSide: board[toPos[1]][toPos[0]] === 'K' ? 'b' : 'w',
1997
+ loseSide: board[toPos[1]][toPos[0]] === 'K' ? 'w' : 'b',
1998
+ });
1999
+ }
2000
+ board[toPos[1]][toPos[0]] = board[fromPos[1]][fromPos[0]];
2001
+ board[fromPos[1]][fromPos[0]] = "";
2002
+ turn = turn === getSide(board[toPos[1]][toPos[0]]) ? (turn === "w" ? "b" : "w") : turn;
2003
+ const moveString = moveToMoveString([fromPos, toPos]);
2004
+ const figureMoveName = getFigureMoveName(fen, moveString);
2005
+ const moveData = {
2006
+ moveId,
2007
+ fen: getFen(board, turn),
2008
+ side,
2009
+ moveCord: [fromPos, toPos],
2010
+ move: moveString,
2011
+ chnMoveName: figureMoveName,
2012
+ next: null
2013
+ };
2014
+ moveList.push(moveData);
2015
+ moveTreePtr.next = moveData;
2016
+ moveTreePtr = moveData;
2017
+ if (pieceAtDestination) {
2018
+ boardAfterLastEat = fenToBoard(getFen(board, turn));
2019
+ turnAfterLastEat = turn;
2020
+ movesAfterLastEat = [];
2021
+ }
2022
+ else {
2023
+ movesAfterLastEat.push(moveData);
2024
+ }
2025
+ const updatedGameRecord = {
2026
+ turn,
2027
+ board,
2028
+ lastMove,
2029
+ moveTreePtr,
2030
+ moveList,
2031
+ isHistoryMode,
2032
+ boardAfterLastEat,
2033
+ turnAfterLastEat,
2034
+ movesAfterLastEat
2035
+ };
2036
+ Object.assign(gameRecord, updatedGameRecord);
2037
+ await ctx.database.set('cchess_game_records', { channelId }, updatedGameRecord);
2038
+ }
2039
+ function getFen(board, turn) {
2040
+ return boardToFen(board, 'w', turn);
2041
+ }
2042
+ function boardToFen(board, side, turn = "w") {
2043
+ if (board === null) {
2044
+ return "";
2045
+ }
2046
+ const ranks = side === "w" ? [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] : [9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
2047
+ let fenString = "";
2048
+ for (const row of ranks) {
2049
+ let emptyCount = 0;
2050
+ for (let col = 0; col < 9; col++) {
2051
+ const piece = board[row][col];
2052
+ if (piece === "") {
2053
+ emptyCount++;
2054
+ }
2055
+ else {
2056
+ if (emptyCount > 0) {
2057
+ fenString += emptyCount;
2058
+ emptyCount = 0;
2059
+ }
2060
+ fenString += piece;
2061
+ }
2062
+ }
2063
+ if (emptyCount > 0) {
2064
+ fenString += emptyCount;
2065
+ }
2066
+ fenString += "/";
2067
+ }
2068
+ fenString = fenString.substring(0, fenString.length - 1) + " " + turn;
2069
+ return fenString;
2070
+ }
2071
+ function getSide(piece) {
2072
+ let e = "RNBAKCP";
2073
+ return e.includes(piece) ? "w" : "b";
2074
+ }
2075
+ async function getGameRecord(channelId) {
2076
+ let gameRecord = await ctx.database.get('cchess_game_records', { channelId });
2077
+ if (gameRecord.length === 0) {
2078
+ await ctx.database.create('cchess_game_records', {
2079
+ channelId,
2080
+ });
2081
+ gameRecord = await ctx.database.get('cchess_game_records', { channelId });
2082
+ }
2083
+ return gameRecord[0];
2084
+ }
2085
+ async function drawChessBoard(channelId) {
2086
+ const gameRecord = await getGameRecord(channelId);
2087
+ let { board, lastMove, moveList, currentMoveId } = gameRecord;
2088
+ const canvas = await ctx.canvas.createCanvas(weight * scale, height * scale);
2089
+ const context = canvas.getContext('2d');
2090
+ const boardImg = await ctx.canvas.loadImage(boardSkinImg);
2091
+ context.drawImage(boardImg, 0, 0, weight * scale, height * scale);
2092
+ const pieceImages = {};
2093
+ const pieceImagePromises = Object.keys(piecesImgResources).map(piece => {
2094
+ return ctx.canvas.loadImage(piecesImgResources[piece]).then(img => {
2095
+ pieceImages[piece] = img;
2096
+ });
2097
+ });
2098
+ await Promise.all(pieceImagePromises);
2099
+ for (let row = 0; row < 10; row++) {
2100
+ for (let col = 0; col < 9; col++) {
2101
+ const piece = getPiece(board, [col, row]);
2102
+ if (piece === "")
2103
+ continue;
2104
+ const xPos = ((isFlipBoard ? 8 - col : col) * we + Pe - Be / 2) * scale;
2105
+ const yPos = ((isFlipBoard ? 9 - row : row) * we + Pe - Be / 2) * scale;
2106
+ const pieceImg = pieceImages[piece];
2107
+ context.drawImage(pieceImg, xPos, yPos, Be * scale, Be * scale);
2108
+ }
2109
+ }
2110
+ if (lastMove !== null) {
2111
+ let i = lastMove, n = i[0], A = i[1], s = n[0], a = n[1], o = A[0], r = A[1];
2112
+ // isFlipBoard && (s = 8 - s,
2113
+ // a = 9 - a,
2114
+ // o = 8 - o,
2115
+ // r = 9 - r);
2116
+ let l = s * we + pe, d = a * we + Pe, g = o * we + pe, f = r * we + Pe, h = Math.sqrt((l - g) * (l - g) + (d - f) * (d - f)), b = l + (g - l) * (h - 30) / h, c = d + (f - d) * (h - 30) / h;
2117
+ await drawLineArrow(context, l * scale, d * scale, b * scale, c * scale, "rgba(128, 171, 69, 0.7)", 15 * scale);
2118
+ }
2119
+ if (moveList.length > 0) {
2120
+ currentMoveId = moveList[moveList.length - 1].moveId;
2121
+ await ctx.database.set('cchess_game_records', { channelId }, { currentMoveId });
2122
+ }
2123
+ if (config.isChessImageWithOutlineEnabled) {
2124
+ return await createImage(await canvas.toBuffer('image/png'));
2125
+ }
2126
+ else {
2127
+ return await canvas.toBuffer('image/png');
2128
+ }
2129
+ }
2130
+ async function drawLineArrow(t, e, i, n, A, s = "black", a = 20) {
2131
+ var o = .282 * Math.sqrt((e - n) * (e - n) + (i - A) * (i - A));
2132
+ o = a;
2133
+ var r, l, d = 45, g = 180 * Math.atan2(i - A, e - n) / Math.PI, f = (g + d) * Math.PI / 180, h = (g - d) * Math.PI / 180, b = o * Math.cos(f), c = o * Math.sin(f), u = o * Math.cos(h), v = o * Math.sin(h), m = e > n, w = i > A;
2134
+ r = n + b,
2135
+ l = A + c;
2136
+ var I = n + u, p = A + v, P = w ? r + .25 * Math.abs(I - r) : r - .25 * Math.abs(I - r), B = m ? l - .25 * Math.abs(p - l) : l + .25 * Math.abs(p - l), M = w ? r + .75 * Math.abs(I - r) : r - .75 * Math.abs(I - r), y = m ? l - .75 * Math.abs(p - l) : l + .75 * Math.abs(p - l);
2137
+ t.beginPath(),
2138
+ t.moveTo(e, i),
2139
+ t.lineTo(P, B),
2140
+ t.lineTo(r, l),
2141
+ t.lineTo(n, A),
2142
+ t.lineTo(I, p),
2143
+ t.lineTo(M, y),
2144
+ t.lineTo(e, i),
2145
+ t.closePath(),
2146
+ t.strokeStyle = s,
2147
+ t.fillStyle = s,
2148
+ t.fill(),
2149
+ t.stroke();
2150
+ }
2151
+ function loadPiecesImageResources(folder, format = "webp") {
2152
+ const imgResources = {};
2153
+ const resources = [
2154
+ { prefix: 'w', type: 'rnbakcp' },
2155
+ { prefix: 'b', type: 'rnbakcp' },
2156
+ ];
2157
+ for (const { prefix, type } of resources) {
2158
+ const items = Array.from(type);
2159
+ for (const item of items) {
2160
+ const filename = `${prefix}${item}`;
2161
+ const imgFilePath = path.join(__dirname, 'assets', '棋子皮肤', folder, `${filename}.${format}`);
2162
+ const key = prefix === 'w' ? item.toUpperCase() : item;
2163
+ imgResources[key] = fs.readFileSync(imgFilePath);
2164
+ }
2165
+ }
2166
+ return imgResources;
2167
+ }
2168
+ function fenToBoard(fenString) {
2169
+ let fenParts = fenString.split(" ");
2170
+ let rows = fenParts[0].split("/");
2171
+ let emptyBoard = getEmptyBoard();
2172
+ let pieceTypes = "rnbakRNBAKCPcp".split("");
2173
+ let numbers = "123456789".split("");
2174
+ for (let rowIdx in rows) {
2175
+ let colIdx = 0;
2176
+ let currentRow = rows[rowIdx].split("");
2177
+ for (let i = 0; i < currentRow.length; i++) {
2178
+ if (pieceTypes.includes(currentRow[i])) {
2179
+ emptyBoard[rowIdx][colIdx] = currentRow[i];
2180
+ colIdx++;
2181
+ }
2182
+ else if (numbers.includes(currentRow[i])) {
2183
+ colIdx += Number(currentRow[i]);
2184
+ }
2185
+ }
2186
+ }
2187
+ return emptyBoard;
2188
+ }
2189
+ function getEmptyBoard() {
2190
+ let emptyBoard = [];
2191
+ for (let row = 0; row < 10; row++) {
2192
+ let currentRow = [];
2193
+ for (let col = 0; col < 9; col++) {
2194
+ currentRow.push("");
2195
+ }
2196
+ emptyBoard.push(currentRow);
2197
+ }
2198
+ return emptyBoard;
2199
+ }
2200
+ function getPiece(board, position) {
2201
+ if (position[0] < 0 || position[0] > 8 || position[1] < 0 || position[1] > 9) {
2202
+ return "invalid";
2203
+ }
2204
+ else {
2205
+ const piece = board[position[1]][position[0]];
2206
+ return piece ? piece : "";
2207
+ }
2208
+ }
2209
+ let sentMessages = [];
2210
+ async function sendMessage(session, message) {
2211
+ const { bot, channelId } = session;
2212
+ let messageId;
2213
+ if (config.isTextToImageConversionEnabled) {
2214
+ const lines = message.split('\n');
2215
+ const isOnlyImgTag = lines.length === 1 && lines[0].trim().startsWith('<img');
2216
+ if (isOnlyImgTag) {
2217
+ await session.send(message);
2218
+ }
2219
+ else {
2220
+ const modifiedMessage = lines
2221
+ .map((line) => {
2222
+ if (line.trim() !== '' && !line.includes('<img')) {
2223
+ return `# ${line}`;
2224
+ }
2225
+ else {
2226
+ return line + '\n';
2227
+ }
2228
+ })
2229
+ .join('\n');
2230
+ const imageBuffer = await ctx.markdownToImage.convertToImage(modifiedMessage);
2231
+ [messageId] = await session.send(koishi_1.h.image(imageBuffer, `image/${config.imageType}`));
2232
+ }
2233
+ }
2234
+ else {
2235
+ [messageId] = await session.send(message);
2236
+ }
2237
+ if (config.retractDelay === 0)
2238
+ return;
2239
+ sentMessages.push(messageId);
2240
+ if (sentMessages.length > 1) {
2241
+ const oldestMessageId = sentMessages.shift();
2242
+ setTimeout(async () => {
2243
+ await bot.deleteMessage(channelId, oldestMessageId);
2244
+ }, config.retractDelay * 1000);
2245
+ }
2246
+ }
2247
+ }