papilot 0.8.8 → 0.8.9

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 (349) hide show
  1. package/dist/assets/78-EUC-H-Uf9aYsyl.bcmap +0 -0
  2. package/dist/assets/78-EUC-V-ChJxef36.bcmap +0 -0
  3. package/dist/assets/78-H-CSvm1opZ.bcmap +0 -0
  4. package/dist/assets/78-RKSJ-H-34XPL1-s.bcmap +0 -0
  5. package/dist/assets/78-RKSJ-V-CyaguwXf.bcmap +0 -0
  6. package/dist/assets/78-V-CJGcNX1t.bcmap +0 -0
  7. package/dist/assets/78ms-RKSJ-H-BuwLY695.bcmap +0 -0
  8. package/dist/assets/78ms-RKSJ-V-4hl06FMz.bcmap +0 -0
  9. package/dist/assets/83pv-RKSJ-H-DNQtuaxs.bcmap +0 -0
  10. package/dist/assets/90ms-RKSJ-H-Bhsfh4Ys.bcmap +0 -0
  11. package/dist/assets/90ms-RKSJ-V-BbstlayK.bcmap +0 -0
  12. package/dist/assets/90msp-RKSJ-H-GTsoumJQ.bcmap +0 -0
  13. package/dist/assets/90msp-RKSJ-V-BWep_0YK.bcmap +0 -0
  14. package/dist/assets/90pv-RKSJ-H-DOcWKG7K.bcmap +0 -0
  15. package/dist/assets/90pv-RKSJ-V-BuoQaCHG.bcmap +0 -0
  16. package/dist/assets/Add-H-1H-FQZVX.bcmap +0 -0
  17. package/dist/assets/Add-RKSJ-H-BpPRzomz.bcmap +0 -0
  18. package/dist/assets/Add-RKSJ-V-C7YDsPzV.bcmap +0 -0
  19. package/dist/assets/Add-V-CzFvKnCs.bcmap +0 -0
  20. package/dist/assets/Adobe-CNS1-0-CfVBOElR.bcmap +0 -0
  21. package/dist/assets/Adobe-CNS1-1-Cs9TI-Yv.bcmap +0 -0
  22. package/dist/assets/Adobe-CNS1-2-D3SWzMKj.bcmap +0 -0
  23. package/dist/assets/Adobe-CNS1-3-BNxX-hNa.bcmap +0 -0
  24. package/dist/assets/Adobe-CNS1-4-uApBOf1n.bcmap +0 -0
  25. package/dist/assets/Adobe-CNS1-5-BWUfkzOP.bcmap +0 -0
  26. package/dist/assets/Adobe-CNS1-6-DfjBny4_.bcmap +0 -0
  27. package/dist/assets/Adobe-CNS1-UCS2-fO900upv.bcmap +0 -0
  28. package/dist/assets/Adobe-GB1-0-DCLN2jmY.bcmap +0 -0
  29. package/dist/assets/Adobe-GB1-1-C_oGAEc2.bcmap +0 -0
  30. package/dist/assets/Adobe-GB1-2-BT5g0uLo.bcmap +0 -0
  31. package/dist/assets/Adobe-GB1-3-BWe_tZZF.bcmap +0 -0
  32. package/dist/assets/Adobe-GB1-4-CYF1KDey.bcmap +0 -0
  33. package/dist/assets/Adobe-GB1-5-B89PBerI.bcmap +0 -0
  34. package/dist/assets/Adobe-GB1-UCS2-BA083yIo.bcmap +0 -0
  35. package/dist/assets/Adobe-Japan1-0-7ueYY-cc.bcmap +0 -0
  36. package/dist/assets/Adobe-Japan1-1-DymoVrld.bcmap +0 -0
  37. package/dist/assets/Adobe-Japan1-2-WYxwCoVU.bcmap +0 -0
  38. package/dist/assets/Adobe-Japan1-3-DU7EG9_k.bcmap +0 -0
  39. package/dist/assets/Adobe-Japan1-4-CPqEnWe7.bcmap +0 -0
  40. package/dist/assets/Adobe-Japan1-5-CyFviWdc.bcmap +0 -0
  41. package/dist/assets/Adobe-Japan1-6-8p9YIft8.bcmap +0 -0
  42. package/dist/assets/Adobe-Japan1-UCS2-BL-4M2vS.bcmap +0 -0
  43. package/dist/assets/Adobe-Korea1-0-A0Ew6GJu.bcmap +0 -0
  44. package/dist/assets/Adobe-Korea1-1-DFSgDZ4w.bcmap +0 -0
  45. package/dist/assets/Adobe-Korea1-2-LZ89XEQ6.bcmap +0 -0
  46. package/dist/assets/Adobe-Korea1-UCS2-BEQZuOdo.bcmap +0 -0
  47. package/dist/assets/B5-H-Cw4_8on0.bcmap +0 -0
  48. package/dist/assets/B5-V-3ShXAXP7.bcmap +0 -0
  49. package/dist/assets/B5pc-H-BLVOWhvh.bcmap +0 -0
  50. package/dist/assets/B5pc-V-1X0fY8mT.bcmap +0 -0
  51. package/dist/assets/CNS-EUC-H-C1HifF4e.bcmap +0 -0
  52. package/dist/assets/CNS-EUC-V-DYWNmJNX.bcmap +0 -0
  53. package/dist/assets/CNS1-H-DAbVz1sI.bcmap +0 -0
  54. package/dist/assets/CNS1-V-BUvSsmpl.bcmap +0 -0
  55. package/dist/assets/CNS2-H-COHfjmw4.bcmap +0 -0
  56. package/dist/assets/CNS2-V-DgHqi_gL.bcmap +3 -0
  57. package/dist/assets/ETHK-B5-H-1MLb5v9x.bcmap +0 -0
  58. package/dist/assets/ETHK-B5-V-DmzBBgI2.bcmap +0 -0
  59. package/dist/assets/ETen-B5-H-BUa4x82H.bcmap +0 -0
  60. package/dist/assets/ETen-B5-V-CyIout1L.bcmap +0 -0
  61. package/dist/assets/ETenms-B5-H-DbS1LlRr.bcmap +3 -0
  62. package/dist/assets/ETenms-B5-V-DsL3AkeM.bcmap +0 -0
  63. package/dist/assets/EUC-H-D0J4HUB1.bcmap +0 -0
  64. package/dist/assets/EUC-V-BQ9CW2K_.bcmap +0 -0
  65. package/dist/assets/Ext-H-BSOXjlXj.bcmap +0 -0
  66. package/dist/assets/Ext-RKSJ-H-DGTwwnmY.bcmap +0 -0
  67. package/dist/assets/Ext-RKSJ-V-gySMsgy2.bcmap +0 -0
  68. package/dist/assets/Ext-V-ByyLJMVu.bcmap +0 -0
  69. package/dist/assets/GB-EUC-H-OgfW-rVY.bcmap +0 -0
  70. package/dist/assets/GB-EUC-V-DUJE8ZfE.bcmap +0 -0
  71. package/dist/assets/GB-H-CjAQlF1j.bcmap +4 -0
  72. package/dist/assets/GB-V-DQcXdwec.bcmap +0 -0
  73. package/dist/assets/GBK-EUC-H-CAORqCkf.bcmap +0 -0
  74. package/dist/assets/GBK-EUC-V-bmo5E_xa.bcmap +0 -0
  75. package/dist/assets/GBK2K-H-Cv55KPk8.bcmap +0 -0
  76. package/dist/assets/GBK2K-V-VEqjiYVJ.bcmap +0 -0
  77. package/dist/assets/GBKp-EUC-H-CElrnV5g.bcmap +0 -0
  78. package/dist/assets/GBKp-EUC-V-FKuJrjD8.bcmap +0 -0
  79. package/dist/assets/GBT-EUC-H-BTsQIL1M.bcmap +0 -0
  80. package/dist/assets/GBT-EUC-V-CCaONgYB.bcmap +0 -0
  81. package/dist/assets/GBT-H-DL9h-WkS.bcmap +0 -0
  82. package/dist/assets/GBT-V-DVsZ47Yj.bcmap +0 -0
  83. package/dist/assets/GBTpc-EUC-H-DnIh5WJ3.bcmap +0 -0
  84. package/dist/assets/GBTpc-EUC-V-D_dpKF5g.bcmap +0 -0
  85. package/dist/assets/GBpc-EUC-H-4mXfmDQd.bcmap +0 -0
  86. package/dist/assets/GBpc-EUC-V-BNBtOgzw.bcmap +0 -0
  87. package/dist/assets/H-BJYV6_el.bcmap +0 -0
  88. package/dist/assets/HKdla-B5-H-Bg4tZIUs.bcmap +0 -0
  89. package/dist/assets/HKdla-B5-V-CHovDFKh.bcmap +0 -0
  90. package/dist/assets/HKdlb-B5-H-Bf7o2mkD.bcmap +0 -0
  91. package/dist/assets/HKdlb-B5-V-CDfiFKye.bcmap +0 -0
  92. package/dist/assets/HKgccs-B5-H-BSg_4Hb2.bcmap +0 -0
  93. package/dist/assets/HKgccs-B5-V-Bb0FD7uo.bcmap +0 -0
  94. package/dist/assets/HKm314-B5-H-CUeI2x46.bcmap +0 -0
  95. package/dist/assets/HKm314-B5-V-BrK5Z_J-.bcmap +0 -0
  96. package/dist/assets/HKm471-B5-H-B_3IWC_G.bcmap +0 -0
  97. package/dist/assets/HKm471-B5-V-B7Ks-vkf.bcmap +0 -0
  98. package/dist/assets/HKscs-B5-H-CXbBbq6g.bcmap +0 -0
  99. package/dist/assets/HKscs-B5-V-CrljkNDo.bcmap +0 -0
  100. package/dist/assets/Hankaku-SMDjWZXJ.bcmap +0 -0
  101. package/dist/assets/Hiragana-Dy6yEHKG.bcmap +0 -0
  102. package/dist/assets/KSC-EUC-H-CYoqfsaA.bcmap +0 -0
  103. package/dist/assets/KSC-EUC-V-C8-Y2jkl.bcmap +0 -0
  104. package/dist/assets/KSC-H-CUtFgdXl.bcmap +0 -0
  105. package/dist/assets/KSC-Johab-H-CGtV3MPT.bcmap +0 -0
  106. package/dist/assets/KSC-Johab-V-CWzqnmVV.bcmap +0 -0
  107. package/dist/assets/KSC-V-CDXb0xyy.bcmap +0 -0
  108. package/dist/assets/KSCms-UHC-H-i6eA63f9.bcmap +0 -0
  109. package/dist/assets/KSCms-UHC-HW-H-lQjjyo98.bcmap +0 -0
  110. package/dist/assets/KSCms-UHC-HW-V-DKemUgQi.bcmap +0 -0
  111. package/dist/assets/KSCms-UHC-V-DaEePsjg.bcmap +0 -0
  112. package/dist/assets/KSCpc-EUC-H-BxNLD7US.bcmap +0 -0
  113. package/dist/assets/KSCpc-EUC-V-Bd6pD5ID.bcmap +0 -0
  114. package/dist/assets/Katakana-DueN_6wN.bcmap +0 -0
  115. package/dist/assets/NWP-H-BSh0nlh5.bcmap +0 -0
  116. package/dist/assets/NWP-V-DvbaGBQ0.bcmap +0 -0
  117. package/dist/assets/RKSJ-H-CotmKIAY.bcmap +0 -0
  118. package/dist/assets/RKSJ-V-CVQ5ujKs.bcmap +0 -0
  119. package/dist/assets/Roman-CGyUGrKi.bcmap +0 -0
  120. package/dist/assets/UniCNS-UCS2-H-DWzv8UhH.bcmap +0 -0
  121. package/dist/assets/UniCNS-UCS2-V-CbsnO1ia.bcmap +0 -0
  122. package/dist/assets/UniCNS-UTF16-H-Bw0JKgCq.bcmap +0 -0
  123. package/dist/assets/UniCNS-UTF16-V-DoPO_42D.bcmap +0 -0
  124. package/dist/assets/UniCNS-UTF32-H-IE_GrH2i.bcmap +0 -0
  125. package/dist/assets/UniCNS-UTF32-V-DpuHKqNE.bcmap +0 -0
  126. package/dist/assets/UniCNS-UTF8-H-BbLcFh6Q.bcmap +0 -0
  127. package/dist/assets/UniCNS-UTF8-V-BD4cmnNX.bcmap +0 -0
  128. package/dist/assets/UniGB-UCS2-H-D7xzRvZN.bcmap +0 -0
  129. package/dist/assets/UniGB-UCS2-V-COOBrDBb.bcmap +0 -0
  130. package/dist/assets/UniGB-UTF16-H-DKjbEwc0.bcmap +0 -0
  131. package/dist/assets/UniGB-UTF16-V-E1RoE6KW.bcmap +0 -0
  132. package/dist/assets/UniGB-UTF32-H-Behfouj5.bcmap +0 -0
  133. package/dist/assets/UniGB-UTF32-V-BFm4myiz.bcmap +0 -0
  134. package/dist/assets/UniGB-UTF8-H-EROft1ro.bcmap +0 -0
  135. package/dist/assets/UniGB-UTF8-V-C8SGUjFI.bcmap +0 -0
  136. package/dist/assets/UniJIS-UCS2-H-2DbZ0MaQ.bcmap +0 -0
  137. package/dist/assets/UniJIS-UCS2-HW-H-BfJ3t__Z.bcmap +0 -0
  138. package/dist/assets/UniJIS-UCS2-HW-V-BZyQaeYZ.bcmap +0 -0
  139. package/dist/assets/UniJIS-UCS2-V-Cr3xs5m4.bcmap +0 -0
  140. package/dist/assets/UniJIS-UTF16-H-BlDDPdCK.bcmap +0 -0
  141. package/dist/assets/UniJIS-UTF16-V-DfK_Aqy1.bcmap +0 -0
  142. package/dist/assets/UniJIS-UTF32-H-BIQPWkjv.bcmap +0 -0
  143. package/dist/assets/UniJIS-UTF32-V-0rh54ED3.bcmap +0 -0
  144. package/dist/assets/UniJIS-UTF8-H-CGusholx.bcmap +0 -0
  145. package/dist/assets/UniJIS-UTF8-V-BGWFHinB.bcmap +0 -0
  146. package/dist/assets/UniJIS2004-UTF16-H-KXixH-HI.bcmap +0 -0
  147. package/dist/assets/UniJIS2004-UTF16-V-BSHgoaRy.bcmap +0 -0
  148. package/dist/assets/UniJIS2004-UTF32-H-CXrD-9YE.bcmap +0 -0
  149. package/dist/assets/UniJIS2004-UTF32-V-CH3k_ouF.bcmap +0 -0
  150. package/dist/assets/UniJIS2004-UTF8-H-BkOctZjn.bcmap +0 -0
  151. package/dist/assets/UniJIS2004-UTF8-V-D8AJhywu.bcmap +0 -0
  152. package/dist/assets/UniJISPro-UCS2-HW-V-DLNkNO1x.bcmap +0 -0
  153. package/dist/assets/UniJISPro-UCS2-V-BpvX7JBA.bcmap +0 -0
  154. package/dist/assets/UniJISPro-UTF8-V-Db5K6XXE.bcmap +0 -0
  155. package/dist/assets/UniJISX0213-UTF32-H-BavAhZjb.bcmap +0 -0
  156. package/dist/assets/UniJISX0213-UTF32-V-Cz7JBDr9.bcmap +0 -0
  157. package/dist/assets/UniJISX02132004-UTF32-H-DAH-AgUq.bcmap +0 -0
  158. package/dist/assets/UniJISX02132004-UTF32-V-BqqDIAe5.bcmap +0 -0
  159. package/dist/assets/UniKS-UCS2-H-YeUc7k1L.bcmap +0 -0
  160. package/dist/assets/UniKS-UCS2-V-ahlksFWQ.bcmap +0 -0
  161. package/dist/assets/UniKS-UTF16-H-B0dvB-Td.bcmap +0 -0
  162. package/dist/assets/UniKS-UTF16-V-EgvK-6IG.bcmap +0 -0
  163. package/dist/assets/UniKS-UTF32-H-olR_LtmR.bcmap +0 -0
  164. package/dist/assets/UniKS-UTF32-V-CnOTbPsn.bcmap +0 -0
  165. package/dist/assets/UniKS-UTF8-H-CbpebD-y.bcmap +0 -0
  166. package/dist/assets/UniKS-UTF8-V-BIFFPWWm.bcmap +0 -0
  167. package/dist/assets/V-BJkwLeFB.bcmap +0 -0
  168. package/dist/assets/WP-Symbol-C3zzKJnO.bcmap +0 -0
  169. package/dist/assets/{index-UOSwDRDP.js → index-n1pYuKIY.js} +5 -5
  170. package/dist/assets/{math-Bhj8FWpK.js → math-yn5UTwU4.js} +1 -1
  171. package/dist/assets/pdf-view-hEwEpB78.js +598 -0
  172. package/dist/index.html +1 -1
  173. package/engine/dist/web/assets/78-EUC-H-Uf9aYsyl.bcmap +0 -0
  174. package/engine/dist/web/assets/78-EUC-V-ChJxef36.bcmap +0 -0
  175. package/engine/dist/web/assets/78-H-CSvm1opZ.bcmap +0 -0
  176. package/engine/dist/web/assets/78-RKSJ-H-34XPL1-s.bcmap +0 -0
  177. package/engine/dist/web/assets/78-RKSJ-V-CyaguwXf.bcmap +0 -0
  178. package/engine/dist/web/assets/78-V-CJGcNX1t.bcmap +0 -0
  179. package/engine/dist/web/assets/78ms-RKSJ-H-BuwLY695.bcmap +0 -0
  180. package/engine/dist/web/assets/78ms-RKSJ-V-4hl06FMz.bcmap +0 -0
  181. package/engine/dist/web/assets/83pv-RKSJ-H-DNQtuaxs.bcmap +0 -0
  182. package/engine/dist/web/assets/90ms-RKSJ-H-Bhsfh4Ys.bcmap +0 -0
  183. package/engine/dist/web/assets/90ms-RKSJ-V-BbstlayK.bcmap +0 -0
  184. package/engine/dist/web/assets/90msp-RKSJ-H-GTsoumJQ.bcmap +0 -0
  185. package/engine/dist/web/assets/90msp-RKSJ-V-BWep_0YK.bcmap +0 -0
  186. package/engine/dist/web/assets/90pv-RKSJ-H-DOcWKG7K.bcmap +0 -0
  187. package/engine/dist/web/assets/90pv-RKSJ-V-BuoQaCHG.bcmap +0 -0
  188. package/engine/dist/web/assets/Add-H-1H-FQZVX.bcmap +0 -0
  189. package/engine/dist/web/assets/Add-RKSJ-H-BpPRzomz.bcmap +0 -0
  190. package/engine/dist/web/assets/Add-RKSJ-V-C7YDsPzV.bcmap +0 -0
  191. package/engine/dist/web/assets/Add-V-CzFvKnCs.bcmap +0 -0
  192. package/engine/dist/web/assets/Adobe-CNS1-0-CfVBOElR.bcmap +0 -0
  193. package/engine/dist/web/assets/Adobe-CNS1-1-Cs9TI-Yv.bcmap +0 -0
  194. package/engine/dist/web/assets/Adobe-CNS1-2-D3SWzMKj.bcmap +0 -0
  195. package/engine/dist/web/assets/Adobe-CNS1-3-BNxX-hNa.bcmap +0 -0
  196. package/engine/dist/web/assets/Adobe-CNS1-4-uApBOf1n.bcmap +0 -0
  197. package/engine/dist/web/assets/Adobe-CNS1-5-BWUfkzOP.bcmap +0 -0
  198. package/engine/dist/web/assets/Adobe-CNS1-6-DfjBny4_.bcmap +0 -0
  199. package/engine/dist/web/assets/Adobe-CNS1-UCS2-fO900upv.bcmap +0 -0
  200. package/engine/dist/web/assets/Adobe-GB1-0-DCLN2jmY.bcmap +0 -0
  201. package/engine/dist/web/assets/Adobe-GB1-1-C_oGAEc2.bcmap +0 -0
  202. package/engine/dist/web/assets/Adobe-GB1-2-BT5g0uLo.bcmap +0 -0
  203. package/engine/dist/web/assets/Adobe-GB1-3-BWe_tZZF.bcmap +0 -0
  204. package/engine/dist/web/assets/Adobe-GB1-4-CYF1KDey.bcmap +0 -0
  205. package/engine/dist/web/assets/Adobe-GB1-5-B89PBerI.bcmap +0 -0
  206. package/engine/dist/web/assets/Adobe-GB1-UCS2-BA083yIo.bcmap +0 -0
  207. package/engine/dist/web/assets/Adobe-Japan1-0-7ueYY-cc.bcmap +0 -0
  208. package/engine/dist/web/assets/Adobe-Japan1-1-DymoVrld.bcmap +0 -0
  209. package/engine/dist/web/assets/Adobe-Japan1-2-WYxwCoVU.bcmap +0 -0
  210. package/engine/dist/web/assets/Adobe-Japan1-3-DU7EG9_k.bcmap +0 -0
  211. package/engine/dist/web/assets/Adobe-Japan1-4-CPqEnWe7.bcmap +0 -0
  212. package/engine/dist/web/assets/Adobe-Japan1-5-CyFviWdc.bcmap +0 -0
  213. package/engine/dist/web/assets/Adobe-Japan1-6-8p9YIft8.bcmap +0 -0
  214. package/engine/dist/web/assets/Adobe-Japan1-UCS2-BL-4M2vS.bcmap +0 -0
  215. package/engine/dist/web/assets/Adobe-Korea1-0-A0Ew6GJu.bcmap +0 -0
  216. package/engine/dist/web/assets/Adobe-Korea1-1-DFSgDZ4w.bcmap +0 -0
  217. package/engine/dist/web/assets/Adobe-Korea1-2-LZ89XEQ6.bcmap +0 -0
  218. package/engine/dist/web/assets/Adobe-Korea1-UCS2-BEQZuOdo.bcmap +0 -0
  219. package/engine/dist/web/assets/B5-H-Cw4_8on0.bcmap +0 -0
  220. package/engine/dist/web/assets/B5-V-3ShXAXP7.bcmap +0 -0
  221. package/engine/dist/web/assets/B5pc-H-BLVOWhvh.bcmap +0 -0
  222. package/engine/dist/web/assets/B5pc-V-1X0fY8mT.bcmap +0 -0
  223. package/engine/dist/web/assets/CNS-EUC-H-C1HifF4e.bcmap +0 -0
  224. package/engine/dist/web/assets/CNS-EUC-V-DYWNmJNX.bcmap +0 -0
  225. package/engine/dist/web/assets/CNS1-H-DAbVz1sI.bcmap +0 -0
  226. package/engine/dist/web/assets/CNS1-V-BUvSsmpl.bcmap +0 -0
  227. package/engine/dist/web/assets/CNS2-H-COHfjmw4.bcmap +0 -0
  228. package/engine/dist/web/assets/CNS2-V-DgHqi_gL.bcmap +3 -0
  229. package/engine/dist/web/assets/ETHK-B5-H-1MLb5v9x.bcmap +0 -0
  230. package/engine/dist/web/assets/ETHK-B5-V-DmzBBgI2.bcmap +0 -0
  231. package/engine/dist/web/assets/ETen-B5-H-BUa4x82H.bcmap +0 -0
  232. package/engine/dist/web/assets/ETen-B5-V-CyIout1L.bcmap +0 -0
  233. package/engine/dist/web/assets/ETenms-B5-H-DbS1LlRr.bcmap +3 -0
  234. package/engine/dist/web/assets/ETenms-B5-V-DsL3AkeM.bcmap +0 -0
  235. package/engine/dist/web/assets/EUC-H-D0J4HUB1.bcmap +0 -0
  236. package/engine/dist/web/assets/EUC-V-BQ9CW2K_.bcmap +0 -0
  237. package/engine/dist/web/assets/Ext-H-BSOXjlXj.bcmap +0 -0
  238. package/engine/dist/web/assets/Ext-RKSJ-H-DGTwwnmY.bcmap +0 -0
  239. package/engine/dist/web/assets/Ext-RKSJ-V-gySMsgy2.bcmap +0 -0
  240. package/engine/dist/web/assets/Ext-V-ByyLJMVu.bcmap +0 -0
  241. package/engine/dist/web/assets/FullPaper-zL_YjQvI.js +54 -0
  242. package/engine/dist/web/assets/GB-EUC-H-OgfW-rVY.bcmap +0 -0
  243. package/engine/dist/web/assets/GB-EUC-V-DUJE8ZfE.bcmap +0 -0
  244. package/engine/dist/web/assets/GB-H-CjAQlF1j.bcmap +4 -0
  245. package/engine/dist/web/assets/GB-V-DQcXdwec.bcmap +0 -0
  246. package/engine/dist/web/assets/GBK-EUC-H-CAORqCkf.bcmap +0 -0
  247. package/engine/dist/web/assets/GBK-EUC-V-bmo5E_xa.bcmap +0 -0
  248. package/engine/dist/web/assets/GBK2K-H-Cv55KPk8.bcmap +0 -0
  249. package/engine/dist/web/assets/GBK2K-V-VEqjiYVJ.bcmap +0 -0
  250. package/engine/dist/web/assets/GBKp-EUC-H-CElrnV5g.bcmap +0 -0
  251. package/engine/dist/web/assets/GBKp-EUC-V-FKuJrjD8.bcmap +0 -0
  252. package/engine/dist/web/assets/GBT-EUC-H-BTsQIL1M.bcmap +0 -0
  253. package/engine/dist/web/assets/GBT-EUC-V-CCaONgYB.bcmap +0 -0
  254. package/engine/dist/web/assets/GBT-H-DL9h-WkS.bcmap +0 -0
  255. package/engine/dist/web/assets/GBT-V-DVsZ47Yj.bcmap +0 -0
  256. package/engine/dist/web/assets/GBTpc-EUC-H-DnIh5WJ3.bcmap +0 -0
  257. package/engine/dist/web/assets/GBTpc-EUC-V-D_dpKF5g.bcmap +0 -0
  258. package/engine/dist/web/assets/GBpc-EUC-H-4mXfmDQd.bcmap +0 -0
  259. package/engine/dist/web/assets/GBpc-EUC-V-BNBtOgzw.bcmap +0 -0
  260. package/engine/dist/web/assets/H-BJYV6_el.bcmap +0 -0
  261. package/engine/dist/web/assets/HKdla-B5-H-Bg4tZIUs.bcmap +0 -0
  262. package/engine/dist/web/assets/HKdla-B5-V-CHovDFKh.bcmap +0 -0
  263. package/engine/dist/web/assets/HKdlb-B5-H-Bf7o2mkD.bcmap +0 -0
  264. package/engine/dist/web/assets/HKdlb-B5-V-CDfiFKye.bcmap +0 -0
  265. package/engine/dist/web/assets/HKgccs-B5-H-BSg_4Hb2.bcmap +0 -0
  266. package/engine/dist/web/assets/HKgccs-B5-V-Bb0FD7uo.bcmap +0 -0
  267. package/engine/dist/web/assets/HKm314-B5-H-CUeI2x46.bcmap +0 -0
  268. package/engine/dist/web/assets/HKm314-B5-V-BrK5Z_J-.bcmap +0 -0
  269. package/engine/dist/web/assets/HKm471-B5-H-B_3IWC_G.bcmap +0 -0
  270. package/engine/dist/web/assets/HKm471-B5-V-B7Ks-vkf.bcmap +0 -0
  271. package/engine/dist/web/assets/HKscs-B5-H-CXbBbq6g.bcmap +0 -0
  272. package/engine/dist/web/assets/HKscs-B5-V-CrljkNDo.bcmap +0 -0
  273. package/engine/dist/web/assets/Hankaku-SMDjWZXJ.bcmap +0 -0
  274. package/engine/dist/web/assets/Hiragana-Dy6yEHKG.bcmap +0 -0
  275. package/engine/dist/web/assets/KSC-EUC-H-CYoqfsaA.bcmap +0 -0
  276. package/engine/dist/web/assets/KSC-EUC-V-C8-Y2jkl.bcmap +0 -0
  277. package/engine/dist/web/assets/KSC-H-CUtFgdXl.bcmap +0 -0
  278. package/engine/dist/web/assets/KSC-Johab-H-CGtV3MPT.bcmap +0 -0
  279. package/engine/dist/web/assets/KSC-Johab-V-CWzqnmVV.bcmap +0 -0
  280. package/engine/dist/web/assets/KSC-V-CDXb0xyy.bcmap +0 -0
  281. package/engine/dist/web/assets/KSCms-UHC-H-i6eA63f9.bcmap +0 -0
  282. package/engine/dist/web/assets/KSCms-UHC-HW-H-lQjjyo98.bcmap +0 -0
  283. package/engine/dist/web/assets/KSCms-UHC-HW-V-DKemUgQi.bcmap +0 -0
  284. package/engine/dist/web/assets/KSCms-UHC-V-DaEePsjg.bcmap +0 -0
  285. package/engine/dist/web/assets/KSCpc-EUC-H-BxNLD7US.bcmap +0 -0
  286. package/engine/dist/web/assets/KSCpc-EUC-V-Bd6pD5ID.bcmap +0 -0
  287. package/engine/dist/web/assets/Katakana-DueN_6wN.bcmap +0 -0
  288. package/engine/dist/web/assets/NWP-H-BSh0nlh5.bcmap +0 -0
  289. package/engine/dist/web/assets/NWP-V-DvbaGBQ0.bcmap +0 -0
  290. package/engine/dist/web/assets/RKSJ-H-CotmKIAY.bcmap +0 -0
  291. package/engine/dist/web/assets/RKSJ-V-CVQ5ujKs.bcmap +0 -0
  292. package/engine/dist/web/assets/Roman-CGyUGrKi.bcmap +0 -0
  293. package/engine/dist/web/assets/UniCNS-UCS2-H-DWzv8UhH.bcmap +0 -0
  294. package/engine/dist/web/assets/UniCNS-UCS2-V-CbsnO1ia.bcmap +0 -0
  295. package/engine/dist/web/assets/UniCNS-UTF16-H-Bw0JKgCq.bcmap +0 -0
  296. package/engine/dist/web/assets/UniCNS-UTF16-V-DoPO_42D.bcmap +0 -0
  297. package/engine/dist/web/assets/UniCNS-UTF32-H-IE_GrH2i.bcmap +0 -0
  298. package/engine/dist/web/assets/UniCNS-UTF32-V-DpuHKqNE.bcmap +0 -0
  299. package/engine/dist/web/assets/UniCNS-UTF8-H-BbLcFh6Q.bcmap +0 -0
  300. package/engine/dist/web/assets/UniCNS-UTF8-V-BD4cmnNX.bcmap +0 -0
  301. package/engine/dist/web/assets/UniGB-UCS2-H-D7xzRvZN.bcmap +0 -0
  302. package/engine/dist/web/assets/UniGB-UCS2-V-COOBrDBb.bcmap +0 -0
  303. package/engine/dist/web/assets/UniGB-UTF16-H-DKjbEwc0.bcmap +0 -0
  304. package/engine/dist/web/assets/UniGB-UTF16-V-E1RoE6KW.bcmap +0 -0
  305. package/engine/dist/web/assets/UniGB-UTF32-H-Behfouj5.bcmap +0 -0
  306. package/engine/dist/web/assets/UniGB-UTF32-V-BFm4myiz.bcmap +0 -0
  307. package/engine/dist/web/assets/UniGB-UTF8-H-EROft1ro.bcmap +0 -0
  308. package/engine/dist/web/assets/UniGB-UTF8-V-C8SGUjFI.bcmap +0 -0
  309. package/engine/dist/web/assets/UniJIS-UCS2-H-2DbZ0MaQ.bcmap +0 -0
  310. package/engine/dist/web/assets/UniJIS-UCS2-HW-H-BfJ3t__Z.bcmap +0 -0
  311. package/engine/dist/web/assets/UniJIS-UCS2-HW-V-BZyQaeYZ.bcmap +0 -0
  312. package/engine/dist/web/assets/UniJIS-UCS2-V-Cr3xs5m4.bcmap +0 -0
  313. package/engine/dist/web/assets/UniJIS-UTF16-H-BlDDPdCK.bcmap +0 -0
  314. package/engine/dist/web/assets/UniJIS-UTF16-V-DfK_Aqy1.bcmap +0 -0
  315. package/engine/dist/web/assets/UniJIS-UTF32-H-BIQPWkjv.bcmap +0 -0
  316. package/engine/dist/web/assets/UniJIS-UTF32-V-0rh54ED3.bcmap +0 -0
  317. package/engine/dist/web/assets/UniJIS-UTF8-H-CGusholx.bcmap +0 -0
  318. package/engine/dist/web/assets/UniJIS-UTF8-V-BGWFHinB.bcmap +0 -0
  319. package/engine/dist/web/assets/UniJIS2004-UTF16-H-KXixH-HI.bcmap +0 -0
  320. package/engine/dist/web/assets/UniJIS2004-UTF16-V-BSHgoaRy.bcmap +0 -0
  321. package/engine/dist/web/assets/UniJIS2004-UTF32-H-CXrD-9YE.bcmap +0 -0
  322. package/engine/dist/web/assets/UniJIS2004-UTF32-V-CH3k_ouF.bcmap +0 -0
  323. package/engine/dist/web/assets/UniJIS2004-UTF8-H-BkOctZjn.bcmap +0 -0
  324. package/engine/dist/web/assets/UniJIS2004-UTF8-V-D8AJhywu.bcmap +0 -0
  325. package/engine/dist/web/assets/UniJISPro-UCS2-HW-V-DLNkNO1x.bcmap +0 -0
  326. package/engine/dist/web/assets/UniJISPro-UCS2-V-BpvX7JBA.bcmap +0 -0
  327. package/engine/dist/web/assets/UniJISPro-UTF8-V-Db5K6XXE.bcmap +0 -0
  328. package/engine/dist/web/assets/UniJISX0213-UTF32-H-BavAhZjb.bcmap +0 -0
  329. package/engine/dist/web/assets/UniJISX0213-UTF32-V-Cz7JBDr9.bcmap +0 -0
  330. package/engine/dist/web/assets/UniJISX02132004-UTF32-H-DAH-AgUq.bcmap +0 -0
  331. package/engine/dist/web/assets/UniJISX02132004-UTF32-V-BqqDIAe5.bcmap +0 -0
  332. package/engine/dist/web/assets/UniKS-UCS2-H-YeUc7k1L.bcmap +0 -0
  333. package/engine/dist/web/assets/UniKS-UCS2-V-ahlksFWQ.bcmap +0 -0
  334. package/engine/dist/web/assets/UniKS-UTF16-H-B0dvB-Td.bcmap +0 -0
  335. package/engine/dist/web/assets/UniKS-UTF16-V-EgvK-6IG.bcmap +0 -0
  336. package/engine/dist/web/assets/UniKS-UTF32-H-olR_LtmR.bcmap +0 -0
  337. package/engine/dist/web/assets/UniKS-UTF32-V-CnOTbPsn.bcmap +0 -0
  338. package/engine/dist/web/assets/UniKS-UTF8-H-CbpebD-y.bcmap +0 -0
  339. package/engine/dist/web/assets/UniKS-UTF8-V-BIFFPWWm.bcmap +0 -0
  340. package/engine/dist/web/assets/V-BJkwLeFB.bcmap +0 -0
  341. package/engine/dist/web/assets/WP-Symbol-C3zzKJnO.bcmap +0 -0
  342. package/engine/dist/web/assets/{index-T8GmpI7k.js → index-e1oe-qOQ.js} +1 -1
  343. package/engine/dist/web/index.html +1 -1
  344. package/engine/src/web/FullPaper.tsx +14 -5
  345. package/engine/src/web/pdf-cmaps.ts +20 -0
  346. package/package.json +1 -1
  347. package/src/server/workspace.ts +1 -2
  348. package/dist/assets/pdf-view-MxbG4Zkk.js +0 -598
  349. package/engine/dist/web/assets/FullPaper-BXMVtK94.js +0 -54
@@ -0,0 +1,4 @@
1
+ �RCopyright 1990-2009 Adobe Systems Incorporated.
2
+ All rights reserved.
3
+ See ./LICENSE!!��]aX!!]`�21�> �p �z�$]��"R�d�-U�7�*�
4
+ �"]�h�"]�F�"]�$�"]��"]�`�"]�>�"]��"]�z�"]�X�"]�6�"]��"]�r�"]�P�"]�.�"]� �"]�j�"]�H�"]�&�"]��"]�b�"]�@�"]��"]�|�"]�Z�"]�8�"]��"]�t�"]�R�"]�0�"]��"]�l�"]�J�"]�(�"]��"]�d�"]�B�"]� �"X�~�']�W�"]�5�"]��"]�q�"]�O�"]�-�"]� �"]�i�"]�G�"]�%�"]��"]�a�"]�?�"]��"]�{�"]�Y�"]�7�"]��"]�s�"]�Q�"]�/�"]�
@@ -14,6 +14,6 @@ Error generating stack: `+e.message+`
14
14
  `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function be(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
15
15
  `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function xe(e){return e==`.`||e==`!`||e==`?`}new class extends se{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(xe(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends se{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends se{constructor(){super(...arguments),this.tokenize=be}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(k(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function k(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=k(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=k(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}var A=new class extends se{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Se(e,t,n){return A.diff(e,t,n)}function Ce(e,t){return we(Se(e,t))}function we(e){let t=[],n=0,r=0;for(let i of e){let e=i.value.length;if(!i.added&&!i.removed)t.push([`equal`,n,n+e,r,r+e]),n+=e,r+=e;else{let a=t.at(-1),o=i.added?`insert`:`delete`,s=n+(i.removed?e:0),c=r+(i.added?e:0);a&&a[0]!==`equal`?(a[0]=a[1]<s&&a[3]<c?`replace`:o,a[2]=s,a[4]=c):t.push([o,n,s,r,c]),n=s,r=c}}return t}function Te(e){return[...e.sections.flatMap((e,t)=>e.blocks.flatMap((e,n)=>e.kind===`change`?[{key:`s${t}b${n}`,units:e.units,section:t}]:[])),...e.loose.map((e,t)=>({key:`l${t}`,units:e.units,section:null}))]}var j=(e,t)=>(e?.units??[]).filter(e=>t[e]===`pending`);function M(e,t,n=-1){for(let r=1;r<=e.length;r++){let i=((n<0?-1:n)+r)%e.length;if(j(e[i],t).length)return i}return-1}var Ee={pending:`Pending`,accepted:`Accepted`,rejected:`Rejected`,commented:`Commented`,mixed:`Mixed`};function De(e,t){let n=new Set(e.map(e=>t[e]||`pending`));return n.size===1?[...n][0]:n.has(`pending`)?`pending`:`mixed`}function Oe(e,t){if(e.length&&e.every(e=>t[e]===`accepted`))return`after`;if(e.length&&e.every(e=>t[e]===`rejected`))return`before`}function ke(e){let t=Object.values(e),n={accepted:0,rejected:0,commented:0,pending:0};for(let e of t)n[e]++;return{...n,total:t.length,decided:t.length-n.pending}}function Ae(e,t,n,r){let i=e.filter(e=>e.bottom>n&&e.top<r);return i.some(e=>e.index===t)?t:i[0]?.index??t}function je(e,t){let n=/\\[A-Za-z@]+\*?|[\p{L}\p{N}_]+|\s+|[^\s]/gu,r=e.match(n)??[],i=t.match(n)??[],a=[];for(let[e,t,n,o,s]of Ce(r,i))e===`equal`?a.push({type:`equal`,text:r.slice(t,n).join(``)}):(t<n&&a.push({type:`del`,text:r.slice(t,n).join(``)}),o<s&&a.push({type:`ins`,text:i.slice(o,s).join(``)}));for(let e=1;e<a.length-1;e++)if(a[e].type===`equal`&&/^\s+$/.test(a[e].text)&&a[e-1].type!==`equal`&&a[e+1].type!==`equal`){let t=a[e].text;a.splice(e,1,{type:`del`,text:t},{type:`ins`,text:t}),e++}let o=[];for(let e=0;e<a.length;){if(a[e].type===`equal`){o.push(a[e++]);continue}let t=``,n=``;for(;e<a.length&&a[e].type!==`equal`;)a[e].type===`del`?t+=a[e].text:n+=a[e].text,e++;t&&o.push({type:`del`,text:t}),n&&o.push({type:`ins`,text:n})}return o}var Me=(e,t={})=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e);function Ne(e,t=Me){let n=new Map;for(let r of e){let e=r.status===`added`?t(`new file`):r.status===`deleted`?t(`deleted`):r.new_start===r.new_end?String(r.new_start):`${r.new_start}–${r.new_end}`;n.set(r.file,[...n.get(r.file)??[],e])}let r=[...new Set(e.flatMap(e=>e.pages??[]))];return[...n].map(([e,t])=>`${e}:${t.join(`, `)}`).join(`; `)+(r.length?` · ${t(`p. {pages}`,{pages:r.join(`, `)})}`:``)}function Pe(e,t,n,r,i){return`${e} · Round ${t} · Change ${n}\n${r}${i?`
16
16
 
17
- `+i:``}`}function Fe({scrollRoot:e,stops:t,showReviewed:n=!0,locations:r,decisions:i,current:a,disabled:o,onSelect:s}){let c=(0,l.useRef)(null),u=(0,l.useRef)(null),[d,f]=(0,l.useState)([]),[p,m]=(0,l.useState)({top:0,height:0}),h=t.map((e,t)=>({stop:e,index:t})).filter(({stop:e})=>n||j(e,i).length).map(({index:e})=>e);if((0,l.useEffect)(()=>{let t=e.current,n=c.current;if(!t||!n)return;let r=0,i=!0,a=()=>{r=0;let e=Math.max(t.scrollHeight,1),a=n.clientHeight,o=Math.max(0,e-t.clientHeight),s=Math.min(a,Math.max(8,t.clientHeight/e*a));if(m({top:o?Math.max(0,Math.min(t.scrollTop,o))/o*(a-s):0,height:s}),!i)return;i=!1;let c=t.getBoundingClientRect().top+t.clientTop;f([...t.querySelectorAll(`[data-stop]`)].map(n=>{let r=n.getBoundingClientRect(),i=Math.max(0,(r.top-c+t.scrollTop)/e*a);return{top:i,height:Math.max(0,Math.min(a-i,Math.max(4,r.height/e*a)))}}))},o=()=>{r||=requestAnimationFrame(a)},s=new ResizeObserver(()=>{i=!0,o()});s.observe(t),s.observe(n);for(let e of t.children)s.observe(e);for(let e of t.querySelectorAll(`[data-stop]`))s.observe(e);let l=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)e instanceof Element&&s.unobserve(e);for(let e of t.addedNodes)e instanceof Element&&s.observe(e)}i=!0,o()});return l.observe(t,{childList:!0}),t.addEventListener(`scroll`,o,{passive:!0}),o(),()=>{s.disconnect(),l.disconnect(),t.removeEventListener(`scroll`,o),cancelAnimationFrame(r)}},[e,t]),!t.length)return null;function g(t,n){let r=e.current,i=c.current;if(!r||!i)return;let a=t-i.getBoundingClientRect().top-i.clientTop,o=Math.max(1,i.clientHeight-p.height);r.scrollTo({top:(a-n)/o*(r.scrollHeight-r.clientHeight),behavior:`instant`})}return(0,w.jsxs)(`nav`,{ref:c,className:`change-map`,"aria-label":x(`Change map`),onPointerDown:e=>{if(e.button!==0||e.target.closest(`button`))return;e.preventDefault();let t=e.target.classList.contains(`change-map-viewport`)?e.clientY-e.currentTarget.getBoundingClientRect().top-e.currentTarget.clientTop-p.top:p.height/2;u.current={pointer:e.pointerId,offset:t},e.currentTarget.setPointerCapture(e.pointerId),g(e.clientY,t)},onPointerMove:e=>{u.current?.pointer===e.pointerId&&g(e.clientY,u.current.offset)},onPointerUp:e=>{u.current?.pointer===e.pointerId&&(u.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},onLostPointerCapture:()=>{u.current=null},children:[(0,w.jsx)(`div`,{className:`change-map-viewport`,style:{top:p.top,height:p.height},"aria-hidden":`true`}),t.map((e,n)=>{if(!h.includes(n))return null;let l=d[n];if(!l)return null;let u=De(e.units,i),f=`${x(`Change {n}`,{n:n+1})} · ${x(Ee[u]??u).toLowerCase()} · ${r[n]}`;return(0,w.jsx)(`button`,{type:`button`,className:`change-map-mark`,"data-stop-index":n,"data-state":u,"aria-label":f,"aria-current":n===a?`location`:void 0,tabIndex:n===(h.includes(a)?a:h[0])?0:-1,disabled:o,style:{top:l.top,height:l.height},onClick:()=>s(n),onKeyDown:e=>{let r=e.key===`ArrowDown`?h[h.indexOf(n)+1]??n:e.key===`ArrowUp`?h[h.indexOf(n)-1]??n:e.key===`Home`?h[0]:e.key===`End`?h.at(-1):null;r!=null&&(e.preventDefault(),e.stopPropagation(),c.current?.querySelector(`[data-stop-index="${Math.max(0,Math.min(t.length-1,r))}"]`)?.focus())},children:(0,w.jsx)(`span`,{className:`change-map-tooltip`,children:f})},e.key)})]})}var Ie=e=>e.some(e=>e.block.after.some(e=>e.top!==void 0)),N=`latex-review:effects`,Le=`latex-review:effects-changed`;function Re(){try{return localStorage.getItem(N)===`on`}catch{return!1}}var ze=`latex-review:view-changed`;function Be(){try{return localStorage.getItem(`latex-review:default-view`)===`paper`?`paper`:`changes`}catch{return`changes`}}var Ve={editing:`Editing`,reviewing:`In review`,revise:`Awaiting revision`,done:`All decided`,build_failed:`Publish failed`,building:`Publishing`};function He(){let[e,t]=(0,l.useState)([]),[n,r]=(0,l.useState)(``),[i,a]=(0,l.useState)(`all`),[o,s]=(0,l.useState)(``);(0,l.useEffect)(()=>{let e=!1,n;async function r(){try{let n=await fetch(`/api/tasks`),r=await n.json();if(!n.ok)throw Error(r.error);e||(t(r.tasks),s(``))}catch(t){e||s(t.message)}finally{e||(n=setTimeout(r,2500))}}return r(),()=>{e=!0,clearTimeout(n)}},[]);let c=e.filter(e=>`${e.title} ${e.task}`.toLowerCase().includes(n.toLowerCase())&&(i===`all`||e.state===i));return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`header`,{className:`bar`,children:[(0,w.jsx)(`a`,{className:`brand`,href:te(`/`),children:`LaTeX Review`}),(0,w.jsx)(`span`,{className:`status`,children:S(e.length,`{n} open review`,`{n} open reviews`)})]}),(0,w.jsx)(`main`,{id:`paper`,className:`index`,children:(0,w.jsxs)(`div`,{className:`document`,children:[(0,w.jsx)(`div`,{className:`overview-heading`,children:(0,w.jsx)(`h1`,{children:x(`All reviews`)})}),(0,w.jsxs)(`div`,{className:`task-tools`,children:[(0,w.jsx)(`input`,{type:`search`,"aria-label":x(`Search reviews`),placeholder:x(`Search by title or task name`),value:n,onChange:e=>r(e.target.value)}),(0,w.jsxs)(`select`,{"aria-label":x(`Filter reviews`),value:i,onChange:e=>a(e.target.value),children:[(0,w.jsx)(`option`,{value:`all`,children:x(`All tasks`)}),(0,w.jsx)(`option`,{value:`reviewing`,children:x(`Awaiting your review`)}),(0,w.jsx)(`option`,{value:`building`,children:x(`Publishing`)}),(0,w.jsx)(`option`,{value:`revise`,children:x(`Awaiting revision`)}),(0,w.jsx)(`option`,{value:`done`,children:x(`All decided`)})]})]}),o&&(0,w.jsx)(`p`,{role:`alert`,children:o}),(0,w.jsx)(`ul`,{className:`task-list`,children:c.map(e=>{let t=Object.values(e.counts).reduce((e,t)=>e+t,0),n=t-e.counts.pending;return(0,w.jsx)(`li`,{children:(0,w.jsxs)(`a`,{className:`task-card`,href:te(`/?task=${encodeURIComponent(e.task)}`),children:[(0,w.jsxs)(`div`,{className:`task-heading`,children:[(0,w.jsx)(`h2`,{children:e.title}),(0,w.jsx)(`span`,{className:`status`,"data-state":e.state,children:x(Ve[e.state])})]}),(0,w.jsxs)(`div`,{className:`task-meta`,children:[(0,w.jsx)(`span`,{className:`task-name`,children:e.task}),!e.round&&(0,w.jsx)(`span`,{children:x(`Not published yet`)})]}),t>0&&(0,w.jsxs)(`div`,{className:`task-progress`,children:[(0,w.jsx)(`span`,{className:`track`,children:(0,w.jsx)(`i`,{style:{width:`${100*n/t}%`}})}),(0,w.jsx)(`span`,{children:x(`{decided} of {total} decided`,{decided:n,total:t})})]}),(0,w.jsxs)(`div`,{className:`task-footer`,children:[(0,w.jsx)(`div`,{className:`task-counts`,children:Object.entries(e.counts).filter(([,e])=>e).map(([e,t])=>(0,w.jsx)(`span`,{"data-kind":e,children:x(`{n} ${e}`,{n:t})},e))}),(0,w.jsx)(`span`,{className:`task-open`,children:e.counts.pending?x(`Review →`):x(`Open →`)})]})]})},e.task)})}),!c.length&&(0,w.jsx)(`p`,{className:`empty`,children:e.length?x(`No reviews match this filter.`):x(`No open reviews yet. Start a task from your document repository.`)})]})})]})}var Ue=`latex-review:references`;function We(){try{return localStorage.getItem(Ue)!==`off`}catch{return!0}}var P={doi:`doi.org`,crossref:`Crossref`,dblp:`DBLP`,arxiv:`arXiv`},F={title:`Title`,author:`Authors`,year:`Year`,doi:`DOI`,arxiv:`arXiv`},Ge={added:`New entry`,modified:`Changed entry`,removed:`Removed entry`},Ke={verified:`Verified`,mismatch:`Differs from the record`,unverified:`Not verified`,failed:`Could not check`,skipped:`Nothing to check`,checking:`Checking…`,off:`Not checked online`,confirmed:`Checked by you`},qe={"still-cited":`The paper still cites this key, and no entry defines it now.`,"duplicate-key":`Another entry in the bibliography has the same key.`,unreadable:`BibTeX cannot read this entry.`,"not-in-bibliography":`The paper does not use this .bib file, so the entry will not appear.`};function Je(e,t){let[n,r]=(0,l.useState)(null),i=(0,l.useRef)(!1),[a,o]=(0,l.useState)(0),s=!!e?.references?.entries.some(e=>e.status!==`removed`&&!e.error);(0,l.useEffect)(()=>{if(!e||!s){r(null);return}let n=!1,a,o=e.round;async function c(){let e=We(),s=i.current;i.current=!1;try{let i=await t(`/rounds/${o}/references${e?`?check=1${s?`&retry=1`:``}`:``}`);if(n)return;r({round:o,value:i,error:!1}),e&&i.pending&&(a=setTimeout(c,document.hidden?5e3:1500))}catch{if(n)return;r(e=>({round:o,value:e?.round===o?e.value:null,error:!0})),a=setTimeout(c,5e3)}}return c(),()=>{n=!0,clearTimeout(a)}},[e?.round,e?.after,s,a]);let c=n&&e&&n.round===e.round?n:null;return{checks:c?.value?.checks??{},pending:c?.value?.pending??(s&&We()?1:0),confirmed:c?.value?.confirmed??{},error:!!c?.error,retry(){i.current=!0,o(e=>e+1)},async confirm(n,i){if(!e)return;let a=e.round,o=await t(`/rounds/${a}/references/confirm`,{id:n,confirmed:i});r(e=>e?.round===a?{round:a,value:{...o,pending:Math.max(o.pending,e.value?.pending??0)},error:!1}:e)}}}function Ye(e,t,n,r=!1){let i=e.problems.map(e=>x(qe[e]));if(e.status===`removed`||e.error||r)return i;let a=Xe(t,n);return a!==`verified`&&i.push(x(Ke[a])),i}function Xe(e,t){return e?e.status:t&&We()?`checking`:`off`}function Ze(e,t,n,r={}){let i=new Map;for(let a of e?.entries??[]){let e=Ye(a,t[a.id],n>0,a.id in r);if(e.length)for(let t of a.units??[a.unit])i.set(t,[...i.get(t)??[],{label:a.key,reasons:e}])}for(let t of e?.missing??[])t.unit&&i.set(t.unit,[...i.get(t.unit)??[],{label:`\\cite{${t.key}}`,reasons:[x(`No bibliography entry has this key.`)]}]);return i}var Qe=()=>b().startsWith(`zh`)?``:` `;function $e(e){return`${e.section?`${e.section} · `:``}${e.file}:${e.line}`}function et({entry:e}){let t=e.status===`removed`?[]:e.cited;return e.status===`removed`?null:(0,w.jsx)(`p`,{className:`reference-cited`,children:t.length?S(t.length,`Cited {n} time: {places}`,`Cited {n} times: {places}`,{places:t.map($e).join(`; `)}):x(`Not cited in the paper, so it does not appear in the PDF.`)})}function tt({old:e,next:t,status:n}){return n!==`modified`||e===t?(0,w.jsx)(w.Fragment,{children:t??e}):(0,w.jsxs)(w.Fragment,{children:[e!==null&&(0,w.jsx)(`del`,{children:e}),e!==null&&t!==null&&` `,t!==null&&(0,w.jsx)(`ins`,{children:t})]})}function nt({check:e,state:t,entry:n,onRetry:r,confirmed:i,onConfirm:a}){if(n.status===`removed`||n.error)return null;let o=a&&(i!==void 0||t!==`verified`&&t!==`checking`)?(0,w.jsx)(`p`,{className:`reference-confirmation`,children:i===void 0?(0,w.jsx)(`button`,{type:`button`,className:`reference-confirm`,onClick:()=>a(!0),children:x(`I checked it myself`)}):(0,w.jsxs)(w.Fragment,{children:[x(`You checked this entry yourself.`),` `,(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(!1),children:x(`Undo`)})]})}):null,s=e?.record?P[e.record.source]:``,c=e?.unavailable.length?x(`{sources} could not be reached.`,{sources:e.unavailable.join(`, `)}):``,u=t===`checking`?x(`Looking this entry up in Crossref, DBLP and arXiv…`):t===`off`?x(`Online checks are off in Settings, so this entry was not looked up.`):t===`verified`?e.differences.length?x(`Matches the record in {source}, apart from the small differences below.`,{source:s}):x(`Matches the record in {source}.`,{source:s}):t===`mismatch`?x(`{source} has this work with other details. Compare them below.`,{source:s}):t===`unverified`?e.reason===`doi-not-found`?x(`The DOI is not registered, and no record matches the title.`):e.reason===`arxiv-not-found`?x(`No arXiv paper has this identifier, and no record matches the title.`):x(`No record in Crossref, DBLP or arXiv matches this entry. Theses, reports and many books are in none of them, so check it yourself.`):x(t===`failed`?`The sources could not be reached.`:`The entry has no title, DOI or arXiv identifier to look up.`);return(0,w.jsxs)(`div`,{className:`reference-verdict`,"data-check":t,children:[(0,w.jsxs)(`p`,{children:[u,c&&Qe()+c,(t===`failed`||t===`unverified`||(e?.unavailable.length??0)>0)&&(0,w.jsxs)(w.Fragment,{children:[` `,(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:r,children:x(`Check again`)})]})]}),e&&e.differences.length>0&&(0,w.jsx)(`dl`,{className:`reference-differences`,children:e.differences.map((t,n)=>(0,w.jsxs)(l.Fragment,{children:[(0,w.jsxs)(`dt`,{children:[x(F[t.field]),t.minor?` · ${x(`small`)}`:``]}),(0,w.jsxs)(`dd`,{children:[(0,w.jsxs)(`span`,{className:`reference-ours`,children:[(0,w.jsx)(`span`,{className:`reference-side`,children:x(`Entry`)}),t.bib]}),(0,w.jsxs)(`span`,{className:`reference-theirs`,children:[(0,w.jsx)(`span`,{className:`reference-side`,children:P[e.record?.source??``]??x(`Record`)}),t.record||(t.field===`doi`?x(`(not registered)`):t.field===`arxiv`?x(`(no such paper)`):`—`)]})]})]},n))}),e?.record&&(0,w.jsxs)(`p`,{className:`reference-record`,children:[(0,w.jsxs)(`span`,{className:`reference-side`,children:[x(t===`unverified`?`Closest record`:`Record`),` · `,s]}),(0,w.jsx)(`a`,{href:e.record.url,target:`_blank`,rel:`noopener noreferrer`,children:e.record.title}),[e.record.authors.join(`, `),e.record.venue,e.record.year,e.record.doi?`doi:${e.record.doi}`:null].filter(Boolean).map((e,t)=>(0,w.jsxs)(`span`,{children:[` · `,e]},t))]}),o]})}function rt({entries:e,checks:t,pending:n,onRetry:r,confirmed:i={},onConfirm:a}){return(0,w.jsx)(`div`,{className:`references`,children:e.map(e=>{let o=t[e.id],s=e.status===`removed`?`removed`:e.error?`unreadable`:Xe(o,n),c=i[e.id],l=c!==void 0&&s!==`verified`&&s!==`removed`&&s!==`unreadable`?`confirmed`:s;return(0,w.jsxs)(`section`,{className:`reference-entry`,"data-status":e.status,"data-check":l,children:[(0,w.jsxs)(`header`,{className:`reference-head`,children:[(0,w.jsxs)(`code`,{className:`reference-key`,children:[`@`,e.old_type?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`del`,{children:e.old_type}),(0,w.jsx)(`ins`,{children:e.type})]}):e.type,`{`,e.old_key?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`del`,{children:e.old_key}),(0,w.jsx)(`ins`,{children:e.key})]}):e.key,`}`]}),(0,w.jsx)(`span`,{className:`reference-status`,children:x(Ge[e.status])}),s!==`removed`&&s!==`unreadable`&&(0,w.jsx)(`span`,{className:`reference-check`,"data-check":l,children:x(Ke[l])}),(0,w.jsxs)(`span`,{className:`reference-lines`,children:[e.file,`:`,e.lines[0],`–`,e.lines[1]]})]}),e.problems.map(t=>(0,w.jsxs)(`p`,{className:`reference-problem`,children:[x(qe[t]),t===`unreadable`&&e.error?Qe()+e.error:``,t===`still-cited`&&Qe()+[...e.status===`removed`?e.cited:[],...e.old_cited??[]].map($e).join(`; `)]},t)),(0,w.jsx)(`table`,{className:`reference-fields`,children:(0,w.jsx)(`tbody`,{children:e.fields.map(t=>(0,w.jsxs)(`tr`,{"data-change":e.status!==`modified`||t.old===t.new&&(t.oldResolved??t.old)===(t.resolved??t.new)?void 0:t.old===null?`added`:t.new===null?`removed`:`changed`,children:[(0,w.jsx)(`th`,{scope:`row`,children:t.name}),(0,w.jsxs)(`td`,{children:[(0,w.jsx)(tt,{old:t.old,next:t.new,status:e.status}),(t.resolved!==void 0||t.oldResolved!==void 0)&&(0,w.jsxs)(`span`,{className:`reference-resolved`,children:[` = `,(0,w.jsx)(tt,{old:t.oldResolved??t.old,next:t.resolved??t.new,status:e.status})]})]})]},t.name))})}),(0,w.jsx)(et,{entry:e}),(0,w.jsx)(nt,{check:o,state:s,entry:e,onRetry:r,confirmed:c,onConfirm:a&&(t=>a(e.id,t))})]},e.id)})})}function it({references:e,checks:t,pending:n,confirmed:r={},changeOf:i,onSelect:a,onRetry:o}){let s=e.entries,c=s.filter(e=>e.status!==`removed`&&!e.error),l=e=>e.id in r&&t[e.id]?.status!==`verified`,u=e=>c.filter(n=>t[n.id]?.status===e&&!l(n)).length,d=s.map(e=>({entry:e,reasons:Ye(e,t[e.id],n>0,e.id in r)})).filter(e=>e.reasons.length),f=[s.length?S(s.length,`{n} entry changed`,`{n} entries changed`):S(e.missing.length,`{n} citation without an entry`,`{n} citations without an entry`),u(`verified`)&&S(u(`verified`),`{n} verified`,`{n} verified`),c.filter(l).length&&S(c.filter(l).length,`{n} checked by you`,`{n} checked by you`),u(`mismatch`)&&S(u(`mismatch`),`{n} differs from its record`,`{n} differ from their records`),u(`unverified`)&&S(u(`unverified`),`{n} not verified`,`{n} not verified`),u(`failed`)&&S(u(`failed`),`{n} could not be checked`,`{n} could not be checked`),n>0&&We()&&x(`checking {n}…`,{n}),!We()&&c.length>0&&x(`online checks are off`)].filter(Boolean),p=(e,t)=>{let n=i(e);return n>=0?(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(n),children:t}):(0,w.jsx)(`span`,{children:t})};return(0,w.jsx)(`div`,{className:`banner references-banner`,role:`status`,children:(0,w.jsxs)(`details`,{open:d.length>0||e.missing.length>0,children:[(0,w.jsxs)(`summary`,{children:[(0,w.jsx)(`strong`,{children:x(`Bibliography`)}),` · `,f.join(` · `)]}),(d.length>0||e.missing.length>0)&&(0,w.jsxs)(`ul`,{className:`references-flagged`,children:[d.map(({entry:e,reasons:t})=>(0,w.jsxs)(`li`,{children:[p(e.unit,e.key),` — `,t.join(Qe())]},e.id)),e.missing.map((e,t)=>(0,w.jsxs)(`li`,{children:[p(e.unit,`\\cite{${e.key}}`),` — `,x(`No bibliography entry has this key.`),` `,(0,w.jsx)(`span`,{className:`muted`,children:$e(e)})]},`missing-${t}`))]}),u(`failed`)>0&&(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:o,children:x(`Check again`)})]})})}function at({items:e,staging:t,onCancel:n,onConfirm:r}){let i=(0,l.useRef)(null);return(0,l.useEffect)(()=>i.current?.focus(),[]),(0,w.jsx)(`div`,{className:`help-backdrop`,onClick:n,children:(0,w.jsxs)(`dialog`,{open:!0,"aria-labelledby":`references-confirm-title`,className:`references-confirm`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`h2`,{id:`references-confirm-title`,children:x(t?`Stage bibliography entries that are not verified?`:`Accept bibliography entries that are not verified?`)}),(0,w.jsx)(`ul`,{children:e.map((e,t)=>(0,w.jsxs)(`li`,{children:[(0,w.jsx)(`code`,{children:e.label}),` — `,e.reasons.join(Qe())]},t))}),(0,w.jsx)(`p`,{className:`muted`,children:x(`An agent can write an entry for a work that does not exist, or with the wrong authors, year or DOI. Check each one before it goes into your paper.`)}),(0,w.jsxs)(`div`,{className:`references-confirm-actions`,children:[(0,w.jsx)(`button`,{type:`button`,onClick:n,children:x(`Cancel`)}),(0,w.jsx)(`button`,{type:`button`,className:`accept`,ref:i,onClick:r,children:x(t?`Stage anyway`:`Accept anyway`)})]})]})})}var ot=`latex-review:shortcuts`,st=`latex-review:shortcuts-changed`,ct={accept:[`a`],reject:[`r`],comment:[`c`],next:[`j`,`ArrowRight`],previous:[`k`,`ArrowLeft`],pending:[`n`],source:[`s`],undo:[`u`],help:[`?`]},lt=Object.keys(ct);function ut(e){if(e.isComposing||[`Control`,`Meta`,`Alt`,`Shift`,`Dead`,`Unidentified`,`Process`].includes(e.key))return null;let t=e.key.length===1?e.key.toLowerCase():e.key;return[e.ctrlKey&&`Ctrl`,e.metaKey&&`Meta`,e.altKey&&`Alt`,e.shiftKey&&(/^[a-z]$/.test(t)||t.length>1)&&`Shift`,t].filter(Boolean).join(`+`)}function dt(e){return/^(?:(?:Ctrl|Meta|Alt|Shift)\+)*(?:[a-z0-9?/,.;'\[\]`=\-]|Arrow(?:Left|Right|Up|Down))$/.test(e)}function ft(e){return!dt(e)||/^(?:Ctrl|Meta)\+(?:Shift\+)?[acflnpqrstuvwxz=\-]$/.test(e)||/^(?:Alt|Meta)\+Arrow(?:Left|Right)$/.test(e)}function pt(e){let t=e&&typeof e==`object`?e:{};return Object.fromEntries(lt.map(e=>{let n=t[e];return[e,Array.isArray(n)&&n.length<=4&&n.every(e=>typeof e==`string`&&!ft(e))?[...new Set(n)]:[...ct[e]]]}))}function mt(e){try{return pt(JSON.parse(e||`{}`))}catch{return pt({})}}function ht(){try{return mt(localStorage.getItem(ot))}catch{return pt({})}}function gt(e,t){let n=ut(e);return n?lt.find(e=>t[e].includes(n)):void 0}function I(e){return e.split(`+`).map(e=>({Meta:`⌘`,Ctrl:`Ctrl`,Alt:`Alt`,Shift:`Shift`,ArrowRight:`→`,ArrowLeft:`←`,ArrowUp:`↑`,ArrowDown:`↓`})[e]||e.toUpperCase()).join(`+`)}var _t=`modulepreload`,vt=function(e){return`/`+e},yt={},bt=function(e){return e.pathname.endsWith(`.css`)},xt=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},St=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=vt(t,n);let r=s(t),i=bt(r);return xt(yt,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:_t,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ct=(0,l.lazy)(()=>St(()=>import(`./FullPaper-BXMVtK94.js`).then(e=>({default:e.FullPaper})),[])),wt={text:`Text`,layout:`Layout`,position:`Moved`,identical:`No visible change`,unmapped:`Source only`},Tt={accept:`Accept`,reject:`Reject`,comment:`Comment`},Et={accept:`Stage`,reject:`Revert`,unstage:`Unstage`},Dt={pending:`Unstaged`,accepted:`Staged`,rejected:`Reverted`,commented:`Edited`,mixed:`Partly staged`},Ot={snapshot:`Taking a snapshot`,build:`Compiling LaTeX`,render:`Rendering the diff`};function kt(e,t){try{return JSON.parse(localStorage.getItem(e)??`null`)??t}catch{return t}}function At(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function jt(e){e&&(e.style.height=`0`,e.style.height=`${e.scrollHeight}px`)}function Mt(e){return e?.status===`queued`?e.ahead?S(e.ahead,`Queued behind {n} update…`,`Queued behind {n} updates…`):x(`Queued…`):`${x(Ot[e?.phase??``]||`Starting`)}…`}function Nt({value:e,total:t,label:n}){return t===0?null:(0,w.jsx)(`div`,{className:`meter review-progress`,role:`progressbar`,"aria-label":n,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,title:n,children:(0,w.jsxs)(`span`,{"aria-hidden":`true`,children:[(0,w.jsx)(`span`,{className:`review-progress-value`,children:e}),` / `,t]})})}function Pt({task:e,pinned:t,changes:n=!1}){let[r,i]=(0,l.useState)(null),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(-1),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!0),[m,h]=(0,l.useState)(``),[g,_]=(0,l.useState)(``),[v,y]=(0,l.useState)(new Set),[C,ne]=(0,l.useState)({}),[T,re]=(0,l.useState)(null),[ie,ae]=(0,l.useState)(null),[se,ce]=(0,l.useState)(``),[le,ue]=(0,l.useState)(!1),[de]=(0,l.useState)(()=>{let e=Number(new URLSearchParams(location.search).get(`change`)??-1);return Number.isSafeInteger(e)&&e>=0?e:-1}),[fe,pe]=(0,l.useState)(!!t&&de<0||new URLSearchParams(location.search).has(`history`)),E=(0,l.useRef)(null),me=(0,l.useRef)(0),he=(0,l.useRef)(0),ge=(0,l.useRef)(null),D=(0,l.useRef)({state:r,detail:a,busy:u,composer:T,current:s}),_e=`latex-review:${n?`changes:${location.pathname}`:e}`,[O,ve]=(0,l.useState)(ht),[ye]=(0,l.useState)(()=>{let e=new URLSearchParams(location.search).get(`view`);return e===`paper`||e===`changes`?e:null}),[be,xe]=(0,l.useState)(()=>ye??Be());(0,l.useEffect)(()=>{if(ye)return;let e=e=>xe(e.detail===`changes`?`changes`:`paper`),t=e=>{(e.key===`latex-review:default-view`||e.key===null)&&xe(Be())};return window.addEventListener(ze,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(ze,e),window.removeEventListener(`storage`,t)}},[ye]);let[k,A]=(0,l.useState)(Re),[Se,Ce]=(0,l.useState)({});(0,l.useEffect)(()=>{let e=e=>A(e.detail===!0),t=e=>{(e.key===`latex-review:effects`||e.key===null)&&A(Re())};return window.addEventListener(Le,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(Le,e),window.removeEventListener(`storage`,t)}},[]),(0,l.useEffect)(()=>{Ce({})},[k]),(0,l.useEffect)(()=>{let e=e=>ve(pt(e.detail)),t=e=>{(e.key===`latex-review:shortcuts`||e.key===null)&&ve(ht())};return window.addEventListener(st,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(st,e),window.removeEventListener(`storage`,t)}},[]);function we(){window.dispatchEvent(new Event(`latex-review:help`,{cancelable:!0}))&&ue(!0)}D.current={state:r,detail:a,busy:u,composer:T,current:s};let Me=(0,l.useMemo)(()=>new Map(a?.units.map(e=>[e.id,e])??[]),[a]),N=(0,l.useMemo)(()=>a?Te(a):[],[a]),He=(0,l.useMemo)(()=>{let e=[];if(!a)return e;for(let t of a.sections)for(let n of t.blocks)n.kind===`change`&&e.push({block:n,index:e.length});for(let t of a.loose)e.push({block:t,index:e.length});return e},[a]),Ue=(0,l.useMemo)(()=>{let e=new Map;return N.forEach((t,n)=>t.units.forEach(t=>e.has(t)||e.set(t,n))),e},[N]),We=(0,l.useMemo)(()=>N.map(e=>Ne(e.units.map(e=>Me.get(e)).filter(Boolean),x)),[N,Me]),P=r?.decisions??{},F=ke(P),Ge=Object.keys(P).filter(e=>P[e]===`pending`),Ke=Je(a,mt),qe=(0,l.useMemo)(()=>Ze(a?.references,Ke.checks,Ke.pending,Ke.confirmed),[a,Ke.checks,Ke.pending,Ke.confirmed]),Ye=Ge.filter(e=>!qe.has(e)),Xe=!!(a&&r&&a.round===r.latest&&!r.closed),Qe=fe||n,$e=e=>x((n?Et:Tt)[e]??e),et=e=>x((n?Dt:Ee)[e]??e),tt=(0,l.useRef)(qe);tt.current=qe;let nt=(e,t)=>e.filter(e=>t===`unstage`?P[e]===`accepted`:n&&t===`reject`?[`pending`,`accepted`].includes(P[e]):P[e]===`pending`),ot=e=>n?nt(e,`accept`).length?[`accept`,`reject`]:nt(e,`unstage`).length?[`unstage`,`reject`]:[]:nt(e,`accept`).length?[`accept`,`reject`,`comment`]:[],ct=N.map((e,t)=>({stop:e,index:t})).filter(({stop:e,index:t})=>Qe||t===de||j(e,P).length).map(({index:e})=>e),lt=(e,t)=>ct[ct.indexOf(e)+t]??-1,ut=r?.undo?N.flatMap((e,t)=>e.units.some(e=>r.undo.changes.includes(e))?[t+1]:[]):[];(0,l.useEffect)(()=>{Qe||T||ct.includes(s)||c(ct[0]??-1)},[P,fe,T,a]),(0,l.useEffect)(()=>{n&&s<0&&N.length&&c(Math.max(M(N,P),0))},[a]);let dt=e=>{let t=e===`comment`?r?.commentLock:r?.decisionLock;return t&&x(t)};function ft(e){let t=D.current.state,n=e===`comment`?t?.commentLock:t?.decisionLock;return n&&_(x(n)),!!n}async function mt(t,r){let i=await fetch(`${n?`/api/changes`:`/api/tasks/${encodeURIComponent(e)}`}${t}`,r===void 0?{}:{method:`POST`,headers:{"Content-Type":`application/json`,"X-Review-Token":D.current.state?.csrf??``},body:JSON.stringify(r)}),a=await i.json();if(!i.ok)throw Error(a.error||`HTTP ${i.status}`);return a}function _t(e,t=!0){e<0||e>=N.length||(t&&(ge.current=null),c(e),At(_e,{round:a?.round,stop:N[e].key}),t&&(he.current=Date.now()+800,requestAnimationFrame(()=>{let t=E.current?.querySelector(`[data-stop="${e}"]`);t&&yt(t,`smooth`),t?.focus({preventScroll:!0})})))}function vt(e){let t=E.current,n=parseFloat(getComputedStyle(t).scrollPaddingTop)||0,r=parseFloat(getComputedStyle(e).scrollMarginTop)||0;return t.getBoundingClientRect().top+n+r-e.getBoundingClientRect().top}function yt(e,t=`instant`){let n=E.current;if(!n)return;let r=Number(e.dataset.stop),i=ge.current,a=0;i&&i.index===r&&i.paper===Wt&&(a=i.offset,ge.current=null),n.scrollTo({top:n.scrollTop-vt(e)+a,behavior:t})}function bt(e){let t=E.current?.querySelector(`[data-stop="${e}"]`);t&&N[e]&&At(_e,{round:a?.round,stop:N[e].key,offset:Math.round(vt(t)),paper:Wt})}(0,l.useEffect)(()=>{s>=0&&!ge.current&&Date.now()>=he.current&&E.current?.scrollTop&&bt(s)},[s]),(0,l.useEffect)(()=>{let e=!1,n;async function r(){let a=me.current;try{let n=D.current,r=t||n.detail?.round,s=await mt(`/state${r?`?round=${r}`:``}`);if(e||me.current!==a||D.current.busy)return;p(!0),h(``);let l=t||s.latest;if(l&&(l!==n.detail?.round||s.revision&&s.revision!==n.detail?.after)&&!D.current.composer){let[r,s]=await Promise.all([mt(`/state?round=${l}`),mt(`/rounds/${l}`)]);if(e||me.current!==a||D.current.busy)return;let u=Te(s),d=kt(_e,{}),f=d.round===l?u.findIndex(e=>e.key===d.stop):-1;(f<0||!j(u[f],r.decisions).length)&&(f=M(u,r.decisions,f)),de>=0&&u[de]&&(f=de),f<0&&(f=t&&u.length?0:-1),ge.current=!n.detail&&f>=0&&d.round===l&&u[f].key===d.stop&&d.offset?{index:f,offset:d.offset,paper:!!d.paper}:null,n.detail&&s.round!==n.detail.round&&!t&&pe(!1),i(r),o(s),c(f),y(new Set),n.detail&&_(x(`Changes are ready`))}else i(s)}catch(t){e||(p(!1),h(t.message))}finally{e||(n=setTimeout(r,document.hidden?1e4:1500))}}return r(),()=>{e=!0,clearTimeout(n)}},[e,t]),(0,l.useEffect)(()=>{a&&s>=0&&requestAnimationFrame(()=>{let e=E.current?.querySelector(`[data-stop="${s}"]`);e&&yt(e)})},[a?.round]),(0,l.useEffect)(()=>{r&&(document.title=`${x(r.title)} · LaTeX Review`)},[r?.title]),(0,l.useEffect)(()=>{n&&(document.documentElement.dataset.mode=`changes`)},[n]),(0,l.useEffect)(()=>{if(!g)return;let e=setTimeout(()=>_(``),6e3);return()=>clearTimeout(e)},[g]);function xt(t=j(N[s],P)){if(!Xe||!t.length||u||r?.closed||ft(`comment`))return;let n=`latex-review:${e}:draft:${a?.round}:${t.join(`,`)}`;ce(kt(n,``)),re({changes:t,stop:s,key:n})}function St(e=!1){T&&At(T.key,e?``:se),re(null)}async function Ot(e,t=nt(N[s]?.units??[],e),r=``,o=!1){if(t.length&&!D.current.busy&&Xe&&a&&!ft(e)){if(e===`accept`&&!o){let n=t.flatMap(e=>tt.current.get(e)??[]);if(n.length){ae({kind:e,chosen:t,body:r,items:n});return}}me.current++,d(!0),D.current.busy=!0;try{let o=await mt(`/decide`,{id:crypto.randomUUID(),action:e,round:a.round,changes:t,body:r});i(o),window.dispatchEvent(new CustomEvent(`latex-review:decided`)),e===`comment`&&St(!0);let l=j(N[s],o.decisions).length?s:M(N,o.decisions,s);l>=0&&l!==s&&_t(l),l<0&&(Qe||c(-1),_(n?e===`accept`?x(`All changes are staged.`):``:x(`All changes reviewed. Your decisions are saved.`)))}catch(e){_(e.message)}finally{me.current++,d(!1),D.current.busy=!1}}}async function Pt(){if(r?.undo&&Xe&&!D.current.busy&&!ft(`accept`)){me.current++,d(!0),D.current.busy=!0;try{let e=await mt(`/undo`,{id:r.undo.id});i(e),window.dispatchEvent(new CustomEvent(`latex-review:decided`));let t=N.findIndex(t=>t.units.some(t=>e.restored.includes(t)));pe(!1),t>=0&&_t(t),_(x(n?`Revert undone. The changes are back in your files.`:`Last decision undone. The restored changes need review again.`))}catch(e){_(e.message)}finally{me.current++,d(!1),D.current.busy=!1}}}async function Ft(){T&&se.trim()&&!u&&await Ot(`comment`,T.changes,se.trim())}function It(e){y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function Lt(e){if(!a||!r)return;let t=window.getSelection()?.toString().trim()??``,n=N[e].units.map(e=>Me.get(e)).filter(Boolean);try{await navigator.clipboard.writeText(Pe(r.title,a.round,e+1,Ne(n),t)),_(x(t?`Copied selected text with file, lines and PDF page.`:`Copied the change location.`))}catch{_(x(`Clipboard unavailable. Select the PDF text and use your browser’s Copy command.`))}}(0,l.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||e.isComposing)return;let t=e.target,r=t.matches(`input,textarea,select`)||t.isContentEditable;if(e.key===`Escape`){ie?ae(null):le?ue(!1):T&&St();return}if(T&&(e.metaKey||e.ctrlKey)&&e.key===`Enter`){e.preventDefault(),Ft();return}if(r||le||ie||window.getSelection()?.toString())return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`z`){e.preventDefault(),Pt();return}if(T)return;let i=gt(e,O);!i||n&&i===`comment`||(e.preventDefault(),i===`accept`?Ot(ot(N[s]?.units??[])[0]??`accept`):i===`reject`?Ot(`reject`):i===`comment`?xt():i===`next`?_t(lt(s,1)):i===`previous`?_t(lt(s,-1)):i===`pending`?_t(M(N,P,s)):i===`source`?It(s):i===`undo`?Pt():i===`help`&&we())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,a,s,u,T,se,le,ie,fe,O]);function Rt(){if(!E.current||T||Date.now()<he.current||window.getSelection()?.toString())return;let e=E.current.getBoundingClientRect(),t=Ae([...E.current.querySelectorAll(`[data-stop]`)].filter(e=>ct.includes(Number(e.dataset.stop))).map(e=>{let t=e.getBoundingClientRect();return{index:Number(e.dataset.stop),top:t.top,bottom:t.bottom}}),s,e.top+60,e.bottom-100);t!==s&&_t(t,!1),t>=0&&bt(t)}let zt=e=>{if(e!==s||!r)return null;let t=N[e].units,i=ot(t),a=M(N,P);return(0,w.jsx)(`div`,{className:`dock`,children:(0,w.jsxs)(`nav`,{className:`actions`,"aria-label":x(`Review the current change`),children:[ct.length>1&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`button`,{className:`nav`,"aria-label":x(`Previous change`),"aria-keyshortcuts":O.previous.join(` `),title:[x(`Previous change`),O.previous.map(I).join(` / `)].filter(Boolean).join(` · `),disabled:lt(e,-1)<0,onClick:()=>_t(lt(e,-1)),children:`‹`}),(0,w.jsxs)(`span`,{className:`position`,children:[ct.indexOf(e)+1,` / `,ct.length]})]}),i.length?(0,w.jsx)(w.Fragment,{children:i.map(e=>{let n=O[e===`unstage`?`accept`:e],r=nt(t,e).length;return(0,w.jsxs)(`button`,{className:e,"aria-keyshortcuts":n.join(` `),title:dt(e)||[$e(e),n.map(I).join(` / `)].filter(Boolean).join(` · `),"aria-describedby":dt(e)?`review-lock`:void 0,disabled:u||!Xe||!!dt(e),onClick:()=>e===`comment`?xt():void Ot(e),children:[$e(e),r>1&&e!==`comment`?` (${r})`:``]},e)})}):a>=0?(0,w.jsx)(`button`,{className:`skip`,"aria-keyshortcuts":O.pending.join(` `),onClick:()=>_t(M(N,P,s)),children:x(n?`Next unstaged`:`Next undecided`)}):(0,w.jsx)(`span`,{className:`complete`,children:n?et(De(t,P)):x(Xe?`Review complete`:`Earlier changes`)}),ct.length>1&&(0,w.jsx)(`button`,{className:`nav`,"aria-label":x(`Next change`),"aria-keyshortcuts":O.next.join(` `),title:[x(`Next change`),O.next.map(I).join(` / `)].filter(Boolean).join(` · `),disabled:lt(e,1)<0,onClick:()=>_t(lt(e,1)),children:`›`})]})})};async function Bt(e){let t=a.round,n=`${t}:${e}`;ne(e=>({...e,[n]:`loading`}));try{let{places:r}=await mt(`/rounds/${t}/effects/${encodeURIComponent(e)}`);ne(e=>({...e,[n]:r}))}catch(e){ne(t=>({...t,[n]:{error:e.message}}))}}function Vt(e,t){let{total:n,shown:r}=e.effects,i=`${a.round}:${e.id}`,o=Se[i]??(k||e.visual===`unmapped`||e.visual===`identical`),s=`effects-${a.round}-${e.id}`,c=C[i],l=[...r,...Array.isArray(c)?c:[]],u=(e,n)=>e.length>0&&(0,w.jsx)(`div`,{className:`side ${n}`,"aria-label":x(n===`before`?`Before`:`After`),children:e.map(e=>(0,w.jsx)(oe,{image:e,base:a.files,label:x(n===`before`?`Before`:`After`),clean:t},e.src))});return(0,w.jsxs)(`section`,{className:`effects`,children:[(0,w.jsx)(`p`,{className:`effects-head`,children:(0,w.jsxs)(`button`,{className:`link effects-toggle`,"aria-expanded":o,"aria-controls":s,onClick:()=>Ce(e=>({...e,[i]:!o})),children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,children:o?`▾`:`▸`}),` `,S(n,`Affects {n} place`,`Affects {n} places`)]})}),(0,w.jsx)(`div`,{id:s,hidden:!o,children:o&&(0,w.jsxs)(w.Fragment,{children:[l.map((e,t)=>(0,w.jsxs)(`div`,{className:`place`,children:[(0,w.jsxs)(`p`,{className:`place-where`,children:[x(`p. {pages}`,{pages:e.page}),e.section?` · ${e.section}`:``,e.with?` · ${x(`with {changes}`,{changes:e.with.map(e=>Ue.has(e)?x(`Change {n}`,{n:Ue.get(e)+1}):Me.get(e)?.file??e).join(`, `)})}`:``]}),u(e.before,`before`),u(e.after,`after`)]},t)),n>l.length&&(0,w.jsx)(`button`,{className:`link more-places`,disabled:c===`loading`,onClick:()=>void Bt(e.id),children:c===`loading`?x(`Loading…`):S(n-l.length,`Show {n} more`,`Show {n} more`)}),c&&typeof c==`object`&&`error`in c&&(0,w.jsx)(`p`,{className:`caption`,children:c.error})]})})]},e.id)}function Ht(e,t,i){let o=e.units.map(e=>Me.get(e)).filter(Boolean),c=a.references?.entries.filter(t=>(t.units??[t.unit]).some(t=>e.units.includes(t)))??[],d=a.references?.missing.filter(t=>t.unit&&e.units.includes(t.unit))??[],f=De(e.units,P),p=!j(N[t],P).length,m=Qe||t===de,h=fe||t===de?void 0:n?f===`rejected`?`before`:void 0:Oe(e.units,P)||(f===`commented`?`after`:void 0),g=v.has(t)||!c.length&&(e.identical||!e.before.length&&!e.after.length),y=[...new Set(e.units.map(e=>r?.comments[e]).filter(Boolean))],ee=Ne(o,x),te=c.length?x(`Bibliography`):e.reflow?x(`Reflow`):[...new Set(o.filter(e=>!(e.effects&&e.visual===`unmapped`)).map(e=>e.visual??`unmapped`))].filter(e=>e!==`text`).map(e=>x(wt[e])).join(`, `),S=(t,n)=>(0,w.jsx)(`div`,{className:`side ${n}${e.identical?` identical`:``}`,"aria-label":x(n===`before`?`Before`:`After`),children:t.map(e=>(0,w.jsx)(oe,{image:e,base:a.files,label:x(n===`before`?`Before`:`After`),clean:!!h},e.src))});return(0,w.jsxs)(`article`,{className:`change ${i?`inline`:`standalone`}${s===t?` current`:``}${p&&!m?` reviewed-change`:``}${p&&!m&&!h?` mixed-reviewed`:``}`,"data-stop":t,"data-state":f,"data-resolved":h,tabIndex:-1,onClick:()=>{t===s||T||!m&&p||_t(t,!1)},children:[p&&!m&&!h&&(0,w.jsx)(`p`,{className:`reviewed-placeholder`,children:(0,w.jsx)(`button`,{className:`link`,onClick:()=>{pe(!0),_t(t,!1)},children:x(`Reviewed changes · View in History`)})}),(0,w.jsxs)(`header`,{className:`change-head`,children:[(0,w.jsx)(`span`,{className:`change-number`,"data-change":t+1,children:x(`Change {n}`,{n:t+1})}),(0,w.jsx)(`span`,{className:`change-where`,title:ee,"data-location":Ne(o),children:ee}),zt(t),te&&(0,w.jsx)(`span`,{className:`change-kind`,children:te}),f!==`pending`&&(0,w.jsx)(`span`,{className:`badge`,children:et(f)}),(0,w.jsx)(`button`,{className:`link copy-reference`,title:x(`Copy selected text with this change’s file, line numbers and PDF page`),onPointerDown:e=>e.preventDefault(),onClick:()=>void Lt(t),children:x(`Copy reference`)}),(0,w.jsx)(`button`,{className:`link ${g?`active`:``}`,title:[x(`Show LaTeX source`),O.source.map(I).join(` / `)].filter(Boolean).join(` · `),"aria-keyshortcuts":O.source.join(` `),onClick:()=>It(t),children:e.units.length>1?x(`{n} edits · LaTeX`,{n:e.units.length}):`LaTeX`})]}),o.some(e=>e.history?.length)&&(0,w.jsx)(`div`,{className:`histories`,children:o.flatMap(e=>e.history??[]).map((e,t)=>(0,w.jsxs)(`p`,{children:[(0,w.jsx)(`strong`,{children:x(`Revised after your comment: `)}),`“`,e.comment,`”`]},t))}),!e.identical&&!e.reflow&&e.before.length>0&&S(e.before,`before`),e.after.length>0&&S(e.after,`after`),e.identical&&!c.length&&(0,w.jsx)(`p`,{className:`caption`,children:x(`No visible change in the PDF; see the LaTeX source.`)}),e.reflow&&(0,w.jsx)(`p`,{className:`caption`,children:x(`Continued: only line breaks moved here.`)}),y.length>0&&(0,w.jsx)(`div`,{className:`remark`,children:y.map((e,t)=>(0,w.jsxs)(`p`,{children:[(0,w.jsx)(`strong`,{children:x(`Your comment: `)}),e]},t))}),d.length>0&&(0,w.jsx)(`p`,{className:`reference-problem reference-uncited`,children:d.map(e=>x(`Cites {key}, which no bibliography entry defines.`,{key:e.key})).join(b().startsWith(`zh`)?``:` `)}),c.length>0&&(0,w.jsx)(rt,{entries:c,checks:Ke.checks,pending:Ke.pending>0,onRetry:Ke.retry,confirmed:Ke.confirmed,onConfirm:(e,t)=>void Ke.confirm(e,t).catch(e=>_(e.message))}),g&&(0,w.jsx)(`div`,{className:`source`,children:o.map(e=>(0,w.jsxs)(`div`,{className:`source-unit`,"data-state":P[e.id],children:[(0,w.jsxs)(`div`,{className:`source-title`,children:[(0,w.jsxs)(`span`,{children:[e.file,` ·`,` `,x(`lines {start}–{end}`,{start:e.new_start,end:e.new_end})]}),o.length>1&&(0,w.jsxs)(`span`,{className:`unit-actions`,children:[(0,w.jsx)(`span`,{className:`unit-state`,children:P[e.id]===`pending`?``:et(P[e.id]).toLowerCase()}),(n||P[e.id]===`pending`)&&ot([e.id]).map(t=>(0,w.jsx)(`button`,{className:t,title:dt(t)||void 0,"aria-describedby":dt(t)?`review-lock`:void 0,disabled:u||!Xe||!!dt(t),onClick:()=>t===`comment`?xt([e.id]):void Ot(t,[e.id]),children:$e(t)},t))]})]}),e.kind===`binary`?(0,w.jsx)(`p`,{children:x(`Binary file changed.`)}):(0,w.jsx)(`pre`,{className:`source-code`,children:je(e.old_text,e.new_text).map((e,t)=>e.type===`del`?(0,w.jsx)(`del`,{children:e.text},t):e.type===`ins`?(0,w.jsx)(`ins`,{children:e.text},t):(0,w.jsx)(l.Fragment,{children:e.text},t))}),e.truncated&&(0,w.jsx)(`p`,{className:`muted`,children:x(`Long change: the source is shortened.`)})]},e.id))}),o.filter(e=>e.effects&&Ue.get(e.id)===t).map(e=>Vt(e,!!h))]},t)}let Ut=!ye&&!!a?.pdf&&Ie(He),Wt=Ut&&be===`paper`;(0,l.useEffect)(()=>{let e=document.documentElement;Ut?e.dataset.fullPaper=`available`:delete e.dataset.fullPaper},[Ut]);let Gt=(0,l.useRef)(Wt);(0,l.useEffect)(()=>{Gt.current!==Wt&&(Gt.current=Wt,requestAnimationFrame(()=>{let e=E.current?.querySelector(`[data-stop="${D.current.current}"]`);e&&yt(e)}))},[Wt]);function Kt(e){xe(e)}let qt=0;return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`header`,{className:`bar`,children:[(0,w.jsxs)(`a`,{className:`ghost overview-link`,href:te(`/`),children:[`← `,x(`All reviews`)]}),(0,w.jsxs)(`div`,{className:`identity`,children:[(0,w.jsx)(`h1`,{children:r?.title??`LaTeX Review`}),(0,w.jsx)(`span`,{className:`muted`,children:n?x(`Since the last commit`):a?a.round===r?.latest?x(`Current changes`):x(`Earlier changes`):``})]}),(0,w.jsx)(Nt,{value:n?F.accepted:F.decided,total:n?F.accepted+F.pending:F.total,label:n?x(`{staged} of {total} staged`,{staged:F.accepted,total:F.accepted+F.pending}):x(`{decided} of {total} decided`,{decided:F.decided,total:F.total})}),(0,w.jsxs)(`div`,{className:`bar-end`,children:[F.pending>1&&Ye.length>0&&(0,w.jsxs)(`button`,{className:`ghost accept accept-all`,disabled:u||!Xe||!!T||!!r?.decisionLock,title:r?.decisionLock||[n?S(Ye.length,`Stage the {n} unstaged change.`,`Stage the {n} unstaged changes.`):S(Ye.length,`Accept {n} undecided change`,`Accept {n} undecided changes`),Ge.length>Ye.length?S(Ge.length-Ye.length,`Leaves {n} change with bibliography entries to check.`,`Leaves {n} changes with bibliography entries to check.`):``].filter(Boolean).join(` `),"aria-label":x(n?`Stage all ({n})`:`Accept all ({n})`,{n:Ye.length}),"aria-describedby":r?.decisionLock?`review-lock`:void 0,onClick:()=>void Ot(`accept`,Ye),children:[(0,w.jsx)(`span`,{className:`batch-label`,children:x(n?`Stage all`:`Accept all`)}),(0,w.jsx)(`span`,{className:`batch-count`,children:Ye.length})]}),F.pending>1&&!n&&(0,w.jsxs)(`button`,{className:`ghost reject reject-all`,disabled:u||!Xe||!!T||!!r?.decisionLock,title:r?.decisionLock||S(F.pending,`Reject {n} undecided change`,`Reject {n} undecided changes`),"aria-label":x(`Reject all ({n})`,{n:F.pending}),"aria-describedby":r?.decisionLock?`review-lock`:void 0,onClick:()=>void Ot(`reject`,Ge),children:[(0,w.jsx)(`span`,{className:`batch-label`,children:x(`Reject all`)}),(0,w.jsx)(`span`,{className:`batch-count`,children:F.pending})]}),(!f||r?.closed||![`reviewing`,`done`].includes(r?.state??``))&&(0,w.jsx)(`span`,{className:`status`,role:`status`,"data-state":f?r?.state:`offline`,children:f?r?.closed?x(`Finished`):r?.state===`building`?Mt(r.job):n&&r?.state===`build_failed`?x(`Comparison failed`):x(Ve[r?.state??``]??``):x(`Reconnecting…`)}),n&&r?.undo&&(0,w.jsx)(`button`,{className:`ghost undo`,disabled:!Xe||u||!!r.decisionLock,title:r.decisionLock||[x(`Undo revert`),O.undo.map(I).join(` / `)].filter(Boolean).join(` · `),"aria-keyshortcuts":O.undo.join(` `),onClick:()=>void Pt(),children:x(`Undo revert`)}),Ut&&(0,w.jsxs)(`div`,{className:`view-switch`,role:`group`,"aria-label":x(`Review view`),children:[(0,w.jsx)(`button`,{className:`ghost${be===`paper`?` active`:``}`,"aria-pressed":be===`paper`,onClick:()=>Kt(`paper`),children:`PDF`}),(0,w.jsx)(`button`,{className:`ghost${be===`changes`?` active`:``}`,"aria-pressed":be===`changes`,onClick:()=>Kt(`changes`),children:x(`Changes`)})]}),a&&!fe&&!n&&(0,w.jsx)(`button`,{className:`ghost history`,title:x(`Review history`),onClick:()=>{pe(!0),s<0&&N.length&&c(0)},children:x(`History`)}),(0,w.jsx)(`button`,{className:`ghost round`,"aria-label":x(`Keyboard shortcuts`),onClick:we,children:`?`})]})]}),a&&fe&&(0,w.jsxs)(`nav`,{className:`review-mode`,"aria-label":x(`Review view`),children:[(0,w.jsxs)(`label`,{children:[x(`History`),` `,(0,w.jsx)(`select`,{"aria-label":x(`Review history`),value:a.round,onChange:t=>{location.href=te(`?task=${encodeURIComponent(e)}&round=${t.target.value}&history=1`)},children:Array.from({length:r?.latest||a.round},(e,t)=>t+1).reverse().map(e=>(0,w.jsx)(`option`,{value:e,children:e===r?.latest?x(`Current changes`):(()=>{let t=r?.history?.find(t=>t.number===e)?.created;return t?new Intl.DateTimeFormat(ee(),{dateStyle:`medium`,timeStyle:`medium`}).format(new Date(t*1e3)):x(`Earlier changes`)})()},e))})]}),r?.undo&&(0,w.jsx)(`button`,{className:`ghost undo`,disabled:!Xe||u||!!r.decisionLock,title:r.decisionLock||x(`Undo {action} · {changes}`,{action:x(Tt[r.undo.kind]??r.undo.kind).toLowerCase(),changes:S(ut.length,`Change {list}`,`Changes {list}`,{list:ut.join(`, `)})}),onClick:()=>void Pt(),children:x(`Undo last decision`)}),(0,w.jsx)(`button`,{className:`ghost`,onClick:()=>{t?location.href=te(`?task=${encodeURIComponent(e)}`):(pe(!1),c(M(N,P)))},children:x(`Back to review`)})]}),(0,w.jsxs)(`div`,{className:`review-body`,children:[(0,w.jsxs)(`main`,{id:`paper`,ref:E,tabIndex:-1,onScroll:Rt,children:[n&&a&&!F.pending&&(F.accepted>0||!N.length)&&(0,w.jsxs)(`div`,{className:`review-complete`,role:`status`,tabIndex:-1,children:[(0,w.jsx)(`strong`,{children:F.accepted?x(`All changes are staged`):x(`No uncommitted changes`)}),(0,w.jsx)(`span`,{children:F.accepted?x(`Commit them when you are ready.`):x(`The PDF matches the last commit.`)}),(0,w.jsx)(`div`,{className:`review-complete-actions`})]}),!n&&a&&!fe&&!F.pending&&(0,w.jsxs)(`div`,{className:`review-complete`,role:`status`,tabIndex:-1,children:[(0,w.jsx)(`strong`,{children:x(r?.workspace?.status===`waiting_input`?`Agent needs your input`:r?.workspace?.status===`queued`?`Feedback queued`:r?.workspace?.status===`running`?`Feedback sent · Agent is working`:r?.workspace?.status===`building`||r?.state===`building`?`Preparing the next review…`:r?.workspace?.merging?`Merge review`:`All changes reviewed`)}),(0,w.jsx)(`span`,{children:x(r?.workspace?.status===`waiting_input`?`Open Chat to answer the agent's question.`:[`running`,`queued`,`building`].includes(r?.workspace?.status||``)||r?.state===`building`?`New changes will appear here when ready.`:r?.workspace?.merging?`Your manuscript is unchanged until you save the merged result.`:r?.workspace?.comments?`Your comments are saved. Send feedback so the agent can revise.`:r?.workspace?.deferred?r.workspace.accepted||r.workspace.destination===`branch`?`Choose how to save the accepted changes to your manuscript.`:r.workspace.destination===`workspace`||r.workspace.destination===`commit`?`Accepted changes are in your manuscript.`:`There are no accepted changes to save.`:r?.workspace?.accepted?`Accepted changes are in your manuscript.`:r?.workspace?.unsent&&!F.accepted?`Your decisions are saved. Send them to the agent to continue.`:F.commented&&!r?.workspace?`Your comments are saved for the agent.`:`There are no new changes to review. Previous decisions are available in History.`)}),(0,w.jsx)(`div`,{className:`review-complete-actions`})]}),(r?.commentLock||r?.decisionLock)&&(0,w.jsx)(`div`,{className:`banner`,id:`review-lock`,role:`status`,children:x(r.commentLock||r.decisionLock)}),r?.closed&&!r.commentLock&&(0,w.jsx)(`div`,{className:`banner`,children:x(`This review is finished. Accepted changes are in your manuscript.`)}),r?.state===`build_failed`&&(0,w.jsxs)(`div`,{className:`banner`,children:[(0,w.jsx)(`strong`,{children:x(n?`The comparison could not be built: `:`The latest publish failed: `)}),r.job?.error,r.job?.details&&(0,w.jsx)(`pre`,{className:`details`,children:r.job.details.join(`
17
+ `+i:``}`}function Fe({scrollRoot:e,stops:t,showReviewed:n=!0,locations:r,decisions:i,current:a,disabled:o,onSelect:s}){let c=(0,l.useRef)(null),u=(0,l.useRef)(null),[d,f]=(0,l.useState)([]),[p,m]=(0,l.useState)({top:0,height:0}),h=t.map((e,t)=>({stop:e,index:t})).filter(({stop:e})=>n||j(e,i).length).map(({index:e})=>e);if((0,l.useEffect)(()=>{let t=e.current,n=c.current;if(!t||!n)return;let r=0,i=!0,a=()=>{r=0;let e=Math.max(t.scrollHeight,1),a=n.clientHeight,o=Math.max(0,e-t.clientHeight),s=Math.min(a,Math.max(8,t.clientHeight/e*a));if(m({top:o?Math.max(0,Math.min(t.scrollTop,o))/o*(a-s):0,height:s}),!i)return;i=!1;let c=t.getBoundingClientRect().top+t.clientTop;f([...t.querySelectorAll(`[data-stop]`)].map(n=>{let r=n.getBoundingClientRect(),i=Math.max(0,(r.top-c+t.scrollTop)/e*a);return{top:i,height:Math.max(0,Math.min(a-i,Math.max(4,r.height/e*a)))}}))},o=()=>{r||=requestAnimationFrame(a)},s=new ResizeObserver(()=>{i=!0,o()});s.observe(t),s.observe(n);for(let e of t.children)s.observe(e);for(let e of t.querySelectorAll(`[data-stop]`))s.observe(e);let l=new MutationObserver(e=>{for(let t of e){for(let e of t.removedNodes)e instanceof Element&&s.unobserve(e);for(let e of t.addedNodes)e instanceof Element&&s.observe(e)}i=!0,o()});return l.observe(t,{childList:!0}),t.addEventListener(`scroll`,o,{passive:!0}),o(),()=>{s.disconnect(),l.disconnect(),t.removeEventListener(`scroll`,o),cancelAnimationFrame(r)}},[e,t]),!t.length)return null;function g(t,n){let r=e.current,i=c.current;if(!r||!i)return;let a=t-i.getBoundingClientRect().top-i.clientTop,o=Math.max(1,i.clientHeight-p.height);r.scrollTo({top:(a-n)/o*(r.scrollHeight-r.clientHeight),behavior:`instant`})}return(0,w.jsxs)(`nav`,{ref:c,className:`change-map`,"aria-label":x(`Change map`),onPointerDown:e=>{if(e.button!==0||e.target.closest(`button`))return;e.preventDefault();let t=e.target.classList.contains(`change-map-viewport`)?e.clientY-e.currentTarget.getBoundingClientRect().top-e.currentTarget.clientTop-p.top:p.height/2;u.current={pointer:e.pointerId,offset:t},e.currentTarget.setPointerCapture(e.pointerId),g(e.clientY,t)},onPointerMove:e=>{u.current?.pointer===e.pointerId&&g(e.clientY,u.current.offset)},onPointerUp:e=>{u.current?.pointer===e.pointerId&&(u.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},onLostPointerCapture:()=>{u.current=null},children:[(0,w.jsx)(`div`,{className:`change-map-viewport`,style:{top:p.top,height:p.height},"aria-hidden":`true`}),t.map((e,n)=>{if(!h.includes(n))return null;let l=d[n];if(!l)return null;let u=De(e.units,i),f=`${x(`Change {n}`,{n:n+1})} · ${x(Ee[u]??u).toLowerCase()} · ${r[n]}`;return(0,w.jsx)(`button`,{type:`button`,className:`change-map-mark`,"data-stop-index":n,"data-state":u,"aria-label":f,"aria-current":n===a?`location`:void 0,tabIndex:n===(h.includes(a)?a:h[0])?0:-1,disabled:o,style:{top:l.top,height:l.height},onClick:()=>s(n),onKeyDown:e=>{let r=e.key===`ArrowDown`?h[h.indexOf(n)+1]??n:e.key===`ArrowUp`?h[h.indexOf(n)-1]??n:e.key===`Home`?h[0]:e.key===`End`?h.at(-1):null;r!=null&&(e.preventDefault(),e.stopPropagation(),c.current?.querySelector(`[data-stop-index="${Math.max(0,Math.min(t.length-1,r))}"]`)?.focus())},children:(0,w.jsx)(`span`,{className:`change-map-tooltip`,children:f})},e.key)})]})}var Ie=e=>e.some(e=>e.block.after.some(e=>e.top!==void 0)),N=`latex-review:effects`,Le=`latex-review:effects-changed`;function Re(){try{return localStorage.getItem(N)===`on`}catch{return!1}}var ze=`latex-review:view-changed`;function Be(){try{return localStorage.getItem(`latex-review:default-view`)===`paper`?`paper`:`changes`}catch{return`changes`}}var Ve={editing:`Editing`,reviewing:`In review`,revise:`Awaiting revision`,done:`All decided`,build_failed:`Publish failed`,building:`Publishing`};function He(){let[e,t]=(0,l.useState)([]),[n,r]=(0,l.useState)(``),[i,a]=(0,l.useState)(`all`),[o,s]=(0,l.useState)(``);(0,l.useEffect)(()=>{let e=!1,n;async function r(){try{let n=await fetch(`/api/tasks`),r=await n.json();if(!n.ok)throw Error(r.error);e||(t(r.tasks),s(``))}catch(t){e||s(t.message)}finally{e||(n=setTimeout(r,2500))}}return r(),()=>{e=!0,clearTimeout(n)}},[]);let c=e.filter(e=>`${e.title} ${e.task}`.toLowerCase().includes(n.toLowerCase())&&(i===`all`||e.state===i));return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`header`,{className:`bar`,children:[(0,w.jsx)(`a`,{className:`brand`,href:te(`/`),children:`LaTeX Review`}),(0,w.jsx)(`span`,{className:`status`,children:S(e.length,`{n} open review`,`{n} open reviews`)})]}),(0,w.jsx)(`main`,{id:`paper`,className:`index`,children:(0,w.jsxs)(`div`,{className:`document`,children:[(0,w.jsx)(`div`,{className:`overview-heading`,children:(0,w.jsx)(`h1`,{children:x(`All reviews`)})}),(0,w.jsxs)(`div`,{className:`task-tools`,children:[(0,w.jsx)(`input`,{type:`search`,"aria-label":x(`Search reviews`),placeholder:x(`Search by title or task name`),value:n,onChange:e=>r(e.target.value)}),(0,w.jsxs)(`select`,{"aria-label":x(`Filter reviews`),value:i,onChange:e=>a(e.target.value),children:[(0,w.jsx)(`option`,{value:`all`,children:x(`All tasks`)}),(0,w.jsx)(`option`,{value:`reviewing`,children:x(`Awaiting your review`)}),(0,w.jsx)(`option`,{value:`building`,children:x(`Publishing`)}),(0,w.jsx)(`option`,{value:`revise`,children:x(`Awaiting revision`)}),(0,w.jsx)(`option`,{value:`done`,children:x(`All decided`)})]})]}),o&&(0,w.jsx)(`p`,{role:`alert`,children:o}),(0,w.jsx)(`ul`,{className:`task-list`,children:c.map(e=>{let t=Object.values(e.counts).reduce((e,t)=>e+t,0),n=t-e.counts.pending;return(0,w.jsx)(`li`,{children:(0,w.jsxs)(`a`,{className:`task-card`,href:te(`/?task=${encodeURIComponent(e.task)}`),children:[(0,w.jsxs)(`div`,{className:`task-heading`,children:[(0,w.jsx)(`h2`,{children:e.title}),(0,w.jsx)(`span`,{className:`status`,"data-state":e.state,children:x(Ve[e.state])})]}),(0,w.jsxs)(`div`,{className:`task-meta`,children:[(0,w.jsx)(`span`,{className:`task-name`,children:e.task}),!e.round&&(0,w.jsx)(`span`,{children:x(`Not published yet`)})]}),t>0&&(0,w.jsxs)(`div`,{className:`task-progress`,children:[(0,w.jsx)(`span`,{className:`track`,children:(0,w.jsx)(`i`,{style:{width:`${100*n/t}%`}})}),(0,w.jsx)(`span`,{children:x(`{decided} of {total} decided`,{decided:n,total:t})})]}),(0,w.jsxs)(`div`,{className:`task-footer`,children:[(0,w.jsx)(`div`,{className:`task-counts`,children:Object.entries(e.counts).filter(([,e])=>e).map(([e,t])=>(0,w.jsx)(`span`,{"data-kind":e,children:x(`{n} ${e}`,{n:t})},e))}),(0,w.jsx)(`span`,{className:`task-open`,children:e.counts.pending?x(`Review →`):x(`Open →`)})]})]})},e.task)})}),!c.length&&(0,w.jsx)(`p`,{className:`empty`,children:e.length?x(`No reviews match this filter.`):x(`No open reviews yet. Start a task from your document repository.`)})]})})]})}var Ue=`latex-review:references`;function We(){try{return localStorage.getItem(Ue)!==`off`}catch{return!0}}var P={doi:`doi.org`,crossref:`Crossref`,dblp:`DBLP`,arxiv:`arXiv`},F={title:`Title`,author:`Authors`,year:`Year`,doi:`DOI`,arxiv:`arXiv`},Ge={added:`New entry`,modified:`Changed entry`,removed:`Removed entry`},Ke={verified:`Verified`,mismatch:`Differs from the record`,unverified:`Not verified`,failed:`Could not check`,skipped:`Nothing to check`,checking:`Checking…`,off:`Not checked online`,confirmed:`Checked by you`},qe={"still-cited":`The paper still cites this key, and no entry defines it now.`,"duplicate-key":`Another entry in the bibliography has the same key.`,unreadable:`BibTeX cannot read this entry.`,"not-in-bibliography":`The paper does not use this .bib file, so the entry will not appear.`};function Je(e,t){let[n,r]=(0,l.useState)(null),i=(0,l.useRef)(!1),[a,o]=(0,l.useState)(0),s=!!e?.references?.entries.some(e=>e.status!==`removed`&&!e.error);(0,l.useEffect)(()=>{if(!e||!s){r(null);return}let n=!1,a,o=e.round;async function c(){let e=We(),s=i.current;i.current=!1;try{let i=await t(`/rounds/${o}/references${e?`?check=1${s?`&retry=1`:``}`:``}`);if(n)return;r({round:o,value:i,error:!1}),e&&i.pending&&(a=setTimeout(c,document.hidden?5e3:1500))}catch{if(n)return;r(e=>({round:o,value:e?.round===o?e.value:null,error:!0})),a=setTimeout(c,5e3)}}return c(),()=>{n=!0,clearTimeout(a)}},[e?.round,e?.after,s,a]);let c=n&&e&&n.round===e.round?n:null;return{checks:c?.value?.checks??{},pending:c?.value?.pending??(s&&We()?1:0),confirmed:c?.value?.confirmed??{},error:!!c?.error,retry(){i.current=!0,o(e=>e+1)},async confirm(n,i){if(!e)return;let a=e.round,o=await t(`/rounds/${a}/references/confirm`,{id:n,confirmed:i});r(e=>e?.round===a?{round:a,value:{...o,pending:Math.max(o.pending,e.value?.pending??0)},error:!1}:e)}}}function Ye(e,t,n,r=!1){let i=e.problems.map(e=>x(qe[e]));if(e.status===`removed`||e.error||r)return i;let a=Xe(t,n);return a!==`verified`&&i.push(x(Ke[a])),i}function Xe(e,t){return e?e.status:t&&We()?`checking`:`off`}function Ze(e,t,n,r={}){let i=new Map;for(let a of e?.entries??[]){let e=Ye(a,t[a.id],n>0,a.id in r);if(e.length)for(let t of a.units??[a.unit])i.set(t,[...i.get(t)??[],{label:a.key,reasons:e}])}for(let t of e?.missing??[])t.unit&&i.set(t.unit,[...i.get(t.unit)??[],{label:`\\cite{${t.key}}`,reasons:[x(`No bibliography entry has this key.`)]}]);return i}var Qe=()=>b().startsWith(`zh`)?``:` `;function $e(e){return`${e.section?`${e.section} · `:``}${e.file}:${e.line}`}function et({entry:e}){let t=e.status===`removed`?[]:e.cited;return e.status===`removed`?null:(0,w.jsx)(`p`,{className:`reference-cited`,children:t.length?S(t.length,`Cited {n} time: {places}`,`Cited {n} times: {places}`,{places:t.map($e).join(`; `)}):x(`Not cited in the paper, so it does not appear in the PDF.`)})}function tt({old:e,next:t,status:n}){return n!==`modified`||e===t?(0,w.jsx)(w.Fragment,{children:t??e}):(0,w.jsxs)(w.Fragment,{children:[e!==null&&(0,w.jsx)(`del`,{children:e}),e!==null&&t!==null&&` `,t!==null&&(0,w.jsx)(`ins`,{children:t})]})}function nt({check:e,state:t,entry:n,onRetry:r,confirmed:i,onConfirm:a}){if(n.status===`removed`||n.error)return null;let o=a&&(i!==void 0||t!==`verified`&&t!==`checking`)?(0,w.jsx)(`p`,{className:`reference-confirmation`,children:i===void 0?(0,w.jsx)(`button`,{type:`button`,className:`reference-confirm`,onClick:()=>a(!0),children:x(`I checked it myself`)}):(0,w.jsxs)(w.Fragment,{children:[x(`You checked this entry yourself.`),` `,(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(!1),children:x(`Undo`)})]})}):null,s=e?.record?P[e.record.source]:``,c=e?.unavailable.length?x(`{sources} could not be reached.`,{sources:e.unavailable.join(`, `)}):``,u=t===`checking`?x(`Looking this entry up in Crossref, DBLP and arXiv…`):t===`off`?x(`Online checks are off in Settings, so this entry was not looked up.`):t===`verified`?e.differences.length?x(`Matches the record in {source}, apart from the small differences below.`,{source:s}):x(`Matches the record in {source}.`,{source:s}):t===`mismatch`?x(`{source} has this work with other details. Compare them below.`,{source:s}):t===`unverified`?e.reason===`doi-not-found`?x(`The DOI is not registered, and no record matches the title.`):e.reason===`arxiv-not-found`?x(`No arXiv paper has this identifier, and no record matches the title.`):x(`No record in Crossref, DBLP or arXiv matches this entry. Theses, reports and many books are in none of them, so check it yourself.`):x(t===`failed`?`The sources could not be reached.`:`The entry has no title, DOI or arXiv identifier to look up.`);return(0,w.jsxs)(`div`,{className:`reference-verdict`,"data-check":t,children:[(0,w.jsxs)(`p`,{children:[u,c&&Qe()+c,(t===`failed`||t===`unverified`||(e?.unavailable.length??0)>0)&&(0,w.jsxs)(w.Fragment,{children:[` `,(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:r,children:x(`Check again`)})]})]}),e&&e.differences.length>0&&(0,w.jsx)(`dl`,{className:`reference-differences`,children:e.differences.map((t,n)=>(0,w.jsxs)(l.Fragment,{children:[(0,w.jsxs)(`dt`,{children:[x(F[t.field]),t.minor?` · ${x(`small`)}`:``]}),(0,w.jsxs)(`dd`,{children:[(0,w.jsxs)(`span`,{className:`reference-ours`,children:[(0,w.jsx)(`span`,{className:`reference-side`,children:x(`Entry`)}),t.bib]}),(0,w.jsxs)(`span`,{className:`reference-theirs`,children:[(0,w.jsx)(`span`,{className:`reference-side`,children:P[e.record?.source??``]??x(`Record`)}),t.record||(t.field===`doi`?x(`(not registered)`):t.field===`arxiv`?x(`(no such paper)`):`—`)]})]})]},n))}),e?.record&&(0,w.jsxs)(`p`,{className:`reference-record`,children:[(0,w.jsxs)(`span`,{className:`reference-side`,children:[x(t===`unverified`?`Closest record`:`Record`),` · `,s]}),(0,w.jsx)(`a`,{href:e.record.url,target:`_blank`,rel:`noopener noreferrer`,children:e.record.title}),[e.record.authors.join(`, `),e.record.venue,e.record.year,e.record.doi?`doi:${e.record.doi}`:null].filter(Boolean).map((e,t)=>(0,w.jsxs)(`span`,{children:[` · `,e]},t))]}),o]})}function rt({entries:e,checks:t,pending:n,onRetry:r,confirmed:i={},onConfirm:a}){return(0,w.jsx)(`div`,{className:`references`,children:e.map(e=>{let o=t[e.id],s=e.status===`removed`?`removed`:e.error?`unreadable`:Xe(o,n),c=i[e.id],l=c!==void 0&&s!==`verified`&&s!==`removed`&&s!==`unreadable`?`confirmed`:s;return(0,w.jsxs)(`section`,{className:`reference-entry`,"data-status":e.status,"data-check":l,children:[(0,w.jsxs)(`header`,{className:`reference-head`,children:[(0,w.jsxs)(`code`,{className:`reference-key`,children:[`@`,e.old_type?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`del`,{children:e.old_type}),(0,w.jsx)(`ins`,{children:e.type})]}):e.type,`{`,e.old_key?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`del`,{children:e.old_key}),(0,w.jsx)(`ins`,{children:e.key})]}):e.key,`}`]}),(0,w.jsx)(`span`,{className:`reference-status`,children:x(Ge[e.status])}),s!==`removed`&&s!==`unreadable`&&(0,w.jsx)(`span`,{className:`reference-check`,"data-check":l,children:x(Ke[l])}),(0,w.jsxs)(`span`,{className:`reference-lines`,children:[e.file,`:`,e.lines[0],`–`,e.lines[1]]})]}),e.problems.map(t=>(0,w.jsxs)(`p`,{className:`reference-problem`,children:[x(qe[t]),t===`unreadable`&&e.error?Qe()+e.error:``,t===`still-cited`&&Qe()+[...e.status===`removed`?e.cited:[],...e.old_cited??[]].map($e).join(`; `)]},t)),(0,w.jsx)(`table`,{className:`reference-fields`,children:(0,w.jsx)(`tbody`,{children:e.fields.map(t=>(0,w.jsxs)(`tr`,{"data-change":e.status!==`modified`||t.old===t.new&&(t.oldResolved??t.old)===(t.resolved??t.new)?void 0:t.old===null?`added`:t.new===null?`removed`:`changed`,children:[(0,w.jsx)(`th`,{scope:`row`,children:t.name}),(0,w.jsxs)(`td`,{children:[(0,w.jsx)(tt,{old:t.old,next:t.new,status:e.status}),(t.resolved!==void 0||t.oldResolved!==void 0)&&(0,w.jsxs)(`span`,{className:`reference-resolved`,children:[` = `,(0,w.jsx)(tt,{old:t.oldResolved??t.old,next:t.resolved??t.new,status:e.status})]})]})]},t.name))})}),(0,w.jsx)(et,{entry:e}),(0,w.jsx)(nt,{check:o,state:s,entry:e,onRetry:r,confirmed:c,onConfirm:a&&(t=>a(e.id,t))})]},e.id)})})}function it({references:e,checks:t,pending:n,confirmed:r={},changeOf:i,onSelect:a,onRetry:o}){let s=e.entries,c=s.filter(e=>e.status!==`removed`&&!e.error),l=e=>e.id in r&&t[e.id]?.status!==`verified`,u=e=>c.filter(n=>t[n.id]?.status===e&&!l(n)).length,d=s.map(e=>({entry:e,reasons:Ye(e,t[e.id],n>0,e.id in r)})).filter(e=>e.reasons.length),f=[s.length?S(s.length,`{n} entry changed`,`{n} entries changed`):S(e.missing.length,`{n} citation without an entry`,`{n} citations without an entry`),u(`verified`)&&S(u(`verified`),`{n} verified`,`{n} verified`),c.filter(l).length&&S(c.filter(l).length,`{n} checked by you`,`{n} checked by you`),u(`mismatch`)&&S(u(`mismatch`),`{n} differs from its record`,`{n} differ from their records`),u(`unverified`)&&S(u(`unverified`),`{n} not verified`,`{n} not verified`),u(`failed`)&&S(u(`failed`),`{n} could not be checked`,`{n} could not be checked`),n>0&&We()&&x(`checking {n}…`,{n}),!We()&&c.length>0&&x(`online checks are off`)].filter(Boolean),p=(e,t)=>{let n=i(e);return n>=0?(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(n),children:t}):(0,w.jsx)(`span`,{children:t})};return(0,w.jsx)(`div`,{className:`banner references-banner`,role:`status`,children:(0,w.jsxs)(`details`,{open:d.length>0||e.missing.length>0,children:[(0,w.jsxs)(`summary`,{children:[(0,w.jsx)(`strong`,{children:x(`Bibliography`)}),` · `,f.join(` · `)]}),(d.length>0||e.missing.length>0)&&(0,w.jsxs)(`ul`,{className:`references-flagged`,children:[d.map(({entry:e,reasons:t})=>(0,w.jsxs)(`li`,{children:[p(e.unit,e.key),` — `,t.join(Qe())]},e.id)),e.missing.map((e,t)=>(0,w.jsxs)(`li`,{children:[p(e.unit,`\\cite{${e.key}}`),` — `,x(`No bibliography entry has this key.`),` `,(0,w.jsx)(`span`,{className:`muted`,children:$e(e)})]},`missing-${t}`))]}),u(`failed`)>0&&(0,w.jsx)(`button`,{type:`button`,className:`link`,onClick:o,children:x(`Check again`)})]})})}function at({items:e,staging:t,onCancel:n,onConfirm:r}){let i=(0,l.useRef)(null);return(0,l.useEffect)(()=>i.current?.focus(),[]),(0,w.jsx)(`div`,{className:`help-backdrop`,onClick:n,children:(0,w.jsxs)(`dialog`,{open:!0,"aria-labelledby":`references-confirm-title`,className:`references-confirm`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`h2`,{id:`references-confirm-title`,children:x(t?`Stage bibliography entries that are not verified?`:`Accept bibliography entries that are not verified?`)}),(0,w.jsx)(`ul`,{children:e.map((e,t)=>(0,w.jsxs)(`li`,{children:[(0,w.jsx)(`code`,{children:e.label}),` — `,e.reasons.join(Qe())]},t))}),(0,w.jsx)(`p`,{className:`muted`,children:x(`An agent can write an entry for a work that does not exist, or with the wrong authors, year or DOI. Check each one before it goes into your paper.`)}),(0,w.jsxs)(`div`,{className:`references-confirm-actions`,children:[(0,w.jsx)(`button`,{type:`button`,onClick:n,children:x(`Cancel`)}),(0,w.jsx)(`button`,{type:`button`,className:`accept`,ref:i,onClick:r,children:x(t?`Stage anyway`:`Accept anyway`)})]})]})})}var ot=`latex-review:shortcuts`,st=`latex-review:shortcuts-changed`,ct={accept:[`a`],reject:[`r`],comment:[`c`],next:[`j`,`ArrowRight`],previous:[`k`,`ArrowLeft`],pending:[`n`],source:[`s`],undo:[`u`],help:[`?`]},lt=Object.keys(ct);function ut(e){if(e.isComposing||[`Control`,`Meta`,`Alt`,`Shift`,`Dead`,`Unidentified`,`Process`].includes(e.key))return null;let t=e.key.length===1?e.key.toLowerCase():e.key;return[e.ctrlKey&&`Ctrl`,e.metaKey&&`Meta`,e.altKey&&`Alt`,e.shiftKey&&(/^[a-z]$/.test(t)||t.length>1)&&`Shift`,t].filter(Boolean).join(`+`)}function dt(e){return/^(?:(?:Ctrl|Meta|Alt|Shift)\+)*(?:[a-z0-9?/,.;'\[\]`=\-]|Arrow(?:Left|Right|Up|Down))$/.test(e)}function ft(e){return!dt(e)||/^(?:Ctrl|Meta)\+(?:Shift\+)?[acflnpqrstuvwxz=\-]$/.test(e)||/^(?:Alt|Meta)\+Arrow(?:Left|Right)$/.test(e)}function pt(e){let t=e&&typeof e==`object`?e:{};return Object.fromEntries(lt.map(e=>{let n=t[e];return[e,Array.isArray(n)&&n.length<=4&&n.every(e=>typeof e==`string`&&!ft(e))?[...new Set(n)]:[...ct[e]]]}))}function mt(e){try{return pt(JSON.parse(e||`{}`))}catch{return pt({})}}function ht(){try{return mt(localStorage.getItem(ot))}catch{return pt({})}}function gt(e,t){let n=ut(e);return n?lt.find(e=>t[e].includes(n)):void 0}function I(e){return e.split(`+`).map(e=>({Meta:`⌘`,Ctrl:`Ctrl`,Alt:`Alt`,Shift:`Shift`,ArrowRight:`→`,ArrowLeft:`←`,ArrowUp:`↑`,ArrowDown:`↓`})[e]||e.toUpperCase()).join(`+`)}var _t=`modulepreload`,vt=function(e){return`/`+e},yt={},bt=function(e){return e.pathname.endsWith(`.css`)},xt=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},St=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=vt(t,n);let r=s(t),i=bt(r);return xt(yt,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:_t,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ct=(0,l.lazy)(()=>St(()=>import(`./FullPaper-zL_YjQvI.js`).then(e=>({default:e.FullPaper})),[])),wt={text:`Text`,layout:`Layout`,position:`Moved`,identical:`No visible change`,unmapped:`Source only`},Tt={accept:`Accept`,reject:`Reject`,comment:`Comment`},Et={accept:`Stage`,reject:`Revert`,unstage:`Unstage`},Dt={pending:`Unstaged`,accepted:`Staged`,rejected:`Reverted`,commented:`Edited`,mixed:`Partly staged`},Ot={snapshot:`Taking a snapshot`,build:`Compiling LaTeX`,render:`Rendering the diff`};function kt(e,t){try{return JSON.parse(localStorage.getItem(e)??`null`)??t}catch{return t}}function At(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function jt(e){e&&(e.style.height=`0`,e.style.height=`${e.scrollHeight}px`)}function Mt(e){return e?.status===`queued`?e.ahead?S(e.ahead,`Queued behind {n} update…`,`Queued behind {n} updates…`):x(`Queued…`):`${x(Ot[e?.phase??``]||`Starting`)}…`}function Nt({value:e,total:t,label:n}){return t===0?null:(0,w.jsx)(`div`,{className:`meter review-progress`,role:`progressbar`,"aria-label":n,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,title:n,children:(0,w.jsxs)(`span`,{"aria-hidden":`true`,children:[(0,w.jsx)(`span`,{className:`review-progress-value`,children:e}),` / `,t]})})}function Pt({task:e,pinned:t,changes:n=!1}){let[r,i]=(0,l.useState)(null),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(-1),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!0),[m,h]=(0,l.useState)(``),[g,_]=(0,l.useState)(``),[v,y]=(0,l.useState)(new Set),[C,ne]=(0,l.useState)({}),[T,re]=(0,l.useState)(null),[ie,ae]=(0,l.useState)(null),[se,ce]=(0,l.useState)(``),[le,ue]=(0,l.useState)(!1),[de]=(0,l.useState)(()=>{let e=Number(new URLSearchParams(location.search).get(`change`)??-1);return Number.isSafeInteger(e)&&e>=0?e:-1}),[fe,pe]=(0,l.useState)(!!t&&de<0||new URLSearchParams(location.search).has(`history`)),E=(0,l.useRef)(null),me=(0,l.useRef)(0),he=(0,l.useRef)(0),ge=(0,l.useRef)(null),D=(0,l.useRef)({state:r,detail:a,busy:u,composer:T,current:s}),_e=`latex-review:${n?`changes:${location.pathname}`:e}`,[O,ve]=(0,l.useState)(ht),[ye]=(0,l.useState)(()=>{let e=new URLSearchParams(location.search).get(`view`);return e===`paper`||e===`changes`?e:null}),[be,xe]=(0,l.useState)(()=>ye??Be());(0,l.useEffect)(()=>{if(ye)return;let e=e=>xe(e.detail===`changes`?`changes`:`paper`),t=e=>{(e.key===`latex-review:default-view`||e.key===null)&&xe(Be())};return window.addEventListener(ze,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(ze,e),window.removeEventListener(`storage`,t)}},[ye]);let[k,A]=(0,l.useState)(Re),[Se,Ce]=(0,l.useState)({});(0,l.useEffect)(()=>{let e=e=>A(e.detail===!0),t=e=>{(e.key===`latex-review:effects`||e.key===null)&&A(Re())};return window.addEventListener(Le,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(Le,e),window.removeEventListener(`storage`,t)}},[]),(0,l.useEffect)(()=>{Ce({})},[k]),(0,l.useEffect)(()=>{let e=e=>ve(pt(e.detail)),t=e=>{(e.key===`latex-review:shortcuts`||e.key===null)&&ve(ht())};return window.addEventListener(st,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(st,e),window.removeEventListener(`storage`,t)}},[]);function we(){window.dispatchEvent(new Event(`latex-review:help`,{cancelable:!0}))&&ue(!0)}D.current={state:r,detail:a,busy:u,composer:T,current:s};let Me=(0,l.useMemo)(()=>new Map(a?.units.map(e=>[e.id,e])??[]),[a]),N=(0,l.useMemo)(()=>a?Te(a):[],[a]),He=(0,l.useMemo)(()=>{let e=[];if(!a)return e;for(let t of a.sections)for(let n of t.blocks)n.kind===`change`&&e.push({block:n,index:e.length});for(let t of a.loose)e.push({block:t,index:e.length});return e},[a]),Ue=(0,l.useMemo)(()=>{let e=new Map;return N.forEach((t,n)=>t.units.forEach(t=>e.has(t)||e.set(t,n))),e},[N]),We=(0,l.useMemo)(()=>N.map(e=>Ne(e.units.map(e=>Me.get(e)).filter(Boolean),x)),[N,Me]),P=r?.decisions??{},F=ke(P),Ge=Object.keys(P).filter(e=>P[e]===`pending`),Ke=Je(a,mt),qe=(0,l.useMemo)(()=>Ze(a?.references,Ke.checks,Ke.pending,Ke.confirmed),[a,Ke.checks,Ke.pending,Ke.confirmed]),Ye=Ge.filter(e=>!qe.has(e)),Xe=!!(a&&r&&a.round===r.latest&&!r.closed),Qe=fe||n,$e=e=>x((n?Et:Tt)[e]??e),et=e=>x((n?Dt:Ee)[e]??e),tt=(0,l.useRef)(qe);tt.current=qe;let nt=(e,t)=>e.filter(e=>t===`unstage`?P[e]===`accepted`:n&&t===`reject`?[`pending`,`accepted`].includes(P[e]):P[e]===`pending`),ot=e=>n?nt(e,`accept`).length?[`accept`,`reject`]:nt(e,`unstage`).length?[`unstage`,`reject`]:[]:nt(e,`accept`).length?[`accept`,`reject`,`comment`]:[],ct=N.map((e,t)=>({stop:e,index:t})).filter(({stop:e,index:t})=>Qe||t===de||j(e,P).length).map(({index:e})=>e),lt=(e,t)=>ct[ct.indexOf(e)+t]??-1,ut=r?.undo?N.flatMap((e,t)=>e.units.some(e=>r.undo.changes.includes(e))?[t+1]:[]):[];(0,l.useEffect)(()=>{Qe||T||ct.includes(s)||c(ct[0]??-1)},[P,fe,T,a]),(0,l.useEffect)(()=>{n&&s<0&&N.length&&c(Math.max(M(N,P),0))},[a]);let dt=e=>{let t=e===`comment`?r?.commentLock:r?.decisionLock;return t&&x(t)};function ft(e){let t=D.current.state,n=e===`comment`?t?.commentLock:t?.decisionLock;return n&&_(x(n)),!!n}async function mt(t,r){let i=await fetch(`${n?`/api/changes`:`/api/tasks/${encodeURIComponent(e)}`}${t}`,r===void 0?{}:{method:`POST`,headers:{"Content-Type":`application/json`,"X-Review-Token":D.current.state?.csrf??``},body:JSON.stringify(r)}),a=await i.json();if(!i.ok)throw Error(a.error||`HTTP ${i.status}`);return a}function _t(e,t=!0){e<0||e>=N.length||(t&&(ge.current=null),c(e),At(_e,{round:a?.round,stop:N[e].key}),t&&(he.current=Date.now()+800,requestAnimationFrame(()=>{let t=E.current?.querySelector(`[data-stop="${e}"]`);t&&yt(t,`smooth`),t?.focus({preventScroll:!0})})))}function vt(e){let t=E.current,n=parseFloat(getComputedStyle(t).scrollPaddingTop)||0,r=parseFloat(getComputedStyle(e).scrollMarginTop)||0;return t.getBoundingClientRect().top+n+r-e.getBoundingClientRect().top}function yt(e,t=`instant`){let n=E.current;if(!n)return;let r=Number(e.dataset.stop),i=ge.current,a=0;i&&i.index===r&&i.paper===Wt&&(a=i.offset,ge.current=null),n.scrollTo({top:n.scrollTop-vt(e)+a,behavior:t})}function bt(e){let t=E.current?.querySelector(`[data-stop="${e}"]`);t&&N[e]&&At(_e,{round:a?.round,stop:N[e].key,offset:Math.round(vt(t)),paper:Wt})}(0,l.useEffect)(()=>{s>=0&&!ge.current&&Date.now()>=he.current&&E.current?.scrollTop&&bt(s)},[s]),(0,l.useEffect)(()=>{let e=!1,n;async function r(){let a=me.current;try{let n=D.current,r=t||n.detail?.round,s=await mt(`/state${r?`?round=${r}`:``}`);if(e||me.current!==a||D.current.busy)return;p(!0),h(``);let l=t||s.latest;if(l&&(l!==n.detail?.round||s.revision&&s.revision!==n.detail?.after)&&!D.current.composer){let[r,s]=await Promise.all([mt(`/state?round=${l}`),mt(`/rounds/${l}`)]);if(e||me.current!==a||D.current.busy)return;let u=Te(s),d=kt(_e,{}),f=d.round===l?u.findIndex(e=>e.key===d.stop):-1;(f<0||!j(u[f],r.decisions).length)&&(f=M(u,r.decisions,f)),de>=0&&u[de]&&(f=de),f<0&&(f=t&&u.length?0:-1),ge.current=!n.detail&&f>=0&&d.round===l&&u[f].key===d.stop&&d.offset?{index:f,offset:d.offset,paper:!!d.paper}:null,n.detail&&s.round!==n.detail.round&&!t&&pe(!1),i(r),o(s),c(f),y(new Set),n.detail&&_(x(`Changes are ready`))}else i(s)}catch(t){e||(p(!1),h(t.message))}finally{e||(n=setTimeout(r,document.hidden?1e4:1500))}}return r(),()=>{e=!0,clearTimeout(n)}},[e,t]),(0,l.useEffect)(()=>{a&&s>=0&&requestAnimationFrame(()=>{let e=E.current?.querySelector(`[data-stop="${s}"]`);e&&yt(e)})},[a?.round]),(0,l.useEffect)(()=>{r&&(document.title=`${x(r.title)} · LaTeX Review`)},[r?.title]),(0,l.useEffect)(()=>{n&&(document.documentElement.dataset.mode=`changes`)},[n]),(0,l.useEffect)(()=>{if(!g)return;let e=setTimeout(()=>_(``),6e3);return()=>clearTimeout(e)},[g]);function xt(t=j(N[s],P)){if(!Xe||!t.length||u||r?.closed||ft(`comment`))return;let n=`latex-review:${e}:draft:${a?.round}:${t.join(`,`)}`;ce(kt(n,``)),re({changes:t,stop:s,key:n})}function St(e=!1){T&&At(T.key,e?``:se),re(null)}async function Ot(e,t=nt(N[s]?.units??[],e),r=``,o=!1){if(t.length&&!D.current.busy&&Xe&&a&&!ft(e)){if(e===`accept`&&!o){let n=t.flatMap(e=>tt.current.get(e)??[]);if(n.length){ae({kind:e,chosen:t,body:r,items:n});return}}me.current++,d(!0),D.current.busy=!0;try{let o=await mt(`/decide`,{id:crypto.randomUUID(),action:e,round:a.round,changes:t,body:r});i(o),window.dispatchEvent(new CustomEvent(`latex-review:decided`)),e===`comment`&&St(!0);let l=j(N[s],o.decisions).length?s:M(N,o.decisions,s);l>=0&&l!==s&&_t(l),l<0&&(Qe||c(-1),_(n?e===`accept`?x(`All changes are staged.`):``:x(`All changes reviewed. Your decisions are saved.`)))}catch(e){_(e.message)}finally{me.current++,d(!1),D.current.busy=!1}}}async function Pt(){if(r?.undo&&Xe&&!D.current.busy&&!ft(`accept`)){me.current++,d(!0),D.current.busy=!0;try{let e=await mt(`/undo`,{id:r.undo.id});i(e),window.dispatchEvent(new CustomEvent(`latex-review:decided`));let t=N.findIndex(t=>t.units.some(t=>e.restored.includes(t)));pe(!1),t>=0&&_t(t),_(x(n?`Revert undone. The changes are back in your files.`:`Last decision undone. The restored changes need review again.`))}catch(e){_(e.message)}finally{me.current++,d(!1),D.current.busy=!1}}}async function Ft(){T&&se.trim()&&!u&&await Ot(`comment`,T.changes,se.trim())}function It(e){y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function Lt(e){if(!a||!r)return;let t=window.getSelection()?.toString().trim()??``,n=N[e].units.map(e=>Me.get(e)).filter(Boolean);try{await navigator.clipboard.writeText(Pe(r.title,a.round,e+1,Ne(n),t)),_(x(t?`Copied selected text with file, lines and PDF page.`:`Copied the change location.`))}catch{_(x(`Clipboard unavailable. Select the PDF text and use your browser’s Copy command.`))}}(0,l.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||e.isComposing)return;let t=e.target,r=t.matches(`input,textarea,select`)||t.isContentEditable;if(e.key===`Escape`){ie?ae(null):le?ue(!1):T&&St();return}if(T&&(e.metaKey||e.ctrlKey)&&e.key===`Enter`){e.preventDefault(),Ft();return}if(r||le||ie||window.getSelection()?.toString())return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`z`){e.preventDefault(),Pt();return}if(T)return;let i=gt(e,O);!i||n&&i===`comment`||(e.preventDefault(),i===`accept`?Ot(ot(N[s]?.units??[])[0]??`accept`):i===`reject`?Ot(`reject`):i===`comment`?xt():i===`next`?_t(lt(s,1)):i===`previous`?_t(lt(s,-1)):i===`pending`?_t(M(N,P,s)):i===`source`?It(s):i===`undo`?Pt():i===`help`&&we())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,a,s,u,T,se,le,ie,fe,O]);function Rt(){if(!E.current||T||Date.now()<he.current||window.getSelection()?.toString())return;let e=E.current.getBoundingClientRect(),t=Ae([...E.current.querySelectorAll(`[data-stop]`)].filter(e=>ct.includes(Number(e.dataset.stop))).map(e=>{let t=e.getBoundingClientRect();return{index:Number(e.dataset.stop),top:t.top,bottom:t.bottom}}),s,e.top+60,e.bottom-100);t!==s&&_t(t,!1),t>=0&&bt(t)}let zt=e=>{if(e!==s||!r)return null;let t=N[e].units,i=ot(t),a=M(N,P);return(0,w.jsx)(`div`,{className:`dock`,children:(0,w.jsxs)(`nav`,{className:`actions`,"aria-label":x(`Review the current change`),children:[ct.length>1&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`button`,{className:`nav`,"aria-label":x(`Previous change`),"aria-keyshortcuts":O.previous.join(` `),title:[x(`Previous change`),O.previous.map(I).join(` / `)].filter(Boolean).join(` · `),disabled:lt(e,-1)<0,onClick:()=>_t(lt(e,-1)),children:`‹`}),(0,w.jsxs)(`span`,{className:`position`,children:[ct.indexOf(e)+1,` / `,ct.length]})]}),i.length?(0,w.jsx)(w.Fragment,{children:i.map(e=>{let n=O[e===`unstage`?`accept`:e],r=nt(t,e).length;return(0,w.jsxs)(`button`,{className:e,"aria-keyshortcuts":n.join(` `),title:dt(e)||[$e(e),n.map(I).join(` / `)].filter(Boolean).join(` · `),"aria-describedby":dt(e)?`review-lock`:void 0,disabled:u||!Xe||!!dt(e),onClick:()=>e===`comment`?xt():void Ot(e),children:[$e(e),r>1&&e!==`comment`?` (${r})`:``]},e)})}):a>=0?(0,w.jsx)(`button`,{className:`skip`,"aria-keyshortcuts":O.pending.join(` `),onClick:()=>_t(M(N,P,s)),children:x(n?`Next unstaged`:`Next undecided`)}):(0,w.jsx)(`span`,{className:`complete`,children:n?et(De(t,P)):x(Xe?`Review complete`:`Earlier changes`)}),ct.length>1&&(0,w.jsx)(`button`,{className:`nav`,"aria-label":x(`Next change`),"aria-keyshortcuts":O.next.join(` `),title:[x(`Next change`),O.next.map(I).join(` / `)].filter(Boolean).join(` · `),disabled:lt(e,1)<0,onClick:()=>_t(lt(e,1)),children:`›`})]})})};async function Bt(e){let t=a.round,n=`${t}:${e}`;ne(e=>({...e,[n]:`loading`}));try{let{places:r}=await mt(`/rounds/${t}/effects/${encodeURIComponent(e)}`);ne(e=>({...e,[n]:r}))}catch(e){ne(t=>({...t,[n]:{error:e.message}}))}}function Vt(e,t){let{total:n,shown:r}=e.effects,i=`${a.round}:${e.id}`,o=Se[i]??(k||e.visual===`unmapped`||e.visual===`identical`),s=`effects-${a.round}-${e.id}`,c=C[i],l=[...r,...Array.isArray(c)?c:[]],u=(e,n)=>e.length>0&&(0,w.jsx)(`div`,{className:`side ${n}`,"aria-label":x(n===`before`?`Before`:`After`),children:e.map(e=>(0,w.jsx)(oe,{image:e,base:a.files,label:x(n===`before`?`Before`:`After`),clean:t},e.src))});return(0,w.jsxs)(`section`,{className:`effects`,children:[(0,w.jsx)(`p`,{className:`effects-head`,children:(0,w.jsxs)(`button`,{className:`link effects-toggle`,"aria-expanded":o,"aria-controls":s,onClick:()=>Ce(e=>({...e,[i]:!o})),children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,children:o?`▾`:`▸`}),` `,S(n,`Affects {n} place`,`Affects {n} places`)]})}),(0,w.jsx)(`div`,{id:s,hidden:!o,children:o&&(0,w.jsxs)(w.Fragment,{children:[l.map((e,t)=>(0,w.jsxs)(`div`,{className:`place`,children:[(0,w.jsxs)(`p`,{className:`place-where`,children:[x(`p. {pages}`,{pages:e.page}),e.section?` · ${e.section}`:``,e.with?` · ${x(`with {changes}`,{changes:e.with.map(e=>Ue.has(e)?x(`Change {n}`,{n:Ue.get(e)+1}):Me.get(e)?.file??e).join(`, `)})}`:``]}),u(e.before,`before`),u(e.after,`after`)]},t)),n>l.length&&(0,w.jsx)(`button`,{className:`link more-places`,disabled:c===`loading`,onClick:()=>void Bt(e.id),children:c===`loading`?x(`Loading…`):S(n-l.length,`Show {n} more`,`Show {n} more`)}),c&&typeof c==`object`&&`error`in c&&(0,w.jsx)(`p`,{className:`caption`,children:c.error})]})})]},e.id)}function Ht(e,t,i){let o=e.units.map(e=>Me.get(e)).filter(Boolean),c=a.references?.entries.filter(t=>(t.units??[t.unit]).some(t=>e.units.includes(t)))??[],d=a.references?.missing.filter(t=>t.unit&&e.units.includes(t.unit))??[],f=De(e.units,P),p=!j(N[t],P).length,m=Qe||t===de,h=fe||t===de?void 0:n?f===`rejected`?`before`:void 0:Oe(e.units,P)||(f===`commented`?`after`:void 0),g=v.has(t)||!c.length&&(e.identical||!e.before.length&&!e.after.length),y=[...new Set(e.units.map(e=>r?.comments[e]).filter(Boolean))],ee=Ne(o,x),te=c.length?x(`Bibliography`):e.reflow?x(`Reflow`):[...new Set(o.filter(e=>!(e.effects&&e.visual===`unmapped`)).map(e=>e.visual??`unmapped`))].filter(e=>e!==`text`).map(e=>x(wt[e])).join(`, `),S=(t,n)=>(0,w.jsx)(`div`,{className:`side ${n}${e.identical?` identical`:``}`,"aria-label":x(n===`before`?`Before`:`After`),children:t.map(e=>(0,w.jsx)(oe,{image:e,base:a.files,label:x(n===`before`?`Before`:`After`),clean:!!h},e.src))});return(0,w.jsxs)(`article`,{className:`change ${i?`inline`:`standalone`}${s===t?` current`:``}${p&&!m?` reviewed-change`:``}${p&&!m&&!h?` mixed-reviewed`:``}`,"data-stop":t,"data-state":f,"data-resolved":h,tabIndex:-1,onClick:()=>{t===s||T||!m&&p||_t(t,!1)},children:[p&&!m&&!h&&(0,w.jsx)(`p`,{className:`reviewed-placeholder`,children:(0,w.jsx)(`button`,{className:`link`,onClick:()=>{pe(!0),_t(t,!1)},children:x(`Reviewed changes · View in History`)})}),(0,w.jsxs)(`header`,{className:`change-head`,children:[(0,w.jsx)(`span`,{className:`change-number`,"data-change":t+1,children:x(`Change {n}`,{n:t+1})}),(0,w.jsx)(`span`,{className:`change-where`,title:ee,"data-location":Ne(o),children:ee}),zt(t),te&&(0,w.jsx)(`span`,{className:`change-kind`,children:te}),f!==`pending`&&(0,w.jsx)(`span`,{className:`badge`,children:et(f)}),(0,w.jsx)(`button`,{className:`link copy-reference`,title:x(`Copy selected text with this change’s file, line numbers and PDF page`),onPointerDown:e=>e.preventDefault(),onClick:()=>void Lt(t),children:x(`Copy reference`)}),(0,w.jsx)(`button`,{className:`link ${g?`active`:``}`,title:[x(`Show LaTeX source`),O.source.map(I).join(` / `)].filter(Boolean).join(` · `),"aria-keyshortcuts":O.source.join(` `),onClick:()=>It(t),children:e.units.length>1?x(`{n} edits · LaTeX`,{n:e.units.length}):`LaTeX`})]}),o.some(e=>e.history?.length)&&(0,w.jsx)(`div`,{className:`histories`,children:o.flatMap(e=>e.history??[]).map((e,t)=>(0,w.jsxs)(`p`,{children:[(0,w.jsx)(`strong`,{children:x(`Revised after your comment: `)}),`“`,e.comment,`”`]},t))}),!e.identical&&!e.reflow&&e.before.length>0&&S(e.before,`before`),e.after.length>0&&S(e.after,`after`),e.identical&&!c.length&&(0,w.jsx)(`p`,{className:`caption`,children:x(`No visible change in the PDF; see the LaTeX source.`)}),e.reflow&&(0,w.jsx)(`p`,{className:`caption`,children:x(`Continued: only line breaks moved here.`)}),y.length>0&&(0,w.jsx)(`div`,{className:`remark`,children:y.map((e,t)=>(0,w.jsxs)(`p`,{children:[(0,w.jsx)(`strong`,{children:x(`Your comment: `)}),e]},t))}),d.length>0&&(0,w.jsx)(`p`,{className:`reference-problem reference-uncited`,children:d.map(e=>x(`Cites {key}, which no bibliography entry defines.`,{key:e.key})).join(b().startsWith(`zh`)?``:` `)}),c.length>0&&(0,w.jsx)(rt,{entries:c,checks:Ke.checks,pending:Ke.pending>0,onRetry:Ke.retry,confirmed:Ke.confirmed,onConfirm:(e,t)=>void Ke.confirm(e,t).catch(e=>_(e.message))}),g&&(0,w.jsx)(`div`,{className:`source`,children:o.map(e=>(0,w.jsxs)(`div`,{className:`source-unit`,"data-state":P[e.id],children:[(0,w.jsxs)(`div`,{className:`source-title`,children:[(0,w.jsxs)(`span`,{children:[e.file,` ·`,` `,x(`lines {start}–{end}`,{start:e.new_start,end:e.new_end})]}),o.length>1&&(0,w.jsxs)(`span`,{className:`unit-actions`,children:[(0,w.jsx)(`span`,{className:`unit-state`,children:P[e.id]===`pending`?``:et(P[e.id]).toLowerCase()}),(n||P[e.id]===`pending`)&&ot([e.id]).map(t=>(0,w.jsx)(`button`,{className:t,title:dt(t)||void 0,"aria-describedby":dt(t)?`review-lock`:void 0,disabled:u||!Xe||!!dt(t),onClick:()=>t===`comment`?xt([e.id]):void Ot(t,[e.id]),children:$e(t)},t))]})]}),e.kind===`binary`?(0,w.jsx)(`p`,{children:x(`Binary file changed.`)}):(0,w.jsx)(`pre`,{className:`source-code`,children:je(e.old_text,e.new_text).map((e,t)=>e.type===`del`?(0,w.jsx)(`del`,{children:e.text},t):e.type===`ins`?(0,w.jsx)(`ins`,{children:e.text},t):(0,w.jsx)(l.Fragment,{children:e.text},t))}),e.truncated&&(0,w.jsx)(`p`,{className:`muted`,children:x(`Long change: the source is shortened.`)})]},e.id))}),o.filter(e=>e.effects&&Ue.get(e.id)===t).map(e=>Vt(e,!!h))]},t)}let Ut=!ye&&!!a?.pdf&&Ie(He),Wt=Ut&&be===`paper`;(0,l.useEffect)(()=>{let e=document.documentElement;Ut?e.dataset.fullPaper=`available`:delete e.dataset.fullPaper},[Ut]);let Gt=(0,l.useRef)(Wt);(0,l.useEffect)(()=>{Gt.current!==Wt&&(Gt.current=Wt,requestAnimationFrame(()=>{let e=E.current?.querySelector(`[data-stop="${D.current.current}"]`);e&&yt(e)}))},[Wt]);function Kt(e){xe(e)}let qt=0;return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`header`,{className:`bar`,children:[(0,w.jsxs)(`a`,{className:`ghost overview-link`,href:te(`/`),children:[`← `,x(`All reviews`)]}),(0,w.jsxs)(`div`,{className:`identity`,children:[(0,w.jsx)(`h1`,{children:r?.title??`LaTeX Review`}),(0,w.jsx)(`span`,{className:`muted`,children:n?x(`Since the last commit`):a?a.round===r?.latest?x(`Current changes`):x(`Earlier changes`):``})]}),(0,w.jsx)(Nt,{value:n?F.accepted:F.decided,total:n?F.accepted+F.pending:F.total,label:n?x(`{staged} of {total} staged`,{staged:F.accepted,total:F.accepted+F.pending}):x(`{decided} of {total} decided`,{decided:F.decided,total:F.total})}),(0,w.jsxs)(`div`,{className:`bar-end`,children:[F.pending>1&&Ye.length>0&&(0,w.jsxs)(`button`,{className:`ghost accept accept-all`,disabled:u||!Xe||!!T||!!r?.decisionLock,title:r?.decisionLock||[n?S(Ye.length,`Stage the {n} unstaged change.`,`Stage the {n} unstaged changes.`):S(Ye.length,`Accept {n} undecided change`,`Accept {n} undecided changes`),Ge.length>Ye.length?S(Ge.length-Ye.length,`Leaves {n} change with bibliography entries to check.`,`Leaves {n} changes with bibliography entries to check.`):``].filter(Boolean).join(` `),"aria-label":x(n?`Stage all ({n})`:`Accept all ({n})`,{n:Ye.length}),"aria-describedby":r?.decisionLock?`review-lock`:void 0,onClick:()=>void Ot(`accept`,Ye),children:[(0,w.jsx)(`span`,{className:`batch-label`,children:x(n?`Stage all`:`Accept all`)}),(0,w.jsx)(`span`,{className:`batch-count`,children:Ye.length})]}),F.pending>1&&!n&&(0,w.jsxs)(`button`,{className:`ghost reject reject-all`,disabled:u||!Xe||!!T||!!r?.decisionLock,title:r?.decisionLock||S(F.pending,`Reject {n} undecided change`,`Reject {n} undecided changes`),"aria-label":x(`Reject all ({n})`,{n:F.pending}),"aria-describedby":r?.decisionLock?`review-lock`:void 0,onClick:()=>void Ot(`reject`,Ge),children:[(0,w.jsx)(`span`,{className:`batch-label`,children:x(`Reject all`)}),(0,w.jsx)(`span`,{className:`batch-count`,children:F.pending})]}),(!f||r?.closed||![`reviewing`,`done`].includes(r?.state??``))&&(0,w.jsx)(`span`,{className:`status`,role:`status`,"data-state":f?r?.state:`offline`,children:f?r?.closed?x(`Finished`):r?.state===`building`?Mt(r.job):n&&r?.state===`build_failed`?x(`Comparison failed`):x(Ve[r?.state??``]??``):x(`Reconnecting…`)}),n&&r?.undo&&(0,w.jsx)(`button`,{className:`ghost undo`,disabled:!Xe||u||!!r.decisionLock,title:r.decisionLock||[x(`Undo revert`),O.undo.map(I).join(` / `)].filter(Boolean).join(` · `),"aria-keyshortcuts":O.undo.join(` `),onClick:()=>void Pt(),children:x(`Undo revert`)}),Ut&&(0,w.jsxs)(`div`,{className:`view-switch`,role:`group`,"aria-label":x(`Review view`),children:[(0,w.jsx)(`button`,{className:`ghost${be===`paper`?` active`:``}`,"aria-pressed":be===`paper`,onClick:()=>Kt(`paper`),children:`PDF`}),(0,w.jsx)(`button`,{className:`ghost${be===`changes`?` active`:``}`,"aria-pressed":be===`changes`,onClick:()=>Kt(`changes`),children:x(`Changes`)})]}),a&&!fe&&!n&&(0,w.jsx)(`button`,{className:`ghost history`,title:x(`Review history`),onClick:()=>{pe(!0),s<0&&N.length&&c(0)},children:x(`History`)}),(0,w.jsx)(`button`,{className:`ghost round`,"aria-label":x(`Keyboard shortcuts`),onClick:we,children:`?`})]})]}),a&&fe&&(0,w.jsxs)(`nav`,{className:`review-mode`,"aria-label":x(`Review view`),children:[(0,w.jsxs)(`label`,{children:[x(`History`),` `,(0,w.jsx)(`select`,{"aria-label":x(`Review history`),value:a.round,onChange:t=>{location.href=te(`?task=${encodeURIComponent(e)}&round=${t.target.value}&history=1`)},children:Array.from({length:r?.latest||a.round},(e,t)=>t+1).reverse().map(e=>(0,w.jsx)(`option`,{value:e,children:e===r?.latest?x(`Current changes`):(()=>{let t=r?.history?.find(t=>t.number===e)?.created;return t?new Intl.DateTimeFormat(ee(),{dateStyle:`medium`,timeStyle:`medium`}).format(new Date(t*1e3)):x(`Earlier changes`)})()},e))})]}),r?.undo&&(0,w.jsx)(`button`,{className:`ghost undo`,disabled:!Xe||u||!!r.decisionLock,title:r.decisionLock||x(`Undo {action} · {changes}`,{action:x(Tt[r.undo.kind]??r.undo.kind).toLowerCase(),changes:S(ut.length,`Change {list}`,`Changes {list}`,{list:ut.join(`, `)})}),onClick:()=>void Pt(),children:x(`Undo last decision`)}),(0,w.jsx)(`button`,{className:`ghost`,onClick:()=>{t?location.href=te(`?task=${encodeURIComponent(e)}`):(pe(!1),c(M(N,P)))},children:x(`Back to review`)})]}),(0,w.jsxs)(`div`,{className:`review-body`,children:[(0,w.jsxs)(`main`,{id:`paper`,ref:E,tabIndex:-1,onScroll:Rt,children:[n&&a&&!F.pending&&(F.accepted>0||!N.length)&&(0,w.jsxs)(`div`,{className:`review-complete`,role:`status`,tabIndex:-1,children:[(0,w.jsx)(`strong`,{children:F.accepted?x(`All changes are staged`):x(`No uncommitted changes`)}),(0,w.jsx)(`span`,{children:F.accepted?x(`Commit them when you are ready.`):x(`The PDF matches the last commit.`)}),(0,w.jsx)(`div`,{className:`review-complete-actions`})]}),!n&&a&&!fe&&!F.pending&&(0,w.jsxs)(`div`,{className:`review-complete`,role:`status`,tabIndex:-1,children:[(0,w.jsx)(`strong`,{children:x(r?.workspace?.status===`waiting_input`?`Agent needs your input`:r?.workspace?.status===`queued`?`Feedback queued`:r?.workspace?.status===`running`?`Feedback sent · Agent is working`:r?.workspace?.status===`building`||r?.state===`building`?`Preparing the next review…`:r?.workspace?.merging?`Merge review`:`All changes reviewed`)}),(0,w.jsx)(`span`,{children:x(r?.workspace?.status===`waiting_input`?`Open Chat to answer the agent's question.`:[`running`,`queued`,`building`].includes(r?.workspace?.status||``)||r?.state===`building`?`New changes will appear here when ready.`:r?.workspace?.merging?`Your manuscript is unchanged until you save the merged result.`:r?.workspace?.comments?`Your comments are saved. Send feedback so the agent can revise.`:r?.workspace?.deferred?r.workspace.accepted||r.workspace.destination===`branch`?`Choose how to save the accepted changes to your manuscript.`:r.workspace.destination===`workspace`||r.workspace.destination===`commit`?`Accepted changes are in your manuscript.`:`There are no accepted changes to save.`:r?.workspace?.accepted?`Accepted changes are in your manuscript.`:r?.workspace?.unsent&&!F.accepted?`Your decisions are saved. Send them to the agent to continue.`:F.commented&&!r?.workspace?`Your comments are saved for the agent.`:`There are no new changes to review. Previous decisions are available in History.`)}),(0,w.jsx)(`div`,{className:`review-complete-actions`})]}),(r?.commentLock||r?.decisionLock)&&(0,w.jsx)(`div`,{className:`banner`,id:`review-lock`,role:`status`,children:x(r.commentLock||r.decisionLock)}),r?.closed&&!r.commentLock&&(0,w.jsx)(`div`,{className:`banner`,children:x(`This review is finished. Accepted changes are in your manuscript.`)}),r?.state===`build_failed`&&(0,w.jsxs)(`div`,{className:`banner`,children:[(0,w.jsx)(`strong`,{children:x(n?`The comparison could not be built: `:`The latest publish failed: `)}),r.job?.error,r.job?.details&&(0,w.jsx)(`pre`,{className:`details`,children:r.job.details.join(`
18
18
  `)})]}),r?.state===`building`&&a&&!r.decisionLock&&(0,w.jsx)(`div`,{className:`banner`,children:x(n?`Updating the comparison with your latest edits. You can keep staging and reverting meanwhile.`:`Updating changes…`)}),!n&&a&&r?.latest&&a.round!==r.latest&&(0,w.jsxs)(`div`,{className:`banner`,children:[x(`Viewing earlier changes.`),` `,(0,w.jsx)(`a`,{href:te(`?task=${encodeURIComponent(e)}`),children:x(`Back to current changes →`)})]}),a?.warnings.length?(0,w.jsx)(`div`,{className:`banner`,children:(0,w.jsxs)(`details`,{children:[(0,w.jsx)(`summary`,{children:S(a.warnings.length,`{n} new LaTeX warning`,`{n} new LaTeX warnings`)}),(0,w.jsx)(`pre`,{className:`details`,children:a.warnings.join(`
19
19
  `)})]})}):null,a?.references&&(a.references.entries.length>0||a.references.missing.length>0)&&(0,w.jsx)(it,{references:a.references,checks:Ke.checks,pending:Ke.pending,confirmed:Ke.confirmed,changeOf:e=>e?Ue.get(e)??-1:-1,onSelect:e=>_t(e),onRetry:Ke.retry}),(0,w.jsx)(`div`,{className:`document`,children:a&&Wt?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(l.Suspense,{fallback:(0,w.jsx)(`div`,{className:`paper-status`,role:`status`,children:(0,w.jsx)(`div`,{className:`pulse`})}),children:(0,w.jsx)(Ct,{url:a.pdf,passes:a.passes,changes:He,render:(e,t)=>Ht(e,t,!0),scrollRoot:E,onReady:()=>{let e=E.current?.querySelector(`[data-stop="${D.current.current}"]`);e&&yt(e)},onUnavailable:()=>Kt(`changes`)})}),!N.length&&!n&&(0,w.jsx)(`p`,{className:`empty`,children:x(`No changes to review.`)})]}):a?(0,w.jsxs)(w.Fragment,{children:[a.sections.map(e=>(0,w.jsxs)(`section`,{className:`part`,children:[(0,w.jsxs)(`h2`,{className:`part-title`,children:[(0,w.jsx)(`span`,{className:`number`,children:e.number}),e.title]}),(0,w.jsx)(`div`,{className:`sheet`,children:e.blocks.map((e,t)=>e.kind===`context`?(0,w.jsx)(`div`,{className:`context`,children:(0,w.jsx)(oe,{image:e.image,base:a.files,label:x(`Unchanged text`)})},`context-${t}`):e.kind===`gap`?(0,w.jsx)(`div`,{className:`fold`,title:x(`Unchanged text is folded`),children:`⋯`},`gap-${t}`):Ht(e,qt++,!0))})]},e.node)),a.loose.length>0&&(0,w.jsxs)(`section`,{className:`part`,children:[a.sections.length>0&&(0,w.jsx)(`h2`,{className:`part-title`,children:x(`Other changes`)}),a.loose.map(e=>Ht(e,qt++,!1))]}),!N.length&&!n&&(0,w.jsx)(`p`,{className:`empty`,children:x(`No changes to review.`)})]}):m?(0,w.jsx)(`p`,{className:`empty`,role:`alert`,children:m}):(0,w.jsxs)(`div`,{className:`waiting`,children:[(0,w.jsx)(`div`,{className:`pulse`}),(0,w.jsx)(`p`,{children:r?.state===`building`?Mt(r.job):x(n?`Comparing with the last commit…`:`Waiting for the agent to publish its changes.`)}),(0,w.jsx)(`p`,{className:`muted`,children:x(`This page updates by itself.`)})]})})]}),(0,w.jsx)(Fe,{scrollRoot:E,stops:N,showReviewed:Qe,locations:We,decisions:P,current:s,disabled:!!T,onSelect:_t})]}),T&&(0,w.jsxs)(`form`,{className:`composer`,onSubmit:e=>{e.preventDefault(),Ft()},children:[(0,w.jsxs)(`div`,{className:`composer-head`,children:[(0,w.jsx)(`label`,{htmlFor:`composer-text`,children:x(`Comment on change {n}`,{n:T.stop+1})}),(0,w.jsx)(`button`,{type:`button`,className:`composer-close`,"aria-label":x(`Cancel`),title:x(`Cancel`),onClick:()=>St(),children:(0,w.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,w.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),(0,w.jsx)(`textarea`,{id:`composer-text`,ref:jt,autoFocus:!0,rows:3,maxLength:2e4,value:se,onChange:e=>{ce(e.target.value),At(T.key,e.target.value),jt(e.target)},placeholder:x(`What should the agent change here?`)}),(0,w.jsxs)(`div`,{className:`composer-row`,children:[(0,w.jsx)(`span`,{className:`muted`,children:x(`⌘↵ send · Esc cancel`)}),(0,w.jsx)(`button`,{type:`submit`,className:`composer-send`,"aria-label":x(`Send`),title:r?.commentLock?x(r.commentLock):x(`Send`),"aria-describedby":r?.commentLock?`review-lock`:void 0,disabled:u||!se.trim()||!!r?.commentLock,children:(0,w.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,w.jsx)(`path`,{d:`M12 19V5m-7 7 7-7 7 7`})})})]})]}),g&&(0,w.jsx)(`div`,{className:`toast`,role:`alert`,children:g}),ie&&(0,w.jsx)(at,{items:ie.items,staging:n,onCancel:()=>ae(null),onConfirm:()=>{let e=ie;ae(null),Ot(e.kind,e.chosen,e.body,!0)}}),le&&(0,w.jsx)(`div`,{className:`help-backdrop`,onClick:()=>ue(!1),children:(0,w.jsxs)(`dialog`,{open:!0,"aria-labelledby":`help-title`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(`h2`,{id:`help-title`,children:x(`Keyboard shortcuts`)}),(0,w.jsx)(`dl`,{children:(n?[[O.accept.map(I).join(` / `),`Stage or unstage`],[O.reject.map(I).join(` / `),`Revert`],[O.next.map(I).join(` / `),`Next change`],[O.previous.map(I).join(` / `),`Previous change`],[O.pending.map(I).join(` / `),`Next unstaged`],[O.source.map(I).join(` / `),`Show LaTeX source`],[[`⌘Z / Ctrl+Z`,...O.undo.map(I)].join(` / `),`Undo revert`],[`⌘C / Ctrl+C`,`Copy selected PDF text`]]:[[O.accept.map(I).join(` / `),`Accept`],[O.reject.map(I).join(` / `),`Reject`],[O.comment.map(I).join(` / `),`Comment`],[O.next.map(I).join(` / `),`Next change`],[O.previous.map(I).join(` / `),`Previous change`],[O.pending.map(I).join(` / `),`Next undecided`],[O.source.map(I).join(` / `),`Show LaTeX source`],[[`⌘Z / Ctrl+Z`,...O.undo.map(I)].join(` / `),`Undo`],[`⌘C / Ctrl+C`,`Copy selected PDF text`]]).map(([e,t])=>(0,w.jsxs)(l.Fragment,{children:[(0,w.jsx)(`dt`,{children:(0,w.jsx)(`kbd`,{children:x(e)})}),(0,w.jsx)(`dd`,{children:x(t)})]},t))}),(0,w.jsx)(`p`,{className:`muted`,children:x(`Select text directly in the PDF preview. Copy reference includes the selection and its file, line numbers and page. Review shortcuts pause while text is selected.`)}),(0,w.jsx)(`button`,{onClick:()=>ue(!1),children:x(`Close`)})]})})]})}var Ft=new URLSearchParams(location.search),It=Ft.get(`task`),Lt=Number(Ft.get(`round`))||null;(0,u.createRoot)(document.getElementById(`root`)).render(Ft.has(`changes`)?(0,w.jsx)(Pt,{task:`changes`,pinned:null,changes:!0}):It?(0,w.jsx)(Pt,{task:It,pinned:Lt}):(0,w.jsx)(He,{}));export{x as n,i as r,ne as t};
@@ -9,7 +9,7 @@
9
9
  rel="icon"
10
10
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='%232b6e5c'/%3E%3Cpath d='M4 8.5l2.5 2.5L12 5' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"
11
11
  />
12
- <script type="module" crossorigin src="/assets/index-T8GmpI7k.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-e1oe-qOQ.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/assets/index-CkL-mf_b.css">
14
14
  </head>
15
15
  <body>
@@ -14,12 +14,21 @@ import worker from "pdfjs-dist/build/pdf.worker.min.mjs?url";
14
14
  import type { ChangeBlock, Strip } from "../types.ts";
15
15
  import { t } from "./i18n.ts";
16
16
  import type { PlacedChange } from "./paper.ts";
17
+ import { cMapData } from "./pdf-cmaps.ts";
17
18
 
18
19
  // Built assets share one folder, and a host such as Papilot serves the viewer
19
- // under its own prefix: find the worker next to this chunk, not at /assets.
20
- pdfjs.GlobalWorkerOptions.workerSrc = import.meta.env.DEV
21
- ? worker
22
- : new URL(worker.split("/").pop()!, import.meta.url).href;
20
+ // under its own prefix: find the worker and CMaps next to this chunk, not at /assets.
21
+ const besideChunk = (url: string) =>
22
+ import.meta.env.DEV ? url : new URL(url.split("/").pop()!, import.meta.url).href;
23
+ pdfjs.GlobalWorkerOptions.workerSrc = besideChunk(worker);
24
+ const CMapData = cMapData(
25
+ import.meta.glob<string>("../../node_modules/pdfjs-dist/cmaps/*.bcmap", {
26
+ eager: true,
27
+ import: "default",
28
+ query: "?url&no-inline",
29
+ }),
30
+ besideChunk,
31
+ );
23
32
 
24
33
  // The whole paper with its changes in place: the new PDF's pages, opened up
25
34
  // where a change's new lines are, and that change shown there as in the
@@ -134,7 +143,7 @@ export function FullPaper({
134
143
  setStarted(Date.now());
135
144
  announced.current = false;
136
145
  const open = async (source: string, partial: boolean) => {
137
- const task = pdfjs.getDocument({ url: source, enableXfa: false });
146
+ const task = pdfjs.getDocument({ url: source, enableXfa: false, BinaryDataFactory: CMapData });
138
147
  tasks.push(task);
139
148
  const pdf = await task.promise,
140
149
  first = (await pdf.getPage(1)).getViewport({ scale: 1 }),