discourse_math_bundle 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/lib/discourse_math_bundle/version.rb +7 -0
  3. data/lib/discourse_math_bundle.rb +55 -0
  4. data/vendor/assets/katex/contrib/copy-tex.min.js +1 -0
  5. data/vendor/assets/katex/contrib/mhchem.min.js +1 -0
  6. data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
  7. data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  8. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  9. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  10. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  11. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  12. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  13. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  14. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  15. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  16. data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff +0 -0
  17. data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  18. data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  19. data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  20. data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff +0 -0
  21. data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  22. data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff +0 -0
  23. data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  24. data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  25. data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  26. data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff +0 -0
  27. data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  28. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  29. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  30. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  31. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  32. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  33. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  34. data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff +0 -0
  35. data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  36. data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
  37. data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  38. data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
  39. data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  40. data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
  41. data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  42. data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
  43. data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  44. data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  45. data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  46. data/vendor/assets/katex/katex.min.css +1 -0
  47. data/vendor/assets/katex/katex.min.js +1 -0
  48. data/vendor/assets/mathjax/a11y/assistive-mml.js +1 -0
  49. data/vendor/assets/mathjax/a11y/complexity.js +1 -0
  50. data/vendor/assets/mathjax/a11y/explorer.js +1 -0
  51. data/vendor/assets/mathjax/a11y/semantic-enrich.js +1 -0
  52. data/vendor/assets/mathjax/a11y/speech.js +1 -0
  53. data/vendor/assets/mathjax/a11y/sre.js +1 -0
  54. data/vendor/assets/mathjax/adaptors/jsdom.js +1 -0
  55. data/vendor/assets/mathjax/adaptors/linkedom.js +1 -0
  56. data/vendor/assets/mathjax/adaptors/liteDOM.js +1 -0
  57. data/vendor/assets/mathjax/core.js +1 -0
  58. data/vendor/assets/mathjax/input/asciimath.js +1 -0
  59. data/vendor/assets/mathjax/input/mml/entities.js +1 -0
  60. data/vendor/assets/mathjax/input/mml/extensions/mml3.js +1 -0
  61. data/vendor/assets/mathjax/input/mml/extensions/mml3.sef.json +1 -0
  62. data/vendor/assets/mathjax/input/mml.js +1 -0
  63. data/vendor/assets/mathjax/input/tex/extensions/action.js +1 -0
  64. data/vendor/assets/mathjax/input/tex/extensions/ams.js +1 -0
  65. data/vendor/assets/mathjax/input/tex/extensions/amscd.js +1 -0
  66. data/vendor/assets/mathjax/input/tex/extensions/autoload.js +1 -0
  67. data/vendor/assets/mathjax/input/tex/extensions/bbm.js +1 -0
  68. data/vendor/assets/mathjax/input/tex/extensions/bboldx.js +1 -0
  69. data/vendor/assets/mathjax/input/tex/extensions/bbox.js +1 -0
  70. data/vendor/assets/mathjax/input/tex/extensions/begingroup.js +1 -0
  71. data/vendor/assets/mathjax/input/tex/extensions/boldsymbol.js +1 -0
  72. data/vendor/assets/mathjax/input/tex/extensions/braket.js +1 -0
  73. data/vendor/assets/mathjax/input/tex/extensions/bussproofs.js +1 -0
  74. data/vendor/assets/mathjax/input/tex/extensions/cancel.js +1 -0
  75. data/vendor/assets/mathjax/input/tex/extensions/cases.js +1 -0
  76. data/vendor/assets/mathjax/input/tex/extensions/centernot.js +1 -0
  77. data/vendor/assets/mathjax/input/tex/extensions/color.js +1 -0
  78. data/vendor/assets/mathjax/input/tex/extensions/colortbl.js +1 -0
  79. data/vendor/assets/mathjax/input/tex/extensions/colorv2.js +1 -0
  80. data/vendor/assets/mathjax/input/tex/extensions/configmacros.js +1 -0
  81. data/vendor/assets/mathjax/input/tex/extensions/dsfont.js +1 -0
  82. data/vendor/assets/mathjax/input/tex/extensions/empheq.js +1 -0
  83. data/vendor/assets/mathjax/input/tex/extensions/enclose.js +1 -0
  84. data/vendor/assets/mathjax/input/tex/extensions/extpfeil.js +1 -0
  85. data/vendor/assets/mathjax/input/tex/extensions/gensymb.js +1 -0
  86. data/vendor/assets/mathjax/input/tex/extensions/html.js +1 -0
  87. data/vendor/assets/mathjax/input/tex/extensions/mathtools.js +1 -0
  88. data/vendor/assets/mathjax/input/tex/extensions/mhchem.js +34 -0
  89. data/vendor/assets/mathjax/input/tex/extensions/newcommand.js +1 -0
  90. data/vendor/assets/mathjax/input/tex/extensions/noerrors.js +1 -0
  91. data/vendor/assets/mathjax/input/tex/extensions/noundefined.js +1 -0
  92. data/vendor/assets/mathjax/input/tex/extensions/physics.js +1 -0
  93. data/vendor/assets/mathjax/input/tex/extensions/require.js +1 -0
  94. data/vendor/assets/mathjax/input/tex/extensions/setoptions.js +1 -0
  95. data/vendor/assets/mathjax/input/tex/extensions/tagformat.js +1 -0
  96. data/vendor/assets/mathjax/input/tex/extensions/texhtml.js +1 -0
  97. data/vendor/assets/mathjax/input/tex/extensions/textcomp.js +1 -0
  98. data/vendor/assets/mathjax/input/tex/extensions/textmacros.js +1 -0
  99. data/vendor/assets/mathjax/input/tex/extensions/unicode.js +1 -0
  100. data/vendor/assets/mathjax/input/tex/extensions/units.js +1 -0
  101. data/vendor/assets/mathjax/input/tex/extensions/upgreek.js +1 -0
  102. data/vendor/assets/mathjax/input/tex/extensions/verb.js +1 -0
  103. data/vendor/assets/mathjax/input/tex-base.js +1 -0
  104. data/vendor/assets/mathjax/input/tex.js +1 -0
  105. data/vendor/assets/mathjax/loader.js +1 -0
  106. data/vendor/assets/mathjax/mml-chtml-nofont.js +1 -0
  107. data/vendor/assets/mathjax/mml-chtml.js +1 -0
  108. data/vendor/assets/mathjax/mml-svg-nofont.js +1 -0
  109. data/vendor/assets/mathjax/mml-svg.js +1 -0
  110. data/vendor/assets/mathjax/output/chtml.js +1 -0
  111. data/vendor/assets/mathjax/output/svg.js +1 -0
  112. data/vendor/assets/mathjax/sre/mathmaps/af.json +146 -0
  113. data/vendor/assets/mathjax/sre/mathmaps/base.json +137 -0
  114. data/vendor/assets/mathjax/sre/mathmaps/ca.json +140 -0
  115. data/vendor/assets/mathjax/sre/mathmaps/da.json +140 -0
  116. data/vendor/assets/mathjax/sre/mathmaps/de.json +146 -0
  117. data/vendor/assets/mathjax/sre/mathmaps/en.json +158 -0
  118. data/vendor/assets/mathjax/sre/mathmaps/es.json +140 -0
  119. data/vendor/assets/mathjax/sre/mathmaps/euro.json +32 -0
  120. data/vendor/assets/mathjax/sre/mathmaps/fr.json +146 -0
  121. data/vendor/assets/mathjax/sre/mathmaps/hi.json +146 -0
  122. data/vendor/assets/mathjax/sre/mathmaps/it.json +146 -0
  123. data/vendor/assets/mathjax/sre/mathmaps/ko.json +146 -0
  124. data/vendor/assets/mathjax/sre/mathmaps/nb.json +146 -0
  125. data/vendor/assets/mathjax/sre/mathmaps/nemeth.json +125 -0
  126. data/vendor/assets/mathjax/sre/mathmaps/nn.json +146 -0
  127. data/vendor/assets/mathjax/sre/mathmaps/sv.json +146 -0
  128. data/vendor/assets/mathjax/sre/require.d.mts +1 -0
  129. data/vendor/assets/mathjax/sre/require.mjs +2 -0
  130. data/vendor/assets/mathjax/sre/speech-worker.js +1 -0
  131. data/vendor/assets/mathjax/startup.js +1 -0
  132. data/vendor/assets/mathjax/tex-chtml-nofont.js +1 -0
  133. data/vendor/assets/mathjax/tex-chtml.js +1 -0
  134. data/vendor/assets/mathjax/tex-mml-chtml-nofont.js +1 -0
  135. data/vendor/assets/mathjax/tex-mml-chtml.js +1 -0
  136. data/vendor/assets/mathjax/tex-mml-svg-nofont.js +1 -0
  137. data/vendor/assets/mathjax/tex-mml-svg.js +1 -0
  138. data/vendor/assets/mathjax/tex-svg-nofont.js +1 -0
  139. data/vendor/assets/mathjax/tex-svg.js +1 -0
  140. data/vendor/assets/mathjax/ui/lazy.js +1 -0
  141. data/vendor/assets/mathjax/ui/menu.js +1 -0
  142. data/vendor/assets/mathjax/ui/safe.js +1 -0
  143. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ab.woff2 +0 -0
  144. data/vendor/assets/mathjax/woff-v2/mjx-ncm-abi.woff2 +0 -0
  145. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ai.woff2 +0 -0
  146. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ar.woff2 +0 -0
  147. data/vendor/assets/mathjax/woff-v2/mjx-ncm-arl.woff2 +0 -0
  148. data/vendor/assets/mathjax/woff-v2/mjx-ncm-b-a.woff2 +0 -0
  149. data/vendor/assets/mathjax/woff-v2/mjx-ncm-b.woff2 +0 -0
  150. data/vendor/assets/mathjax/woff-v2/mjx-ncm-bi.woff2 +0 -0
  151. data/vendor/assets/mathjax/woff-v2/mjx-ncm-br.woff2 +0 -0
  152. data/vendor/assets/mathjax/woff-v2/mjx-ncm-brd.woff2 +0 -0
  153. data/vendor/assets/mathjax/woff-v2/mjx-ncm-brk.woff2 +0 -0
  154. data/vendor/assets/mathjax/woff-v2/mjx-ncm-c.woff2 +0 -0
  155. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cb.woff2 +0 -0
  156. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ch.woff2 +0 -0
  157. data/vendor/assets/mathjax/woff-v2/mjx-ncm-chb.woff2 +0 -0
  158. data/vendor/assets/mathjax/woff-v2/mjx-ncm-chbi.woff2 +0 -0
  159. data/vendor/assets/mathjax/woff-v2/mjx-ncm-chi.woff2 +0 -0
  160. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cy.woff2 +0 -0
  161. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyb.woff2 +0 -0
  162. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cybi.woff2 +0 -0
  163. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyi.woff2 +0 -0
  164. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyss.woff2 +0 -0
  165. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssb.woff2 +0 -0
  166. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssbi.woff2 +0 -0
  167. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssi.woff2 +0 -0
  168. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ds.woff2 +0 -0
  169. data/vendor/assets/mathjax/woff-v2/mjx-ncm-dv.woff2 +0 -0
  170. data/vendor/assets/mathjax/woff-v2/mjx-ncm-em.woff2 +0 -0
  171. data/vendor/assets/mathjax/woff-v2/mjx-ncm-f.woff2 +0 -0
  172. data/vendor/assets/mathjax/woff-v2/mjx-ncm-fb.woff2 +0 -0
  173. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gk.woff2 +0 -0
  174. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkb.woff2 +0 -0
  175. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkbi.woff2 +0 -0
  176. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gki.woff2 +0 -0
  177. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkss.woff2 +0 -0
  178. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssb.woff2 +0 -0
  179. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssbi.woff2 +0 -0
  180. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssi.woff2 +0 -0
  181. data/vendor/assets/mathjax/woff-v2/mjx-ncm-he.woff2 +0 -0
  182. data/vendor/assets/mathjax/woff-v2/mjx-ncm-heb.woff2 +0 -0
  183. data/vendor/assets/mathjax/woff-v2/mjx-ncm-hebi.woff2 +0 -0
  184. data/vendor/assets/mathjax/woff-v2/mjx-ncm-hei.woff2 +0 -0
  185. data/vendor/assets/mathjax/woff-v2/mjx-ncm-i.woff2 +0 -0
  186. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lb.woff2 +0 -0
  187. data/vendor/assets/mathjax/woff-v2/mjx-ncm-li.woff2 +0 -0
  188. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lib.woff2 +0 -0
  189. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lo.woff2 +0 -0
  190. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lr.woff2 +0 -0
  191. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lt.woff2 +0 -0
  192. data/vendor/assets/mathjax/woff-v2/mjx-ncm-m.woff2 +0 -0
  193. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mar.woff2 +0 -0
  194. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mi.woff2 +0 -0
  195. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ml.woff2 +0 -0
  196. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mm.woff2 +0 -0
  197. data/vendor/assets/mathjax/woff-v2/mjx-ncm-msh.woff2 +0 -0
  198. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mx.woff2 +0 -0
  199. data/vendor/assets/mathjax/woff-v2/mjx-ncm-n.woff2 +0 -0
  200. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ob.woff2 +0 -0
  201. data/vendor/assets/mathjax/woff-v2/mjx-ncm-os.woff2 +0 -0
  202. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ph.woff2 +0 -0
  203. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phb.woff2 +0 -0
  204. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phbi.woff2 +0 -0
  205. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phi.woff2 +0 -0
  206. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phss.woff2 +0 -0
  207. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssb.woff2 +0 -0
  208. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssbi.woff2 +0 -0
  209. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssi.woff2 +0 -0
  210. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pu.woff2 +0 -0
  211. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pub.woff2 +0 -0
  212. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pubi.woff2 +0 -0
  213. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pui.woff2 +0 -0
  214. data/vendor/assets/mathjax/woff-v2/mjx-ncm-rb.woff2 +0 -0
  215. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s.woff2 +0 -0
  216. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s3.woff2 +0 -0
  217. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s4.woff2 +0 -0
  218. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s5.woff2 +0 -0
  219. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s6.woff2 +0 -0
  220. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s7.woff2 +0 -0
  221. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sb.woff2 +0 -0
  222. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sh.woff2 +0 -0
  223. data/vendor/assets/mathjax/woff-v2/mjx-ncm-shb.woff2 +0 -0
  224. data/vendor/assets/mathjax/woff-v2/mjx-ncm-shbi.woff2 +0 -0
  225. data/vendor/assets/mathjax/woff-v2/mjx-ncm-shi.woff2 +0 -0
  226. data/vendor/assets/mathjax/woff-v2/mjx-ncm-so.woff2 +0 -0
  227. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ss.woff2 +0 -0
  228. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssb.woff2 +0 -0
  229. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbi.woff2 +0 -0
  230. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbix.woff2 +0 -0
  231. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbx.woff2 +0 -0
  232. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssi.woff2 +0 -0
  233. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssix.woff2 +0 -0
  234. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslb.woff2 +0 -0
  235. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssli.woff2 +0 -0
  236. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslib.woff2 +0 -0
  237. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslr.woff2 +0 -0
  238. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssx.woff2 +0 -0
  239. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sy.woff2 +0 -0
  240. data/vendor/assets/mathjax/woff-v2/mjx-ncm-syb.woff2 +0 -0
  241. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sybi.woff2 +0 -0
  242. data/vendor/assets/mathjax/woff-v2/mjx-ncm-syi.woff2 +0 -0
  243. data/vendor/assets/mathjax/woff-v2/mjx-ncm-u-a.woff2 +0 -0
  244. data/vendor/assets/mathjax/woff-v2/mjx-ncm-u.woff2 +0 -0
  245. data/vendor/assets/mathjax/woff-v2/mjx-ncm-v.woff2 +0 -0
  246. data/vendor/assets/mathjax/woff-v2/mjx-ncm-vx.woff2 +0 -0
  247. data/vendor/assets/mathjax/woff-v2/mjx-ncm-zero.woff2 +0 -0
  248. metadata +304 -0
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var a in s)t.o(s,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:s[a]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{LAZYID:()=>c,LazyHandler:()=>d,LazyList:()=>h,LazyMathDocumentMixin:()=>z,LazyMathItemMixin:()=>u});const s=("undefined"!=typeof window?window:t.g).MathJax._.components.global,a=(s.GLOBAL,s.isObject,s.combineConfig,s.combineDefaults,s.combineWithMathJax),i=(s.MathJax,MathJax._.core.MathItem),r=(i.protoItem,i.AbstractMathItem,i.STATE),n=i.newState,l=MathJax._.util.Retries,o=l.handleRetriesFor;l.retryAfter;var y=function(t,e,s,a){return new(s||(s=Promise))((function(i,r){function n(t){try{o(a.next(t))}catch(t){r(t)}}function l(t){try{o(a.throw(t))}catch(t){r(t)}}function o(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,l)}o((a=a.apply(t,e||[])).next())}))};class h{constructor(){this.id=0,this.items=new Map}add(t){const e=String(this.id++);return this.items.set(e,t),e}get(t){return this.items.get(t)}delete(t){return this.items.delete(t)}}n("LAZYALWAYS",r.FINDMATH+3);const c="data-mjx-lazy";function u(t){return class extends t{constructor(...t){super(...t),this.lazyCompile=!0,this.lazyTypeset=!0,this.lazyTex=!1,this.attachSpeech=t=>{var e;this.state()>=r.ATTACHSPEECH||(this.lazyTypeset||null===(e=super.attachSpeech)||void 0===e||e.call(this,t),this.state(r.ATTACHSPEECH))},this.end.node||(this.lazyCompile=this.lazyTypeset=!1)}compile(t){this.lazyCompile?this.state()<r.COMPILED&&(this.lazyTex="TeX"===this.inputJax.name,this.root=t.mmlFactory.create("math"),this.state(r.COMPILED)):super.compile(t)}state(t=null,e=!1){return null!==e&&super.state(t,e),super.state()}typeset(t){if(this.lazyTypeset){if(this.state()<r.TYPESET){const e=t.adaptor;if(!this.lazyMarker){const s=t.lazyList.add(this);this.lazyMarker=e.node("mjx-lazy",{[c]:s}),this.typesetRoot=e.node("mjx-container",{},[this.lazyMarker])}this.state(r.TYPESET)}}else super.typeset(t)}updateDocument(t){super.updateDocument(t),this.lazyTypeset&&t.lazyObserver.observe(this.lazyMarker)}}}function z(t){var e;return(e=class extends t{constructor(...t){super(...t),this.lazyAlwaysContainers=null,this.lazyAlwaysIndex=0,this.lazyPromise=Promise.resolve(),this.lazyIdle=!1,this.lazySet=new Set,this.options.MathItem=u(this.options.MathItem);const e=this.constructor.ProcessBits;e.has("lazyAlways")||e.allocate("lazyAlways"),this.lazyObserver=new IntersectionObserver(this.lazyObserve.bind(this),{rootMargin:this.options.lazyMargin}),this.lazyList=new h;const s=this.lazyHandleSet.bind(this);if(this.lazyProcessSet=window&&window.requestIdleCallback?()=>window.requestIdleCallback(s):()=>setTimeout(s,10),window){let t=!1;const e=()=>{t||this.lazyTypesetAll(),t=!0};window.matchMedia("print").addListener(e),window.addEventListener("beforeprint",e)}}lazyAlways(){if(this.lazyAlwaysContainers&&!this.processed.isSet("lazyAlways")){for(const t of this.math){const e=t;e.lazyTypeset&&this.lazyIsAlways(e)&&(e.lazyCompile=e.lazyTypeset=!1)}this.processed.set("lazyAlways")}}lazyIsAlways(t){if(t.state()<r.LAZYALWAYS){t.state(r.LAZYALWAYS);const e=t.start.node,s=this.adaptor,a=this.lazyAlwaysIndex,i=this.lazyAlwaysContainers.length;do{const t=this.lazyAlwaysContainers[this.lazyAlwaysIndex];if(s.contains(t,e))return!0;++this.lazyAlwaysIndex>=i&&(this.lazyAlwaysIndex=0)}while(this.lazyAlwaysIndex!==a)}return!1}state(t,e=!1){return super.state(t,e),t<r.LAZYALWAYS&&this.processed.clear("lazyAlways"),this}lazyTypesetAll(){return y(this,void 0,void 0,(function*(){let t=r.LAST;for(const e of this.math){const s=e;(s.lazyCompile||s.lazyTypeset)&&(s.lazyCompile?(s.state(r.COMPILED-1),t=r.COMPILED):(s.state(r.TYPESET-1),r.TYPESET<t&&(t=r.TYPESET)),s.lazyCompile=s.lazyTypeset=!1,s.lazyMarker&&this.lazyObserver.unobserve(s.lazyMarker))}if(t===r.LAST)return Promise.resolve();this.state(t-1,null);const e=this.outputJax.options.fontCache;return e&&(this.outputJax.options.fontCache="none"),this.reset(),o((()=>this.render())).then((()=>{e&&(this.outputJax.options.fontCache=e)}))}))}lazyObserve(t){for(const e of t){const t=this.adaptor.getAttribute(e.target,c);this.lazyList.get(t)&&(e.isIntersecting?(this.lazySet.add(t),this.lazyIdle||(this.lazyIdle=!0,this.lazyProcessSet())):this.lazySet.delete(t))}}lazyHandleSet(){const t=this.lazySet;this.lazySet=new Set,this.lazyPromise=this.lazyPromise.then((()=>{let e=this.compileEarlierItems(t)?r.COMPILED:r.TYPESET;return e=this.resetStates(t,e),this.state(e-1,null),o((()=>{this.render(),this.lazyIdle=!1}))}))}resetStates(t,e){for(const s of t.values()){const t=this.lazyList.get(s);t.lazyCompile?(t.state(r.COMPILED-1),e=r.COMPILED):Object.hasOwn(t.metrics,"em")?t.state(r.TYPESET-1):(t.state(r.METRICS-1),e=r.METRICS),t.lazyCompile=t.lazyTypeset=!1,t.lazyMarker&&this.lazyObserver.unobserve(t.lazyMarker)}return e}compileEarlierItems(t){const e=this.earliestTex(t);if(!e)return!1;let s=!1;for(const t of this.math){const a=t;if(a===e||!(null==a?void 0:a.lazyCompile)||!a.lazyTex)break;a.lazyCompile=!1,a.lazyMarker&&this.lazyObserver.unobserve(a.lazyMarker),a.state(r.COMPILED-1),s=!0}return s}earliestTex(t){let e=null,s=null;for(const a of t.values()){const t=this.lazyList.get(a);t.lazyTex&&((null===e||parseInt(a)<e)&&(e=parseInt(a),s=t))}return s}clearMathItemsWithin(t){const e=super.clearMathItemsWithin(t);for(const t of e){const e=t.lazyMarker;e&&(this.lazyObserver.unobserve(e),this.lazyList.delete(this.adaptor.getAttribute(e,c)))}return e}render(){const t=this.options.lazyAlwaysTypeset;return this.lazyAlwaysContainers=t?this.adaptor.getElements(Array.isArray(t)?t:[t],this.document):null,this.lazyAlwaysIndex=0,super.render(),this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{lazyMargin:"500px",lazyAlwaysTypeset:null,renderActions:Object.assign(Object.assign({},t.OPTIONS.renderActions),{lazyAlways:[r.LAZYALWAYS,"lazyAlways","",!1]})}),e}function d(t){return"undefined"!=typeof IntersectionObserver&&(t.documentClass=z(t.documentClass)),t}MathJax.loader&&MathJax.loader.checkVersion("ui/lazy","4.1.0","ui"),a({_:{ui:{lazy:{LazyHandler:e}}}}),MathJax.startup&&MathJax.startup.extendHandler((t=>d(t)))})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{MJContextMenu:()=>lt});var s={};t.r(s),t.d(s,{clearspeakMenu:()=>St,localeMenu:()=>wt});var i={};t.r(i),t.d(i,{copyToClipboard:()=>It,isMac:()=>Lt});var n={};t.r(n),t.d(n,{annotation:()=>Pt,copyAnnotations:()=>Dt,showAnnotations:()=>Nt});var o={};t.r(o),t.d(o,{RadioCompare:()=>Xt});var a={};t.r(a),t.d(a,{MmlVisitor:()=>Kt});var r={};t.r(r),t.d(r,{Menu:()=>Zt});var l={};t.r(l),t.d(l,{MenuHandler:()=>te,MenuMathDocumentMixin:()=>Qt,MenuMathItemMixin:()=>Yt});const h=("undefined"!=typeof window?window:t.g).MathJax._.components.global,c=(h.GLOBAL,h.isObject,h.combineConfig,h.combineDefaults,h.combineWithMathJax),u=h.MathJax;var d;!function(t){t[t.RETURN=13]="RETURN",t[t.ESCAPE=27]="ESCAPE",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(d||(d={}));const p="click",m="dblclick",b="mousedown",g="mouseup",f="mouseover",v="mouseout",x="selectstart";class E{constructor(){this.bubble=!1}bubbleKey(){this.bubble=!0}keydown(t){switch(t.keyCode){case d.ESCAPE:this.escape(t);break;case d.RIGHT:this.right(t);break;case d.LEFT:this.left(t);break;case d.UP:this.up(t);break;case d.DOWN:this.down(t);break;case d.RETURN:case d.SPACE:this.space(t);break;default:return}this.bubble?this.bubble=!1:this.stop(t)}escape(t){}space(t){}left(t){}right(t){}up(t){}down(t){}stop(t){t&&(t.stopPropagation(),t.preventDefault(),t.cancelBubble=!0)}mousedown(t){return this.stop(t)}mouseup(t){return this.stop(t)}mouseover(t){return this.stop(t)}mouseout(t){return this.stop(t)}click(t){return this.stop(t)}addEvents(t){t.addEventListener(b,this.mousedown.bind(this)),t.addEventListener(g,this.mouseup.bind(this)),t.addEventListener(f,this.mouseover.bind(this)),t.addEventListener(v,this.mouseout.bind(this)),t.addEventListener(p,this.click.bind(this)),t.addEventListener("keydown",this.keydown.bind(this)),t.addEventListener("dragstart",this.stop.bind(this)),t.addEventListener(x,this.stop.bind(this)),t.addEventListener("contextmenu",this.stop.bind(this)),t.addEventListener(m,this.stop.bind(this))}}class y extends E{addAttributes(t){for(const e in t)this.html.setAttribute(e,t[e])}get html(){return this._html||this.generateHtml(),this._html}set html(t){this._html=t,this.addEvents(t)}generateHtml(){const t=document.createElement("div");t.classList.add(this.className),t.setAttribute("role",this.role),this.html=t}focus(){const t=this.html;t.setAttribute("tabindex","0"),setTimeout((()=>t.focus()),50)}unfocus(){const t=this.html;t.hasAttribute("tabindex")&&t.setAttribute("tabindex","-1");try{t.blur()}catch(t){}t.blur()}}class M extends y{constructor(){super(...arguments),this.posted=!1}isPosted(){return this.posted}post(t,e){this.posted||(void 0!==t&&void 0!==e&&this.html.setAttribute("style","left: "+t+"px; top: "+e+"px;"),this.display(),this.posted=!0)}unpost(){if(!this.posted)return;const t=this.html;t.parentNode&&t.parentNode.removeChild(t),this.posted=!1}}function C(t){return"CtxtMenu_"+t}function S(t){return C(t)}function O(t){return C(t)}const w={ATTACHED:S("Attached"),CONTEXTMENU:S("ContextMenu"),MENU:S("Menu"),MENUARROW:S("MenuArrow"),MENUACTIVE:S("MenuActive"),MENUCHECK:S("MenuCheck"),MENUCLOSE:S("MenuClose"),MENUCOMBOBOX:S("MenuComboBox"),MENUDISABLED:S("MenuDisabled"),MENUFRAME:S("MenuFrame"),MENUITEM:S("MenuItem"),MENULABEL:S("MenuLabel"),MENURADIOCHECK:S("MenuRadioCheck"),MENUINPUTBOX:S("MenuInputBox"),MENURULE:S("MenuRule"),MENUSLIDER:S("MenuSlider"),MOUSEPOST:S("MousePost"),RTL:S("RTL"),INFO:S("Info"),INFOCLOSE:S("InfoClose"),INFOCONTENT:S("InfoContent"),INFOSIGNATURE:S("InfoSignature"),INFOTITLE:S("InfoTitle"),SLIDERVALUE:S("SliderValue"),SLIDERBAR:S("SliderBar"),SELECTION:S("Selection"),SELECTIONBOX:S("SelectionBox"),SELECTIONMENU:S("SelectionMenu"),SELECTIONDIVIDER:S("SelectionDivider"),SELECTIONITEM:S("SelectionItem")},k={COUNTER:O("Counter"),KEYDOWNFUNC:O("keydownFunc"),CONTEXTMENUFUNC:O("contextmenuFunc"),OLDTAB:O("Oldtabindex"),TOUCHFUNC:O("TouchFunc")};class A extends y{constructor(t,e){super(),this._menu=t,this._type=e,this.className=w.MENUITEM,this.role="menuitem",this.hidden=!1}get menu(){return this._menu}set menu(t){this._menu=t}get type(){return this._type}hide(){this.hidden=!0,this.menu.generateMenu()}show(){this.hidden=!1,this.menu.generateMenu()}isHidden(){return this.hidden}}function T(t){const e=t.menu;e.baseMenu?e.baseMenu.unpost():e.unpost()}function L(t){const e=t.menu;return(e.baseMenu?e.baseMenu:e).store.active}function I(t,e){console.error("ContextMenu Error: "+e)}function N(){return D++}let D=0;class R extends A{constructor(t,e,s,i){super(t,e),this._content=s,this.disabled=!1,this.callbacks=[],this._id=i||s}get content(){return this._content}set content(t){this._content=t,this.generateHtml(),this.menu&&this.menu.generateHtml()}get id(){return this._id}press(){this.disabled||(this.executeAction(),this.executeCallbacks_())}executeAction(){}registerCallback(t){-1===this.callbacks.indexOf(t)&&this.callbacks.push(t)}unregisterCallback(t){const e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)}mousedown(t){this.press(),this.stop(t)}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.deactivate(),this.stop(t)}generateHtml(){super.generateHtml();const t=this.html;t.setAttribute("aria-disabled","false"),t.textContent=this.content}activate(){this.disabled||this.html.classList.add(w.MENUACTIVE)}deactivate(){this.html.classList.remove(w.MENUACTIVE)}focus(){this.menu.focused=this,super.focus(),this.activate()}unfocus(){this.deactivate(),super.unfocus()}escape(t){T(this)}up(t){this.menu.up(t)}down(t){this.menu.down(t)}left(t){this.menu.left(t)}right(t){this.menu.right(t)}space(t){this.press()}disable(){this.disabled=!0;const t=this.html;t.classList.add(w.MENUDISABLED),t.setAttribute("aria-disabled","true")}enable(){this.disabled=!1;const t=this.html;t.classList.remove(w.MENUDISABLED),t.removeAttribute("aria-disabled")}executeCallbacks_(){for(const t of this.callbacks)try{t(this)}catch(t){I(0,"Callback for menu entry "+this.id+" failed.")}}}class P extends R{static fromJson(t,{content:e,menu:s,id:i},n){const o=new this(n,e,i),a=t.get("subMenu")(t,s,o);return o.submenu=a,o}constructor(t,e,s){super(t,"submenu",e,s),this._submenu=null}set submenu(t){this._submenu=t}get submenu(){return this._submenu}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.stop(t)}unfocus(){if(this.submenu.isPosted()){if(this.menu.focused!==this)return super.unfocus(),void this.menu.unpostSubmenus();this.html.setAttribute("tabindex","-1"),this.html.blur()}else super.unfocus()}focus(){super.focus(),this.submenu.isPosted()||this.disabled||this.submenu.post()}executeAction(){this.submenu.isPosted()?this.submenu.unpost():this.submenu.post()}generateHtml(){super.generateHtml();const t=this.html;this.span=document.createElement("span"),this.span.textContent="\u25ba",this.span.classList.add(w.MENUARROW),this.span.setAttribute("aria-hidden","true"),t.appendChild(this.span),t.setAttribute("aria-haspopup","true")}left(t){this.submenu.isPosted()?this.submenu.unpost():super.left(t)}right(t){this.submenu.isPosted()?this.submenu.down(t):this.submenu.post()}toJson(){return{type:""}}}class U extends M{constructor(){super(...arguments),this.className=w.CONTEXTMENU,this.role="menu",this._items=[],this._baseMenu=null}set baseMenu(t){this._baseMenu=t}get baseMenu(){return this._baseMenu}get items(){return this._items}set items(t){this._items=t}get pool(){return this.variablePool}get focused(){return this._focused}set focused(t){if(this._focused===t)return;this._focused||this.unfocus();const e=this._focused;this._focused=t,e&&e.unfocus()}up(t){const e=this.items.filter((t=>t instanceof R&&!t.isHidden()));if(0===e.length)return;if(!this.focused)return void e[e.length-1].focus();let s=e.indexOf(this.focused);-1!==s&&(s=s?--s:e.length-1,e[s].focus())}down(t){const e=this.items.filter((t=>t instanceof R&&!t.isHidden()));if(0===e.length)return;if(!this.focused)return void e[0].focus();let s=e.indexOf(this.focused);-1!==s&&(s++,s=s===e.length?0:s,e[s].focus())}generateHtml(){super.generateHtml(),this.generateMenu()}generateMenu(){const t=this.html;t.classList.add(w.MENU);for(const e of this.items){if(!e.isHidden()){t.appendChild(e.html);continue}const s=e.html;s.parentNode&&s.parentNode.removeChild(s)}}post(t,e){this.variablePool.update(),super.post(t,e)}unpostSubmenus(){const t=this.items.filter((t=>t instanceof P));for(const e of t)e.submenu.unpost(),e!==this.focused&&e.unfocus()}unpost(){super.unpost(),this.unpostSubmenus(),this.focused=null}find(t){for(const e of this.items)if("rule"!==e.type){if(e.id===t)return e;if("submenu"===e.type){const s=e.submenu.find(t);if(s)return s}}return null}}class _{constructor(t){this.menu=t,this.store=[],this._active=null,this.counter=0,this.attachedClass=w.ATTACHED+"_"+N(),this.taborder=!0,this.attrMap={}}set active(t){do{if(-1!==this.store.indexOf(t)){this._active=t;break}t=t.parentNode}while(t)}get active(){return this._active}next(){const t=this.store.length;if(0===t)return this.active=null,null;let e=this.store.indexOf(this.active);return e=-1===e?0:e<t-1?e+1:0,this.active=this.store[e],this.active}previous(){const t=this.store.length;if(0===t)return this.active=null,null;const e=t-1;let s=this.store.indexOf(this.active);return s=-1===s||0===s?e:s-1,this.active=this.store[s],this.active}clear(){this.remove(this.store)}insert(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.insertElement(t);this.sort()}remove(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.removeElement(t);this.sort()}inTaborder(t){this.taborder&&!t&&this.removeTaborder(),!this.taborder&&t&&this.insertTaborder(),this.taborder=t}insertTaborder(){this.taborder&&this.insertTaborder_()}removeTaborder(){this.taborder&&this.removeTaborder_()}insertElement(t){t.classList.contains(this.attachedClass)||(t.classList.add(this.attachedClass),this.taborder&&this.addTabindex(t),this.addEvents(t))}removeElement(t){t.classList.contains(this.attachedClass)&&(t.classList.remove(this.attachedClass),this.taborder&&this.removeTabindex(t),this.removeEvents(t))}sort(){const t=document.getElementsByClassName(this.attachedClass);this.store=[].slice.call(t)}insertTaborder_(){this.store.forEach((t=>t.setAttribute("tabindex","0")))}removeTaborder_(){this.store.forEach((t=>t.setAttribute("tabindex","-1")))}addTabindex(t){t.hasAttribute("tabindex")&&t.setAttribute(k.OLDTAB,t.getAttribute("tabindex")),t.setAttribute("tabindex","0")}removeTabindex(t){t.hasAttribute(k.OLDTAB)?(t.setAttribute("tabindex",t.getAttribute(k.OLDTAB)),t.removeAttribute(k.OLDTAB)):t.removeAttribute("tabindex")}addEvents(t){t.hasAttribute(k.COUNTER)||(this.addEvent(t,"contextmenu",this.menu.post.bind(this.menu)),this.addEvent(t,"keydown",this.keydown.bind(this)),t.setAttribute(k.COUNTER,this.counter.toString()),this.counter++)}addEvent(t,e,s){const i=k[e.toUpperCase()+"FUNC"];this.attrMap[i+this.counter]=s,t.addEventListener(e,s)}removeEvents(t){if(!t.hasAttribute(k.COUNTER))return;const e=t.getAttribute(k.COUNTER);this.removeEvent(t,"contextmenu",e),this.removeEvent(t,"keydown",e),t.removeAttribute(k.COUNTER)}removeEvent(t,e,s){const i=k[e.toUpperCase()+"FUNC"],n=this.attrMap[i+s];t.removeEventListener(e,n)}keydown(t){t.keyCode===d.SPACE&&(this.menu.post(t),t.preventDefault(),t.stopImmediatePropagation())}}class J{constructor(){this.pool={}}insert(t){this.pool[t.name]=t}lookup(t){return this.pool[t]}remove(t){delete this.pool[t]}update(){for(const t in this.pool)this.pool[t].update()}}class V extends U{static fromJson(t,{pool:e,items:s,id:i=""}){const n=new this(t);n.id=i;const o=t.get("variable");e.forEach((e=>o(t,e,n.pool)));const a=t.get("items")(t,s,n);return n.items=a,n}constructor(t){super(),this.factory=t,this.id="",this.moving=!1,this._store=new _(this),this.widgets=[],this.variablePool=new J}generateHtml(){this.isPosted()&&this.unpost(),super.generateHtml(),this._frame=document.createElement("div"),this._frame.classList.add(w.MENUFRAME);const t="left: 0px; top: 0px; z-index: 200; width: 100%; height: 100%; border: 0px; padding: 0px; margin: 0px;";this._frame.setAttribute("style","position: absolute; "+t);const e=document.createElement("div");e.setAttribute("style","position: fixed; "+t),this._frame.appendChild(e),e.addEventListener("mousedown",function(t){this.unpost(),this.unpostWidgets(),this.stop(t)}.bind(this))}display(){document.body.appendChild(this.frame),this.frame.appendChild(this.html),this.focus()}escape(t){this.unpost(),this.unpostWidgets()}unpost(){if(super.unpost(),this.widgets.length>0)return;this.frame.parentNode.removeChild(this.frame);const t=this.store;this.moving||t.insertTaborder(),t.active.focus()}left(t){this.move_(this.store.previous())}right(t){this.move_(this.store.next())}get frame(){return this._frame}get store(){return this._store}post(t,e){if(void 0!==e)return this.moving||this.store.removeTaborder(),void super.post(t,e);const s=t;let i,n,o;if(s instanceof Event?(i=s.target,this.stop(s)):i=s,s instanceof MouseEvent&&(n=s.pageX,o=s.pageY,n||o||!s.clientX||(n=s.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,o=s.clientY+document.body.scrollTop+document.documentElement.scrollTop)),!n&&!o&&i){const t=window.pageXOffset||document.documentElement.scrollLeft,e=window.pageYOffset||document.documentElement.scrollTop,s=i.getBoundingClientRect();n=(s.right+s.left)/2+t,o=(s.bottom+s.top)/2+e}this.store.active=i,this.anchor=this.store.active;const a=this.html;n+a.offsetWidth>document.body.offsetWidth-5&&(n=document.body.offsetWidth-a.offsetWidth-5),this.post(n,o)}registerWidget(t){this.widgets.push(t)}unregisterWidget(t){const e=this.widgets.indexOf(t);e>-1&&this.widgets.splice(e,1),0===this.widgets.length&&this.unpost()}unpostWidgets(){this.widgets.forEach((t=>t.unpost()))}toJson(){return{type:""}}move_(t){this.anchor&&t!==this.anchor&&(this.moving=!0,this.unpost(),this.post(t),this.moving=!1)}}class B extends U{static fromJson(t,{items:e},s){const i=new this(s),n=t.get("items")(t,e,i);return i.items=n,i}constructor(t){super(),this._anchor=t,this.variablePool=this.anchor.menu.pool,this.setBaseMenu()}get anchor(){return this._anchor}post(){if(!this.anchor.menu.isPosted())return;let t=this.anchor.html;const e=this.html,s=this.baseMenu.frame,i=t.offsetWidth;let n=i-2,o=0;for(;t&&t!==s;)n+=t.offsetLeft,o+=t.offsetTop,t=t.parentNode;n+e.offsetWidth>document.body.offsetWidth-5&&(n=Math.max(5,n-i-e.offsetWidth+6)),super.post(n,o)}display(){this.baseMenu.frame.appendChild(this.html)}setBaseMenu(){let t=this;do{t=t.anchor.menu}while(t instanceof B);this.baseMenu=t}left(t){this.focused=null,this.anchor.focus()}toJson(){return{type:""}}}class H extends R{generateHtml(){super.generateHtml();const t=this.html;this.span||this.generateSpan(),t.appendChild(this.span),this.update()}register(){this.variable.register(this)}unregister(){this.variable.unregister(this)}update(){this.updateAria(),this.span&&this.updateSpan()}}class j extends H{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"radio",e,i),this.role="menuitemradio",this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.id),T(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(w.MENURADIOCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()===this.id?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()===this.id?"":"none"}toJson(){return{type:""}}}class F extends A{static fromJson(t,e,s){return new this(s)}constructor(t){super(t,"rule"),this.className=w.MENUITEM,this.role="separator"}generateHtml(){super.generateHtml();const t=this.html;t.classList.add(w.MENURULE),t.setAttribute("aria-orientation","vertical")}addEvents(t){}toJson(){return{type:"rule"}}}class G extends R{static fromJson(t,{content:e,action:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"command",e,i),this.command=s}mousedown(t){this.stop(t)}mouseup(t){this.press(),this.stop(t)}executeAction(){try{this.command(L(this))}catch(t){I(0,"Illegal command callback.")}T(this)}toJson(){return{type:""}}}class z{static fromJson(t,{name:e,getter:s,setter:i},n){const o=new this(e,s,i);n.insert(o)}constructor(t,e,s){this._name=t,this.getter=e,this.setter=s,this.items=[]}get name(){return this._name}getValue(t){try{return this.getter(t)}catch(t){return I(0,"Command of variable "+this.name+" failed."),null}}setValue(t,e){try{this.setter(t,e)}catch(t){I(0,"Command of variable "+this.name+" failed.")}this.update()}register(t){-1===this.items.indexOf(t)&&this.items.push(t)}unregister(t){const e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1)}update(){this.items.forEach((t=>t.update()))}registerCallback(t){this.items.forEach((e=>e.registerCallback(t)))}unregisterCallback(t){this.items.forEach((e=>e.unregisterCallback(t)))}toJson(){return{type:"variable",name:this.name,getter:this.getter.toString(),setter:this.setter.toString()}}}class X extends H{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"checkbox",e,i),this.role="menuitemcheckbox",this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(!this.variable.getValue()),T(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(w.MENUCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()?"":"none"}toJson(){return{type:""}}}class W extends H{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"combobox",e,i),this.role="combobox",this.inputEvent=!1,this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.input.value,L(this))}space(t){super.space(t),T(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add(w.MENUCOMBOBOX)}generateSpan(){this.span=document.createElement("span"),this.span.classList.add(w.MENUINPUTBOX),this.input=document.createElement("input"),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.setAttribute("size","10em"),this.input.setAttribute("type","text"),this.input.setAttribute("tabindex","-1"),this.span.appendChild(this.input)}inputKey(t){this.bubbleKey(),this.inputEvent=!0}keydown(t){if(this.inputEvent&&t.keyCode!==d.ESCAPE&&t.keyCode!==d.RETURN)return this.inputEvent=!1,void t.stopPropagation();super.keydown(t),t.stopPropagation()}updateAria(){}updateSpan(){let t;try{t=this.variable.getValue(L(this))}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class K extends R{static fromJson(t,{content:e,id:s},i){return new this(i,e,s)}constructor(t,e,s){super(t,"label",e,s)}generateHtml(){super.generateHtml();this.html.classList.add(w.MENULABEL)}toJson(){return{type:""}}}class $ extends H{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"slider",e,i),this.role="slider",this.labelId="ctx_slideLabel"+N(),this.valueId="ctx_slideValue"+N(),this.inputEvent=!1,this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.input.value,L(this)),this.update()}space(t){super.space(t),T(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add(w.MENUSLIDER),this.valueSpan=document.createElement("span"),this.valueSpan.setAttribute("id",this.valueId),this.valueSpan.classList.add(w.SLIDERVALUE),this.html.appendChild(this.valueSpan)}generateSpan(){this.span=document.createElement("span"),this.labelSpan=document.createElement("span"),this.labelSpan.setAttribute("id",this.labelId),this.labelSpan.appendChild(this.html.childNodes[0]),this.html.appendChild(this.labelSpan),this.input=document.createElement("input"),this.input.setAttribute("type","range"),this.input.setAttribute("min","0"),this.input.setAttribute("max","100"),this.input.setAttribute("aria-valuemin","0"),this.input.setAttribute("aria-valuemax","100"),this.input.setAttribute("aria-labelledby",this.labelId),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.addEventListener("input",this.executeAction.bind(this)),this.input.classList.add(w.SLIDERBAR),this.span.appendChild(this.input)}inputKey(t){this.inputEvent=!0}mousedown(t){t.stopPropagation()}mouseup(t){T(this),t.stopPropagation()}keydown(t){const e=t.keyCode;return e===d.UP||e===d.DOWN?(t.preventDefault(),void super.keydown(t)):this.inputEvent&&e!==d.ESCAPE&&e!==d.RETURN?(this.inputEvent=!1,void t.stopPropagation()):(super.keydown(t),void t.stopPropagation())}updateAria(){const t=this.variable.getValue();t&&this.input&&(this.input.setAttribute("aria-valuenow",t),this.input.setAttribute("aria-valuetext",t+"%"))}updateSpan(){let t;try{t=this.variable.getValue(L(this)),this.valueSpan.innerHTML=t+"%"}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class q extends M{constructor(t){super(),this.element=t,this.className=w.MENUCLOSE,this.role="button"}generateHtml(){const t=document.createElement("span");t.classList.add(this.className),t.setAttribute("role",this.role),t.setAttribute("tabindex","0");const e=document.createElement("span");e.textContent="\xd7",t.appendChild(e),this.html=t}display(){}unpost(){super.unpost(),this.element.unpost()}keydown(t){this.bubbleKey(),super.keydown(t)}space(t){this.unpost(),this.stop(t)}mousedown(t){this.unpost(),this.stop(t)}}class Z extends M{constructor(t,e,s){super(),this.title=t,this.signature=s,this.className=w.INFO,this.role="dialog",this.contentDiv=this.generateContent(),this.close=this.generateClose(),this.content=e||function(){return""}}attachMenu(t){this.menu=t}generateHtml(){super.generateHtml();const t=this.html;t.appendChild(this.generateTitle()),t.appendChild(this.contentDiv),t.appendChild(this.generateSignature()),t.appendChild(this.close.html),t.setAttribute("tabindex","0")}post(){super.post();const t=document.documentElement,e=this.html,s=window.innerHeight||t.clientHeight||t.scrollHeight||0,i=Math.floor(-e.offsetWidth/2),n=Math.floor((s-e.offsetHeight)/3);e.setAttribute("style","margin-left: "+i+"px; top: "+n+"px;"),window.event instanceof MouseEvent&&e.classList.add(w.MOUSEPOST),e.focus()}display(){this.menu.registerWidget(this),this.contentDiv.innerHTML=this.content();const t=this.menu.html;t.parentNode&&t.parentNode.removeChild(t),this.menu.frame.appendChild(this.html)}click(t){}keydown(t){this.bubbleKey(),super.keydown(t)}escape(t){this.unpost()}unpost(){super.unpost(),this.html.classList.remove(w.MOUSEPOST),this.menu.unregisterWidget(this)}generateClose(){const t=new q(this),e=t.html;return e.classList.add(w.INFOCLOSE),e.setAttribute("aria-label","Close Dialog Box"),t}generateTitle(){const t=document.createElement("span");return t.innerHTML=this.title,t.classList.add(w.INFOTITLE),t}generateContent(){const t=document.createElement("div");return t.classList.add(w.INFOCONTENT),t.setAttribute("tabindex","0"),t}generateSignature(){const t=document.createElement("span");return t.innerHTML=this.signature,t.classList.add(w.INFOSIGNATURE),t}toJson(){return{type:""}}}class Y extends U{static fromJson(t,{title:e,values:s,variable:i},n){const o=new this(n),a=t.get("label")(t,{content:e||"",id:e||"id"},o),r=t.get("rule")(t,{},o),l=s.map((e=>t.get("radio")(t,{content:e,variable:i,id:e},o))),h=[a,r].concat(l);return o.items=h,o}constructor(t){super(),this.anchor=t,this.className=w.SELECTIONMENU,this.variablePool=this.anchor.menu.pool,this.baseMenu=this.anchor.menu}generateHtml(){super.generateHtml(),this.items.forEach((t=>t.html.classList.add(w.SELECTIONITEM)))}display(){}right(t){this.anchor.right(t)}left(t){this.anchor.left(t)}}class Q extends Z{static fromJson(t,{title:e,signature:s,selections:i,order:n,grid:o},a){const r=new this(e,s,n,o);r.attachMenu(a);const l=i.map((e=>t.get("selectionMenu")(t,e,r)));return r.selections=l,r}constructor(t,e,s="none",i="vertical"){super(t,null,e),this.style=s,this.grid=i,this._selections=[],this.prefix="ctxt-selection",this._balanced=!0}attachMenu(t){this.menu=t}get selections(){return this._selections}set selections(t){this._selections=[],t.forEach((t=>this.addSelection(t)))}addSelection(t){t.anchor=this,this._selections.push(t)}rowDiv(t){const e=document.createElement("div");this.contentDiv.appendChild(e);const s=t.map((t=>(e.appendChild(t.html),t.html.id||(t.html.id=this.prefix+N()),t.html.getBoundingClientRect()))),i=s.map((t=>t.width)),n=i.reduce(((t,e)=>t+e),0),o=s.reduce(((t,e)=>Math.max(t,e.height)),0);return e.classList.add(w.SELECTIONDIVIDER),e.setAttribute("style","height: "+o+"px;"),[e,n,o,i]}display(){if(super.display(),this.order(),!this.selections.length)return;const t=[];let e=0,s=[];const i=this.getChunkSize(this.selections.length);for(let n=0;n<this.selections.length;n+=i){const o=this.selections.slice(n,n+i),[a,r,l,h]=this.rowDiv(o);t.push(a),e=Math.max(e,r),o.forEach((t=>t.html.style.height=l+"px")),s=this.combineColumn(s,h)}this._balanced&&(this.balanceColumn(t,s),e=s.reduce(((t,e)=>t+e),20)),t.forEach((t=>t.style.width=e+"px"))}getChunkSize(t){switch(this.grid){case"square":return Math.floor(Math.sqrt(t));case"horizontal":return Math.floor(t/Q.chunkSize);default:return Q.chunkSize}}balanceColumn(t,e){t.forEach((t=>{const s=Array.from(t.children);for(let t,i=0;t=s[i];i++)t.style.width=e[i]+"px"}))}combineColumn(t,e){let s=[],i=0;for(;t[i]||e[i];){if(!t[i]){s=s.concat(e.slice(i));break}if(!e[i]){s=s.concat(t.slice(i));break}s.push(Math.max(t[i],e[i])),i++}return s}left(t){this.move(t,(t=>(0===t?this.selections.length:t)-1))}right(t){this.move(t,(t=>t===this.selections.length-1?0:t+1))}generateHtml(){super.generateHtml(),this.html.classList.add(w.SELECTION)}generateContent(){const t=super.generateContent();return t.classList.add(w.SELECTIONBOX),t.removeAttribute("tabindex"),t}findSelection(t){const e=t.target;let s=null;if(e.id&&(s=this.selections.find((t=>t.html.id===e.id))),!s){const t=e.parentElement.id;s=this.selections.find((e=>e.html.id===t))}return s}move(t,e){const s=this.findSelection(t);s.focused&&s.focused.unfocus();const i=e(this.selections.indexOf(s));this.selections[i].focus()}order(){this.selections.sort(Q.orderMethod.get(this.style))}toJson(){return{type:""}}}Q.chunkSize=4,Q.orderMethod=new Map([["alphabetical",(t,e)=>t.items[0].content.localeCompare(e.items[0].content)],["none",(t,e)=>1],["decreasing",(t,e)=>{const s=t.items.length,i=e.items.length;return s<i?1:i<s?-1:0}],["increasing",(t,e)=>{const s=t.items.length,i=e.items.length;return s<i?-1:i<s?1:0}]]);class tt{constructor(t){this._parser=new Map(t)}get(t){return this._parser.get(t)}add(t,e){this._parser.set(t,e)}}var et=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};class st{constructor(t=[]){this._initList=[["command",G.fromJson.bind(G)],["checkbox",X.fromJson.bind(X)],["combo",W.fromJson.bind(W)],["slider",$.fromJson.bind($)],["label",K.fromJson.bind(K)],["radio",j.fromJson.bind(j)],["rule",F.fromJson.bind(F)],["submenu",P.fromJson.bind(P)],["contextMenu",V.fromJson.bind(V)],["subMenu",B.fromJson.bind(B)],["variable",z.fromJson.bind(z)],["items",this.items.bind(this)],["selectionMenu",Y.fromJson.bind(Y)],["selectionBox",Q.fromJson.bind(Q)]],this._factory=new tt(this._initList),t.forEach((([t,e])=>this.factory.add(t,e)))}get factory(){return this._factory}items(t,e,s){const i=[];for(const t of e){const e=this.parse(t,s);e&&(s.items.push(e),t.disabled&&e.disable(),t.hidden&&i.push(e))}return i.forEach((t=>t.hide())),s.items}parse(t,...e){var{type:s}=t,i=et(t,["type"]);const n=this.factory.get(s);return n?n(this.factory,i,...e):null}}function it(t){return"."+(w[t]||t)}function nt(t,e=";"){return"{\n "+t.join(e+"\n ")+";\n}"}const ot={};ot[it("MENU")]=nt(["position: absolute","background-color: white","color: black","width: auto","padding: 5px 0px","border: 1px solid #CCCCCC","margin: 0","cursor: default","font: menu","text-align: left","text-indent: 0","text-transform: none","line-height: normal","letter-spacing: normal","word-spacing: normal","word-wrap: normal","white-space: nowrap","float: none","z-index: 1001","border-radius: 5px","box-shadow: 0px 10px 20px #808080"]),ot[it("MENUITEM")]=nt(["padding: 1px 2em","background: transparent"]),ot[it("MENUARROW")]=nt(["position: absolute","right: 0.5em","padding-top: 0.25em","color: #666666","font-family: null","font-size: 0.75em"]),ot[it("MENUACTIVE")+" "+it("MENUARROW")]=nt(["color: white"]),ot[it("MENUARROW")+it("RTL")]=nt(["left: 0.5em","right: auto"]),ot[it("MENUCHECK")]=nt(["position: absolute","left: 0.7em","font-family: null"]),ot[it("MENUCHECK")+it("RTL")]=nt(["right: 0.7em","left: auto"]),ot[it("MENURADIOCHECK")]=nt(["position: absolute","left: 0.7em"]),ot[it("MENURADIOCHECK")+it("RTL")]=nt(["right: 0.7em","left: auto"]),ot[it("MENUINPUTBOX")]=nt(["padding-left: 1em","right: 0.5em","color: #666666","font-family: null"]),ot[it("MENUINPUTBOX")+it("RTL")]=nt(["left: 0.1em"]),ot[it("MENUCOMBOBOX")]=nt(["left: 0.1em","padding-bottom: 0.5em"]),ot[it("MENUSLIDER")]=nt(["left: 0.1em"]),ot[it("SLIDERVALUE")]=nt(["position: absolute","right: 0.1em","padding-top: 0.25em","color: #333333","font-size: 0.75em"]),ot[it("MENUACTIVE")+" "+it("SLIDERVALUE")]=nt(["color: #DDDDDD"]),ot[it("SLIDERBAR")]=nt(["outline: none","background: #D3D3D3"]),ot[it("MENULABEL")]=nt(["padding: 1px 2em 3px 1.33em","font-style: italic"]),ot[it("MENURULE")]=nt(["border-top: 1px solid #DDDDDD","margin: 4px 3px"]),ot[it("MENUDISABLED")]=nt(["color: #999"]),ot[it("MENUACTIVE")]=nt(["background-color: #606872","color: white"]),ot[it("MENUDISABLED")+":focus"]=nt(["background-color: #E8E8E8"]),ot[it("MENULABEL")+":focus"]=nt(["background-color: #E8E8E8"]),ot[it("CONTEXTMENU")+":focus"]=nt(["outline: none"]),ot[it("CONTEXTMENU")+" "+it("MENUITEM")+":focus"]=nt(["outline: none"]),ot[it("SELECTIONMENU")]=nt(["position: relative","float: left","border-bottom: none","box-shadow: none ! important","border-radius: 0px !important"]),ot[it("SELECTIONITEM")]=nt(["padding-right: 1em"]),ot[it("SELECTION")]=nt(["right: 40%","width: 50%"]),ot[it("SELECTIONBOX")]=nt(["padding: 0em","max-height: 20em","max-width: none","background-color: #FFFFFF"]),ot[it("SELECTIONDIVIDER")]=nt(["clear: both","border-top: 2px solid #000000"]),ot[it("MENU")+" "+it("MENUCLOSE")]=nt(["top: -10px","left: -10px"]),ot["@media (prefers-color-scheme: dark) /* menu */"]=nt([it("MENU")+" "+nt(["color: #E0E0E0","background-color: #242436","box-shadow: 0px 10px 20px #000","border: 1px solid #808080"]),it("SLIDERVALUE")+" "+nt(["color: #D0D0D0"]),it("MENUDISABLED")+":focus "+nt(["background-color: #383838"]),it("MENULABEL")+":focus "+nt(["background-color: #585858"]),it("MENURULE")+" "+nt(["border-top: 1px solid #808080"]),it("SELECTIONDIVIDER")+" "+nt(["border-top: 2px solid #808080"])],"");const at={};at[it("MENUCLOSE")]=nt(["position: absolute","cursor: pointer","display: inline-block","border: 2px solid #AAA","border-radius: 18px",'font-family: "Courier New", Courier',"font-size: 24px","color: #F0F0F0"]),at[it("MENUCLOSE")+" span"]=nt(["display: block","background-color: #AAA","border: 1.5px solid","border-radius: 18px","line-height: 0","padding: 8px 0 6px"]),at[it("MENUCLOSE")+":hover"]=nt(["color: white !important","border: 2px solid #CCC !important"]),at[it("MENUCLOSE")+":hover span"]=nt(["background-color: #CCC !important"]),at[it("MENUCLOSE")+":hover:focus"]=nt(["outline: none"]);function rt(t,e=document,s="MJX-Menu-styles"){if(e.head.querySelector("#"+s))return;const i=e.createElement("style");i.id=s;const n=[];for(const e in t)n.push(`${e} ${t[e]}`);i.textContent=n.join("\n"),e.head.appendChild(i)}class lt extends V{constructor(){super(...arguments),this.mathItem=null,this.nofocus=!1,this.errorMsg=""}post(t,e){var s,i;if(this.mathItem){const n=null===(i=null===(s=this.mathItem)||void 0===s?void 0:s.explorers)||void 0===i?void 0:i.speech;(null==n?void 0:n.active)&&(n.restarted=n.semanticFocus()),void 0!==e&&(this.getOriginalMenu(),this.getSemanticsMenu(),this.getSpeechMenu(),this.getBrailleMenu(),this.getSvgMenu(),this.getErrorMessage(),this.dynamicSubmenus()),super.post(t,e)}}unpost(){this.posted&&super.unpost(),this.mathItem&&(this.mathItem.outputData.nofocus=this.nofocus),this.mathItem=null,this.nofocus=!1}findID(...t){let e=this,s=null;for(const i of t){if(!e)return null;for(s of e.items){if(s.id===i){e=s instanceof P?s.submenu:null;break}e=s=null}}return s}setJax(t){this.jax=t}getOriginalMenu(){const t=this.mathItem.inputJax.name,e=this.findID("Show","Original");e.content="MathML"===t?"Original MathML":t+" Commands";this.findID("Copy","Original").content=e.content}getSemanticsMenu(){const t=this.findID("Settings","MathmlIncludes","semantics");"MathML"===this.mathItem.inputJax.name?t.disable():t.enable()}getSpeechMenu(){const t=this.mathItem.outputData.speech;this.findID("Show","Speech")[t?"enable":"disable"](),this.findID("Copy","Speech")[t?"enable":"disable"]()}getBrailleMenu(){const t=this.mathItem.outputData.braille;this.findID("Show","Braille")[t?"enable":"disable"](),this.findID("Copy","Braille")[t?"enable":"disable"]()}getSvgMenu(){const t=this.jax.SVG;this.findID("Show","SVG")[t?"enable":"disable"](),this.findID("Copy","SVG")[t?"enable":"disable"]()}getErrorMessage(){const t=this.mathItem.root.childNodes[0].childNodes;let e=!0;if(this.errorMsg="",1===t.length&&t[0].isKind("merror")){const s=t[0].attributes;this.errorMsg=s.get("data-mjx-error")||s.get("data-mjx-message")||"",e=!this.errorMsg}this.findID("Show","Error")[e?"disable":"enable"](),this.findID("Copy","Error")[e?"disable":"enable"]()}dynamicSubmenus(){for(const[t,[e,s]]of lt.DynamicSubmenus){const i=this.find(t);i&&e(this,i,(t=>{var e;i.submenu=t,!(null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.length)||s&&!this.settings[s]?i.disable():i.enable()}))}}}lt.DynamicSubmenus=new Map;const ht=MathJax._.ui.dialog.InfoDialog.InfoDialog;class ct extends Q{constructor(t,e,s,i,n,o){super(t,e,i,n),this.attachMenu(o);const a=o.factory;this.selections=s.map((t=>a.get("selectionMenu")(a,t,this)))}post(){const t=Array.from(Object.values(this.menu.jax)).filter((t=>!!t))[0],e=new ht({title:this.title,message:"",adaptor:t.adaptor,styles:{"mjx-dialog > div":{padding:0}}});e.attach(),this.contentDiv=e.content,this.display()}display(){const t=this;if(t.order(),!this.selections.length)return;const e=[];let s=0,i=[];const n=t.getChunkSize(this.selections.length);for(let o=0;o<this.selections.length;o+=n){const a=this.selections.slice(o,o+n),[r,l,h,c]=t.rowDiv(a);e.push(r),s=Math.max(s,l),a.forEach((t=>t.html.style.height=h+"px")),i=t.combineColumn(i,c)}t._balanced&&(t.balanceColumn(e,i),s=i.reduce(((t,e)=>t+e-2),20)),e.forEach((t=>t.style.width=s+"px"))}}const ut=MathJax._.a11y.sre_ts,dt=ut.locales,pt=(ut.setupEngine,ut.engineSetup,ut.toEnriched,ut.parseDOM,ut.addPreference),mt=ut.fromPreference,bt=ut.toPreference;var gt=function(t,e,s,i){return new(s||(s=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function r(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(a,r)}l((i=i.apply(t,e||[])).next())}))};let ft={},vt=null;function xt(t){var e,s;const i=null==t?void 0:t.match(/^clearspeak-(.*)/);return vt=null!==(s=null!==(e=i&&i[1])&&void 0!==e?e:vt)&&void 0!==s?s:"default",vt}const Et=new Map;const yt=new Map;let Mt=0;function Ct(t,e){const s=Et.get(e);!function(t,e){const s=t.pool.lookup("speechRules"),i=xt(t.settings.speechRules);ft=mt(i);for(const i of e)t.factory.get("variable")(t.factory,{name:"csprf_"+i,setter:t=>{ft[i]=t,s.setValue("clearspeak-"+bt(ft))},getter:()=>ft[i]||"Auto"},t.pool)}(t,Object.keys(s));const i=[];for(const t of Object.getOwnPropertyNames(s))i.push({title:t,values:s[t].map((e=>e.replace(RegExp("^"+t+"_"),""))),variable:"csprf_"+t});const n=new ct("Clearspeak Preferences","",i,"alphabetical","square",t);return{type:"command",id:"ClearspeakPreferences",content:"Select Preferences",action:()=>n.post()}}function St(t,e,s){return gt(this,void 0,void 0,(function*(){var i,n;const o=i=>{s(t.factory.get("subMenu")(t.factory,{items:i,id:"Clearspeak"},e))};if(!t.settings.speech||!t.settings.enrich)return void o([]);const a=t.pool.lookup("locale").getValue();if(yield function(t,e){return gt(this,void 0,void 0,(function*(){Et.has(e)||(yield t.mathItem.generatorPool.getLocalePreferences(Et))}))}(t,a),!Et.get(a))return void o([]);const r=Ct(t,a);let l=[];if(t.settings.speech){const e=t.mathItem,s=null===(i=null==e?void 0:e.explorers)||void 0===i?void 0:i.speech,o=xt(t.settings.speechRules);l=l.concat(function(t){return[{type:"radio",content:"No Preferences",id:"clearspeak-default",variable:"speechRules"},{type:"radio",content:"Current Preferences",id:"clearspeak-"+t,variable:"speechRules"},{type:"rule"}]}(o));const r=null==s?void 0:s.refocus,h=null!==(n=null==r?void 0:r.getAttribute("data-semantic-id"))&&void 0!==n?n:null,c=Mt++;yield e.generatorPool.getRelevantPreferences(e,h,yt,c);const u=yt.get(c);if(yt.delete(c),u){const t=function(t,e,s){const i=Et.get(s);return[{type:"label",content:"Preferences for "+e},{type:"rule"}].concat(i[e].map((function(e){const[s,i]=e.split("_");return{type:"radioCompare",content:i,id:"clearspeak-"+pt(t,s,i),variable:"speechRules",comparator:(t,e)=>{if(t===e)return!0;if("Auto"!==i)return!1;const[n,o]=t.split("-"),[a]=e.split("-");return n===a&&!mt(o)[s]}}})))}(o,u,a);l=l.concat(t)}}l.splice(2,0,r),o(l)}))}lt.DynamicSubmenus.set("Clearspeak",[St,"speech"]);let Ot=null;function wt(t,e,s){if(Ot)return void s(Ot);const i=[];for(const t of dt.keys())"nemeth"!==t&&"euro"!==t&&i.push({type:"radio",id:t,content:dt.get(t)||t,variable:"locale"});i.sort(((t,e)=>t.content.localeCompare(e.content,"en"))),Ot=t.factory.get("subMenu")(t.factory,{items:i,id:"Language"},e),s(Ot)}lt.DynamicSubmenus.set("A11yLanguage",[wt,"speech"]);const kt=MathJax._.util.context,At=kt.hasWindow,Tt=kt.context,Lt="MacOS"===Tt.os;function It(t){const e=Tt.document,s=e.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.cssText="height: 1px; width: 1px; padding: 1px; position: absolute; left: -10px",e.body.appendChild(s),s.select();try{e.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}e.body.removeChild(s)}function Nt(t,e,s){return(i,n,o)=>{!function(t,e,s){if(!t)return;for(const i of t.childNodes)if(i.isKind("annotation")){const t=Rt(i,e);if(t){const e=i.childNodes.reduce(((t,e)=>t+e.toString()),"");s.push([t,e])}}}(function(t){var e;let s=null===(e=t.mathItem)||void 0===e?void 0:e.root;for(;s&&!s.isKind("semantics");){if(s.isToken||1!==s.childNodes.length)return null;s=s.childNodes[0]}return s}(i),e,s),o(Ut(i,n,s,t))}}function Dt(t){return(e,s,i)=>{const n=t.slice();t.length=0,i(Ut(e,s,n,(()=>It(Pt.trim()))))}}function Rt(t,e){const s=t.attributes.get("encoding");for(const t of Object.keys(e))if(e[t].includes(s))return t;return null}let Pt="";function Ut(t,e,s,i){return t.factory.get("subMenu")(t.factory,{items:s.map((([t,e])=>({type:"command",id:t,content:t,action:()=>{Pt=e,i()}}))),id:"annotations"},e)}const _t=MathJax._.mathjax.mathjax,Jt=MathJax._.core.MathItem,Vt=(Jt.protoItem,Jt.AbstractMathItem,Jt.STATE),Bt=Jt.newState,Ht=MathJax._.util.Options,jt=(Ht.isObject,Ht.APPEND,Ht.REMOVE,Ht.OPTIONS,Ht.Expandable,Ht.expandable),Ft=(Ht.makeArray,Ht.keys,Ht.copy,Ht.insert,Ht.defaultOptions),Gt=Ht.userOptions;Ht.selectOptions,Ht.selectOptionsFromKeys,Ht.separateOptions,Ht.lookup;class zt extends ht{static post(t){return super.post(t)}html(t){var e;null!==(e=t.extraNodes)&&void 0!==e||(t.extraNodes=[]);const s=t.adaptor.node("input",{type:"button",value:"Copy to Clipboard","data-drag":"none"});return s.addEventListener("click",this.copyToClipboard.bind(this)),t.extraNodes.push(s),t.code&&(t.message="<pre>"+this.formatSource(t.message)+"</pre>"),super.html(t)}formatSource(t){return t.trim().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}class Xt extends j{static fromJson(t,{content:e,variable:s,id:i,comparator:n},o){return new this(o,e,s,i,n)}constructor(t,e,s,i,n){super(t,e,s,i),this.comparator=n,this.role="menuitemradiocompare"}updateAria(){this.html.setAttribute("aria-checked",this.comparator(this.variable.getValue(),this.id)?"true":"false")}updateSpan(){this.span.style.display=this.comparator(this.variable.getValue(),this.id)?"":"none"}}const Wt=MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor;class Kt extends Wt{constructor(){super(...arguments),this.options={filterSRE:!0,filterTex:!0,texHints:!0,semantics:!1},this.mathItem=null}visitTree(t,e=null,s={}){return this.mathItem=e,Gt(this.options,s),this.visitNode(t,"")}visitTeXAtomNode(t,e){return this.options.texHints?super.visitDefault(t,e):t.childNodes[0]&&1===t.childNodes[0].childNodes.length?this.visitNode(t.childNodes[0],e):`${e}<mrow${this.getAttributes(t)}>\n`+this.childNodeMml(t,e+" ","\n")+`${e}</mrow>`}visitMathNode(t,e){if(!this.options.semantics||"TeX"!==this.mathItem.inputJax.name)return super.visitDefault(t,e);const s=t.childNodes.length&&t.childNodes[0].childNodes.length>1;return`${e}<math${this.getAttributes(t)}>\n${e} <semantics>\n`+(s?e+" <mrow>\n":"")+this.childNodeMml(t,e+(s?" ":" "),"\n")+(s?e+" </mrow>\n":"")+`${e} <annotation encoding="application/x-tex">`+this.mathItem.math+`</annotation>\n${e} </semantics>\n${e}</math>`}getAttributeList(t){const e=super.getAttributeList(t);if(this.options.filterTex&&(delete e["data-latex"],delete e["data-latex-item"]),this.options.filterSRE){const t=Object.keys(e).filter((t=>t.match(/^(?:data-semantic-.*?|data-speech-node|role|aria-(?:level|posinset|setsize|owns))$/)));for(const s of t)delete e[s]}return e}}var $t=function(t,e,s,i){return new(s||(s=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function r(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(a,r)}l((i=i.apply(t,e||[])).next())}))};const qt=u;class Zt{get isLoading(){return Zt.loading>0}get loadingPromise(){return this.isLoading?(Zt._loadingPromise||(Zt._loadingPromise=new Promise(((t,e)=>{Zt._loadingOK=t,Zt._loadingFailed=e}))),Zt._loadingPromise):Promise.resolve()}about(){const t=[];if(t.push("Input Jax: "+this.document.inputJax.map((t=>t.name)).join(", ")),t.push("Output Jax: "+this.document.outputJax.name),t.push("Document Type: "+this.document.kind),qt&&qt.loader){t.push("<hr/>Modules Loaded:");const e=qt._.components.package.Package,s=qt.loader.versions;for(const i of Array.from(e.packages.keys()).sort(this.sortPackages)){const n=s.get(e.resolvePath(i));n&&t.push(`&#xA0;&#xA0;&#xA0;&#xA0;${i} <mjx-v>(${n})</mjx-v>`)}}ht.post({title:"MathJax <mjx-v>v"+_t.version+"</mjx-v>",message:t.join("<br/>"),adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(20em, 85%))"},"mjx-dialog > div":{"white-space":"nowrap"},"dialog.mjx-dialog-help > mjx-dialog > div":{"white-space":"normal"},"mjx-v":{"font-size":"80%"}},extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"false"},[this.document.adaptor.text("https://www.mathjax.org")])]})}sortPackages(t,e){const[s,i]=t.includes("/")?t.split(/\//):["",t],[n,o]=e.includes("/")?e.split(/\//):["",e];return s===n?i<o?-1:1:"["===s.charAt(0)?"["===n.charAt(0)&&s<n?-1:1:"["===n.charAt(0)||s<n?-1:1}help(){ht.post({title:"MathJax Help",message:["<p><b>MathJax</b> is a JavaScript library that allows page"," authors to include mathematics within their web pages."," As a reader, you don't need to do anything to make that happen.</p>","<p><b>Browsers</b>: MathJax works with all modern browsers including"," Edge, Firefox, Chrome, Safari, Opera, and most mobile browsers.</p>","<p><b>Math Menu</b>: MathJax adds a contextual menu to equations."," Right-click or CTRL-click on any mathematics to access the menu.</p>",'<div style="margin-left: 1em;">',"<p><b>Show Math As:</b> These options allow you to view the formula's"," source markup (as MathML or in its original format).</p>","<p><b>Copy to Clipboard:</b> These options copy the formula's source markup,"," as MathML or in its original format, to the clipboard"," (in browsers that support that).</p>","<p><b>Math Settings:</b> These give you control over features of MathJax,"," such the size of the mathematics, the mechanism used to display equations,"," how to handle equations that are too wide, and the language to use for"," MathJax's menus and error messages (not yet implemented in v4).","</p>","<p><b>Accessibility</b>: MathJax can work with screen"," readers to make mathematics accessible to the visually impaired."," Turn on speech or braille generation to enable creation of speech strings"," and the ability to investigate expressions interactively. You can control"," the style of the explorer in its menu.</p>","</div>","<p><b>Math Zoom</b>: If you are having difficulty reading an"," equation, MathJax can enlarge it to help you see it better, or"," you can scale all the math on the page to make it larger."," Turn these features on in the <b>Math Settings</b> menu.</p>","<p><b>Preferences</b>: MathJax uses your browser's localStorage database"," to save the preferences set via this menu locally in your browser. These"," are not used to track you, and are not transferred or used remotely by"," MathJax in any way.</p>"].join("\n"),adaptor:this.document.adaptor,extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"none"},[this.document.adaptor.text("https://www.mathjax.org")])]})}mathMLCode(){zt.post({title:"MathJax MathML Expression",message:this.menu.mathItem?this.toMML(this.menu.mathItem):"",adaptor:this.document.adaptor,code:!0})}originalText(){var t,e;zt.post({title:"MathJax Original Source",message:null!==(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.math)&&void 0!==e?e:"",adaptor:this.document.adaptor,code:!0})}annotationBox(){zt.post({title:"MathJax Annotation Text",message:Pt,adaptor:this.document.adaptor,code:!0})}svgImage(){return $t(this,void 0,void 0,(function*(){zt.post({title:"MathJax SVG Image",message:yield this.toSVG(this.menu.mathItem),adaptor:this.document.adaptor,code:!0})}))}speechText(){var t,e,s;zt.post({title:"MathJax Speech Text",message:null!==(s=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.speech)&&void 0!==s?s:"",adaptor:this.document.adaptor,code:!0})}brailleText(){var t,e,s;zt.post({title:"MathJax Braille Text",message:null!==(s=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.braille)&&void 0!==s?s:"",adaptor:this.document.adaptor,code:!0})}errorMessage(){zt.post({title:"MathJax Error Message",message:this.menu.mathItem?this.menu.errorMsg:"",adaptor:this.document.adaptor,code:!0})}zoomBox(){let t="";if(this.menu.mathItem){const e=this.menu.mathItem.typesetRoot,s=this.document.adaptor.fontSize(e),i=e.cloneNode(!0);i.style.margin="0";t=`<div style="font-size: ${s*parseFloat(this.settings.zscale)/100}px">${i.outerHTML}</div>`}ht.post({title:"MathJax Zoomed Expression",message:t,adaptor:this.document.adaptor,styles:{"mjx-dialog > div":{padding:"1.8em"}}})}constructor(t,e={}){this.settings=null,this.defaultSettings=null,this.menu=null,this.current=null,this.MmlVisitor=new Kt,this.jax={CHTML:null,SVG:null},this.rerenderStart=Vt.LAST,this.requiredExtensions=[],this.document=t,this.options=Gt(Ft({},this.constructor.OPTIONS),e),this.initSettings(),this.mergeUserSettings(),this.initMenu(),this.applySettings()}initSettings(){var t;this.settings=this.options.settings,this.jax=this.options.jax;const e=this.document.outputJax;this.jax[e.name]=e,this.settings.renderer=e.name,this.settings.scale=e.options.scale,e.options.displayOverflow&&(this.settings.overflow=e.options.displayOverflow.substring(0,1).toUpperCase()+e.options.displayOverflow.substring(1).toLowerCase()),this.settings.breakInline=null===(t=e.options.linebreaks)||void 0===t?void 0:t.inline,this.defaultSettings=Object.assign({},this.document.options.a11y,this.settings),this.setA11y({roleDescription:this.settings.roleDescription})}initMenu(){const t=new st([["contextMenu",lt.fromJson.bind(lt)],["radioCompare",Xt.fromJson.bind(Xt)]]);this.menu=t.parse({type:"contextMenu",id:"MathJax_Menu",pool:[this.variable("showSRE"),this.variable("showTex"),this.variable("texHints"),this.variable("semantics"),this.variable("zoom"),this.variable("zscale"),this.variable("renderer",(t=>this.setRenderer(t))),this.variable("overflow",(t=>this.setOverflow(t))),this.variable("breakInline",(t=>this.setInlineBreaks(t))),this.variable("alt"),this.variable("cmd"),this.variable("ctrl"),this.variable("shift"),this.variable("scale",(t=>this.setScale(t))),this.a11yVar("speech",(t=>this.setSpeech(t))),this.a11yVar("braille",(t=>this.setBraille(t))),this.variable("brailleCode",(t=>this.setBrailleCode(t))),this.a11yVar("brailleSpeech",(t=>this.setBrailleSpeech(t))),this.a11yVar("brailleCombine",(t=>this.setBrailleCombine(t))),this.a11yVar("highlight",(t=>this.setHighlight(t))),this.a11yVar("backgroundColor",(t=>this.setColor("bg",t))),this.a11yVar("backgroundOpacity",(t=>this.setColor("bg",null,t))),this.a11yVar("foregroundColor",(t=>this.setColor("fg",t))),this.a11yVar("foregroundOpacity",(t=>this.setColor("fg",null,t))),this.a11yVar("subtitles"),this.a11yVar("viewBraille"),this.a11yVar("voicing"),this.a11yVar("roleDescription",(()=>this.setRoleDescription())),this.a11yVar("help"),this.a11yVar("locale",(t=>this.setLocale(t))),this.variable("speechRules",(t=>{const[e,s]=t.split("-");this.document.options.sre.domain=e,this.document.options.sre.style=s,this.rerender(Vt.COMPILED)})),this.a11yVar("magnification"),this.a11yVar("magnify"),this.a11yVar("treeColoring"),this.a11yVar("infoType"),this.a11yVar("infoRole"),this.a11yVar("infoPrefix"),this.variable("autocollapse"),this.variable("collapsible",(t=>this.setCollapsible(t))),this.variable("enrich",(t=>this.setEnrichment(t))),this.variable("inTabOrder",(t=>this.setTabOrder(t))),this.a11yVar("tabSelects"),this.variable("assistiveMml",(t=>this.setAssistiveMml(t)))],items:[this.submenu("Show","Show Math As",[this.command("MathMLcode","MathML Code",(()=>this.mathMLCode())),this.command("Original","Original Form",(()=>this.originalText())),this.rule(),this.command("Speech","Speech Text",(()=>this.speechText()),{disabled:!0}),this.command("Braille","Braille Code",(()=>this.brailleText()),{disabled:!0}),this.command("SVG","SVG Image",(()=>this.svgImage()),{disabled:!0}),this.submenu("ShowAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",(()=>this.errorMessage()),{disabled:!0})]),this.submenu("Copy","Copy to Clipboard",[this.command("MathMLcode","MathML Code",(()=>this.copyMathML())),this.command("Original","Original Form",(()=>this.copyOriginal())),this.rule(),this.command("Speech","Speech Text",(()=>this.copySpeechText()),{disabled:!0}),this.command("Braille","Braille Code",(()=>this.copyBrailleText()),{disabled:!0}),this.command("SVG","SVG Image",(()=>this.copySvgImage()),{disabled:!0}),this.submenu("CopyAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",(()=>this.copyErrorMessage()),{disabled:!0})]),this.rule(),this.submenu("Settings","Math Settings",[this.submenu("Renderer","Math Renderer",this.radioGroup("renderer",[["CHTML"],["SVG"]])),this.submenu("Overflow","Wide Expressions",[this.radioGroup("overflow",[["Overflow"],["Scroll"],["Linebreak"],["Scale"],["Truncate"],["Elide"]]),this.rule(),this.checkbox("BreakInline","Allow In-line Breaks","breakInline")]),this.rule(),this.submenu("MathmlIncludes","MathML/SVG has",[this.checkbox("showSRE","Semantic attributes","showSRE"),this.checkbox("showTex","LaTeX attributes","showTex"),this.checkbox("texHints","TeX hints","texHints"),this.checkbox("semantics","Original as annotation","semantics")]),this.submenu("Language","Language"),this.rule(),this.submenu("ZoomTrigger","Zoom Trigger",[this.command("ZoomNow","Zoom Once Now",(()=>this.zoom(null,""))),this.rule(),this.radioGroup("zoom",[["Click"],["DoubleClick","Double-Click"],["NoZoom","No Zoom"]]),this.rule(),this.label("TriggerRequires","Trigger Requires:"),this.checkbox(Lt?"Option":"Alt",Lt?"Option":"Alt","alt"),this.checkbox("Command","Command","cmd",{hidden:!Lt}),this.checkbox("Control","Control","ctrl",{hidden:Lt}),this.checkbox("Shift","Shift","shift")]),this.submenu("ZoomFactor","Zoom Factor",this.radioGroup("zscale",[["150%"],["175%"],["200%"],["250%"],["300%"],["400%"]])),this.rule(),this.command("Scale","Scale All Math...",(()=>this.scaleAllMath())),this.rule(),this.command("Reset","Reset to defaults",(()=>this.resetDefaults()))]),this.rule(),this.label("Accessibility","\xa0\xa0 Accessibility:"),this.submenu("Speech","\xa0 \xa0 Speech",[this.checkbox("Generate","Generate","speech"),this.checkbox("Subtitles","Show Subtitles","subtitles"),this.checkbox("Auto Voicing","Auto Voicing","voicing"),this.rule(),this.label("Rules","Rules:"),this.submenu("Mathspeak","Mathspeak",this.radioGroup("speechRules",[["mathspeak-default","Verbose"],["mathspeak-brief","Brief"],["mathspeak-sbrief","Superbrief"]])),this.submenu("Clearspeak","Clearspeak",this.radioGroup("speechRules",[["clearspeak-default","Auto"]])),this.rule(),this.submenu("A11yLanguage","Language")]),this.submenu("Braille","\xa0 \xa0 Braille",[this.checkbox("Generate","Generate","braille"),this.checkbox("Subtitles","Show Subtitles","viewBraille"),this.checkbox("BrailleSpeech","Replace Speech","brailleSpeech",{hidden:!0}),this.checkbox("BrailleCombine","Combine with Speech","brailleCombine"),this.rule(),this.label("Code","Code Format:"),this.radioGroup("brailleCode",[["nemeth","Nemeth"],["ueb","UEB"],["euro","Euro"]])]),this.submenu("Explorer","\xa0 \xa0 Explorer",[this.submenu("Highlight","Highlight",[this.submenu("Background","Background",this.radioGroup("backgroundColor",[["Blue"],["Red"],["Green"],["Yellow"],["Cyan"],["Magenta"],["White"],["Black"]])),{type:"slider",variable:"backgroundOpacity",content:" "},this.submenu("Foreground","Foreground",this.radioGroup("foregroundColor",[["Black"],["White"],["Magenta"],["Cyan"],["Yellow"],["Green"],["Red"],["Blue"]])),{type:"slider",variable:"foregroundOpacity",content:" "},this.rule(),this.radioGroup("highlight",[["None"],["Hover"],["Flame"]]),this.rule(),this.checkbox("TreeColoring","Tree Coloring","treeColoring")]),this.submenu("Magnification","Magnification",[this.radioGroup("magnification",[["None"],["Keyboard"],["Mouse"]]),this.rule(),this.radioGroup("magnify",[["200%"],["300%"],["400%"],["500%"]])]),this.submenu("Semantic Info","Semantic Info",[this.checkbox("Type","Type","infoType"),this.checkbox("Role","Role","infoRole"),this.checkbox("Prefix","Prefix","infoPrefix")]),this.rule(),this.submenu("Role Description","Describe math as",[this.radioGroup("roleDescription",[["MathJax expression"],["MathJax"],["math"],["clickable math"],["explorable math"],["none"]])]),this.checkbox("Math Help","Help message on focus","help")]),this.submenu("Options","\xa0 \xa0 Options",[this.checkbox("Enrich","Semantic Enrichment","enrich"),this.checkbox("Collapsible","Collapsible Math","collapsible"),this.checkbox("AutoCollapse","Auto Collapse","autocollapse",{disabled:!0}),this.rule(),this.checkbox("InTabOrder","Include in Tab Order","inTabOrder"),this.submenu("TabSelects","Tabbing Focuses on",[this.radioGroup("tabSelects",[["all","Whole Expression"],["last","Last Explored Node"]])]),this.rule(),this.checkbox("AssistiveMml","Include Hidden MathML","assistiveMml")]),this.rule(),this.command("About","About MathJax",(()=>this.about())),this.command("Help","MathJax Help",(()=>this.help()))]});const e=this.menu;e.settings=this.settings,e.findID("Settings","Overflow","Elide").disable(),e.findID("Braille","ueb").hide(),e.setJax(this.jax),this.checkLoadableItems();const s=[];lt.DynamicSubmenus.set("ShowAnnotation",[Nt((()=>this.annotationBox()),this.options.annotationTypes,s),""]),lt.DynamicSubmenus.set("CopyAnnotation",[Dt(s),""]),function(t){rt(Object.assign(Object.assign({},ot),at),t)}(this.document.document)}checkLoadableItems(){var t,e,s,i,n,o;if(qt&&qt._&&qt.loader&&qt.startup){const a=this.settings,r=this.document.options;(a.enrich||a.speech&&r.enableSpeech||a.braille&&r.enableBraille)&&!(null===(e=null===(t=qt._)||void 0===t?void 0:t.a11y)||void 0===e?void 0:e.explorer)&&this.loadA11y("explorer"),a.collapsible&&!(null===(i=null===(s=qt._)||void 0===s?void 0:s.a11y)||void 0===i?void 0:i.complexity)&&this.loadA11y("complexity"),a.assistiveMml&&!(null===(o=null===(n=qt._)||void 0===n?void 0:n.a11y)||void 0===o?void 0:o["assistive-mml"])&&this.loadA11y("assistive-mml")}else{const t=this.menu;for(const e of Object.keys(this.jax))this.jax[e]||t.findID("Settings","Renderer",e).disable();t.findID("Speech").disable(),t.findID("Braille").disable(),t.findID("Explorer").disable(),t.findID("Options","AutoCollapse").disable(),t.findID("Options","Collapsible").disable(),t.findID("Options","Enrich").disable(),t.findID("Options","AssistiveMml").disable()}}enableAccessibilityItems(t,e){const s=this.menu.findID(t).submenu;for(const t of s.items.slice(1))t instanceof F||(!e||t instanceof P&&!t.submenu.items.length?t.disable():t.enable())}mergeUserSettings(){try{const t=localStorage.getItem(Zt.MENU_STORAGE);if(!t)return;Object.assign(this.settings,JSON.parse(t)),this.setA11y(this.settings)}catch(t){console.log("MathJax localStorage error: "+t.message)}}saveUserSettings(){const t={};for(const e of Object.keys(this.settings))this.settings[e]!==this.defaultSettings[e]&&(t[e]=this.settings[e]);try{Object.keys(t).length?localStorage.setItem(Zt.MENU_STORAGE,JSON.stringify(t)):localStorage.removeItem(Zt.MENU_STORAGE)}catch(t){console.log("MathJax localStorage error: "+t.message)}}setA11y(t){var e,s;(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)&&qt._.a11y.explorer_ts.setA11yOptions(this.document,t)}getA11y(t){var e,s;if(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)return void 0!==this.document.options.a11y[t]?this.document.options.a11y[t]:this.document.options.sre[t]}applySettings(){this.setTabOrder(this.settings.inTabOrder);this.document.options.enableAssistiveMml=this.settings.assistiveMml,this.enableAccessibilityItems("Speech",this.settings.speech),this.enableAccessibilityItems("Braille",this.settings.braille),this.setAccessibilityMenus();const t=this.settings.renderer.replace(/[^a-zA-Z0-9]/g,"")||"CHTML";(Zt._loadingPromise||Promise.resolve()).then((()=>{const e=this.settings,s=this.document.outputJax.options;if(s.scale=parseFloat(e.scale),s.displayOverflow=e.overflow.toLowerCase(),s.linebreaks&&(s.linebreaks.inline=e.breakInline),!e.speechRules){const t=this.document.options.sre;e.speechRules=`${t.domain||"clearspeak"}-${t.style||"default"}`}t!==this.defaultSettings.renderer&&this.document.whenReady((()=>this.setRenderer(t,!1)))}))}setOverflow(t){this.document.outputJax.options.displayOverflow=t.toLowerCase(),Zt.loading||this.document.rerenderPromise()}setInlineBreaks(t){this.document.outputJax.options.linebreaks.inline=t,Zt.loading||this.document.rerenderPromise()}setScale(t){this.document.outputJax.options.scale=parseFloat(t),Zt.loading||this.document.rerenderPromise()}setRenderer(t,e=!0){if(Object.hasOwn(this.jax,t)&&this.jax[t])return this.setOutputJax(t,e);const s=t.toLowerCase();return new Promise(((i,n)=>{this.loadComponent("output/"+s,(()=>{const o=qt.startup;if(!(s in o.constructors))return n(new Error(`Component ${s} not loaded`));o.useOutput(s,!0),o.output=o.getOutputJax(),o.output.setAdaptor(this.document.adaptor),o.output.initialize(),this.jax[t]=o.output,this.setOutputJax(t,e).then((()=>i())).catch((t=>n(t)))}))}))}setOutputJax(t,e=!0){this.jax[t].setAdaptor(this.document.adaptor),this.document.outputJax=this.jax[t];const s=this.loadRequiredExtensions();return e?s.then((()=>_t.handleRetriesFor((()=>this.rerender())))):s.then((()=>{}))}loadRequiredExtensions(){const t=this.document.outputJax.name.toLowerCase(),e=[];for(const s of this.requiredExtensions)e.push(qt.loader.load(`[${s}]/${t}`));return this.requiredExtensions=[],Promise.all(e)}addRequiredExtensions(t){if(t){const e=new Set([...this.requiredExtensions,...t]);this.requiredExtensions=[...e]}}setTabOrder(t){const e=this.menu.findID("Options","TabSelects");t?e.enable():e.disable(),this.menu.store.inTaborder(t)}setAssistiveMml(t){var e,s;this.document.options.enableAssistiveMml=t,t&&this.noRerender((()=>{this.settings.speech&&this.menu.pool.lookup("speech").setValue(!1),this.settings.braille&&this.menu.pool.lookup("braille").setValue(!1)})),!t||(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s["assistive-mml"])?this.rerender():this.loadA11y("assistive-mml")}setAccessibilityMenus(){const t=this.settings.enrich,e=t?"enable":"disable";["Speech","Braille","Explorer"].forEach((t=>this.menu.findID(t)[e]()));const s=this.document.options;s.enableSpeech=s.enableBraille=s.enableExplorer=t,t||(this.settings.collapsible=!1,this.document.options.enableCollapsible=!1)}setSpeech(t){var e,s;this.enableAccessibilityItems("Speech",t),this.document.options.enableSpeech=t,t&&(this.settings.assistiveMml&&this.noRerender((()=>this.menu.pool.lookup("assistiveMml").setValue(!1))),this.settings.brailleSpeech&&this.noRerender((()=>this.menu.pool.lookup("brailleSpeech").setValue(!1)))),!t||(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(Vt.COMPILED):this.loadA11y("explorer")}setBraille(t){var e,s;this.enableAccessibilityItems("Braille",t),this.document.options.enableBraille=t,t&&this.settings.assistiveMml&&this.noRerender((()=>this.menu.pool.lookup("assistiveMml").setValue(!1))),!t||(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(Vt.COMPILED):this.loadA11y("explorer")}setBrailleCode(t){this.document.options.sre.braille=t,this.rerender(Vt.COMPILED)}setBrailleSpeech(t){t&&this.settings.speech?this.noRerender((()=>this.menu.pool.lookup("speech").setValue(!1))):this.enableAccessibilityItems("Speech",!0),this.settings.brailleCombine=this.document.options.a11y.brailleCombine=!1,this.rerender(Vt.COMPILED)}setBrailleCombine(t){this.settings.brailleSpeech&&this.menu.pool.lookup("brailleSpeech").setValue(!1),this.settings.brailleSpeech=this.document.options.a11y.brailleSpeech=!1,this.rerender(Vt.COMPILED)}setLocale(t){this.document.options.sre.locale=t,this.rerender(Vt.COMPILED)}setRoleDescription(){this.rerender(Vt.COMPILED)}setEnrichment(t){var e,s;this.document.options.enableEnrichment=t,this.setAccessibilityMenus(),!t||(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(Vt.COMPILED):this.loadA11y("explorer")}setCollapsible(t){var e,s;this.document.options.enableComplexity=t,t&&!this.settings.enrich&&(this.settings.enrich=this.document.options.enableEnrichment=!0,this.setAccessibilityMenus()),t||this.menu.pool.lookup("highlight").setValue("None"),!t||(null===(s=null===(e=qt._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.complexity)?this.rerender(Vt.COMPILED):this.loadA11y("complexity")}setHighlight(t){var e,s;if("None"!==t){if(!this.settings.collapsible){const t=this.menu.pool.lookup("collapsible");t.setValue(!0),null===(s=null===(e=t.items[0])||void 0===e?void 0:e.executeCallbacks_)||void 0===s||s.call(e)}Zt.loadingPromises.has("a11y/complexity")||this.rerender(Vt.COMPILED)}}setColor(t,e,s){const i=this.document.options.a11y;e||(e=i["fg"===t?"foregroundColor":"backgroundColor"]),s||(s=i["fg"===t?"foregroundOpacity":"backgroundOpacity"]),qt._.a11y.explorer.Region.LiveRegion.setColor(t,1,e.toLowerCase(),parseInt(s)/100)}scaleAllMath(){const t=(100*parseFloat(this.settings.scale)).toFixed(1).replace(/.0$/,""),e=prompt("Scale all mathematics (compared to surrounding text) by",t+"%");if(this.current){const t=this.menu.mathItem.explorers.speech;t.refocus=this.current,t.focus()}if(e)if(e.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)){const t=parseFloat(e)/100;t?this.menu.pool.lookup("scale").setValue(String(t)):alert("The scale should not be zero")}else alert("The scale should be a percentage (e.g., 120%)")}resetDefaults(){this.noRerender((()=>{const t=this.menu.pool,e=this.defaultSettings;for(const s of Object.keys(e)){const i=t.lookup(s);if(i){if(i.getValue()!==e[s]){i.setValue(e[s]);const t=i.items[0];t&&t.executeCallbacks_()}}else Object.hasOwn(this.settings,s)&&(this.settings[s]=e[s])}})),this.rerender(Vt.COMPILED)}checkComponent(t){const e=Zt.loadingPromises.get(t);e&&_t.retryAfter(e)}loadComponent(t,e){if(Zt.loadingPromises.has(t))return;const s=qt.loader;if(!s)return;Zt.loading++;const i=s.load(t).then((()=>{Zt.loading--,Zt.loadingPromises.delete(t),0===Zt.loading&&Zt._loadingPromise&&(Zt._loadingPromise=null,Zt._loadingOK()),e()})).catch((t=>{Zt._loadingPromise?(Zt._loadingPromise=null,Zt._loadingFailed(t)):console.log(t)}));Zt.loadingPromises.set(t,i)}loadA11y(t){const e=!Vt.ENRICHED;this.loadComponent("a11y/"+t,(()=>{var s,i;const n=qt.startup;_t.handlers.unregister(n.handler),n.handler=n.getHandler(),_t.handlers.register(n.handler);const o=this.document;this.document=n.document=n.getDocument(),this.document.processed=o.processed,this.document.menu=this,o.webworker&&(this.document.webworker=o.webworker),this.setA11y(this.settings),this.defaultSettings=Object.assign({},this.document.options.a11y,(null===(i=null===(s=qt.config)||void 0===s?void 0:s.options)||void 0===i?void 0:i.a11y)||{},this.defaultSettings),this.document.outputJax.reset(),this.transferMathList(o),this.document.processed=o.processed,Zt._loadingPromise||(this.document.outputJax.reset(),_t.handleRetriesFor((()=>{this.rerender("complexity"===t||e?Vt.COMPILED:Vt.TYPESET)})))}))}transferMathList(t){const e=this.document.options.MathItem;for(const s of t.math){const t=new e;Object.assign(t,s),this.document.math.push(t)}}toMML(t){return this.MmlVisitor.visitTree(t.root,t,{filterSRE:!this.settings.showSRE,filterTex:!this.settings.showTex,texHints:this.settings.texHints,semantics:this.settings.semantics&&"MathML"!==t.inputJax.name})}toSVG(t){return $t(this,void 0,void 0,(function*(){const e=this.jax.SVG;if(!e)return"SVG can't be produced.<br>Try switching to SVG output first.";const s=e.adaptor,i=e.options.fontCache,n=!!t.root.getProperty("process-breaks");if("global"!==i&&(t.display||!n)&&"SVG"===s.getAttribute(t.typesetRoot,"jax"))for(const e of s.childNodes(t.typesetRoot))if("svg"===s.kind(e))return this.formatSvg(s.serializeXML(e));return this.typesetSVG(t,i,n)}))}typesetSVG(t,e,s){return $t(this,void 0,void 0,(function*(){const i=this.jax.SVG,n=i.html("div");"global"===e&&(i.options.fontCache="local");const o=t.root;return t.root=o.copy(!0),t.root.setInheritedAttributes({},t.display,0,!1),s&&(i.unmarkInlineBreaks(t.root),t.root.setProperty("inlineMarked",!1)),yield _t.handleRetriesFor((()=>{i.toDOM(t,n,i.document)})),t.root=o,i.options.fontCache=e,this.formatSvg(i.adaptor.serializeXML(n))}))}formatSvg(t){const e=this.constructor.SvgCss,s=(t=(t=t.match(/^<svg.*?><defs>/)?t.replace(/<defs>/,`<defs><style>${e}</style>`):t.replace(/^(<svg.*?>)/,`$1<defs><style>${e}</style></defs>`)).replace(/ (?:role|focusable)=".*?"/g,"").replace(/"currentColor"/g,'"black"')).split(/(<\/?[a-zA-Z].*?>)/);for(let t=2,e="";t<s.length;t+=2){const i=s[t-1],n=s[t+1];"/"!==i.charAt(1)&&"/"!==i.charAt(i.length-2)&&(e+=" "),n&&("/"===n.charAt(1)&&(e=e.slice(2)),s[t+1]=n.replace(' xmlns:xlink="http://www.w3.org/1999/xlink"',"")),s[t]&&(s[t]="\n "+e+s[t].replace(/\n/g,"\n "+e)),s[t]+="\n"+e}return t=s.join(""),this.settings.showSRE||(t=t.replace(/ (?:data-semantic-.*?|data-speech-node)=".*?"/g,"")),this.settings.showTex||(t=t.replace(/ data-latex(?:-item)?=".*?"/g,"")),this.settings.texHints||(t=t.replace(/ data-mjx-(?:texclass|alternate|variant|pseudoscript|smallmatrix|mathaccent|auto-op|script-align|vbox)=".*?"/g,"").replace(/ data-mml-node="TeXAtom"/g,"")),`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n${t}`}zoom(t,e){t&&!this.isZoomEvent(t,e)||this.zoomBox()}isZoomEvent(t,e){return this.settings.zoom===e&&(!this.settings.alt||t.altKey)&&(!this.settings.ctrl||t.ctrlKey)&&(!this.settings.cmd||t.metaKey)&&(!this.settings.shift||t.shiftKey)}rerender(t=Vt.TYPESET){this.rerenderStart=Math.min(t,this.rerenderStart),!Zt.loading&&qt.startup.hasTypeset&&this.document.whenReady((()=>$t(this,void 0,void 0,(function*(){this.rerenderStart<=Vt.COMPILED&&this.document.reset({inputJax:[]}),yield this.document.rerenderPromise(this.rerenderStart),this.rerenderStart=Vt.LAST}))))}noRerender(t){Zt.loading++;try{t(),Zt.loading--}catch(t){throw Zt.loading--,t}}copyMathML(){It(this.toMML(this.menu.mathItem))}copyOriginal(){It(this.menu.mathItem.math.trim())}copySvgImage(){this.toSVG(this.menu.mathItem).then((t=>{It(t)}))}copySpeechText(){It(this.menu.mathItem.outputData.speech)}copyBrailleText(){It(this.menu.mathItem.outputData.braille)}copyErrorMessage(){It(this.menu.errorMsg.trim())}addMenu(t){this.addEvents(t),this.menu.store.insert(t.typesetRoot),t.typesetRoot.tabIndex=this.settings.inTabOrder?0:-1}addEvents(t){const e=t.typesetRoot;e.addEventListener("mousedown",(()=>{var e,s;this.menu.mathItem=t,this.current=null===(s=null===(e=t.explorers)||void 0===e?void 0:e.speech)||void 0===s?void 0:s.current}),!0),e.addEventListener("contextmenu",(()=>{var e;this.menu.mathItem=t;const s=null===(e=t.explorers)||void 0===e?void 0:e.speech;s&&(t.outputData.nofocus=!this.current,s.refocus=this.current)}),!0),e.addEventListener("keydown",(()=>this.menu.mathItem=t),!0),e.addEventListener("click",(t=>this.zoom(t,"Click")),!0),e.addEventListener("dblclick",(t=>this.zoom(t,"DoubleClick")),!0)}clear(){this.menu.store.clear()}variable(t,e){return{name:t,getter:()=>this.settings[t],setter:s=>{this.settings[t]=s,e&&e(s),this.saveUserSettings()}}}a11yVar(t,e){return{name:t,getter:()=>this.getA11y(t),setter:s=>{this.settings[t]=s,this.setA11y({[t]:s}),e&&e(s),this.saveUserSettings()}}}submenu(t,e,s=[],i=!1){let n=[];for(const t of s)Array.isArray(t)?n=n.concat(t):n.push(t);return{type:"submenu",id:t,content:e,menu:{items:n},disabled:0===n.length||i}}command(t,e,s,i={}){return Object.assign({type:"command",id:t,content:e,action:s},i)}checkbox(t,e,s,i={}){return Object.assign({type:"checkbox",id:t,content:e,variable:s},i)}radioGroup(t,e){return e.map((e=>this.radio(e[0],e[1]||e[0],t)))}radio(t,e,s,i={}){return Object.assign({type:"radio",id:t,content:e,variable:s},i)}label(t,e){return{type:"label",id:t,content:e}}rule(){return{type:"rule"}}}function Yt(t){return class extends t{addMenu(t,e=!1){this.state()>=Vt.CONTEXT_MENU||(this.isEscaped||!t.options.enableMenu&&!e||t.menu.addMenu(this),this.state(Vt.CONTEXT_MENU))}getMenus(t){t.menu.menu.store.sort()}checkLoading(t){t.checkLoading()}}}function Qt(t){var e;return(e=class extends t{constructor(...t){super(...t),this.menu=new this.options.MenuClass(this,this.options.menuOptions);const e=this.constructor.ProcessBits;e.has("context-menu")||e.allocate("context-menu"),this.options.MathItem=Yt(this.options.MathItem);const s=this.menu.settings,i=this.options,n=i.enableEnrichment=s.enrich;i.enableSpeech=s.speech&&n,i.enableBraille=s.braille&&n,i.enableComplexity=s.collapsible&&n,i.enableExplorer=n}addMenu(){if(!this.processed.isSet("context-menu")){for(const t of this.math)t.addMenu(this);this.processed.set("context-menu")}return this}getMenus(){this.menu.menu.store.sort()}checkLoading(){let t=!0;try{this._checkLoading(),t=!1}catch(t){if(!t.retry)throw t}return t}_checkLoading(){return this.menu.isLoading&&_t.retryAfter(this.menu.loadingPromise.catch((t=>console.log(t)))),this.options.enableComplexity&&this.menu.checkComponent("a11y/complexity"),this.options.enableExplorer&&this.menu.checkComponent("a11y/explorer"),this}state(t,e=!1){return super.state(t,e),t<Vt.CONTEXT_MENU&&this.processed.clear("context-menu"),this}}).OPTIONS=Object.assign(Object.assign({enableEnrichment:!0,enableComplexity:!0,enableSpeech:!0,enableBraille:!0,enableExplorer:!0,enableExplorerHelp:!0,enrichSpeech:"none",enrichError:(t,e,s)=>console.warn("Enrichment Error:",s)},t.OPTIONS),{MenuClass:Zt,menuOptions:Zt.OPTIONS,enableMenu:!0,sre:t.OPTIONS.sre||jt({}),a11y:t.OPTIONS.a11y||jt({}),renderActions:jt(Object.assign(Object.assign({},t.OPTIONS.renderActions),{addMenu:[Vt.CONTEXT_MENU],getMenus:[Vt.INSERTED+5,!1],checkLoading:[Vt.UNPROCESSED+1,t=>t.checkLoading(),"",!1]}))}),e}function te(t){return t.documentClass=Qt(t.documentClass),t}Zt.MENU_STORAGE="MathJax-Menu-Settings",Zt.OPTIONS={settings:{showSRE:!1,showTex:!1,texHints:!0,semantics:!1,zoom:"NoZoom",zscale:"200%",renderer:"CHTML",alt:!0,cmd:!1,ctrl:!1,shift:!1,scale:1,overflow:"Scroll",breakInline:!0,autocollapse:!1,collapsible:!1,enrich:!0,inTabOrder:!0,assistiveMml:!1,speech:!0,braille:!0,brailleCode:"nemeth",brailleSpeech:!1,brailleCombine:!1,speechRules:"clearspeak-default",roleDescription:"math",tabSelects:"all",help:!0},jax:{CHTML:null,SVG:null},annotationTypes:jt({TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]})},Zt.SvgCss=["svg a{fill:blue;stroke:blue}",'[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join("\n"),Zt.loading=0,Zt.loadingPromises=new Map,Zt._loadingPromise=null,Zt._loadingOK=null,Zt._loadingFailed=null,Bt("CONTEXT_MENU",170),MathJax.loader&&MathJax.loader.checkVersion("ui/menu","4.1.0","ui"),c({_:{a11y:{speech:{SpeechMenu:s}},ui:{menu:{AnnotationMenu:n,MJContextMenu:e,Menu:r,MenuHandler:l,MenuUtil:i,MmlVisitor:a,RadioCompare:o}}}}),MathJax.startup&&At&&MathJax.startup.extendHandler((t=>te(t)),20)})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{SafeMethods:()=>c});var s={};t.r(s),t.d(s,{Safe:()=>p});var i={};t.r(i),t.d(i,{SafeHandler:()=>u,SafeMathDocumentMixin:()=>h});const r=("undefined"!=typeof window?window:t.g).MathJax._.components.global,a=(r.GLOBAL,r.isObject,r.combineConfig,r.combineDefaults,r.combineWithMathJax),o=(r.MathJax,MathJax._.util.Options),l=(o.isObject,o.APPEND,o.REMOVE,o.OPTIONS,o.Expandable,o.expandable),n=(o.makeArray,o.keys,o.copy,o.insert,o.defaultOptions,o.userOptions,o.selectOptions,o.selectOptionsFromKeys,o.separateOptions,o.lookup,MathJax._.util.lengths),f=(n.BIGDIMEN,n.UNITS,n.RELUNITS,n.MATHSPACE,n.length2em),c=(n.percent,n.em,n.px,{filterURL(t,e){const s=(e.match(/^\s*([a-z\n\r]+):/i)||[null,""])[1].replace(/[\n\r]/g,"").toLowerCase(),i=t.allow.URLs;return"all"===i||"safe"===i&&(t.options.safeProtocols[s]||!s)?e:null},filterClassList(t,e){return e.trim().replace(/\s\s+/g," ").split(/ /).map((e=>this.filterClass(t,e)||"")).join(" ").trim().replace(/\s\s+/g,"")},filterClass(t,e){const s=t.allow.classes;return"all"===s||"safe"===s&&e.match(t.options.classPattern)?e:null},filterID(t,e){const s=t.allow.cssIDs;return"all"===s||"safe"===s&&e.match(t.options.idPattern)?e:null},filterStyles(t,e){if("all"===t.allow.styles)return e;if("safe"!==t.allow.styles)return null;const s=t.adaptor,i=t.options;try{const r=s.node("div",{style:e}),a=s.node("div");for(const e of Object.keys(i.safeStyles))if(i.styleParts[e])for(const i of["Top","Right","Bottom","Left"]){const o=e+i,l=this.filterStyle(t,o,r);l&&s.setStyle(a,o,l)}else{const i=this.filterStyle(t,e,r);i&&s.setStyle(a,e,i)}e=s.allStyles(a)}catch(t){e=""}return e},filterStyle(t,e,s){const i=t.adaptor.getStyle(s,e);if("string"!=typeof i||""===i||i.match(/^\s*calc/)||i.match(/javascript:/)&&!t.options.safeProtocols.javascript||i.match(/data:/)&&!t.options.safeProtocols.data)return null;const r=e.replace(/Top|Right|Left|Bottom/,"");return t.options.safeStyles[e]||t.options.safeStyles[r]?this.filterStyleValue(t,e,i,s):null},filterStyleValue(t,e,s,i){const r=t.options.styleLengths[e];if(!r)return s;if("string"!=typeof r)return this.filterStyleLength(t,e,s);const a=this.filterStyleLength(t,r,t.adaptor.getStyle(i,r));return a?(t.adaptor.setStyle(i,r,a),t.adaptor.getStyle(i,e)):null},filterStyleLength(t,e,s){if(!s.match(/^(.+)(em|ex|ch|rem|px|mm|cm|in|pt|pc|%)$/))return null;const i=f(s,1),r=t.options.styleLengths[e],[a,o]=Array.isArray(r)?r:[-t.options.lengthMax,t.options.lengthMax];return a<=i&&i<=o?s:(i<a?a:o).toFixed(3).replace(/\.?0+$/,"")+"em"},filterFontSize(t,e){return this.filterStyleLength(t,"fontSize",e)},filterSizeMultiplier(t,e){const[s,i]=t.options.scriptsizemultiplierRange||[-1/0,1/0];return Math.min(i,Math.max(s,parseFloat(e))).toString()},filterScriptLevel(t,e){const[s,i]=t.options.scriptlevelRange||[-1/0,1/0];return Math.min(i,Math.max(s,parseInt(e))).toString()},filterData:(t,e,s)=>s.match(t.options.dataPattern)?e:null});class p{constructor(t,e){this.filterAttributes=new Map([["href","filterURL"],["src","filterURL"],["altimg","filterURL"],["class","filterClassList"],["style","filterStyles"],["id","filterID"],["fontsize","filterFontSize"],["mathsize","filterFontSize"],["scriptminsize","filterFontSize"],["scriptsizemultiplier","filterSizeMultiplier"],["scriptlevel","filterScriptLevel"],["data-","filterData"]]),this.filterMethods=Object.assign({},c),this.adaptor=t.adaptor,this.options=e,this.allow=this.options.allow}sanitize(t,e){try{t.root.walkTree(this.sanitizeNode.bind(this))}catch(s){e.options.compileError(e,t,s)}}sanitizeNode(t){const e=t.attributes.getAllAttributes();for(const t of Object.keys(e)){const s=this.filterAttributes.get(t);if(s){const i=this.filterMethods[s](this,e[t]);i?i!==("number"==typeof i?parseFloat(e[t]):e[t])&&(e[t]=i):delete e[t]}}}mmlAttribute(t,e){if("class"===t)return null;const s=this.filterAttributes.get(t)||("data-"===t.substring(0,5)?this.filterAttributes.get("data-"):null);if(!s)return e;const i=this.filterMethods[s](this,e,t);return"number"==typeof i||"boolean"==typeof i?String(i):i}mmlClassList(t){return t.map((t=>this.filterMethods.filterClass(this,t))).filter((t=>null!==t))}}function h(t){var e;return(e=class extends t{constructor(...t){super(...t),this.safe=new this.options.SafeClass(this,this.options.safeOptions);for(const t of this.inputJax)t.name.match(/MathML/)?(t.mathml.filterAttribute=this.safe.mmlAttribute.bind(this.safe),t.mathml.filterClassList=this.safe.mmlClassList.bind(this.safe)):t.name.match(/TeX/)&&t.postFilters.add(this.sanitize.bind(t),-5.5)}sanitize(t){t.math.root=this.parseOptions.root,t.document.safe.sanitize(t.math,t.document)}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{safeOptions:Object.assign({},p.OPTIONS),SafeClass:p}),e}function u(t){return t.documentClass=h(t.documentClass),t}p.OPTIONS={allow:{URLs:"safe",classes:"safe",cssIDs:"safe",styles:"safe"},lengthMax:3,scriptsizemultiplierRange:[.6,1],scriptlevelRange:[-2,2],classPattern:/^mjx-[-a-zA-Z0-9_.]+$/,idPattern:/^mjx-[-a-zA-Z0-9_.]+$/,dataPattern:/^data-mjx-/,safeProtocols:l({http:!0,https:!0,file:!0,javascript:!1,data:!1}),safeStyles:l({color:!0,backgroundColor:!0,border:!0,cursor:!0,margin:!0,padding:!0,textShadow:!0,fontFamily:!0,fontSize:!0,fontStyle:!0,fontWeight:!0,opacity:!0,outline:!0}),styleParts:l({border:!0,padding:!0,margin:!0,outline:!0}),styleLengths:l({borderTop:"borderTopWidth",borderRight:"borderRightWidth",borderBottom:"borderBottomWidth",borderLeft:"borderLeftWidth",paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0,outlineTop:!0,outlineRight:!0,outlineBottom:!0,outlineLeft:!0,fontSize:[.707,1.44]})},MathJax.loader&&MathJax.loader.checkVersion("ui/safe","4.1.0","ui"),a({_:{ui:{safe:{SafeHandler:i,SafeMethods:e,safe:s}}}}),MathJax.startup&&MathJax.startup.extendHandler((t=>u(t)))})();