deepsky-core 1.112.0 → 1.118.4

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 (287) hide show
  1. package/dist/index.css +1292 -1293
  2. package/dist/index.d.ts +2707 -2109
  3. package/dist/index.js +1 -1
  4. package/package.json +65 -65
  5. /package/dist/chunk/{1037-80772935d4409e6b0538.js → 1037-25be6d62a1e259bb29fc.js} +0 -0
  6. /package/dist/chunk/{1066-80772935d4409e6b0538.js → 1066-25be6d62a1e259bb29fc.js} +0 -0
  7. /package/dist/chunk/{1216-80772935d4409e6b0538.js → 1216-25be6d62a1e259bb29fc.js} +0 -0
  8. /package/dist/chunk/{1230-80772935d4409e6b0538.js → 1230-25be6d62a1e259bb29fc.js} +0 -0
  9. /package/dist/chunk/{1425-80772935d4409e6b0538.js → 1425-25be6d62a1e259bb29fc.js} +0 -0
  10. /package/dist/chunk/{1432-80772935d4409e6b0538.js → 1432-25be6d62a1e259bb29fc.js} +0 -0
  11. /package/dist/chunk/{1476-80772935d4409e6b0538.js → 1476-25be6d62a1e259bb29fc.js} +0 -0
  12. /package/dist/chunk/{1545-80772935d4409e6b0538.js → 1545-25be6d62a1e259bb29fc.js} +0 -0
  13. /package/dist/chunk/{16-80772935d4409e6b0538.js → 16-25be6d62a1e259bb29fc.js} +0 -0
  14. /package/dist/chunk/{1624-80772935d4409e6b0538.js → 1624-25be6d62a1e259bb29fc.js} +0 -0
  15. /package/dist/chunk/{1631-80772935d4409e6b0538.js → 1631-25be6d62a1e259bb29fc.js} +0 -0
  16. /package/dist/chunk/{1655-80772935d4409e6b0538.js → 1655-25be6d62a1e259bb29fc.js} +0 -0
  17. /package/dist/chunk/{1708-80772935d4409e6b0538.js → 1708-25be6d62a1e259bb29fc.js} +0 -0
  18. /package/dist/chunk/{172-80772935d4409e6b0538.js → 172-25be6d62a1e259bb29fc.js} +0 -0
  19. /package/dist/chunk/{1729-80772935d4409e6b0538.js → 1729-25be6d62a1e259bb29fc.js} +0 -0
  20. /package/dist/chunk/{1757-80772935d4409e6b0538.js → 1757-25be6d62a1e259bb29fc.js} +0 -0
  21. /package/dist/chunk/{1803-80772935d4409e6b0538.js → 1803-25be6d62a1e259bb29fc.js} +0 -0
  22. /package/dist/chunk/{1839-80772935d4409e6b0538.js → 1839-25be6d62a1e259bb29fc.js} +0 -0
  23. /package/dist/chunk/{1857-80772935d4409e6b0538.js → 1857-25be6d62a1e259bb29fc.js} +0 -0
  24. /package/dist/chunk/{1931-80772935d4409e6b0538.js → 1931-25be6d62a1e259bb29fc.js} +0 -0
  25. /package/dist/chunk/{2062-80772935d4409e6b0538.js → 2062-25be6d62a1e259bb29fc.js} +0 -0
  26. /package/dist/chunk/{2068-80772935d4409e6b0538.js → 2068-25be6d62a1e259bb29fc.js} +0 -0
  27. /package/dist/chunk/{2071-80772935d4409e6b0538.js → 2071-25be6d62a1e259bb29fc.js} +0 -0
  28. /package/dist/chunk/{2108-80772935d4409e6b0538.js → 2108-25be6d62a1e259bb29fc.js} +0 -0
  29. /package/dist/chunk/{212-80772935d4409e6b0538.js → 212-25be6d62a1e259bb29fc.js} +0 -0
  30. /package/dist/chunk/{2142-80772935d4409e6b0538.js → 2142-25be6d62a1e259bb29fc.js} +0 -0
  31. /package/dist/chunk/{2173-80772935d4409e6b0538.js → 2173-25be6d62a1e259bb29fc.js} +0 -0
  32. /package/dist/chunk/{2184-80772935d4409e6b0538.js → 2184-25be6d62a1e259bb29fc.js} +0 -0
  33. /package/dist/chunk/{2215-80772935d4409e6b0538.js → 2215-25be6d62a1e259bb29fc.js} +0 -0
  34. /package/dist/chunk/{224-80772935d4409e6b0538.js → 224-25be6d62a1e259bb29fc.js} +0 -0
  35. /package/dist/chunk/{2266-80772935d4409e6b0538.js → 2266-25be6d62a1e259bb29fc.js} +0 -0
  36. /package/dist/chunk/{2354-80772935d4409e6b0538.js → 2354-25be6d62a1e259bb29fc.js} +0 -0
  37. /package/dist/chunk/{2419-80772935d4409e6b0538.js → 2419-25be6d62a1e259bb29fc.js} +0 -0
  38. /package/dist/chunk/{245-80772935d4409e6b0538.js → 245-25be6d62a1e259bb29fc.js} +0 -0
  39. /package/dist/chunk/{2473-80772935d4409e6b0538.js → 2473-25be6d62a1e259bb29fc.js} +0 -0
  40. /package/dist/chunk/{2492-80772935d4409e6b0538.js → 2492-25be6d62a1e259bb29fc.js} +0 -0
  41. /package/dist/chunk/{2505-80772935d4409e6b0538.js → 2505-25be6d62a1e259bb29fc.js} +0 -0
  42. /package/dist/chunk/{2535-80772935d4409e6b0538.js → 2535-25be6d62a1e259bb29fc.js} +0 -0
  43. /package/dist/chunk/{2660-80772935d4409e6b0538.js → 2660-25be6d62a1e259bb29fc.js} +0 -0
  44. /package/dist/chunk/{2691-80772935d4409e6b0538.js → 2691-25be6d62a1e259bb29fc.js} +0 -0
  45. /package/dist/chunk/{2723-80772935d4409e6b0538.js → 2723-25be6d62a1e259bb29fc.js} +0 -0
  46. /package/dist/chunk/{284-80772935d4409e6b0538.js → 284-25be6d62a1e259bb29fc.js} +0 -0
  47. /package/dist/chunk/{2860-80772935d4409e6b0538.js → 2860-25be6d62a1e259bb29fc.js} +0 -0
  48. /package/dist/chunk/{2861-80772935d4409e6b0538.js → 2861-25be6d62a1e259bb29fc.js} +0 -0
  49. /package/dist/chunk/{2934-80772935d4409e6b0538.js → 2934-25be6d62a1e259bb29fc.js} +0 -0
  50. /package/dist/chunk/{3032-80772935d4409e6b0538.js → 3032-25be6d62a1e259bb29fc.js} +0 -0
  51. /package/dist/chunk/{3043-80772935d4409e6b0538.js → 3043-25be6d62a1e259bb29fc.js} +0 -0
  52. /package/dist/chunk/{3052-80772935d4409e6b0538.js → 3052-25be6d62a1e259bb29fc.js} +0 -0
  53. /package/dist/chunk/{3124-80772935d4409e6b0538.js → 3124-25be6d62a1e259bb29fc.js} +0 -0
  54. /package/dist/chunk/{3170-80772935d4409e6b0538.js → 3170-25be6d62a1e259bb29fc.js} +0 -0
  55. /package/dist/chunk/{321-80772935d4409e6b0538.js → 321-25be6d62a1e259bb29fc.js} +0 -0
  56. /package/dist/chunk/{3227-80772935d4409e6b0538.js → 3227-25be6d62a1e259bb29fc.js} +0 -0
  57. /package/dist/chunk/{3247-80772935d4409e6b0538.js → 3247-25be6d62a1e259bb29fc.js} +0 -0
  58. /package/dist/chunk/{327-80772935d4409e6b0538.js → 327-25be6d62a1e259bb29fc.js} +0 -0
  59. /package/dist/chunk/{3279-80772935d4409e6b0538.js → 3279-25be6d62a1e259bb29fc.js} +0 -0
  60. /package/dist/chunk/{3330-80772935d4409e6b0538.js → 3330-25be6d62a1e259bb29fc.js} +0 -0
  61. /package/dist/chunk/{3403-80772935d4409e6b0538.js → 3403-25be6d62a1e259bb29fc.js} +0 -0
  62. /package/dist/chunk/{3454-80772935d4409e6b0538.js → 3454-25be6d62a1e259bb29fc.js} +0 -0
  63. /package/dist/chunk/{3492-80772935d4409e6b0538.js → 3492-25be6d62a1e259bb29fc.js} +0 -0
  64. /package/dist/chunk/{3516-80772935d4409e6b0538.js → 3516-25be6d62a1e259bb29fc.js} +0 -0
  65. /package/dist/chunk/{3593-80772935d4409e6b0538.js → 3593-25be6d62a1e259bb29fc.js} +0 -0
  66. /package/dist/chunk/{3646-80772935d4409e6b0538.js → 3646-25be6d62a1e259bb29fc.js} +0 -0
  67. /package/dist/chunk/{3702-80772935d4409e6b0538.js → 3702-25be6d62a1e259bb29fc.js} +0 -0
  68. /package/dist/chunk/{3720-80772935d4409e6b0538.js → 3720-25be6d62a1e259bb29fc.js} +0 -0
  69. /package/dist/chunk/{3837-80772935d4409e6b0538.js → 3837-25be6d62a1e259bb29fc.js} +0 -0
  70. /package/dist/chunk/{3874-80772935d4409e6b0538.js → 3874-25be6d62a1e259bb29fc.js} +0 -0
  71. /package/dist/chunk/{3894-80772935d4409e6b0538.js → 3894-25be6d62a1e259bb29fc.js} +0 -0
  72. /package/dist/chunk/{3906-80772935d4409e6b0538.js → 3906-25be6d62a1e259bb29fc.js} +0 -0
  73. /package/dist/chunk/{3941-80772935d4409e6b0538.js → 3941-25be6d62a1e259bb29fc.js} +0 -0
  74. /package/dist/chunk/{3947-80772935d4409e6b0538.js → 3947-25be6d62a1e259bb29fc.js} +0 -0
  75. /package/dist/chunk/{3949-80772935d4409e6b0538.js → 3949-25be6d62a1e259bb29fc.js} +0 -0
  76. /package/dist/chunk/{396-80772935d4409e6b0538.js → 396-25be6d62a1e259bb29fc.js} +0 -0
  77. /package/dist/chunk/{3972-80772935d4409e6b0538.js → 3972-25be6d62a1e259bb29fc.js} +0 -0
  78. /package/dist/chunk/{4007-80772935d4409e6b0538.js → 4007-25be6d62a1e259bb29fc.js} +0 -0
  79. /package/dist/chunk/{4009-80772935d4409e6b0538.js → 4009-25be6d62a1e259bb29fc.js} +0 -0
  80. /package/dist/chunk/{402-80772935d4409e6b0538.js → 402-25be6d62a1e259bb29fc.js} +0 -0
  81. /package/dist/chunk/{4081-80772935d4409e6b0538.js → 4081-25be6d62a1e259bb29fc.js} +0 -0
  82. /package/dist/chunk/{41-80772935d4409e6b0538.js → 41-25be6d62a1e259bb29fc.js} +0 -0
  83. /package/dist/chunk/{4108-80772935d4409e6b0538.js → 4108-25be6d62a1e259bb29fc.js} +0 -0
  84. /package/dist/chunk/{4112-80772935d4409e6b0538.js → 4112-25be6d62a1e259bb29fc.js} +0 -0
  85. /package/dist/chunk/{415-80772935d4409e6b0538.js → 415-25be6d62a1e259bb29fc.js} +0 -0
  86. /package/dist/chunk/{4199-80772935d4409e6b0538.js → 4199-25be6d62a1e259bb29fc.js} +0 -0
  87. /package/dist/chunk/{4214-80772935d4409e6b0538.js → 4214-25be6d62a1e259bb29fc.js} +0 -0
  88. /package/dist/chunk/{4236-80772935d4409e6b0538.js → 4236-25be6d62a1e259bb29fc.js} +0 -0
  89. /package/dist/chunk/{4283-80772935d4409e6b0538.js → 4283-25be6d62a1e259bb29fc.js} +0 -0
  90. /package/dist/chunk/{4292-80772935d4409e6b0538.js → 4292-25be6d62a1e259bb29fc.js} +0 -0
  91. /package/dist/chunk/{4311-80772935d4409e6b0538.js → 4311-25be6d62a1e259bb29fc.js} +0 -0
  92. /package/dist/chunk/{4354-80772935d4409e6b0538.js → 4354-25be6d62a1e259bb29fc.js} +0 -0
  93. /package/dist/chunk/{4385-80772935d4409e6b0538.js → 4385-25be6d62a1e259bb29fc.js} +0 -0
  94. /package/dist/chunk/{4408-80772935d4409e6b0538.js → 4408-25be6d62a1e259bb29fc.js} +0 -0
  95. /package/dist/chunk/{4445-80772935d4409e6b0538.js → 4445-25be6d62a1e259bb29fc.js} +0 -0
  96. /package/dist/chunk/{4451-80772935d4409e6b0538.js → 4451-25be6d62a1e259bb29fc.js} +0 -0
  97. /package/dist/chunk/{4452-80772935d4409e6b0538.js → 4452-25be6d62a1e259bb29fc.js} +0 -0
  98. /package/dist/chunk/{4465-80772935d4409e6b0538.js → 4465-25be6d62a1e259bb29fc.js} +0 -0
  99. /package/dist/chunk/{4520-80772935d4409e6b0538.js → 4520-25be6d62a1e259bb29fc.js} +0 -0
  100. /package/dist/chunk/{454-80772935d4409e6b0538.js → 454-25be6d62a1e259bb29fc.js} +0 -0
  101. /package/dist/chunk/{4546-80772935d4409e6b0538.js → 4546-25be6d62a1e259bb29fc.js} +0 -0
  102. /package/dist/chunk/{4552-80772935d4409e6b0538.js → 4552-25be6d62a1e259bb29fc.js} +0 -0
  103. /package/dist/chunk/{4598-80772935d4409e6b0538.js → 4598-25be6d62a1e259bb29fc.js} +0 -0
  104. /package/dist/chunk/{4614-80772935d4409e6b0538.js → 4614-25be6d62a1e259bb29fc.js} +0 -0
  105. /package/dist/chunk/{4660-80772935d4409e6b0538.js → 4660-25be6d62a1e259bb29fc.js} +0 -0
  106. /package/dist/chunk/{4697-80772935d4409e6b0538.js → 4697-25be6d62a1e259bb29fc.js} +0 -0
  107. /package/dist/chunk/{4709-80772935d4409e6b0538.js → 4709-25be6d62a1e259bb29fc.js} +0 -0
  108. /package/dist/chunk/{4714-80772935d4409e6b0538.js → 4714-25be6d62a1e259bb29fc.js} +0 -0
  109. /package/dist/chunk/{4780-80772935d4409e6b0538.js → 4780-25be6d62a1e259bb29fc.js} +0 -0
  110. /package/dist/chunk/{4838-80772935d4409e6b0538.js → 4838-25be6d62a1e259bb29fc.js} +0 -0
  111. /package/dist/chunk/{4843-80772935d4409e6b0538.js → 4843-25be6d62a1e259bb29fc.js} +0 -0
  112. /package/dist/chunk/{4862-80772935d4409e6b0538.js → 4862-25be6d62a1e259bb29fc.js} +0 -0
  113. /package/dist/chunk/{4877-80772935d4409e6b0538.js → 4877-25be6d62a1e259bb29fc.js} +0 -0
  114. /package/dist/chunk/{4886-80772935d4409e6b0538.js → 4886-25be6d62a1e259bb29fc.js} +0 -0
  115. /package/dist/chunk/{489-80772935d4409e6b0538.js → 489-25be6d62a1e259bb29fc.js} +0 -0
  116. /package/dist/chunk/{4914-80772935d4409e6b0538.js → 4914-25be6d62a1e259bb29fc.js} +0 -0
  117. /package/dist/chunk/{4940-80772935d4409e6b0538.js → 4940-25be6d62a1e259bb29fc.js} +0 -0
  118. /package/dist/chunk/{4962-80772935d4409e6b0538.js → 4962-25be6d62a1e259bb29fc.js} +0 -0
  119. /package/dist/chunk/{5026-80772935d4409e6b0538.js → 5026-25be6d62a1e259bb29fc.js} +0 -0
  120. /package/dist/chunk/{5034-80772935d4409e6b0538.js → 5034-25be6d62a1e259bb29fc.js} +0 -0
  121. /package/dist/chunk/{5050-80772935d4409e6b0538.js → 5050-25be6d62a1e259bb29fc.js} +0 -0
  122. /package/dist/chunk/{5099-80772935d4409e6b0538.js → 5099-25be6d62a1e259bb29fc.js} +0 -0
  123. /package/dist/chunk/{5119-80772935d4409e6b0538.js → 5119-25be6d62a1e259bb29fc.js} +0 -0
  124. /package/dist/chunk/{5141-80772935d4409e6b0538.js → 5141-25be6d62a1e259bb29fc.js} +0 -0
  125. /package/dist/chunk/{5143-80772935d4409e6b0538.js → 5143-25be6d62a1e259bb29fc.js} +0 -0
  126. /package/dist/chunk/{5177-80772935d4409e6b0538.js → 5177-25be6d62a1e259bb29fc.js} +0 -0
  127. /package/dist/chunk/{5203-80772935d4409e6b0538.js → 5203-25be6d62a1e259bb29fc.js} +0 -0
  128. /package/dist/chunk/{5283-80772935d4409e6b0538.js → 5283-25be6d62a1e259bb29fc.js} +0 -0
  129. /package/dist/chunk/{5314-80772935d4409e6b0538.js → 5314-25be6d62a1e259bb29fc.js} +0 -0
  130. /package/dist/chunk/{535-80772935d4409e6b0538.js → 535-25be6d62a1e259bb29fc.js} +0 -0
  131. /package/dist/chunk/{5363-80772935d4409e6b0538.js → 5363-25be6d62a1e259bb29fc.js} +0 -0
  132. /package/dist/chunk/{542-80772935d4409e6b0538.js → 542-25be6d62a1e259bb29fc.js} +0 -0
  133. /package/dist/chunk/{5424-80772935d4409e6b0538.js → 5424-25be6d62a1e259bb29fc.js} +0 -0
  134. /package/dist/chunk/{5443-80772935d4409e6b0538.js → 5443-25be6d62a1e259bb29fc.js} +0 -0
  135. /package/dist/chunk/{5521-80772935d4409e6b0538.js → 5521-25be6d62a1e259bb29fc.js} +0 -0
  136. /package/dist/chunk/{5536-80772935d4409e6b0538.js → 5536-25be6d62a1e259bb29fc.js} +0 -0
  137. /package/dist/chunk/{5542-80772935d4409e6b0538.js → 5542-25be6d62a1e259bb29fc.js} +0 -0
  138. /package/dist/chunk/{5585-80772935d4409e6b0538.js → 5585-25be6d62a1e259bb29fc.js} +0 -0
  139. /package/dist/chunk/{5589-80772935d4409e6b0538.js → 5589-25be6d62a1e259bb29fc.js} +0 -0
  140. /package/dist/chunk/{5601-80772935d4409e6b0538.js → 5601-25be6d62a1e259bb29fc.js} +0 -0
  141. /package/dist/chunk/{5611-80772935d4409e6b0538.js → 5611-25be6d62a1e259bb29fc.js} +0 -0
  142. /package/dist/chunk/{5628-80772935d4409e6b0538.js → 5628-25be6d62a1e259bb29fc.js} +0 -0
  143. /package/dist/chunk/{5638-80772935d4409e6b0538.js → 5638-25be6d62a1e259bb29fc.js} +0 -0
  144. /package/dist/chunk/{5647-80772935d4409e6b0538.js → 5647-25be6d62a1e259bb29fc.js} +0 -0
  145. /package/dist/chunk/{5709-80772935d4409e6b0538.js → 5709-25be6d62a1e259bb29fc.js} +0 -0
  146. /package/dist/chunk/{5728-80772935d4409e6b0538.js → 5728-25be6d62a1e259bb29fc.js} +0 -0
  147. /package/dist/chunk/{5731-80772935d4409e6b0538.js → 5731-25be6d62a1e259bb29fc.js} +0 -0
  148. /package/dist/chunk/{5744-80772935d4409e6b0538.js → 5744-25be6d62a1e259bb29fc.js} +0 -0
  149. /package/dist/chunk/{5814-80772935d4409e6b0538.js → 5814-25be6d62a1e259bb29fc.js} +0 -0
  150. /package/dist/chunk/{5827-80772935d4409e6b0538.js → 5827-25be6d62a1e259bb29fc.js} +0 -0
  151. /package/dist/chunk/{5884-80772935d4409e6b0538.js → 5884-25be6d62a1e259bb29fc.js} +0 -0
  152. /package/dist/chunk/{5891-80772935d4409e6b0538.js → 5891-25be6d62a1e259bb29fc.js} +0 -0
  153. /package/dist/chunk/{5936-80772935d4409e6b0538.js → 5936-25be6d62a1e259bb29fc.js} +0 -0
  154. /package/dist/chunk/{5954-80772935d4409e6b0538.js → 5954-25be6d62a1e259bb29fc.js} +0 -0
  155. /package/dist/chunk/{6010-80772935d4409e6b0538.js → 6010-25be6d62a1e259bb29fc.js} +0 -0
  156. /package/dist/chunk/{6045-80772935d4409e6b0538.js → 6045-25be6d62a1e259bb29fc.js} +0 -0
  157. /package/dist/chunk/{6083-80772935d4409e6b0538.js → 6083-25be6d62a1e259bb29fc.js} +0 -0
  158. /package/dist/chunk/{6124-80772935d4409e6b0538.js → 6124-25be6d62a1e259bb29fc.js} +0 -0
  159. /package/dist/chunk/{6173-80772935d4409e6b0538.js → 6173-25be6d62a1e259bb29fc.js} +0 -0
  160. /package/dist/chunk/{6239-80772935d4409e6b0538.js → 6239-25be6d62a1e259bb29fc.js} +0 -0
  161. /package/dist/chunk/{6262-80772935d4409e6b0538.js → 6262-25be6d62a1e259bb29fc.js} +0 -0
  162. /package/dist/chunk/{6283-80772935d4409e6b0538.js → 6283-25be6d62a1e259bb29fc.js} +0 -0
  163. /package/dist/chunk/{6297-80772935d4409e6b0538.js → 6297-25be6d62a1e259bb29fc.js} +0 -0
  164. /package/dist/chunk/{6324-80772935d4409e6b0538.js → 6324-25be6d62a1e259bb29fc.js} +0 -0
  165. /package/dist/chunk/{6343-80772935d4409e6b0538.js → 6343-25be6d62a1e259bb29fc.js} +0 -0
  166. /package/dist/chunk/{6356-80772935d4409e6b0538.js → 6356-25be6d62a1e259bb29fc.js} +0 -0
  167. /package/dist/chunk/{638-80772935d4409e6b0538.js → 638-25be6d62a1e259bb29fc.js} +0 -0
  168. /package/dist/chunk/{6405-80772935d4409e6b0538.js → 6405-25be6d62a1e259bb29fc.js} +0 -0
  169. /package/dist/chunk/{6514-80772935d4409e6b0538.js → 6514-25be6d62a1e259bb29fc.js} +0 -0
  170. /package/dist/chunk/{6517-80772935d4409e6b0538.js → 6517-25be6d62a1e259bb29fc.js} +0 -0
  171. /package/dist/chunk/{6563-80772935d4409e6b0538.js → 6563-25be6d62a1e259bb29fc.js} +0 -0
  172. /package/dist/chunk/{6577-80772935d4409e6b0538.js → 6577-25be6d62a1e259bb29fc.js} +0 -0
  173. /package/dist/chunk/{6677-80772935d4409e6b0538.js → 6677-25be6d62a1e259bb29fc.js} +0 -0
  174. /package/dist/chunk/{6736-80772935d4409e6b0538.js → 6736-25be6d62a1e259bb29fc.js} +0 -0
  175. /package/dist/chunk/{6757-80772935d4409e6b0538.js → 6757-25be6d62a1e259bb29fc.js} +0 -0
  176. /package/dist/chunk/{6865-80772935d4409e6b0538.js → 6865-25be6d62a1e259bb29fc.js} +0 -0
  177. /package/dist/chunk/{6940-80772935d4409e6b0538.js → 6940-25be6d62a1e259bb29fc.js} +0 -0
  178. /package/dist/chunk/{6957-80772935d4409e6b0538.js → 6957-25be6d62a1e259bb29fc.js} +0 -0
  179. /package/dist/chunk/{6964-80772935d4409e6b0538.js → 6964-25be6d62a1e259bb29fc.js} +0 -0
  180. /package/dist/chunk/{6967-80772935d4409e6b0538.js → 6967-25be6d62a1e259bb29fc.js} +0 -0
  181. /package/dist/chunk/{697-80772935d4409e6b0538.js → 697-25be6d62a1e259bb29fc.js} +0 -0
  182. /package/dist/chunk/{6980-80772935d4409e6b0538.js → 6980-25be6d62a1e259bb29fc.js} +0 -0
  183. /package/dist/chunk/{7095-80772935d4409e6b0538.js → 7095-25be6d62a1e259bb29fc.js} +0 -0
  184. /package/dist/chunk/{7141-80772935d4409e6b0538.js → 7141-25be6d62a1e259bb29fc.js} +0 -0
  185. /package/dist/chunk/{7145-80772935d4409e6b0538.js → 7145-25be6d62a1e259bb29fc.js} +0 -0
  186. /package/dist/chunk/{7148-80772935d4409e6b0538.js → 7148-25be6d62a1e259bb29fc.js} +0 -0
  187. /package/dist/chunk/{7217-80772935d4409e6b0538.js → 7217-25be6d62a1e259bb29fc.js} +0 -0
  188. /package/dist/chunk/{7258-80772935d4409e6b0538.js → 7258-25be6d62a1e259bb29fc.js} +0 -0
  189. /package/dist/chunk/{7328-80772935d4409e6b0538.js → 7328-25be6d62a1e259bb29fc.js} +0 -0
  190. /package/dist/chunk/{7374-80772935d4409e6b0538.js → 7374-25be6d62a1e259bb29fc.js} +0 -0
  191. /package/dist/chunk/{7434-80772935d4409e6b0538.js → 7434-25be6d62a1e259bb29fc.js} +0 -0
  192. /package/dist/chunk/{7470-80772935d4409e6b0538.js → 7470-25be6d62a1e259bb29fc.js} +0 -0
  193. /package/dist/chunk/{7504-80772935d4409e6b0538.js → 7504-25be6d62a1e259bb29fc.js} +0 -0
  194. /package/dist/chunk/{753-80772935d4409e6b0538.js → 753-25be6d62a1e259bb29fc.js} +0 -0
  195. /package/dist/chunk/{7549-80772935d4409e6b0538.js → 7549-25be6d62a1e259bb29fc.js} +0 -0
  196. /package/dist/chunk/{7561-80772935d4409e6b0538.js → 7561-25be6d62a1e259bb29fc.js} +0 -0
  197. /package/dist/chunk/{7567-80772935d4409e6b0538.js → 7567-25be6d62a1e259bb29fc.js} +0 -0
  198. /package/dist/chunk/{7611-80772935d4409e6b0538.js → 7611-25be6d62a1e259bb29fc.js} +0 -0
  199. /package/dist/chunk/{7615-80772935d4409e6b0538.js → 7615-25be6d62a1e259bb29fc.js} +0 -0
  200. /package/dist/chunk/{7625-80772935d4409e6b0538.js → 7625-25be6d62a1e259bb29fc.js} +0 -0
  201. /package/dist/chunk/{7642-80772935d4409e6b0538.js → 7642-25be6d62a1e259bb29fc.js} +0 -0
  202. /package/dist/chunk/{7670-80772935d4409e6b0538.js → 7670-25be6d62a1e259bb29fc.js} +0 -0
  203. /package/dist/chunk/{7681-80772935d4409e6b0538.js → 7681-25be6d62a1e259bb29fc.js} +0 -0
  204. /package/dist/chunk/{7688-80772935d4409e6b0538.js → 7688-25be6d62a1e259bb29fc.js} +0 -0
  205. /package/dist/chunk/{7765-80772935d4409e6b0538.js → 7765-25be6d62a1e259bb29fc.js} +0 -0
  206. /package/dist/chunk/{7768-80772935d4409e6b0538.js → 7768-25be6d62a1e259bb29fc.js} +0 -0
  207. /package/dist/chunk/{7788-80772935d4409e6b0538.js → 7788-25be6d62a1e259bb29fc.js} +0 -0
  208. /package/dist/chunk/{7789-80772935d4409e6b0538.js → 7789-25be6d62a1e259bb29fc.js} +0 -0
  209. /package/dist/chunk/{780-80772935d4409e6b0538.js → 780-25be6d62a1e259bb29fc.js} +0 -0
  210. /package/dist/chunk/{7817-80772935d4409e6b0538.js → 7817-25be6d62a1e259bb29fc.js} +0 -0
  211. /package/dist/chunk/{7824-80772935d4409e6b0538.js → 7824-25be6d62a1e259bb29fc.js} +0 -0
  212. /package/dist/chunk/{7831-80772935d4409e6b0538.js → 7831-25be6d62a1e259bb29fc.js} +0 -0
  213. /package/dist/chunk/{7900-80772935d4409e6b0538.js → 7900-25be6d62a1e259bb29fc.js} +0 -0
  214. /package/dist/chunk/{7922-80772935d4409e6b0538.js → 7922-25be6d62a1e259bb29fc.js} +0 -0
  215. /package/dist/chunk/{7927-80772935d4409e6b0538.js → 7927-25be6d62a1e259bb29fc.js} +0 -0
  216. /package/dist/chunk/{794-80772935d4409e6b0538.js → 794-25be6d62a1e259bb29fc.js} +0 -0
  217. /package/dist/chunk/{7966-80772935d4409e6b0538.js → 7966-25be6d62a1e259bb29fc.js} +0 -0
  218. /package/dist/chunk/{8003-80772935d4409e6b0538.js → 8003-25be6d62a1e259bb29fc.js} +0 -0
  219. /package/dist/chunk/{8093-80772935d4409e6b0538.js → 8093-25be6d62a1e259bb29fc.js} +0 -0
  220. /package/dist/chunk/{8107-80772935d4409e6b0538.js → 8107-25be6d62a1e259bb29fc.js} +0 -0
  221. /package/dist/chunk/{8201-80772935d4409e6b0538.js → 8201-25be6d62a1e259bb29fc.js} +0 -0
  222. /package/dist/chunk/{8212-80772935d4409e6b0538.js → 8212-25be6d62a1e259bb29fc.js} +0 -0
  223. /package/dist/chunk/{8234-80772935d4409e6b0538.js → 8234-25be6d62a1e259bb29fc.js} +0 -0
  224. /package/dist/chunk/{8235-80772935d4409e6b0538.js → 8235-25be6d62a1e259bb29fc.js} +0 -0
  225. /package/dist/chunk/{8237-80772935d4409e6b0538.js → 8237-25be6d62a1e259bb29fc.js} +0 -0
  226. /package/dist/chunk/{8249-80772935d4409e6b0538.js → 8249-25be6d62a1e259bb29fc.js} +0 -0
  227. /package/dist/chunk/{8320-80772935d4409e6b0538.js → 8320-25be6d62a1e259bb29fc.js} +0 -0
  228. /package/dist/chunk/{8389-80772935d4409e6b0538.js → 8389-25be6d62a1e259bb29fc.js} +0 -0
  229. /package/dist/chunk/{8393-80772935d4409e6b0538.js → 8393-25be6d62a1e259bb29fc.js} +0 -0
  230. /package/dist/chunk/{8418-80772935d4409e6b0538.js → 8418-25be6d62a1e259bb29fc.js} +0 -0
  231. /package/dist/chunk/{8426-80772935d4409e6b0538.js → 8426-25be6d62a1e259bb29fc.js} +0 -0
  232. /package/dist/chunk/{8436-80772935d4409e6b0538.js → 8436-25be6d62a1e259bb29fc.js} +0 -0
  233. /package/dist/chunk/{845-80772935d4409e6b0538.js → 845-25be6d62a1e259bb29fc.js} +0 -0
  234. /package/dist/chunk/{8485-80772935d4409e6b0538.js → 8485-25be6d62a1e259bb29fc.js} +0 -0
  235. /package/dist/chunk/{8499-80772935d4409e6b0538.js → 8499-25be6d62a1e259bb29fc.js} +0 -0
  236. /package/dist/chunk/{8553-80772935d4409e6b0538.js → 8553-25be6d62a1e259bb29fc.js} +0 -0
  237. /package/dist/chunk/{8617-80772935d4409e6b0538.js → 8617-25be6d62a1e259bb29fc.js} +0 -0
  238. /package/dist/chunk/{8684-80772935d4409e6b0538.js → 8684-25be6d62a1e259bb29fc.js} +0 -0
  239. /package/dist/chunk/{8700-80772935d4409e6b0538.js → 8700-25be6d62a1e259bb29fc.js} +0 -0
  240. /package/dist/chunk/{8709-80772935d4409e6b0538.js → 8709-25be6d62a1e259bb29fc.js} +0 -0
  241. /package/dist/chunk/{8711-80772935d4409e6b0538.js → 8711-25be6d62a1e259bb29fc.js} +0 -0
  242. /package/dist/chunk/{874-80772935d4409e6b0538.js → 874-25be6d62a1e259bb29fc.js} +0 -0
  243. /package/dist/chunk/{8753-80772935d4409e6b0538.js → 8753-25be6d62a1e259bb29fc.js} +0 -0
  244. /package/dist/chunk/{8849-80772935d4409e6b0538.js → 8849-25be6d62a1e259bb29fc.js} +0 -0
  245. /package/dist/chunk/{8931-80772935d4409e6b0538.js → 8931-25be6d62a1e259bb29fc.js} +0 -0
  246. /package/dist/chunk/{9017-80772935d4409e6b0538.js → 9017-25be6d62a1e259bb29fc.js} +0 -0
  247. /package/dist/chunk/{9045-80772935d4409e6b0538.js → 9045-25be6d62a1e259bb29fc.js} +0 -0
  248. /package/dist/chunk/{9057-80772935d4409e6b0538.js → 9057-25be6d62a1e259bb29fc.js} +0 -0
  249. /package/dist/chunk/{9077-80772935d4409e6b0538.js → 9077-25be6d62a1e259bb29fc.js} +0 -0
  250. /package/dist/chunk/{9079-80772935d4409e6b0538.js → 9079-25be6d62a1e259bb29fc.js} +0 -0
  251. /package/dist/chunk/{9096-80772935d4409e6b0538.js → 9096-25be6d62a1e259bb29fc.js} +0 -0
  252. /package/dist/chunk/{9104-80772935d4409e6b0538.js → 9104-25be6d62a1e259bb29fc.js} +0 -0
  253. /package/dist/chunk/{914-80772935d4409e6b0538.js → 914-25be6d62a1e259bb29fc.js} +0 -0
  254. /package/dist/chunk/{9175-80772935d4409e6b0538.js → 9175-25be6d62a1e259bb29fc.js} +0 -0
  255. /package/dist/chunk/{9179-80772935d4409e6b0538.js → 9179-25be6d62a1e259bb29fc.js} +0 -0
  256. /package/dist/chunk/{9198-80772935d4409e6b0538.js → 9198-25be6d62a1e259bb29fc.js} +0 -0
  257. /package/dist/chunk/{9206-80772935d4409e6b0538.js → 9206-25be6d62a1e259bb29fc.js} +0 -0
  258. /package/dist/chunk/{9225-80772935d4409e6b0538.js → 9225-25be6d62a1e259bb29fc.js} +0 -0
  259. /package/dist/chunk/{9270-80772935d4409e6b0538.js → 9270-25be6d62a1e259bb29fc.js} +0 -0
  260. /package/dist/chunk/{9281-80772935d4409e6b0538.js → 9281-25be6d62a1e259bb29fc.js} +0 -0
  261. /package/dist/chunk/{9294-80772935d4409e6b0538.js → 9294-25be6d62a1e259bb29fc.js} +0 -0
  262. /package/dist/chunk/{9478-80772935d4409e6b0538.js → 9478-25be6d62a1e259bb29fc.js} +0 -0
  263. /package/dist/chunk/{9524-80772935d4409e6b0538.js → 9524-25be6d62a1e259bb29fc.js} +0 -0
  264. /package/dist/chunk/{9526-80772935d4409e6b0538.js → 9526-25be6d62a1e259bb29fc.js} +0 -0
  265. /package/dist/chunk/{9556-80772935d4409e6b0538.js → 9556-25be6d62a1e259bb29fc.js} +0 -0
  266. /package/dist/chunk/{9641-80772935d4409e6b0538.js → 9641-25be6d62a1e259bb29fc.js} +0 -0
  267. /package/dist/chunk/{9661-80772935d4409e6b0538.js → 9661-25be6d62a1e259bb29fc.js} +0 -0
  268. /package/dist/chunk/{9681-80772935d4409e6b0538.js → 9681-25be6d62a1e259bb29fc.js} +0 -0
  269. /package/dist/chunk/{9689-80772935d4409e6b0538.js → 9689-25be6d62a1e259bb29fc.js} +0 -0
  270. /package/dist/chunk/{9692-80772935d4409e6b0538.js → 9692-25be6d62a1e259bb29fc.js} +0 -0
  271. /package/dist/chunk/{9728-80772935d4409e6b0538.js → 9728-25be6d62a1e259bb29fc.js} +0 -0
  272. /package/dist/chunk/{9730-80772935d4409e6b0538.js → 9730-25be6d62a1e259bb29fc.js} +0 -0
  273. /package/dist/chunk/{9780-80772935d4409e6b0538.js → 9780-25be6d62a1e259bb29fc.js} +0 -0
  274. /package/dist/chunk/{9788-80772935d4409e6b0538.js → 9788-25be6d62a1e259bb29fc.js} +0 -0
  275. /package/dist/chunk/{9806-80772935d4409e6b0538.js → 9806-25be6d62a1e259bb29fc.js} +0 -0
  276. /package/dist/chunk/{9809-80772935d4409e6b0538.js → 9809-25be6d62a1e259bb29fc.js} +0 -0
  277. /package/dist/chunk/{9819-80772935d4409e6b0538.js → 9819-25be6d62a1e259bb29fc.js} +0 -0
  278. /package/dist/chunk/{9831-80772935d4409e6b0538.js → 9831-25be6d62a1e259bb29fc.js} +0 -0
  279. /package/dist/chunk/{9845-80772935d4409e6b0538.js → 9845-25be6d62a1e259bb29fc.js} +0 -0
  280. /package/dist/chunk/{9876-80772935d4409e6b0538.js → 9876-25be6d62a1e259bb29fc.js} +0 -0
  281. /package/dist/chunk/{9904-80772935d4409e6b0538.js → 9904-25be6d62a1e259bb29fc.js} +0 -0
  282. /package/dist/chunk/{9910-80772935d4409e6b0538.js → 9910-25be6d62a1e259bb29fc.js} +0 -0
  283. /package/dist/chunk/{9965-80772935d4409e6b0538.js → 9965-25be6d62a1e259bb29fc.js} +0 -0
  284. /package/dist/chunk/{9976-80772935d4409e6b0538.js → 9976-25be6d62a1e259bb29fc.js} +0 -0
  285. /package/dist/chunk/{9982-80772935d4409e6b0538.js → 9982-25be6d62a1e259bb29fc.js} +0 -0
  286. /package/dist/chunk/{9983-80772935d4409e6b0538.js → 9983-25be6d62a1e259bb29fc.js} +0 -0
  287. /package/dist/chunk/{9984-80772935d4409e6b0538.js → 9984-25be6d62a1e259bb29fc.js} +0 -0
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepsky=t():e.deepsky=t()}(self,()=>(()=>{var e,t,n={1858:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ArrayTools:()=>u,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>m,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>v,MathPoint:()=>b,MathPolygon:()=>y,MathRect:()=>g,Notice:()=>s,_RectPosition:()=>o});var n,i,r,o=function(e){return e.left_mid="left-mid",e.left_top="left-top",e.left_bottom="left-bottom",e.top_mid="top-mid",e.bottom_mid="bottom-mid",e.right_top="right-top",e.right_mid="right-mid",e.right_bottom="right_bottom",e.center="center",e}({});class s{static rope(e,t){return(...n)=>{let i=Symbol();return this.scope[e]=i,t(()=>i===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...i){n||(n=setTimeout(()=>{e(...i),n=void 0},t))}}static debounce(e,t=100){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}}r={},(i="scope")in(n=s)?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r;class a{static*zip(...e){const t=Math.min(...e.map(e=>e.length));for(let n=0;n<t;n++)yield e.map(e=>e[n])}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{static get_month_name(e){let t;return t=e||new Date,this.month_names[t.getMonth()]}static get_week_name(e){let t;return t=e||new Date,this.weeks_names[t.getDay()]}static get_date_string(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}static get_week_string(e){let t;t=e||new Date;const n=t.getDate(),i=t.getDay(),r=new Date(t.getFullYear(),t.getMonth(),n-i),o=new Date(t.getFullYear(),t.getMonth(),n+(6-i));return`${this.get_date_string(r)}:${this.get_date_string(o)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const i=n.getFullYear(),r=n.getMonth(),o=n.getDate(),s=n.getDay(),a=new Date(i,r,o-s),l=a.getFullYear(),c=a.getMonth(),d=a.getDate();t.push(a);for(let e=1;e<=6;e++)t.push(new Date(l,c,d+e));return t}}l(c,"month_names",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),l(c,"weeks_names",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);class d{static scroll_element(e,t,n="vertical"){let i=t;const r=()=>{if(Math.abs(i)>2){let t=i/10;i-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(r)}"vertical"===n?e.scrollTop+=i:e.scrollLeft+=i};r()}}class u{static swap(e,t,n){const i=e[t],r=e[n];e[t]=r,e[n]=i}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p{init(){const e=this.order,t=new Set;this.order=[];for(let e=0;e<this.container.children.length;e++){const n=this.container.children[e],i=n.getAttribute(this.attr);i&&n instanceof HTMLElement&&(n.setAttribute("draggable","true"),n.style.position="absolute","horizental"===this.dir?n.style.left="0px":n.style.top="0px",this.order_origin.push(i),t.add(i),this.map.has(i)||this.register(n),this.map.set(i,n))}const n=this.init_container();this.container.addEventListener("dragenter",e=>{e.preventDefault()}),this.container.addEventListener("dragover",e=>{e.preventDefault()});for(let n of e)t.has(n)?(this.order.push(n),t.delete(n)):this.map.delete(n);for(let e of t)this.order.push(e);return this.sort(),n}sort(){for(let e=0;e<this.order.length;e++){const t=this.order[e],n=this.map.get(t);if(!n)continue;const i=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${i}px)`:n.style.transform=`translateY(${i}px)`}for(let e of this.callback)e([...this.order])}init_container(){let e=0;for(const[t,n]of this.map)"horizental"===this.dir?e+=n.getBoundingClientRect().width/this.scale_h:e+=n.getBoundingClientRect().height/this.scale_v;return"horizental"===this.dir?this.container.style.width=e+"px":this.container.style.height=e+"px",e}sum_translate(e){let t=0;for(let n of e){const e=this.map.get(n);e&&("horizental"===this.dir?t+=e.getBoundingClientRect().width/this.scale_h:t+=e.getBoundingClientRect().height/this.scale_v)}return t}register(e){this._func_start=this.on_dragstart.bind(this),this._func_over=this.on_dragover.bind(this),this._func_enter=this.on_dragenter.bind(this),this._func_end=this.on_dragend.bind(this),e.addEventListener("dragstart",this._func_start,{capture:!0}),e.addEventListener("dragover",this._func_over,{capture:!0}),e.addEventListener("dragenter",this._func_enter,{capture:!0}),e.addEventListener("dragend",this._func_end,{capture:!0}),this.realtime||e.addEventListener("drop",this.on_drop.bind(this),{capture:!0})}on_dragstart(e){e.stopPropagation();const t=e.currentTarget;if(t instanceof HTMLElement&&(this.drag_id=t.getAttribute(this.attr),this.drag_id))for(let t of this.callback_start)t(e,this.drag_id);this.container.style.setProperty(this.css_var_point_events,"none")}on_dragenter(e){if(e.stopPropagation(),e.preventDefault(),!this.realtime)return;const t=e.currentTarget;if(e.target!==t)return;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),o=this.order.indexOf(i);r<0||o<0||("swap"===this.effect?u.swap(this.order,r,o):(this.order.splice(o,1),this.order.splice(r,0,i)),this.init_container(),this.sort())}on_dragover(e){e.preventDefault(),e.stopPropagation()}on_drop(e){e.stopPropagation();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),o=this.order.indexOf(i);r<0||o<0||("swap"===this.effect?u.swap(this.order,r,o):(this.order.splice(o,1),this.order.splice(r,0,i)),this.sort())}on_dragend(e){this.container.style.setProperty(this.css_var_point_events,"auto");for(let t of this.callback_end)t(e)}register_start(e){this.callback_start.add(e)}register_dropend(e){this.callback_end.add(e)}register_callback(e){this.callback.add(e)}off_callback(e){this.callback.delete(e)}off_callback_start(e){this.callback_start.delete(e)}off_callback_drop(e){this.callback_end.delete(e)}constructor(e,t,n,i,r=!0){h(this,"container",void 0),h(this,"drag_id",void 0),h(this,"dir","vertical"),h(this,"effect",void 0),h(this,"attr",void 0),h(this,"realtime",!0),h(this,"order_origin",[]),h(this,"order",[]),h(this,"css_var_point_events","--drag-item-point-event"),h(this,"map",new Map),h(this,"callback",new Set),h(this,"callback_start",new Set),h(this,"callback_end",new Set),h(this,"scale_h",1),h(this,"scale_v",1),h(this,"_func_start",void 0),h(this,"_func_over",void 0),h(this,"_func_enter",void 0),h(this,"_func_end",void 0),h(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=r,this.effect=i,e.style.position="relative"}}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class m{get el(){return this._el}init(){this._handler_down=e=>this._pointdown(e),this._handler_move=e=>this._pointmove(e),this._handler_up=e=>this._pointup(e),this._handler_cancel=e=>this._pointercancel(e),this.el.addEventListener("pointerdown",this._handler_down),document.documentElement.addEventListener("pointermove",this._handler_move),document.documentElement.addEventListener("pointerup",this._handler_up),document.documentElement.addEventListener("pointercancel",this._handler_cancel)}_pointdown(e){e.stopPropagation(),e.preventDefault();const t=e.target;this.el.contains(t)&&(this._is_down=!0,this._down_point={x:e.clientX,y:e.clientY},this._func_down&&this._func_down())}_pointmove(e){if(!this._is_down||!this._down_point||e.buttons<=0)return;e.stopPropagation(),e.preventDefault(),this._is_move=!0;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._func_move&&this._func_move(t,n)}_pointup(e){if(e.preventDefault(),e.stopPropagation(),!this._is_down||!this._is_move)return;if(this._is_down=!1,this._is_move=!1,!this._down_point)return;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._down_point=void 0,this._func_up&&this._func_up(t,n)}_pointercancel(e){this._is_down&&this._is_move&&(this._is_down=!1,this._is_move=!1,this._down_point=void 0,this._func_cancel&&this._func_cancel())}off(){this.el.removeEventListener("pointerdown",this._handler_down),document.documentElement.removeEventListener("pointermove",this._handler_move),document.documentElement.removeEventListener("pointerup",this._handler_up),document.documentElement.removeEventListener("pointercancel",this._handler_cancel)}register_down(e){this._func_down=e}register_move(e){this._func_move=e}register_up(e){this._func_up=e}register_cancel(e){this._func_cancel=e}constructor(e){f(this,"_el",void 0),f(this,"_handler_down",void 0),f(this,"_handler_move",void 0),f(this,"_handler_up",void 0),f(this,"_handler_cancel",void 0),f(this,"_func_down",void 0),f(this,"_func_move",void 0),f(this,"_func_up",void 0),f(this,"_func_cancel",void 0),f(this,"_is_down",!1),f(this,"_is_move",!1),f(this,"_down_point",void 0),this._el=e,this.init()}}class _{static sum(e){let t=0;for(let n of e)t+=n;return t}}class g{static get_rect_point(e,t){const{x:n,y:i,width:r,height:s}=e,a=i+s,l=n+r,c=n+r/2,d=i+s/2;if(t===o.left_bottom)return{x:n,y:a};if(t===o.left_top)return{x:n,y:i};if(t===o.left_mid)return{x:n,y:d};if(t===o.right_top)return{x:l,y:i};if(t===o.right_mid)return{x:l,y:d};if(t===o.right_bottom)return{x:l,y:a};if(t===o.bottom_mid)return{x:c,y:a};if(t===o.top_mid)return{x:c,y:i};if(t===o.center)return{x:c,y:d};throw Error("MathRect: the position keyword is invalid")}static is_point_in_rect(e,t,n=!0){const i=e.x===t.x||e.x===t.x+t.width,r=e.y===t.y||e.y===t.y+t.height,o=e.x>t.x&&e.x<t.x+t.width,s=e.y>t.y&&e.y<t.y+t.height;return n?(o||i)&&(s||r):o&&s}static get_point_in_rects(e,t,n=!0){const i=[];for(let r of t)this.is_point_in_rect(e,r,n)&&i.push(r);return i}static get_point_center(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}static move_rect_to_other(e,t,n,i=5){const r={width:e.width,height:Math.abs(e.y-n.y)},o={width:e.width,height:Math.abs(e.height-(n.y+n.height))},s={width:Math.abs(n.x-e.x),height:e.height},a={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(g.can_include_size(o,t)){const r=t.width+n.x-e.width,o=n.y+n.height+i;return{x:r<0?n.x:n.x-r,y:o}}if(g.can_include_size(r,t)){const r=t.width+n.x-e.width,o=n.y-t.height-i;return{x:r<0?n.x:n.x-r,y:o}}if(g.can_include_size(s,t)){const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}if(g.can_include_size(a,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}if(g.can_include_size(e,t)){const i=e.y+e.height-t.height;let r=n.x;return a.width>=t.width?r=n.x+n.width:s.width>=t.width&&(r=n.x-t.width),{x:r,y:i}}return{x:n.x,y:0}}static move_rect_in_other(e,t){if(g.is_include(t,e))return{dx:0,dy:0};let n=0,i=0;return e.x<t.x?n=t.x-e.x:e.x+e.width>t.x+t.width&&(n=t.x+t.width-(e.x+e.width)),e.y<t.y?i=t.y-e.y:e.y+e.height>t.y+t.height&&(i=t.y+t.height-(e.y+e.height)),{dx:n,dy:i}}static can_include_size(e,t){return t.width<=e.width&&t.height<=e.height}static is_include(e,t){return!(!this.can_include_size(e,t)||t.x<e.x||t.x>e.x+e.width-t.width||t.y<e.y||t.y>e.y+e.height-t.height)}static check_intersection(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),o=Math.abs(n.y-i.y);return r<=(e.width+t.width)/2&&o<=(e.height+t.height)/2}static limit_point_in_rect(e,t){const n=t.x,i=t.y,r=t.x+t.width,o=t.y+t.height;let s=e.x,a=e.y;return s<n&&(s=n),s>r&&(s=r),a<i&&(a=i),a>o&&(a=o),{x:s,y:a}}static point_distance_with_rect(e,t){if(this.is_point_in_rect(e,t,!0))return 0;const n=t.x+t.width/2,i=t.y+t.height/2,r=t.width/2,o=t.height/2,s=Math.abs(n-e.x),a=Math.abs(i-e.y);return s<=r&&a>o?a-o:a<=o&&s>r?s-r:Math.sqrt(Math.pow(s-r,2)+Math.pow(a-o,2))}static distance_with(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),o=Math.abs(n.y-i.y),s=(e.width+t.width)/2,a=(e.height+t.height)/2;if(r<=s&&o<=a)return 0;if(r>s&&o<=a)return r-s;if(r<=s&&o>a)return o-a;{let e=Math.pow(r-s,2),t=Math.pow(o-a,2);return Math.sqrt(e+t)}}static get_nearest_rect(e,t){if(0===t.length)return;let n,i=Number.POSITIVE_INFINITY;for(let r of t){let t=this.point_distance_with_rect(e,r);t<i&&(i=t,n=r)}return n}static get_shadow_point_horizental(e,t){let n=t.x,i=t.y+t.height/2;return n=e.x<=t.x?t.x:e.x>=t.x+t.width?t.x+t.width:e.x,{x:n,y:i}}static merge(...e){const t=e[0];let n=t.x,i=t.x+t.width,r=t.y,o=t.y+t.height;for(let t of e.slice(1)){const{x:e,y:s,width:a,height:l}=t;e<n&&(n=e),e+a>i&&(i=e+a),s<r&&(r=s),s+l>o&&(o=s+l)}return{x:n,y:r,width:i-n,height:o-r}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t,n=100){const i=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:i/r}static distance(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:o}=t;for(let t of e){let e=Math.pow(r-t.x,2)+Math.pow(o-t.y,2);e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let o=0;o<e.length;o++){const s=e[o];for(let e=0;e<t.length;e++){const o=t[e],a=s.x-o.x,l=s.y-o.y,c=a*a+l*l;c<n&&(n=c,i=s,r=o)}}return{from:i,to:r}}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(b,"path",document.createElementNS("http://www.w3.org/2000/svg","path"));class y{static polygon_center(e){let t=0,n=0,i=0;const r=e.length;for(let o=0;o<r;o++){const{x:s,y:a}=e[o],{x:l,y:c}=e[(o+1)%r],d=s*c-l*a;i+=d,t+=(s+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:o}=e[i],{x:s,y:a}=e[(i+1)%n];t+=r*a-s*o}return t/2}}class v{static check_intersection(e,t){const{from:n,to:i}=e,{from:r,to:o}=t;let s,a;if(s=n.x===i.x?Number.POSITIVE_INFINITY:(i.y-n.y)/(i.x-n.x),a=r.x===o.x?Number.POSITIVE_INFINITY:(o.y-r.y)/(o.x-r.x),s===a)return!1;const l=Math.min(n.x,i.x),c=Math.max(n.x,i.x),d=Math.min(n.y,i.y),u=Math.max(n.y,i.y),h=Math.min(r.x,o.x),p=Math.max(r.x,o.x),f=Math.min(r.y,o.y),m=Math.max(r.y,o.y);if(s===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-r.x)+r.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}if(a===Number.POSITIVE_INFINITY){const e=r.x,t=(i.y-n.y)/(i.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}{const e=(r.y-n.y+s*n.x-a*r.x)/(s-a),t=s*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=f&&t<=m}}}return t})(),e.exports=t()},6960:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return n[e](o,o.exports,r),o.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"chunk/"+e+"-"+r.h()+".js",r.miniCssF=e=>{},r.h=()=>"80772935d4409e6b0538",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",r.l=(n,i,o,s)=>{if(e[n])e[n].push(i);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+o){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+o),a.src=n),e[n]=[i];var h=(t,i)=>{a.onerror=a.onload=null,clearTimeout(p);var r=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(i)),t)return t(i)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={3057:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var o=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=o);var s=r.p+r.u(t),a=new Error;r.l(s,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var o=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+s+")",a.name="ChunkLoadError",a.type=o,a.request=s,i[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,o,[s,a,l]=n,c=0;if(s.some(t=>0!==e[t])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(l)l(r)}for(t&&t(n);c<s.length;c++)o=s[c],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunkdeepsky=self.webpackChunkdeepsky||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o={};return(()=>{"use strict";r.r(o),r.d(o,{BoundBox:()=>iu,CodeLanguageMap:()=>k_,CommandApi:()=>fu,CommandBoxFolder:()=>Fc,CommandBoxRoot:()=>el,CommandCode:()=>Fu,CommandCube:()=>Lo,CommandCursor:()=>Eo,CommandDetailList:()=>_u,CommandFomula:()=>Tw,CommandLinker:()=>pd,CommandListOrdered:()=>Lu,CommandMap:()=>qo,CommandNode:()=>jo,CommandRt:()=>ix,CommandTable:()=>Nw,CommandText:()=>il,CommandTextLink:()=>$a,CommandTodo:()=>xu,CubeAnnotation:()=>Ba,CubeApi:()=>pu,CubeBase:()=>Fo,CubeBox:()=>Ec,CubeBoxColumns:()=>nx,CubeBoxFolder:()=>qc,CubeBoxRoot:()=>Za,CubeChild:()=>cs,CubeCode:()=>M_,CubeDetailList:()=>wu,CubeDoc:()=>Ac,CubeFomula:()=>Pw,CubeHandler:()=>$o,CubeImg:()=>ka,CubeLine:()=>Pc,CubeLinker:()=>Gd,CubeList:()=>Ru,CubeListOrdered:()=>qu,CubeLost:()=>Aa,CubeMap:()=>su,CubeNode:()=>tu,CubePostil:()=>nl,CubeRoot:()=>ls,CubeRt:()=>ax,CubeSubMap:()=>$d,CubeTable:()=>Uw,CubeText:()=>ol,CubeTextLink:()=>Ga,CubeTip:()=>Jw,CubeTodo:()=>Au,LayoutChecker:()=>Wd,LinkerLine:()=>ud,LinkerPoint:()=>hd,MapBase:()=>ds,MapInteraction:()=>Cd,MapNodeBase:()=>hs,MapTools:()=>So,Matrix2D:()=>ko,NodeObserver:()=>Vd,NodeShape:()=>ru,NoteApi:()=>Mo,NoteBase:()=>Co,NoteClipBoard:()=>ts,NoteConfig:()=>ns,NoteCourier:()=>rs,NoteCubes:()=>Wo,NoteCursor:()=>is,NoteEvent:()=>Zo,NoteHistory:()=>Oo,NoteHotkeys:()=>Jo,NoteListener:()=>Uo,NoteManager:()=>Ao,NotePainter:()=>es,NotePlayer:()=>No,NoteScope:()=>Vo,NoteStats:()=>Qo,NoteTools:()=>To,Recorder:()=>Ro,Waiter:()=>Po,_ApiCommandNames:()=>p,_CodeCommandNames:()=>g,_CubeCommandName:()=>i,_CursorCommandName:()=>s,_DetaiListCommandName:()=>f,_DocCommandName:()=>d,_FomulaCommandNames:()=>v,_FomulaSize:()=>y,_HotKeys:()=>A,_HotKeysGroup:()=>T,_Keys:()=>N,_LinkerAnchor:()=>x,_LinkerCommandNames:()=>k,_ListCommandNames:()=>m,_ListOrderedCommandNames:()=>_,_MapCommandName:()=>a,_MapGroup:()=>u,_NavigationKey:()=>P,_NodeCommandName:()=>l,_NoteCores:()=>t,_NoteCubeTypes:()=>n,_NoteEvents:()=>M,_NoteMode:()=>z,_PlayStatus:()=>C,_RtCommandNames:()=>S,_TableCommandNames:()=>w,_TextCommandName:()=>c,_TextLinkCommandNames:()=>h,_TodoCommandNames:()=>b,cmd:()=>Go,key:()=>Ko,keymap:()=>Xo,node_observer:()=>Ud});var e={};r.r(e),r.d(e,{boolean:()=>yp,booleanish:()=>vp,commaOrSpaceSeparated:()=>Cp,commaSeparated:()=>Sp,number:()=>xp,overloadedBoolean:()=>wp,spaceSeparated:()=>kp});var t=function(e){return e.courier="courier",e.cursor="cursor",e.config="config",e.cubes="cubes",e.clipboard="clipboard",e.event="event",e.fomula="fomula",e.float="float",e.painter="painter",e.player="player",e.hotkeys="hotkeys",e.history="history",e.scope="scope",e.stats="stats",e}({}),n=function(e){return e.api="api",e.annotation="annotation",e.box="box",e.box_root="box-root",e.box_folder="box-folder",e.box_columns="box-columns",e.code="code",e.doc="doc",e.detail_list="detail-list",e.fomula="fomula",e.img="img",e.lost="lost",e.line="line",e.list="list",e.list_ordered="list-ordered",e.linker="linker",e.link="link",e.map="map",e.submap="submap",e.node="node",e.postil="postil",e.rt="rt",e.text="text",e.tip="tip",e.todo="todo",e.table="table",e}({}),i=function(e){return e.cube_insert_child="cube-insert-child",e.cube_delete_child="cube-delete-child",e.cube_reset="cube-reset",e.cube_delete_adjacent="cube-delete-adjacent",e.cube_set_selection_css="cube-set-selection-css",e.cube_insert="cube-insert",e.cube_delete="cube-delete",e.cube_partition="cube-partition",e.cube_reorder="cube-reorder",e.cube_set_css="cube-set-css",e.cube_set_attr="cube-set-attr",e.cube_move="cube-move",e.cube_merge="cube-merge",e.cube_postil_add="cube-postil-add",e.cube_postil_remove="cube-postil-remove",e}({}),s=function(e){return e.cursor_in_head="cursor:in-head",e.cursor_in_tail="cursor:in-tail",e.loc="cursor:loc",e}({}),a=function(e){return e.node_add="node-add",e.node_remove="node-remove",e.linker_add="linker-add",e.linker_remove="linker-remove",e.update_attrs="update-attrs",e}({}),l=function(e){return e.layout_update="node:layout-update",e.append_child="node:append-child",e}({}),c=function(e){return e.text_reset="cube-text:text-reset",e.text_merge="cube-text:text-merge",e.text_break="cube-text:text-break",e}({}),d=function(){return{}}(),u=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),h=function(e){return e.update="text-link:update",e}({}),p=function(e){return e.reset="cube-api:reset",e}({}),f=function(e){return e.insert_row="cube-detail-list:insert-row",e.remove_row="cube-detail-list:remove-row",e.change_width_col1="cube-detail-list:change-width-col1",e}({}),m=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e.reset="cube-list:reset",e.transform="cube-list:transform",e}({}),_=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e.reset="cube-list-ordered:reset",e}({}),g=function(e){return e.change_lang="cube-code:change-lang",e.change_active="cube-code:change-active",e.change_theme="cube-code:change-theme",e.code_update="cube-code:update-code",e.code_add="cube-code:code-add",e.code_remove="cube-code:code-remove",e.code_rename="cube-code:code-rename",e}({}),b=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e.reset="cube-todo:reset",e}({}),y=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),v=function(e){return e.update="cube-fomula:update",e}({}),w=function(e){return e.add_title="cube-table:add-title",e.remove_title="cube-table:remove-title",e.add_cell="cube-table:add-cell",e.remove_cell="cube-table:remove-cell",e.add_row="cube-table:add-row",e.remove_row="cube-table:remove-row",e.add_col="cube-table:add-col",e.remove_col="cube-table:remove-col",e.add_grid_col="cube-table:add-grid-col",e.remove_grid_col="cube-table:remove-grid-col",e.merge="cube-table:merge",e.moveto="cube-table:moveto",e.update_area="cube-table:update-area",e.reorder="cube-table:reorder",e.col_resize="cube-table:col-resize",e}({}),x=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),k=function(e){return e.update="linker:update",e}({}),S=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),C=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),M=function(e){return e["asset-save"]="note-event:asset-save",e["asset-download"]="note-event:asset-download",e["asset-copy"]="note-event:asset-copy",e.export="note-event:export",e["replace-id"]="note-event:replace-id",e["edit-before"]="note-event:edit-before",e["edit-after"]="note-event:edit-after",e["text-merge"]="note-event:text-merge",e.esc="note-event:esc",e["selection-change"]="note-event:selection-change",e["cursor-nav-before"]="note-event:cursor-nav-before",e["cursor-nav-after"]="note-event:cursor-nav-after",e["enter-before"]="note-event:enter-before",e["enter-after"]="note-event:enter-after",e["show-cube-editor"]="note-event:show-cube-editor",e["text-link-edit"]="note-event:text-link-edit",e["note-input-before"]="note-event:note-input-before",e["note-input-compositionend"]="note-event:note-input-compositionend",e["note-input-compositionend-before"]="note-event:note-input-compositionend-before",e["note-input-compositionupdate"]="note-event:note-input-compositionupdate",e["status-update"]="note-event:status-update",e["fig-click"]="note-event:fig-click",e}({}),z=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),A=function(e){return e["break-line"]="换行",e["cursor-nav"]="光标导航",e["cursor-nav-extend"]="光标复选",e["format-brush-apply"]="应用格式刷",e["format-brush-copy"]="复制格式刷",e.undo="撤销",e.redo="重做",e["indent-line"]="缩进",e["unindent-line"]="反向缩进",e["clear-css"]="重置样式",e["scope-clear"]="清空块选区",e["scope-add"]="添加块选区",e["root-add-next"]="向后添加根级块",e["root-add-prev"]="向前添加根级块",e["break-root"]="分裂根级块",e["break-text"]="文本块换行",e["fold-block"]="折叠所在块",e["text-add-annotation"]="添加批注",e["text-italic"]="斜体",e["text-bold"]="加粗",e["text-underline"]="下划线",e["text-align-left"]="左对齐",e["text-align-center"]="居中对齐",e["text-align-right"]="右对齐",e["text-partition"]="分裂文本块",e}({}),T=function(e){return e.core="核心",e.common="通用",e.text="文本块",e.block="块",e.scope="块选区",e.dict="字典",e.bookmark="书签",e.search="搜索",e.css="样式",e.float="面板",e.other="其他",e}({}),P=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),N=function(e){return e.enter="Enter",e}({});function O(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const R={},L=[],E=()=>{},I=()=>!1,D=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),B=e=>e.startsWith("onUpdate:"),j=Object.assign,q=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},F=Object.prototype.hasOwnProperty,H=(e,t)=>F.call(e,t),$=Array.isArray,G=e=>"[object Map]"===Q(e),V=e=>"[object Set]"===Q(e),U=e=>"function"==typeof e,W=e=>"string"==typeof e,Y=e=>"symbol"==typeof e,X=e=>null!==e&&"object"==typeof e,K=e=>(X(e)||U(e))&&U(e.then)&&U(e.catch),J=Object.prototype.toString,Q=e=>J.call(e),Z=e=>"[object Object]"===Q(e),ee=e=>W(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,te=O(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ne=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ie=/-\w/g,re=ne(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),oe=/\B([A-Z])/g,se=ne(e=>e.replace(oe,"-$1").toLowerCase()),ae=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),le=ne(e=>e?`on${ae(e)}`:""),ce=(e,t)=>!Object.is(e,t),de=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ue=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},he=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let pe;const fe=()=>pe||(pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{});function me(e){if($(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],r=W(i)?ye(i):me(i);if(r)for(const e in r)t[e]=r[e]}return t}if(W(e)||X(e))return e}const _e=/;(?![^(]*\))/g,ge=/:([^]+)/,be=/\/\*[^]*?\*\//g;function ye(e){const t={};return e.replace(be,"").split(_e).forEach(e=>{if(e){const n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ve(e){let t="";if(W(e))t=e;else if($(e))for(let n=0;n<e.length;n++){const i=ve(e[n]);i&&(t+=i+" ")}else if(X(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const we="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",xe=O(we);function ke(e){return!!e||""===e}const Se=e=>!(!e||!0!==e.__v_isRef),Ce=e=>W(e)?e:null==e?"":$(e)||X(e)&&(e.toString===J||!U(e.toString))?Se(e)?Ce(e.value):JSON.stringify(e,Me,2):String(e),Me=(e,t)=>Se(t)?Me(e,t.value):G(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[ze(t,i)+" =>"]=n,e),{})}:V(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ze(e))}:Y(t)?ze(t):!X(t)||$(t)||Z(t)?t:String(t),ze=(e,t="")=>{var n;return Y(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let Ae,Te;class Pe{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ae,!e&&Ae&&(this.index=(Ae.scopes||(Ae.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Ae;try{return Ae=this,e()}finally{Ae=t}}else 0}on(){1===++this._on&&(this.prevScope=Ae,Ae=this)}off(){this._on>0&&0===--this._on&&(Ae=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Ne=new WeakSet;class Oe{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ae&&Ae.active&&Ae.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Ne.has(this)&&(Ne.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||Ie(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Xe(this),je(this);const e=Te,t=Ve;Te=this,Ve=!0;try{return this.fn()}finally{0,qe(this),Te=e,Ve=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)$e(e);this.deps=this.depsTail=void 0,Xe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Ne.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Fe(this)&&this.run()}get dirty(){return Fe(this)}}let Re,Le,Ee=0;function Ie(e,t=!1){if(e.flags|=8,t)return e.next=Le,void(Le=e);e.next=Re,Re=e}function De(){Ee++}function Be(){if(--Ee>0)return;if(Le){let e=Le;for(Le=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Re;){let t=Re;for(Re=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function je(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function qe(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),$e(i),Ge(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function Fe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(He(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function He(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Ke)return;if(e.globalVersion=Ke,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!Fe(e)))return;e.flags|=2;const t=e.dep,n=Te,i=Ve;Te=e,Ve=!0;try{je(e);const n=e.fn(e._value);(0===t.version||ce(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Te=n,Ve=i,qe(e),e.flags&=-3}}function $e(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)$e(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function Ge(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ve=!0;const Ue=[];function We(){Ue.push(Ve),Ve=!1}function Ye(){const e=Ue.pop();Ve=void 0===e||e}function Xe(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Te;Te=void 0;try{t()}finally{Te=e}}}let Ke=0;class Je{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qe{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Te||!Ve||Te===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Te)t=this.activeLink=new Je(Te,this),Te.deps?(t.prevDep=Te.depsTail,Te.depsTail.nextDep=t,Te.depsTail=t):Te.deps=Te.depsTail=t,Ze(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Te.depsTail,t.nextDep=void 0,Te.depsTail.nextDep=t,Te.depsTail=t,Te.deps===t&&(Te.deps=e)}return t}trigger(e){this.version++,Ke++,this.notify(e)}notify(e){De();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Be()}}}function Ze(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const et=new WeakMap,tt=Symbol(""),nt=Symbol(""),it=Symbol("");function rt(e,t,n){if(Ve&&Te){let t=et.get(e);t||et.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new Qe),i.map=t,i.key=n),i.track()}}function ot(e,t,n,i,r,o){const s=et.get(e);if(!s)return void Ke++;const a=e=>{e&&e.trigger()};if(De(),"clear"===t)s.forEach(a);else{const r=$(e),o=r&&ee(n);if(r&&"length"===n){const e=Number(i);s.forEach((t,n)=>{("length"===n||n===it||!Y(n)&&n>=e)&&a(t)})}else switch((void 0!==n||s.has(void 0))&&a(s.get(n)),o&&a(s.get(it)),t){case"add":r?o&&a(s.get("length")):(a(s.get(tt)),G(e)&&a(s.get(nt)));break;case"delete":r||(a(s.get(tt)),G(e)&&a(s.get(nt)));break;case"set":G(e)&&a(s.get(tt))}}Be()}function st(e){const t=Vt(e);return t===e?t:(rt(t,0,it),$t(e)?t:t.map(Wt))}function at(e){return rt(e=Vt(e),0,it),e}const lt={__proto__:null,[Symbol.iterator](){return ct(this,Symbol.iterator,Wt)},concat(...e){return st(this).concat(...e.map(e=>$(e)?st(e):e))},entries(){return ct(this,"entries",e=>(e[1]=Wt(e[1]),e))},every(e,t){return ut(this,"every",e,t,void 0,arguments)},filter(e,t){return ut(this,"filter",e,t,e=>e.map(Wt),arguments)},find(e,t){return ut(this,"find",e,t,Wt,arguments)},findIndex(e,t){return ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ut(this,"findLast",e,t,Wt,arguments)},findLastIndex(e,t){return ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return pt(this,"includes",e)},indexOf(...e){return pt(this,"indexOf",e)},join(e){return st(this).join(e)},lastIndexOf(...e){return pt(this,"lastIndexOf",e)},map(e,t){return ut(this,"map",e,t,void 0,arguments)},pop(){return ft(this,"pop")},push(...e){return ft(this,"push",e)},reduce(e,...t){return ht(this,"reduce",e,t)},reduceRight(e,...t){return ht(this,"reduceRight",e,t)},shift(){return ft(this,"shift")},some(e,t){return ut(this,"some",e,t,void 0,arguments)},splice(...e){return ft(this,"splice",e)},toReversed(){return st(this).toReversed()},toSorted(e){return st(this).toSorted(e)},toSpliced(...e){return st(this).toSpliced(...e)},unshift(...e){return ft(this,"unshift",e)},values(){return ct(this,"values",Wt)}};function ct(e,t,n){const i=at(e),r=i[t]();return i===e||$t(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const dt=Array.prototype;function ut(e,t,n,i,r,o){const s=at(e),a=s!==e&&!$t(e),l=s[t];if(l!==dt[t]){const t=l.apply(e,o);return a?Wt(t):t}let c=n;s!==e&&(a?c=function(t,i){return n.call(this,Wt(t),i,e)}:n.length>2&&(c=function(t,i){return n.call(this,t,i,e)}));const d=l.call(s,c,i);return a&&r?r(d):d}function ht(e,t,n,i){const r=at(e);let o=n;return r!==e&&($t(e)?n.length>3&&(o=function(t,i,r){return n.call(this,t,i,r,e)}):o=function(t,i,r){return n.call(this,t,Wt(i),r,e)}),r[t](o,...i)}function pt(e,t,n){const i=Vt(e);rt(i,0,it);const r=i[t](...n);return-1!==r&&!1!==r||!Gt(n[0])?r:(n[0]=Vt(n[0]),i[t](...n))}function ft(e,t,n=[]){We(),De();const i=Vt(e)[t].apply(e,n);return Be(),Ye(),i}const mt=O("__proto__,__v_isRef,__isVue"),_t=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(Y));function gt(e){Y(e)||(e=String(e));const t=Vt(this);return rt(t,0,e),t.hasOwnProperty(e)}class bt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?Et:Lt:r?Rt:Ot).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=$(e);if(!i){let e;if(o&&(e=lt[t]))return e;if("hasOwnProperty"===t)return gt}const s=Reflect.get(e,t,Xt(e)?e:n);return(Y(t)?_t.has(t):mt(t))?s:(i||rt(e,0,t),r?s:Xt(s)?o&&ee(t)?s:s.value:X(s)?i?jt(s):Dt(s):s)}}class yt extends bt{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=Ht(r);if($t(n)||Ht(n)||(r=Vt(r),n=Vt(n)),!$(e)&&Xt(r)&&!Xt(n))return t||(r.value=n),!0}const o=$(e)&&ee(t)?Number(t)<e.length:H(e,t),s=Reflect.set(e,t,n,Xt(e)?e:i);return e===Vt(i)&&(o?ce(n,r)&&ot(e,"set",t,n):ot(e,"add",t,n)),s}deleteProperty(e,t){const n=H(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&ot(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return Y(t)&&_t.has(t)||rt(e,0,t),n}ownKeys(e){return rt(e,0,$(e)?"length":tt),Reflect.ownKeys(e)}}class vt extends bt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const wt=new yt,xt=new vt,kt=new yt(!0),St=e=>e,Ct=e=>Reflect.getPrototypeOf(e);function Mt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function zt(e,t){const n={get(n){const i=this.__v_raw,r=Vt(i),o=Vt(n);e||(ce(n,o)&&rt(r,0,n),rt(r,0,o));const{has:s}=Ct(r),a=t?St:e?Yt:Wt;return s.call(r,n)?a(i.get(n)):s.call(r,o)?a(i.get(o)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&rt(Vt(t),0,tt),t.size},has(t){const n=this.__v_raw,i=Vt(n),r=Vt(t);return e||(ce(t,r)&&rt(i,0,t),rt(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,o=r.__v_raw,s=Vt(o),a=t?St:e?Yt:Wt;return!e&&rt(s,0,tt),o.forEach((e,t)=>n.call(i,a(e),a(t),r))}};j(n,e?{add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear")}:{add(e){t||$t(e)||Ht(e)||(e=Vt(e));const n=Vt(this);return Ct(n).has.call(n,e)||(n.add(e),ot(n,"add",e,e)),this},set(e,n){t||$t(n)||Ht(n)||(n=Vt(n));const i=Vt(this),{has:r,get:o}=Ct(i);let s=r.call(i,e);s||(e=Vt(e),s=r.call(i,e));const a=o.call(i,e);return i.set(e,n),s?ce(n,a)&&ot(i,"set",e,n):ot(i,"add",e,n),this},delete(e){const t=Vt(this),{has:n,get:i}=Ct(t);let r=n.call(t,e);r||(e=Vt(e),r=n.call(t,e));i&&i.call(t,e);const o=t.delete(e);return r&&ot(t,"delete",e,void 0),o},clear(){const e=Vt(this),t=0!==e.size,n=e.clear();return t&&ot(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,o=Vt(r),s=G(o),a="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=r[e](...i),d=n?St:t?Yt:Wt;return!t&&rt(o,0,l?nt:tt),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[d(e[0]),d(e[1])]:d(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function At(e,t){const n=zt(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(H(n,i)&&i in t?n:t,i,r)}const Tt={get:At(!1,!1)},Pt={get:At(!1,!0)},Nt={get:At(!0,!1)};const Ot=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,Et=new WeakMap;function It(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Q(e).slice(8,-1))(e))}function Dt(e){return Ht(e)?e:qt(e,!1,wt,Tt,Ot)}function Bt(e){return qt(e,!1,kt,Pt,Rt)}function jt(e){return qt(e,!0,xt,Nt,Lt)}function qt(e,t,n,i,r){if(!X(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=It(e);if(0===o)return e;const s=r.get(e);if(s)return s;const a=new Proxy(e,2===o?i:n);return r.set(e,a),a}function Ft(e){return Ht(e)?Ft(e.__v_raw):!(!e||!e.__v_isReactive)}function Ht(e){return!(!e||!e.__v_isReadonly)}function $t(e){return!(!e||!e.__v_isShallow)}function Gt(e){return!!e&&!!e.__v_raw}function Vt(e){const t=e&&e.__v_raw;return t?Vt(t):e}function Ut(e){return!H(e,"__v_skip")&&Object.isExtensible(e)&&ue(e,"__v_skip",!0),e}const Wt=e=>X(e)?Dt(e):e,Yt=e=>X(e)?jt(e):e;function Xt(e){return!!e&&!0===e.__v_isRef}function Kt(e){return Jt(e,!1)}function Jt(e,t){return Xt(e)?e:new Qt(e,t)}class Qt{constructor(e,t){this.dep=new Qe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Vt(e),this._value=t?e:Wt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||$t(e)||Ht(e);e=n?e:Vt(e),ce(e,t)&&(this._rawValue=e,this._value=n?e:Wt(e),this.dep.trigger())}}function Zt(e){return Xt(e)?e.value:e}const en={get:(e,t,n)=>"__v_raw"===t?e:Zt(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return Xt(r)&&!Xt(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function tn(e){return Ft(e)?e:new Proxy(e,en)}class nn{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Qe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ke-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||Te===this))return Ie(this,!0),!0}get value(){const e=this.dep.track();return He(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const rn={},on=new WeakMap;let sn;function an(e,t,n=R){const{immediate:i,deep:r,once:o,scheduler:s,augmentJob:a,call:l}=n,c=e=>r?e:$t(e)||!1===r||0===r?ln(e,1):ln(e);let d,u,h,p,f=!1,m=!1;if(Xt(e)?(u=()=>e.value,f=$t(e)):Ft(e)?(u=()=>c(e),f=!0):$(e)?(m=!0,f=e.some(e=>Ft(e)||$t(e)),u=()=>e.map(e=>Xt(e)?e.value:Ft(e)?c(e):U(e)?l?l(e,2):e():void 0)):u=U(e)?t?l?()=>l(e,2):e:()=>{if(h){We();try{h()}finally{Ye()}}const t=sn;sn=d;try{return l?l(e,3,[p]):e(p)}finally{sn=t}}:E,t&&r){const e=u,t=!0===r?1/0:r;u=()=>ln(e(),t)}const _=Ae,g=()=>{d.stop(),_&&_.active&&q(_.effects,d)};if(o&&t){const e=t;t=(...t)=>{e(...t),g()}}let b=m?new Array(e.length).fill(rn):rn;const y=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(r||f||(m?e.some((e,t)=>ce(e,b[t])):ce(e,b))){h&&h();const n=sn;sn=d;try{const n=[e,b===rn?void 0:m&&b[0]===rn?[]:b,p];b=e,l?l(t,3,n):t(...n)}finally{sn=n}}}else d.run()};return a&&a(y),d=new Oe(u),d.scheduler=s?()=>s(y,!1):y,p=e=>function(e,t=!1,n=sn){if(n){let t=on.get(n);t||on.set(n,t=[]),t.push(e)}}(e,!1,d),h=d.onStop=()=>{const e=on.get(d);if(e){if(l)l(e,4);else for(const t of e)t();on.delete(d)}},t?i?y(!0):b=d.run():s?s(y.bind(null,!0),!0):d.run(),g.pause=d.pause.bind(d),g.resume=d.resume.bind(d),g.stop=g,g}function ln(e,t=1/0,n){if(t<=0||!X(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,Xt(e))ln(e.value,t,n);else if($(e))for(let i=0;i<e.length;i++)ln(e[i],t,n);else if(V(e)||G(e))e.forEach(e=>{ln(e,t,n)});else if(Z(e)){for(const i in e)ln(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&ln(e[i],t,n)}return e}function cn(e,t,n,i){try{return i?e(...i):e()}catch(e){un(e,t,n)}}function dn(e,t,n,i){if(U(e)){const r=cn(e,t,n,i);return r&&K(r)&&r.catch(e=>{un(e,t,n)}),r}if($(e)){const r=[];for(let o=0;o<e.length;o++)r.push(dn(e[o],t,n,i));return r}}function un(e,t,n,i=!0){t&&t.vnode;const{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||R;if(t){let i=t.parent;const o=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,s))return;i=i.parent}if(r)return We(),cn(r,null,10,[e,o,s]),void Ye()}!function(e,t,n,i=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,i,o)}const hn=[];let pn=-1;const fn=[];let mn=null,_n=0;const gn=Promise.resolve();let bn=null;function yn(e){const t=bn||gn;return e?t.then(this?e.bind(this):e):t}function vn(e){if(!(1&e.flags)){const t=Cn(e),n=hn[hn.length-1];!n||!(2&e.flags)&&t>=Cn(n)?hn.push(e):hn.splice(function(e){let t=pn+1,n=hn.length;for(;t<n;){const i=t+n>>>1,r=hn[i],o=Cn(r);o<e||o===e&&2&r.flags?t=i+1:n=i}return t}(t),0,e),e.flags|=1,wn()}}function wn(){bn||(bn=gn.then(Mn))}function xn(e){$(e)?fn.push(...e):mn&&-1===e.id?mn.splice(_n+1,0,e):1&e.flags||(fn.push(e),e.flags|=1),wn()}function kn(e,t,n=pn+1){for(0;n<hn.length;n++){const t=hn[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;0,hn.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function Sn(e){if(fn.length){const e=[...new Set(fn)].sort((e,t)=>Cn(e)-Cn(t));if(fn.length=0,mn)return void mn.push(...e);for(mn=e,_n=0;_n<mn.length;_n++){const e=mn[_n];0,4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}mn=null,_n=0}}const Cn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function Mn(e){try{for(pn=0;pn<hn.length;pn++){const e=hn[pn];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),cn(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;pn<hn.length;pn++){const e=hn[pn];e&&(e.flags&=-2)}pn=-1,hn.length=0,Sn(),bn=null,(hn.length||fn.length)&&Mn(e)}}let zn=null,An=null;function Tn(e){const t=zn;return zn=e,An=e&&e.type.__scopeId||null,t}function Pn(e,t=zn,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&Lr(-1);const r=Tn(t);let o;try{o=e(...n)}finally{Tn(r),i._d&&Lr(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Nn(e,t){if(null===zn)return e;const n=bo(zn),i=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,o,s,a=R]=t[e];r&&(U(r)&&(r={mounted:r,updated:r}),r.deep&&ln(o),i.push({dir:r,instance:n,value:o,oldValue:void 0,arg:s,modifiers:a}))}return e}function On(e,t,n,i){const r=e.dirs,o=t&&t.dirs;for(let s=0;s<r.length;s++){const a=r[s];o&&(a.oldValue=o[s].value);let l=a.dir[i];l&&(We(),dn(l,n,8,[e.el,a,e,t]),Ye())}}const Rn=Symbol("_vte"),Ln=e=>e.__isTeleport;const En=Symbol("_leaveCb");Symbol("_enterCb");const In=[Function,Array];Boolean,Boolean;function Dn(e,t){6&e.shapeFlag&&e.component?(e.transition=t,Dn(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Bn(e,t){return U(e)?(()=>j({name:e.name},t,{setup:e}))():e}function jn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function qn(e){const t=io(),n=Jt(null,!0);if(t){const i=t.refs===R?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}else 0;return n}const Fn=new WeakMap;function Hn(e,t,n,i,r=!1){if($(e))return void e.forEach((e,o)=>Hn(e,t&&($(t)?t[o]:t),n,i,r));if(Gn(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&Hn(e,t,n,i.component.subTree));const o=4&i.shapeFlag?bo(i.component):i.el,s=r?null:o,{i:a,r:l}=e;const c=t&&t.r,d=a.refs===R?a.refs={}:a.refs,u=a.setupState,h=Vt(u),p=u===R?I:e=>H(h,e);if(null!=c&&c!==l)if($n(t),W(c))d[c]=null,p(c)&&(u[c]=null);else if(Xt(c)){c.value=null;const e=t;e.k&&(d[e.k]=null)}if(U(l))cn(l,a,12,[s,d]);else{const t=W(l),i=Xt(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?u[l]:d[l]:l.value;if(r)$(n)&&q(n,o);else if($(n))n.includes(o)||n.push(o);else if(t)d[l]=[o],p(l)&&(u[l]=d[l]);else{const t=[o];l.value=t,e.k&&(d[e.k]=t)}}else t?(d[l]=s,p(l)&&(u[l]=s)):i&&(l.value=s,e.k&&(d[e.k]=s))};if(s){const t=()=>{a(),Fn.delete(e)};t.id=-1,Fn.set(e,t),Zi(t,n)}else $n(e),a()}else 0}}function $n(e){const t=Fn.get(e);t&&(t.flags|=8,Fn.delete(e))}fe().requestIdleCallback,fe().cancelIdleCallback;const Gn=e=>!!e.type.__asyncLoader;const Vn=e=>e.type.__isKeepAlive;RegExp,RegExp;function Un(e,t){return $(e)?e.some(e=>Un(e,t)):W(e)?e.split(",").includes(t):"[object RegExp]"===Q(e)&&(e.lastIndex=0,e.test(t))}function Wn(e,t){Xn(e,"a",t)}function Yn(e,t){Xn(e,"da",t)}function Xn(e,t,n=no){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Zn(t,i,n),n){let e=n.parent;for(;e&&e.parent;)Vn(e.parent.vnode)&&Kn(i,t,n,e),e=e.parent}}function Kn(e,t,n,i){const r=Zn(t,e,i,!0);si(()=>{q(i[t],r)},n)}function Jn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Qn(e){return 128&e.shapeFlag?e.ssContent:e}function Zn(e,t,n=no,i=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{We();const r=so(n),o=dn(t,n,e,i);return r(),Ye(),o});return i?r.unshift(o):r.push(o),o}}const ei=e=>(t,n=no)=>{ho&&"sp"!==e||Zn(e,(...e)=>t(...e),n)},ti=ei("bm"),ni=ei("m"),ii=ei("bu"),ri=ei("u"),oi=ei("bum"),si=ei("um"),ai=ei("sp"),li=ei("rtg"),ci=ei("rtc");function di(e,t=no){Zn("ec",e,t)}const ui="components";const hi=Symbol.for("v-ndc");function pi(e){return W(e)?fi(ui,e,!1)||e:e||hi}function fi(e,t,n=!0,i=!1){const r=zn||no;if(r){const n=r.type;if(e===ui){const e=yo(n,!1);if(e&&(e===t||e===re(t)||e===ae(re(t))))return n}const o=mi(r[e]||n[e],t)||mi(r.appContext[e],t);return!o&&i?n:o}}function mi(e,t){return e&&(e[t]||e[re(t)]||e[ae(re(t))])}function _i(e,t,n,i){let r;const o=n&&n[i],s=$(e);if(s||W(e)){let n=!1,i=!1;s&&Ft(e)&&(n=!$t(e),i=Ht(e),e=at(e)),r=new Array(e.length);for(let s=0,a=e.length;s<a;s++)r[s]=t(n?i?Yt(Wt(e[s])):Wt(e[s]):e[s],s,void 0,o&&o[s])}else if("number"==typeof e){0,r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,o&&o[n])}else if(X(e))if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,o&&o[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,s=n.length;i<s;i++){const s=n[i];r[i]=t(e[s],s,i,o&&o[i])}}else r=[];return n&&(n[i]=r),r}const gi=e=>e?lo(e)?bo(e):gi(e.parent):null,bi=j(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>gi(e.parent),$root:e=>gi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mi(e),$forceUpdate:e=>e.f||(e.f=()=>{vn(e.update)}),$nextTick:e=>e.n||(e.n=yn.bind(e.proxy)),$watch:e=>ur.bind(e)}),yi=(e,t)=>e!==R&&!e.__isScriptSetup&&H(e,t),vi={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:o,accessCache:s,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=s[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(yi(i,t))return s[t]=1,i[t];if(r!==R&&H(r,t))return s[t]=2,r[t];if((c=e.propsOptions[0])&&H(c,t))return s[t]=3,o[t];if(n!==R&&H(n,t))return s[t]=4,n[t];xi&&(s[t]=0)}}const d=bi[t];let u,h;return d?("$attrs"===t&&rt(e.attrs,0,""),d(e)):(u=a.__cssModules)&&(u=u[t])?u:n!==R&&H(n,t)?(s[t]=4,n[t]):(h=l.config.globalProperties,H(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:o}=e;return yi(r,t)?(r[t]=n,!0):i!==R&&H(i,t)?(i[t]=n,!0):!H(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(o[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:o,type:s}},a){let l,c;return!!(n[a]||e!==R&&"$"!==a[0]&&H(e,a)||yi(t,a)||(l=o[0])&&H(l,a)||H(i,a)||H(bi,a)||H(r.config.globalProperties,a)||(c=s.__cssModules)&&c[a])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:H(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function wi(e){return $(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let xi=!0;function ki(e){const t=Mi(e),n=e.proxy,i=e.ctx;xi=!1,t.beforeCreate&&Si(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:s,watch:a,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:p,updated:f,activated:m,deactivated:_,beforeDestroy:g,beforeUnmount:b,destroyed:y,unmounted:v,render:w,renderTracked:x,renderTriggered:k,errorCaptured:S,serverPrefetch:C,expose:M,inheritAttrs:z,components:A,directives:T,filters:P}=t;if(c&&function(e,t){$(e)&&(e=Pi(e));for(const n in e){const i=e[n];let r;r=X(i)?"default"in i?Bi(i.from||n,i.default,!0):Bi(i.from||n):Bi(i),Xt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,i,null),s)for(const e in s){const t=s[e];U(t)&&(i[e]=t.bind(n))}if(r){0;const t=r.call(n,n);0,X(t)&&(e.data=Dt(t))}if(xi=!0,o)for(const e in o){const t=o[e],r=U(t)?t.bind(n,n):U(t.get)?t.get.bind(n,n):E;0;const s=!U(t)&&U(t.set)?t.set.bind(n):E,a=wo({get:r,set:s});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)Ci(a[e],i,n,e);if(l){const e=U(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(no){let n=no.provides;const i=no.parent&&no.parent.provides;i===n&&(n=no.provides=Object.create(i)),n[e]=t}else 0}(t,e[t])})}function N(e,t){$(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&Si(d,e,"c"),N(ti,u),N(ni,h),N(ii,p),N(ri,f),N(Wn,m),N(Yn,_),N(di,S),N(ci,x),N(li,k),N(oi,b),N(si,v),N(ai,C),$(M))if(M.length){const t=e.exposed||(e.exposed={});M.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===E&&(e.render=w),null!=z&&(e.inheritAttrs=z),A&&(e.components=A),T&&(e.directives=T),C&&jn(e)}function Si(e,t,n){dn($(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ci(e,t,n,i){let r=i.includes(".")?hr(n,i):()=>n[i];if(W(e)){const n=t[e];U(n)&&cr(r,n)}else if(U(e))cr(r,e.bind(n));else if(X(e))if($(e))e.forEach(e=>Ci(e,t,n,i));else{const i=U(e.handler)?e.handler.bind(n):t[e.handler];U(i)&&cr(r,i,e)}else 0}function Mi(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>zi(l,e,s,!0)),zi(l,t,s)):l=t,X(t)&&o.set(t,l),l}function zi(e,t,n,i=!1){const{mixins:r,extends:o}=t;o&&zi(e,o,n,!0),r&&r.forEach(t=>zi(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=Ai[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const Ai={data:Ti,props:Ri,emits:Ri,methods:Oi,computed:Oi,beforeCreate:Ni,created:Ni,beforeMount:Ni,mounted:Ni,beforeUpdate:Ni,updated:Ni,beforeDestroy:Ni,beforeUnmount:Ni,destroyed:Ni,unmounted:Ni,activated:Ni,deactivated:Ni,errorCaptured:Ni,serverPrefetch:Ni,components:Oi,directives:Oi,watch:function(e,t){if(!e)return t;if(!t)return e;const n=j(Object.create(null),e);for(const i in t)n[i]=Ni(e[i],t[i]);return n},provide:Ti,inject:function(e,t){return Oi(Pi(e),Pi(t))}};function Ti(e,t){return t?e?function(){return j(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function Pi(e){if($(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ni(e,t){return e?[...new Set([].concat(e,t))]:t}function Oi(e,t){return e?j(Object.create(null),e,t):t}function Ri(e,t){return e?$(e)&&$(t)?[...new Set([...e,...t])]:j(Object.create(null),wi(e),wi(null!=t?t:{})):t}function Li(){return{app:null,config:{isNativeTag:I,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ei=0;function Ii(e,t){return function(n,i=null){U(n)||(n=j({},n)),null==i||X(i)||(i=null);const r=Li(),o=new WeakSet,s=[];let a=!1;const l=r.app={_uid:Ei++,_component:n,_props:i,_container:null,_context:r,_instance:null,version:xo,get config(){return r.config},set config(e){0},use:(e,...t)=>(o.has(e)||(e&&U(e.install)?(o.add(e),e.install(l,...t)):U(e)&&(o.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(o,s,c){if(!a){0;const d=l._ceVNode||$r(n,i);return d.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),s&&t?t(d,o):e(d,o,c),a=!0,l._container=o,o.__vue_app__=l,bo(d.component)}},onUnmount(e){s.push(e)},unmount(){a&&(dn(s,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=Di;Di=l;try{return e()}finally{Di=t}}};return l}}let Di=null;function Bi(e,t,n=!1){const i=io();if(i||Di){let r=Di?Di._context.provides:i?null==i.parent||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&U(t)?t.call(i&&i.proxy):t}else 0}const ji={},qi=()=>Object.create(ji),Fi=e=>Object.getPrototypeOf(e)===ji;function Hi(e,t,n,i){const[r,o]=e.propsOptions;let s,a=!1;if(t)for(let l in t){if(te(l))continue;const c=t[l];let d;r&&H(r,d=re(l))?o&&o.includes(d)?(s||(s={}))[d]=c:n[d]=c:gr(e.emitsOptions,l)||l in i&&c===i[l]||(i[l]=c,a=!0)}if(o){const t=Vt(n),i=s||R;for(let s=0;s<o.length;s++){const a=o[s];n[a]=$i(r,t,a,i[a],e,!H(i,a))}}return a}function $i(e,t,n,i,r,o){const s=e[n];if(null!=s){const e=H(s,"default");if(e&&void 0===i){const e=s.default;if(s.type!==Function&&!s.skipFactory&&U(e)){const{propsDefaults:o}=r;if(n in o)i=o[n];else{const s=so(r);i=o[n]=e.call(null,t),s()}}else i=e;r.ce&&r.ce._setProp(n,i)}s[0]&&(o&&!e?i=!1:!s[1]||""!==i&&i!==se(n)||(i=!0))}return i}const Gi=new WeakMap;function Vi(e,t,n=!1){const i=n?Gi:t.propsCache,r=i.get(e);if(r)return r;const o=e.props,s={},a=[];let l=!1;if(!U(e)){const i=e=>{l=!0;const[n,i]=Vi(e,t,!0);j(s,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!o&&!l)return X(e)&&i.set(e,L),L;if($(o))for(let e=0;e<o.length;e++){0;const t=re(o[e]);Ui(t)&&(s[t]=R)}else if(o){0;for(const e in o){const t=re(e);if(Ui(t)){const n=o[e],i=s[t]=$(n)||U(n)?{type:n}:j({},n),r=i.type;let l=!1,c=!0;if($(r))for(let e=0;e<r.length;++e){const t=r[e],n=U(t)&&t.name;if("Boolean"===n){l=!0;break}"String"===n&&(c=!1)}else l=U(r)&&"Boolean"===r.name;i[0]=l,i[1]=c,(l||H(i,"default"))&&a.push(t)}}}const c=[s,a];return X(e)&&i.set(e,c),c}function Ui(e){return"$"!==e[0]&&!te(e)}const Wi=e=>"_"===e||"_ctx"===e||"$stable"===e,Yi=e=>$(e)?e.map(Xr):[Xr(e)],Xi=(e,t,n)=>{if(t._n)return t;const i=Pn((...e)=>Yi(t(...e)),n);return i._c=!1,i},Ki=(e,t,n)=>{const i=e._ctx;for(const n in e){if(Wi(n))continue;const r=e[n];if(U(r))t[n]=Xi(0,r,i);else if(null!=r){0;const e=Yi(r);t[n]=()=>e}}},Ji=(e,t)=>{const n=Yi(t);e.slots.default=()=>n},Qi=(e,t,n)=>{for(const i in t)!n&&Wi(i)||(e[i]=t[i])};const Zi=Sr;function er(e,t){fe().__VUE__=!0;const{insert:n,remove:i,patchProp:r,createElement:o,createText:s,createComment:a,setText:l,setElementText:c,parentNode:d,nextSibling:u,setScopeId:h=E,insertStaticContent:p}=e,f=(e,t,n,i=null,r=null,o=null,s=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!jr(e,t)&&(i=V(e),j(e,r,o,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Mr:m(e,t,n,i);break;case zr:_(e,t,n,i);break;case Ar:null==e&&g(t,n,i,s);break;case Cr:M(e,t,n,i,r,o,s,a,l);break;default:1&u?y(e,t,n,i,r,o,s,a,l):6&u?z(e,t,n,i,r,o,s,a,l):(64&u||128&u)&&c.process(e,t,n,i,r,o,s,a,l,Y)}null!=d&&r?Hn(d,e&&e.ref,o,t||e,!t):null==d&&e&&null!=e.ref&&Hn(e.ref,null,o,e,!0)},m=(e,t,i,r)=>{if(null==e)n(t.el=s(t.children),i,r);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,i,r)=>{null==e?n(t.el=a(t.children||""),i,r):t.el=e.el},g=(e,t,n,i)=>{[e.el,e.anchor]=p(e.children,t,n,i,e.el,e.anchor)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=u(e),i(e),e=n;i(t)},y=(e,t,n,i,r,o,s,a,l)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?v(t,n,i,r,o,s,a,l):k(e,t,r,o,s,a,l)},v=(e,t,i,s,a,l,d,u)=>{let h,p;const{props:f,shapeFlag:m,transition:_,dirs:g}=e;if(h=e.el=o(e.type,l,f&&f.is,f),8&m?c(h,e.children):16&m&&x(e.children,h,null,s,a,tr(e,l),d,u),g&&On(e,null,s,"created"),w(h,e,e.scopeId,d,s),f){for(const e in f)"value"===e||te(e)||r(h,e,null,f[e],l,s);"value"in f&&r(h,"value",null,f.value,l),(p=f.onVnodeBeforeMount)&&Qr(p,s,e)}g&&On(e,null,s,"beforeMount");const b=ir(a,_);b&&_.beforeEnter(h),n(h,t,i),((p=f&&f.onVnodeMounted)||b||g)&&Zi(()=>{p&&Qr(p,s,e),b&&_.enter(h),g&&On(e,null,s,"mounted")},a)},w=(e,t,n,i,r)=>{if(n&&h(e,n),i)for(let t=0;t<i.length;t++)h(e,i[t]);if(r){let n=r.subTree;if(t===n||kr(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;w(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},x=(e,t,n,i,r,o,s,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Kr(e[c]):Xr(e[c]);f(null,l,t,n,i,r,o,s,a)}},k=(e,t,n,i,o,s,a)=>{const l=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const p=e.props||R,f=t.props||R;let m;if(n&&nr(n,!1),(m=f.onVnodeBeforeUpdate)&&Qr(m,n,t,e),h&&On(t,e,n,"beforeUpdate"),n&&nr(n,!0),(p.innerHTML&&null==f.innerHTML||p.textContent&&null==f.textContent)&&c(l,""),u?S(e.dynamicChildren,u,l,n,i,tr(t,o),s):a||O(e,t,l,null,n,i,tr(t,o),s,!1),d>0){if(16&d)C(l,p,f,n,o);else if(2&d&&p.class!==f.class&&r(l,"class",null,f.class,o),4&d&&r(l,"style",p.style,f.style,o),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const i=e[t],s=p[i],a=f[i];a===s&&"value"!==i||r(l,i,s,a,o,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else a||null!=u||C(l,p,f,n,o);((m=f.onVnodeUpdated)||h)&&Zi(()=>{m&&Qr(m,n,t,e),h&&On(t,e,n,"updated")},i)},S=(e,t,n,i,r,o,s)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],u=l.el&&(l.type===Cr||!jr(l,c)||198&l.shapeFlag)?d(l.el):n;f(l,c,u,null,i,r,o,s,!0)}},C=(e,t,n,i,o)=>{if(t!==n){if(t!==R)for(const s in t)te(s)||s in n||r(e,s,t[s],null,o,i);for(const s in n){if(te(s))continue;const a=n[s],l=t[s];a!==l&&"value"!==s&&r(e,s,l,a,o,i)}"value"in n&&r(e,"value",t.value,n.value,o)}},M=(e,t,i,r,o,a,l,c,d)=>{const u=t.el=e?e.el:s(""),h=t.anchor=e?e.anchor:s("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(c=c?c.concat(m):m),null==e?(n(u,i,r),n(h,i,r),x(t.children||[],i,h,o,a,l,c,d)):p>0&&64&p&&f&&e.dynamicChildren?(S(e.dynamicChildren,f,i,o,a,l,c),(null!=t.key||o&&t===o.subTree)&&rr(e,t,!0)):O(e,t,i,h,o,a,l,c,d)},z=(e,t,n,i,r,o,s,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,s,l):A(t,n,i,r,o,s,l):T(e,t,l)},A=(e,t,n,i,r,o,s)=>{const a=e.component=to(e,i,r);if(Vn(e)&&(a.ctx.renderer=Y),po(a,!1,s),a.asyncDep){if(r&&r.registerDep(a,P,s),!e.el){const i=a.subTree=$r(zr);_(null,i,t,n),e.placeholder=i.el}}else P(a,e,t,n,r,o,s)},T=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:o}=e,{props:s,children:a,patchFlag:l}=t,c=o.emitsOptions;0;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==s&&(i?!s||wr(i,s,c):!!s);if(1024&l)return!0;if(16&l)return i?wr(i,s,c):!!s;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(s[n]!==i[n]&&!gr(c,n))return!0}}return!1}(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void N(i,t,n);i.next=t,i.update()}else t.el=e.el,i.vnode=t},P=(e,t,n,i,r,o,s)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:c}=e;{const n=or(e);if(n)return t&&(t.el=c.el,N(e,t,s)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let u,h=t;0,nr(e,!1),t?(t.el=c.el,N(e,t,s)):t=c,n&&de(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Qr(u,l,t,c),nr(e,!0);const p=br(e);0;const m=e.subTree;e.subTree=p,f(m,p,d(m.el),V(m),e,r,o),t.el=p.el,null===h&&xr(e,p.el),i&&Zi(i,r),(u=t.props&&t.props.onVnodeUpdated)&&Zi(()=>Qr(u,l,t,c),r)}else{let s;const{el:a,props:l}=t,{bm:c,m:d,parent:u,root:h,type:p}=e,m=Gn(t);if(nr(e,!1),c&&de(c),!m&&(s=l&&l.onVnodeBeforeMount)&&Qr(s,u,t),nr(e,!0),a&&K){const t=()=>{e.subTree=br(e),K(a,e.subTree,e,r,null)};m&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{h.ce&&!1!==h.ce._def.shadowRoot&&h.ce._injectChildStyle(p);const s=e.subTree=br(e);0,f(null,s,n,i,e,r,o),t.el=s.el}if(d&&Zi(d,r),!m&&(s=l&&l.onVnodeMounted)){const e=t;Zi(()=>Qr(s,u,e),r)}(256&t.shapeFlag||u&&Gn(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&Zi(e.a,r),e.isMounted=!0,t=n=i=null}};e.scope.on();const l=e.effect=new Oe(a);e.scope.off();const c=e.update=l.run.bind(l),u=e.job=l.runIfDirty.bind(l);u.i=e,u.id=e.uid,l.scheduler=()=>vn(u),nr(e,!0),c()},N=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:o,vnode:{patchFlag:s}}=e,a=Vt(r),[l]=e.propsOptions;let c=!1;if(!(i||s>0)||16&s){let i;Hi(e,t,r,o)&&(c=!0);for(const o in a)t&&(H(t,o)||(i=se(o))!==o&&H(t,i))||(l?!n||void 0===n[o]&&void 0===n[i]||(r[o]=$i(l,a,o,void 0,e,!0)):delete r[o]);if(o!==a)for(const e in o)t&&H(t,e)||(delete o[e],c=!0)}else if(8&s){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let s=n[i];if(gr(e.emitsOptions,s))continue;const d=t[s];if(l)if(H(o,s))d!==o[s]&&(o[s]=d,c=!0);else{const t=re(s);r[t]=$i(l,a,t,d,e,!1)}else d!==o[s]&&(o[s]=d,c=!0)}}c&&ot(e.attrs,"set","")}(e,t.props,i,n),((e,t,n)=>{const{vnode:i,slots:r}=e;let o=!0,s=R;if(32&i.shapeFlag){const e=t._;e?n&&1===e?o=!1:Qi(r,t,n):(o=!t.$stable,Ki(t,r)),s=t}else t&&(Ji(e,t),s={default:1});if(o)for(const e in r)Wi(e)||null!=s[e]||delete r[e]})(e,t.children,n),We(),kn(e),Ye()},O=(e,t,n,i,r,o,s,a,l=!1)=>{const d=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void D(d,h,n,i,r,o,s,a,l);if(256&p)return void I(d,h,n,i,r,o,s,a,l)}8&f?(16&u&&G(d,r,o),h!==d&&c(n,h)):16&u?16&f?D(d,h,n,i,r,o,s,a,l):G(d,r,o,!0):(8&u&&c(n,""),16&f&&x(h,n,i,r,o,s,a,l))},I=(e,t,n,i,r,o,s,a,l)=>{t=t||L;const c=(e=e||L).length,d=t.length,u=Math.min(c,d);let h;for(h=0;h<u;h++){const i=t[h]=l?Kr(t[h]):Xr(t[h]);f(e[h],i,n,null,r,o,s,a,l)}c>d?G(e,r,o,!0,!1,u):x(t,n,i,r,o,s,a,l,u)},D=(e,t,n,i,r,o,s,a,l)=>{let c=0;const d=t.length;let u=e.length-1,h=d-1;for(;c<=u&&c<=h;){const i=e[c],d=t[c]=l?Kr(t[c]):Xr(t[c]);if(!jr(i,d))break;f(i,d,n,null,r,o,s,a,l),c++}for(;c<=u&&c<=h;){const i=e[u],c=t[h]=l?Kr(t[h]):Xr(t[h]);if(!jr(i,c))break;f(i,c,n,null,r,o,s,a,l),u--,h--}if(c>u){if(c<=h){const e=h+1,u=e<d?t[e].el:i;for(;c<=h;)f(null,t[c]=l?Kr(t[c]):Xr(t[c]),n,u,r,o,s,a,l),c++}}else if(c>h)for(;c<=u;)j(e[c],r,o,!0),c++;else{const p=c,m=c,_=new Map;for(c=m;c<=h;c++){const e=t[c]=l?Kr(t[c]):Xr(t[c]);null!=e.key&&_.set(e.key,c)}let g,b=0;const y=h-m+1;let v=!1,w=0;const x=new Array(y);for(c=0;c<y;c++)x[c]=0;for(c=p;c<=u;c++){const i=e[c];if(b>=y){j(i,r,o,!0);continue}let d;if(null!=i.key)d=_.get(i.key);else for(g=m;g<=h;g++)if(0===x[g-m]&&jr(i,t[g])){d=g;break}void 0===d?j(i,r,o,!0):(x[d-m]=c+1,d>=w?w=d:v=!0,f(i,t[d],n,null,r,o,s,a,l),b++)}const k=v?function(e){const t=e.slice(),n=[0];let i,r,o,s,a;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(r=n[n.length-1],e[r]<l){t[i]=r,n.push(i);continue}for(o=0,s=n.length-1;o<s;)a=o+s>>1,e[n[a]]<l?o=a+1:s=a;l<e[n[o]]&&(o>0&&(t[i]=n[o-1]),n[o]=i)}}o=n.length,s=n[o-1];for(;o-- >0;)n[o]=s,s=t[s];return n}(x):L;for(g=k.length-1,c=y-1;c>=0;c--){const e=m+c,u=t[e],h=t[e+1],p=e+1<d?h.el||h.placeholder:i;0===x[c]?f(null,u,n,p,r,o,s,a,l):v&&(g<0||c!==k[g]?B(u,n,p,2):g--)}}},B=(e,t,r,o,s=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:h}=e;if(6&h)return void B(e.component.subTree,t,r,o);if(128&h)return void e.suspense.move(t,r,o);if(64&h)return void l.move(e,t,r,Y);if(l===Cr){n(a,t,r);for(let e=0;e<d.length;e++)B(d[e],t,r,o);return void n(e.anchor,t,r)}if(l===Ar)return void(({el:e,anchor:t},i,r)=>{let o;for(;e&&e!==t;)o=u(e),n(e,i,r),e=o;n(t,i,r)})(e,t,r);if(2!==o&&1&h&&c)if(0===o)c.beforeEnter(a),n(a,t,r),Zi(()=>c.enter(a),s);else{const{leave:o,delayLeave:s,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?i(a):n(a,t,r)},u=()=>{a._isLeaving&&a[En](!0),o(a,()=>{d(),l&&l()})};s?s(a,d,u):u()}else n(a,t,r)},j=(e,t,n,i=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h,cacheIndex:p}=e;if(-2===u&&(r=!1),null!=a&&(We(),Hn(a,null,n,e,!0),Ye()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const f=1&d&&h,m=!Gn(e);let _;if(m&&(_=s&&s.onVnodeBeforeUnmount)&&Qr(_,t,e),6&d)$(e.component,n,i);else{if(128&d)return void e.suspense.unmount(n,i);f&&On(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,Y,i):c&&!c.hasOnce&&(o!==Cr||u>0&&64&u)?G(c,t,n,!1,!0):(o===Cr&&384&u||!r&&16&d)&&G(l,t,n),i&&q(e)}(m&&(_=s&&s.onVnodeUnmounted)||f)&&Zi(()=>{_&&Qr(_,t,e),f&&On(e,null,t,"unmounted")},n)},q=e=>{const{type:t,el:n,anchor:r,transition:o}=e;if(t===Cr)return void F(n,r);if(t===Ar)return void b(e);const s=()=>{i(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&e.shapeFlag&&o&&!o.persisted){const{leave:t,delayLeave:i}=o,r=()=>t(n,s);i?i(e.el,s,r):r()}else s()},F=(e,t)=>{let n;for(;e!==t;)n=u(e),i(e),e=n;i(t)},$=(e,t,n)=>{const{bum:i,scope:r,job:o,subTree:s,um:a,m:l,a:c}=e;sr(l),sr(c),i&&de(i),r.stop(),o&&(o.flags|=8,j(s,e,t,n)),a&&Zi(a,t),Zi(()=>{e.isUnmounted=!0},t)},G=(e,t,n,i=!1,r=!1,o=0)=>{for(let s=o;s<e.length;s++)j(e[s],t,n,i,r)},V=e=>{if(6&e.shapeFlag)return V(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[Rn];return n?u(n):t};let U=!1;const W=(e,t,n)=>{null==e?t._vnode&&j(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),t._vnode=e,U||(U=!0,kn(),Sn(),U=!1)},Y={p:f,um:j,m:B,r:q,mt:A,mc:x,pc:O,pbc:S,n:V,o:e};let X,K;return t&&([X,K]=t(Y)),{render:W,hydrate:X,createApp:Ii(W,X)}}function tr({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ir(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function rr(e,t,n=!1){const i=e.children,r=t.children;if($(i)&&$(r))for(let e=0;e<i.length;e++){const t=i[e];let o=r[e];1&o.shapeFlag&&!o.dynamicChildren&&((o.patchFlag<=0||32===o.patchFlag)&&(o=r[e]=Kr(r[e]),o.el=t.el),n||-2===o.patchFlag||rr(t,o)),o.type===Mr&&-1!==o.patchFlag&&(o.el=t.el),o.type!==zr||o.el||(o.el=t.el)}}function or(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:or(t)}function sr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const ar=Symbol.for("v-scx"),lr=()=>{{const e=Bi(ar);return e}};function cr(e,t,n){return dr(e,t,n)}function dr(e,t,n=R){const{immediate:i,deep:r,flush:o,once:s}=n;const a=j({},n);const l=t&&i||!t&&"post"!==o;let c;if(ho)if("sync"===o){const e=lr();c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=E,e.resume=E,e.pause=E,e}const d=no;a.call=(e,t,n)=>dn(e,d,t,n);let u=!1;"post"===o?a.scheduler=e=>{Zi(e,d&&d.suspense)}:"sync"!==o&&(u=!0,a.scheduler=(e,t)=>{t?e():vn(e)}),a.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const h=an(e,t,a);return ho&&(c?c.push(h):l&&h()),h}function ur(e,t,n){const i=this.proxy,r=W(e)?e.includes(".")?hr(i,e):()=>i[e]:e.bind(i,i);let o;U(t)?o=t:(o=t.handler,n=t);const s=so(this),a=dr(r,o.bind(i),n);return s(),a}function hr(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const pr=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${re(t)}Modifiers`]||e[`${se(t)}Modifiers`];function fr(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||R;let r=n;const o=t.startsWith("update:"),s=o&&pr(i,t.slice(7));let a;s&&(s.trim&&(r=n.map(e=>W(e)?e.trim():e)),s.number&&(r=n.map(he)));let l=i[a=le(t)]||i[a=le(re(t))];!l&&o&&(l=i[a=le(se(t))]),l&&dn(l,e,6,r);const c=i[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,dn(c,e,6,r)}}const mr=new WeakMap;function _r(e,t,n=!1){const i=n?mr:t.emitsCache,r=i.get(e);if(void 0!==r)return r;const o=e.emits;let s={},a=!1;if(!U(e)){const i=e=>{const n=_r(e,t,!0);n&&(a=!0,j(s,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return o||a?($(o)?o.forEach(e=>s[e]=null):j(s,o),X(e)&&i.set(e,s),s):(X(e)&&i.set(e,null),null)}function gr(e,t){return!(!e||!D(t))&&(t=t.slice(2).replace(/Once$/,""),H(e,t[0].toLowerCase()+t.slice(1))||H(e,se(t))||H(e,t))}function br(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[o],slots:s,attrs:a,emit:l,render:c,renderCache:d,props:u,data:h,setupState:p,ctx:f,inheritAttrs:m}=e,_=Tn(e);let g,b;try{if(4&n.shapeFlag){const e=r||i,t=e;g=Xr(c.call(t,e,d,u,p,h,f)),b=a}else{const e=t;0,g=Xr(e.length>1?e(u,{attrs:a,slots:s,emit:l}):e(u,null)),b=t.props?a:yr(a)}}catch(t){Tr.length=0,un(t,e,1),g=$r(zr)}let y=g;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=y;e.length&&7&t&&(o&&e.some(B)&&(b=vr(b,o)),y=Vr(y,b,!1,!0))}return n.dirs&&(y=Vr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Dn(y,n.transition),g=y,Tn(_),g}const yr=e=>{let t;for(const n in e)("class"===n||"style"===n||D(n))&&((t||(t={}))[n]=e[n]);return t},vr=(e,t)=>{const n={};for(const i in e)B(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function wr(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;r<i.length;r++){const o=i[r];if(t[o]!==e[o]&&!gr(n,o))return!0}return!1}function xr({vnode:e,parent:t},n){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.el=e.el),i!==e)break;(e=t.vnode).el=n,t=t.parent}}const kr=e=>e.__isSuspense;function Sr(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):xn(e)}const Cr=Symbol.for("v-fgt"),Mr=Symbol.for("v-txt"),zr=Symbol.for("v-cmt"),Ar=Symbol.for("v-stc"),Tr=[];let Pr=null;function Nr(e=!1){Tr.push(Pr=e?null:[])}function Or(){Tr.pop(),Pr=Tr[Tr.length-1]||null}let Rr=1;function Lr(e,t=!1){Rr+=e,e<0&&Pr&&t&&(Pr.hasOnce=!0)}function Er(e){return e.dynamicChildren=Rr>0?Pr||L:null,Or(),Rr>0&&Pr&&Pr.push(e),e}function Ir(e,t,n,i,r,o){return Er(Hr(e,t,n,i,r,o,!0))}function Dr(e,t,n,i,r){return Er($r(e,t,n,i,r,!0))}function Br(e){return!!e&&!0===e.__v_isVNode}function jr(e,t){return e.type===t.type&&e.key===t.key}const qr=({key:e})=>null!=e?e:null,Fr=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?W(e)||Xt(e)||U(e)?{i:zn,r:e,k:t,f:!!n}:e:null);function Hr(e,t=null,n=null,i=0,r=null,o=(e===Cr?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qr(t),ref:t&&Fr(t),scopeId:An,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:zn};return a?(Jr(l,n),128&o&&e.normalize(l)):n&&(l.shapeFlag|=W(n)?8:16),Rr>0&&!s&&Pr&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&Pr.push(l),l}const $r=Gr;function Gr(e,t=null,n=null,i=0,r=null,o=!1){if(e&&e!==hi||(e=zr),Br(e)){const i=Vr(e,t,!0);return n&&Jr(i,n),Rr>0&&!o&&Pr&&(6&i.shapeFlag?Pr[Pr.indexOf(e)]=i:Pr.push(i)),i.patchFlag=-2,i}if(vo(e)&&(e=e.__vccOpts),t){t=function(e){return e?Gt(e)||Fi(e)?j({},e):e:null}(t);let{class:e,style:n}=t;e&&!W(e)&&(t.class=ve(e)),X(n)&&(Gt(n)&&!$(n)&&(n=j({},n)),t.style=me(n))}return Hr(e,t,n,i,r,W(e)?1:kr(e)?128:Ln(e)?64:X(e)?4:U(e)?2:0,o,!0)}function Vr(e,t,n=!1,i=!1){const{props:r,ref:o,patchFlag:s,children:a,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=ve([t.class,i.class]));else if("style"===e)t.style=me([t.style,i.style]);else if(D(e)){const n=t[e],r=i[e];!r||n===r||$(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=i[e])}return t}(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&qr(c),ref:t&&t.ref?n&&o?$(o)?o.concat(Fr(t)):[o,Fr(t)]:Fr(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Cr?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vr(e.ssContent),ssFallback:e.ssFallback&&Vr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Dn(d,l.clone(d)),d}function Ur(e=" ",t=0){return $r(Mr,null,e,t)}function Wr(e,t){const n=$r(Ar,null,e);return n.staticCount=t,n}function Yr(e="",t=!1){return t?(Nr(),Dr(zr,null,e)):$r(zr,null,e)}function Xr(e){return null==e||"boolean"==typeof e?$r(zr):$(e)?$r(Cr,null,e.slice()):Br(e)?Kr(e):$r(Mr,null,String(e))}function Kr(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Vr(e)}function Jr(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if($(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),Jr(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||Fi(t)?3===i&&zn&&(1===zn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=zn}}else U(t)?(t={default:t,_ctx:zn},n=32):(t=String(t),64&i?(n=16,t=[Ur(t)]):n=8);e.children=t,e.shapeFlag|=n}function Qr(e,t,n,i=null){dn(e,t,7,[n,i])}const Zr=Li();let eo=0;function to(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||Zr,o={uid:eo++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Pe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Vi(i,r),emitsOptions:_r(i,r),emit:null,emitted:null,propsDefaults:R,inheritAttrs:i.inheritAttrs,ctx:R,data:R,props:R,attrs:R,slots:R,refs:R,setupState:R,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=fr.bind(null,o),e.ce&&e.ce(o),o}let no=null;const io=()=>no||zn;let ro,oo;{const e=fe(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};ro=t("__VUE_INSTANCE_SETTERS__",e=>no=e),oo=t("__VUE_SSR_SETTERS__",e=>ho=e)}const so=e=>{const t=no;return ro(e),e.scope.on(),()=>{e.scope.off(),ro(t)}},ao=()=>{no&&no.scope.off(),ro(null)};function lo(e){return 4&e.vnode.shapeFlag}let co,uo,ho=!1;function po(e,t=!1,n=!1){t&&oo(t);const{props:i,children:r}=e.vnode,o=lo(e);!function(e,t,n,i=!1){const r={},o=qi();e.propsDefaults=Object.create(null),Hi(e,t,r,o);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:Bt(r):e.type.props?e.props=r:e.props=o,e.attrs=o}(e,i,o,t),((e,t,n)=>{const i=e.slots=qi();if(32&e.vnode.shapeFlag){const e=t._;e?(Qi(i,t,n),n&&ue(i,"_",e,!0)):Ki(t,i)}else t&&Ji(e,t)})(e,r,n||t);const s=o?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vi),!1;const{setup:i}=n;if(i){We();const n=e.setupContext=i.length>1?go(e):null,r=so(e),o=cn(i,e,0,[e.props,n]),s=K(o);if(Ye(),r(),!s&&!e.sp||Gn(e)||jn(e),s){if(o.then(ao,ao),t)return o.then(n=>{fo(e,n,t)}).catch(t=>{un(t,e,0)});e.asyncDep=o}else fo(e,o,t)}else mo(e,t)}(e,t):void 0;return t&&oo(!1),s}function fo(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:X(t)&&(e.setupState=tn(t)),mo(e,n)}function mo(e,t,n){const i=e.type;if(!e.render){if(!t&&co&&!i.render){const t=i.template||Mi(e).template;if(t){0;const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:o,compilerOptions:s}=i,a=j(j({isCustomElement:n,delimiters:o},r),s);i.render=co(t,a)}}e.render=i.render||E,uo&&uo(e)}{const t=so(e);We();try{ki(e)}finally{Ye(),t()}}}const _o={get:(e,t)=>(rt(e,0,""),e[t])};function go(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,_o),slots:e.slots,emit:e.emit,expose:t}}function bo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tn(Ut(e.exposed)),{get:(t,n)=>n in t?t[n]:n in bi?bi[n](e):void 0,has:(e,t)=>t in e||t in bi})):e.proxy}function yo(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}function vo(e){return U(e)&&"__vccOpts"in e}const wo=(e,t)=>{const n=function(e,t,n=!1){let i,r;return U(e)?i=e:(i=e.get,r=e.set),new nn(i,r,n)}(e,0,ho);return n};const xo="3.5.21";class ko{static get_default(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static to_array(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static is_default(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f}static get_matrix(e,t,n,i,r,o){return{a:e,b:t,c:n,d:i,e:r,f:o}}static get_matrix_translate(e,t){return{a:1,b:0,c:0,d:1,e,f:t}}static get_matrix_scale(e,t){return{a:e,b:0,c:0,d:t,e:0,f:0}}static get_matrix_reflection_horizental(){return{a:1,b:0,c:0,d:-1,e:0,f:0}}static get_matrix_reflection_vertical(){return{a:-1,b:0,c:0,d:1,e:0,f:0}}static multiply(e,t){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}static translate(e,t,n){const i=this.get_matrix_translate(t,n);return this.multiply(e,i)}static get_dom_string(e){const{a:t,b:n,c:i,d:r,e:o,f:s}=e;return`matrix(${t.toFixed(1)},${n},${i},${r.toFixed(1)},${o.toFixed(1)},${s.toFixed(1)})`}static map_point_to_view(e,t){return{x:e.x+t.x,y:e.y+t.y}}static view_point_to_map(e,t){return{x:e.x-t.x,y:e.y-t.y}}}class So{static path=document.createElementNS("http://www.w3.org/2000/svg","path");static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t){const n=t.y-e.y,i=t.x-e.x;if(0===i)return Number.POSITIVE_INFINITY;return n/i}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:o}=t;for(let t of e){let e=(r-t.x)**2+(o-t.y)**2;e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let o=0;o<e.length;o++){const s=e[o];for(let e=0;e<t.length;e++){const o=t[e],a=s.x-o.x,l=s.y-o.y,c=a*a+l*l;c<n&&(n=c,i=s,r=o)}}return{from:i,to:r}}static polygonCentroid(e){let t=0,n=0,i=0;const r=e.length;for(let o=0;o<r;o++){const{x:s,y:a}=e[o],{x:l,y:c}=e[(o+1)%r],d=s*c-l*a;i+=d,t+=(s+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:o}=e[i],{x:s,y:a}=e[(i+1)%n];t+=r*a-s*o}return t/2}static find_line_to_layout_root(e,t=new Set){if(e.is_layout_root)return{has_root:!0,line:[e]};t.add(e.id);for(let n of e.from){if(t.has(n))continue;const i=e.pcube.get_node(n);if(i){if(i.is_layout_root)return{has_root:!0,line:[e,i]};{const n=this.find_line_to_layout_root(i,t);if(n.has_root)return n.line.unshift(e),n}}}return{has_root:!1,line:[]}}static get_linker_id(e,t){return e+"-"+t}static wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}static create_linker_info(e,t,n){const i=e.get_node(t),r=e.get_node(n),o=i?.to.size||0,s=r?.from.size||0;return{linker:Gd.get_default(t,n),index_from:s,index_to:o}}}class Co{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof Ac)return e}get courier(){return this.root.courier}get history(){return this.root.history}get cursor(){return this.root.cursor}get event(){return this.root.event}get listener(){return this.root.listener}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get config(){return this.root.config}get stats(){return this.root.stats}get hotkeys(){return this.root.hotkeys}constructor(e){this._root=e}}class Mo{static _funcs=new Map;static get url(){return this._funcs.get("asset-url")}static get tips(){return this._funcs.get("tip")}static register_asset_url(e){this._funcs.set("asset-url",e)}static register_tip(e){this._funcs.set("tip",e)}}let zo=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};class Ao{static docs=new Map;static maps=new Map;static _cubes=new Map;static _metas_cube=new Map;static get metas_cube(){const e=new Map;for(let[t,n]of this._cubes)e.set(t,n.meta);return e}static init(){this.register_cube_core()}static add_doc(e){this.docs.set(e.id,e)}static add_map(e){this.maps.set(e.id,e)}static register_cube(e){const t=e.meta;t||console.error(`NoteManager: can't find static member meta in ${e}`),this._cubes.set(t.type,e)}static find_cube(e){return this._cubes.get(e)}static export_versions(){const e={[Ac.meta.type]:Ac.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.112.0",time_publish:1769253529405}}static register_cube_core(){Ao.register_cube(ol),Ao.register_cube(Pc),Ao.register_cube(ka),Ao.register_cube(nl),Ao.register_cube(Ga),Ao.register_cube(Ba),Ao.register_cube(Za),Ao.register_cube(Ru),Ao.register_cube(qu),Ao.register_cube(Au),Ao.register_cube(Jw),Ao.register_cube(wu),Ao.register_cube(Uw),Ao.register_cube(Pw),Ao.register_cube(M_),Ao.register_cube(pu),Ao.register_cube(Ec),Ao.register_cube(qc),Ao.register_cube(tu),Ao.register_cube(Gd),Ao.register_cube(nx),Ao.register_cube($d),Ao.register_cube(ax)}}class To{static get_id(){return zo()}static get_char_zws(){return"​"}static async sleep(e=100){return new Promise(t=>{setTimeout(t,e)})}static is_same_style(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n){if(e[i]!==t[i])return!1}return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n){if(e[i]!==t[i])return!1}return!0}async locate(e,t,n=!0){const{courier:i,history:r}=e,o=e.find_cube(t),s=Mo.tips;if(o instanceof cs&&o.top){const e=o.top;if(o.find_upstream_untill(e)!==e.child_first){const t=i.get_recorder();t.tell(e,Lo.fold(e.id,!1)),r.record(t)}}const a=document.getElementById(t);if(!a)return s?.tip_error("未发现书签锚点");let l=a.style.backgroundColor;a.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===a.style.backgroundColor&&(a.style.backgroundColor=l)},3e3),n&&a.scrollIntoView({block:"center",behavior:"instant"})}static exports(e){const t=[];for(let n of e)t.push(n.export());return t}static build_cubes(e,t){const n=[];for(let i of e){if(!i)continue;let e=Ao.find_cube(i.type);if(e)n.push(new e(i,t));else{const e=new Aa(i,t,"未注册cube");n.push(e)}}return n}static get_client_rects(e){const t=document.getElementById(e);if(t)return t.getClientRects()}static pick(e,t=!1){const i=Ao.metas_cube;let r=[],o=[],s=[],a=[],l=null,c=-1,d=-1,u=e,h=[];for(let t=0;t<e.length;t++){const i=e[t];if(i.type===n.box_root){u=e.slice(0,t),h=e.slice(t+1),l=i,a.push(l);break}}for(let e=0;e<u.length;e++){const t=u[e];i.get(t.type)?.block&&(c<0?c=e:d=e)}if(c>=0&&d>=0){const e=u.slice(0,c),t=u.slice(d+1),n=[];let a=Pc.get_default();a.info=[];for(let e of u.slice(c,d+1))i.get(e.type)?.block?(n.push(e),a.info.length>0&&(n.push(a),a=Pc.get_default(),a.info=[])):a.info.push(e);r=e,o=n,s=t}else c>=0&&d<0?(r=u.slice(0,c),o=u.slice(c,c+1),s=u.slice(c+1)):(r=u,o=[],s=[]);if(l){let e=Pc.get_default();e.info=[];for(let t of h)t.type===n.box_root?(l=t,a.push(t)):i.get(t.type)?.block?(t.type===n.box?l.info.push(...t.info):l.info.push(t),e.info.length>0&&l&&(l.info.push(e),e=Pc.get_default())):e.info.push(t);e.info.length>0&&l&&l.info.push(e)}const p=[];if(r.length>0&&p.push(Pc.get_default(r)),o.length>0&&p.push(...o),s.length>0&&p.push(Pc.get_default(s)),a.length>0)if(t)for(let e of a)p.push(...e.info);else p.push(...a);return{head:r,body:o,tail:s,root:a,sort:p}}static find_line(e,t="first"){if(e instanceof Pc)return e;const n=Ao.metas_cube.get(e.type);if(!n||!n.block)return;const i="first"===t?e.children:e.children.reverse();for(let e of i){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!ol.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,i=[];if(t)for(let e of n)i.push(e),i.push(...this.get_flat_cube(e));else{i.push(...n);for(let e of i)i.push(...e.children)}return i}static replace_id(e,t,n,i={}){const r=[];for(let o of n){const n=Ao.find_cube(o.type);if(!n||!n.replace_id)continue;const s=t[n.meta.type]||1,a=n.update_data(s,o);r.push(n.replace_id(e,a.data,i))}return r}static insert_cubes(e,t){const{courier:n,history:i,cursor:r}=e,{cube_selection:o,cube_start:s,cube_end:a,offset_end:l,offset_start:c}=r;if(!o||!s||!a)return;const d=new Ro(n);return r.has_selection&&d.tell(o,Lo.delete(o.id,"backward",s.id,a.id,c,l)),d.tell(s,Lo.insert(s.id,t,s.id,s.id,c,c)),d}static check_mouse_key(e,t){let n={left:{pointermove:{button:-1,buttons:1},pointerdown:{button:0,buttons:1},pointerup:{button:0,buttons:0}},right:{pointermove:{button:-1,buttons:2},pointerdown:{button:2,buttons:2},pointerup:{button:2,buttons:0}},mid:{pointermove:{button:-1,buttons:4},pointerdown:{button:1,buttons:4},pointerup:{button:1,buttons:0}}}[t][e.type];return e.button==n.button&&e.buttons==n.buttons}}class Po{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class No extends Co{_record;_resolve;_status=C.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return No.meta}get status(){return this._status}constructor(e,t){const n=Mo.tips;super(e),this._record=t,this._prev_tip_remove=n?.tip_info("播放器已就绪,点我播放",1/0,this.play.bind(this))}waiting(){return new Promise(e=>{this._resolve=e;[C.pending,C.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=Mo.tips;this.clear_message(),this.status!==C.stop&&(this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)));for(let e of this._record.stack){const t=this.courier.get_recorder();for(let n of e.do){await To.sleep(this.config.data.player_speed),await yn(),this.stats.showing=!0;let e=this.root.find_cube(n.id);e?(e.dom?.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}),t.tell(e,n)):console.warn(`未发现演示cube:${n}`)}await yn(),this.history.record(t),await this.waiting()}this._status=C.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=Mo.tips;this.clear_message(),this._status!==C.stop&&(this._status=C.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=Mo.tips;this.clear_message(),this._status!==C.stop&&(this._resolve&&this._resolve(),this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)))}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.player,version:1}}}class Oo extends Co{stack_undo=Bt([]);stack_redo=Bt([]);get meta(){return Oo.meta}get len_undo(){return this.stack_undo.length}get len_redo(){return this.stack_redo.length}constructor(e){super(e)}execute_command_group(e){let t=Promise.resolve();for(let n of e)t.then(()=>yn(()=>this.courier.pass(n)))}undo(){const e=Mo.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_undo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_redo.push(t);const n=t.stack_undo;this.execute_command_group(n),this.event.emit_status_update()}redo(){const e=Mo.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_redo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_undo.push(t);const n=t.stack_do;this.execute_command_group(n),this.event.emit_status_update()}record(e){if(!this.stats.is_read_mode&&0!==e.stack_undo.length){if(this.config.data.history_length>0&&this.config.data.history_length<Number.POSITIVE_INFINITY){const e=this.stack_undo.length-this.config.data.history_length;e>0&&this.stack_undo.splice(0,e)}this.stack_undo.push(e),this.event.emit_status_update()}}play(e){return new No(this.root,e)}export(e=0){const t=this.stack_undo.slice(e),n={version:this.meta.version,stack:[],docid:this.root.id};for(let e of t)n.stack.push({do:e.stack_do,undo:e.stack_undo});return n}download(e="record.json"){const t=this.export(),n=document.createElement("a");n.download="filename";const i=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(i),n.click()}update_data(...e){return{}}clear_stack(){this.stack_undo.length=0,this.stack_redo.length=0,this.event.emit_status_update()}static get meta(){return{type:t.history,version:1}}}class Ro{do=[];undo=[];courier;get len_do(){return this.do.length}get len_undo(){return this.undo.length}get stack_do(){const e=[];return e.push(...this.do),e}get stack_undo(){const e=[];return e.push(...this.undo),e}constructor(e){this.courier=e}add_cmd(e){this.do.push(structuredClone(Vt(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof Ro&&this.merge(t)}tick(e,t){yn(()=>{t?this.tell(t,e):this.courier.pass(e)})}get_cube_upstream(e,t=!0){let n=[],i=t?e:e.pcube;for(;i;)n.push(i),i=i.pcube;return n}tell(e,...t){const n=Mo.tips;if(!e)return this;if(this.courier.stats.mode===z.read)return n?.tip_info("只读模式不可操作"),this;const i=this.get_cube_upstream(e,!1).reverse();if(e instanceof cs)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_capture(r).stop)return this}for(let n of t){if(!e||e.id!==n.id)continue;console.log("🟩",e,e.type,n),this.courier.event.emit_edit_before(e,n);let t=e.on(n);this.merge(t),this.courier.event.emit_edit_after(e,n)}if(e instanceof cs)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_bubble(r).stop)return this}return this}merge(e){return e instanceof Ro?(this.do.push(...structuredClone(Vt(e.stack_do))),this.undo.unshift(...structuredClone(Vt(e.stack_undo))),this):this}}class Lo{static insert_child(e,t,n){return{id:e,name:i.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,r=!1){return{id:e,name:i.cube_delete_child,dir:t,range:n,reserve:r}}static insert(e,t,n,r,o,s){return{id:e,name:i.cube_insert,data:t,start_id:n,end_id:r,offset_end:s,offset_start:o}}static delete(e,t,n,r,o,s,a=!1){return{id:e,name:i.cube_delete,dir:t,start_id:n,end_id:r,offset_start:o,offset_end:s,reserve:a}}static delete_adjacent(e,t,n,r){return{id:e,name:i.cube_delete_adjacent,from:t,offset:r,from_id:n}}static set_selection_css(e,t,n,r,o,s,a=!1,l=!1){return{id:e,name:i.cube_set_selection_css,css:t,start_id:n,end_id:r,offset_start:o,offset_end:s,toggle:a,replace:l}}static set_css(e,t,n=!1,r=!1){return{id:e,name:i.cube_set_css,css:t,toggle:n,replace:r}}static partition(e,t,n,r,o){return{name:i.cube_partition,id:e,start_id:t,end_id:n,offset_start:r,offset_end:o}}static reorder(e,t,n){return{id:e,name:i.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:i.cube_reset,data:t}}static merge(e,t,n,r){return{id:e,name:i.cube_merge,method:t,cubeid:n,offset:r}}static postil_add(e,t=[]){return{name:i.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:i.cube_postil_remove,id:e,range:t}}static set_attr(e,t){return{id:e,name:i.cube_set_attr,attr:t}}static resize(e,t,n=-1){return n>0?this.set_attr(e,{width:t,height:n}):this.set_attr(e,{width:t})}static fold(e,t){return this.set_attr(e,{fold:t})}}class Eo{static loc(e,t,n,i){return{name:s.loc,id:e,from:n,from_offset:i,offset:t}}static in_head(e){return{id:e,name:s.cursor_in_head}}static in_tail(e){return{id:e,name:s.cursor_in_tail}}}var Io=r(1858);class Do{static layout_tree(e){const t=e.env.layout_type;if(t)return"right"===t?this.right(e):"left"===t?this.left(e):"down"===t?this.down(e):"up"===t?this.up(e):"time-down"===t?this.time_down(e):"time-right"===t?this.time_right(e):void 0}static right(e){const t=e.bound,n=t.size_bound,i=t.pos,r=t.size_tree;return{x:i.x,y:i.y+n.height/2-r.height/2}}static left(e){const t=e.bound,n=t.size_bound,i=t.pos,r=t.size_tree;return{x:i.x+n.width-r.width,y:i.y+n.height/2-r.height/2}}static down(e){const t=e.bound,n=t.size_bound,i=t.pos,r=t.size_tree;return{x:i.x+n.width/2-r.width/2,y:i.y}}static up(e){const t=e.bound,n=t.size_bound,i=t.pos,r=t.size_tree;return{x:i.x+n.width/2-r.width/2,y:i.y+n.height-r.height}}static time_down(e){const t=e.bound,n=t.size_bound,i=t.pos;let r=n.width;const o=e.env.downstream_visible;for(let e of o){const t=e.bound.size_bound.width;t>r&&(r=t)}return{x:i.x+n.width/2-r/2,y:i.y}}static time_right(e){const t=e.bound,n=t.size_bound,i=t.pos;let r=n.height;const o=e.env.downstream_visible;for(let e of o){const t=e.bound.size_bound.height;t>r&&(r=t)}return{x:i.x,y:i.y+n.height/2-r/2}}}class Bo{static layout_tree(e){if(0==e.count_to)return[];const t=e.env.layout_type,n=e.env.downstream_visible;return"right"===t?this.right(e,n):"left"===t?this.left(e,n):"down"===t?this.down(e,n):"up"===t?this.up(e,n):"time-down"===t?this.time_down(e,n):"time-right"===t?this.time_right(e,n):this.none(e,n),n}static none(e,t){for(let e=0;e<t.length;e++){const n=t[e],i=Do.layout_tree(n);i&&n.bound.update_pos_tree(i.x,i.y,!1)}}static right(e,t){const n=e.env.node_gap_x,i=e.env.node_gap_y,r=e.bound,{pos_tree:o,size_bound:s}=r;let a=o.x+n+s.width,l=o.y,c=0;for(let e=0;e<t.length;e++){const n=t[e].bound;n.update_pos_tree(a,l+c+e*i),c+=n.size_tree.height}}static left(e,t){const n=e.env.node_gap_x,i=e.env.node_gap_y,r=e.bound,{pos_tree:o,size_bound:s,size_tree:a}=r;let l=o.x+a.width-s.width-n,c=o.y,d=0;for(let e=0;e<t.length;e++){const n=t[e].bound;n.update_pos_tree(l-n.size_tree.width,c+d+e*i),d+=n.size_tree.height}}static down(e,t){const n=e.env.node_gap_x,i=e.env.node_gap_y,r=e.bound,{pos_tree:o,size_bound:s}=r;let a=o.x,l=o.y+i+s.height,c=0;for(let e=0;e<t.length;e++){const i=t[e].bound;i.update_pos_tree(a+c+e*n,l),c+=i.size_tree.width}}static up(e,t){const n=e.env.node_gap_x,i=e.env.node_gap_y,r=e.bound,{pos_tree:o,size_bound:s,size_tree:a}=r;let l=o.x,c=o.y+a.height-s.height-i,d=0;for(let e=0;e<t.length;e++){const i=t[e].bound;i.update_pos_tree(l+d+e*n,c-i.size_tree.height),d+=i.size_tree.width}}static time_right(e,t){const n=e.env.node_gap_x,i=(e.env.node_gap_y,e.bound),{pos:r,size_bound:o}=i;let s=r.x+o.width+n,a=r.y+o.height/2,l=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.bound,{size_bound:o,size_tree:c}=r,d=i.attrs.layout;"right"===d||"left"===d?r.update_pos_tree(s+l+e*n,a-c.height/2):"up"===d?r.update_pos_tree(s+l+e*n,a-(c.height-o.height/2)):r.update_pos_tree(s+l+e*n,a-o.height/2),l+=r.size_tree.width}}static time_down(e,t){const n=e.env.node_gap_y,i=e.bound,{pos:r,size_bound:o}=i;let s=r.x+o.width/2,a=r.y+o.height+n,l=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.bound,o=i.env.layout_type,{size_bound:c,size_tree:d}=r;"left"===o?r.update_pos_tree(s-(d.width-c.width/2),a+l+e*n):"down"===o||"up"===o?r.update_pos_tree(s-d.width/2,a+l+e*n):r.update_pos_tree(s-c.width/2,a+l+e*n),l+=r.size_tree.height}}}class jo{static layout_change(e,t){return{id:e,name:l.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:l.append_child,previd:t}}}class qo{static node_add(e,t){return{id:e,name:a.node_add,data:t}}static node_remove(e,t){return{id:e,name:a.node_remove,data:t}}static linker_add(e,t){return{id:e,name:a.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:a.linker_remove,data:t}}static update_attr(e,t){return{id:e,name:a.update_attrs,data:t}}}class Fo{handler=new Map;vip_handler=new Map;constructor(){}on(e){const t=this.get_vip_cmd_handler(e.name)||this.get_cmd_handler(e.name);if(t)return t(e)}get_cmd_handler(e){return this.handler.get(e)}get_vip_cmd_handler(e){return this.vip_handler.get(e)}set_cmd_handler(e,t){this.handler.set(e,t)}set_vip_cmd_handler(e,t){this.vip_handler.set(e,t)}event_capture(e){return{stop:!1}}event_bubble(e){return{stop:!1}}static get_default(...e){throw Error("sub-cube have't implement get_default method")}static get meta(){throw Error("sub-cube have't implement attribution meta")}}const Ho=new Map;class $o{static get_cmd_handler(e,t){const n=Ho.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=Ho.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),Ho.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=Ho.get(t.type);if(n)for(let[t,i]of n)e.set_vip_cmd_handler(t,i.bind(e))}}function Go(e){return(t,n)=>{const i=t[n];if(!i)return;const r=t.meta;$o.set_cmd_handler(r.type,e,i)}}class Vo extends Co{_id=zo();scroll_offset=100;_freeze=Kt(!1);get meta(){return Vo.meta}get id(){return this._id}pos=Dt({x:0,y:0,width:0,height:0});css=Dt({});get freeze(){return this._freeze.value}set freeze(e){this._freeze.value=e}_direction=null;get focus_cube(){return this.selection_line[this.selection_line.length-1]}get second_cube(){return this.selection_line.length<=1?void 0:this.selection_line[this.selection_line.length-2]}get len(){return this.selection_line.length}selection_line=[];constructor(e,t){super(e),this.selection_line.push(t),this.listener.check_float()}expand(e){if(!(this.focus_cube instanceof nl&&this._direction===e))if("up"===e){if("down"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.prev_cube||this.focus_cube.pcube;if(!e||e instanceof ls)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="up"),this.selection_line.push(e),this.update_area())}else{if("up"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.next_cube||this.focus_cube.pcube;if(!e||e instanceof ls)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="down"),this.selection_line.push(e),this.update_area())}}shrink(){1!==this.selection_line.length&&(this.selection_line.pop(),this.update_area())}update_area(e=!0){if(e){const e=[];for(let t of this.selection_line){const n=t.clientRect;n&&e.push(n)}if(0===e.length)return this.remove();const t=Io.MathRect.merge(...e);this.css.width=`${t.width}px`,this.css.height=`${t.height}px`,this.css.left=t.x+"px",this.css.top=t.y+"px",this.pos.x=t.x+document.documentElement.scrollLeft,this.pos.y=t.y+document.documentElement.scrollTop,this.pos.width=t.width,this.pos.height=t.height}else{const e=this.pos.x-document.documentElement.scrollLeft,t=this.pos.y-document.documentElement.scrollTop;this.css.left=e+"px",this.css.top=t+"px"}}find_line_next(e){if(this.selection_line.indexOf(e)<this.selection_line.length)return this.selection_line[this.selection_line.length-1]}find_line_prev(e){const t=this.selection_line.indexOf(e);if(t>0)return this.selection_line[t-1]}get_scope_info(){let e=this.focus_cube.level;const t=this.focus_cube.pcube,n=[],i=[];for(let t of this.selection_line){const r=t.level,o=t.index;r===e&&(n.push(t),i.push(o))}return{cube:t,range:[Math.min(...i),Math.max(...i)+1],from:this.id}}remove(){this.root.remove_scope(this.id),this.event.emit_status_update()}find_scope_lines(){const e=this.root.get_scope_cubes(),t=[],n=[];for(let n of e)t.push(...To.get_flat_cube(n.cube));for(let e of t)e instanceof Pc&&n.push(e);return n}find_inline_data(){const e=[],t=this.find_scope_lines();for(let n of t)e.push(...n.children);return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.scope,version:1}}}class Uo extends Co{timer_float_check=!1;constructor(e){super(e),this.listen()}listen(){this.listen_esc()}listen_esc(){this.event.on_esc(()=>{const e=this.root.cubes.postils;for(let[t,n]of e)n.show&&(n.show=!1);this.root instanceof su&&this.root.clear_node_editing();const t=this.root.cubes.get_types_cube(n.submap);for(let[e,n]of t)n.clear_node_editing()})}check_float(){const{stats:e,cubes:t}=this.root;this.timer_float_check||requestAnimationFrame(()=>{let e=!0;for(let t of this.root.scope)e=!1,t.update_area();for(let[n,i]of t.postils)i.show&&(e=!1,i.update_pos());e||this.check_float()})}}class Wo extends Co{_map=Bt({});_types=Bt(new Map);_count=Bt({});constructor(e){super(e)}get postils(){return this._types.get(n.postil)||new Map}get meta(){return Wo.meta}get_types_cube(e){return this._types.get(e)||new Map}add_cube(e){const t=e.id,n=e.meta.type;void 0===this._count[t]?this._count[t]=1:this._count[t]++,this._map[t]=e;const i=this._types.get(n);i?i.set(t,e):this._types.set(n,Bt(new Map([[t,e]])))}remove_cube(e){const t=e.id,n=e.meta.type;0===--this._count[t]&&(delete this._map[t],this._types.get(n)?.delete(t))}find_cube(e){return this._map[e]}find_postil(e){for(let t of Object.values(this.postils)){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}clear_all_map_selected(){const e=this.get_types_cube(n.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof su&&this.root.clear_node_selected()}static get meta(){return{type:t.cubes,version:1}}}function Yo(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}const Xo=new Map;function Ko(e){return(t,n)=>{let i=t[n];Xo.set(e,i)}}class Jo extends Co{handlers=Dt(new Map);data;get meta(){return Jo.meta}constructor(e){super(e),this.data=Dt(Jo.default_hotkeys)}listen(e){this.listen_cursor_hotkey(e),this.listen_uncursor_hotkey(e),this.listen_cvx(e)}listen_cursor_hotkey(e){const t=this;e.addEventListener("keydown",e=>{const n=t.stats.mode,i=e.key.toLowerCase(),r=document.activeElement;let o=!1;if(n===z.edit&&r!==document.body){for(let[n,i]of Xo){let r=t.data[n];r.cursor&&(t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i.bind(t)(e)))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor&&(t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i(e)))}if(!o&&"tab"===i){o=!0;const{cursor:t,courier:n,history:i}=this,{cube_end:r,cube_start:s,offset_start:a,offset_end:l,has_selection:c,cube_selection:d}=t,u=n.get_recorder();if(!d||!r||!s)return;e.preventDefault(),c&&u.tell(d,Lo.delete(d.id,"backward",s.id,r.id,a,l,!0));const h=s.text,p=h.slice(0,a)+"\t"+h.slice(a),f=il.reset(s.id,p),m=Eo.loc(s.id,a+1,s.id,l);u.tell(s,f,m),i.record(u)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,i=document.activeElement,r=[P.down,P.left,P.right,P.up],o=e.key.toLowerCase();this.root;let s=!1;if(this.cursor.cube_end||i===document.body){for(let[n,i]of Xo){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i.bind(t)(e))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i(e))}}s||i!==document.body||n!==z.edit||(" "===o?this.listen_map_space(e):"backspace"===o||"delete"===o?this.listen_map_delete(e):"enter"===o?this.listen_map_enter(e):"tab"===o?this.listen_map_tab(e):r.includes(o)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,i=e.key.toLowerCase(),r=this.cubes.get_types_cube(n.submap),o=[P.down,P.left,P.right,P.up];if(t instanceof su&&t.get_nodes_selected().size>0)o.includes(i)&&t.move_select(i);else for(let[e,t]of r)t.move_select(i)}listen_map_delete(e){const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof su){const e=[...this.root.get_nodes_selected()].map(e=>e.id);r.tell(this.root,qo.node_remove(this.root.id,e))}const o=this.cubes.get_types_cube(n.submap);for(let[e,t]of o){const e=[...t.get_nodes_selected()].map(e=>e.id);r.tell(t,qo.node_remove(t.id,e))}i.record(r)}listen_map_enter(e){const{courier:t,history:i}=this,r=t.get_recorder();let o=!1;if(this.root instanceof su){const t=this.root.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){o=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const s=jo.append_child(t.id,i);r.tell(t,s)}}const s=this.cubes.get_types_cube(n.submap);for(let[t,n]of s){const t=n.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){o=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const s=jo.append_child(t.id,i);r.tell(t,s)}}o&&Mo.tips?.tip_warning("无法在没有布局上游的节点添加同级"),i.record(r)}listen_map_tab(e){e.preventDefault();const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof su){const e=this.root.get_nodes_selected();for(let t of e){const e=jo.append_child(t.id);r.tell(t,e)}}const o=this.cubes.get_types_cube(n.submap);for(let[e,t]of o){const e=t.get_nodes_selected();for(let t of e){const e=jo.append_child(t.id);r.tell(t,e)}}i.record(r)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof su){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const i=t.cubes.get_types_cube(n.submap);for(let[e,t]of i){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof su&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof ol&&t){e.preventDefault();const n=await this.clipboard.paste(t);this.history.record(n)}}),t.addEventListener("copy",e=>{const t=e.clipboardData,{doc:n,hotkeys:i,cursor:r}=this;t&&(this.root.scope_count_normal>0||r.has_selection||r.cube_end instanceof ol)&&(e.preventDefault(),this.clipboard.copy(t))}),t.addEventListener("cut",e=>{const t=e.clipboardData,{root:n,cursor:i}=this;t&&(n.scope_count_normal>0||i.cube_end instanceof ol)&&(e.preventDefault(),this.clipboard.cut(t))})}register(e,t){this.data[t.name]=t,this.handlers.set(t.name,e)}reset(e){Object.assign(this.data,e)}reset_handler(e,t){this.handlers.set(e,t)}export(){return structuredClone(Vt(this.data))}update_data(...e){return{}}validate(e,t){return t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&t.ctrl===e.ctrlKey&&(0===t.key.length||t.key.includes(e.key.toLocaleLowerCase()))}which(e){for(let t of Object.values(this.data))if(this.validate(e,t))return t}validate_hotkeys(e){for(let t of Object.values(this.data))if(this.validate(e,t))return!0;return!1}get_hotkey_str(e){const t=this.data[e];if(!t)return"";let n="";return t.meta&&(n+="meta + "),t.ctrl&&(n+="ctrl + "),t.alt&&(n+="alt + "),t.shift&&(n+="shift + "),n+=t.key,n}clear_scope(e){e.preventDefault(),this.root.clear_scope(!1)}clear_css(e){e.preventDefault();const{cursor:t}=this;this.root.painter.clear()}bold(e){e.preventDefault(),this.root.painter.paint({"font-weight":"700"},!0)}unindent_line(e){e.preventDefault(),this.root.painter.unindent()}indent_line(e){e.preventDefault(),this.root.painter.indent()}undo(e){e.preventDefault(),this.root.history.undo()}redo(e){e.preventDefault(),this.root.history.redo()}cursor_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;if(!t)return;if(!n.range)return;e.preventDefault();const i=[P.down,P.end,P.home,P.left,P.right,P.up],r=e.key.toLocaleLowerCase();if(i.includes(r)){if(this.event.emit_cursor_nav_before(e).some(e=>!1===e))return}r===P.left?n.move_left():r===P.right?n.move_right():r===P.up?n.move_up():r===P.down?n.move_down():r===P.home?n.move_home():r===P.end&&n.move_end(),this.event.emit_cursor_nav_after(e)}cursor_extend_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;t&&n.cube_end instanceof ol&&(e.preventDefault(),e.key.toLocaleLowerCase()===P.left?n.extend_left():e.key.toLocaleLowerCase()===P.right?n.extend_right():e.key.toLocaleLowerCase()===P.up?n.extend_up():e.key.toLocaleLowerCase()===P.down?n.extend_down():e.key.toLocaleLowerCase()===P.home?n.extend_home():e.key.toLocaleLowerCase()===P.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:r}=this;if(n.has_selection)return;e.preventDefault();const o=new Ro(t),{cube_end:s,cube_start:a,cube_selection:l,offset_end:c,offset_start:d}=n;if(s){if(s instanceof ol){const e=s.text.slice(0,c)+"\n​"+s.text.slice(c),t=s.id,n=il.reset(t,e),i=Eo.loc(t,c+2,t,c);o.tell(s,n,i)}i.record(o)}}break(e){if(this.event.emit_enter_before(e).some(e=>"stop"===e))return;if(!this.cursor.get_focus_line())return;e.preventDefault();const{courier:t,history:n,cursor:i,doc:r}=this,{cube_end:o,cube_start:s,cube_selection:a,offset_end:l,offset_start:c}=i;if(!a||!o||!s)return;const d=new Ro(t),u=s.id,h=o.id;i.has_selection&&d.tell(a,Lo.delete(a.id,"backward",u,h,c,l,!0)),d.tell(s,il.break(s.id,c)),n.record(d),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:i}=this,{cube_end:r,offset_end:o}=t;if(!r)return;const s=r.find_upstream_target(e=>e instanceof Za);if(!s)return;const a=r.find_upstream_untill(s);if(!a)return;const l=[],c=a.index,d=s.children.slice(c);for(let e of d)l.push(e.export());const u=Za.get_default(l),h=n.get_recorder(),p=s.pcube;h.tell(p,Lo.insert_child(p.id,[u],s.index+1)),h.tell(s,Lo.delete_child(s.id,"backward",[c,s.child_count])),r instanceof ol&&(await yn(),r.set_cursor_in_head(o)),i.record(h)}text_partition(e){const{cursor:t,history:n,courier:i}=this,r=Mo.tips,{cube_selection:o,offset_end:s,offset_start:a}=t;if(!(o instanceof ol))return r?.tip_warning("选区必须在一个文本块内");const l=i.get_recorder(),c=o.id;l.tell(o,Lo.partition(c,c,c,a,s)),n.record(l)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:i}=this,{cube_selection:r,cube_end:o,cube_start:s,offset_start:a,offset_end:l}=t,c=new Ro(n);if(!r||!s||!o)return;c.tell(r,Lo.set_selection_css(r.id,{"text-decoration-line":"underline"},s.id,o.id,a,l,!0)),i.record(c)}copy_format(e){const{root:t}=this;e.preventDefault(),t.painter.copy_format()}apply_format(e){const{root:t}=this;e.preventDefault(),t.painter.apply_format_brush()}italic(e){e.preventDefault(),this.painter.paint({"font-style":"italic"},!0)}align_left(e){e.preventDefault(),this.painter.paint({"text-align":"left"},!0)}align_center(e){e.preventDefault(),this.painter.paint({"text-align":"center"},!0)}align_right(e){e.preventDefault(),this.painter.paint({"text-align":"right"},!0)}next_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof Za);if(!r)return;const o=r.pcube,s=new Ro(this.courier),a=Za.get_default();s.tell(o,Lo.insert_child(o.id,[a],r.index+1)),n.record(s)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof Za);if(!r)return;const o=r.pcube,s=new Ro(this.courier),a=Za.get_default();s.tell(o,Lo.insert_child(o.id,[a],r.index)),n.record(s)}add_annotation(e){e.preventDefault();const t=Mo.tips,{cursor:n,courier:i,history:r}=this,{cube_selection:o,cube_start:s,cube_end:a,offset_end:l,offset_start:c}=n,d=new Ro(i);if(!o||!s||!a)return t?.tip_warning("未发现光标或选区");const u=s.id,h=a.id,p=Ba.get_default();if(n.has_selection)if(o instanceof ol)if(d.tell(o,Lo.partition(o.id,u,h,c,l)),0===c){if(o.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(o,Lo.postil_add(o.id,[p])),d.tell(o,Eo.loc(o.id,l,o.id,l))}else{const e=o.next_cube;if(e instanceof ol){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(e,Lo.postil_add(e.id,[p])),d.tell(e,Eo.loc(e.id,e.len,e.id,e.len))}}else t?.tip_warning("选区跨越多个文本块");else a instanceof ol&&(d.merge(a.add_annotation()),d.tell(a,Eo.loc(a.id,l,a.id,l)));r.record(d)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:i}=t;if(!n)return;let r,o=n;for(;!r;){let e=o.pcube;if(e instanceof qc||e instanceof Za)r=e;else if(e instanceof ls)return;o=e}if(r){const e=r.child_first,t=n.find_upstream_untill(r)===e,o=this.courier.get_recorder(),s=!r.attrs.fold,a=Lo.set_attr(r.id,{fold:s});o.tell(r,a),t?o.tell(n,Eo.loc(n.id,i,n.id,i)):s&&e&&o.tell(e,Eo.in_tail(e.id)),this.history.record(o)}}static get meta(){return{type:t.hotkeys,version:1}}static get default_hotkeys(){return{[A["fold-block"]]:{name:A["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:T.block},[A["text-partition"]]:{name:A["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:T.text},[A["text-add-annotation"]]:{name:A["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:T.text},[A["scope-clear"]]:{name:A["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:T.scope},[A["clear-css"]]:{name:A["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:T.css},[A["root-add-prev"]]:{name:A["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:T.block},[A["root-add-next"]]:{name:A["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:T.block},[A["text-align-left"]]:{name:A["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:T.common},[A["text-align-center"]]:{name:A["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:T.common},[A["text-align-right"]]:{name:A["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:T.common},[A["break-text"]]:{name:A["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:T.text},[A["break-line"]]:{name:A["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:T.core},[A["break-root"]]:{name:A["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:T.block},[A["cursor-nav"]]:{name:A["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:T.core},[A["cursor-nav-extend"]]:{name:A["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:T.core},[A.undo]:{name:A.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:T.common},[A.redo]:{name:A.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:T.common},[A["indent-line"]]:{name:A["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:T.common},[A["unindent-line"]]:{name:A["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:T.common},[A["text-bold"]]:{name:A["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:T.text},[A["scope-add"]]:{name:A["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:T.scope},[A["text-underline"]]:{name:A["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:T.text},[A["text-italic"]]:{name:A["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:T.text},[A["format-brush-copy"]]:{name:A["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:T.common},[A["format-brush-apply"]]:{name:A["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:T.common}}}}Yo([Ko(A["scope-clear"])],Jo.prototype,"clear_scope",null),Yo([Ko(A["clear-css"])],Jo.prototype,"clear_css",null),Yo([Ko(A["text-bold"])],Jo.prototype,"bold",null),Yo([Ko(A["unindent-line"])],Jo.prototype,"unindent_line",null),Yo([Ko(A["indent-line"])],Jo.prototype,"indent_line",null),Yo([Ko(A.undo)],Jo.prototype,"undo",null),Yo([Ko(A.redo)],Jo.prototype,"redo",null),Yo([Ko(A["cursor-nav"])],Jo.prototype,"cursor_navigation",null),Yo([Ko(A["cursor-nav-extend"])],Jo.prototype,"cursor_extend_navigation",null),Yo([Ko(A["break-text"])],Jo.prototype,"text_break",null),Yo([Ko(A["break-line"])],Jo.prototype,"break",null),Yo([Ko(A["break-root"])],Jo.prototype,"break_root",null),Yo([Ko(A["text-partition"])],Jo.prototype,"text_partition",null),Yo([Ko(A["scope-add"])],Jo.prototype,"add_scope",null),Yo([Ko(A["text-underline"])],Jo.prototype,"underline",null),Yo([Ko(A["format-brush-copy"])],Jo.prototype,"copy_format",null),Yo([Ko(A["format-brush-apply"])],Jo.prototype,"apply_format",null),Yo([Ko(A["text-italic"])],Jo.prototype,"italic",null),Yo([Ko(A["text-align-left"])],Jo.prototype,"align_left",null),Yo([Ko(A["text-align-center"])],Jo.prototype,"align_center",null),Yo([Ko(A["text-align-right"])],Jo.prototype,"align_right",null),Yo([Ko(A["root-add-next"])],Jo.prototype,"next_root",null),Yo([Ko(A["root-add-prev"])],Jo.prototype,"prev_root",null),Yo([Ko(A["text-add-annotation"])],Jo.prototype,"add_annotation",null),Yo([Ko(A["fold-block"])],Jo.prototype,"fold_block",null);class Qo extends Co{_count_word=Kt(0);_active_root_index=Kt(0);_anchor_root_id=Kt("");_mode=Kt(z.read);_view=Kt("doc");_in_composition_mode=Kt(!1);_in_recording=Kt(!1);_showing=Kt(!1);view_point=Dt({x:0,y:0});get view(){return this._view.value}set view(e){this._view.value=e}get is_doc_view(){return"doc"===this.view}get is_map_view(){return"map"===this.view}get mode_name(){return{[z.edit]:"编辑模式",[z.read]:"阅读模式",[z.export]:"导出模式"}[this.mode]}get showing(){return this._showing.value}set showing(e){this._showing.value=e,this.event.emit_status_update()}get is_recording(){return this._in_recording.value}set is_recording(e){this._in_recording.value=e,this.event.emit_status_update()}get len_undo(){return this.history.len_undo}get len_redo(){return this.history.len_redo}get is_read_mode(){return this._mode.value===z.read}get is_edit_mode(){return this._mode.value===z.edit}get in_composition_mode(){return this._in_composition_mode.value}set in_composition_mode(e){this._in_composition_mode.value=e,this.event.emit_status_update()}get mode(){return this._mode.value}set mode(e){const t=this.mode;this._mode.value=e,t!==e&&this.event.emit_status_update()}get anchor_root_id(){return this._anchor_root_id.value}set anchor_root_id(e){this._anchor_root_id.value=e,this.event.emit_status_update()}get anchor_root(){return this.root instanceof Ac?this.root.children.find(e=>e.id===this.anchor_root_id):this.root.find_cube(this.anchor_root_id)}get count_root(){return this.root.child_count}get count_word(){return this._count_word.value}get active_root(){return this.root.children[this.active_root_index-1]}get active_root_index(){return this._active_root_index.value}set active_root_index(e){this._active_root_index.value=e,this.event.emit_status_update()}get count_scope(){return this.root.scope.size}get count_scope_freeze(){return this.root.scope_count_freeze}get count_scope_normal(){return this.root.scope_count_normal}get meta(){return Qo.meta}constructor(e){super(e)}update_count_word(e){this._count_word.value+=e,this.event.emit_status_update()}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.stats,version:1}}}class Zo extends Co{_listener=new Map;_updating_status=!1;get meta(){return Zo.meta}constructor(e){super(e),this._listen()}_listen(){document.documentElement.addEventListener("keyup",e=>{"Escape"===e.key&&this.emit_esc()}),document.addEventListener("selectionchange",e=>{this.emit_selection_change(e)})}on(e,t){const n=this._listener.get(e);n?n.add(t):this._listener.set(e,new Set([t]))}emit(e,...t){const n=this._listener.get(e);if(!n)return[];const i=[];for(let e of n)i.push(e(...t));return i}off(e){for(let[t,n]of this._listener)for(let t of n)e===t&&n.delete(t)}on_asset_save(e){const t=Mo.tips,n=this._listener.get(M["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(M["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=Mo.tips,r=this._listener.get(M["asset-save"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const o=[...r][0];return!!o&&await o(e,t,n)}on_asset_download(e){const t=Mo.tips,n=this._listener.get(M["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(M["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=Mo.tips,i=this._listener.get(M["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const r=[...i][0];return!!r&&await r(e,t)}on_asset_copy(e){const t=Mo.tips,n=this._listener.get(M["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(M["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=Mo.tips,r=this._listener.get(M["asset-copy"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const o=[...r][0];return!!o&&await o(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(M["replace-id"]);if(!n)return!1;for(let i of n)i(e,t)}on_replace_id(e){const t=this._listener.get(M["replace-id"]);t?t.add(e):this._listener.set(M["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(M["edit-before"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_before(e){const t=this._listener.get(M["edit-before"]);t?t.add(e):this._listener.set(M["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(M["edit-after"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_after(e){const t=this._listener.get(M["edit-after"]);t?t.add(e):this._listener.set(M["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(M["text-merge"]);if(!n)return!1;for(let i of n)i(e,t)}on_text_merge(e){const t=this._listener.get(M["text-merge"]);t?t.add(e):this._listener.set(M["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(M.esc);t?t.add(e):this._listener.set(M.esc,new Set([e]))}emit_esc(){const e=this._listener.get(M.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(M["selection-change"],e)}emit_selection_change(e){this.emit(M["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(M["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(M["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(M["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(M["cursor-nav-after"],e)}on_enter_before(e){this.on(M["enter-before"],e)}emit_enter_before(e){return this.emit(M["enter-before"],e)}on_enter_after(e){this.on(M["enter-after"],e)}emit_enter_after(e){return this.emit(M["enter-after"],e)}on_show_cube_editor(e){this.on(M["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(M["show-cube-editor"],e)}on_text_link_edit(e){this.on(M["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(M["text-link-edit"],e)}on_note_input_before(e){return this.on(M["note-input-before"],e)}emit_note_input_before(e){return this.emit(M["note-input-before"],e)}on_note_compositionend_before(e){return this.on(M["note-input-compositionend-before"],e)}emit_note_compositionend_before(e){return this.emit(M["note-input-compositionend-before"],e)}on_note_compositionend(e){return this.on(M["note-input-compositionend"],e)}emit_note_compositionend(e){return this.emit(M["note-input-compositionend"],e)}on_note_compositionupdate(e){return this.on(M["note-input-compositionupdate"],e)}emit_note_compositionupdate(e){return this.emit(M["note-input-compositionupdate"],e)}on_status_update(e){return this.on(M["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t=e,n={mode:this.stats.mode,count_word:this.stats.count_word,count_scope_normal:this.stats.count_scope_normal,count_scope_all:this.root.scope.size,count_stack_redo:this.history.len_redo,count_stack_undo:this.history.len_undo,count_root:this.stats.count_root,active_root_index:this.stats.active_root_index,anchor_root_id:this.stats.anchor_root_id,note_recording:this.stats.is_recording,note_composition_input:this.stats.in_composition_mode,note_showing:this.stats.showing,map_matrix:{...t.matrix2d}};this.emit(M["status-update"],n),this._updating_status=!1}))}on_fig_click(e){return this.on(M["fig-click"],e)}emit_fig_click(e){return this.emit(M["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.event,version:1}}}class es extends Co{_format_brush=null;get meta(){return es.meta}get format_brush(){const e={};return this._format_brush&&Object.assign(e,this._format_brush),e}constructor(e){super(e)}paint(e,t=!1){const{root:n,cursor:i,history:r,courier:o}=this,s=new Ro(o);if(!e)return;const a=structuredClone(Vt(e));if(a["text-align"]){const t=e["text-align"];s.merge(this.text_align(t)),delete a["text-align"]}if(n.scope_count_normal>0){const e=n.get_scope_cubes();for(let n of e){const e=n.cube;for(let i of e.children.slice(...n.range))s.tell(i,Lo.set_css(i.id,structuredClone(a),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:o,offset_end:l}=i;if(!e||!n||!r)return;const c=Lo.set_selection_css(e.id,a,n.id,r.id,o,l,t);s.tell(e,c)}r.record(s)}clear(){const{root:e,cursor:t,history:n,courier:i}=this,r=new Ro(i),o={};if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range))r.tell(n,Lo.set_css(n.id,structuredClone(o),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:i,offset_start:s,offset_end:a}=t;if(!e||!n||!i)return;const l=Lo.set_selection_css(e.id,o,n.id,i.id,s,a,!1,!0);r.tell(e,l)}n.record(r)}text_align(e){const{root:t,cursor:n,history:i,courier:r}=this,o=new Ro(r),s={"text-align":e};if(t.scope_count_normal>0){const e=t.get_scope_cubes();for(let t of e){const e=t.cube;for(let n of e.children.slice(...t.range))o.tell(n,Lo.set_css(n.id,structuredClone(s)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=Lo.set_css(t.id,structuredClone(s));o.tell(t,e)}}return o}indent(){const{root:e,cursor:t,history:n,courier:i,config:r}=this,o=new Ro(i);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range)){const e=n.attrs.indent>0?n.attrs.indent+1:1;o.tell(n,Lo.set_attr(n.id,{indent:e}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0,n=e>0?e+1:1;o.tell(t,Lo.set_attr(t.id,{indent:n}))}}n.record(o)}unindent(){const{root:e,cursor:t,history:n,courier:i}=this,r=new Ro(i);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube.children.slice(...e.range);for(let e of t){let t=e.attrs.indent;t>0&&r.tell(e,Lo.set_attr(e.id,{indent:t-1}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0;e>0&&r.tell(t,Lo.set_attr(t.id,{indent:e-1}))}}n.record(r)}copy_format(){const{root:e,cursor:t}=this;if(e.scope_count_normal>0){const t=[...e.scope_normal][0].focus_cube;this._format_brush=structuredClone(Vt(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone(Vt(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:i}=this,r=new Ro(n);if(t.scope_count_normal>0){const n=t.get_scope_cubes();for(let t of n)for(let n of t.cube.children.slice(...t.range)){const t=Lo.set_css(n.id,e,!1,!0);r.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:i,offset_end:o}=this.cursor;if(!e||!t||!n)return;const s=Lo.set_selection_css(e.id,this.format_brush,n.id,t.id,i,o,!1,!0);r.tell(e,s)}i.record(r)}static get meta(){return{type:t.painter,version:1}}}class ts extends Co{_copy_data=[];_img_mime=["image/png","image/jpeg","image/gif"];_paste_stack=[];get pasted_from(){return this._paste_stack[this._paste_stack.length-1]}get copy_data(){return[...this._copy_data]}get pasting(){return this._paste_stack.length>0}get meta(){return ts.meta}constructor(e){super(e)}async copy(e){const{root:t,cursor:n}=this;return t.scope_count_normal>0?this.copy_scope(e):this.copy_selection(e)}async copy_selection(e){const{root:t,cursor:i}=this;if(i.has_selection){this._copy_data=i.find_inline_data();let n=i.get_selection_text();const r={noteid:t.id,versions:Ao.export_versions(),cubedata:this._copy_data},o=JSON.stringify(r);return e.setData("application/json",o),e.setData("text/plain",n),!0}{const{cube_end:r}=i;if(!r)return!1;const o=[r.export()];this._copy_data=o;let s="";for(let e of this._copy_data)e.type===n.text&&(s+=e.info);const a={noteid:t.id,versions:Ao.export_versions(),cubedata:o},l=JSON.stringify(a);return e.setData("application/json",l),e.setData("text/plain",s),!0}}async copy_scope(e){const t=Mo.tips;if(0===this.root.scope.size)return t?.tip_info("无块选区,未复制内容"),!1;if(0===this.root.scope_count_normal)return t?.tip_info("无正常块选区,未复制内容"),!1;const n=this.root.get_scope_cubes();this.root.clear_scope();const i=[];let r="";for(let e of n){for(let t of e.cube.children.slice(...e.range))r+=t.text;i.push(...e.cube.copy(...e.range))}this._copy_data=i;const o={noteid:this.root.id,versions:Ao.export_versions(),cubedata:this._copy_data},s=JSON.stringify(o);return e.setData("application/json",s),e.setData("text/plain",r),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,versions:Ao.export_versions(),cubedata:t},i=JSON.stringify(n),r=(new TextEncoder).encode(i),o=JSON.stringify([...r]),s=new Blob([e],{type:"text/plain"}),a=new Blob([o],{type:"text/html"}),l=new ClipboardItem({[s.type]:s,[a.type]:a});return this.set_clipboard_data(l)}async paste(e){const{cursor:t,courier:n}=this,i=e.items,r=n.get_recorder();let o=[];r.merge(this.delete()),await yn();for(let e=0;e<i.length;e++){const t=i[e];if(t.type.startsWith("image")){const e=t.getAsFile();e&&o.push(e)}}if(o.length>0){for(let e of o){const t=await this.paste_img(e);r.merge(t)}return r}const s=e.getData("application/json");if(s){let e=!1;try{const t=JSON.parse(s);if(t&&t.cubedata&&t.noteid)return this._paste_stack.push(t),e=!0,r.merge(this.paste_cubes(t.versions||{},t.cubedata)),r}catch(e){}finally{e&&this._paste_stack.pop()}}const a=e.getData("text/html");if(a)try{const e=new DOMParser,t=e.parseFromString(a,"text/html").body.textContent.trim(),n=JSON.parse(t),i=new Uint8Array(n),o=(new TextDecoder).decode(i),s=JSON.parse(o);let l=!1;try{if(s&&s.cubedata&&s.noteid)return this._paste_stack.push(s),l=!0,r.merge(this.paste_cubes(s.versions,s.cubedata)),r}catch(e){}finally{l&&this._paste_stack.pop()}}catch(e){console.error("🟥paste",e)}const l=e.getData("text/plain");if(l){const e=this.get_cubedata_from_text(l);return r.merge(this.paste_cubes(this.root.cube_versions,e)),r}return r}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=ol.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=Pc.get_default_by_string(e);n.push(t)}return n}paste_cubes(e,t){if(0===t.length)return;const{courier:n,history:i,cursor:r}=this,o=new Ro(n),{cube_selection:s,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=r;if(!s||!a||!l)return;r.has_selection&&o.tell(s,Lo.delete(s.id,"backward",l.id,a.id,c,d,!0));const u=To.replace_id(this.root,e,t);return o.tell(l,Lo.insert(l.id,u,l.id,l.id,c,c)),o}async paste_img(e){const{courier:t,history:n,cursor:i}=this,r=new Ro(t),{cube_selection:o,cube_end:s,cube_start:a,offset_start:l,offset_end:c}=i;if(!o||!s||!a)return;const d=ka.get_default();if(this.root.isdev)d.info=URL.createObjectURL(e),r.tell(s,Lo.insert(s.id,[d],a.id,s.id,l,c));else{const t=d.id+".png",n=t;await this.event.emit_asset_save("image",t,e);d.info=n,r.tell(s,Lo.insert(s.id,[d],a.id,s.id,l,c))}return r}delete(){const{root:e,courier:t,cursor:n}=this;return e.scope_count_normal>0?this.delete_scope():n.has_selection?this.delete_selection():void 0}delete_selection(){const{courier:e,cursor:t,history:n}=this,i=new Ro(e),{cube_end:r,cube_start:o,cube_selection:s,offset_start:a,offset_end:l}=t;if(!s||!r||!o)return;const c=o.id,d=r.id,u=s.id,h=Lo.delete(u,"backward",c,d,a,l);return i.tell(s,h),i}delete_scope(){const e=Mo.tips,{root:t,courier:n,history:i,cursor:r}=this;if(0===t.scope.size)return void e?.tip_info("无块选区");if(0===t.scope_count_normal)return void e?.tip_info("无常规块选区");const o=new Ro(n),s=this._root.get_scope_cubes(),a=new Map;for(let e of s){let t=a.get(e.cube);t?t.push(e.range):a.set(e.cube,[e.range])}const l=new Set;for(let[e,t]of a){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)l.add(e)}for(let e of l)o.merge(e.remove_self())}return this.root.clear_scope(),o}cut(e){const{root:t,courier:n,cursor:i}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:i,history:r,cursor:o}=this,s=Mo.tips;if(0===t.scope.size)return s?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return s?.tip_info("无常规块选区"),!1;const a=new Ro(i),l=this._root.get_scope_cubes(),c=new Map;for(let e of l){let t=c.get(e.cube);t?t.push(e.range):c.set(e.cube,[e.range])}const d=[];for(let[e,t]of c){const n=new Set;e.children;for(let i of t){const t=e.children.slice(i[0],i[1]);for(let e of t)n.add(e);d.push(...e.copy(...i))}for(let e of n)a.merge(e.remove_self())}this._copy_data=d;let u="";for(let e of this._copy_data)e.type===n.text&&(u+=e.info);const h={noteid:this.root.id,versions:Ao.export_versions(),cubedata:d},p=JSON.stringify(h);e.setData("text/plain",u),e.setData("application/json",p),this.root.clear_scope(),r.record(a)}cut_selection(e){const{courier:t,cursor:i,history:r}=this,o=new Ro(t),{cube_end:s,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=i;if(l&&s&&a)if(i.has_selection){this._copy_data=i.find_inline_data();let t="";for(let e of this._copy_data)e.type===n.text&&(t+=e.info);const u={noteid:this.root.id,versions:Ao.export_versions(),cubedata:this._copy_data},h=JSON.stringify(u);e.setData("text/plain",t),e.setData("application/json",h);const p=a.id,f=s.id,m=l.id,_=Lo.delete(m,"backward",p,f,c,d);o.tell(l,_),r.record(o)}else{const t=s.export();this._copy_data=[t];let i="";for(let e of this._copy_data)e.type===n.text&&(i+=e.info);const a={noteid:this.root.id,versions:Ao.export_versions(),cubedata:this._copy_data},l=JSON.stringify(a);e.setData("text/plain",i),e.setData("application/json",l);const c=s.pcube,d=s.index,u=Lo.delete_child(c.id,"backward",[d,d+1]);o.tell(c,u),r.record(o)}}set_clipboard_data(e){return new Promise((t,n)=>{navigator.clipboard?navigator.clipboard.write([e]).then(e=>t(!0)).catch(e=>{t(!1),console.error("写入粘贴板数据失败",e)}):t(!1)})}read_clipboard(){return new Promise(e=>{navigator.clipboard?navigator.clipboard.read().then(async t=>{const n=new Map;for(let e of t)if(e instanceof ClipboardItem){const t=e.types;for(let i of t)await e.getType(i).then(async e=>n.set(e.type,e))}e(n)}):e(new Map)})}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.clipboard,version:1}}}class ns extends Co{cp=ns.default_config;data;get meta(){return ns.meta}get css_vars(){const e=this.data;return{"--text-transition":""+(e.text_transition?"0.5s":"none"),"--text-family":`${e.text_family}`,"--text-fontsize":`${e.text_fontsize||16}px`}}constructor(e){super(e),this.data=Dt(ns.default_config)}init(e){Object.assign(this.data,e),this.cp=structuredClone(Vt(this.data))}export(){return structuredClone(Vt(this.data))}static get meta(){return{type:t.config,version:4}}static get default_config(){return{text_transition:!0,text_family:'"Comic Sans MS"',text_fontsize:16,code_theme:"dracula",line_indent:40,history_length:1/0,player_speed:150,revert_scope:!1,map_node_gap_x:40,map_node_gap_y:40,map_node_padding:8,map_node_exit_by_esc:!0,map_node_default_width:140,map_lod_scale:.5,map_scale_max:5,map_scale_min:.1,map_scale_step:.1,scroll_distance:20,map_linker_type:"bezier2",map_linker_width:2,map_linker_anchor_in:x.arrow,map_linker_anchor_out:x.point}}}class is extends Co{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return is.meta}get has_selection(){return!this.selection.isCollapsed}get client_rect(){return this.range?.getBoundingClientRect()}get client_rects(){return this.range?.getClientRects()}get range(){if(0!==this.selection?.rangeCount)return this.selection?.getRangeAt(0)}get ranges(){const e=[];for(let t=0;t<this.selection.rangeCount;t++)e.push(this.selection.getRangeAt(0));return e}get offset_start(){return this.range?this.range?.startOffset:-1}get offset_end(){return this.range?this.range?.endOffset:-1}get node_start(){return this.range?.startContainer}get node_end(){return this.range?.endContainer}get node_focus(){return this.selection.focusNode}get node_anchor(){return this.selection.anchorNode}get top_edge(){return this.safa_distance}get bottom_edge(){return document.documentElement.clientHeight-this.safa_distance}get cube_selection(){if(!this.range)return;const e=this.range.commonAncestorContainer,t=this.stats.active_root;if(t){return this.get_node_cube(e,t)||this.get_node_cube(e,this.root)}return this.get_node_cube(e,this.root)}get cube_start(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.startContainer,i=this.get_node_cube(n,t);return i instanceof cs?i:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,i=this.get_node_cube(n,t);return i instanceof cs?i:void 0}get cube_focus(){const e=this.cube_selection,t=this.node_focus;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof cs?n:void 0}get cube_anchor(){const e=this.cube_selection,t=this.node_anchor;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof cs?n:void 0}constructor(e){super(e);let t=window.getSelection();if(!t)throw Error("NoteCursor : can't find Selection API");this.selection=t}move_up_by_coor(){}locate_next_line(e,t,n){let i="up"===e?t.prev_line:t.next_line;const r=t.clientRect;let o=i?.clientRect;for(;i&&o&&r&&(o.left>=r.right||o.right<=r.left);){let t="up"===e?i.prev_line:i.next_line;if(!t)break;i=t,o=t.clientRect}if(!i)return;const s=[],a=new Map;for(let e of i.children)if(e instanceof ol){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)s.push(t[n]),a.set(t[n],e)}const l="up"===e?Io.MathRect.get_rect_point(n.left,Io._RectPosition.left_mid):Io.MathRect.get_rect_point(n.left,Io._RectPosition.right_mid),c=Io.MathRect.get_nearest_rect(l,s);if(!c)return;const d=Io.MathRect.get_shadow_point_horizental(l,c),u=document.caretPositionFromPoint(d.x,d.y);if(u&&u.offsetNode instanceof Text)this.set_cursor(u.offsetNode,u.offset);else if(u&&!(u.offsetNode instanceof Text)){const e=a.get(c);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const i=[],r=[],o=new Map;for(let e of t.children)if(e instanceof ol){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];i.push(r),o.set(r,e)}}if(1===i.length)return!1;if("up"===e){const e=n.left.top;for(let t of i)t.bottom<=e&&r.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of i)t.y>=e&&r.push(t)}if(r.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=Io.MathRect.get_nearest_rect(t,r);if(!i)return!1;const s=Io.MathRect.get_shadow_point_horizental(t,i),a=document.caretPositionFromPoint(s.x,s.y);if(a&&a.offsetNode instanceof Text)return this.set_cursor(a.offsetNode,a.offset),!0;{const e=o.get(i);if(!e)return!1;e.set_cursor_in_tail()}}return!1}move_vertical(e){const{cube_start:t,cube_end:n}=this;if(!(t instanceof ol&&n instanceof ol))return;const i="up"===e?t.line:n.line,r=this.get_selection_edge_position();if(!i||!r)return;this.locate_current_line(e,i,r)||this.locate_next_line(e,i,r)}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:o}=this,s=new Ro(o);if(!(e instanceof ol))return;if(this.has_selection)return this.set_cursor(this.range.startContainer,this.range.startOffset);if(e.drop_zero_width_space(t).pos>0)if(e.is_empty){let t=e.prev_cube_deep;t&&s.tell(t,Eo.in_tail(t.id))}else{const n=e.find_text_nav_pos(t,"left");i&&this.set_cursor(i,n)}else{const t=e.prev_cube_deep;t&&s.tell(t,Eo.in_tail(t.id))}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:o}=this,s=new Ro(o);if(e instanceof ol){if(this.has_selection)return this.set_cursor(this.range.endContainer,this.range.endOffset);if(n<e.drop_zero_width_space(n).len)if(e.is_empty){let t=e.next_cube_deep;t&&s.tell(t,Eo.in_head(t.id))}else{const t=e.find_text_nav_pos(n,"right");i&&this.set_cursor(i,t)}else{const t=e.next_cube_deep;t&&s.tell(t,Eo.in_head(t.id))}}}move_up(){this.move_vertical("up")}move_down(){return this.move_vertical("down")}move_end(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const o=this.range.getClientRects();if(0===o.length)return;const s=Io.MathRect.get_rect_point(o[o.length-1],Io._RectPosition.center);let a=To.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],u=d;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(Io.MathRect.is_point_in_rect(s,t)){u=t;break}}if(u!==d)return this.locate_cursor_on_rect(u,Io._RectPosition.right_mid)}let h=e.next_cube;if(!h)return this.locate_cursor_on_rect(u,Io._RectPosition.right_mid);for(a=To.get_client_rects(h.id);a;){if(l=a.length,c=a[0],c.x<u.right)return this.locate_cursor_on_rect(u,Io._RectPosition.right_mid);if(l>1)return this.locate_cursor_on_rect(c,Io._RectPosition.right_mid);if(h=h?.next_cube,!h)return this.locate_cursor_on_rect(c,Io._RectPosition.right_mid);a=To.get_client_rects(h.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const o=this.range.getClientRects();if(0===o.length)return;const s=Io.MathRect.get_rect_point(o[o.length-1],Io._RectPosition.center);let a=To.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],u=c;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(Io.MathRect.is_point_in_rect(s,t)){u=t;break}}if(u!==c)return this.locate_cursor_on_rect(u,Io._RectPosition.left_mid)}let h=e.prev_cube;if(!h)return this.locate_cursor_on_rect(u,Io._RectPosition.left_mid);for(a=To.get_client_rects(h.id);a;){if(l=a.length,d=a[a.length-1],d.right>u.left)return this.locate_cursor_on_rect(u,Io._RectPosition.left_mid);if(l>1)return this.locate_cursor_on_rect(d,Io._RectPosition.left_mid);if(h=h?.prev_cube,!h)return this.locate_cursor_on_rect(d,Io._RectPosition.left_mid);a=To.get_client_rects(h.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=this.selection,l=r||e,c="number"==typeof o?o:t,d=s||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_left(),yn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_right(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=this.selection,l=r||e,c="number"==typeof o?o:t,d=s||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_right(),yn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_up(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=this.selection,l=r||e,c="number"==typeof o?o:t,d=s||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_up();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=this.selection,l=r||e,c="number"==typeof o?o:t,d=s||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_down();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=this.selection,l=r||e,c="number"==typeof o?o:t,d=s||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_home();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:a}=this.selection,l=r||e,c="number"==typeof o?o:t,d=s||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_end();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}is_contains_selection(e){const t=[];for(let e of this.ranges)t.push(e.commonAncestorContainer);for(let n of t){if(!this.get_node_cube(n,e))return!1}return!0}get_node_cube(e,t){let n=e instanceof Element?e:e.parentElement;const i=[];for(;n;){if(n.id){let e;if(i.push(n.id),e=(this.root,t.find_cube(n.id)),e)return e}n=n.parentElement}}get_focus_line(){const{cube_end:e}=this;if(e)return e instanceof ol?e.line:void 0}set_cursor(e,t){if(!(e instanceof Text))throw Error("NoteCursor : curosr only be set in TextNode");let n=Math.min(e.length,t);this.selection?.setPosition(e,n),e.parentElement&&e.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}locate_cursor_on_rect(e,t){let n=Io.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),r=window.getSelection();if(i&&r&&i.offsetNode instanceof Text)return r.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:i,root:r}=this,o=document.caretPositionFromPoint(e,t),s=o?.offsetNode,a=new Ro(n);if(s){if(s instanceof Text)o.offsetNode instanceof Text&&(s.parentElement?.parentElement?.focus(),this.set_cursor(o.offsetNode,o.offset));else{const e=r.cursor.get_node_cube(s,r);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube;n.block||a.tell(e,Eo.in_head(e.id))}i.record(a)}}set_cursor_by_coor(e,t){if(t<=this.top_edge){let e=document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;Io.DomAnimation.scroll_element(document.documentElement,-this.scroll_distance,"vertical"),t+=n}else if(t>=this.bottom_edge){let e=document.documentElement.scrollHeight-document.documentElement.clientHeight-document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;Io.DomAnimation.scroll_element(document.documentElement,this.scroll_distance,"vertical"),t-=n}const n=document.caretPositionFromPoint(e,t);if(n&&n.offsetNode instanceof Text){this.set_cursor(n.offsetNode,n.offset);let e=this.get_selection_edge_position()?.right;if(!e)return;return e.y<=this.top_edge?window.scrollBy({top:-this.scroll_distance,behavior:"smooth"}):e.y>=this.bottom_edge&&window.scrollBy({top:this.scroll_distance,behavior:"smooth"}),n}}get_selection_edge_position(){if(!this.range)return;const e=this.range.getClientRects();if(0===e.length)return;const t=e[0],n=e[e.length-1];return{left:new DOMRect(t.x,t.y,0,t.height),right:new DOMRect(n.x,n.y,0,n.height)}}set_selection_between(e,t,n,i){this.selection.setBaseAndExtent(e,t,n,i)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:i,offset_end:r}=this;let o="";if(e&&!this.has_selection&&n instanceof ol)return n.text;if(this.cube_selection instanceof ol)return this.cube_selection.text.slice(i,r);{let e=!1,s=!1;const a=this.find_inline_cube();for(let l of a){for(let a of l){if(s)break;e||a!==n||(e=!0,a instanceof ol&&(o+=a.text.slice(i))),s||a!==t||(s=!0,a instanceof ol&&(o+=a.text.slice(0,r))),e&&!s&&a instanceof ol&&a!==n&&a!==t&&(o+=a.text)}o+="\n"}}return o}find_cube_by_coor(e){const{x:t,y:n}=e,i=document.elementFromPoint(t,n);if(i)return this.get_node_cube(i,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:i}=this;if(t instanceof ol){let e=t.line;if(e)return[e]}else{if(t instanceof Pc)return[t];if(n instanceof ol&&i instanceof ol){const t=n.line,r=i.line;if(t&&r){let n=t;for(;n&&(e.push(n),n!==r);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:i,offset_end:r}=this;if(!t||!n)return e;if(!(t instanceof ol&&n instanceof ol))return e;const o=this.find_selection_lines();if(0===o.length)return[];const s=o[0],a=o[o.length-1],l=t.index,c=n.index;if(1===o.length){const t=[];for(let e of s.children.slice(l,c+1))t.push(e);e.push(t)}else{let t=[];for(let e of s.children.slice(l))t.push(e);e.push(t),t=[];for(let n of o.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of a.children.slice(0,c+1))t.push(e);e.push(t)}return e}find_inline_data(){const e=[],t=this.find_inline_cube();if(0===t.length)return e;const n=t[0],i=t[t.length-1],r=n[0],o=i[i.length-1],{cube_start:s,cube_end:a,offset_start:l,offset_end:c}=this;if(!s||!a)return e;if(s===a){const t=s.export();t.info=t.info.slice(l,c),e.push(t)}else if(n===i){if(s instanceof ol&&s===r){const t=s.export();t.info=t.info.slice(l),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(a instanceof ol&&a===o){const t=a.export();t.info=t.info.slice(0,c),e.push(t)}}else{if(s instanceof ol&&s===r){const t=s.export();t.info=t.info.slice(l),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=Pc.get_default(n.map(e=>e.export()));e.push(t)}const d=Pc.get_default(i.slice(0,-1).map(e=>e.export()));if(a instanceof ol&&a===o){const e=a.export();e.info=e.info.slice(0,c),d.info.push(e)}e.push(d)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.cursor,version:1}}}class rs extends Co{command_group_do=[];command_group_undo=[];get meta(){return rs.meta}execute_command_group(e){if(this.stats.mode===z.read)return;const t=(e,n,i)=>{n<i.length&&yn(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new Ro(this)}pass(e){if(this.stats.mode===z.read)return;const t=e,n=e.id,i=this.root.find_cube(n);if(!i)return console.error("未发现cube:",n);console.log("🟡",i,e);const r=new Ro(this);let o=i.on(t);return o instanceof Ro&&r.merge(o),r}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.courier,version:1}}}class os{_float;_visible=Kt(!1);_css=Dt({position:"fixed"});_cube=Kt(null);constructor(e){this._float=e}get visible(){return this._visible.value}get float(){return this._float}get cube(){return this._cube.value}get css(){return this._css}async show(e,t){this._visible.value=!0;const n=e.currentTarget;await yn();const i={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=n.getBoundingClientRect(),o={x:e.clientX,y:e.clientY,width:1,height:1},s=Io.MathRect.move_rect_to_other(i,r,o,12);this._css.left=`${s.x}px`,this._css.top=`${s.y}px`,this._cube.value=Ut(t)}close(){this._visible.value=!1,this._cube.value=null}}class ss extends os{_css=Dt({});_cube=Kt(null);constructor(e){super(e),this._listen()}_listen(){const e=this.float.event;e.on_esc(this.close.bind(this)),e.on_fig_click(this.close.bind(this))}get cube(){return this._cube.value}}class as extends Co{_float_node_layout=new ss(this);constructor(e){super(e)}get float_node_layout(){return this._float_node_layout}get meta(){return as.meta}static get meta(){return{type:t.float,version:1}}}class ls extends Fo{_scopes=Bt(new Set);_dom;_children=Bt([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_float;_isdev=!1;constructor(){super(),this._cubes=new Wo(this),this._hotkeys=new Jo(this),this._config=new ns(this),this._cursor=new is(this),this._courier=new rs(this),this._history=new Oo(this),this._clipboard=new ts(this),this._painter=new es(this),this._event=new Zo(this),this._stats=new Qo(this),this._listener=new Uo(this),this._float=new as(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(i.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(i.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(i.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(i.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(i.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(i.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(s.cursor_in_tail,this.on_cursor_in_tail.bind(this)),$o.init_cmd_handler(this)}get editable(){return!0}get config(){return this._config}get hotkeys(){return this._hotkeys}get stats(){return this._stats}get cubes(){return this._cubes}get cursor(){return this._cursor}get listener(){return this._listener}get float(){return this._float}get courier(){return this._courier}get history(){return this._history}get clipboard(){return this._clipboard}get painter(){return this._painter}get event(){return this._event}get root(){return this}get isdev(){return this._isdev}get dom(){return document.getElementById(this.id)}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get pid(){}get index(){return 0}get css(){return Object.assign({},this.data.css)}get attrs(){return Object.assign({},this.data.attrs)}get info(){return this.data.info}get child_count(){return this._children.length}get child_first(){return this._children[0]}get child_last(){return this._children[this._children.length-1]}get id(){return this.data.id}get pcube(){}get type(){return this.data.type}get versions(){return Object.assign({},this.data.versions)}get level(){return 0}get in_postil(){return!1}get host_postil(){return null}get next_cube_deep(){}get prev_cube_deep(){}get root_dom(){return this._dom}get is_empty(){const e=1===this.child_count,t=this.child_first.is_empty;return e&&t}get prev_cube(){}get next_cube(){}get host_node(){}get cube_versions(){return Ao.export_versions()}get scope(){return new Set([...this._scopes])}get scope_normal(){const e=new Set;for(let t of this.scope)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this.scope)t.freeze&&e.add(t);return e}get scope_count_normal(){return this._scopes.size-this.scope_count_freeze}get scope_count_freeze(){let e=0;for(let t of this.scope)t.freeze&&e++;return e}set_dev(e=!0){this._isdev=e,window.root=this}find_child_cube(e){return this._children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}is_contains_cube(e){return!!e&&e.root===this}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}copy(e,t){const n=this._children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_upstream_untill(){}add_scope_by_cube(e){const t=new Vo(this,e);this._scopes.add(t),this.event.emit_status_update()}add_scope(e=!1){if(e){const e=this.cursor.cube_end;if(!e||e instanceof ls)return Mo.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(e)}else{const e=this.stats.view_point,t=this.cursor.find_cube_by_coor(e);if(!t||t instanceof ls)return Mo.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(t)}}remove_scope(e){for(let t of this._scopes)if(t.id===e){this._scopes.delete(t);break}}clear_scope(e=!0){for(let t of this._scopes)e&&t.freeze||this._scopes.delete(t)}freeze_scopes(){for(let e of this._scopes)e.freeze=!0}sort_scope(){const e=[...this._scopes];return e.sort((e,t)=>e.pos.y-t.pos.y),e}get_scope_cubes(e=!1,t=!0){if(0===this._scopes.size)return[];const n=[],i=e?this.sort_scope():this.scope;for(let e of i)t&&e.freeze||n.push(e.get_scope_info());return n}get_scope_cubes_data(){const e=this.get_scope_cubes(),t=[];for(let n of e)t.push(...n.cube.copy(n.range[0],n.range[1]));return t}delete_edge(e,t){const{courier:n}=this,i=new Ro(n);if("backward"===t){const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.prev_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.next_cube;if(r&&n.type===r.type)return r.merge("left");if(n)return i.tell(n,Eo.in_tail(n.id))}else{const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.next_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.prev_cube;if(r&&n.type===r.type)return n.merge("left");if(n)return i.tell(n,Eo.in_tail(n.id))}}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}get_sdk_version(){return Ao.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,o=To.build_cubes(n,this);return this.splice(0,this.child_count,...o),i.add_recover(Lo.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:o}=e,s=this.find_child_cube(r);if(!s||s.index===o)return;const a=new Ro(t);let l=0,c=s.index;return"tail"===o?l=this.child_count:"number"==typeof o&&(l=o),this.splice(c,1),this.splice(l,0,s),a.add_recover(Lo.reorder(this.id,s.id,c)),a}on_insert_cube(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:o}=e;if(0===o.length)return i;const s=[];for(let e of o)e.type===n.box_root&&s.push(new Za(e,this));let a=this.get_valid_index(r);this.splice(a,0,...s);const l=s[s.length-1];return l&&i.tell(l,Eo.in_tail(l.id)),i.add_recover(Lo.delete_child(this.id,"backward",[a,a+s.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:o}=e,[s,a]=o,l=t.get_recorder();l.add_cmd(e);const c=this.children[s-1],d=this.children[a],u=a-s;if(s!==a){if(s<=0&&a>=this.child_count){const e=this.child_first;return this.child_count>1&&l.tell(this,Lo.delete_child(this.id,r,[1,this.child_count])),e.is_empty||l.tell(e,Lo.reset(e.id,[])),l}{let e=this.splice(s,u);c&&"backward"===r||!d?l.tell(c,Eo.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,Eo.in_head(d.id));const t=e.data;l.add_recover(Lo.insert_child(this.id,t,s))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:i,pid:r}=this,{css:o,start_id:s,end_id:a,offset_end:l,offset_start:c}=e,d=new Ro(n);if(s!==a||l!==c){if(a&&!s){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Lo.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return d.tell(t,Lo.set_selection_css(t.id,o,null,a,"head",l)),d}if(s&&!a){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Lo.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return d.tell(t,Lo.set_selection_css(t.id,o,s,null,c,"tail")),d}if("tail"===l&&"head"===c){for(let e of this.children)d.tell(e,Lo.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return d}if(a&&s){const e=this.find_cube(s),t=this.find_cube(a),n=e?.find_upstream_untill(this),i=t?.find_upstream_untill(this);if(!n||!i)return;const r=this.children.slice(n.index+1,i.index);for(let e of r)d.tell(e,Lo.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return d.tell(n,Lo.set_selection_css(n.id,o,s,null,c,"tail")),d.tell(i,Lo.set_selection_css(i.id,o,null,a,"head",l)),d}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,o=new Ro(t),{data:s,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,u=this.find_cube(l),h=this.find_cube(a),p=u?.find_upstream_untill(this),f=h?.find_upstream_untill(this);if(!p||!f)return o;if(h!==u||d!==c)if(p&&p===f)o.tell(p,Lo.delete(p.id,"backward",l,a,d,c)),o.tell(p,Lo.insert(p.id,s,l,a,d,c));else{o.tell(f,Lo.delete(f.id,"backward",null,a,"head",c)),o.tell(this,Lo.delete_child(this.id,"backward",[p.index+1,f.index])),o.tell(this,Lo.insert_child(this.id,e.data,p.index+1)),o.tell(p,Lo.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&o.tell(e,Eo.in_tail(t.id))}}else o.tell(h,Lo.insert(a,s,l,a,d,c));return o}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:o,offset_end:s,offset_start:a,reserve:l}=e,c=new Ro(t);if(!r&&o){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Lo.delete_child(this.id,i,[0,t.index])),c.tell(t,Lo.delete(t.id,i,r,o,"head",s)),c}if(r&&!o){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Lo.delete_child(this.id,i,[t.index+1,this.child_count])),c.tell(t,Lo.delete(t.id,i,r,o,a,s)),c}if("head"===a&&"tail"===s)return c.tell(this,Lo.reset(this.id,[])),c;if(r&&o){const e=this.find_cube(r),t=this.find_cube(o);if(!(e instanceof ol&&t instanceof ol))return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,u=l.index;if(r!==o||a!==s)if(n===l)c.tell(n,Lo.delete(n.id,i,r,o,a,s,!0));else{c.tell(l,Lo.delete(l.id,i,null,o,"head",s)),c.tell(this,Lo.delete_child(this.id,"backward",[d+1,u])),c.tell(n,Lo.delete(n.id,i,r,null,a,"tail",!0));let t=0;if("number"==typeof a&&(t=a),c.tell(n,Lo.merge(n.id,"right",r,t)),n.is_empty)c.tell(this,Lo.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof ol){const n=e.pcube;c.tell(n,Lo.merge(n.id,"right",r,t))}}return c}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone(Vt(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return r.add_recover(Lo.set_attr(this.id,o)),r}on_cursor_in_tail(e){const{courier:t}=this,n=this.child_last,i=new Ro(t);if(n)return i.tell(n,Eo.in_tail(n.id)),i}}class cs extends Fo{_children=Bt([]);_has_postil=Kt(!1);postil=null;pcube;data;get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get float(){return this.root.float}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}constructor(e,t){super(),this.pcube=t}get domain(){return"doc"}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof Pc&&(e+="\n");return this instanceof Pc&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof ls)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get has_postil(){return this._has_postil.value}set has_postil(e){this._has_postil.value=e}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof nl?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof cs;){if("map"===e.domain&&e instanceof hs)return e;e=e.pcube}}get in_postil(){return this instanceof nl||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_first_line(){for(let e of this._children)if(e instanceof Pc)return e}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return this.data.css||(this.data.css={}),{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof cs)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof cs)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(s.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(s.cursor_in_tail,this.on_cursor_in_tail.bind(this)),$o.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone(Vt(e))}catch(n){return new Aa(e,t,"克隆数据失败")}if(!n)return new Aa(e,t,"克隆数据为空");try{const i=this.clipboard.pasted_from?.versions,r=i||this.root.versions,o=this.update_data(r[this.meta.type],n);if(!o.data)return new Aa(e,t,"升级后数据为空");if(!o.usable)return new Aa(e,t,"高版本数据,请升级软件");this.data=Dt(o.data),this._setup(),this.build_child(o.data),this.cubes.add_cube(this)}catch(n){return console.error(n),new Aa(e,t,"数据升级失败")}return this}create_child_block(e){const t=To.pick(e);return To.build_cubes(t.sort,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone(Vt(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof $d||t instanceof su)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}delete_edge(e,t){const{courier:n}=this;if("backward"===t){const t=e.prev_cube_deep,i=t?.next_cube;if(!(i instanceof cs))return;if(i&&t.type===i.type){const e=i.merge("left");if(e)return e}if(i){const e=new Ro(n),t=i.pcube,r=i.index,o=i.child_first.export(),s=Lo.insert_child(t.id,[o],r);if(e.tell(t,s),e.len_undo>0)return e.merge(i.remove_self()),e}if(t&&t.is_empty){const e=new Ro(n);return e.merge(t.remove_self()),i&&e.tell(i,Eo.in_head(i.id)),e}if(t){return new Ro(n).tell(t,Eo.in_tail(t.id))}}else{const t=e.next_cube_deep,n=t?.prev_cube;if(!(n instanceof cs))return;if(n&&t?.type===n?.type){const e=t.merge("right");if(e)return e}if(n){const e=this.courier.get_recorder(),t=n.pcube,i=n.index,r=n.child_first.export(),o=Lo.insert_child(t.id,[r],i);if(e.tell(t,o),e.len_undo>0)return e.merge(n.remove_self()),e}if(t&&t.is_empty){const e=this.courier.get_recorder();return e.merge(t.remove_self()),n&&e.tell(n,Eo.in_tail(n.id)),e}if(t){return this.courier.get_recorder().tell(t,Eo.in_tail(t.id))}}}remove_self(e="backward"){const{pcube:t,courier:n,index:i}=this,r=new Ro(n);return r.tell(t,Lo.delete_child(t.id,e,[i,i+1])),r}merge(e){const{pcube:t,cursor:n,courier:i}=this,{cube_end:r,offset_end:o}=n;if(!r)return;const s=i.get_recorder();return s.tell(this,Lo.merge(this.id,e,r.id,o)),s}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t instanceof cs&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof cs;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:i,start_id:r,end_id:o,offset_end:s,offset_start:a,toggle:l,replace:c}=e,d=new Ro(n);if(r!==o||s!==a){if(o&&!r){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Lo.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Lo.set_selection_css(t.id,i,null,o,"head",s,l,c)),d}if(r&&!o){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Lo.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Lo.set_selection_css(t.id,i,r,null,a,"tail",l,c)),d}if("tail"===s&&"head"===a){for(let e of this.children)d.tell(e,Lo.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d}if(o&&r){const e=this.find_cube(r),t=this.find_cube(o),n=e?.find_upstream_untill(this),u=t?.find_upstream_untill(this);if(!n||!u)return;const h=this.children.slice(n.index+1,u.index);for(let e of h)d.tell(e,Lo.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(n,Lo.set_selection_css(n.id,i,r,null,a,"tail",l,c)),n!==u&&d.tell(u,Lo.set_selection_css(u.id,i,null,o,"head",s,l,c)),d}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i}=this,r=new Ro(t),{data:o,end_id:s,start_id:a,offset_end:l,offset_start:c}=e,d=this.find_cube(a),u=this.find_cube(s),h=d?.find_upstream_untill(this),p=u?.find_upstream_untill(this);if(!h||!p)return r;if(u!==d||c!==l)if(h&&h===p)r.tell(h,Lo.delete(h.id,"backward",a,s,c,l)),r.tell(h,Lo.insert(h.id,o,a,s,c,l));else{r.tell(p,Lo.delete(p.id,"backward",null,s,"head",l)),r.tell(this,Lo.delete_child(this.id,"backward",[h.index+1,p.index])),r.tell(this,Lo.insert_child(this.id,o,h.index+1)),r.tell(h,Lo.delete(h.id,"backward",a,null,c,"tail"));let e=o[o.length-1];const t=this.top.find_cube(e.id);t&&r.tell(t,Eo.in_tail(e.id))}else r.tell(u,Lo.insert(s,o,a,s,c,l));return r}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:o,offset_end:s,offset_start:a,reserve:l}=e,c=new Ro(t);if(!r&&o){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Lo.delete_child(this.id,i,[0,t.index],l)),c.tell(t,Lo.delete(t.id,i,r,o,"head",s,l)),c}if(r&&!o){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Lo.delete_child(this.id,i,[t.index+1,this.child_count],l)),c.tell(t,Lo.delete(t.id,i,r,o,a,s,l)),c}if("head"===a&&"tail"===s){if(l){if(this.is_empty)return;c.tell(this,Lo.delete_child(this.id,i,[1,this.child_count]));const e=this.child_first;e.meta.block?c.tell(e,Lo.delete_child(e.id,i,[0,e.child_count],l)):e instanceof ol?(c.tell(e,il.reset(e.id,"​")),c.tell(e,Eo.loc(e.id,1,e.id,1))):c.tell(e,Lo.reset(e.id,[]))}else c.tell(this.pcube,Lo.delete_child(this.pid,"backward",[this.index,this.index+1]));return c}if(r&&o){const e=this.find_cube(r),t=this.find_cube(o);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,u=l.index;if(r!==o||a!==s)if(n===l)c.tell(n,Lo.delete(n.id,i,r,o,a,s,!0));else if(c.tell(l,Lo.delete(l.id,i,null,o,"head",s)),c.tell(this,Lo.delete_child(this.id,"backward",[d+1,u])),c.tell(n,Lo.delete(n.id,i,r,null,a,"tail",!0)),e instanceof ol){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return c}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:r,replace:o}=e,s=t.get_recorder();if(s.add_cmd(e),o){const e=structuredClone(Vt(this.css));return this.data.css=i,s.add_recover(Lo.set_css(this.id,e,!1,!0)),s}if(0===Object.keys(i).length)return;let a=!0;const l=structuredClone(Vt(this.css)),c=structuredClone(Vt(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;l[e]=n,null===t||r&&t===n?(a=!1,delete c[e]):t!==n&&(a=!1,c[e]=t)}return this.data.css=c,a?void 0:(s.add_recover(Lo.set_css(this.id,l)),s)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone(Vt(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return r.add_recover(Lo.set_attr(this.id,o)),r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i,index:r}=this,{from:o,from_id:s,offset:a}=e,l=new Ro(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&l.tell(n,Lo.delete_child(i,"backward",[this.index,this.index+1])),"left"===o?l.tell(e,Eo.in_head(e.id)):l.tell(t,Eo.in_tail(t.id))}else l.tell(n,Lo.delete_child(i,"backward",[this.index,this.index+1]));return l}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new Ro(t),i=this.postil;return e.tell(i,Lo.insert_child(i.id,n,i.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const i=t.get_recorder();i.add_cmd(e);const r=nl.get_default(n),o=new nl(r,this);return this.postil=o,i.add_recover(Lo.postil_remove(this.id,[0,o.child_count])),this.postil.show=!0,this.has_postil=!0,i}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[i,r]=n,o=this.postil;if(!o)return;let s=i<0?0:i,a=r>o.child_count?o.child_count:r;if(s<=0&&a>=o.child_count){const n=t.get_recorder();n.add_cmd(e);const i=o.export();return n.add_recover(Lo.postil_add(this.id,i.info)),this.postil=null,this.has_postil=!1,o.gc(),n}{const e=new Ro(t);return e.tell(o,Lo.delete_child(o.id,"backward",[s,a])),e}}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,o=new Ro(t);if(this.meta.block){const e=this.child_first;if(!e)return o;o.tell(e,Eo.in_head(e.id))}else if(this instanceof ol)this.prev_cube instanceof ol&&this.len>=1?this.set_cursor_in_head(1):this.set_cursor_in_head(0);else if(r&&r instanceof ol)r.set_cursor_in_head();else{const e=ol.get_default();o.tell(i,Lo.insert_child(i.id,[e],this.index+1))}return o}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,o=new Ro(t);if(this.meta.block){const e=this.child_last;if(!e)return o;o.tell(e,Eo.in_tail(e.id))}else if(this instanceof ol)this.next_cube instanceof ol&&this.len>=1?this.set_cursor_in_tail(1):this.set_cursor_in_tail(0);else if(n&&n instanceof ol)n.set_cursor_in_tail();else{const e=ol.get_default();o.tell(i,Lo.insert_child(i.id,[e],this.index))}return o}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}class ds extends cs{}class us{_node;_map;_bound;_upenv;_env=Dt({upstream:void 0,downstream:[],layout:null});_all_downstream_nodes=wo(()=>this.get_layout_downstream_nodes());_siblings_info=wo(()=>this.get_siblings_info());_folded_upstream=wo(()=>{let e=this.upstream;for(;e;){if(e.attrs.fold||e.is_layout_root)return e.attrs.fold;e=e.env.upstream}return!1});constructor(e){this._node=e,this._map=e.pcube,this._bound=e.bound}get siblings(){return this._siblings_info.value}get bound(){return this._bound}get map(){return this._map}get to(){return this.node.to}get from(){return this.node.from}get upenv(){return this._upenv}get node_fill(){return this.node.is_layout_root?this.node.attrs.fill:this.node.attrs.fill||this.upstream?.env.node_fill}get node_line_type(){return this.node.is_layout_root?this.node.attrs.line_type||this.node.config.data.map_linker_type:this.node.attrs.line_type||this.upstream?.env.node_line_type||this.node.config.data.map_linker_type}get node_line_width(){return this.node.is_layout_root?this.node.attrs.line_width||this.node.config.data.map_linker_width:this.node.attrs.line_width||this.upstream?.env.node_line_width||this.node.config.data.map_linker_width}get node_line_anchor_in(){return this.node.is_layout_root?this.node.attrs.anchor_in||this.node.config.data.map_linker_anchor_in:this.node.attrs.anchor_in||this.upstream?.env.node_line_anchor_in||this.node.config.data.map_linker_anchor_in}get node_line_anchor_out(){return this.node.is_layout_root?this.node.attrs.anchor_out||this.node.config.data.map_linker_anchor_out:this.node.attrs.anchor_out||this.upstream?.env.node_line_anchor_out||this.node.config.data.map_linker_anchor_out}get node_gap_x(){return this.node.is_layout_root?this.node.attrs.gap_x||this.node.config.data.map_node_gap_x:this.node.attrs.gap_x||this.upstream?.env.node_gap_x||this.node.config.data.map_node_gap_x}get node_gap_y(){return this.node.is_layout_root?this.node.attrs.gap_y||this.node.config.data.map_node_gap_y:this.node.attrs.gap_y||this.upstream?.env.node_gap_y||this.node.config.data.map_node_gap_y}get nodes_to(){return this.node.nodes_to}get nodes_from(){return this.node.nodes_from}get node(){return this._node}get index(){return this.upstream?this.upstream.env.downstream.indexOf(this.node):0}get prev_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e-1]}get next_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e+1]}get level(){return this.node.is_layout_root||!this.upstream?0:this.layout_line.length-1}get upstream(){return this._env.upstream}get downstream_visible(){return this.folded_self?[]:this.downstream}get downstream(){return[...this._env.downstream]}get downstream_nodes(){return[...this._all_downstream_nodes.value]}get is_captive(){return!this.node.is_layout_root&&(this.layout_root&&this.upstream?.env.layout_type)}get is_under_root(){const e=this.layout_root,t=this.layout_root!==this.node;return e&&t}get has_layout_ability(){return this.layout_root}get is_under_free_root(){const e=this.layout_root;return!!e&&!e.env.layout_type}get layout_line(){if(this.node.is_layout_root)return[this.node];if(!this.upstream)return[];const e=[];let t=this.node;for(;t;){if(e.unshift(t),t.is_layout_root)return e;t=t.env.upstream}return[]}get layout_root(){return this.node.is_layout_root?this.node:this.layout_line[0]}get folded_upstream(){return!this.node.is_layout_root&&this._folded_upstream.value}get folded_self(){return this._node.attrs.fold}get folded(){return this.folded_self||this.folded_upstream}get layout_from(){if(this.node.attrs.layout)return this.node;const e=this.layout_line;for(let t of e.reverse())if(t.is_layout_root||t.attrs.layout)return t;return this.node}get layout_type(){return this._env.layout||this._node.attrs.layout||null}clear(){this._env.upstream=void 0,this._env.downstream.length=0,this._env.layout=null}free(){if(So.find_line_to_layout_root(this.node).has_root)return;const e=this.get_layout_downstream_nodes(),t=new Set;for(let n of e){if(n.env.clear(),0===n.count_from)continue;const e=So.find_line_to_layout_root(n),i=e.line[1];e.has_root&&i&&(t.add(i),i.env.flow("self"),i.bound.flow("self"))}for(let e of t)e.bound.flow("upstream"),e.env.layout_root?.layout_throttle();this.clear()}update_env(e){if(e===this)return console.error("🟠Error: Layout Env loop");this._upenv=e,this._env.upstream=e.node,this._env.layout=e.get_downstream_layout_type(this.node)}flow(e="downstream"){this._node.is_layout_root&&this.clear(),this._env.downstream.length=0;if(So.find_line_to_layout_root(this.node).has_root){for(let e of this.nodes_to){const{has_root:t,line:n}=So.find_line_to_layout_root(e);t&&(n[1]===this.node&&this._env.downstream.push(e))}if("self"===e)for(let e of this._env.downstream)e.env.update_env(this);else if("downstream"===e)for(let e of this._env.downstream)e.env.update_env(this),e.env.flow("downstream")}}get_layout_downstream_nodes(){const e=[...this.downstream];for(let t of e)e.push(...t.env.downstream);return e}get_downstream_layout_type(e){const t=this.layout_type;if(!t)return null;if(e===this.node)return t;const n=e.attrs.layout||null;if(Wd.check_allow(this._node,n,!1))return n;const i=e.env.level-this.level;return"right"===t?"right":"left"===t?"left":"up"===t?"up":"down"===t?"down":"time-right"===t?1===i?"time-down":"right":"time-down"===t?"right":t}get_siblings_info(){const e=this.upstream;if(!e)return;const t=e.env.downstream,n=t.indexOf(this.node);return n<0?void 0:{prev:t[n-1],next:t[n+1],index:n}}}class hs extends ds{_editable=Kt(!1);_waiter=new Set;_layouted_self=Kt(!1);_show=Kt(!0);_mis=2;_env;bound;data;pcube;shape=Dt({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this._env=new us(this),this.bound=new iu(this,e.attrs.matrix2d||ko.get_default()),this.shape.type=e.attrs.shape||"rect"}get css(){return{...super.css,fill:this.env.node_fill}}get layouted_self(){return this._layouted_self.value}get is_selected(){return this.pcube.is_node_selected(this)}get env(){return this._env}get mis(){return this._mis}get map(){return this.pcube}get matrix2d(){return this.attrs.matrix2d}get rect(){return this.bound.rect}get show(){return this.pcube.check_node_visible(this)}_sample=wo(()=>{if(this.is_layout_root||!this.env.upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return So.offset_points(this.shape.sample,e)}return So.offset_points(this.shape.sample,this.bound.pos)});get attrs(){return this.data.attrs}get path(){return this.shape.path}get sample_count(){return 8}get sample(){return this._sample.value}get editable(){return this._editable.value}set editable(e){e?this.pcube.register_node_editing(this):this.pcube.remove_node_editing(this),this._editable.value=e;const t=this.courier.get_recorder(),n=this.child_last,i=Eo.in_tail(n.id);t.tell(n,i),this.history.record(t)}get is_layout_root(){return this.attrs.root||!1}get domain(){return"map"}get from(){const e=this.pcube.get_node_from(this.id);return new Set(e||[])}get to(){const e=this.pcube.get_node_to(this.id);return new Set(e||[])}get linkers_from(){const e=[];for(let t of this.from){const n=So.get_linker_id(t,this.id),i=this.pcube.get_linker(n);i&&e.push(i)}return e}get linkers_to(){const e=[];for(let t of this.to){const n=So.get_linker_id(this.id,t),i=this.pcube.get_linker(n);i&&e.push(i)}return e}get node_last(){const e=this.pcube.get_node_to(this.id),t=e?e[e.length-1]:this.id;return this.pcube.get_node(t)||this}get count_from(){return this.from.size}get count_to(){return this.to.size}get nodes_to(){const e=[];for(let t of this.to){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get nodes_from(){const e=[];for(let t of this.from){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get matrix2d_dom_string(){const{a:e,b:t,c:n,d:i,e:r,f:o}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return ko.get_dom_string(this.matrix2d);{const r=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${i.toFixed(1)},${r.x.toFixed(1)},${r.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:i,e:r,f:o}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return{...this.matrix2d};{const r=this.bound.pos;return{a:e,b:t,c:n,d:i,e:r.x,f:r.y}}}_init_handler(){this.set_cmd_handler(i.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(i.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(i.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(i.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(i.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(l.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(l.layout_update,this.on_layout_update.bind(this))}check_show(){}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof $d||t instanceof su)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}move_to_center(){const e=this.courier.get_recorder(),t=this.pcube.get_view_center(),n=this.pcube.transform_point(t),i=this.bound.pos_center,r=this.pcube.real_point_to_fig(i),o=n.x-r.x,s=n.y-r.y,a=ko.multiply(this.pcube.matrix2d,ko.get_matrix_translate(o,s)),l=jo.layout_change(this.id,{matrix2d:a});return e.tell(this,l),e}move_in_fig_view(){if(this.check_in_fig_view(!0))return;const e=this.pcube,t=e.view_rect,{dx:n,dy:i}=Io.MathRect.move_rect_in_other(this.bound.rect,t),r=ko.multiply(e.matrix2d,ko.get_matrix_translate(n,i));e.reset_matrix(r),this.map.check_show()}check_in_fig_view(e=!1){const t=this.pcube.view_rect;return e?Io.MathRect.is_include(t,this.rect):Io.MathRect.check_intersection(t,this.rect)}check_show_downstream(){return this.env.folded}layout(){let e=Date.now();if(this.bound.update_pos_tree_root(),this.env.has_layout_ability){const t=Bo.layout_tree(this);for(let e of t)e.layout();this.is_layout_root&&console.log("⚫布局根布局",this.id,Date.now()-e)}if(this.is_layout_root){const e=this.env.downstream_nodes;this.map.grider.update_nodes(e),this.map.check_show_throttle()}}layout_throttle=Io.Notice.throttle(this.layout.bind(this),10);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:i}=t,r=this.bound.size;if(this.layouted_self&&Math.abs(r.width-i)<this.mis&&Math.abs(r.height-n)<this.mis)return;this._layouted_self.value=!0;const o={width:Math.ceil(i),height:Math.ceil(n)};this.bound.update_size(o.width,o.height),this.shape.path=ru.get_shaple(this,this.config.data.map_node_padding),this.shape.sample=this.get_sample(),this.env.upstream||this.check_show();for(let e of this._waiter)e()}wait_layout_self(){return new Promise(e=>{this.layouted_self?e(!0):this._waiter.add(e)})}check_show_line(){const e=this.id;for(let t of this.to){const n=So.get_linker_id(e,t),i=this.pcube.get_linker(n);i&&(this.attrs.fold?i.show=!1:i.to_node?.show||this.show?i.show=!0:i.show=!1)}for(let t of this.from){const n=So.get_linker_id(t,e),i=this.pcube.get_linker(n);if(!i)continue;let r=i.from_node;const o=!r?.attrs.fold,s=this.show||r?.show;i.show=!(!o||!s)}}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=Io.MathRect.get_rect_point;return[t(e,Io._RectPosition.left_top),t(e,Io._RectPosition.top_mid),t(e,Io._RectPosition.right_top),t(e,Io._RectPosition.right_mid),t(e,Io._RectPosition.right_bottom),t(e,Io._RectPosition.bottom_mid),t(e,Io._RectPosition.left_bottom),t(e,Io._RectPosition.left_mid),t(e,Io._RectPosition.left_top)]}return So.svg_path_sample(this.shape.path,this.sample_count)}gc(){this.base_gc(),this.map?.grider.remove_node(this)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}reset_matrix(e){Object.assign(this.matrix2d,e),this.bound.update_pos()}get_node(e){if(e)return this.pcube.get_node(e)}get_layout_index(e){return e.indexOf(this)}translate(e,t){const n=ko.translate(this.matrix2d,e,t);this.reset_matrix(n)}break_link_node(e){this.from.delete(e),this.to.delete(e)}remove_self(){for(let e of this.from){const t=this.pcube.find_child_cube(e);t&&t instanceof hs&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof hs&&t.break_link_node(this.id)}return super.remove_self()}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,o=To.build_cubes(n,this);return this.splice(0,this.child_count,...o),i.add_recover(Lo.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:o}=e,s=this.find_child_cube(r);if(!s||s.index===o)return;const a=new Ro(t);let l=0,c=s.index;return"tail"===o?l=this.child_count:"number"==typeof o&&(l=o),this.splice(c,1),this.splice(l,0,s),a.add_recover(Lo.reorder(this.id,s.id,c)),a}on_insert_child(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:o}=e;if(0===o.length)return i;const s=[];for(let e of o)e.type===n.box_root&&s.push(new Za(e,this));let a=this.get_valid_index(r);this.splice(a,0,...s);const l=s[s.length-1];return l&&i.tell(l,Eo.in_tail(l.id)),i.add_recover(Lo.delete_child(this.id,"backward",[a,a+s.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:o}=e,[s,a]=o,l=t.get_recorder();l.add_cmd(e);const c=this.children[s-1],d=this.children[a],u=a-s;if(s!==a){if(s<=0&&a>=this.child_count){this.child_first;l.tell(this,Lo.reset(this.id,[]));const e=Lo.insert_child(this.id,[Za.get_default()],0);return l.tell(this,e),l}{let e=this.splice(s,u);c&&"backward"===r||!d?l.tell(c,Eo.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,Eo.in_head(d.id));const t=e.data;l.add_recover(Lo.insert_child(this.id,t,s))}return l}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,o=new Ro(t),{data:s,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,u=this.find_cube(l),h=this.find_cube(a),p=u?.find_upstream_untill(this),f=h?.find_upstream_untill(this);if(!p||!f)return o;if(h!==u||d!==c)if(p&&p===f)o.tell(p,Lo.delete(p.id,"backward",l,a,d,c)),o.tell(p,Lo.insert(p.id,s,l,a,d,c));else{o.tell(f,Lo.delete(f.id,"backward",null,a,"head",c)),o.tell(this,Lo.delete_child(this.id,"backward",[p.index+1,f.index])),o.tell(this,Lo.insert_child(this.id,e.data,p.index+1)),o.tell(p,Lo.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&o.tell(e,Eo.in_tail(t.id))}}else o.tell(h,Lo.insert(a,s,l,a,d,c));return o}on_layout_update(e){const{courier:t,history:n}=this,i={...e.attrs},r=t.get_recorder(),o=structuredClone(Vt(this.data.attrs));r.add_cmd(e);const s={fold:o.fold,is_under_root:this.env.is_under_root,upstream:this.env.upstream,is_root:this.is_layout_root};!("layout"in i)||!i.layout||this.env.is_under_root||"root"in i||o.root||(i.root=!0);for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t)}let a=!1,l=!1,c=!1;const d="layout"in i&&o.layout!==i.layout,u="fold"in i&&s.fold!==i.fold,h="gap_x"in i&&o.gap_x!==i.gap_x,p="gap_y"in i&&o.gap_y!==i.gap_y,f="root"in i&&o.root!==i.root;if("matrix2d"in i&&i.matrix2d&&!this.env.is_captive&&(this.bound.update_pos(),this.env.has_layout_ability)){if(this.env.is_under_free_root){const e=Do.layout_tree(this);e&&this.bound.update_pos_tree(e.x,e.y,!1)}this.layout_throttle(),this.is_layout_root&&(c=!0)}if(f)if(!s.is_root&&i.root)s.upstream?.env.flow("self"),s.upstream?.bound.flow("self"),s.upstream?.bound.flow("upstream"),s.upstream?.env.layout_root?.layout_throttle(),this.env.flow("downstream"),this.bound.flow("downstream"),this.layout_throttle(),l=!0,a=!0,c=!0;else if(s.is_root&&!this.is_layout_root){const e=So.find_line_to_layout_root(this);if(e.has_root){const t=e.line[1];t?.env.flow("downstream"),t?.bound.flow("self"),t?.bound.flow("upstream"),t?.env.layout_root?.layout_throttle()}else this.env.free()}l||d&&(this.is_layout_root?this.env.flow("downstream"):this.env.upstream?.env.flow("downstream"),this.env.layout_root?.layout_throttle(),l=!0,c=!0),a||(d||u||h||p)&&(this.bound.flow("downstream"),this.bound.flow("upstream"),this.env.layout_root?.layout_throttle(),a=!0),c||(d||u||h||p)&&this.env.layout_root?.layout_throttle();const m=jo.layout_change(this.id,o);return r.add_recover(m),r}on_append_child(e){const{courier:t,history:n,pcube:i}=this,{previd:r}=e,o=this.env.node_gap_x,s=t.get_recorder(),a=this.node_last.bound,l={x:a.pos.x,y:a.pos.y+a.size_bound.height+o},c=tu.get_default(l),d=qo.node_add(i.id,[c]);s.tell(i,d);const u=So.create_linker_info(this.pcube,this.id,c.id),h=qo.linker_add(i.id,[u]);s.tell(i,h);const p=i.get_node_to(this.id),f=p?.indexOf(c.id);if(p&&void 0!==f&&f>=0)if(null===r)p.splice(f,1),p.unshift(c.id);else if(r){const e=p.indexOf(r);e>=0&&(p.splice(f,1),p.splice(e+1,0,c.id))}return s}static get_default_node_size(e=0){return{width:ns.default_config.map_node_default_width+2*e,height:52+2*e}}static get_default_node_pos(e,t){const{map_node_padding:n}=t.config.data,i=t.view_point_to_real(e),r=hs.get_default_node_size(n);return{x:i.x-r.width/2,y:i.y-r.height/2}}}function ps(e,t){return t.css.width?Number.parseInt(t.css.width.trim().slice(0,-2)):e.getBoundingClientRect().width}function fs(e,t,n,i){e.stopPropagation(),e.preventDefault(),i.isdown=!0,i.dir=n,i.dom=t.dom;const r=e.currentTarget,o=r.parentElement?.parentElement;if(!o)return;i.x=e.clientX,i.width_origin=t.css.width;const s=ps(o,t);i.width=s,i.width_result=s}const ms=Dt({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),_s=Dt({open:!1,data:{},submit(){}});function gs(e,t){_s.open=!0,_s.submit=t,_s.data=e}function bs(e){const t=[..._a(e,!0),{usable:!0,title:"语言",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){const t={cube:e,title:"选择语言",layout:"grid",is_cube_menu:!1,active:[e.active_tab?.lang||""],menus:e.langs.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:o,active_tab:s}=e;if(!s)return;const a=i.get_recorder();a.tell(e,Fu.change_lang(o,s.id,t)),r.record(a)}}))};return t}(e),click(e){}},{usable:!0,title:"主题",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){const t={cube:e,title:"选择主题",layout:"grid",is_cube_menu:!1,active:[e.active_tab?.theme||""],menus:e.themes.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:o,active_tab:s}=e;if(!s)return;const a=i.get_recorder();a.tell(e,Fu.change_theme(o,s.id,t)),r.record(a)}}))};return t}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){gs({文件名:""},t=>{const n=t["文件名"],i=n.lastIndexOf(".");let r="typescript";if(i>=0){const e=n.slice(i);r=k_[e]||r}const{code_theme:o}=e.config.data,s=e.create_tab(r,n,o),a=e.courier.get_recorder();a.tell(e,Fu.add(e.id,s)),e.history.record(a)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){gs({文件名:e.active_tab?.name||""},t=>{const n=e.active_tab;if(!n)return;const i=t["文件名"],r=e.courier.get_recorder();r.tell(e,Fu.rename(e.id,n.id,i)),e.history.record(r)})},mouseenter(e){}},{usable:!0,title:"复制代码",icon:["iconfont","icon-copy"],click(t){e.copy_code()},mouseenter(e){}},{usable:!0,title:"清空代码",icon:["iconfont","icon-eraser"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,Fu.update(e.id,n.id,"")),e.history.record(i)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,Fu.remove(e.id,n.id)),e.history.record(i)},mouseenter(e){}}];return{cube:e,title:e.meta.cubename,layout:"grid",is_cube_menu:!0,active:[],menus:t}}function ys(e){const t=e.get_active_cell(),n=[..._a(e),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:i,id:r}=e,o=i.get_recorder();if(e.title){const t=Nw.remove_title(r);o.tell(e,t)}else{const t=Ec.get_default(),n=Nw.add_title(r,t);o.tell(e,n)}n.record(o)}},{usable:e.selection_cells.length>0,title:"复制子表",icon:["iconfont","icon-grid"],has_submenu:!1,mouseenter(e){},click(t){const{clipboard:n}=e,i=Mo.tips,r=e.copy_selection_table();if(!r)return Mo.tips?.tip_error("复制子表失败");const o=e.get_selection_text();n.set_clipboard_cubedata(o,[r]),i?.tip_success("复制子表成功")}},{usable:e.selection_cells.length>0,title:"合并单元格",icon:["iconfont","icon-hebingdanyuange"],has_submenu:!1,mouseenter(e){},click(t){!function(e){const{courier:t,id:n,history:i}=e,r=Mo.tips,o=t.get_recorder(),s=e.get_selection_area();if(!s)return r?.tip_info("无选中单元格");o.tell(e,Nw.merge(n,s)),i.record(o)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){Ss(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){Ss(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){vs(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){ws(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){xs(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){ks(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){vs(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){ws(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){xs(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){ks(e,!0)}},{usable:!!t,title:"删除当前行",icon:["iconfont","icon-shanchuhang"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:o}=e,s=Mo.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");const c=e.check_orderly_row(l.row);if(!c)return s?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,Nw.remove_row(o,l.row)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前列",icon:["iconfont","icon-shanchulie"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:o}=e,s=Mo.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");const c=e.check_orderly_col(l.col);if(!c)return s?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,Nw.remove_col(o,l.col)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前单元格",icon:["iconfont","icon-list-delete-cell"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:o}=e,s=Mo.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");const c=n.get_recorder();c.tell(e,Nw.remove_cell(o,l.box.id)),r.record(c)}(e)}}];return{cube:e,title:e.meta.cubename,layout:"grid",is_cube_menu:!0,active:[],menus:n}}function vs(e,t=!1){const{cursor:n,courier:i,stats:r,history:o}=e,s=Mo.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col-1))return s?.tip_info("左侧已存在单元格");if(l.col-1<0)return s?.tip_info("左侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col-1,rowspan:1,colspan:1,data:Ec.get_default()};t.tell(e,Nw.add_cell(e.id,n)),o.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_left(t.left))return s?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(Ec.get_default());n.tell(e,Nw.add_col(e.id,l.col,r)),o.record(n)}}function ws(e,t=!1){const{cursor:n,courier:i,stats:r,history:o}=e,s=Mo.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col+1))return s?.tip_info("右侧已存在单元格");if(l.col+1>=e.size[1])return s?.tip_info("右侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col+1,rowspan:1,colspan:1,data:Ec.get_default()};t.tell(e,Nw.add_cell(e.id,n)),o.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_right(t.right))return s?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(Ec.get_default());n.tell(e,Nw.add_col(e.id,l.col+l.colspan,r)),o.record(n)}}function xs(e,t=!1){const{cursor:n,courier:i,stats:r,history:o}=e,s=Mo.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row-1,l.col))return s?.tip_info("上方已存在单元格");if(l.row-1<0)return s?.tip_info("上方已达边界");{const t=i.get_recorder(),n={row:l.row-1,col:l.col,rowspan:1,colspan:1,data:Ec.get_default()};t.tell(e,Nw.add_cell(e.id,n)),o.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_top(t.top))return s?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(Ec.get_default());n.tell(e,Nw.add_row(e.id,l.row,r)),o.record(n)}}function ks(e,t=!1){const{cursor:n,courier:i,stats:r,history:o}=e,s=Mo.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return s?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row+1,l.col))return s?.tip_info("下方已存在单元格");if(l.row+1>=e.size[0])return s?.tip_info("下方已达边界");{const t=i.get_recorder(),n={row:l.row+1,col:l.col,rowspan:1,colspan:1,data:Ec.get_default()};t.tell(e,Nw.add_cell(e.id,n)),o.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_bottom(t.bottom))return s?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(Ec.get_default());n.tell(e,Nw.add_row(e.id,l.row+l.rowspan,r)),o.record(n)}}function Ss(e,t){const{cursor:n,courier:i,stats:r,history:o,id:s}=e,a=Mo.tips,{cube_end:l}=n,c=e.get_active_cell();if(!c)return a?.tip_info("未发现激活单元格");const d=i.get_recorder(),u=e.get_cell_area(c);d.tell(e,Nw.col_resize(s,[u.left,u.right],t)),o.record(d)}let Cs,Ms,zs=!1,As=null,Ts=null;function Ps(e){const{courier:t,history:n,id:i,cubes:r}=e,o=t.get_recorder();o.tell(e,Lo.fold(i,!e.attrs.fold)),n.record(o);for(let t of Object.values(r.postils))t.pcube?.top===e&&t.visible(!1);const s=e.child_first.id;if(!s)return;const a=document.getElementById(s);a?.scrollIntoView({block:"nearest",behavior:"smooth"})}function Ns(e,t){Ps(t)}function Os(e,t){e.preventDefault();const{root:n,stats:i}=t;i.anchor_root_id===t.id?i.anchor_root_id="":n.stats.anchor_root_id=t.id}function Rs(e){const t=[..._a(e),{usable:!0,title:"添加块",shortcut:"",has_submenu:!1,icon:["iconfont","icon-add"],mouseenter(){},click(){!function(e){const{courier:t,history:n}=e,i=t.get_recorder(),r=[Ec.get_default()];i.tell(e,Lo.insert_child(e.id,r,e.child_count)),n.record(i)}(e)}},{usable:!0,title:"布局•限定列宽",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:120,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Es(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Es(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Es(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Es(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Es(e,200)}}],n={cube:e,title:"限定列宽",layout:"list",is_cube_menu:!1,active:[e.attrs.column_width],menus:t};return n}(e),click(){}},{usable:!0,title:"布局•限定列数",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:2,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Ls(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Ls(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Ls(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Ls(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Ls(e,6)}}],n={cube:e,title:"限定列数",layout:"list",is_cube_menu:!1,active:[e.attrs.column_count],menus:t};return n}(e),click(){}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}function Ls(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,Lo.set_attr(e.id,{column_count:t,column_width:null})),i.record(r)}function Es(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,Lo.set_attr(e.id,{column_width:t,column_count:null})),i.record(r)}class Is{static reset(e,t){return{id:e,name:m.reset,data:t}}static add(e,t,n){return{id:e,name:m.add,data:t,pos:n}}static remove(e,t){return{id:e,name:m.remove,range:t}}static indent(e,t){return{id:e,name:m.indent,items:t}}}function Ds(e,t=!1){const n=e,{cursor:i,courier:r,history:o}=e,{cube_start:s,cube_end:a}=i;if(!s||!a)return;const l=r.get_recorder();if(t){const e=s.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Is.indent(n.id,r)),o.record(l)}else{const e=s.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Is.indent(n.id,r)),o.record(l)}}function Bs(e,t=!1){const n=e,{cursor:i,courier:r,history:o}=e,{cube_start:s,cube_end:a}=i;if(!s||!a)return;const l=r.get_recorder();if(t){const e=s.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Lu.indent(n.id,r)),o.record(l)}else{const e=s.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Lu.indent(n.id,r)),o.record(l)}}function js(e,t=!1){const n=e,{cursor:i,courier:r,history:o}=e,{cube_start:s,cube_end:a}=i;if(!s||!a)return;const l=r.get_recorder();if(t){const e=s.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,xu.indent(n.id,r)),o.record(l)}else{const e=s.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,xu.indent(n.id,r)),o.record(l)}}function qs(e,t="tail"){const{courier:n,history:i}=e,r=new Ro(n),o=[Ec.get_default(),Ec.get_default()],s=_u.insert_row(e.id,t,[o]);r.tell(e,s),i.record(r)}const Fs=Dt({alpha:10,bg:"#ffffff"}),Hs=window.matchMedia("(prefers-color-scheme: dark)");Hs.addEventListener("change",e=>{e.matches?(Fs.bg="#000000",console.log("切换到深色模式")):(Fs.bg="#ffffff",console.log("切换到浅色模式"))});function $s(e,t,n="#FFFFFF"){return function(e,t,n="#FFFFFF"){const i=/^#([0-9A-F]{3}){1,2}$/i;if(!i.test(e)||!i.test(n))throw new Error("Invalid hex color format");const r=e=>{let t=e.replace("#","");return 3===t.length&&(t=t.split("").map(e=>e+e).join("")),t},o=r(e),s=r(n),a={r:parseInt(o.substring(0,2),16),g:parseInt(o.substring(2,4),16),b:parseInt(o.substring(4,6),16)},l={r:parseInt(s.substring(0,2),16),g:parseInt(s.substring(2,4),16),b:parseInt(s.substring(4,6),16)},c=[];for(let e=0;e<t;e++){const n=e/(t-1||1),i=Math.round(a.r+(l.r-a.r)*n),r=Math.round(a.g+(l.g-a.g)*n),o=Math.round(a.b+(l.b-a.b)*n),s="#"+((1<<24)+(i<<16)+(r<<8)+o).toString(16).slice(1).toUpperCase(),d=Gs(i,r,o,150);c.push({fill:s,color:d})}return c}(e,t,n)}function Gs(e,t,n,i=158){return(299*e+587*t+114*n)/1e3>i?"#000000":"#FFFFFF"}function Vs(e){if(!/^#([0-9A-F]{3,4}){1,2}$/i.test(e))throw new Error(`Invalid hex color format: ${e}`);let t=e.replace("#","").toUpperCase();return 3!==t.length&&4!==t.length||(t=t.split("").map(e=>e+e).join("")),6===t.length&&(t+="FF"),{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:parseInt(t.substring(6,8),16)/255}}Hs.matches?(Fs.bg="#000000",console.log("当前是深色模式")):(Fs.bg="#ffffff",console.log("当前是浅色模式(或无偏好)"));const Us={class:"menu-node-fill"},Ws={class:"box-items"},Ys=["onClick"],Xs=["onClick"],Ks=Bn({__name:"menu-node-fill",props:{cube:{},hide:{type:Function}},setup(e){const t=[...$s("#000000",13).slice(0,-1),...$s("#ff006e",13).slice(0,-1),...$s("#fb5607",13).slice(0,-1),...$s("#f0f600",13).slice(0,-1),...$s("#affc41",13).slice(0,-1),...$s("#06d6a0",13).slice(0,-1),...$s("#00b4d8",13).slice(0,-1),...$s("#5c7aff",13).slice(0,-1),...$s("#7400b8",13).slice(0,-1)],n=wo(()=>{const e=[{name:"清空",value:{fill:null,color:null},css:{background:"transparent"}},{name:"透明",value:{fill:"transparent"},css:{background:"transparent"}}],n=function(e){if(e<1||e>10)throw new Error("透明度等级必须在1-10之间");if(!Number.isInteger(e))throw new Error("透明度等级必须是整数");const t=(e-1)/9;return Math.round(255*t).toString(16).toUpperCase().padStart(2,"0")}(Fs.alpha);for(let i of t){let t=i.fill+n;e.push({name:"",value:{fill:t},css:{background:t}})}return e});return(t,i)=>(Nr(),Ir("div",Us,[i[0]||(i[0]=Hr("div",{class:"menu-title"},[Hr("span",{class:"title iconfont icon-sp"},"节点填充色")],-1)),Hr("div",Ws,[(Nr(),Ir(Cr,null,_i(10,e=>Hr("div",{class:ve(["alpha-item",{active:Zt(Fs).alpha===e}]),onClick:t=>{return n=e,void(Fs.alpha=n);var n}},Ce(e),11,Ys)),64)),(Nr(!0),Ir(Cr,null,_i(n.value,t=>(Nr(),Ir("div",{class:"background-item",style:me(t.css),onClick:n=>function(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,t.value);r.tell(e.cube,o),i.record(r)}(t)},Ce(t.name),13,Xs))),256))])]))}});var Js=r(6960);const Qs=(0,Js.A)(Ks,[["__scopeId","data-v-7eb6f1ec"]]),Zs={class:"menu-node-layout"},ea=["onClick"],ta=Bn({__name:"menu-node-layout",props:{cube:{},hide:{type:Function}},setup(e){const t=e.cube,n=wo(()=>Wd.get_layout_detail(t?.env.upstream));return(i,r)=>(Nr(),Ir("div",Zs,[(Nr(!0),Ir(Cr,null,_i(n.value,n=>(Nr(),Ir("div",{class:ve(["layout-item",{usable:n.usable}]),onClick:i=>function(t,n){if(!t||!n.usable)return e.hide();const{courier:i,history:r}=t,o=i.get_recorder(),s=jo.layout_change(t.id,{layout:n.type});o.tell(t,s),r.record(o),e.hide()}(Zt(t),n)},[Hr("div",{class:ve(n.icon)},null,2)],10,ea))),256))]))}}),na=(0,Js.A)(ta,[["__scopeId","data-v-a3367bb6"]]),ia={class:"menu-node-linker"},ra={class:"box-items"},oa=Bn({__name:"menu-node-linker",props:{cube:{},hide:{type:Function}},setup(e){function t(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{anchor_out:t});r.tell(e.cube,o),i.record(r)}function n(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{anchor_in:t});r.tell(e.cube,o),i.record(r)}function i(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{line_type:t});r.tell(e.cube,o),i.record(r)}function r(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{line_width:t});r.tell(e.cube,o),i.record(r)}function o(t){return{active:t===e.cube.attrs.anchor_out}}function s(t){return{active:t===e.cube.attrs.anchor_in}}function a(t){return{active:t===e.cube.attrs.line_type}}function l(t){return{active:t===e.cube.attrs.line_width}}return(e,c)=>(Nr(),Ir("div",ia,[c[28]||(c[28]=Hr("div",{class:"menu-title"},[Hr("span",{class:"title iconfont icon-sp"},"节点连线")],-1)),Hr("div",ra,[c[20]||(c[20]=Hr("div",{class:"item header"},"出点",-1)),Hr("div",{class:ve(["item iconfont icon-a-Arrow-Right",o(Zt(x).arrow)]),onClick:c[0]||(c[0]=e=>t(Zt(x).arrow))},null,2),Hr("div",{class:ve(["item iconfont icon-circle",o(Zt(x).point)]),onClick:c[1]||(c[1]=e=>t(Zt(x).point))},null,2),Hr("div",{class:ve(["item iconfont icon-square",o(Zt(x).square)]),onClick:c[2]||(c[2]=e=>t(Zt(x).square))},null,2),Hr("div",{class:ve(["item iconfont icon-cube",o(Zt(x).rhomb)]),onClick:c[3]||(c[3]=e=>t(Zt(x).rhomb))},null,2),c[21]||(c[21]=Hr("div",{class:"item"},null,-1)),c[22]||(c[22]=Hr("div",{class:"item"},null,-1)),c[23]||(c[23]=Hr("div",{class:"item header"},"线型",-1)),Hr("div",{class:ve(["item iconfont icon-zhixian",a("line")]),onClick:c[4]||(c[4]=e=>i("line"))},null,2),Hr("div",{class:ve(["item iconfont icon-line-type",a("bezier2")]),onClick:c[5]||(c[5]=e=>i("bezier2"))},null,2),Hr("div",{class:ve(["item iconfont icon-zhexian1",a("polyline")]),onClick:c[6]||(c[6]=e=>i("polyline"))},null,2),Hr("div",{class:ve(["item iconfont icon-zhexian2",a("polyline2")]),onClick:c[7]||(c[7]=e=>i("polyline2"))},null,2),Hr("div",{class:ve(["item iconfont icon-zhexian3",a("polyline3")]),onClick:c[8]||(c[8]=e=>i("polyline3"))},null,2),Hr("div",{class:ve(["item iconfont icon-bolangxian",a("wave")]),onClick:c[9]||(c[9]=e=>i("wave"))},null,2),c[24]||(c[24]=Hr("div",{class:"item header"},"入点",-1)),Hr("div",{class:ve(["item iconfont icon-a-Arrow-Right",s(Zt(x).arrow)]),onClick:c[10]||(c[10]=e=>n(Zt(x).arrow))},null,2),Hr("div",{class:ve(["item iconfont icon-circle",s(Zt(x).point)]),onClick:c[11]||(c[11]=e=>n(Zt(x).point))},null,2),Hr("div",{class:ve(["item iconfont icon-square",s(Zt(x).square)]),onClick:c[12]||(c[12]=e=>n(Zt(x).square))},null,2),Hr("div",{class:ve(["item iconfont icon-cube",s(Zt(x).rhomb)]),onClick:c[13]||(c[13]=e=>n(Zt(x).rhomb))},null,2),c[25]||(c[25]=Hr("div",{class:"item"},null,-1)),c[26]||(c[26]=Hr("div",{class:"item"},null,-1)),c[27]||(c[27]=Hr("div",{class:"item header"},"线宽",-1)),Hr("div",{class:ve(["item line-1",l(1)]),onClick:c[14]||(c[14]=e=>r(1))},null,2),Hr("div",{class:ve(["item line-2",l(2)]),onClick:c[15]||(c[15]=e=>r(2))},null,2),Hr("div",{class:ve(["item line-3",l(3)]),onClick:c[16]||(c[16]=e=>r(3))},null,2),Hr("div",{class:ve(["item line-4",l(4)]),onClick:c[17]||(c[17]=e=>r(4))},null,2),Hr("div",{class:ve(["item line-5",l(5)]),onClick:c[18]||(c[18]=e=>r(5))},null,2),Hr("div",{class:ve(["item line-6",l(6)]),onClick:c[19]||(c[19]=e=>r(6))},null,2)])]))}}),sa=(0,Js.A)(oa,[["__scopeId","data-v-a0172c1a"]]),aa={class:"menu-node-gap"},la={class:"box-items"},ca=Bn({__name:"menu-node-gap",props:{cube:{},hide:{type:Function}},setup(e){function t(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{gap_x:t});r.tell(e.cube,o),i.record(r)}function n(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{gap_y:t});r.tell(e.cube,o),i.record(r)}function i(t){return{active:t===e.cube.env.node_gap_x}}function r(t){return{active:t===e.cube.env.node_gap_y}}return(e,o)=>(Nr(),Ir("div",aa,[o[18]||(o[18]=Hr("div",{class:"menu-title"},[Hr("span",{class:"title iconfont icon-sp"},"节点间隔")],-1)),Hr("div",la,[o[16]||(o[16]=Hr("div",{class:"item header"},"水平间隔",-1)),Hr("div",{class:ve(["item gap-h",i(10)]),onClick:o[0]||(o[0]=e=>t(10))},"10",2),Hr("div",{class:ve(["item gap-h",i(20)]),onClick:o[1]||(o[1]=e=>t(20))},"20",2),Hr("div",{class:ve(["item gap-h",i(30)]),onClick:o[2]||(o[2]=e=>t(30))},"30",2),Hr("div",{class:ve(["item gap-h",i(40)]),onClick:o[3]||(o[3]=e=>t(40))},"40",2),Hr("div",{class:ve(["item gap-h",i(50)]),onClick:o[4]||(o[4]=e=>t(50))},"50",2),Hr("div",{class:ve(["item gap-h",i(60)]),onClick:o[5]||(o[5]=e=>t(60))},"60",2),Hr("div",{class:ve(["item gap-h",i(70)]),onClick:o[6]||(o[6]=e=>t(70))},"70",2),Hr("div",{class:ve(["item gap-h",i(80)]),onClick:o[7]||(o[7]=e=>t(80))},"80",2),o[17]||(o[17]=Hr("div",{class:"item header"},"垂直间隔",-1)),Hr("div",{class:ve(["item gap-v",r(10)]),onClick:o[8]||(o[8]=e=>n(10))},"10",2),Hr("div",{class:ve(["item gap-v",r(20)]),onClick:o[9]||(o[9]=e=>n(20))},"20",2),Hr("div",{class:ve(["item gap-v",r(30)]),onClick:o[10]||(o[10]=e=>n(30))},"30",2),Hr("div",{class:ve(["item gap-v",r(40)]),onClick:o[11]||(o[11]=e=>n(40))},"40",2),Hr("div",{class:ve(["item gap-v",r(50)]),onClick:o[12]||(o[12]=e=>n(50))},"50",2),Hr("div",{class:ve(["item gap-v",r(60)]),onClick:o[13]||(o[13]=e=>n(60))},"60",2),Hr("div",{class:ve(["item gap-v",r(70)]),onClick:o[14]||(o[14]=e=>n(70))},"70",2),Hr("div",{class:ve(["item gap-v",r(80)]),onClick:o[15]||(o[15]=e=>n(80))},"80",2)])]))}}),da=(0,Js.A)(ca,[["__scopeId","data-v-248dd330"]]);function ua(e){const t=[{usable:!0,title:"切换布局根",icon:["iconfont","icon-system-mind-map-filled"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.courier.get_recorder(),i=jo.layout_change(e.id,{root:!e.attrs.root});n.tell(e,i),e.history.record(n)}},{usable:!0,title:"切换布局",icon:["iconfont","icon-layout-2-fill"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(na)}}(e),click(e){}},{usable:!0,title:"切换折叠",icon:["iconfont","icon-minus"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.courier.get_recorder(),i=jo.layout_change(e.id,{fold:!e.attrs.fold});n.tell(e,i),e.history.record(n)}},{usable:!0,title:"填充色",icon:["iconfont","icon-background"],shortcut:"",has_submenu:!0,mouseenter:t=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(Qs)}}(e),click(e){}},{usable:!0,title:"连线",icon:["iconfont","icon-background"],shortcut:"",has_submenu:!0,mouseenter:t=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(sa)}}(e),click(e){}},{usable:!0,title:"布局间隔",icon:["iconfont","icon-bimgis_suanliang"],shortcut:"",has_submenu:!0,mouseenter:t=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(da)}}(e),click(e){}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}async function ha(e,t){const n=t.root;if(n instanceof su&&n.interaction.flowing)return;e.preventDefault(),e.stopPropagation(),ms.cube=t,ms.point={x:e.clientX,y:e.clientY},ms.stack_pos.length=0,ms.stack_rect.length=0,ms.stack_menus.length=0;const i=pa(t);i&&(ms.menu=i)}function pa(e){return e instanceof tu?ua(e):e instanceof M_?bs(e):e instanceof Uw?ys(e):e instanceof Za?function(e){const t=[..._a(e),{usable:!e.attrs.fold,title:"折叠",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){Ps(e)}},{usable:!!e.attrs.fold,title:"展开",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){Ps(e)}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof nx?Rs(e):e instanceof Ru?function(e){const t=[{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){Ds(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){Ds(e,!0)}},{get usable(){return!(e.pcube instanceof pu)},title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,o=structuredClone(e.export());o.id=To.get_id(),o.type=n.list_ordered;const s=e.pcube,a=e.index,l=i.get_recorder(),c=Lo.delete_child(s.id,"backward",[a,a+1],!0),d=Lo.insert_child(s.id,[o],a);l.tell(s,c,d),r.record(l)}},{get usable(){return!(e.pcube instanceof pu)},title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,o=structuredClone(e.export());o.id=To.get_id(),o.type=n.todo;for(let e of o.info)e.done=e.done||!1;const s=e.pcube,a=e.index,l=i.get_recorder(),c=Lo.delete_child(s.id,"backward",[a,a+1],!0),d=Lo.insert_child(s.id,[o],a);l.tell(s,c,d),r.record(l)}}];return e.pcube instanceof pu||t.unshift(..._a(e)),{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof qu?function(e){const t=[..._a(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){Bs(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){Bs(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,o=structuredClone(e.export());o.id=To.get_id(),o.type=n.list;const s=e.pcube,a=e.index,l=i.get_recorder(),c=Lo.delete_child(s.id,"backward",[a,a+1],!0),d=Lo.insert_child(s.id,[o],a);l.tell(s,c,d),r.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,o=structuredClone(e.export());o.id=To.get_id(),o.type=n.todo;for(let e of o.info)e.done=e.done||!1;const s=e.pcube,a=e.index,l=i.get_recorder(),c=Lo.delete_child(s.id,"backward",[a,a+1],!0),d=Lo.insert_child(s.id,[o],a);l.tell(s,c,d),r.record(l)}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof Au?function(e){const t=[..._a(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){js(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){js(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,o=structuredClone(e.export());o.id=To.get_id(),o.type=n.list;const s=e.pcube,a=e.index,l=i.get_recorder(),c=Lo.delete_child(s.id,"backward",[a,a+1],!0),d=Lo.insert_child(s.id,[o],a);l.tell(s,c,d),r.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,o=structuredClone(e.export());o.id=To.get_id(),o.type=n.list_ordered;const s=e.pcube,a=e.index,l=i.get_recorder(),c=Lo.delete_child(s.id,"backward",[a,a+1],!0),d=Lo.insert_child(s.id,[o],a);l.tell(s,c,d),r.record(l)}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof ka?function(e){const t=[{usable:!0,title:"下载",icon:["iconfont","icon-download"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){e.event.emit_asset_download("image",e.info)}},{usable:!0,title:"复制到粘贴板",icon:["iconfont","icon-copy"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.dom?.querySelector("img");if(!n)return Mo.tips?.tip_error("复制失败");fetch(n.src).then(e=>e.blob()).then(async t=>{const n=new ClipboardItem({"image/png":t});await e.clipboard.set_clipboard_data(n)&&Mo.tips?.tip_success("复制成功🍊")})}},{usable:!0,title:"文字环绕",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){const t=[{usable:!0,title:"无环绕",icon:["iconfont","icon-close"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.clear_float())}},{usable:!0,title:"左环绕",icon:["iconfont","icon-floatleft"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float_image("L"))}},{usable:!0,title:"右环绕",icon:["iconfont","icon-floatright"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float_image("R"))}}];return{cube:e,title:"文字环绕",layout:"list",is_cube_menu:!1,active:[],menus:t}}(e),click(e){}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof wu?function(e){const t=[..._a(e,!1),{usable:!0,title:"向下插入行",shortcut:"ctrl + enter",icon:["iconfont","icon-cc-arrow-down-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof Ec&&qs(e,Math.floor(i.index/2)+1)}},{usable:!0,title:"向上插入行",shortcut:"ctrl + shift + enter",icon:["iconfont","icon-cc-arrow-up-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof Ec&&qs(e,Math.floor(i.index/2))}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof pu?function(e){const t=[..._a(e),{usable:!e.exceptions,title:"添加异常块",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){e.add_exceptions()}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):void 0}function fa(e,t,n,i=5){e.width,Math.abs(e.y-n.y),e.width,Math.abs(e.height-(n.y+n.height)),Math.abs(n.x-e.x),e.height;const r={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(Io.MathRect.can_include_size(r,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}{const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}}function ma(e,t){const{courier:n,history:i}=e,r=n.get_recorder(),o=e.pcube;if("A"===t)if(e instanceof Za){const t=Za.get_default();r.tell(o,Lo.insert_child(o.id,[t],e.index+1))}else{const t=Pc.get_default(),n=Lo.insert_child(o.id,[t],e.index+1);r.tell(o,n)}else if("B"===t&&e)if(e instanceof Za){const t=Za.get_default();r.tell(o,Lo.insert_child(o.id,[t],e.index))}else{const t=Pc.get_default(),n=Lo.insert_child(o.id,[t],e.index);r.tell(o,n)}i.record(r)}function _a(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){ma(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){ma(e,"A")}}],i={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(i),n}const ga=["id","data-type"],ba={class:"tools-left"},ya={class:"tools-right"},va=["src","loading"],wa=Bn({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:i}=e.cube,r={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},o=Dt({resize_origin_width:-1,resize_result:-1,resize_scroll:!1}),s=t.id,a=Mo.url,l=t=>fs(t,e.cube,"left",r),c=t=>fs(t,e.cube,"right",r),d=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const i="left"===n.dir?1:-1,r=e.clientX-n.x,o=Math.abs(n.width-r*i);t.data.css.width=o+"px",n.width_result=o}(t,e.cube,r),u=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,o=new Ro(i);o.tell(t,Lo.set_css(t.id,{width:n.width_result+"px"})),r.record(o)}(0,e.cube,r),h=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,o=new Ro(i);o.tell(t,Lo.set_css(t.id,{width:n.width_result+"px"})),r.record(o)}(0,e.cube,r);function p(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}function f(t){if(!o.resize_scroll)return;const{deltaY:n}=t,i=t.currentTarget;if(!i)return;t.preventDefault(),t.stopPropagation();let r=ps(i,e.cube)+10*Math.sign(n);e.cube.data.css.width=r+"px",o.resize_result=r}return ni(()=>{document.documentElement.addEventListener("pointermove",d),document.documentElement.addEventListener("pointerup",u),document.documentElement.addEventListener("pointercancel",h)}),si(()=>{document.documentElement.removeEventListener("pointermove",d),document.documentElement.removeEventListener("pointerup",u),document.documentElement.removeEventListener("pointercancel",h)}),(r,d)=>(Nr(),Ir("div",{class:ve(["cube-img",{"resize-scroll":o.resize_scroll}]),style:me(r.cube.css),id:r.cube.id,"data-type":Zt(n).img,onContextmenu:d[1]||(d[1]=e=>Zt(ha)(e,r.cube)),onWheel:f},[Hr("div",ba,[Hr("div",{class:"dragger",onPointerdown:l},null,32)]),Hr("div",ya,[Hr("div",{class:"dragger",onPointerdown:c},null,32)]),Hr("img",{style:me(r.cube.css),src:t.isdev?e.cube.info:a?a(s,"image",e.cube.info):void 0,alt:"",onErrorOnce:p,onClick:d[0]||(d[0]=t=>function(t){const n=t.currentTarget;if(o.resize_scroll=!o.resize_scroll)o.resize_origin_width=ps(n,e.cube);else{if(o.resize_origin_width<0||o.resize_result<0)return;const{courier:t,history:n}=e.cube.root;e.cube.data.css.width=o.resize_origin_width+"px";const i=t.get_recorder();i.tell(e.cube,Lo.set_css(e.cube.id,{width:o.resize_result+"px"})),n.record(i)}}(t)),loading:Zt(i).mode===Zt(z).export?"eager":"lazy"},null,44,va),Yr(' <div class="tools-img">\r\n <div class="iconfont icon-floatleft" @click="() => float(\'L\')"></div>\r\n <div class="iconfont icon-floatright" @click="() => float(\'R\')"></div>\r\n <div class="iconfont icon-close" @click="clear"></div>\r\n </div> ')],46,ga))}}),xa=(0,Js.A)(wa,[["__scopeId","data-v-14032bda"]]);class ka extends cs{_component=xa;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return ka.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),i=this.clipboard.pasted_from;return i&&this.event.emit_asset_copy(i.noteid,"image",e.info),n}build_child(){}update_data(e,t){return ka.update_data(e,t)}float_image(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),r=Lo.set_css(this.id,n,!0);return i.tell(this,r),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=Lo.set_css(this.id,{float:null},!0);return t.tell(this,n),t}gc(){super.base_gc()}export(){return this.base_export()}replace_id(e,t={}){return ka.replace_id(this.root,e,t)}static get meta(){return{type:n.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t}static get_default(e="",t={},i={}){return{id:To.get_id(),type:n.img,info:e,css:t,attrs:i}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(1===e&&t.info.startsWith("image://")&&(t.info=t.info.slice(8)),{data:t,usable:!0})}}const Sa=["id","data-type"],Ca={class:"lost-info"},Ma=Bn({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Ir("div",{class:"cube-lost",id:e.cube.id,"data-type":Zt(n).lost,style:me(e.cube.css)},[t[2]||(t[2]=Hr("div",{class:"lost-title"},"异常方块",-1)),Hr("div",Ca,[t[0]||(t[0]=Hr("div",null,"方块类型:",-1)),Hr("div",null,Ce(e.cube.cube_name),1),t[1]||(t[1]=Hr("div",null,"异常原因:",-1)),Hr("div",null,Ce(e.cube.msg),1)])],12,Sa))}),za=(0,Js.A)(Ma,[["__scopeId","data-v-0b0feb78"]]);class Aa extends cs{_msg=Kt("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=za;get component(){return this._component}get meta(){return Aa.meta}get cube_name(){return this.data.type}get is_empty(){return!1}get children(){return[]}constructor(e,t,n){super(e,t),e&&this.setup(e,t),this.msg=n}build_child(){}update_data(e,t){return Aa.update_data(e,t)}gc(){}replace_id(e,t={}){return Aa.replace_id(this.root,e,t)}export(){const e=this.base_export();return e.attrs.postil&&(e.info.attrs.postil=e.attrs.postil),e}on_cursor_in_head(e){const{courier:t,next_cube:n}=this,i=new Ro(t);return n&&i.tell(n,Eo.in_head(n.id)),i}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,i=new Ro(t);return n&&i.tell(n,Eo.in_head(n.id)),i}static get_default(e){return{id:zo(),type:n.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:n.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}const Ta=["id","data-type"],Pa=Bn({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,i)=>(Nr(),Ir("span",{class:ve(["cube-text",{"text-mark":e.cube.has_postil}]),style:me(e.cube.css),onClick:t,id:e.cube.id,"data-type":Zt(n).text},Ce(e.cube.text),15,Ta))}}),Na=(0,Js.A)(Pa,[["__scopeId","data-v-494c8a06"]]),Oa=Bn({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Dr(pi(e.cube.component),{cube:Ut(e.cube)},null,8,["cube"]))}),Ra=["id","data-type"],La={class:"iconbox"},Ea=Bn({__name:"cube-annotation",props:{cube:{}},setup(e){const t=Dt({fold:!1});function i(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=e.cube.index,o=new Ro(t);o.tell(i,Lo.delete_child(i.id,"backward",[r,r+1])),n.record(o)}function r(){t.fold=!t.fold}return(e,o)=>(Nr(),Ir("div",{class:"cube-annotation",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).annotation},[Hr("div",La,[Hr("div",{class:ve(["iconfont","icon-fold",t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),Hr("div",{class:"iconfont icon-Delete",onClick:i,title:"删除批注块"})]),t.fold?Yr("v-if",!0):(Nr(),Ir("div",{key:0,class:ve(["annotation-contents",{"annotation-fold":t.fold}])},[(Nr(!0),Ir(Cr,null,_i(e.cube.children,e=>(Nr(),Dr(Oa,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,Ra))}}),Ia=(0,Js.A)(Ea,[["__scopeId","data-v-7829f62c"]]);function Da(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Ba extends cs{constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return Ia}get meta(){return Ba.meta}init(){}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return Ba.update_data(e,t)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return Ba.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let o=this.get_valid_index(n);const s=this.create_child_block(i);this.splice(o,0,...s),r.add_recover(Lo.delete_child(this.id,"backward",[o,o+s.length]));const a=this.children[o+1];return a?r.tell(a,Eo.in_head(a.id)):r.tell(this.child_last,Eo.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,o=t.get_recorder();o.add_cmd(e);const{dir:s,range:a}=e,[l,c]=a;let d=l<0?0:l,u=c>this.child_count?this.child_count:c;if(d>=u)return;if(d<=0&&u>=this.child_count)return this.is_empty?o.tell(r,Lo.delete_child(n,s,[i,i+1])):o.tell(this,Lo.reset(this.id,[])),o;const h=this.children[d-1],p=this.children[u],f=u-d;let m=this.splice(l,f);return o.add_recover(Lo.insert_child(this.id,m.data,l)),"backward"===s?h?o.tell(h,Eo.in_tail(h.id)):p&&o.tell(p,Eo.in_head(p.id)):"forward"===s&&(p?o.tell(p,Eo.in_head(p.id)):h&&o.tell(h,Eo.in_tail(h.id))),o}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new Ro(t),o=[];for(let e of this.children)o.push(e.export());const s=To.build_cubes(i,this);this.splice(0,this.child_count,...s);return r.add_recover(Lo.reset(this.id,o)),r}static get meta(){return{cubename:"批注",type:n.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const i={id:zo(),type:n.text,info:"​",attrs:{},css:{}},r={id:zo(),type:n.line,info:[i],attrs:{},css:{}},o={id:zo(),type:n.box,info:[r],attrs:{},css:{}};return{id:zo(),type:n.annotation,info:[o],css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;let o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Da([Go(i.cube_insert_child)],Ba.prototype,"on_insert_child",null),Da([Go(i.cube_delete_child)],Ba.prototype,"on_delete_child",null),Da([Go(i.cube_reset)],Ba.prototype,"on_reset",null);const ja=["id","data-type"],qa={class:"title"},Fa=Bn({__name:"cube-text-link",props:{cube:{}},setup(e){function t(){const t=document.createElement("a");t.href=e.cube.data.info.url,t.target="_blank",t.click()}function i(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:i,index:r}=e.cube,o=new Ro(t);o.tell(i,Lo.delete_child(i.id,"backward",[r,r+1])),n.record(o)}return(e,o)=>(Nr(),Ir("div",{class:"cube-link",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).link},[Hr("div",qa,Ce(e.cube.data.info.title),1),Hr("div",{class:"link",onClick:t},Ce(e.cube.data.info.url),1),Hr("div",{class:"iconbox"},[Hr("div",{class:"iconfont icon-rename",onClick:i}),Hr("div",{class:"iconfont icon-Delete",onClick:r})])],12,ja))}}),Ha=(0,Js.A)(Fa,[["__scopeId","data-v-2946c9fa"]]);class $a{static update(e,t,n){return{id:e,name:h.update,title:t,url:n}}}class Ga extends cs{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return Ha}get meta(){return Ga.meta}get url(){return this.data.info.url}get title(){return this.data.info.title}build_child(e){}gc(){}export(){return this.base_export()}replace_id(e,t={}){return Ga.replace_id(this.root,e,t)}update_data(e,t){return Ga.update_data(e,t)}on_update_info(e){const{courier:t,cursor:n}=this,{url:i,title:r}=e,o=t.get_recorder();o.add_cmd(e);const s=this.info.title,a=this.info.url;return this.info.url=i,this.info.title=r,o.add_recover($a.update(this.id,s,a)),o}static get meta(){return{cubename:"文本链接",type:n.link,block:!0,show:!1,version:1}}static get_default(e,t,i={},r={}){return{id:zo(),type:n.link,info:{url:e,title:t},css:i,attrs:r}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([Go(h.update)],Ga.prototype,"on_update_info",null);const Va=["id","data-type"],Ua=Bn({__name:"cube-postil",props:{cube:{}},setup(e){const t=wo(()=>e.cube.children.filter(e=>e instanceof Ga)),i=wo(()=>e.cube.children.filter(e=>!(e instanceof Ga))),r=wo(()=>({...e.cube.css}));function o(){e.cube.visible(!1)}function s(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=new Ro(t);r.tell(i,Lo.postil_remove(i.id,[0,e.cube.child_count])),n.record(r)}function a(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?Io.DomAnimation.scroll_element(t,20,"vertical"):Io.DomAnimation.scroll_element(t,-20,"vertical")}return(e,l)=>e.cube.show?(Nr(),Ir("div",{key:0,class:"cube-postil",style:me(r.value),id:e.cube.id,"data-type":Zt(n).postil},[Hr("div",{class:"iconbox"},[Hr("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:s}),Hr("div",{class:"iconfont icon-close close",title:"关闭",onClick:o})]),Hr("div",{class:"mark-contents",onWheel:a},[(Nr(!0),Ir(Cr,null,_i(t.value,e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128)),(Nr(!0),Ir(Cr,null,_i(i.value,e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,Va)):Yr("v-if",!0)}}),Wa=(0,Js.A)(Ua,[["__scopeId","data-v-576d43af"]]),Ya=["id","data-type"],Xa={class:"cube-box-root-content"},Ka=Bn({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:i}=e.cube,r=wo(()=>({opacity:(e.cube.child_count+10)/60})),o=e=>function(e,t){if(e.stopPropagation(),!zs)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(As=n,Cs=t,document.body.style.setProperty("--box-root-pointer-events","none"))}(e,t),s=e=>function(e,t){if(!zs||!Cs)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==Cs&&(n!==Ts&&Ts?.classList.remove("drag-enter"),Ts=n,Ms=t,Ts.classList.add("drag-enter"))}(e,t),a=e=>function(e,t){zs&&(e.preventDefault(),e.stopPropagation(),Cs&&Ms&&As&&Ts&&Cs!==Ms&&(As.style["view-transition-name"]=Cs.id,document.startViewTransition(()=>{if(!(Cs&&Ms&&As&&Ts))return;const{courier:e,history:n}=t,i=new Ro(e),r=As.getBoundingClientRect(),o=Ms.index,s=Cs.export(),a=Ms.pcube;Cs.pcube===a?i.tell(Cs.pcube,Lo.reorder(Cs.pid,Cs.id,Ms.index)):(i.merge(Cs.remove_self()),i.tell(a,Lo.insert_child(a.id,[s],o))),n.record(i);const l=Ts.getBoundingClientRect(),c=l.x-r.x,d=l.y-r.y;document.body.style.setProperty("--x",c+"px"),document.body.style.setProperty("--y",d+"px")}),zs=!1))}(e,t),l=e=>(Ts&&Ts.classList.remove("drag-enter"),As&&As.classList.remove("drag-enter"),void(zs=!1)),c=e=>function(e){e.preventDefault(),e.stopPropagation(),Ts&&Ts.classList.add("drag-enter")}(e),d=e=>function(e){e.stopPropagation(),Ts&&Ts.classList.remove("drag-enter")}(e),u=e=>function(e){const t=e.target;t instanceof HTMLElement&&"cube-box-root-dragger"===t.dataset.tag&&(zs=!0,e.stopPropagation())}(e),h=e=>function(e,t){const{stats:n}=t.root,i=t.index+1;n.active_root_index=i}(0,t);function p(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,i)=>(Nr(),Ir("div",{class:"cube-box-root",style:me(Zt(t).css),draggable:"true",id:e.cube.id,"data-type":Zt(n).box_root,onContextmenu:i[2]||(i[2]=t=>Zt(ha)(t,e.cube)),onFocusin:h,onDragstart:o,onDragenter:s,onDrop:a,onDragend:l,onDragover:c,onDragleave:d,onPointerdown:u},[Hr("div",{class:ve(["cube-dragger",p(e.cube)]),style:me(r.value),onClick:i[0]||(i[0]=t=>Zt(Ns)(t,e.cube)),onContextmenu:i[1]||(i[1]=t=>Zt(Os)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),Hr("div",Xa,[e.cube.attrs.fold?(Nr(),Dr(Oa,{key:0,cube:e.cube.child_first},null,8,["cube"])):(Nr(!0),Ir(Cr,{key:1},_i(Zt(t).children,e=>(Nr(),Dr(Oa,{key:e.id,cube:Ut(e)},null,8,["cube"]))),128))])],44,Ya))}}),Ja=(0,Js.A)(Ka,[["__scopeId","data-v-76631106"]]);function Qa(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Za extends cs{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Ja}get meta(){return Za.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof Pc&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Za.update_data(e,t)}replace_id(e,t={}){return Za.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,o=new Ro(t);if("left"===n){this.prev_cube_deep instanceof Za?o.tell(this,Lo.merge(this.id,"left",r,i)):o.tell(this,Eo.in_head(this.id))}else if("right"===n){this.next_cube_deep instanceof Za?o.merge(this.on(Lo.merge(this.id,"right",r,i))):o.tell(this,Eo.in_tail(this.id))}return o}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:o}=this,{method:s,cubeid:a,offset:l}=e,c=new Ro(t);if("left"===s&&n instanceof Za){const e=this.export().info;c.tell(n,Lo.insert_child(n.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if("right"===s&&i instanceof Za){const e=i.export().info;c.tell(this,Lo.insert_child(this.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if("both"===s)if(n instanceof Za&&i instanceof Za){const e=this.export().info,t=i.export().info;c.tell(n,Lo.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=Eo.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof Za&&!(i instanceof Za)){const e=this.export().info;c.tell(n,Lo.insert_child(n.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof Za)&&i instanceof Za){const e=i.export().info;c.tell(this,Lo.insert_child(this.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:o}=e,s=this.find_child_cube(r);if(!s||s.index===o)return;const a=new Ro(t);let l=0,c=s.index;return"tail"===o?l=this.child_count:"number"==typeof o&&(l=o),this.splice(c,1),this.splice(l,0,s),a.add_recover(Lo.reorder(this.id,s.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=To.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof ol&&e.is_empty)return;const t=this.export().info,n=new Pc(Pc.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(Lo.reset(this.id,t)),i.tell(n,Eo.in_tail(n.id))}else{const e=this.export().info,t=To.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Lo.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;let o=this.get_valid_index(n);const s=To.pick(i,!0),a=To.build_cubes(s.sort,this);this.splice(o,0,...a),r.add_recover(Lo.delete_child(this.id,"backward",[o,o+a.length]));const l=a[a.length-1],c=this.children[o+1];return l?r.tell(l,Eo.in_tail(l.id)):r.tell(c,Eo.in_head(c.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=s;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(!(u>=h)){if(u<=0&&h>=this.child_count&&!a){if(a){if(this.is_empty)return;l.tell(this,Lo.delete_child(this.id,o,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Lo.delete_child(e.id,o,[0,e.child_count],a))}else this.is_empty?l.tell(r,Lo.delete_child(n,o,[i,i+1])):l.tell(this,Lo.reset(this.id,[]));return l}{const e=this.children[u-1],t=this.children[h],n=h-u;let i=this.splice(c,n);l.add_recover(Lo.insert_child(this.id,i.data,c)),"backward"===o?e?l.tell(e,Eo.in_tail(e.id)):t&&l.tell(t,Eo.in_head(t.id)):"forward"===o&&(t?l.tell(t,Eo.in_head(t.id)):e&&l.tell(e,Eo.in_tail(e.id)))}return l}}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!ol.is_empty_text(e))}static get meta(){return{type:n.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[Pc.get_default()]:e;return{id:To.get_id(),type:n.box_root,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Qa([Go(i.cube_delete_adjacent)],Za.prototype,"on_cube_delete_adjacent",null),Qa([Go(i.cube_merge)],Za.prototype,"on_merge",null),Qa([Go(i.cube_reorder)],Za.prototype,"on_cube_reorder",null),Qa([Go(i.cube_reset)],Za.prototype,"on_cube_reset",null),Qa([Go(i.cube_insert_child)],Za.prototype,"on_insert_child",null),Qa([Go(i.cube_delete_child)],Za.prototype,"on_delete_child",null);class el{}function tl(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class nl extends cs{_handler_update_pos;_handler_corrent;_timer_corrent;_show=Kt(!1);constructor(e,t){super(e,t);const n=this.setup(e,t);return t.has_postil=!0,n}get default_size(){return{x:0,y:0,width:180,height:130}}get show(){return this._show.value}set show(e){this._show.value=e,e&&this.root.listener.check_float()}get has_annotation(){for(let e of this.children)if(e instanceof Ba)return!0;return!1}get meta(){return nl.meta}get component(){return Wa}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return nl.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}gc(){super.base_gc(),this.root.cubes.remove_cube(this),this._handler_update_pos&&(this.root.event.off(this._handler_update_pos),this._handler_update_pos=null)}replace_id(e,t={}){return nl.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let o=this.get_valid_index(n);const s=this.create_child_block(i);this.splice(o,0,...s),r.add_recover(Lo.delete_child(this.id,"backward",[o,o+s.length]));const a=this.children[o+1];return a?r.tell(a,Eo.in_head(a.id)):r.tell(this.child_last,Eo.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,o=t.get_recorder();o.add_cmd(e);const{dir:s,range:a}=e,[l,c]=a;let d=l<0?0:l,u=c>this.child_count?this.child_count:c;if(d>=u)return;if(d<=0&&u>=this.child_count)return o.tell(this,Lo.reset(this.id,[])),o;const h=this.children[d-1],p=this.children[u],f=u-d;let m=this.splice(l,f);return o.add_recover(Lo.insert_child(this.id,m.data,l)),"backward"===s?h?o.tell(h,Eo.in_tail(h.id)):p&&o.tell(p,Eo.in_head(p.id)):"forward"===s&&(p?o.tell(p,Eo.in_head(p.id)):h&&o.tell(h,Eo.in_tail(h.id))),o}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new Ro(t),o=[];for(let e of this.children)o.push(e.export());const s=To.build_cubes(i,this);this.splice(0,this.child_count,...s);return r.add_recover(Lo.reset(this.id,o)),r}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,yn(()=>{const n=e.get_recorder();n.tell(t,Eo.in_tail(t.id)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){yn(()=>{const e=this.pcube.clientRect,t=this.clientRect||this.default_size;if(!e)return void(this.show=!1);const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=Io.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${i.x}px`,this.data.css.top=`${i.y}px`})}static get_default(e=[],t={}){return{id:zo(),type:n.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:n.postil,show:!1,version:2,block:!0}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){if(e>this.meta.version)return{data:t,usable:!1};const n=structuredClone(t);return e<2?(n.info=[Za.get_default(n.info)],{data:n,usable:!0}):{data:t,usable:!0}}}tl([Go(i.cube_insert_child)],nl.prototype,"on_insert_child",null),tl([Go(i.cube_delete_child)],nl.prototype,"on_delete_child",null),tl([Go(i.cube_reset)],nl.prototype,"on_reset",null);class il{static reset(e,t){return{id:e,name:c.text_reset,info:t}}static break(e,t){return{id:e,name:c.text_break,offset:t}}}function rl(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class ol extends cs{_component=Na;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return ol.meta}get is_empty(){return ol.is_empty_text(this.data)}get len(){return this.text.length}get text(){return this.data.info}get text_node(){const e=this.dom?.firstChild;if(e instanceof Text)return e}get children(){return[]}get line(){let e=this.pcube;for(;e;){if(e instanceof Pc)return e;e=e.pcube}}constructor(e,t){super(e,t);const n=this.setup(e,t);this.data.info=this.data.info.replace("\r","");return this.data.info||(this.data.info="​"),this.init(),n}init(){this.root.stats.update_count_word(this.len)}build_child(e){const t=e.attrs?.postil;t&&(this.postil=new nl(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return ol.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e,t){return ol.update_data(e,t)}merge_text(e){const{courier:t}=this,n=t.get_recorder(),i=this.prev_cube,r=this.next_cube,o=i instanceof ol,s=r instanceof ol;if(o&&s){const t=Lo.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(o){const t=Lo.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(s){const t=Lo.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_cursor_loc(e){const{from:t,from_offset:n,offset:i}=e,{courier:r}=this,o=r.get_recorder();return o.add_cmd(e),this.set_cursor_in_head(i),o.add_recover(Eo.loc(t,n,this.id,i)),o}on_partition(e){const{courier:t,cursor:n,pcube:i}=this,{start_id:r,end_id:o,offset_end:s,offset_start:a}=e,l=this.get_valid_index(a),c=this.get_valid_index(s),d=new Ro(t),u=this.text.slice(0,l),h=this.text.slice(l,c),p=this.text.slice(c);if(h){const e=ol.get_default(h,structuredClone(Vt(this.css)));if(u){if(u){const t=il.reset(this.id,u),n=Eo.loc(this.id,u.length,this.id,u.length);if(d.tell(this,t,n),p){const e=ol.get_default(p,structuredClone(Vt(this.css)));d.tell(i,Lo.insert_child(i.id,[e],this.index+1))}d.tell(i,Lo.insert_child(i.id,[e],this.index+1))}}else{const e=il.reset(this.id,h),t=Eo.loc(this.id,h.length,this.id,h.length);if(d.tell(this,e,t),p){const e=ol.get_default(p,structuredClone(Vt(this.css)));d.tell(i,Lo.insert_child(i.id,[e],this.index+1))}}return d}if(0===l){const e=ol.get_default();d.tell(i,Lo.insert_child(i.id,[e],this.index))}else if(l===this.len){const e=ol.get_default();d.tell(i,Lo.insert_child(i.id,[e],this.index+1))}else if(l>0&&l<this.len){const e=ol.get_default(p,structuredClone(Vt(this.css))),t=Lo.insert_child(i.id,[e],this.index+1),n=il.reset(this.id,u),r=Eo.loc(this.id,u.length,this.id,u.length);return d.tell(i,t),d.tell(this,n,r),d}return d}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r,pid:o,index:s}=this,{method:a,offset:l,cubeid:c}=e;let d=this.get_valid_index(l);const u=new Ro(t);if("left"===a&&n instanceof ol&&this.can_merge_with(n)){const e=n.id,t=Lo.delete_child(o,"forward",[s-1,s]),r=il.reset(this.id,n.text+this.text),a=Eo.loc(this.id,d+n.len,this.id,d);u.tell(i,t),u.tell(this,r,a),this.event.emit_text_merge(e,this.id)}else if("right"===a&&r instanceof ol&&this.can_merge_with(r)){const e=r.id,t=Lo.delete_child(o,"backward",[s+1,s+2]),n=il.reset(this.id,this.text+r.text),a=Eo.loc(this.id,d,this.id,d);u.tell(i,t),u.tell(this,n,a),this.event.emit_text_merge(e,this.id)}else if("both"===a)if(n instanceof ol&&r instanceof ol&&this.can_merge_with(n)&&this.can_merge_with(r)){const e=n.len+d,t=n.id,o=r.id;u.tell(i,Lo.delete_child(this.pid,"backward",[this.index-1,this.index])),u.tell(i,Lo.delete_child(this.pid,"backward",[this.index+1,this.index+2])),u.tell(this,il.reset(this.id,n.text+this.text+r.text)),u.tell(this,Eo.loc(this.id,e,this.id,d)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(o,this.id)}else if(n instanceof ol&&this.can_merge_with(n)){const e=n.id;u.tell(i,Lo.delete_child(o,"forward",[s-1,s])),u.tell(this,il.reset(this.id,n.text+this.text)),u.tell(this,Eo.loc(this.id,d+n.len,this.id,d)),this.event.emit_text_merge(e,this.id)}else if(r instanceof ol&&this.can_merge_with(r)){const e=r.id;u.tell(i,Lo.delete_child(o,"backward",[s+1,s+2])),u.tell(this,il.reset(this.id,this.text+r.text)),u.tell(this,Eo.loc(this.id,d,this.id,d)),this.event.emit_text_merge(e,this.id)}return u}on_cube_insert(e){const{data:t,start_id:n,end_id:i,offset_end:r,offset_start:o}=e,{courier:s,pid:a,pcube:l}=this,c=new Ro(s);this.cursor.has_selection;let d=o,u=r;if(d<0&&(d=0),u>this.text.length&&(u=this.text.length),r!==o){const e=Lo.delete(this.id,"backward",this.id,this.id,o,r,!0);c.tell(this,e)}const h=To.pick(t),p=this.text.slice(0,d),f=this.text.slice(u);if(h.head.length>0)if(p)if(p&&f){const e=il.reset(this.id,p),t=Eo.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=ol.get_default(f,structuredClone(Vt(this.css)),structuredClone(Vt(this.attrs)));c.tell(l,Lo.insert_child(a,[n],this.index+1)),c.tell(l,Lo.insert_child(a,h.head,this.index+1))}else f||c.tell(l,Lo.insert_child(a,h.head,this.index+1));else c.tell(l,Lo.insert_child(a,h.head,this.index));const m=[...h.body];if(h.tail.length>0&&m.push(Pc.get_default(h.tail)),h.root.length>0)for(let e of h.root)m.push(...e.info);if(m.length>0){if(0===h.head.length&&r>0&&r<this.len){const e=il.reset(this.id,p),t=Eo.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=ol.get_default(f,structuredClone(Vt(this.css)),structuredClone(Vt(this.attrs)));c.tell(l,Lo.insert_child(a,[n],this.index+1))}c.tell(l,Lo.insert_child(this.pid,m,this.index+h.head.length+1))}return c}on_cube_delete(e){const{courier:t,index:n,pcube:i,pid:r}=this,{dir:o,start_id:s,end_id:a,offset_start:l,offset_end:c,reserve:d}=e,u=new Ro(t),h=this.get_valid_index(l),p=this.get_valid_index(c),f=h!==p||"head"===l||"tail"===c;if(0===h&&p===this.len){if(d){const e=il.reset(this.id,"​"),t=Eo.loc(this.id,1,this.id,this.len);u.tell(this,e,t)}else u.tell(i,Lo.delete_child(r,"backward",[n,n+1]));return u}const m=this.text.slice(0,h),_=this.text.slice(p);if(f){const e=il.reset(this.id,m+_),t=Eo.loc(this.id,h,this.id,p);u.tell(this,e,t)}else{const e=h;if("backward"===o)if(0===e||0===ol.drop_zero_width_space(this.text,h).pos)if(this.pcube.is_empty&&this.pcube instanceof cs)u.merge(this.pcube.remove_self());else{const e=this.prev_cube_deep,t=e?.pcube;e&&!e.meta.block?u.tell(e,Lo.delete_adjacent(e.id,"right",this.id,0)):t&&u.merge(t.delete_edge(this,o))}else if(this.is_empty)u.tell(i,Lo.delete_child(r,"backward",[n,n+1]));else{const e=this.find_text_deleted(h,"left"),t=il.reset(this.id,e.text),n=Eo.loc(this.id,e.pos,this.id,m.length);u.tell(this,t,n),e.text&&u.tell(this,Lo.merge(this.id,"both",this.id,m.length-1))}else if("forward"===o)if(e===this.len||e===ol.drop_zero_width_space(this.text,h).len)if(this.pcube.is_empty&&this.pcube instanceof cs)u.merge(this.pcube.remove_self());else{const e=this.next_cube_deep,t=e?.pcube;e&&!e.meta.block?u.tell(e,Lo.delete_adjacent(e.id,"left",this.id,this.len)):t&&u.merge(t.delete_edge(this,o))}else if(this.is_empty)u.tell(i,Lo.delete_child(r,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right"),n=il.reset(this.id,t.text),i=Eo.loc(this.id,m.length,this.id,m.length),r=Lo.merge(this.id,"both",this.id,m.length);u.tell(this,n,i),u.tell(this,r)}}return u}on_text_reset(e){const{courier:t,pid:n,index:i,pcube:r,len:o}=this,{info:s}=e,a=t.get_recorder();a.add_cmd(e);let l=this.text;!s&&this.is_empty;const c=ol.drop_zero_intelligence(s,0);return this.data.info=c.text,this.root.stats.update_count_word(c.len-o),a.add_recover(il.reset(this.id,l)),a}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:i}=this,{css:r,start_id:o,end_id:s,offset_start:a,offset_end:l,toggle:c,replace:d}=e;if(0===Object.keys(r).length&&!d)return;const u=new Ro(t),h=this.get_valid_index(a),p=this.get_valid_index(l),f=ol.drop_zero_width_space(this.text.slice(0,h),0).text,m=ol.drop_zero_width_space(this.text.slice(h,p),0).text,_=ol.drop_zero_width_space(this.text.slice(p),0).text;if(0===h&&p===this.len||h===p&&o===s)u.tell(this,Lo.set_css(this.id,r,c,d)),u.tell(this,Lo.merge(this.id,"both",this.id,p));else if(0===h&&m){const e=structuredClone(Vt(this.css)),t=il.reset(this.id,m),o=Eo.loc(this.id,p,this.id,p);if(u.tell(this,t,o),u.tell(this,Lo.set_css(this.id,r,c,d)),_){const t=ol.get_default(_,e);u.tell(i,Lo.insert_child(n,[t],this.index+1));const r=i.find_cube(t.id);r&&u.tell(r,Lo.merge(t.id,"both",t.id,0))}u.tell(this,Eo.in_tail(this.id)),u.tell(this,Lo.merge(this.id,"left",this.id,this.len))}else if(h>0){if(f){const e=il.reset(this.id,f),t=Eo.loc(this.id,h,this.id,h),n=Lo.merge(this.id,"left",this.id,p);u.tell(this,e,t,n)}if(_){const e=ol.get_default(_,structuredClone(Vt(this.css))),t=[e];u.tell(i,Lo.insert_child(n,t,this.index+1));const r=i.find_cube(e.id);r&&u.tell(r,Lo.merge(r.id,"right",r.id,0))}if(m){const e=ol.get_default(m,structuredClone(Vt(this.css)));u.tell(i,Lo.insert_child(n,[e],this.index+1));const t=i.find_cube(e.id);t&&(u.tell(t,Lo.set_css(e.id,r,c,d)),u.tell(t,Lo.merge(e.id,"both",e.id,f.length+h)))}}return u}on_cube_break(e){const{courier:t,cursor:n,pcube:i,pid:r,index:o}=this,s=i.pcube;if(!s)return;const{offset:a}=e;let l=o+1;const c=new Ro(t),d=this.text[a-1],u=this.text[a];let h=a,p=!1;if(d){const e=d.charCodeAt(0);55296<=e&&e<=56319&&(p=!0)}if(u&&!p){const e=u.charCodeAt(0);56320<=e&&e<=57343&&(p=!0)}p&&(h+=1),c.tell(this,Lo.partition(this.id,this.id,this.id,h,h));const f=[];for(let e of i.children.slice(l))f.push(e.export());c.tell(i,Lo.delete_child(i.id,"backward",[l,i.child_count]));const m=Pc.get_default(f),_=this.line;_&&_.inherit_line([m]),c.tell(s,Lo.insert_child(s.id,[m],i.index+1));const g=i.next_cube;return g?.id===m.id&&c.tell(g,Eo.in_head(g.id)),c}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:i,from_id:r,offset:o}=e,s=new Ro(t);if("left"===i)if(this.is_empty)s.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?s.tell(this,Eo.in_head(this.id)):s.tell(this,Lo.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)s.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?s.tell(this,Eo.in_tail(this.id)):s.tell(this,Lo.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return s}add_link(e,t){const{cursor:n,courier:i}=this,r=i.get_recorder(),o=Ga.get_default(t,e);return r.tell(this,Lo.postil_add(this.id,[o])),r}add_annotation(e){const t=this.courier.get_recorder(),n=e||Ba.get_default();return t.tell(this,Lo.postil_add(this.id,[n])),t}get_valid_index(e){return"head"===e?0:"tail"===e?this.text.length:e<0?0:e>this.text.length?this.text.length:e}set_cursor_in_head(e=0){const t=this.get_valid_index(e);yn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}set_cursor_in_tail(e=0){let t=this.len-this.get_valid_index(e);yn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}find_text_nav_pos(e,t){const n=this.text;let i=e;if(e<0&&(i=0),e>n.length&&(i=n.length),"left"===t){let e=i-1,t=n[e];for(;"​"===t&&e>=0;)e-=1,t=n[e];if(t){const n=t.charCodeAt(0);56320<=n&&n<=57343&&(e-=1)}return e<0?0:e}{let e=i+1,t=n[e];for(;"​"===t&&e<n.length;)e+=1,t=n[e];if(t){const n=t.charCodeAt(0);55296<=n&&n<=56319&&(e+=1)}return e>n.length?n.length:e}}find_text_deleted(e,t){if(e<0)return{text:this.text,pos:0};if(e>this.len)return{text:this.text,pos:this.len};if("left"===t){let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,n),r=this.text.slice(e),o=i[i.length-1];if(o){const t=o.charCodeAt(0);55296<=t&&t<=56319&&(i=i.slice(0,-1),e-=1)}return{text:i+r,pos:n}}{let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,e),r=this.text.slice(n),o=r[0];if(o){const e=o.charCodeAt(0);56320<=e&&e<=57343&&(r=r.slice(1))}return{text:i+r,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,i]=t;if(n===i){if("backward"===e){return 0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(i-1,"right")!==this.len}return this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left")}{if(0===n&&i===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(i-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return ol.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=To.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=To.is_same_attrs(this.attrs,e.attrs),i=!this.postil&&!e.postil;return t&&n&&i}static drop_zero_width_space(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),o=e.slice(i);if(r){for(let e of r)"​"!==e&&(n+=e);i=n.length}if(o)for(let e of o)"​"!==e&&(n+=e);return{text:n,pos:i,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),o=e.slice(i);if(r){for(let e=0;e<r.length;e++){let t=r[e],i=r[e-1];"​"===t&&"\n"!==i||(n+=t)}i=n.length}if(o)for(let e=0;e<o.length;e++){let t=o[e],i=o[e-1];"​"===t&&"\n"!==i||(n+=t)}return n||(n="​",i=1),{text:n,pos:i,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==n.text)return!1;let t="";for(let n of e.info)if("​"!==n&&(t+=n),t.length>0)return!1;return 0===t.length}static get meta(){return{version:1,type:n.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},i={}){const r=e||"​";return{id:zo(),type:n.text,info:r,css:structuredClone(Vt(t)),attrs:structuredClone(Vt(i))}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,e.event.emit_replace_id(i,r),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}rl([Go(s.loc)],ol.prototype,"on_cursor_loc",null),rl([Go(i.cube_partition)],ol.prototype,"on_partition",null),rl([Go(i.cube_merge)],ol.prototype,"on_cube_merge",null),rl([Go(i.cube_insert)],ol.prototype,"on_cube_insert",null),rl([Go(i.cube_delete)],ol.prototype,"on_cube_delete",null),rl([Go(c.text_reset)],ol.prototype,"on_text_reset",null),rl([Go(i.cube_set_selection_css)],ol.prototype,"on_cube_set_selection_css",null),rl([Go(c.text_break)],ol.prototype,"on_cube_break",null),rl([Go(i.cube_delete_adjacent)],ol.prototype,"on_cube_delete_adjacent",null);const sl=["id","data-type","contenteditable"],al=Bn({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Ir("div",{class:ve(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":Zt(n).line,style:me(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[(Nr(!0),Ir(Cr,null,_i(e.cube.children,e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],14,sl))}),ll=(0,Js.A)(al,[["__scopeId","data-v-f72cf81e"]]);let cl;const dl="undefined"!=typeof window&&window.trustedTypes;if(dl)try{cl=dl.createPolicy("vue",{createHTML:e=>e})}catch(e){}const ul=cl?e=>cl.createHTML(e):e=>e,hl="undefined"!=typeof document?document:null,pl=hl&&hl.createElement("template"),fl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?hl.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?hl.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?hl.createElement(e,{is:n}):hl.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>hl.createTextNode(e),createComment:e=>hl.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>hl.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,o){const s=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==o&&(r=r.nextSibling););else{pl.innerHTML=ul("svg"===i?`<svg>${e}</svg>`:"mathml"===i?`<math>${e}</math>`:e);const r=pl.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ml=Symbol("_vtc");Boolean;const _l=Symbol("_vod"),gl=Symbol("_vsh");const bl=Symbol("");const yl=/(?:^|;)\s*display\s*:/;const vl=/\s*!important$/;function wl(e,t,n){if($(n))n.forEach(n=>wl(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=kl[t];if(n)return n;let i=re(t);if("filter"!==i&&i in e)return kl[t]=i;i=ae(i);for(let n=0;n<xl.length;n++){const r=xl[n]+i;if(r in e)return kl[t]=r}return t}(e,t);vl.test(n)?e.setProperty(se(i),n.replace(vl,""),"important"):e[i]=n}}const xl=["Webkit","Moz","ms"],kl={};const Sl="http://www.w3.org/1999/xlink";function Cl(e,t,n,i,r,o=xe(t)){i&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(Sl,t.slice(6,t.length)):e.setAttributeNS(Sl,t,n):null==n||o&&!ke(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Y(n)?String(n):n)}function Ml(e,t,n,i,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?ul(n):n));const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const i="OPTION"===o?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let s=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=ke(n):null==n&&"string"===i?(n="",s=!0):"number"===i&&(n=0,s=!0)}try{e[t]=n}catch(e){0}s&&e.removeAttribute(r||t)}function zl(e,t,n,i){e.addEventListener(t,n,i)}const Al=Symbol("_vei");function Tl(e,t,n,i,r=null){const o=e[Al]||(e[Al]={}),s=o[t];if(i&&s)s.value=i;else{const[n,a]=function(e){let t;if(Pl.test(e)){let n;for(t={};n=e.match(Pl);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):se(e.slice(2));return[n,t]}(t);if(i){const s=o[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();dn(function(e,t){if($(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Rl(),n}(i,r);zl(e,n,s,a)}else s&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,s,a),o[t]=void 0)}}const Pl=/(?:Once|Passive|Capture)$/;let Nl=0;const Ol=Promise.resolve(),Rl=()=>Nl||(Ol.then(()=>Nl=0),Nl=Date.now());const Ll=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement;Symbol("_moveCb"),Symbol("_enterCb");const El=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?e=>de(t,e):t};function Il(e){e.target.composing=!0}function Dl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Bl=Symbol("_assign"),jl={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[Bl]=El(r);const o=i||r.props&&"number"===r.props.type;zl(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),o&&(i=he(i)),e[Bl](i)}),n&&zl(e,"change",()=>{e.value=e.value.trim()}),t||(zl(e,"compositionstart",Il),zl(e,"compositionend",Dl),zl(e,"change",Dl))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:o}},s){if(e[Bl]=El(s),e.composing)return;const a=null==t?"":t;if((!o&&"number"!==e.type||/^0\d/.test(e.value)?e.value:he(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}};const ql=j({patchProp:(e,t,n,i,r,o)=>{const s="svg"===r;"class"===t?function(e,t,n){const i=e[ml];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,s):"style"===t?function(e,t,n){const i=e.style,r=W(n);let o=!1;if(n&&!r){if(t)if(W(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&wl(i,t,"")}else for(const e in t)null==n[e]&&wl(i,e,"");for(const e in n)"display"===e&&(o=!0),wl(i,e,n[e])}else if(r){if(t!==n){const e=i[bl];e&&(n+=";"+e),i.cssText=n,o=yl.test(n)}}else t&&e.removeAttribute("style");_l in e&&(e[_l]=o?i.display:"",e[gl]&&(i.display="none"))}(e,n,i):D(t)?B(t)||Tl(e,t,0,i,o):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&Ll(t)&&U(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(Ll(t)&&W(n))return!1;return t in e}(e,t,i,s))?(Ml(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Cl(e,t,i,s,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&W(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),Cl(e,t,i,s)):Ml(e,re(t),i,0,t)}},fl);let Fl;function Hl(){return Fl||(Fl=er(ql))}const $l=(...e)=>{const t=Hl().createApp(...e);const{mount:n}=t;return t.mount=e=>{const i=Vl(e);if(!i)return;const r=t._component;U(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const o=n(i,!1,Gl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function Gl(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function Vl(e){if(W(e)){return document.querySelector(e)}return e}function Ul(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:i}=t,{deltaY:r,currentTarget:o}=e,s=t.config.data.revert_scope;r>0&&!s?t.expand("down"):t.expand("up")}const Wl={class:"iconbox"},Yl=Bn({__name:"note-scope",props:{selection:{}},setup(e){const t=wo(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);if(0===t)return;return{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px"}}),n=wo(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);if(0===t)return;return{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px",display:e.selection.pos.width<30?"none":"unset"}});function i(){e.selection.freeze=!e.selection.freeze}function r(t,n,i){t.stopPropagation();const{root:r}=e.selection,o=new Ro(r.courier),s=n.get_scope_info(),a=s.cube.children[s.range[0]],l=s.cube.children[s.range[1]-1];if("A"===i&&l)if(l instanceof Za){const e=Za.get_default();o.tell(s.cube,Lo.insert_child(s.cube.id,[e],l.index+1))}else{const e=Pc.get_default(),t=Lo.insert_child(s.cube.id,[e],l.index+1);o.tell(s.cube,t)}else if("B"===i&&a)if(a instanceof Za){const e=Za.get_default();o.tell(s.cube,Lo.insert_child(s.cube.id,[e],a.index))}else{const e=Pc.get_default(),t=Lo.insert_child(s.cube.id,[e],a.index);o.tell(s.cube,t)}r.history.record(o)}function o(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,s)=>(Nr(),Ir("div",{class:ve(["note-scope",{freeze:e.selection.freeze}]),style:me(e.selection.css),onWheel:s[3]||(s[3]=t=>Zt(Ul)(t,e.selection)),onClick:i,onContextmenu:o},[Hr("div",Wl,[Hr("div",{class:"iconfont icon-a-copy",style:me(n.value),title:"在上方插入行",onClick:s[0]||(s[0]=t=>r(t,e.selection,"A"))},null,4),Hr("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:me(t.value),onClick:s[1]||(s[1]=()=>e.selection.remove())},null,4),Hr("div",{class:"iconfont icon-B-copy",style:me(n.value),title:"在上方插入行",onClick:s[2]||(s[2]=t=>r(t,e.selection,"B"))},null,4)])],38))}}),Xl=(0,Js.A)(Yl,[["__scopeId","data-v-acbac1ca"]]);class Kl extends Co{has_down=!1;down_caret=void 0;constructor(e){super(e)}get root(){return this._root}pointerdown(e){if(this.root.stats.is_read_mode)return e.preventDefault();e.preventDefault(),this.has_down=!0,this.down_caret=document.caretPositionFromPoint(e.clientX,e.clientY),this.click_selection_text(e),this.cursor.locate_cursor_by_coor(e.clientX,e.clientY)}pointermove(e){this.stats.view_point={x:e.clientX,y:e.clientY},this.drag_selection_text(e)}pointercancel(e){this.has_down=!1,this.down_caret=null}pointerup(e){e.preventDefault(),this.has_down=!1,this.down_caret=null}beforeinput(e){if(this.stats.in_composition_mode)return;if(this.event.emit_note_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:i}=this,r=e.data,{cube_end:o,cube_start:s,cube_selection:a,offset_start:l,offset_end:c}=n;if(!a||!o||!s)return;const d=s.id,u=o.id,h=a.id;if("insertText"===e.inputType){if(!(a instanceof ol&&r)){const e=t.get_recorder(),n=ol.get_default(r||"​"),o=Lo.insert(h,[n],d,u,l,c);return e.tell(a,o),i.record(e)}{const e=t.get_recorder();this.ins(e,this.root,r,a,l,c),i.record(e)}}else if("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType){const n=t.get_recorder();if(!this.root.scope_count_normal){let t="deleteContentBackward"===e.inputType?"backward":"forward";const r=Lo.delete(h,t,d,u,l,c);return n.tell(a,r),i.record(n)}{const e=this.clipboard.delete_scope();e&&this.history.record(e)}}}compositionstart(e){this.stats.in_composition_mode=!0,this.clear_selection_text()}compositionupdate(e){this.event.emit_note_compositionupdate(e).some(e=>"stop"===e)}compositionend(e){if(this.event.emit_note_compositionend_before(e).some(e=>"stop"===e))return;const{courier:t,cursor:n,history:i,stats:r,event:o}=this.root;if(n.has_selection)return;if(!r.in_composition_mode)return;const{cube_end:s,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,u=e.data,h=new Ro(t);if(l&&s&&a){if(l instanceof ol){const e=l.text,t=d-u.length,n=`${e.slice(0,t)}${u}${e.slice(t)}`,i=il.reset(l.id,n),r=Eo.loc(l.id,d,l.id,t);h.tell(l,i,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");r.in_composition_mode=!1,i.record(h),o.emit_note_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:i,cube_start:r,cube_selection:o,offset_start:s,offset_end:a}=e;if(!o||!i||!r)return;const l=new Ro(t);l.tell(o,Lo.delete(o.id,"backward",r.id,i.id,s,a)),n.record(l)}ins(e,t,n,i,r,o){const{courier:s,history:a}=t,l=i.text,c=l.slice(0,r)+n+l.slice(o),d=r+n.length,u=il.reset(i.id,c),h=Eo.loc(i.id,d,i.id,r);e.tell(i,u,h);const p=Lo.merge(i.id,"both",i.id,d);return e.tell(i,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:i,offsetNode:r}=this.down_caret;n instanceof Text&&r instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,r,i)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!To.check_mouse_key(e,"left"))return;const t=document.caretPositionFromPoint(e.clientX,e.clientY);t&&this.down_caret.offsetNode instanceof Text&&t.offsetNode instanceof Text&&this.cursor.set_selection_between(this.down_caret.offsetNode,this.down_caret.offset,t.offsetNode,t.offset)}}class Jl extends Kl{dragenter(e){e.preventDefault()}dragover(e){e.preventDefault()}dragleave(e){e.preventDefault()}drop(e){e.preventDefault();const{cursor:t}=this.root,{cube_end:n,offset_end:i}=t,r=e.dataTransfer;if(!r)return;const o=new DOMParser,s=r.getData("text/plain"),a=r.getData("text/html"),l=r.files;if(console.log("🍊",{files:l,html:a,text:s}),console.log("❤",(new DOMParser).parseFromString(a,"text/html")),s){const e=this.courier.get_recorder();console.log("💠text",s);const{offset_end:t,offset_start:n,cube_selection:i}=this.cursor;if(!(i instanceof ol))return;this.ins(e,this._root,s,i,n,t),this.history.record(e)}if(a){const e=o.parseFromString(a,"text/html");console.log("💠html",e)}}handler_click_foot(e){e.preventDefault();const{courier:t,cursor:n,history:i}=this.root,r=this.root.child_last;if(r&&r.is_empty){let e=r;for(;e;){if(e instanceof ol){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new Ro(t),n=Za.get_default();e.tell(this.root,Lo.insert_child(this.root.id,[n],this.root.child_count)),i.record(e)}}}class Ql extends Kl{}const Zl={class:"dialog-form"},ec={class:"form-grid"},tc={class:"label"},nc=["onUpdate:modelValue"],ic=Bn({__name:"menu-dialog",setup(e){const t=Kt();function n(){const e=t.value;e&&(_s.open=!1,e.close())}function i(){n(),_s.submit(_s.data)}return cr(()=>_s.open,()=>{const e=t.value;e&&(_s.open?e.showModal():e.close())}),(e,r)=>(Nr(),Ir("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[Hr("div",Zl,[Hr("div",{class:"close-corner",onClick:n}),Hr("div",ec,[(Nr(!0),Ir(Cr,null,_i(Object.keys(Zt(_s).data),e=>(Nr(),Ir(Cr,{key:e},[Hr("div",tc,Ce(e),1),Nn(Hr("input",{type:"text",autofocus:"","onUpdate:modelValue":t=>Zt(_s).data[e]=t},null,8,nc),[[jl,Zt(_s).data[e]]])],64))),128))]),Hr("div",{class:"dialog-submit",onClick:i},"确认")])],544))}}),rc=(0,Js.A)(ic,[["__scopeId","data-v-13d4fd0e"]]),oc={class:"title iconfont icon-sp"},sc={key:0,class:"iconfont icon-arrow-right"},ac=["onPointerdown","onMouseenter"],lc={class:"item-shortcut"},cc={key:0,class:"iconfont icon-arrow-right"},dc=["onMouseenter"],uc={class:"title iconfont icon-sp"},hc={key:0,class:"iconfont icon-arrow-right"},pc=["onPointerdown","onMouseenter"],fc={class:"item-shortcut"},mc={key:0,class:"iconfont icon-arrow-right"},_c=Bn({__name:"note-menu",props:{root:{}},setup(e){const t=Kt(),n=Kt([]);cr(()=>ms.point,async()=>{const e=t.value;if(!e)return;await yn(),ms.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=e.getBoundingClientRect(),r={x:ms.point.x,y:ms.point.y,width:0,height:0},o=Io.MathRect.move_rect_to_other(n,i,r);ms.css={left:o.x+"px",top:o.y+"px"}}),cr(ms.stack_menus,async()=>{await yn();const e=n.value;if(!e)return;ms.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<ms.stack_menus.length;n++){const i=ms.stack_rect[n],r=fa(t,e[n].getBoundingClientRect(),i);ms.stack_pos.push({left:r.x+"px",top:r.y+"px"})}});const i=wo(()=>ms.menu);function r(){ms.stack_menus.length=Math.max(0,ms.stack_menus.length-1),ms.stack_rect.length=Math.max(0,ms.stack_rect.length-1)}function o(e,t=!1){t?(ms.stack_menus.length=e,ms.stack_rect.length=e,ms.menu=void 0):(ms.stack_menus.length=e,ms.stack_rect.length=e)}function s(e,t){if(!t.is_cube_menu)return;const n=t?.cube?.pcube;if(!(n&&n instanceof cs))return;const i=pa(n);if(!i)return;o(ms.stack_menus.findLastIndex(e=>e.is_cube_menu)+1);const r=e.currentTarget;ms.stack_rect.push(r.getBoundingClientRect()),ms.stack_menus.push(i)}function a(e,t,n){if(o(t),!n.has_submenu)return;const i=e.currentTarget;ms.stack_rect.push(i.getBoundingClientRect());const r=n.mouseenter(e);r&&ms.stack_menus.push(r)}function l(e,t){t.usable&&(r(),t.click(e))}function c(e){const t=e.usable;return{cursor:t?"pointer":"not-allowed",color:t?"unset":"var(--menu-item-disable-color)"}}function d(e){e.stopPropagation()}function u(e){return{"layout-list":!e.layout||"list"===e.layout,"layout-grid":"grid"===e.layout}}function h(e){return e.is_cube_menu&&function(e){if(!e)return!1;const t=[tu,M_,Uw,Za,nx,Ru,qu,Au,ka,wu,pu],n=e.pcube;if(!n)return!1;for(const e of t)if(n instanceof e)return!0;return!1}(e.cube)}return ni(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const i=e.target;i&&!n.contains(i)&&(ms.menu=void 0,ms.stack_menus.length=0,ms.stack_pos.length=0,ms.stack_rect.length=0)},{capture:!0})}),(e,o)=>(Nr(),Ir("div",{class:"note-menus",style:me(Zt(ms).css),ref_key:"dom",ref:t,onWheel:d},[Yr(" 弹窗 "),$r(rc),Yr(" 主菜单列表 "),i.value?(Nr(),Ir("div",{key:0,class:"menu menu-list",ref_key:"ms",ref:n},[Hr("div",{class:"menu-title",onMouseenter:o[0]||(o[0]=e=>s(e,i.value))},[Hr("span",oc,Ce(i.value.title),1),h(i.value)?(Nr(),Ir("div",sc)):Yr("v-if",!0)],32),Hr("div",{class:ve(["box-menu-items",u(i.value)])},[(Nr(!0),Ir(Cr,null,_i(i.value.menus,e=>(Nr(),Ir("div",{class:ve(["menu-item",{"active-item":i.value.active.includes(e.title)}]),style:me(c(e)),key:e.title,onPointerdown:t=>l(t,e),onMouseenter:t=>a(t,0,e)},[Hr("div",{class:ve(["item-title",e.icon])},Ce(e.title),3),Hr("div",lc,Ce(e.shortcut),1),e.has_submenu?(Nr(),Ir("div",cc)):Yr("v-if",!0)],46,ac))),128))],2)],512)):Yr("v-if",!0),Yr(" 子菜单组 "),(Nr(!0),Ir(Cr,null,_i(Zt(ms).stack_menus,(e,t)=>(Nr(),Ir("div",{class:"menu submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:me(Zt(ms).stack_pos[t])},["component"===e.type?(Nr(),Dr(pi(e.component),{key:0,cube:Ut(e.cube),hide:Ut(r)},null,8,["cube","hide"])):(Nr(),Ir(Cr,{key:1},[Hr("div",{class:"menu-title",onMouseenter:t=>s(t,e)},[Hr("span",uc,Ce(e.title),1),h(e)?(Nr(),Ir("div",hc)):Yr("v-if",!0)],40,dc),Hr("div",{class:ve(["box-menu-items",u(e)])},[(Nr(!0),Ir(Cr,null,_i(e.menus,n=>(Nr(),Ir("div",{class:ve(["menu-item",{"active-item":e.active.includes(n.title)}]),style:me(c(n)),key:n.title,onPointerdown:e=>l(e,n),onMouseenter:e=>a(e,t+1,n)},[Hr("div",{class:ve(["item-title",n.icon])},Ce(n.title),3),Hr("div",fc,Ce(n.shortcut),1),n.has_submenu?(Nr(),Ir("div",mc)):Yr("v-if",!0)],46,pc))),128))],2)],64))],4))),256))],36))}}),gc=(0,Js.A)(_c,[["__scopeId","data-v-1a290dac"]]),bc=["onClick"],yc=Bn({__name:"float-node-layout",props:{float:{}},setup(e){const t=e.float.float_node_layout,n=wo(()=>{const e=Wd.get_layout_detail(t.cube?.env.upstream);return console.log("layouts:",e),e});return(e,i)=>Zt(t).visible?(Nr(),Ir("div",{key:0,class:"float-node-layout",style:me(Zt(t).css)},[(Nr(!0),Ir(Cr,null,_i(n.value,e=>(Nr(),Ir("div",{class:ve(["layout-item",{usable:e.usable}]),onClick:n=>function(e,n){if(!e||!n.usable)return t.close();const{courier:i,history:r}=e,o=i.get_recorder(),s=jo.layout_change(e.id,{layout:n.type});o.tell(e,s),r.record(o),t.close()}(Zt(t).cube,e)},[Hr("div",{class:ve(e.icon)},null,2)],10,bc))),256))],4)):Yr("v-if",!0)}}),vc=(0,Js.A)(yc,[["__scopeId","data-v-8418c3fe"]]),wc={class:"note-float"},xc=Bn({__name:"note-float",props:{root:{}},setup(e){const t=e.root.float;return(e,n)=>(Nr(),Ir("div",wc,[$r(vc,{float:Zt(t)},null,8,["float"])]))}}),kc=(0,Js.A)(xc,[["__scopeId","data-v-4888b6b8"]]),Sc=["id","data-type"],Cc={class:"doc-postils"},Mc=Bn({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:i}=e.cube,r=new Jl(t),o=e=>r.pointerdown(e),s=e=>r.pointermove(e),a=e=>r.pointerup(e),l=e=>r.pointercancel(e),c=e=>r.handler_click_foot(e),d=e=>r.compositionstart(e),u=e=>r.compositionupdate(e),h=e=>r.compositionend(e),p=e=>r.beforeinput(e),f=e=>r.dragover(e),m=e=>r.dragenter(e),_=e=>r.dragleave(e),g=e=>r.drop(e);return ni(()=>{document.documentElement.addEventListener("pointerup",a),document.documentElement.addEventListener("pointermove",s),document.documentElement.addEventListener("pointercancel",l)}),(e,r)=>(Nr(),Ir("div",{class:"cube-doc",id:Zt(t).id,"data-type":Zt(n).doc,style:me(Zt(i).css_vars),onDragover:f,onDragenter:m,onDragleave:_,onDrop:g},[Hr("div",{class:"note",onPointerdown:o,onCompositionstart:d,onCompositionupdate:u,onCompositionend:h,onBeforeinput:p},[(Nr(!0),Ir(Cr,null,_i(Zt(t).children,e=>(Nr(),Dr(pi(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),Yr(" doc-cubes "),Hr("div",Cc,[(Nr(!0),Ir(Cr,null,_i(Zt(t).cubes.postils,([e,t])=>(Nr(),Dr(Oa,{key:t.id,cube:t},null,8,["cube"]))),128))]),Yr(" footer "),Hr("div",{class:"cube-doc-footer",onPointerdown:c},null,32)],32),Yr(" scope selection "),(Nr(!0),Ir(Cr,null,_i(Zt(t).scope,e=>(Nr(),Dr(Xl,{key:e.id,selection:Ut(e)},null,8,["selection"]))),128)),Yr(" menus "),$r(gc,{root:e.cube},null,8,["root"]),$r(kc,{root:e.cube},null,8,["root"])],44,Sc))}}),zc=(0,Js.A)(Mc,[["__scopeId","data-v-4e1a9944"]]);class Ac extends ls{_app;data;constructor(e){super();const t=this.update_data(e.versions[this.meta.type],e).data;this.data=Dt(t),this.build_child(t),$o.init_cmd_handler(this),Ao.add_doc(this),this._app=$l(zc,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return zc}get meta(){return Ac.meta}get doc(){return this}get children(){const e=[];for(let t of this._children)e.push(t);return e}build_child(e){const t=To.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=Vt(this.data);e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.info=[],e.versions=Ao.export_versions();for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Ac.update_data(e,t)}replace_id(e,t={}){return Ac.replace_id(this.root,e,t)}render(e){this._dom=e,this.hotkeys.listen(e),this.app.mount(e),this.event.emit_status_update()}static get meta(){return{type:n.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){Za.get_default();return{id:zo(),type:n.doc,versions:Ao.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}function Tc(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Pc extends cs{_component=ll;get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get editable(){if(this.stats.is_read_mode)return!1;const e=this.host_postil,t=this.host_node;return!e&&t?t.editable:!(!e||t)||(!e||!t||(e.level>t.level||t.editable))}get meta(){return Pc.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}get attrs(){return this.data.attrs}get child_first_text(){for(let e of this._children)if(e instanceof ol)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof ol)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof Ac)return;let t=To.find_line(e,"first");if(t)return t;e=e.next_cube_deep}}get prev_line(){let e=this.prev_cube_deep;for(;e;){if(e instanceof Ac)return;let t=To.find_line(e,"last");if(t)return t;e=e.prev_cube_deep}}constructor(e,t){return super(e,t),this.setup(e,t)}gc(){super.base_gc()}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}update_data(e,t){return Pc.update_data(e,t)}replace_id(e,t={}){return Pc.replace_id(this.root,e,t)}inherit_line(e){const t=Math.min(...e.map(e=>e.attrs.indent||0));for(let n of e){const e=this.attrs.indent;if(e){const i=n.attrs.indent||0;n.attrs.indent=e+i-t}this.css["text-indent"]&&n.type===this.type&&(n.css["text-indent"]=this.css["text-indent"])}}on_cube_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:o,pcube:s}=this,{method:a,cubeid:l,offset:c}=e,d=new Ro(t);if("left"===a&&n instanceof Pc){const e=To.exports(this.children),t=To.filter_out_empty(e);d.tell(n,Lo.insert_child(n.id,t,"tail")),d.merge(this.remove_self("backward"));const i=n.find_child_cube(l);if(i){const e=Eo.loc(l,c,l,c);d.tell(i,e)}}else if("right"===a&&i instanceof Pc){const e=i.export().info,t=To.filter_out_empty(e);d.tell(this,Lo.insert_child(this.id,t,"tail")),d.tell(s,Lo.delete_child(o,"backward",[r+1,r+2]));const n=this.find_child_cube(l);n&&d.tell(n,Eo.loc(l,c,l,c))}else if("both"===a)if(n instanceof Pc&&i instanceof Pc){const e=To.filter_out_empty(this.export().info),t=To.filter_out_empty(i.export().info);d.tell(n,Lo.insert_child(n.id,e.concat(t),"tail")),d.tell(s,Lo.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_child_cube(l);r&&d.tell(r,Eo.loc(l,c,l,c))}else if(n instanceof Pc&&!(i instanceof Pc)){const e=To.filter_out_empty(this.export().info);d.tell(n,Lo.insert_child(n.id,e,"tail")),d.tell(s,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(l);t&&d.tell(t,Eo.loc(l,c,l,c))}else if(!(n instanceof Pc)&&i instanceof Pc){const e=To.filter_out_empty(i.export().info);d.tell(this,Lo.insert_child(this.id,e,"tail")),d.tell(s,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_child_cube(l);t&&d.tell(t,Eo.loc(l,c,l,c))}return d}on_cube_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=To.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new ol(ol.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(Lo.reset(this.id,e)),i.tell(t,Eo.in_tail(t.id))}else{const e=this.export().info,t=To.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Lo.reset(this.id,e))}return i}on_insert_child(e){const{courier:t,pid:n,pcube:i}=this,{pos:r,data:o}=e,s=new Ro(t);if(0===o.length)return s;let a=this.get_valid_index(r);const l=To.pick(o);if(l.head.length>0){s.add_cmd(e);const t=To.build_cubes(o,this),n=t[t.length-1];this.splice(a,0,...t),s.add_recover(Lo.delete_child(this.id,"backward",[a,a+t.length])),n&&s.tell(n,Eo.in_tail(n.id))}const c=[...l.body];if(l.tail.length>0&&c.push(Pc.get_default(l.tail)),l.root.length>0)for(let e of l.root)c.push(...e.info);if(c.length>0)if(this.inherit_line(c),this.is_empty)s.tell(i,Lo.insert_child(n,c,this.index)),s.tell(i,Lo.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(a+l.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const r=t.map(e=>e.export()),o=Pc.get_default(r);this.inherit_line([o]),s.tell(this,Lo.delete_child(this.id,"backward",[e,this.child_count])),s.tell(i,Lo.insert_child(n,[o],this.index+1))}}s.tell(i,Lo.insert_child(n,c,this.index+1))}return s}on_delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,pid:o,index:s,pcube:a}=this,l=r.get_recorder();l.add_cmd(e);const[c,d]=n;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(!(u>=h)){if(u<=0&&h>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;e instanceof ol?(l.tell(this,Lo.delete_child(this.id,t,[1,this.child_count])),l.tell(e,il.reset(e.id,"​")),l.tell(e,Eo.loc(e.id,1,e.id,1))):l.tell(this,Lo.reset(this.id,[]))}else this.is_empty?l.tell(a,Lo.delete_child(o,t,[s,s+1])):l.tell(this,Lo.reset(this.id,[]));else{const e=this.children[u-1],n=this.children[h],i=h-u;if(u>=this.child_count||i<=0)return;let r=this.splice(u,i);l.add_recover(Lo.insert_child(this.id,r.data,c)),"backward"===t?e?l.tell(e,Eo.in_tail(e.id)):n&&l.tell(n,Eo.in_head(n.id)):"forward"===t&&(n?l.tell(n,Eo.in_head(n.id)):e&&l.tell(e,Eo.in_tail(e.id)))}return l}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:i,next_cube:r,pcube:o}=this,{from:s,from_id:a,offset:l}=e,c=new Ro(t);if("left"===s){this.prev_cube_deep instanceof Pc?c.tell(this,Lo.merge(this.id,"left",a,l)):c.tell(this,Eo.in_head(this.id))}else if("right"===s){this.next_cube_deep instanceof Pc?c.tell(this,Lo.merge(this.id,"right",a,l)):c.tell(this,Eo.in_tail(this.id))}return c}static filter_out_empty(e){return e.filter(e=>!ol.is_empty_text(e))}static get meta(){return{version:1,type:n.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},i={}){const r=0===e.length?[ol.get_default()]:e;return{id:zo(),type:n.line,info:r,css:t,attrs:i}}static get_default_by_string(e="​",t={},i={}){const r=[ol.get_default(e||"​")];return{id:zo(),type:n.line,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Tc([Go(i.cube_merge)],Pc.prototype,"on_cube_merge",null),Tc([Go(i.cube_reset)],Pc.prototype,"on_cube_reset",null),Tc([Go(i.cube_insert_child)],Pc.prototype,"on_insert_child",null),Tc([Go(i.cube_delete_child)],Pc.prototype,"on_delete_child",null),Tc([Go(i.cube_delete_adjacent)],Pc.prototype,"on_cube_delete_adjacent",null);const Nc=["id","data-type"],Oc=Bn({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=Eo.in_tail(e.cube.id);r.tell(e.cube,o),i.record(r)}}return(e,i)=>(Nr(),Ir("div",{class:"cube-box",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).box,onPointerup:t},[(Nr(!0),Ir(Cr,null,_i(e.cube.children,e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],44,Nc))}}),Rc=(0,Js.A)(Oc,[["__scopeId","data-v-b4213ca8"]]);function Lc(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Ec extends cs{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Ut(Rc)}get attrs(){return this.data.attrs}get meta(){return Ec.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Ec.update_data(e,t)}gc(){super.base_gc()}replace_id(e,t={}){return Ec.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:o}=this,{method:s,cubeid:a,offset:l}=e,c=new Ro(t);if("left"===s&&n instanceof Ec){const e=this.export().info;c.tell(n,Lo.insert_child(n.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if("right"===s&&i instanceof Ec){const e=i.export().info;c.tell(this,Lo.insert_child(this.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if("both"===s)if(n instanceof Ec&&i instanceof Ec){const e=this.export().info,t=i.export().info;c.tell(n,Lo.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=Eo.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof Ec&&!(i instanceof Ec)){const e=this.export().info;c.tell(n,Lo.insert_child(n.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof Ec)&&i instanceof Ec){const e=i.export().info;c.tell(this,Lo.insert_child(this.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}return c}on_box_order(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:o}=e,s=this.find_child_cube(r);if(!s||s.index===o)return;const a=new Ro(t);let l=0,c=s.index;return"tail"===o?l=this.child_count:"number"==typeof o&&(l=o),this.splice(c,1),this.splice(l,0,s),a.add_recover(Lo.reorder(this.id,s.id,c)),a}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let o=this.get_valid_index(n);const s=this.create_child_block(i);this.splice(o,0,...s),r.add_recover(Lo.delete_child(this.id,"backward",[o,o+s.length]));const a=this.children[o+1];return a?r.tell(a,Eo.in_head(a.id)):r.tell(this.child_last,Eo.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=s;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(!(u>=h)){if(u<=0&&h>=this.child_count)if(a){if(this.is_empty)return;l.tell(this,Lo.delete_child(this.id,o,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Lo.delete_child(e.id,o,[0,e.child_count],a))}else this.is_empty?l.tell(r,Lo.delete_child(n,o,[i,i+1])):l.tell(this,Lo.reset(this.id,[]));else{const e=this.children[u-1],t=this.children[h],n=h-u;if(u>=this.child_count||n<=0)return;let i=this.splice(u,n);l.add_recover(Lo.insert_child(this.id,i.data,c)),"backward"===o?e?l.tell(e,Eo.in_tail(e.id)):t&&l.tell(t,Eo.in_head(t.id)):"forward"===o&&(t?l.tell(t,Eo.in_head(t.id)):e&&l.tell(e,Eo.in_tail(e.id)))}return l}}on_box_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=To.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new Pc(Pc.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(Lo.reset(this.id,e)),i.tell(t,Eo.in_tail(t.id))}else{const e=this.export().info,t=To.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Lo.reset(this.id,e))}return i}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i}=this,{from:r,from_id:o,offset:s}=e,a=new Ro(t);if("left"===r){if(this.prev_cube_deep instanceof Ec)a.tell(this,Lo.merge(this.id,"left",o,s));else{const e=this.export().info,t=this.child_first.id;a.tell(n,Lo.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,Lo.delete_adjacent(t,r,o,s))}}else if("right"===r){if(this.next_cube_deep instanceof Ec)a.merge(this.on(Lo.merge(this.id,"right",o,s)));else{const e=this.export().info,t=this.child_first.id;a.tell(n,Lo.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,Lo.delete_adjacent(t,r,o,s))}}return a}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static get meta(){return{type:n.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=[];return 0===e.length?r.push(Pc.get_default()):r.push(...To.pick(e).sort),{id:To.get_id(),type:n.box,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Lc([Go(i.cube_merge)],Ec.prototype,"on_merge",null),Lc([Go(i.cube_reorder)],Ec.prototype,"on_box_order",null),Lc([Go(i.cube_insert_child)],Ec.prototype,"on_insert_child",null),Lc([Go(i.cube_delete_child)],Ec.prototype,"on_delete_child",null),Lc([Go(i.cube_reset)],Ec.prototype,"on_box_reset",null),Lc([Go(i.cube_delete_adjacent)],Ec.prototype,"on_cube_delete_adjacent",null);const Ic=["id","data-type"],Dc=Bn({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:i}=e.cube;return(e,i)=>(Nr(),Ir("div",{class:ve(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),id:e.cube.id,style:me(Zt(t).css),"data-type":Zt(n).box_folder},[e.cube.attrs.fold?(Nr(),Dr(Oa,{key:0,cube:e.cube.child_first},null,8,["cube"])):(Nr(!0),Ir(Cr,{key:1},_i(Zt(t).children,e=>(Nr(),Dr(Oa,{key:e.id,cube:Ut(e)},null,8,["cube"]))),128)),Hr("div",{class:ve(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:i[0]||(i[0]=t=>function(e,t){const{courier:n,history:i,cubes:r,id:o,pcube:s}=t,a=n.get_recorder();a.tell(t,Lo.fold(o,!t.attrs.fold)),i.record(a);for(let e of Object.values(r.postils))e.find_upstream_untill(s)===t&&e.visible(!1);const l=t.child_first.id;if(!l)return;const c=document.getElementById(l);c?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,Ic))}}),Bc=(0,Js.A)(Dc,[["__scopeId","data-v-e4ce51da"]]);function jc(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class qc extends cs{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Bc}get meta(){return qc.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof Pc&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return qc.update_data(e,t)}replace_id(e,t){return qc.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,o=new Ro(t);if("left"===n){this.prev_cube_deep instanceof qc?o.tell(this,Lo.merge(this.id,"left",r,i)):o.tell(this,Eo.in_head(this.id))}else if("right"===n){this.next_cube_deep instanceof qc?o.merge(this.on(Lo.merge(this.id,"right",r,i))):o.tell(this,Eo.in_tail(this.id))}return o}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:o}=this,{method:s,cubeid:a,offset:l}=e,c=new Ro(t);if("left"===s&&n instanceof qc){const e=this.export().info;c.tell(n,Lo.insert_child(n.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if("right"===s&&i instanceof qc){const e=i.export().info;c.tell(this,Lo.insert_child(this.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if("both"===s)if(n instanceof qc&&i instanceof qc){const e=this.export().info,t=i.export().info;c.tell(n,Lo.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=Eo.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof qc&&!(i instanceof qc)){const e=this.export().info;c.tell(n,Lo.insert_child(n.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof qc)&&i instanceof qc){const e=i.export().info;c.tell(this,Lo.insert_child(this.id,e,"tail")),c.tell(this.pcube,Lo.delete_child(o,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=Eo.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:o}=e,s=this.find_child_cube(r);if(!s||s.index===o)return;const a=new Ro(t);let l=0,c=s.index;return"tail"===o?l=this.child_count:"number"==typeof o&&(l=o),this.splice(c,1),this.splice(l,0,s),a.add_recover(Lo.reorder(this.id,s.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=To.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof ol&&e.is_empty)return;const t=this.export().info,n=new Pc(Pc.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(Lo.reset(this.id,t)),i.tell(n,Eo.in_tail(n.id))}else{const e=this.export().info,t=To.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Lo.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let o=this.get_valid_index(n);const s=this.create_child_block(i);this.splice(o,0,...s),r.add_recover(Lo.delete_child(this.id,"backward",[o,o+s.length]));const a=s[s.length-1],l=this.children[o+1];return a?r.tell(a,Eo.in_tail(a.id)):r.tell(l,Eo.in_head(l.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=s;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count){if(a){if(this.is_empty)return;l.tell(this,Lo.delete_child(this.id,o,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Lo.delete_child(e.id,o,[0,e.child_count],a))}else this.is_empty?l.tell(r,Lo.delete_child(n,o,[i,i+1])):l.tell(this,Lo.reset(this.id,[]));return l}const p=this.children[u-1],f=this.children[h],m=h-u;let _=this.splice(c,m);return l.add_recover(Lo.insert_child(this.id,_.data,c)),"backward"===o?p?l.tell(p,Eo.in_tail(p.id)):f&&l.tell(f,Eo.in_head(f.id)):"forward"===o&&(f?l.tell(f,Eo.in_head(f.id)):p&&l.tell(p,Eo.in_tail(p.id))),l}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!ol.is_empty_text(e))}static get meta(){return{type:n.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[Pc.get_default()]:e;return{id:To.get_id(),type:n.box_folder,info:r,css:t,attrs:i}}static replace_id(e,t,n){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info){const t=Ao.find_cube(i.type);t&&t.replace_id&&o.push(t.replace_id(e,i,n))}return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}jc([Go(i.cube_delete_adjacent)],qc.prototype,"on_cube_delete_adjacent",null),jc([Go(i.cube_merge)],qc.prototype,"on_merge",null),jc([Go(i.cube_reorder)],qc.prototype,"on_cube_reorder",null),jc([Go(i.cube_reset)],qc.prototype,"on_cube_reset",null),jc([Go(i.cube_insert_child)],qc.prototype,"on_insert_child",null),jc([Go(i.cube_delete_child)],qc.prototype,"on_delete_child",null);class Fc{}const Hc=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],$c=Bn({__name:"cube-linker",props:{cube:{}},setup:e=>(t,i)=>(Nr(),Ir("path",{d:t.cube.path,id:t.cube.id,class:ve(["cube-linker",{"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}]),style:me(t.cube.css),"data-type":Zt(n).linker,"stroke-width":t.cube.attrs.stroke_width,stroke:t.cube.attrs.stroke,"marker-start":`url(#${t.cube.anchor_left})`,"marker-end":`url(#${t.cube.anchor_right})`},null,14,Hc))}),Gc=(0,Js.A)($c,[["__scopeId","data-v-6b0e5f48"]]),Vc=["cx","cy"],Uc=Bn({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>(Nr(),Ir(Cr,null,[Zt(t).show?(Nr(),Ir("circle",{key:0,cx:Zt(t).x,cy:Zt(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,Vc)):Yr("v-if",!0),Yr(' <g data-flag="drag-nodes" :transform="get_matrix()" style="pointer-events: none; user-select: none; opacity: 0.8" v-if="info_node_drag.show">\r\n <path d="M -54.5 -18 L 54.5 -18 Q 56.5 -18 56.5 -16 L 56.5 16 Q 56.5 18 54.5 18 L -54.5 18 Q -56.5 18 -56.5 16 L -56.5 -16 Q -56.5 -18 -54.5 -18 z" style="fill: rgba(255, 255, 255, 0.05); stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <path d="M -54.5 -18 L -54.5 -20 Q -54.5 -22 -52.5 -22 L 58.5 -22 Q 60.5 -22 60.5 -20 L 60.5 14 Q 60.5 16 58.5 16 L 56.5 16" style="fill: none; stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <text x="0" y="7" text-anchor="middle" font-size="14" style="fill: rgb(113 117 122)">已选择{{info_node_drag.count}}个节点</text>\r\n </g> ')],2112))}}),Wc={class:"map-status"},Yc={class:"tool-item map-scale"},Xc={class:"tool-item map-nodes"},Kc=Bn({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,i=wo(()=>e.cube.cubes.get_types_cube(n.node));function r(e){const n=t.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(i,e,e)}return(t,n)=>(Nr(),Ir("div",Wc,[Hr("div",Yc,[Hr("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:n[0]||(n[0]=e=>r(-.1))}),Hr("span",null,Ce((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),Hr("span",{class:"iconfont icon-add",onClick:n[1]||(n[1]=e=>r(.1))})]),Hr("div",Xc,[Hr("span",null,"节点 : "+Ce(i.value.size),1)])]))}}),Jc=(0,Js.A)(Kc,[["__scopeId","data-v-0a87416a"]]),Qc=new Po,Zc=["id","data-type"],ed=["transform"],td=["data-group"],nd=["data-group"],id=["data-group"],rd=["data-group"],od=["d"],sd=["d","marker-start","marker-end"],ad=["d"],ld={class:"doc-postils"},cd=Bn({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:i,config:r}=e.cube,o=(r.data,new Ql(t)),s=Kt(),a=new ResizeObserver(e=>{t.get_view_rect(),Qc.resolve()});ni(()=>{const t=s.value;t&&a.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const l=e=>o.pointerdown(e),c=e=>o.pointermove(e),d=e=>o.pointerup(e),h=e=>o.pointercancel(e),p=e=>o.compositionstart(e),f=e=>o.compositionupdate(e),m=e=>o.compositionend(e),_=e=>o.beforeinput(e);return ni(()=>{document.documentElement.addEventListener("pointerup",d),document.documentElement.addEventListener("pointermove",c),document.documentElement.addEventListener("pointercancel",h)}),(e,o)=>(Nr(),Ir("div",{class:"cube-map",id:e.cube.id,"data-type":Zt(n).map},[Hr("div",{class:"note",onPointerdown:l,onCompositionstart:p,onCompositionupdate:f,onCompositionend:m,onBeforeinput:_},[(Nr(),Ir("svg",{ref_key:"svg",ref:s,style:me(Zt(r).css_vars)},[Hr("g",{transform:Zt(t).matrix2d_dom_string},[Hr("g",{"data-group":Zt(u).markers,class:"group-defs"},[...o[0]||(o[0]=[Wr('<defs data-v-7ea9296a>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-7ea9296a><path d="M 0 0 L 6 3 L 0 6 z" data-v-7ea9296a></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-7ea9296a><circle cx="3" cy="3" r="3" data-v-7ea9296a></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-7ea9296a><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-7ea9296a></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-7ea9296a><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-7ea9296a></rect></marker></defs>',1)])],8,td),Hr("g",{"data-group":Zt(u).linkers,class:"group-linkers"},[(Nr(!0),Ir(Cr,null,_i(Zt(t).get_linkers_view(),e=>(Nr(),Dr(Gc,{key:e.id,cube:e},null,8,["cube"]))),128))],8,nd),Hr("g",{"data-group":Zt(u).nodes,class:"group-nodes"},[(Nr(!0),Ir(Cr,null,_i(e.cube.get_nodes_view(),e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],8,id),Hr("g",{"data-group":Zt(u).placeholder,class:"group-placeholder"},[Zt(i).box_selector?(Nr(),Ir("path",{key:0,class:"placeholder-box-selector",d:Zt(i).box_selector},null,8,od)):Yr("v-if",!0),(Nr(!0),Ir(Cr,null,_i(Zt(i).linker,e=>(Nr(),Ir(Cr,null,[e?(Nr(),Ir("path",{key:0,class:"placeholder-linker",d:e.path,style:me({stroke:e.stroke,"stroke-width":e.width}),"marker-start":`url(#${e.anchor_start})`,"marker-end":`url(#${e.anchor_end})`},null,12,sd)):Yr("v-if",!0)],64))),256)),Zt(i).line_delete?(Nr(),Ir("path",{key:1,class:"placeholder-line-delete",d:Zt(i).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,ad)):Yr("v-if",!0),Yr(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),$r(Uc,{interaction:e.cube.interaction},null,8,["interaction"])],8,rd),Yr(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),Yr(" ------------------节点信息---------------------- "),Yr(' <template v-for="node of cube.nodes_test" v-if="cube.isdev"> '),Yr(" 采样点 "),Yr(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),Yr(" 中心点 "),Yr(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),Yr(" 左上角 "),Yr(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),Yr(" 边界框 "),Yr(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),Yr(" 树边界框 "),Yr(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),Yr(" </template> "),Yr(" ------------------连线信息---------------------- "),Yr(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),Yr(" 采样点 "),Yr(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),Yr(" 中心点 "),Yr(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),Yr(" 左上角 "),Yr(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),Yr(" 边界框 "),Yr(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),Yr(" 树边界框 "),Yr(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),Yr(" </template> "),Yr(" ------------------意图区域---------------------- "),Yr(' <rect :x="PP.prev.x" :y="PP.prev.y" :width="PP.prev.width" :height="PP.prev.height" stroke="red" fill="none"></rect>\r\n <rect :x="PP.next.x" :y="PP.next.y" :width="PP.next.width" :height="PP.next.height" stroke="blue" fill="none"></rect>\r\n <rect :x="PP.child.x" :y="PP.child.y" :width="PP.child.width" :height="PP.child.height" stroke="green" fill="none" v-if="PP.child"></rect> ')],8,ed)],4)),Yr(" doc-cubes "),Hr("div",ld,[(Nr(!0),Ir(Cr,null,_i(Zt(t).cubes.postils,([e,t])=>(Nr(),Dr(Oa,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),Yr(" scope selection "),(Nr(!0),Ir(Cr,null,_i(Zt(t).scope,e=>(Nr(),Dr(Xl,{key:e.id,selection:Ut(e)},null,8,["selection"]))),128)),Yr(" map status "),$r(Jc,{cube:e.cube},null,8,["cube"]),Yr(" menus "),$r(gc,{root:e.cube},null,8,["root"]),$r(kc,{root:e.cube},null,8,["root"])],8,Zc))}}),dd=(0,Js.A)(cd,[["__scopeId","data-v-7ea9296a"]]);class ud{static draw(e){const{type:t,from:n,to:i}=e;return"line"===t?this.line(n,i):"bezier2"===t?this.bezier2(n,i):"polyline"===t?this.polyline(n,i):"polyline2"===t?this.polyline2(n,i):"polyline3"===t?this.polyline3(n,i):"wave"===t?this.wave(n,i):this.bezier2(n,i)}static get_line(e,t,n){return"line"===n?this.line(e,t):"bezier2"===n?this.bezier2(e,t):"polyline"===n?this.polyline(e,t):"polyline2"===n?this.polyline2(e,t):"polyline3"===n?this.polyline3(e,t):"wave"===n?this.wave(e,t):this.bezier2(e,t)}static line(e,t){return`M${e.x.toFixed(1)} ${e.y.toFixed(1)}L${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static bezier2(e,t){const n=(e.x+t.x)/2,i=n,r=e.y,o=n,s=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${i} ${r} ${o} ${s} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const i=(e.x+t.x)/2,r=e,o=t,s=i,a=r.y,l=i,c=o.y,d=Math.sign(e.x-t.x),u=Math.sign(t.y-e.y),h=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${r.x} ${r.y} H ${s+d*n} Q ${s} ${a} ${s} ${a+u*n} V ${c+h*n} Q${l} ${c} ${l+p*n} ${c} H ${o.x}`}static polyline2(e,t,n=4){const i=e,r=t,o=(e.x+t.x)/2,s=i.y;return`M${i.x} ${i.y} L${o} ${s} L ${r.x} ${r.y}`}static polyline3(e,t,n=4){const i=(e.x+t.x)/2,r=e,o=t,s=(r.y,i),a=o.y;return`M${r.x} ${r.y} L${s} ${a} L ${o.x} ${o.y}`}static wave(e,t,n=2,i=8){const r=t.x-e.x,o=t.y-e.y,s=Math.sqrt(r*r+o*o),a=Math.atan2(o,r),l=i??s/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const i=t/d,s=e.x+r*i,u=e.y+o*i,h=l*Math.sin(i*n*Math.PI*2),p=s+-Math.sin(a)*h,f=u+Math.cos(a)*h;if(0===t)c+=` M ${p} ${f}`;else{const i=(t-1)/d,s=l*Math.sin(i*n*Math.PI*2),u=-Math.sin(a)*s,h=Math.cos(a)*s,m=e.x+r*i+u,_=e.y+o*i+h;c+=` C ${m+(p-m)/3} ${_+(f-_)/3}, ${p-(p-m)/3} ${f-(f-_)/3}, ${p} ${f}`}}return c}}class hd{static map={right:this.right.bind(this),left:this.left.bind(this),down:this.down.bind(this),up:this.up.bind(this),"time-right":this.time_right.bind(this),"time-down":this.time_down.bind(this)};static find(e,t){const n=e.env.layout_type;if(t.env.upstream!==e)return this.free_to_any(e,t);if(n){return(0,this.map[n])(e,t)}return this.free_to_any(e,t)}static get_point(e){const t=e.env.layout_type;if(!t)return;const n=e.bound.rect;return"right"===t?Io.MathRect.get_rect_point(n,Io._RectPosition.right_mid):"left"===t?Io.MathRect.get_rect_point(n,Io._RectPosition.left_mid):"down"===t?Io.MathRect.get_rect_point(n,Io._RectPosition.bottom_mid):"up"===t?Io.MathRect.get_rect_point(n,Io._RectPosition.top_mid):"time-down"===t?Io.MathRect.get_rect_point(n,Io._RectPosition.bottom_mid):"time-right"===t?Io.MathRect.get_rect_point(n,Io._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.env.prev_node||e,i={...n.bound.pos,...n.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:Io.MathRect.get_rect_point(i,Io._RectPosition.bottom_mid),to:Io.MathRect.get_rect_point(r,Io._RectPosition.top_mid)}}static time_right(e,t){const n=t.env.prev_node||e,i={...n.bound.pos,...n.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:Io.MathRect.get_rect_point(i,Io._RectPosition.right_mid),to:Io.MathRect.get_rect_point(r,Io._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:Io.MathRect.get_rect_point(n,Io._RectPosition.top_mid),to:Io.MathRect.get_rect_point(i,Io._RectPosition.bottom_mid)}}static right(e,t){const n=e.bound.rect,i=t.bound.rect;return{from:Io.MathRect.get_rect_point(n,Io._RectPosition.right_mid),to:Io.MathRect.get_rect_point(i,Io._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:Io.MathRect.get_rect_point(n,Io._RectPosition.left_mid),to:Io.MathRect.get_rect_point(i,Io._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:Io.MathRect.get_rect_point(n,Io._RectPosition.bottom_mid),to:Io.MathRect.get_rect_point(i,Io._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,i=t.sample;if(0!==n.length&&0!==i.length)return So.find_closest_points(n,i)}}class pd{static update(e,t){return{id:e,name:k.update,attrs:t}}}class fd extends Co{_interaction;_flow=!1;scope_down=null;fig_matrix_origin;pos_down_real;m;count=0;rate=3;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-drag"}reset_status(){this._flow=!1}down(e,t){this.scope_down=t;const{selector:n}=t;"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&!e.ctrlKey&&(e.stopPropagation(),e.preventDefault(),this.pos_down_real=this.map.view_point_to_real(t.pos),this._flow=!0,this.fig_matrix_origin={...this.map.matrix2d})}move(e){if(!this._flow||!this.scope_down||!this._interaction.check_mouse_key(e,"right"))return;if(this.count++,this.count%this.rate===0)return;this.count=1,e.stopPropagation(),e.preventDefault();const{map_sum_scale:t}=this.scope_down,n=e.clientX,i=e.clientY,r=(n-this.scope_down.pos.x)/t.sx,o=(i-this.scope_down.pos.y)/t.sy;this.m=ko.multiply(this.fig_matrix_origin,ko.get_matrix_translate(r,o)),Object.assign(this.map.matrix2d,this.m)}up(e){if(!this._flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const t=this.courier.get_recorder();this.map.reset_matrix(this.fig_matrix_origin);const n=qo.update_attr(this.map.id,{matrix2d:this.m});t.tell(this.map,n),this.history.record(t),this._flow=!1,this.map.reset_matrix(this.m),this.map.check_show()}cancel(e){this._flow&&(this._flow=!1,this.map.check_show())}leave(e){this._flow&&(this._flow=!1,this.map.check_show())}wheel(e){}dblclick(e){}contextmenu(e){}}class md extends Co{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-scale"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){if(!e.ctrlKey)return;e.stopPropagation(),e.preventDefault();const{map_scale_step:t}=this.config.data,n=e.deltaY,i=-Math.sign(n),r={x:e.clientX,y:e.clientY},o=i*t;this.map.scale_by_point(r,o,o),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class _d extends Co{_interaction;_flow=!1;count=0;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-wheel"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){e.stopPropagation(),e.preventDefault(),this.count++;const t=-Math.sign(e.deltaY)*this.config.data.scroll_distance;if(!e.ctrlKey){if(e.shiftKey){const e=ko.multiply(this.map.matrix2d,ko.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=ko.multiply(this.map.matrix2d,ko.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}class gd extends Co{_interaction;down_point;view_cubes=[];flow=!1;count=0;rate=4;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:line-delete"}reset(){this.flow=!1,this.map.placeholder.line_delete="",this.view_cubes=[]}down(e,t){const{selector:n,pos:i,view_cubes:r}=t;this.stats.is_read_mode||"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&e.ctrlKey&&(e.stopPropagation(),e.preventDefault(),this.flow=!0,this.down_point=this.map.view_point_to_real(i),this.view_cubes=r)}move(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault(),this.count++;const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);if(this.map.placeholder.line_delete=ud.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const i={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof hs){let t=e.sample[0];for(let n of e.sample.slice(1)){const r={from:t,to:n};if(Io.MathLine.check_intersection(r,i)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof Gd){let t=e.sample[0];for(let n of e.sample.slice(1)){const r={from:t,to:n};if(Io.MathLine.check_intersection(r,i)){this.map.put_delete_selected(e);break}t=n}}}up(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this.root,i=t.get_recorder(),r=this.map.id,o=[],s=[],a=this.map.get_delete_selected();for(let e of a)e instanceof hs?o.push(e.id):e instanceof Gd&&s.push(e.id);const l=qo.node_remove(r,o),c=qo.linker_remove(r,s);i.tell(this.map,l,c),n.record(i),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class bd extends Co{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-add"}down(e,t){}move(e){}up(e){this.flow&&(this.flow=!1)}cancel(e){this.flow}wheel(e){}leave(){}dblclick(e,t){const{selector:n,pos:i}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:r,history:o}=this,s=hs.get_default_node_pos(i,this.map),a=[tu.get_default(s)],l=qo.node_add(this.map.id,a),c=r.get_recorder();c.tell(this.map,l),o.record(c)}contextmenu(e){}}class yd extends Co{_interaction;_flow=!1;point_down;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-box-selected"}reset(){this.flow=!1,this.map.placeholder.box_selector=""}down(e,t){const{pos:n,selector:i}=t,{type:r,res:o}=i;"fig"===r&&this._interaction.check_mouse_key(e,"left")&&(e.preventDefault(),this.flow=!0,this.point_down=this.map.view_point_to_real(n))}move(e){if(!this.flow)return;this.count++,e.preventDefault();const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),i=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=i,this.count%this.rate!==0)return;this.count=1;const r={x:Math.min(this.point_down.x,n.x),y:Math.min(this.point_down.y,n.y),width:Math.abs(n.x-this.point_down.x),height:Math.abs(n.y-this.point_down.y)},o=this.map.get_nodes_intersection(r);this.map.clear_node_selected();for(let e of o)this.map.register_node_selected(e)}up(e){this.flow&&(e.stopPropagation(),e.preventDefault(),this.reset())}cancel(e){this.flow&&this.reset()}wheel(e){}leave(){}dblclick(e,t){}contextmenu(e){}get_rect_area(e,t,n=4){const i=t.x-e.x,r=t.y-e.y,o=Math.sign(i)*n,s=Math.sign(r)*n,a=e,l=a.x+i,c=a.y,d=t,u=a.x,h=a.y+r;return`M${a.x+o} ${a.y}H${l-o}Q${l} ${c} ${l} ${c+s}V${d.y-s}Q${d.x} ${d.y} ${d.x-o} ${d.y}H ${u+o}Q${u} ${h} ${u} ${h-s}V${a.y+s}Q${a.x} ${a.y} ${a.x+o} ${a.y}Z`}check_intersection(e,t){const n=e.x+e.width/2,i=e.y+e.height/2,r=t.x+t.width/2,o=t.y+t.height/2,s=Math.abs(n-r),a=Math.abs(i-o);return s<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class vd extends Co{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-click-select"}down(e,t){const{selector:n,pos:i}=t,{type:r,res:o}=n;"node"!==r||n.res.editable||(e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.map.clear_node_selected(),o.pcube.toggle_node_selected(o))}move(e){this.flow}up(e){this.flow}leave(e){}cancel(e){}wheel(e){}dblclick(e){}contextmenu(e){}}class wd extends Co{_interaction;_flow=!1;down_node;down_pos;matrix=new Map;matrix_translate=ko.get_matrix_translate(0,0);scope_down;recover_select=!1;has_down=!1;view_cubes=[];near;intention="none";constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-drag"}reset_status(){this.recover_select=!1,this.matrix.clear(),this.flow=!1,this.has_down=!1,this._interaction.info_node_drag.show=!1,this.view_cubes=[]}down(e,t){this.scope_down=t;const{selector:n,pos:i,selected_nodes:r,view_cubes:o}=t;if("node"===n.type&&this.map.interaction.check_mouse_key(e,"left")&&!n.res.editable)if(e.stopPropagation(),e.preventDefault(),this.reset_status(),this.has_down=!0,this.view_cubes=o,this.down_node=n.res,this.down_pos=this.map.view_point_to_real(i),r.has(this.down_node))for(let e of r)e.env.is_captive||this.matrix.set(e,{...e.matrix2d});else this.matrix.set(this.down_node,{...this.down_node.matrix2d})}move(e){if(!this.has_down||!this.map.interaction.check_mouse_key(e,"left")||!this.down_pos)return;this.flow=!0,e.preventDefault();const t=this._interaction.info_node_drag,n={x:e.clientX,y:e.clientY},i=this.map.view_point_to_real(n),r=i.x-this.down_pos.x,o=i.y-this.down_pos.y;if(!this.recover_select){this.map.clear_node_selected();for(let[e]of this.matrix)this.map.register_node_selected(e);this.recover_select=!0}t.show=!1,this.matrix_translate=ko.get_matrix_translate(r,o);for(let[e,t]of this.matrix){if(!t)continue;const n=ko.multiply(t,this.matrix_translate);e.reset_matrix(n)}}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this,i=t.get_recorder();if(e.ctrlKey);else{const e=new Set,t=new Set;for(let[n,i]of this.matrix)if(i&&(n.reset_matrix(i),t.add(n),n.is_layout_root&&(e.add(n),!n.env.layout_type)))for(let e of n.env.downstream_nodes)t.add(e);for(let e of t){const t=e.matrix2d,n=ko.multiply(t,this.matrix_translate),r=jo.layout_change(e.id,{matrix2d:n});i.tell(e,r)}n.record(i),this.map.grider.update_nodes([...this.matrix.keys()]);for(let t of e)t.layout_throttle()}this.reset_status()}cancel(e){this.flow&&this.reset_status()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class xd extends Co{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit"}down(e,t){}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){const{selector:n,pos:i}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class kd extends Co{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit-exit"}down(e,t){const{selector:n}=t,{type:i,res:r}=n;"fig"!==i&&"empty"!==i||(e.stopPropagation(),e.preventDefault(),this.cubes.clear_all_map_selected(),this.map.clear_node_editing())}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){}contextmenu(e){}}class Sd extends Co{_interaction;_flow=!1;down_node;selected_nodes=new Set;recorver_selected=!1;has_down=!1;down_pos={x:0,y:0};constructor(e){super(e.root),this._interaction=e}get min_distance(){return 5}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-line"}reset_status(){this.flow=!1,this.has_down=!1,this.selected_nodes.clear(),this.map.placeholder.linker=[],this.recorver_selected=!1}down(e,t){const{selector:n,pos:i,selected_nodes:r}=t;if("node"===n.type&&this._interaction.check_mouse_key(e,"right"))if(this.reset_status(),this.has_down=!0,e.preventDefault(),e.stopPropagation(),this.down_pos=i,this.down_node=n.res,r.has(this.down_node))for(let e of r)this.selected_nodes.add(e);else this.selected_nodes.add(this.down_node)}move(e){if(!this._interaction.check_mouse_key(e,"right")||!this.has_down)return;if(Math.sqrt((e.clientX-this.down_pos.x)**2+(e.clientY-this.down_pos.y)**2)<this.min_distance)return;this.flow=!0,e.stopPropagation(),e.preventDefault();const t=this._interaction.get_map_selector(e),{res:n,type:i}=t;if(this.map.placeholder.linker=[],!this.recorver_selected){this.recorver_selected=!0,this.map.clear_node_selected();for(let e of this.selected_nodes)this.map.register_node_selected(e)}if("node"===i)for(let e of this.selected_nodes){const{from:t,to:i}=So.find_closest_points(e.sample,n.sample),r=e.env.node_line_type;this.map.placeholder.linker.push({path:ud.get_line(t,i,r),stroke:e.env.node_fill,width:e.env.node_line_width,anchor_start:e.env.node_line_anchor_out,anchor_end:x.arrow})}else{const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);for(let e of this.selected_nodes){const t=So.find_closet_point(e.sample,n),i=e.env.node_line_type;this.map.placeholder.linker.push({path:ud.get_line(t,n,i),stroke:e.env.node_fill,width:e.env.node_line_width,anchor_start:e.env.node_line_anchor_out,anchor_end:x.arrow})}}}async up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation(),await To.sleep(1);const{courier:t,history:n}=this,i=this._interaction.get_map_selector(e),{res:r,type:o}=i;if("node"===o){if(r===this.down_node)return;const e=t.get_recorder();for(let t of this.selected_nodes){const n=this.map.get_linker_id(t.id,r.id);if(this.map.get_linker(n))Mo.tips?.tip_warning("已存在连接线");else{const n=So.create_linker_info(this.map,t.id,r.id),i=qo.linker_add(this.map.id,[n]);e.tell(this.map,i)}}n.record(e)}else if("fig"===o){const{courier:t,history:n}=this,i=t.get_recorder(),r=hs.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),o=tu.get_default(r),s=qo.node_add(this.map.id,[o]);i.tell(this.map,s);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,o.id);if(this.map.get_linker(t)){Mo.tips?.tip_warning("已存在连接线");continue}const n=So.create_linker_info(this.map,e.id,o.id),r=qo.linker_add(this.map.id,[n]);i.tell(this.map,r)}n.record(i)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}class Cd extends Co{_map;interactions_pointer=[];interaction_keyboard=[];info_node_drag=Dt({show:!1,count:0,x:0,y:0});constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new fd(this)),this.interactions_pointer.push(new md(this)),this.interactions_pointer.push(new xd(this)),this.interactions_pointer.push(new kd(this)),this.interactions_pointer.push(new bd(this)),this.interactions_pointer.push(new Sd(this)),this.interactions_pointer.push(new wd(this)),this.interactions_pointer.push(new yd(this)),this.interactions_pointer.push(new gd(this)),this.interactions_pointer.push(new vd(this)),this.map instanceof ls&&this.interactions_pointer.push(new _d(this))}get flowing(){return this.interactions_pointer.some(e=>e.flow)}get map(){return this._map}register(e){e.addEventListener("pointerdown",this.pointerdown.bind(this)),e.addEventListener("pointermove",this.pointermove.bind(this)),e.addEventListener("pointerup",this.pointerup.bind(this)),e.addEventListener("pointercancel",this.pointercancel.bind(this)),e.addEventListener("pointerleave",this.pointerleave.bind(this)),e.addEventListener("wheel",this.wheel.bind(this)),e.addEventListener("dblclick",this.dblclick.bind(this)),e.addEventListener("contextmenu",this.contextmenu.bind(this))}check_mouse_key(e,t){return To.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,i=t.id;if(i&&e){if(e===n.node){const e=this.map.get_node(i);if(e)return{type:"node",res:e}}else if(e===n.linker){const e=this.map.get_linker(i);if(e)return{type:"linker",res:e}}else if(e===n.map||e===n.submap)return{type:"fig",res:this.map};t=t.parentElement}else t=t.parentElement}return{type:"empty",res:void 0}}pointerdown(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()},{selector:n}=t,{res:i,type:r}=n;if("node"===r&&this.root.isdev){this.map.nodes_test[i.id]=i,console.log("------------------------------------节点信息");const t=i.bound;console.log("id",i.id),console.log("matrix:",{...t.matrix2d}),console.log("pos:",t.pos),console.log("pos_tree:",t.pos_tree),console.log("size_bound:",t.size_bound),console.log("size_tree:",t.size_tree),console.log("fig_pos:",i.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",i.pcube.real_point_to_view(t.pos)),console.log("to_size",i.to.size),console.log("in_size",i.from.size),console.log("节点",i),this.check_mouse_key(e,"mid")&&i.a()}for(let n of this.interactions_pointer)n.down(e,t);"fig"===t.selector.type&&this.event.emit_fig_click(e)}pointermove(e){for(let t of this.interactions_pointer)t.move(e)}pointerup(e){for(let t of this.interactions_pointer)t.up(e)}pointercancel(e){for(let t of this.interactions_pointer)t.cancel(e)}pointerleave(e){for(let t of this.interactions_pointer)t.leave(e)}dblclick(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()};for(let n of this.interactions_pointer)n.dblclick(e,t)}wheel(e){for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}const Md={class:"map-status"},zd=Bn({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(i,t,t)}return(n,i)=>(Nr(),Ir("div",Md,[Hr("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>t(-.1))}),Hr("span",null,Ce((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),Hr("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>t(.1))})]))}}),Ad=(0,Js.A)(zd,[["__scopeId","data-v-cb09d654"]]),Td=["id","data-type"],Pd=["transform"],Nd=["data-group"],Od=["data-group"],Rd=["data-group"],Ld=["data-group"],Ed=["d"],Id=["d","marker-start","marker-end"],Dd=["d"],Bd=Bn({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,i=(e.cube.config.data,Kt()),r=Kt(),o=new ResizeObserver(t=>{e.cube.get_view_rect()}),s=Kt();let a;function l(){e.cube.dom_svg_rect}return ni(()=>{const t=r.value;t&&o.observe(t);const n=i.value;n&&e.cube.interaction.register(n);const l=s.value;if(!l)return;a=new Io.DragDiff(l);let c=e.cube.attrs.width,d=e.cube.attrs.height,u=c,h=d;a.register_down(()=>{c=e.cube.attrs.width,d=e.cube.attrs.height}),a.register_move((e,t)=>{u=Math.round(e+c),h=Math.round(t+d),n.style.width=u+"px",n.style.height=h+"px"}),a.register_up((t,n)=>{if(c===u&&d===h)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+c),o=Math.round(n+d);i.tell(e.cube,Lo.resize(e.cube.id,r,o)),e.cube.history.record(i),e.cube.check_show()}),a.register_cancel(()=>{e.cube.attrs.width=c,e.cube.attrs.height=d})}),si(()=>{a?.off()}),(e,o)=>(Nr(),Ir("div",{class:"cube-submap",id:e.cube.id,style:me(e.cube.css),"data-type":Zt(n).submap,ref_key:"box",ref:i,onClick:l},[(Nr(),Ir("svg",{ref_key:"svg",ref:r},[Hr("g",{transform:e.cube.matrix2d_dom_string},[Hr("g",{"data-group":Zt(u).markers,class:"group-defs"},[...o[0]||(o[0]=[Wr('<defs data-v-ec1a4c54>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-ec1a4c54><path d="M 0 0 L 6 3 L 0 6 z" data-v-ec1a4c54></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-ec1a4c54><circle cx="3" cy="3" r="3" data-v-ec1a4c54></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-ec1a4c54><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-ec1a4c54></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-ec1a4c54><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-ec1a4c54></rect></marker></defs>',1)])],8,Nd),Hr("g",{"data-group":Zt(u).linkers,class:"group-linkers"},[(Nr(!0),Ir(Cr,null,_i(e.cube.get_linkers_view(),e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Od),Hr("g",{"data-group":Zt(u).nodes,class:"group-nodes"},[(Nr(!0),Ir(Cr,null,_i(e.cube.get_nodes_view(),e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Rd),Hr("g",{"data-group":Zt(u).placeholder,class:"group-placeholder"},[Zt(t).box_selector?(Nr(),Ir("path",{key:0,class:"placeholder-box-selector",d:Zt(t).box_selector},null,8,Ed)):Yr("v-if",!0),(Nr(!0),Ir(Cr,null,_i(Zt(t).linker,e=>(Nr(),Ir(Cr,null,[e?(Nr(),Ir("path",{key:0,class:"placeholder-linker",d:e.path,style:me({stroke:e.stroke,"stroke-width":e.width}),"marker-start":`url(#${e.anchor_start})`,"marker-end":`url(#${e.anchor_end})`},null,12,Id)):Yr("v-if",!0)],64))),256)),Zt(t).line_delete?(Nr(),Ir("path",{key:1,class:"placeholder-line-delete",d:Zt(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Dd)):Yr("v-if",!0),Yr(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),$r(Uc,{interaction:e.cube.interaction},null,8,["interaction"])],8,Ld)],8,Pd)],512)),$r(Ad,{cube:e.cube},null,8,["cube"]),Hr("div",{class:"submap-dragger",ref_key:"dragger",ref:s},null,512)],12,Td))}}),jd=(0,Js.A)(Bd,[["__scopeId","data-v-ec1a4c54"]]);class qd{_row;_col;_nodes=new Set;constructor(e,t){this._row=e,this._col=t}get pos(){return{row:this._row,col:this._col}}get row(){return this._row}get col(){return this._col}get nodes(){return new Set(this._nodes)}add_node(e){this._nodes.add(e)}remove_node(e){this._nodes.delete(e)}}class Fd{_map;_nodes=new Map;_grider=[];_grid_width;_grid_height;constructor(e){this._map=e,this._grid_width=window.innerWidth,this._grid_height=window.innerHeight}get map(){return this._map}get grid_size(){return{width:this._grid_width,height:this._grid_height}}update_nodes(e){for(let t of e)this.update_node(t)}update_node(e){const t=this.get_node_griders(e),n=e.id;if(this._nodes.has(n)){this._nodes.get(n).forEach(t=>t.remove_node(e))}const i=[];t.forEach(e=>{const t=e.row,n=e.col;if(this._grider[t]||(this._grider[t]=[]),!this._grider[t][n]){const e=new qd(t,n);this._grider[t][n]=e}i.push(this._grider[t][n])}),this._nodes.set(n,i),i.forEach(t=>t.add_node(e))}remove_node(e){const t=e.id;if(this._nodes.has(t)){this._nodes.get(t).forEach(t=>t.remove_node(e)),this._nodes.delete(t)}}get_node_griders(e){const t=[],n=e.bound.rect,i=Math.floor(n.y/this._grid_height),r=Math.floor((n.y+n.height)/this._grid_height),o=Math.floor(n.x/this._grid_width),s=Math.floor((n.x+n.width)/this._grid_width);for(let e=i;e<=r;e++)for(let n=o;n<=s;n++)t.push({row:e,col:n});return t}get_viewport_griders(){const e=this._map.get_view_rect(),t=[],n=Math.floor(e.y/this._grid_height),i=Math.floor((e.y+e.height)/this._grid_height),r=Math.floor(e.x/this._grid_width),o=Math.floor((e.x+e.width)/this._grid_width);for(let e=n;e<=i;e++)for(let n=r;n<=o;n++)this._grider[e]&&this._grider[e][n]&&t.push(this._grider[e][n]);return t}get_intersection_griders(e){const t=[],n=Math.floor(e.y/this._grid_height),i=Math.floor((e.y+e.height)/this._grid_height),r=Math.floor(e.x/this._grid_width),o=Math.floor((e.x+e.width)/this._grid_width);for(let e=n;e<=i;e++)for(let n=r;n<=o;n++)this._grider[e]&&this._grider[e][n]&&t.push(this._grider[e][n]);return t}get_intersection_nodes(e){const t=new Set,n=this.get_intersection_griders(e),i=this.grid_size;for(let r of n){const n={x:r.col*i.width,y:r.row*i.height,width:i.width,height:i.height};if(Io.MathRect.is_include(e,n))for(let e of r.nodes)t.add(e);else for(let n of r.nodes)Io.MathRect.check_intersection(e,n.bound.rect)&&t.add(n)}return t}}function Hd(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class $d extends cs{_interaction;_has_layout=!1;_display_success=!1;_grider=new Fd(this);data;nodes_test=Bt({});matrix2d=Dt(ko.get_default());nodes=Bt({});node_from=Dt({});node_to=Dt({});node_editing=Bt(new Set);linkers=Bt({});nodes_selected=Bt(new Set);line_delete_selected=Bt(new Set);view_nodes=Bt(new Set);view_linkers=Bt(new Set);_view_rect=Dt({x:0,y:0,width:0,height:0});placeholder=Dt({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new Cd(this),this.setup(e,t)}get grider(){return this._grider}get nodes_count(){return Object.keys(this.nodes).length}get linkers_count(){return Object.keys(this.linkers).length}get css(){return{...super.css,width:this.attrs.width+"px",height:this.attrs.height+"px"}}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get view_rect(){return{...this._view_rect}}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get matrix2d_dom_string(){return ko.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return $d.meta}get component(){return jd}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_svg_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),o={x:i,y:Math.max(0,n.top)},s={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(o),l=this.view_point_to_real(s),c=l.x-a.x,d=l.y-a.y,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[],n=this.grider.get_intersection_nodes(e);t.push(...n);for(let e of n)t.push(...e.linkers_from),t.push(...e.linkers_to);return t}check_node_visible(e){return this.view_nodes.has(e)}find_layout_root(e){const t=new Set;for(let n of e){const e=n.env.layout_root;e&&t.add(e)}return t}wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}find_cube(e){const t=this.linkers[e];if(t)return t;for(let t of Object.values(this.nodes)){const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof hs?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof Gd&&(this.linkers[t.id]=t,this.view_linkers.add(t))}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const i=n.bound.rect;Io.MathRect.check_intersection(e,i)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof hs?this.view_nodes.add(e):e instanceof Gd&&this.view_linkers.add(e):e instanceof hs?this.view_nodes.delete(e):e instanceof Gd&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof hs?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Gd&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===P.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const o=t.bound.rect;if(o.x>n.x||o.y+o.height<n.y||o.y>n.y+n.height)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let o=t.bound.rect;if(o.x+o.width<n.x+n.width||o.y+o.height<n.y||o.y>n.y+n.height)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let o=t.bound.rect;if(o.y>n.y||o.x>n.x+n.width||o.x+o.width<n.x)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let o=t.bound.rect;if(o.y+o.height<n.y+n.height||o.x>n.x+n.width||o.x+o.width<n.x)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}return i}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}check_show(){this.check_show_node(),this.check_show_line()}check_show_node(){const e=this._grider.get_viewport_griders();this.view_nodes.clear();for(let t of e)for(let e of t.nodes)e.env.folded_upstream||this.view_nodes.add(e)}check_show_line(){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}layout(){for(let e of Object.values(this.nodes))e.is_layout_root&&e.attrs.layout&&e.layout()}layout_throttle=Io.Notice.throttle(this.layout.bind(this),10);check_show_throttle=Io.Notice.throttle(this.check_show.bind(this),10);env_flow(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow()}check_in_view(e){const{innerHeight:t,innerWidth:n}=window;return!(e.y>t||e.y+e.height<0)&&!(e.x>n||e.x+e.width<0)}async build_child(e){const{nodes:t,linkers:n}=e.info,i=To.build_cubes(t,this);for(let e of i)this.nodes[e.id]=e,this.view_nodes=Bt(new Set(i));await this.wait_nodes_render(i),this.env_flow(),await this.layout(),this._has_layout=!0;for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const i=new Gd(e,this);this.linkers[i.id]=i}}update_data(e,t){return $d.update_data(e,t)}export(){const e=$d.get_default();e.id=this.id,e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:structuredClone(Vt(this.node_from)),node_to:structuredClone(Vt(this.node_to))};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),this.grider.remove_node(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,o=i.get_recorder();o.add_cmd(e);const s=To.build_cubes(t,this);this.pick(...s);const a=t.map(e=>e.id);return o.add_recover(qo.node_remove(this.id,a)),Promise.resolve().then(async()=>{const e=s.map(e=>e.wait_layout_self());await Promise.all(e);const t=new Set;for(let e of s){const n=So.find_line_to_layout_root(e);n.has_root&&n.line[1]&&t.add(n.line[1])}for(let e of t)e.env.flow(),e.bound.flow("self"),e.bound.flow("upstream")}),o}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const o=n.get_recorder();o.add_cmd(e);const s=[],a=new Set,l=new Set,c=new Set;for(let e of t){const t=this.get_node(e);if(t){a.add(t);for(let e of t.env.downstream_nodes)a.add(e)}}for(let e of a){for(const t of e.linkers_from)c.add(t.id);for(const t of e.linkers_to)c.add(t.id)}for(let e of a){s.push(e.export());const t=e.env.layout_root;t&&t!==e&&l.add(e.env.layout_root),this.remove_node(e)}return o.tell(this,qo.linker_remove(this.id,[...c])),o.add_recover(qo.node_add(this.id,s)),o}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,o=n.get_recorder();if(0===t.length)return;o.add_cmd(e);let s=Promise.resolve();const a=[],l=new Set,c=[];for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new Gd(i,this),o=r.from_node,s=r.to_node;if(!o||!s)continue;this.pick(r);let d=this.node_from[r.to_id],u=this.node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this.node_from[r.to_id]=[r.from_id],u?u.indexOf(r.to_id)<0&&u.splice(t,0,r.to_id):this.node_to[r.from_id]=[r.to_id],c.unshift(r.id),!s.env.is_captive){const{has_root:e,line:t}=So.find_line_to_layout_root(s);a.push(s.wait_layout_self()),t[1]&&l.add(t[1])}}const d=new Set;for(let e of l){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return o.add_recover(qo.linker_remove(this.id,c)),s.then(async()=>{await Promise.all(a);for(let e of d)e.layout_throttle()}),o}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const o=n.get_recorder();o.add_cmd(e);const s=[],a=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&a.push(n);const i=this.node_to[t.from_id],r=this.node_from[t.to_id];if(i&&r){const e=i.indexOf(t.to_id),n=r.indexOf(t.from_id);i.splice(e,1),r.splice(n,1),s.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const l=this.find_layout_root(a);for(let e of l)e.layout_throttle();return o.add_recover(qo.linker_add(this.id,s)),o}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return $d.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e)}translate(e,t){const n=ko.multiply(this.matrix2d,ko.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,o=this.matrix2d.a+t;if(o>i||o<r)return;const s=this.view_point_to_fig(e),a=this.untransform_point(s);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=ko.multiply(this.matrix2d,ko.get_matrix_translate(s.x-l.x,s.y-l.y));this.reset_matrix(c)}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:o}=e;return{x:(r-t.x)/n,y:(o-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:o,f:s}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+o,y:n*a+r*l+s}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:o,f:s}=this.matrix2d,{x:a,y:l}=e;return{x:(a-o-i*l)/t,y:(l-s-n*a)/r}}static get meta(){return{type:n.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:To.get_id(),type:n.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,To.replace_id(e,e.cube_versions,t.info.nodes,n),To.replace_id(e,e.cube_versions,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}Hd([Go(a.node_add)],$d.prototype,"on_node_add",null),Hd([Go(a.node_remove)],$d.prototype,"on_node_remove",null),Hd([Go(a.linker_add)],$d.prototype,"on_linker_add",null),Hd([Go(a.linker_remove)],$d.prototype,"on_linker_remove",null);class Gd extends ds{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=Bt([]);_path=wo(()=>this.layout_self());constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=wo(()=>this.pcube.get_node(this.from_id));_to_node=wo(()=>this.pcube.get_node(this.to_id));get css(){return{...super.css,stroke:this.line_stroke,"stroke-width":this.line_width}}get line_type(){return this.attrs.type||this.from_node?.env.node_line_type||"bezier2"}get line_stroke(){return this.attrs.stroke||this.from_node?.env.node_fill}get line_width(){return this.attrs.stroke_width||this.from_node?.env.node_line_width||2}get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}get info(){return this.data.info}get anchor_left(){return this.from_node?.attrs.anchor_out||x.point}get anchor_right(){return this.to_node?.attrs.anchor_in||x.arrow}get point_from(){return{...this._point_from}}get point_to(){return{...this._point_to}}get rect(){return{x:Math.min(this._point_from.x,this._point_to.x),y:Math.min(this._point_from.y,this._point_to.y),width:Math.abs(this._point_from.x-this._point_to.x),height:Math.abs(this._point_from.y-this._point_to.y)}}get component(){return Gc}get from_id(){return this.attrs.from}get to_id(){return this.attrs.to}get from_node(){return this._from_node.value}get to_node(){return this._to_node.value}get meta(){return Gd.meta}get domain(){return"map"}get id(){return So.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}export(){const e=this.base_export();return e.attrs.from=this.from_id,e.attrs.to=this.to_id,e}build_child(e){}update_data(e,t){return Gd.update_data(e,t)}replace_id(e,t={}){return Gd.replace_id(this.root,e,t)}layout_self(){const e=this.from_node,t=this.to_node;if(!e||!t)return"";const n=this.line_type,i=hd.find(e,t);if(i){this._point_from=i.from,this._point_to=i.to;const e=ud.draw({type:n,...i});return this.sample=So.svg_path_sample(e,8),e}return""}get_linker_info(){const e=this.from_node,t=this.to_node;if(!e||!t)return;const n=this.pcube.get_node_to(e.id),i=this.pcube.get_node_from(t.id),r=n?.indexOf(t.id)||-1,o=i?.indexOf(e.id)||-1;return{linker:this.export(),index_from:o,index_to:r}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof $d||t instanceof dd)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}check_show(){return this.from_node?.show||this.to_node?.show?(this.show=!0,!0):(this.show=!1,!1)}on_linker_update(e){const{courier:t,history:n}=this,{attrs:i}=e,r=t.get_recorder();r.add_cmd(e);const o=structuredClone(Vt(this.data.attrs));Object.assign(this.attrs,i);const s=pd.update(this.id,o);return r.add_recover(s),r}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(Io._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(Io._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?ud.line(e,t):"bezier2"===n?ud.bezier2(e,t):ud.line(e,t):""}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t.attrs.from=n[t.attrs.from]||t.attrs.from,t.attrs.to=n[t.attrs.to]||t.attrs.to,t}static get meta(){return{cubename:"连接线",type:n.linker,block:!1,version:1,show:!1}}static get_default(e,t,i){return{id:So.get_linker_id(e,t),type:n.linker,info:{},attrs:{from:e,to:t},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([Go(k.update)],Gd.prototype,"on_linker_update",null);class Vd{_observer;_nodes={};constructor(){this._observer=new ResizeObserver(this.watch.bind(this))}watch(e,t){for(let t of e){const e=t.target,n=t.target.dataset.id,i=this._nodes[n];i&&e.isConnected&&i.layout_self(t)}}register(e,t){const n=e.dataset.id;n&&(this._nodes[n]=t,this._observer.observe(e))}unregister(e){const t=e.dataset.id;t&&(delete this._nodes[t],e&&this._observer.unobserve(e))}}const Ud=new Vd;class Wd{static check_allow(e,t,n=!0){if(e?.is_layout_root&&!e.attrs.root||!e?.env.layout_root||n&&!t)return!0;const i=e.env.layout_type;return"right"===i?this.right.includes(t):"left"===i?this.left.includes(t):"up"===i?this.up.includes(t):"down"===i?this.down.includes(t):"time-right"===i?this.time_right.includes(t):"time-down"!==i||this.time_down.includes(t)}static get left(){return["left","time-down"]}static get right(){return["right","time-down","time-right"]}static get up(){return["up","left","right","time-right"]}static get down(){return["down","left","right","time-right","time-down"]}static get time_right(){return["time-down","down","up"]}static get time_down(){return["time-right","left","right"]}static get_layout_icons(e){if(!e)return[];return{right:["iconfont","icon-right"],left:["iconfont","icon-left"],up:["iconfont","icon-up"],down:["iconfont","icon-down"],"time-down":["iconfont","icon-time-down"],"time-right":["iconfont","icon-time-right"]}[e]||[]}static get_layout_detail(e){return[{type:null,name:"无布局",icon:["iconfont","icon-close"],usable:this.check_allow(e,null)},{type:"right",name:"向右逻辑图",icon:["iconfont","icon-right"],usable:this.check_allow(e,"right")},{type:"left",name:"向左逻辑图",icon:["iconfont","icon-left"],usable:this.check_allow(e,"left")},{type:"up",name:"向上逻辑图",icon:["iconfont","icon-up"],usable:this.check_allow(e,"up")},{type:"down",name:"向下逻辑图",icon:["iconfont","icon-down"],usable:this.check_allow(e,"down")},{type:"time-right",name:"时间向右逻辑图",icon:["iconfont","icon-time-right"],usable:this.check_allow(e,"time-right")},{type:"time-down",name:"时间向下逻辑图",icon:["iconfont","icon-time-down"],usable:this.check_allow(e,"time-down")}]}}const Yd=["id","data-type","transform","data-editing"],Xd=["d"],Kd=["x","y","width","height"],Jd=["data-id"],Qd={class:"node-status"},Zd=Bn({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:i}=e.cube,r=Kt();ni(()=>{const t=r.value;t&&Ud.register(t,e.cube)}),oi(()=>{const e=r.value;e&&Ud.unregister(e)});const o=wo(()=>({"node-selected":e.cube.pcube.is_node_selected(e.cube),"node-editable":e.cube.editable,"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}));function s(){const{courier:t,history:n}=e.cube,i=t.get_recorder(),r=jo.layout_change(e.cube.id,{root:!1});i.tell(e.cube,r),n.record(i)}function a(t=!0){const{courier:n,history:i}=e.cube,r=n.get_recorder(),o=jo.layout_change(e.cube.id,{fold:t});r.tell(e.cube,o),i.record(r)}const l=wo(()=>e.cube.css),c=wo(()=>{const e=l.value.fill;return{"--fill":e,"--color":function(e,t="#FFFFFF",n=158){if(!e)return"";const i=Vs(e),{r,g:o,b:s,a}=i;if(1===a)return(299*r+587*o+114*s)/1e3>n?"#000000":"#FFFFFF";if(0===a){const e=Vs(t);return(299*e.r+587*e.g+114*e.b)/1e3>n?"#000000":"#FFFFFF"}const l=Vs(t);return(299*Math.round(r*a+l.r*(1-a))+587*Math.round(o*a+l.g*(1-a))+114*Math.round(s*a+l.b*(1-a)))/1e3>n?"#000000":"#FFFFFF"}(e,Fs.bg)}});return(d,u)=>(Nr(),Ir("g",{id:d.cube.id,"data-type":Zt(n).node,class:ve(["cube-node",o.value]),transform:d.cube.matrix2d_dom_string,"data-editing":d.cube.editable,style:me(c.value)},[Hr("path",{d:Zt(i).path,ref:"p"},null,8,Xd),(Nr(),Ir("foreignObject",{x:Zt(t).pos_cbox.x,y:Zt(t).pos_cbox.y,width:Zt(t).size.width,height:Zt(t).size.height,style:me(l.value)},[Hr("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":d.cube.id},[(Nr(!0),Ir(Cr,null,_i(d.cube.children,e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128)),Yr(" node statusbar "),Hr("div",Qd,[d.cube.is_layout_root?(Nr(),Ir("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:s})):Yr("v-if",!0),d.cube.attrs.layout?(Nr(),Ir("div",{key:1,class:ve(Zt(Wd).get_layout_icons(d.cube.env.layout_type)),onClick:u[0]||(u[0]=t=>{return n=t,void e.cube.float.float_node_layout.show(n,e.cube);var n})},null,2)):Yr("v-if",!0),d.cube.env.upstream&&d.cube.env.downstream.length>0?(Nr(),Ir(Cr,{key:2},[d.cube.attrs.fold?(Nr(),Ir("div",{key:0,class:"status-fold",onClick:u[1]||(u[1]=e=>a(!1))},Ce(d.cube.env.downstream_nodes.length),1)):(Nr(),Ir("div",{key:1,class:"iconfont icon-minussquare",onClick:u[2]||(u[2]=e=>a(!0))}))],64)):Yr("v-if",!0)])],8,Jd)],12,Kd))],14,Yd))}}),eu=(0,Js.A)(Zd,[["__scopeId","data-v-3eab78fd"]]);class tu extends hs{constructor(e,t){super(e,t);return this.setup(e,t)}get domain(){return"map"}get meta(){return tu.meta}get component(){return eu}build_child(e){this._children.push(...To.build_cubes(e.info,this))}update_data(e,t){return tu.update_data(e,t)}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone(Vt(this.attrs)),e.attrs.matrix2d=this.matrix2d_real;for(let t of this._children)e.info.push(t.export());return e}replace_id(e,t={}){return tu.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:n.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,To.replace_id(e,e.cube_versions,t.info,n),t}static get_default(e,t="rect"){return{id:To.get_id(),type:n.node,info:[Za.get_default()],attrs:{root:!1,matrix2d:{a:1,b:0,c:0,d:1,e:e.x,f:e.y},shape:t,layout:null},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}a(e=!0,t="right",n=!1){const{courier:i}=this,r=i.get_recorder(),o=jo.layout_change(this.id,{root:e,layout:t,fold:n});r.tell(this,o),this.history.record(r),this.env.layout_root?.layout()}}class nu{bound;constructor(e){this.bound=e}get env(){return this.bound.env}get_pos(){const e=this.bound.node.env.layout_type;return"right"===e?this.pos_right():"left"===e?this.pos_left():"down"===e?this.pos_down():"up"===e?this.pos_up():"time-right"===e?this.pos_time_right():"time-down"===e?this.pos_time_down():void 0}get_size_tree(){const e=this.bound.node,t=e.env.downstream_visible,n=e.env.layout_type,i=this.bound.size_bound;return 0===t.length?{...i}:"left"===n?this.size_tree_left(t):"right"===n?this.size_tree_right(t):"down"===n?this.size_tree_down(t):"up"===n?this.size_tree_up(t):"time-right"===n?this.size_tree_time_right(t):"time-down"===n?this.size_tree_time_down(t):void 0}get_root_pos_tree(){return Do.layout_tree(this.bound.node)}pos_left(){const e=this.bound,t={x:0,y:0},n=e.pos_tree,i=e.size_bound,r=e.size_tree;return t.x=n.x+r.width-i.width,t.y=n.y+r.height/2-i.height/2,t}pos_right(){const e=this.bound,t={x:0,y:0},n=e.pos_tree,i=e.size_bound,r=e.size_tree;return t.x=n.x,t.y=n.y-i.height/2+r.height/2,t}pos_up(){const e=this.bound,t={x:0,y:0},n=e.pos_tree,i=e.size_bound,r=e.size_tree;return t.x=n.x+r.width/2-i.width/2,t.y=n.y+r.height-i.height,t}pos_down(){const e=this.bound,t={x:0,y:0},n=e.pos_tree,i=e.size_bound,r=e.size_tree;return t.x=n.x+r.width/2-i.width/2,t.y=n.y,t}pos_time_right(){const e=this.bound,t={x:0,y:0},n=e.pos_tree;t.x=n.x;const i=e.node.env.downstream;if(0===i.length)return n;const r=e.size_bound.height/2;let o=r;for(let e of i){let t=e.bound.size_tree,n=e.bound.size_bound.height/2;if("up"===e.env.layout_type){let e=t.height-n;e>o&&(o=e)}else{n>o&&(o=n)}}return t.y=n.y+o-r,t}pos_time_down(){const e=this.bound,t=e.pos_tree,n=e.node.env.downstream;if(0===n.length)return t;const i={x:0,y:0};i.y=t.y;const r=e.size_bound.width/2;let o=r;for(let e of n){let t=e.bound.size_tree,n=e.bound.size_bound.width/2;if("left"===e.env.layout_type){let e=t.width-n;e>o&&(o=e)}else{n>o&&(o=n)}}return i.x=t.x+o-r,i}size_tree_left(e){const t=this.bound,n={width:0,height:0},i=this.env.node_gap_x,r=this.env.node_gap_y,o=t.size_bound;let s=0,a={width:0,height:0},l=0,c={width:0,height:0},d=0;for(let t of e){let e=t.bound.size_tree,n=t.bound.size_bound;d+=e.height,e.width>s&&(s=e.width,a=n),e.height>l&&(l=e.height,c=n)}return n.width=o.width+i+s,n.height=Math.max(o.height,d+(e.length-1)*r),n}size_tree_right(e){const t={width:0,height:0},n=this.env.node_gap_x,i=this.env.node_gap_y,r=this.bound.size_bound;let o=0,s=0,a=0;for(let t of e){let e=t.bound.size_tree;t.bound.size_bound;a+=e.height,e.width>o&&(o=e.width),e.height>s&&(s=e.height)}return t.width=r.width+n+o,t.height=Math.max(r.height,a+(e.length-1)*i),t}size_tree_down(e){const t={width:0,height:0},n=this.env.node_gap_x,i=this.env.node_gap_y,r=this.bound.size_bound;let o=0,s={width:0,height:0},a=0,l={width:0,height:0},c=0;for(let t of e){let e=t.bound.size_tree,n=t.bound.size_bound;c+=e.width,e.width>o&&(o=e.width,s=n),e.height>a&&(a=e.height,l=n)}return t.width=Math.max(r.width,c+(e.length-1)*n),t.height=r.height+i+a,t}size_tree_up(e){const t={width:0,height:0},n=this.env.node_gap_x,i=this.env.node_gap_y,r=this.bound.size_bound;let o=0,s={width:0,height:0},a=0,l={width:0,height:0},c=0;for(let t of e){let e=t.bound.size_tree,n=t.bound.size_bound;c+=e.width,e.width>o&&(o=e.width,s=n),e.height>a&&(a=e.height,l=n)}return t.width=Math.max(r.width,c+(e.length-1)*n),t.height=r.height+i+a,t}size_tree_time_right(e){const t={width:0,height:0},n=this.env.node_gap_x,i=(this.env.node_gap_y,this.bound.size_bound);let r=i.height/2,o=0,s=r,a=r;for(let t of e){let e=t.bound.size_tree,n=t.bound.size_bound.height/2,i=t.env.layout_type;if(o+=e.width,n>s&&(s=n),n>a&&(a=n),"up"===i){let t=e.height-n;t>s&&(s=t)}else{let t=e.height-n;t>a&&(a=t)}}return t.width=i.width+o+e.length*n,t.height=s+a,t}size_tree_time_down(e){const t={width:0,height:0},n=(this.env.node_gap_x,this.env.node_gap_y),i=this.bound.size_bound;let r=i.width/2,o=0,s=r,a=r;for(let t of e){let e=t.bound.size_tree,n=t.bound.size_bound.width/2,i=t.env.layout_type;if(o+=e.height,n>s&&(s=n),n>a&&(a=n),"left"===i){let t=e.width-n;t>s&&(s=t)}else{let t=e.width-n;t>a&&(a=t)}}return t.width=s+a,t.height=i.height+o+e.length*n,t}}class iu{_meter=new nu(this);_node;_size=Dt(hs.get_default_node_size());_size_bound=Dt(hs.get_default_node_size());_size_tree=Dt(hs.get_default_node_size());_pos_cbox=Dt({x:ns.default_config.map_node_padding,y:ns.default_config.map_node_padding});_pos;_layout_pos_tree;constructor(e,t){this._node=e,this._pos=Dt({x:t.e,y:t.f}),this._layout_pos_tree={x:t.e,y:t.f}}get meter(){return this._meter}get config(){return this.node.config}get node(){return this._node}get env(){return this.node.env}get pcube(){return this.node.pcube}get matrix2d(){return{...this._node.attrs.matrix2d}}get rect(){return{...this._pos,...this._size_bound}}get size(){return{...this._size}}get size_tree(){return{...this._size_tree}}get size_bound(){return this._size_bound}get pos(){return{...this._pos}}get pos_raw(){return{x:this.matrix2d.e,y:this.matrix2d.f}}get pos_center(){return this.get_pos_center()}get pos_cbox(){return{...this._pos_cbox}}get pos_tree(){return{...this._layout_pos_tree}}sync_pos(){this._node.attrs.matrix2d.e=this._pos.x,this._node.attrs.matrix2d.f=this._pos.y}update_pos_cbox(){const e=this.node.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:i}=this.node.config.data,r=t/2,o=n/2;"circle"===e?(this._pos_cbox.x=r-this.size.width/2,this._pos_cbox.y=o-this.size.height/2):(this._pos_cbox.x=i,this._pos_cbox.y=i)}update_pos(){if(!this.env.is_captive||this.env.folded_self){const e=this._node.attrs.matrix2d.e,t=this._node.attrs.matrix2d.f;this._pos.x=e,this._pos.y=t}else if(this.env.has_layout_ability){const e=this.meter.get_pos();e&&Object.assign(this._pos,e)}}get_pos_center(){const e=this.pos,{width:t,height:n}=this.size_bound;return{x:e.x+t/2,y:e.y+n/2}}update_pos_tree_root(){if(!this.node.is_layout_root)return;const e=this.node.env.layout_type,t=this.matrix2d.e,n=this.matrix2d.f;if(!e||this.node.attrs.fold)this._layout_pos_tree.x=t,this._layout_pos_tree.y=n;else{const e=this.meter.get_root_pos_tree();e&&Object.assign(this._layout_pos_tree,e)}}update_pos_tree(e,t,n=!0){this._layout_pos_tree.x=e,this._layout_pos_tree.y=t,n&&this.update_pos()}update_size(e,t){this._size.width=e,this._size.height=t,this.update_size_bound(),this.update_pos_cbox(),this.pcube.has_layout&&Promise.resolve().then(async()=>{if(this.flow("upstream"),this.pcube.has_layout&&!this.node.clipboard.pasting){const e=this.node.env.layout_root;e&&e.layout_throttle()}})}update_size_bound(){const{map_node_padding:e}=this.node.config.data;this._size_bound.width=this.size.width+2*e,this._size_bound.height=this.size.height+2*e}update_size_tree(){const e=this.meter.get_size_tree();e&&Object.assign(this._size_tree,e)}flow(e="downstream"){const t=this.env.downstream_visible;if(0===t.length&&Object.assign(this._size_tree,this.size_bound),"downstream"===e){for(let e of t)e.bound.flow();this.update_size_tree()}else if("upstream"===e){this.update_size_tree();const t=this.env.upstream;t?.is_layout_root?t.bound.flow("self"):t?.bound.flow(e)}else"self"===e&&this.update_size_tree()}get_bound_rect_point(e){const t={...this.pos,...this.size_bound};return Io.MathRect.get_rect_point(t,e)}}class ru{static get_shaple(e,t=8){const n=e.attrs.shape;return"rect"===n?this.rect(e,t):"circle"===n?this.circle(e,t):this.rect(e)}static rect(e,t=8,n=8){const{width:i,height:r}=e.bound.size,o=0,s=0,a=i+2*t,l=0,c=i+2*t,d=r+2*t,u=0,h=r+2*t;return`M${o+n} ${s}H${a-n}Q${a} ${l} ${a} ${l+n}V${d-n}Q${c} ${d} ${c-n} ${d}H ${u+n}Q${u} ${h} ${u} ${h-n}V${s+n}Q${o} ${s} ${o+n} ${s}Z`}static circle(e,t=8){const{width:n,height:i}=e.bound.size,r=Math.sqrt(n*n+i*i)/2,o=0;return`M${r} ${o} A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} ${o}`}}function ou(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class su extends ls{_app;_interaction;_has_layout=Kt(!1);_grider=new Fd(this);data;nodes_test=Bt({});nodes=Bt({});node_from=Dt({});node_to=Dt({});node_editing=Bt(new Set);linkers=Bt({});nodes_selected=Bt(new Set);line_delete_selected=Bt(new Set);view_nodes=Bt(new Set);view_linkers=Bt(new Set);_view_rect=Dt({x:0,y:0,width:0,height:0});placeholder=Dt({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e.versions[this.meta.type],e).data;this.data=Dt(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new Cd(this),this.build_child(t),$o.init_cmd_handler(this),Ao.add_map(this),this._app=$l(dd,{cube:this}),this.stats.view="map"}get grider(){return this._grider}get matrix2d(){return this.attrs.matrix2d}get nodes_count(){return Object.keys(this.nodes).length}get linkers_count(){return Object.keys(this.linkers).length}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout.value}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get interaction(){return this._interaction}get matrix2d_dom_string(){return ko.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return dd}get meta(){return su.meta}get children(){return[...this._children]}get view_rect(){return{...this._view_rect}}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),o={x:i,y:Math.max(0,n.top)},s={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(o),l=this.view_point_to_real(s),c=l.x-a.x,d=l.y-a.y,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}get_view_center(){const e=this.view_rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[],n=this.grider.get_intersection_nodes(e);t.push(...n);for(let e of n)t.push(...e.linkers_from),t.push(...e.linkers_to);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.env.layout_root;e&&t.add(e)}return t}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===P.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,i=e?.bound.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const o=t.bound.rect;if(o.x>n.x||o.y+o.height<n.y||o.y>n.y+n.height)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let o=t.bound.rect;if(o.x+o.width<n.x+n.width||o.y+o.height<n.y||o.y>n.y+n.height)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let o=t.bound.rect;if(o.y>n.y||o.x>n.x+n.width||o.x+o.width<n.x)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let o=t.bound.rect;if(o.y+o.height<n.y+n.height||o.x>n.x+n.width||o.x+o.width<n.x)continue;const s=Io.MathRect.distance_with(n,o);s<r&&(i=t,r=s)}return i}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}wait_nodes_render(e){return So.wait_nodes_render(e)}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof hs?(this.nodes[t.id]=Ut(t),this.view_nodes.add(t)):t instanceof Gd&&(this.linkers[t.id]=Ut(t),this.view_linkers.add(t))}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){const t=this.grider.get_intersection_nodes(e);return Array.from(t)}set_graph_visible(e,t){t?e instanceof hs?this.view_nodes.add(e):e instanceof Gd&&this.view_linkers.add(e):e instanceof hs?this.view_nodes.delete(e):e instanceof Gd&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof hs?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Gd&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}check_node_visible(e){return this.view_nodes.has(e)}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),this.grider.remove_node(e),e.gc()}remove_linker(e){const t=this.node_to[e.from_id],n=this.node_from[e.to_id];let i;if(t&&n){const r=t.indexOf(e.to_id),o=n.indexOf(e.from_id);t.splice(r,1),n.splice(o,1),i={linker:e.export(),index_to:r,index_from:o}}return delete this.linkers[e.id],this.view_linkers.delete(e),e.gc(),i}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const i=[];for(let e of t){let t=new tu(e,this);i.push(t),this.nodes[t.id]=Ut(t),this.view_nodes.add(t)}console.timeEnd("🍋build-nodes");for(let e of n){const{from:t,to:n}=e.attrs,i=this.get_node(e.attrs.from),r=this.get_node(e.attrs.to);if(!i||!r){const e=this.node_to[t],i=e.indexOf(n);e.splice(i,0);const r=this.node_from[n],o=r.indexOf(t);r.splice(o,1);continue}const o=new Gd(e,this);this.linkers[o.id]=Ut(o)}this.init_env()}init_env(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow("downstream")}init_boundbox(){console.time("🍋wait-size-tree");const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.bound.flow();console.timeEnd("🍋wait-size-tree")}init_grider(){const e=Date.now(),t=Object.values(this.nodes);this._grider.update_nodes(t),console.log("🍋init-grider:",Date.now()-e)}async layout(){console.time("🍋layout-nodes");const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.layout();console.timeEnd("🍋layout-nodes")}check_show(){console.time("🍋动态显示检查"),this.check_show_node(),this.check_show_line(),console.timeEnd("🍋动态显示检查")}check_show_node(){const e=this._grider.get_viewport_griders();this.view_nodes.clear();for(let t of e)for(let e of t.nodes)e.env.folded_upstream||this.view_nodes.add(e)}check_show_line(){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}layout_throttle=Io.Notice.throttle(this.layout.bind(this),10);check_show_throttle=Io.Notice.throttle(this.check_show.bind(this),10);gc(){}export(){const e=su.get_default();e.id=this.id,e.versions=Ao.export_versions(),e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:Vt(this.node_from),node_to:Vt(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}update_data(e,t){return su.update_data(e,t)}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg & nodes"),await Promise.all([Qc.ps,So.wait_nodes_render([...this.view_nodes])]),console.timeEnd("🍋wait-svg & nodes"),await To.sleep(100),this.init_boundbox(),this.init_grider(),this.check_show(),this._has_layout.value=!0;const t=this.dom?.querySelector(".note");this.event.emit_status_update(),t&&(this.hotkeys.listen(t),this.interaction.register(t))}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,o=i.get_recorder();o.add_cmd(e);const s=To.build_cubes(t,this);this.pick(...s);const a=t.map(e=>e.id);return o.add_recover(qo.node_remove(this.id,a)),Promise.resolve().then(async()=>{const e=s.map(e=>e.wait_layout_self());await Promise.all(e);const t=new Set;for(let e of s){const n=So.find_line_to_layout_root(e);n.has_root&&n.line[1]&&t.add(n.line[1])}for(let e of t)e.env.flow(),e.bound.flow("self"),e.bound.flow("upstream");this.grider.update_nodes(s)}),o}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const o=n.get_recorder();o.add_cmd(e);const s=[],a=new Set,l=new Set,c=new Set;for(let e of t){const t=this.get_node(e);if(t){a.add(t);for(let e of t.env.downstream_nodes)a.add(e)}}for(let e of a){for(const t of e.linkers_from)c.add(t.id);for(const t of e.linkers_to)c.add(t.id)}for(let e of a){s.push(e.export());const t=e.env.layout_root;t&&t!==e&&l.add(e.env.layout_root),this.remove_node(e)}return o.tell(this,qo.linker_remove(this.id,[...c])),o.add_recover(qo.node_add(this.id,s)),o}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,o=n.get_recorder();if(0===t.length)return;let s=Promise.resolve();o.add_cmd(e);const a=[],l=[],c=new Set;for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new Gd(i,this),o=r.from_node,s=r.to_node;if(!o||!s)continue;this.pick(r);let d=this.node_from[r.to_id],u=this.node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this.node_from[r.to_id]=[r.from_id],u?u.indexOf(r.to_id)<0&&u.splice(t,0,r.to_id):this.node_to[r.from_id]=[r.to_id],a.unshift(r.id),!s.env.is_captive){const{has_root:e,line:t}=So.find_line_to_layout_root(s);l.push(s.wait_layout_self()),t[1]&&c.add(t[1])}}const d=new Set;for(let e of c){e.env.flow(),e.bound.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return o.add_recover(qo.linker_remove(this.id,a)),s.then(async()=>{await Promise.all(l);for(let e of d)e.layout_throttle()}),o}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const o=n.get_recorder();o.add_cmd(e);const s=[],a=new Set,l=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,i=t.to_node;n&&a.add(n),i&&l.add(i);const r=this.remove_linker(t);r&&s.unshift(r)}if(0===s.length)return;for(let e of a)e.env.flow(),e.bound.flow("upstream");const c=new Set;for(let e of l){if(e.is_layout_root)continue;const{has_root:t,line:n}=So.find_line_to_layout_root(e);if(!t){e.env.free();continue}const i=n[1];l.has(i)||c.add(i)}for(let e of c)e.env.flow(),e.bound.flow("downstream"),e.bound.flow("upstream");const d=new Set;for(let e of[...a,...c]){const t=e.env?.layout_root;t&&d.add(t)}for(let e of d)e.layout_throttle();return o.add_recover(qo.linker_add(this.id,s)),o}on_update_attrs(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();return r.add_cmd(e),"matrix2d"in i&&i.matrix2d&&(r.add_recover(qo.update_attr(this.id,{matrix2d:{...this.matrix2d}})),this.reset_matrix(i.matrix2d)),r}get_linker_id(e,t){return So.get_linker_id(e,t)}replace_id(e,t={}){return su.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.get_view_rect(),this.event.emit_status_update()}translate(e,t){const n=ko.multiply(this.matrix2d,ko.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,o=this.matrix2d.a+t;if(o>i||o<r)return;const s=this.view_point_to_fig(e),a=this.untransform_point(s);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=s.x-l.x,d=s.y-l.y,u=ko.multiply(this.matrix2d,ko.get_matrix_translate(c,d));this.reset_matrix(u)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:o}=e;return{x:(r-t.x)/n,y:(o-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:o,f:s}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+o,y:n*a+r*l+s}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:o,f:s}=this.matrix2d,{x:a,y:l}=e;return{x:(a-o-i*l)/t,y:(l-s-n*a)/r}}static get meta(){return{type:n.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:To.get_id(),type:n.map,versions:Ao.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:ko.get_default()}}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,To.replace_id(e,e.cube_versions,t.info.nodes,n),To.replace_id(e,e.cube_versions,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}ou([Go(a.node_add)],su.prototype,"on_node_add",null),ou([Go(a.node_remove)],su.prototype,"on_node_remove",null),ou([Go(a.linker_add)],su.prototype,"on_linker_add",null),ou([Go(a.linker_remove)],su.prototype,"on_linker_remove",null),ou([Go(a.update_attrs)],su.prototype,"on_update_attrs",null);const au=["id","data-type"],lu={class:"cube-api-functions"},cu={key:0,class:"cube-api-arguments"},du={key:1,class:"cube-api-exceptions"},uu=Bn({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Ir("div",{class:"cube-api",id:e.cube.id,"data-type":Zt(n).api,style:me(e.cube.css),ref:"root",onContextmenu:t[0]||(t[0]=t=>Zt(ha)(t,e.cube))},[Hr("div",lu,[t[1]||(t[1]=Hr("div",{class:"legend"},"api",-1)),$r(Oa,{cube:e.cube.functions},null,8,["cube"])]),e.cube.arguments?(Nr(),Ir("div",cu,[t[2]||(t[2]=Hr("div",{class:"legend"},"arguments",-1)),$r(Oa,{cube:e.cube.arguments},null,8,["cube"])])):Yr("v-if",!0),e.cube.exceptions?(Nr(),Ir("div",du,[t[3]||(t[3]=Hr("div",{class:"legend"},"exceptions",-1)),$r(Oa,{cube:e.cube.exceptions},null,8,["cube"])])):Yr("v-if",!0)],44,au))}),hu=(0,Js.A)(uu,[["__scopeId","data-v-25e3bd90"]]);class pu extends cs{_functions;_arguments=Kt(void 0);_exceptions=Kt(void 0);_temp_funcnames=[];constructor(e,t){return super(e,t),this.setup(e,t)}static get type_funciton(){return{padding:"0px 4px",background:"var(--api-functions-type-bg)",color:"var(--api-functions-type-color)"}}static get type_argument(){return{padding:"0px 4px",background:"var(--api-arguments-type-bg)",color:"var(--api-arguments-type-color)"}}get functions(){return this._functions}get arguments(){return this._arguments.value}get exceptions(){return this._exceptions.value}get component(){return hu}get children(){const e=[this._functions];return this.arguments&&e.push(this.arguments),this.exceptions&&e.push(this.exceptions),e}get meta(){return pu.meta}add_arguments(){if(this.arguments)return;const e=Ru.get_default();this._arguments.value=Ut(new Ru(e,this))}add_exceptions(){if(this.exceptions)return;const e=Ru.get_default();this._exceptions.value=Ut(new Ru(e,this))}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return pu.replace_id(this.root,e,t)}build_child(e){this._functions=new Ru(e.info.functions,this),e.info.arguments&&(this._arguments.value=Ut(new Ru(e.info.arguments,this))),e.info.exceptions&&(this._exceptions.value=Ut(new Ru(e.info.exceptions,this)))}event_bubble(e){const{recorder:t,tcube:n,path:i,cmds:r}=e,o=[c.text_reset,m.remove,m.reset];i.includes(this.functions)&&r.find(e=>o.includes(e.name))&&this.parse(t);const s=r.find(e=>e.name===m.add);if(n===this.functions&&s)for(let e of s.data){const i=e.data.id,r=n.find_cube(i),o=r?.child_first_line;if(!o)continue;const s=ol.get_default("​",pu.type_funciton),a=Lo.insert_child(o.id,[s],1);t.tell(o,a)}return{stop:!1}}parse(e){const t=[];for(let e of this.functions.items){const{indent:n,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof ol);r&&t.push(r)}if(t.length===this._temp_funcnames.length){let e=!0;for(let n=0;n<t.length;n++){if(this._temp_funcnames[n]!==t[n].info){e=!1;break}}if(e)return}this._temp_funcnames=t.map(e=>e.info);const n=new Map;if(this.arguments)for(let e of this.arguments.items){const{indent:t,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof ol);r&&n.set(r.info,{item:e,text:r})}const i=new Set;for(let e of t){let t=e.data.info,n=t.indexOf("("),r=t.lastIndexOf(")");if(n>=r)continue;let o=t.slice(n+1,r).split(",").map(e=>e.trim()).filter(e=>e);for(let e of o)i.add(e)}i.size>0&&this.add_arguments();const r=[...n.values()];if(i.size===r.length){for(let[t,n]of Io.Iteration.zip([...i],r))if(t!==n.text.info.trim()){const i=il.reset(n.text.id,t);e.tell(n.text,i)}}else{const t=[];for(let e of i){const n=r.find(t=>t.text.info===e);if(n)t.push({indent:n.item.indent,data:n.item.data.export()});else{const n=Pc.get_default([ol.get_default(e),ol.get_default(" "),ol.get_default("​",pu.type_argument)]);t.push(Ru.get_list_item([n]))}}if(this.arguments){const n=Is.reset(this.arguments.id,t);e.tell(this.arguments,n)}}}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.functions=this.functions.export(),this.arguments&&(e.info.arguments=this.arguments.export()),this.exceptions&&(e.info.exceptions=this.exceptions.export()),e}reset_api(e){const{courier:t,history:n}=this,{args:i,funcs:r}=e,o=t.get_recorder();return o.add_cmd(e),o}update_data(e,t){return pu.update_data(e,t)}static get_funcitem_data(){return Pc.get_default([ol.get_default(),ol.get_default(" "),ol.get_default("​",pu.type_funciton)])}static update_data(e,t){if(e>this.meta.version)return{data:t,usable:!1};if(e<2){const e=t,i=pu.get_default(e.css,e.attrs),r=[],o=[],s=i.info.functions,a=Ru.get_default();for(let t of e.info.names.info)if(t.type===n.line){const e=t.info.find(e=>e.type===n.text);r.push({name:e,type:void 0,desc:[]})}for(let t=0;t<e.info.funcs.length;t++){const i=e.info.funcs[t],o=i.desc.info[0],s=r[t];if(s){if(o.type===n.line){const e=o,t=e.info[0];if(t&&t.type===n.text&&(s.type=t),o.info.length>1){const t=Pc.get_default(e.info.slice(1));s.desc.push(t)}}s.desc.push(...i.desc.info.slice(1))}}for(let t=0;t<e.info.args.length;t++){const i=e.info.args[t],{name:r,desc:s}=i,a=i.desc.info[0],l={name:ol.get_default(r),type:void 0,desc:[]};if(a.type===n.line){const e=a,t=e.info[0];if(t&&t.type===n.text&&(l.type=t),a.info.length>1){const t=Pc.get_default(e.info.slice(1));l.desc.push(t)}}l.desc.push(...i.desc.info.slice(1)),o.push(l)}if(r.length>0){s.info.length=0;for(let e=0;e<r.length;e++){const t=r[e],n=Pc.get_default([t.name,ol.get_default(" ")]),i=t.type||ol.get_default();Object.assign(i.css,this.type_funciton);const o=i.info.trim();o&&"​"!==o||(i.info="type"),n.info.push(i);const a=Ru.get_list_item([n,...t.desc]);s.info.push(a)}}if(o.length>0){a.info.length=0;for(let e=0;e<o.length;e++){const t=o[e],n=Pc.get_default([t.name,ol.get_default(" ")]),i=t.type||ol.get_default();Object.assign(i.css,this.type_argument);const r=i.info.trim();r&&"​"!==r||(i.info="type"),n.info.push(i);const s=Ru.get_list_item([n,...t.desc]);a.info.push(s)}i.info.arguments=a}return{data:i,usable:!0}}return{data:t,usable:!0}}static get_default(e={},t={}){const i=this.get_funcitem_data();return{id:To.get_id(),type:n.api,info:{functions:Ru.get_default([i])},css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t.info.functions=Ru.replace_id(e,t.info.functions,n),t.info.arguments&&(t.info.arguments=Ru.replace_id(e,t.info.arguments,n)),t.info.exceptions&&(t.info.exceptions=Ru.replace_id(e,t.info.exceptions,n)),t}static get meta(){return{type:n.api,version:2,cubename:"Api",block:!0,show:!0}}}!function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([Go(p.reset)],pu.prototype,"reset_api",null);class fu{static reset(e,t,n){return{id:e,name:p.reset,args:t,funcs:n}}}function mu(e,t="tail"){const{courier:n,history:i}=e,r=new Ro(n),o=[Ec.get_default(),Ec.get_default()],s=_u.insert_row(e.id,t,[o]);r.tell(e,s),i.record(r)}class _u{static insert_row(e,t,n){return{id:e,name:f.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:f.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:f.change_width_col1}}}const gu=["id","data-type"],bu=Bn({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,i=qn("root"),r=Kt();ni(()=>{const n=r.value,o=i.value;if(!n)return;const s=new Io.DragDiff(n);let a=e.cube.attrs.width_col1,l=a;s.register_down(()=>{a=e.cube.attrs.width_col1}),s.register_move((e,n)=>{t.stats.is_read_mode||(l=Math.round(e+a),o?.style.setProperty("--width-col1",l+"px"))}),s.register_up((n,i)=>{if(t.stats.is_read_mode)return;if(a===l)return;const r=e.cube.courier.get_recorder(),o=Math.round(n+a);r.tell(e.cube,_u.change_width_col1(e.cube.id,o)),e.cube.history.record(r)}),s.register_cancel(()=>{e.cube.attrs.width=a,n.style.left=a-2+"px"})});const o=wo(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,s)=>(Nr(),Ir("div",{class:"cube-detail-list",id:t.cube.id,"data-type":Zt(n).detail_list,ref_key:"root",ref:i,style:me(o.value),onContextmenu:s[1]||(s[1]=e=>Zt(ha)(e,t.cube))},[(Nr(!0),Ir(Cr,null,_i(t.cube.children,t=>(Nr(),Dr(Oa,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),mu(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),mu(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),Hr("div",{class:"adder-wrap",onClick:s[0]||(s[0]=()=>Zt(mu)(t.cube))},[...s[2]||(s[2]=[Hr("div",{class:"adder"},null,-1)])]),Hr("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,gu))}}),yu=(0,Js.A)(bu,[["__scopeId","data-v-6b68d605"]]);function vu(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class wu extends cs{rows;constructor(e,t){return super(e,t),this.rows=Bt([]),this.setup(e,t)}get component(){return yu}get children(){const e=[];for(let t of this.rows)e.push(...t);return e}get attrs(){return this.data.attrs}get css_col1(){return this.attrs.width_col1||(this.attrs.width_col1=150),{width:this.attrs.width_col1+"px"}}get is_empty(){return!1}get row_count(){return this.rows.length}get col1(){return this.rows.map(e=>e[0])}get col2(){return this.rows.map(e=>e[1])}get meta(){return wu.meta}update_data(e,t){return wu.update_data(e,t)}build_child(e){for(let t of e.info){const e=new Ec(t[0],this),n=new Ec(t[1],this);this.rows.push([e,n])}}copy(e,t){if(e===t)return[this.children[e].export()];const n=Math.floor(e/2),i=Math.floor((t-1)/2),r=wu.get_default();r.info=[];for(let e=n;e<=i;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];r.info.push(n)}return 0===r.info.length?[]:[r]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.info=[];for(let[t,n]of this.rows){const i=t.export(),r=n.export();e.info.push([i,r])}return e}replace_id(e,t={}){return wu.replace_id(this.root,e,t)}splice_rows(e,t,...n){const i=this.rows.splice(e,t,...n);for(let[e,t]of i)e.gc(),t.gc();return i}check_delete_edge(e){return 0===e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:i}=e,r=t.get_recorder();r.add_cmd(e);const o=[];for(let[e,t]of i)o.push([new Ec(e,this),new Ec(t,this)]);let s=[0,0];return"tail"===n?(s=[this.row_count,this.row_count+o.length],this.rows.push(...o)):"head"===n?(s=[0,0+o.length],this.rows.unshift(...o)):(s=[n,n+o.length],this.splice_rows(n,0,...o)),r.add_recover(_u.remove_row(this.id,s)),r}remove_row(e){const{courier:t,cursor:n}=this,{range:i,reserve:r}=e,o=new Ro(t);let[s,a]=i;if(s<0&&(s=0),a>this.row_count&&(a=this.row_count),0===s&&a>=this.row_count)if(r){if(this.is_empty)return;o.tell(this,_u.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&o.tell(t,Lo.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&o.tell(e,Lo.delete_child(e.id,"backward",[0,e.child_count],!0))}else o.merge(this.remove_self());else{const e=this.rows[s-1]?.[1],t=this.rows[a+1]?.[1],n=this.splice_rows(s,a-s),i=[];for(let[e,t]of n)i.push([e.export(),t.export()]);o.add_recover(_u.insert_row(this.id,s,i)),e?o.tell(e,Eo.in_tail(e.id)):t&&o.tell(t,Eo.in_head(t.id))}return o}change_width_col1(e){const{width:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const o=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),r.add_recover(_u.change_width_col1(i,o)),r}delete_cube(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s,reserve:a}=e,[l,c]=s,d=Math.floor(l/2),u=Math.floor((c-1)/2),h=(this.children[l],_u.remove_row(this.id,[d,u+1],a));return this.remove_row(h)}static get meta(){return{type:n.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=0===e.length?[[Ec.get_default(),Ec.get_default()]]:e;return{id:zo(),type:n.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;const o=[];for(let i of t.info)o.push([Ec.replace_id(e,i[0],n),Ec.replace_id(e,i[1],n)]);return t.info=o,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(e<2&&(t.attrs.width_col1||(t.attrs.width_col1=150)),{data:t,usable:!0})}}vu([Go(f.insert_row)],wu.prototype,"insert_row",null),vu([Go(f.remove_row)],wu.prototype,"remove_row",null),vu([Go(f.change_width_col1)],wu.prototype,"change_width_col1",null),vu([Go(i.cube_delete_child)],wu.prototype,"delete_cube",null);class xu{static reset(e,t){return{id:e,data:t,name:b.reset}}static add(e,t,n){return{id:e,name:b.add,data:t,pos:n}}static remove(e,t){return{id:e,name:b.remove,range:t}}static indent(e,t){return{id:e,name:b.indent,items:t}}static status(e,t,n){return{id:e,name:b.status,index:t,done:n}}}const ku=["id","data-type"],Su=["onClick"],Cu=Bn({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:i}=t;return(t,r)=>(Nr(),Ir("div",{class:"cube-todo",id:t.cube.id,style:me(t.cube.css),"data-type":Zt(n).todo,onContextmenu:r[0]||(r[0]=e=>Zt(ha)(e,t.cube))},[(Nr(!0),Ir(Cr,null,_i(t.cube.items,(n,r)=>(Nr(),Ir("div",{key:n.data.id,class:"todoitem",style:me({"margin-left":n.indent*Zt(i).data.line_indent+"px"})},[Hr("div",{class:ve(["todoitem-status",{active:n.done}]),onClick:()=>function(t,n){const i=xu.status(e.cube.id,n,!t.done),r=e.cube.courier.get_recorder();r.tell(e.cube,i),e.cube.history.record(r)}(n,r)},null,10,Su),$r(Oa,{class:"todoitem-box",cube:n.data,onKeydown:e=>function(e,t,n,i){const{courier:r,history:o,cursor:s}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),s=t.create_item_data(a);n.tell(t,xu.add(t.id,[s],i+1)),o.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),s=t.create_item_data(a);n.tell(t,xu.add(t.id,[s],i)),o.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=s,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const s=t.items.slice(e.index,r.index+1),l=[];for(let e of s)l.push({id:e.data.id,indent:!1});a.tell(t,xu.indent(t.id,l)),o.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,xu.indent(t.id,e)),o.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=s,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const s=t.items.slice(e.index,r.index+1),l=[];for(let e of s)l.push({id:e.data.id,indent:!0});a.tell(t,xu.indent(t.id,l)),o.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,xu.indent(t.id,e)),o.record(a)}}}(e,t.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,ku))}}),Mu=(0,Js.A)(Cu,[["__scopeId","data-v-33222767"]]);function zu(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Au extends cs{_items=Dt([]);constructor(e,t){return super(e,t),this.setup(e,t)}get items(){return[...this._items]}get component(){return Mu}get children(){return[...this._items.map(e=>e.data)]}get meta(){return Au.meta}get info(){return this.data.info}update_data(e,t){return Au.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new Ec(n.data,this),i={done:n.done,indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info=[...this.export_items()],e}export_items(){const e=[];for(let t of this._items)e.push({done:t.done,indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return Au.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Ec(n.data,this);t.push({done:n.done,indent:n.indent,data:e})}return t}create_item_data(e=0){return{done:!1,indent:e,data:Ec.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=xu.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,o=i.get_recorder();o.add_cmd(e);const s=this.get_valid_index(n),a=[];for(let e of t){const t=new Ec(e.data,this);let n={done:e.done,indent:e.indent,data:Ut(t)};a.push(n)}this.splice(s,0,...a);const l=a[a.length-1]?.data;return l&&o.tell(l,Eo.in_tail(l.id)),o.add_recover(xu.remove(this.id,[s,s+a.length])),o}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[o,s]=t;if(o<=0&&s>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[o-1]?.data,c=this._items[s+1]?.data,d=this.splice(o,a);return r.add_recover(xu.add(this.id,d.data,o)),l?r.tell(l,Eo.in_tail(l.id)):c&&r.tell(c,Eo.in_head(c.id)),r}indent_todoitem(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(xu.indent(this.id,r)),i}update_status(e){const{courier:t}=this,{index:n,done:i}=e,r=t.get_recorder();r.add_cmd(e);const o=this._items[n];if(o)return o.done=i,r.add_recover(xu.status(this.id,n,!i)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s}=e,a=xu.remove(this.id,s);return this.remove_item(a)}static get_default(){let e=Ec.get_default();return{id:zo(),type:n.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=To.pick(e).sort;return{done:t,indent:0,data:Ec.get_default(n)}}static get meta(){return{cubename:"待办列表",type:n.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=Ec.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}zu([Go(b.reset)],Au.prototype,"on_reset",null),zu([Go(b.add)],Au.prototype,"add_item",null),zu([Go(b.remove)],Au.prototype,"remove_item",null),zu([Go(b.indent)],Au.prototype,"indent_todoitem",null),zu([Go(b.status)],Au.prototype,"update_status",null),zu([Go(i.cube_delete_child)],Au.prototype,"on_delete_child",null);const Tu=["id","data-type"],Pu=Bn({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,i)=>(Nr(),Ir("div",{class:"cube-list",id:e.cube.id,style:me(e.cube.css),"data-type":Zt(n).list,onContextmenu:i[0]||(i[0]=t=>Zt(ha)(t,e.cube))},[(Nr(!0),Ir(Cr,null,_i(e.cube.items,(n,r)=>(Nr(),Ir("div",{key:n.data.id,class:"listitem",style:me({"margin-left":n.indent*Zt(t).data.line_indent+"px"})},[i[1]||(i[1]=Hr("div",{class:"listitem-symbol"},null,-1)),$r(Oa,{class:"listitem-box",cube:n.data,onKeydown:t=>function(e,t,n,i){const{courier:r,history:o,cursor:s}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),s=t.create_item_data(l);n.tell(t,Is.add(t.id,[s],i+1)),o.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),s=t.create_item_data(l);n.tell(t,Is.add(t.id,[s],i)),o.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=s,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const s=t.items.slice(e.index,r.index+1),l=[];for(let e of s)l.push({id:e.data.id,indent:!1});a.tell(t,Is.indent(t.id,l)),o.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,Is.indent(t.id,e)),o.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=s,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const s=t.items.slice(e.index,r.index+1),l=[];for(let e of s)l.push({id:e.data.id,indent:!0});a.tell(t,Is.indent(t.id,l)),o.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,Is.indent(t.id,e)),o.record(a)}}}(t,e.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,Tu))}}),Nu=(0,Js.A)(Pu,[["__scopeId","data-v-40a8fb6f"]]);function Ou(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Ru extends cs{_component=Nu;_items=Dt([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}get meta(){return Ru.meta}get info(){return this.data.info}update_data(e,t){return Ru.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new Ec(n.data,this),i={indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info.length=0,e.info.push(...this.export_items()),e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return Ru.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Ec(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Ec.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Is.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,o=i.get_recorder();o.add_cmd(e);const s=this.get_valid_index(n),a=[];for(let e of t){const t=new Ec(e.data,this);let n={indent:e.indent,data:Ut(t)};a.push(n)}this.splice(s,0,...a);const l=a[a.length-1]?.data;return l&&o.tell(l,Eo.in_tail(l.id)),o.add_recover(Is.remove(this.id,[s,s+a.length])),o}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[o,s]=t;if(0===o&&s>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[o-1]?.data,c=this._items[s+1]?.data,d=this.splice(o,a);return r.add_recover(Is.add(this.id,d.data,o)),l?r.tell(l,Eo.in_tail(l.id)):c&&r.tell(c,Eo.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(Is.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s}=e,a=Is.remove(this.id,s);return this.remove_item(a)}static get_default(e=[]){let t=Ec.get_default(e);return{id:zo(),type:n.list,info:[{indent:0,data:t}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Ec.get_default(To.pick(e).sort)}}static get meta(){return{cubename:"列表",type:n.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=Ec.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Ou([Go(m.reset)],Ru.prototype,"on_reset",null),Ou([Go(m.add)],Ru.prototype,"add_item",null),Ou([Go(m.remove)],Ru.prototype,"remove_item",null),Ou([Go(m.indent)],Ru.prototype,"indent_item",null),Ou([Go(i.cube_delete_child)],Ru.prototype,"on_delete_child",null);class Lu{static reset(e,t){return{id:e,data:t,name:_.reset}}static add(e,t,n){return{id:e,name:_.add,data:t,pos:n}}static remove(e,t){return{id:e,name:_.remove,range:t}}static indent(e,t){return{id:e,name:_.indent,items:t}}}const Eu=["id","data-type"],Iu={class:"listitem-symbol"},Du=Bn({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:i}=t;return(e,t)=>(Nr(),Ir("div",{class:"cube-list-ordered",id:e.cube.id,style:me(e.cube.css),"data-type":Zt(n).list_ordered,onContextmenu:t[0]||(t[0]=t=>Zt(ha)(t,e.cube))},[(Nr(!0),Ir(Cr,null,_i(e.cube.items,(t,n)=>(Nr(),Ir("div",{key:t.data.id,class:"listitem",style:me({"margin-left":t.indent*Zt(i).data.line_indent+"px"})},[Hr("div",Iu,Ce(n+1),1),$r(Oa,{class:"listitem-box",cube:t.data,onKeydown:i=>function(e,t,n,i){const{courier:r,history:o,cursor:s}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),s=t.create_item_data(l);n.tell(t,Lu.add(t.id,[s],i+1)),o.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),s=t.create_item_data(l);n.tell(t,Lu.add(t.id,[s],i)),o.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=s,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const s=t.items.slice(e.index,r.index+1),l=[];for(let e of s)l.push({id:e.data.id,indent:!1});a.tell(t,Lu.indent(t.id,l)),o.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,Lu.indent(t.id,e)),o.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=s,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const s=t.items.slice(e.index,r.index+1),l=[];for(let e of s)l.push({id:e.data.id,indent:!0});a.tell(t,Lu.indent(t.id,l)),o.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,Lu.indent(t.id,e)),o.record(a)}}}(i,e.cube,t,n)},null,8,["cube","onKeydown"])],4))),128))],44,Eu))}}),Bu=(0,Js.A)(Du,[["__scopeId","data-v-9f3381f0"]]);function ju(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class qu extends cs{_items=Dt([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return Bu}get children(){return[...this._items.map(e=>e.data)]}get items(){return[...this._items]}get meta(){return qu.meta}get info(){return this.data.info}update_data(e,t){return qu.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new Ec(n.data,this),i={indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=super.base_export();e.info=[];for(let t of this._items)e.info.push({indent:t.indent,data:t.data.export()});return e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return{children:i,data:r}}replace_id(e,t={}){return qu.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Ec(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Ec.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Lu.reset(this.id,this.export_items());return this._items.length=0,this._items.push(...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,o=i.get_recorder();o.add_cmd(e);const s=this.get_valid_index(n),a=[];for(let e of t){const t=new Ec(e.data,this);let n={indent:e.indent,data:Ut(t)};a.push(n)}this.splice(s,0,...a);const l=a[a.length-1]?.data;return l&&o.tell(l,Eo.in_tail(l.id)),o.add_recover(Lu.remove(this.id,[s,s+a.length])),o}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[o,s]=t;if(0===o&&s>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[o-1]?.data,c=this._items[s+1]?.data,d=this.splice(o,a);return r.add_recover(Lu.add(this.id,d.data,o)),l?r.tell(l,Eo.in_tail(l.id)):c&&r.tell(c,Eo.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}))}return i.add_recover(Lu.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:o,range:s}=e,a=Lu.remove(this.id,s);return this.remove_item(a)}static get_default(){let e=Ec.get_default();return{id:To.get_id(),type:n.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Ec.get_default(To.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:n.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=Ec.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}ju([Go(_.reset)],qu.prototype,"on_reset",null),ju([Go(_.add)],qu.prototype,"add_item",null),ju([Go(_.remove)],qu.prototype,"remove_item",null),ju([Go(_.indent)],qu.prototype,"indent_item",null),ju([Go(i.cube_delete_child)],qu.prototype,"on_delete_child",null);class Fu{static update(e,t,n){return{id:e,name:g.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:g.code_add,item:Vt(t),focus:n}}static remove(e,t){return{id:e,name:g.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:g.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:g.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:g.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:g.change_theme}}}const Hu=[{id:"abap",name:"ABAP",import:()=>r.e(8617).then(r.bind(r,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>r.e(3516).then(r.bind(r,3516))},{id:"ada",name:"Ada",import:()=>r.e(7561).then(r.bind(r,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(535)]).then(r.bind(r,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7611),r.e(535),r.e(4886)]).then(r.bind(r,4886))},{id:"apache",name:"Apache Conf",import:()=>r.e(7625).then(r.bind(r,7625))},{id:"apex",name:"Apex",import:()=>r.e(9819).then(r.bind(r,9819))},{id:"apl",name:"APL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(7504)]).then(r.bind(r,7504))},{id:"applescript",name:"AppleScript",import:()=>r.e(2108).then(r.bind(r,2108))},{id:"ara",name:"Ara",import:()=>r.e(5611).then(r.bind(r,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>r.e(4354).then(r.bind(r,4354))},{id:"asm",name:"Assembly",import:()=>r.e(6324).then(r.bind(r,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(6940),r.e(4408)]).then(r.bind(r,4408))},{id:"awk",name:"AWK",import:()=>r.e(4862).then(r.bind(r,4862))},{id:"ballerina",name:"Ballerina",import:()=>r.e(5141).then(r.bind(r,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>r.e(2068).then(r.bind(r,2068))},{id:"beancount",name:"Beancount",import:()=>r.e(5026).then(r.bind(r,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>r.e(8753).then(r.bind(r,8753))},{id:"bibtex",name:"BibTeX",import:()=>r.e(4009).then(r.bind(r,4009))},{id:"bicep",name:"Bicep",import:()=>r.e(7688).then(r.bind(r,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(5283)]).then(r.bind(r,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>r.e(5314).then(r.bind(r,5314))},{id:"c",name:"C",import:()=>r.e(5814).then(r.bind(r,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>r.e(5728).then(r.bind(r,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([r.e(2473),r.e(8237)]).then(r.bind(r,8237))},{id:"clarity",name:"Clarity",import:()=>r.e(6677).then(r.bind(r,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>r.e(7681).then(r.bind(r,7681))},{id:"cmake",name:"CMake",import:()=>r.e(5936).then(r.bind(r,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(780)]).then(r.bind(r,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>r.e(9096).then(r.bind(r,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>r.e(6283).then(r.bind(r,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([r.e(7258),r.e(6563)]).then(r.bind(r,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>r.e(489).then(r.bind(r,489))},{id:"coq",name:"Coq",import:()=>r.e(8418).then(r.bind(r,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([r.e(1230),r.e(5814),r.e(4914)]).then(r.bind(r,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(5814),r.e(3894),r.e(3403)]).then(r.bind(r,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>r.e(2354).then(r.bind(r,2354))},{id:"css",name:"CSS",import:()=>r.e(1708).then(r.bind(r,1708))},{id:"csv",name:"CSV",import:()=>r.e(8849).then(r.bind(r,1230))},{id:"cue",name:"CUE",import:()=>r.e(172).then(r.bind(r,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>r.e(9806).then(r.bind(r,9806))},{id:"d",name:"D",import:()=>r.e(5177).then(r.bind(r,5177))},{id:"dart",name:"Dart",import:()=>r.e(9728).then(r.bind(r,9728))},{id:"dax",name:"DAX",import:()=>r.e(874).then(r.bind(r,874))},{id:"desktop",name:"Desktop",import:()=>r.e(6173).then(r.bind(r,6173))},{id:"diff",name:"Diff",import:()=>r.e(7670).then(r.bind(r,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>r.e(415).then(r.bind(r,415))},{id:"dotenv",name:"dotEnv",import:()=>r.e(2173).then(r.bind(r,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>r.e(3227).then(r.bind(r,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(3052)]).then(r.bind(r,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3330)]).then(r.bind(r,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([r.e(5814),r.e(9641)]).then(r.bind(r,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>r.e(2505).then(r.bind(r,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007),r.e(9524)]).then(r.bind(r,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([r.e(7900),r.e(2266)]).then(r.bind(r,2266))},{id:"fennel",name:"Fennel",import:()=>r.e(1631).then(r.bind(r,1631))},{id:"fish",name:"Fish",import:()=>r.e(9661).then(r.bind(r,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>r.e(9077).then(r.bind(r,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([r.e(8553),r.e(7549)]).then(r.bind(r,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>r.e(8553).then(r.bind(r,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([r.e(7900),r.e(9689)]).then(r.bind(r,9689))},{id:"gdresource",name:"GDResource",import:()=>r.e(7434).then(r.bind(r,7434))},{id:"gdscript",name:"GDScript",import:()=>r.e(4311).then(r.bind(r,4311))},{id:"gdshader",name:"GDShader",import:()=>r.e(6405).then(r.bind(r,6405))},{id:"genie",name:"Genie",import:()=>r.e(9017).then(r.bind(r,9017))},{id:"gherkin",name:"Gherkin",import:()=>r.e(4451).then(r.bind(r,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>r.e(2861).then(r.bind(r,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([r.e(3894),r.e(638)]).then(r.bind(r,638))},{id:"gleam",name:"Gleam",import:()=>r.e(8201).then(r.bind(r,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(8700)]).then(r.bind(r,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(5050)]).then(r.bind(r,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([r.e(5814),r.e(2723)]).then(r.bind(r,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>r.e(396).then(r.bind(r,396))},{id:"go",name:"Go",import:()=>r.e(3941).then(r.bind(r,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6940),r.e(6262),r.e(3170)]).then(r.bind(r,3170))},{id:"groovy",name:"Groovy",import:()=>r.e(1037).then(r.bind(r,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(6356)]).then(r.bind(r,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3949)]).then(r.bind(r,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1655)]).then(r.bind(r,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>r.e(9045).then(r.bind(r,9045))},{id:"haxe",name:"Haxe",import:()=>r.e(8107).then(r.bind(r,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>r.e(6124).then(r.bind(r,6124))},{id:"hjson",name:"Hjson",import:()=>r.e(5203).then(r.bind(r,5203))},{id:"hlsl",name:"HLSL",import:()=>r.e(4598).then(r.bind(r,4598))},{id:"html",name:"HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940)]).then(r.bind(r,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(914)]).then(r.bind(r,914))},{id:"http",name:"HTTP",import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6967),r.e(3894),r.e(6940),r.e(6262),r.e(3170),r.e(5119)]).then(r.bind(r,5119))},{id:"hxml",name:"HXML",import:()=>r.e(8320).then(r.bind(r,8320))},{id:"hy",name:"Hy",import:()=>r.e(7470).then(r.bind(r,7470))},{id:"imba",name:"Imba",import:()=>r.e(3702).then(r.bind(r,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>r.e(6343).then(r.bind(r,6343))},{id:"java",name:"Java",import:()=>r.e(6967).then(r.bind(r,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>r.e(7258).then(r.bind(r,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3837)]).then(r.bind(r,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([r.e(7258),r.e(5536)]).then(r.bind(r,5536))},{id:"json",name:"JSON",import:()=>r.e(5709).then(r.bind(r,5709))},{id:"json5",name:"JSON5",import:()=>r.e(6010).then(r.bind(r,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>r.e(212).then(r.bind(r,212))},{id:"jsonl",name:"JSON Lines",import:()=>r.e(4843).then(r.bind(r,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>r.e(4962).then(r.bind(r,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>r.e(7922).then(r.bind(r,7922))},{id:"jsx",name:"JSX",import:()=>r.e(6262).then(r.bind(r,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([r.e(7258),r.e(1230),r.e(5814),r.e(4914),r.e(2473),r.e(9983),r.e(9910)]).then(r.bind(r,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>r.e(2660).then(r.bind(r,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>r.e(6297).then(r.bind(r,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([r.e(9983),r.e(7817)]).then(r.bind(r,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>r.e(8003).then(r.bind(r,8003))},{id:"less",name:"Less",import:()=>r.e(6964).then(r.bind(r,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(327)]).then(r.bind(r,327))},{id:"llvm",name:"LLVM IR",import:()=>r.e(3972).then(r.bind(r,3972))},{id:"log",name:"Log file",import:()=>r.e(3247).then(r.bind(r,3247))},{id:"logo",name:"Logo",import:()=>r.e(9730).then(r.bind(r,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([r.e(5814),r.e(4199)]).then(r.bind(r,4199))},{id:"luau",name:"Luau",import:()=>r.e(5744).then(r.bind(r,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>r.e(1757).then(r.bind(r,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>r.e(7900).then(r.bind(r,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([r.e(1708),r.e(4714),r.e(7611),r.e(6964),r.e(9175)]).then(r.bind(r,9175))},{id:"matlab",name:"MATLAB",import:()=>r.e(2492).then(r.bind(r,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7900),r.e(2215)]).then(r.bind(r,2215))},{id:"mdx",name:"MDX",import:()=>r.e(4452).then(r.bind(r,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>r.e(2860).then(r.bind(r,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>r.e(8499).then(r.bind(r,8499))},{id:"mojo",name:"Mojo",import:()=>r.e(9526).then(r.bind(r,9526))},{id:"move",name:"Move",import:()=>r.e(9104).then(r.bind(r,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>r.e(6239).then(r.bind(r,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>r.e(9876).then(r.bind(r,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([r.e(5814),r.e(697)]).then(r.bind(r,697))},{id:"nim",name:"Nim",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(5814),r.e(7900),r.e(4697)]).then(r.bind(r,4697))},{id:"nix",name:"Nix",import:()=>r.e(8212).then(r.bind(r,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>r.e(7374).then(r.bind(r,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>r.e(7148).then(r.bind(r,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>r.e(9788).then(r.bind(r,9788))},{id:"ocaml",name:"OCaml",import:()=>r.e(9057).then(r.bind(r,9057))},{id:"pascal",name:"Pascal",import:()=>r.e(9079).then(r.bind(r,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(9984)]).then(r.bind(r,9984))},{id:"php",name:"PHP",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(7765),r.e(7966)]).then(r.bind(r,7765))},{id:"plsql",name:"PL/SQL",import:()=>r.e(8389).then(r.bind(r,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>r.e(4520).then(r.bind(r,4520))},{id:"polar",name:"Polar",import:()=>r.e(9845).then(r.bind(r,9845))},{id:"postcss",name:"PostCSS",import:()=>r.e(9270).then(r.bind(r,9270))},{id:"powerquery",name:"PowerQuery",import:()=>r.e(454).then(r.bind(r,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>r.e(1476).then(r.bind(r,1476))},{id:"prisma",name:"Prisma",import:()=>r.e(5731).then(r.bind(r,5731))},{id:"prolog",name:"Prolog",import:()=>r.e(9206).then(r.bind(r,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>r.e(5891).then(r.bind(r,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6757)]).then(r.bind(r,6757))},{id:"puppet",name:"Puppet",import:()=>r.e(3593).then(r.bind(r,3593))},{id:"purescript",name:"PureScript",import:()=>r.e(9904).then(r.bind(r,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>r.e(2473).then(r.bind(r,2473))},{id:"qml",name:"QML",import:()=>Promise.all([r.e(7258),r.e(1803)]).then(r.bind(r,1803))},{id:"qmldir",name:"QML Directory",import:()=>r.e(4292).then(r.bind(r,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>r.e(402).then(r.bind(r,402))},{id:"r",name:"R",import:()=>r.e(9983).then(r.bind(r,9983))},{id:"racket",name:"Racket",import:()=>r.e(9281).then(r.bind(r,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>r.e(9780).then(r.bind(r,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(2354),r.e(245)]).then(r.bind(r,245))},{id:"reg",name:"Windows Registry Script",import:()=>r.e(5827).then(r.bind(r,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>r.e(3124).then(r.bind(r,3124))},{id:"rel",name:"Rel",import:()=>r.e(3043).then(r.bind(r,5424))},{id:"riscv",name:"RISC-V",import:()=>r.e(8684).then(r.bind(r,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(4007),r.e(8234)]).then(r.bind(r,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007)]).then(r.bind(r,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>r.e(7145).then(r.bind(r,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([r.e(1230),r.e(9478)]).then(r.bind(r,9478))},{id:"sass",name:"Sass",import:()=>r.e(8709).then(r.bind(r,8709))},{id:"scala",name:"Scala",import:()=>r.e(3947).then(r.bind(r,3947))},{id:"scheme",name:"Scheme",import:()=>r.e(9982).then(r.bind(r,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([r.e(1708),r.e(7611)]).then(r.bind(r,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>r.e(1624).then(r.bind(r,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>r.e(8249).then(r.bind(r,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>r.e(3894).then(r.bind(r,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([r.e(3894),r.e(9965)]).then(r.bind(r,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>r.e(1066).then(r.bind(r,1066))},{id:"solidity",name:"Solidity",import:()=>r.e(4780).then(r.bind(r,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7642)]).then(r.bind(r,7642))},{id:"sparql",name:"SPARQL",import:()=>r.e(4108).then(r.bind(r,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>r.e(6514).then(r.bind(r,6514))},{id:"sql",name:"SQL",import:()=>r.e(1230).then(r.bind(r,8849))},{id:"ssh-config",name:"SSH Config",import:()=>r.e(3874).then(r.bind(r,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([r.e(1230),r.e(542)]).then(r.bind(r,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>r.e(41).then(r.bind(r,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(3454)]).then(r.bind(r,3454))},{id:"swift",name:"Swift",import:()=>r.e(8436).then(r.bind(r,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>r.e(6577).then(r.bind(r,6577))},{id:"systemd",name:"Systemd Units",import:()=>r.e(16).then(r.bind(r,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>r.e(4660).then(r.bind(r,4660))},{id:"tasl",name:"Tasl",import:()=>r.e(1839).then(r.bind(r,1839))},{id:"tcl",name:"Tcl",import:()=>r.e(7328).then(r.bind(r,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3941),r.e(7095)]).then(r.bind(r,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>r.e(4385).then(r.bind(r,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([r.e(9983),r.e(9198)]).then(r.bind(r,9198))},{id:"toml",name:"TOML",import:()=>r.e(5363).then(r.bind(r,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(9556)]).then(r.bind(r,9556))},{id:"tsv",name:"TSV",import:()=>r.e(6045).then(r.bind(r,8426))},{id:"tsx",name:"TSX",import:()=>r.e(6940).then(r.bind(r,6940))},{id:"turtle",name:"Turtle",import:()=>r.e(4877).then(r.bind(r,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(7611),r.e(4007),r.e(7765),r.e(4236)]).then(r.bind(r,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>r.e(4714).then(r.bind(r,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>r.e(794).then(r.bind(r,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>r.e(8711).then(r.bind(r,8711))},{id:"v",name:"V",import:()=>r.e(5443).then(r.bind(r,5443))},{id:"vala",name:"Vala",import:()=>r.e(7141).then(r.bind(r,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>r.e(8235).then(r.bind(r,8235))},{id:"verilog",name:"Verilog",import:()=>r.e(4283).then(r.bind(r,4283))},{id:"vhdl",name:"VHDL",import:()=>r.e(5521).then(r.bind(r,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>r.e(7567).then(r.bind(r,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432)]).then(r.bind(r,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432),r.e(7789)]).then(r.bind(r,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(7611),r.e(6964),r.e(1432),r.e(41),r.e(5954)]).then(r.bind(r,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>r.e(845).then(r.bind(r,845))},{id:"wasm",name:"WebAssembly",import:()=>r.e(7615).then(r.bind(r,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>r.e(8393).then(r.bind(r,8393))},{id:"wgsl",name:"WGSL",import:()=>r.e(5884).then(r.bind(r,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>r.e(2062).then(r.bind(r,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>r.e(6957).then(r.bind(r,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>r.e(5589).then(r.bind(r,5589))},{id:"xml",name:"XML",import:()=>Promise.all([r.e(6967),r.e(5585)]).then(r.bind(r,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([r.e(6967),r.e(5628)]).then(r.bind(r,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>r.e(4546).then(r.bind(r,4546))},{id:"zenscript",name:"ZenScript",import:()=>r.e(5099).then(r.bind(r,5099))},{id:"zig",name:"Zig",import:()=>r.e(3279).then(r.bind(r,3279))}],$u=Object.fromEntries(Hu.map(e=>[e.id,e.import])),Gu=Object.fromEntries(Hu.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Vu={...$u,...Gu},Uu=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>r.e(2691).then(r.bind(r,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>r.e(7768).then(r.bind(r,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>r.e(7927).then(r.bind(r,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>r.e(1216).then(r.bind(r,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>r.e(7788).then(r.bind(r,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>r.e(2071).then(r.bind(r,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>r.e(9692).then(r.bind(r,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>r.e(3032).then(r.bind(r,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>r.e(8485).then(r.bind(r,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>r.e(284).then(r.bind(r,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>r.e(1545).then(r.bind(r,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>r.e(6083).then(r.bind(r,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>r.e(5647).then(r.bind(r,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>r.e(9179).then(r.bind(r,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>r.e(9976).then(r.bind(r,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>r.e(9831).then(r.bind(r,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>r.e(9809).then(r.bind(r,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>r.e(9681).then(r.bind(r,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>r.e(1425).then(r.bind(r,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>r.e(6865).then(r.bind(r,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>r.e(7824).then(r.bind(r,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>r.e(3646).then(r.bind(r,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>r.e(2419).then(r.bind(r,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>r.e(9225).then(r.bind(r,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>r.e(4112).then(r.bind(r,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>r.e(8931).then(r.bind(r,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>r.e(2184).then(r.bind(r,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>r.e(2142).then(r.bind(r,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>r.e(5638).then(r.bind(r,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>r.e(7831).then(r.bind(r,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>r.e(8426).then(r.bind(r,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>r.e(3492).then(r.bind(r,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>r.e(3720).then(r.bind(r,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>r.e(9294).then(r.bind(r,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>r.e(4081).then(r.bind(r,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>r.e(1729).then(r.bind(r,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>r.e(4614).then(r.bind(r,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>r.e(2934).then(r.bind(r,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>r.e(2535).then(r.bind(r,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>r.e(4214).then(r.bind(r,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>r.e(4552).then(r.bind(r,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>r.e(6736).then(r.bind(r,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>r.e(3906).then(r.bind(r,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>r.e(4445).then(r.bind(r,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>r.e(4465).then(r.bind(r,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>r.e(6980).then(r.bind(r,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>r.e(753).then(r.bind(r,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>r.e(5424).then(r.bind(r,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>r.e(8093).then(r.bind(r,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>r.e(4838).then(r.bind(r,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>r.e(5601).then(r.bind(r,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>r.e(1857).then(r.bind(r,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>r.e(7217).then(r.bind(r,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>r.e(1931).then(r.bind(r,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>r.e(321).then(r.bind(r,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>r.e(5034).then(r.bind(r,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>r.e(224).then(r.bind(r,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>r.e(5542).then(r.bind(r,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>r.e(6517).then(r.bind(r,6517))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>r.e(5143).then(r.bind(r,5143))}],Wu=Object.fromEntries(Uu.map(e=>[e.id,e.import]));class Yu extends Error{constructor(e){super(e),this.name="ShikiError"}}function Xu(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Xu(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=Xu(e[n]);return t}(e):e}function Ku(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ju(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?Ju(e.substring(0,e.length-1)):e.substr(1+~t)}var Qu=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Zu=class{static hasCaptures(e){return null!==e&&(Qu.lastIndex=0,Qu.test(e))}static replaceCaptures(e,t,n){return e.replace(Qu,(e,i,r,o)=>{let s=n[parseInt(i||r,10)];if(!s)return e;{let e=t.substring(s.start,s.end);for(;"."===e[0];)e=e.substring(1);switch(o){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function eh(e,t){return e<t?-1:e>t?1:0}function th(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let i=0;i<n;i++){let n=eh(e[i],t[i]);if(0!==n)return n}return 0}return n-i}function nh(e){return!!/^#[0-9a-f]{6}$/i.test(e)||(!!/^#[0-9a-f]{8}$/i.test(e)||(!!/^#[0-9a-f]{3}$/i.test(e)||!!/^#[0-9a-f]{4}$/i.test(e)))}function ih(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var rh=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},oh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let e=0,r=t.length;e<r;e++){let r,o=t[e];if(!o.settings)continue;if("string"==typeof o.scope){let e=o.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),r=e.split(",")}else r=Array.isArray(o.scope)?o.scope:[""];let s=-1;if("string"==typeof o.settings.fontStyle){s=0;let e=o.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++){switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}}let a=null;"string"==typeof o.settings.foreground&&nh(o.settings.foreground)&&(a=o.settings.foreground);let l=null;"string"==typeof o.settings.background&&nh(o.settings.background)&&(l=o.settings.background);for(let t=0,o=r.length;t<o;t++){let o=r[t].trim().split(" "),c=o[o.length-1],d=null;o.length>1&&(d=o.slice(0,o.length-1),d.reverse()),n[i++]=new ch(c,d,e,s,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=eh(e.scope,t.scope);return 0!==n?n:(n=th(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(r=t.background)}let o=new uh(t),s=new lh(n,o.getId(i),o.getId(r)),a=new fh(new ph(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];a.insert(0,n.scope,n.parentScopes,n.fontStyle,o.getId(n.foreground),o.getId(n.background))}return new oh(o,s,a)}(e,t)}_cachedMatchRoot=new rh(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>function(e,t){if(0===t.length)return!0;for(let n=0;n<t.length;n++){let i=t[n],r=!1;if(">"===i){if(n===t.length-1)return!1;i=t[++n],r=!0}for(;e&&!ah(e.scopeName,i);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new lh(n.fontStyle,n.foreground,n.background):null}},sh=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const i of n)t=new e(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new e(n,t[i]);return n}push(t){return new e(this,t)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ah(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var lh=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};var ch=class{constructor(e,t,n,i,r,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=o}},dh=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(dh||{});var uh=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},hh=Object.freeze([]),ph=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,i,r){this.scopeDepth=e,this.parentScopes=t||hh,this.fontStyle=n,this.foreground=i,this.background=r}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==i&&(this.background=i)}},fh=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,i=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[i]&&i++,!(n>=e.parentScopes.length||i>=t.parentScopes.length);){const r=t.parentScopes[i].length-e.parentScopes[n].length;if(0!==r)return r;n++,i++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,i=t.indexOf(".");if(-1===i?(e=t,n=""):(e=t.substring(0,i),n=t.substring(i+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,i,r,o,s){if(""===n)return void this._doInsertHere(t,i,r,o,s);let a,l,c,d=n.indexOf(".");-1===d?(a=n,l=""):(a=n.substring(0,d),l=n.substring(d+1)),this._children.hasOwnProperty(a)?c=this._children[a]:(c=new e(this._mainRule.clone(),ph.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,i,r,o,s)}_doInsertHere(e,t,n,i,r){if(null!==t){for(let o=0,s=this._rulesWithParentScopes.length;o<s;o++){let s=this._rulesWithParentScopes[o];if(0===th(s.parentScopes,t))return void s.acceptOverwrite(e,n,i,r)}-1===n&&(n=this._mainRule.fontStyle),0===i&&(i=this._mainRule.foreground),0===r&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new ph(e,t,n,i,r))}else this._mainRule.acceptOverwrite(e,n,i,r)}},mh=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),i=e.getTokenType(t),r=e.getFontStyle(t),o=e.getForeground(t),s=e.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:o,background:s})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(t,n,i,r,o,s,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,u=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==i&&(c=i),null!==r&&(d=r?1:0),-1!==o&&(u=o),0!==s&&(h=s),0!==a&&(p=a),(l|c<<8|d<<10|u<<11|h<<15|p<<24)>>>0}};function _h(e){return e}function gh(e,t){const n=[],i=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}(e);let r=i.next();for(;null!==r;){let e=0;if(2===r.length&&":"===r.charAt(1)){switch(r.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let t=s();if(n.push({matcher:t,priority:e}),","!==r)break;r=i.next()}return n;function o(){if("-"===r){r=i.next();const e=o();return t=>!!e&&!e(t)}if("("===r){r=i.next();const e=function(){const e=[];let t=s();for(;t&&(e.push(t),"|"===r||","===r);){do{r=i.next()}while("|"===r||","===r);t=s()}return t=>e.some(e=>e(t))}();return")"===r&&(r=i.next()),e}if(bh(r)){const e=[];do{e.push(r),r=i.next()}while(bh(r));return n=>t(e,n)}return null}function s(){const e=[];let t=o();for(;t;)e.push(t),t=o();return t=>e.every(e=>e(t))}}function bh(e){return!!e&&!!e.match(/[\w\.:]+/)}function yh(e){"function"==typeof e.dispose&&e.dispose()}var vh=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},wh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xh=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},kh=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new vh(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new xh;for(const n of e)Sh(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof vh){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName))continue;if(this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Sh(e,t,n,i){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof vh?Mh({baseGrammar:o,selfGrammar:r},i):Ch(e.ruleName,{baseGrammar:o,selfGrammar:r,repository:r.repository},i);const s=n.injections(e.scopeName);if(s)for(const e of s)i.add(new vh(e))}function Ch(e,t,n){if(t.repository&&t.repository[e]){zh([t.repository[e]],t,n)}}function Mh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&zh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&zh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function zh(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const e=i.repository?Ku({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&zh(i.patterns,{...t,repository:e},n);const r=i.include;if(!r)continue;const o=Rh(r);switch(o.kind){case 0:Mh({...t,selfGrammar:t.baseGrammar},n);break;case 1:Mh(t,n);break;case 2:Ch(o.ruleName,{...t,repository:e},n);break;case 3:case 4:const i=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const r={baseGrammar:t.baseGrammar,selfGrammar:i,repository:e};4===o.kind?Ch(o.ruleName,r,n):Mh(r,n)}else 4===o.kind?n.add(new wh(o.scopeName,o.ruleName)):n.add(new vh(o.scopeName))}}}var Ah=class{kind=0},Th=class{kind=1},Ph=class{constructor(e){this.ruleName=e}kind=2},Nh=class{constructor(e){this.scopeName=e}kind=3},Oh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Rh(e){if("$base"===e)return new Ah;if("$self"===e)return new Th;const t=e.indexOf("#");if(-1===t)return new Nh(e);if(0===t)return new Ph(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Oh(n,i)}}var Lh=/\\(\d+)/,Eh=/\\(\d+)/g;Symbol("RuleId");var Ih=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Zu.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Zu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Ju(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?Zu.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?Zu.replaceCaptures(this._contentName,e,t):this._contentName}},Dh=class extends Ih{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},Bh=class extends Ih{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new $h(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Gh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},jh=class extends Ih{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns){e.getRule(n).collectPatterns(e,t)}}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Gh,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qh=class extends Ih{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,o,s,a,l,c){super(e,t,n,i),this._begin=new $h(r,this.id),this.beginCaptures=o,this._end=new $h(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Gh;for(const t of this.patterns){e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Fh=class extends Ih{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,o,s,a,l){super(e,t,n,i),this._begin=new $h(r,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new $h(s,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Gh;for(const t of this.patterns){e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Gh,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Hh=class e{static createCaptureRule(e,t,n,i,r){return e.registerRule(e=>new Dh(t,e,n,i,r))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new Bh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,i));if(void 0===t.begin){t.repository&&(i=Ku({},i,t.repository));let r=t.patterns;return void 0===r&&t.include&&(r=[{include:t.include}]),new jh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(r,n,i))}return t.while?new Fh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,i),e._compilePatterns(t.patterns,n,i)):new qh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,e._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let o=0;for(const e in t){if("$vscodeTextmateLocation"===e)continue;const t=parseInt(e,10);t>o&&(o=t)}for(let e=0;e<=o;e++)r[e]=null;for(const o in t){if("$vscodeTextmateLocation"===o)continue;const s=parseInt(o,10);let a=0;t[o].patterns&&(a=e.getCompiledRuleId(t[o],n,i)),r[s]=e.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,a)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let o=0,s=t.length;o<s;o++){const s=t[o];let a=-1;if(s.include){const t=Rh(s.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(i[s.include],n,i);break;case 2:let r=i[t.ruleName];r&&(a=e.getCompiledRuleId(r,n,i));break;case 3:case 4:const o=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(o,i);if(c)if(l){let t=c.repository[l];t&&(a=e.getCompiledRuleId(t,n,c.repository))}else a=e.getCompiledRuleId(c.repository.$self,n,c.repository)}}else a=e.getCompiledRuleId(s,n,i);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof jh||e instanceof qh||e instanceof Fh)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},$h=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,i=[],r=!1;for(let o=0;o<t;o++){if("\\"===e.charAt(o)&&o+1<t){const t=e.charAt(o+1);"z"===t?(i.push(e.substring(n,o)),i.push("$(?!\\n)(?<!\\n)"),n=o+2):"A"!==t&&"G"!==t||(r=!0),o++}}this.hasAnchor=r,0===n?this.source=e:(i.push(e.substring(n,t)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=Lh.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return Eh.lastIndex=0,this.source.replace(Eh,(e,t)=>ih(n[parseInt(t,10)]||""))}_buildAnchorCache(){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let e,t,n,i,r=[],o=[],s=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),r[e]=n,o[e]=n,s[e]=n,a[e]=n,"\\"===n&&e+1<t&&(i=this.source.charAt(e+1),"A"===i?(r[e+1]="￿",o[e+1]="￿",s[e+1]="A",a[e+1]="A"):"G"===i?(r[e+1]="￿",o[e+1]="G",s[e+1]="￿",a[e+1]="G"):(r[e+1]=i,o[e+1]=i,s[e+1]=i,a[e+1]=i),e++);return{A0_G0:r.join(""),A0_G1:o.join(""),A1_G0:s.join(""),A1_G1:a.join("")}}resolveAnchors(e,t){return this.hasAnchor&&this._anchorCache&&"string"==typeof this.source?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},Gh=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Vh(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(e=>e.resolveAnchors(t,n));return new Vh(e,i,this._items.map(e=>e.ruleId))}},Vh=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Uh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Wh=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Uh(e,8),this._embeddedLanguagesMatcher=new Yh(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Uh(0,0);_getBasicScopeAttributes=new rh(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Uh(t,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){const n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Yh=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>ih(e));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}},Xh=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function Kh(e,t,n,i,r,o,s,a){const l=t.content.length;let c=!1,d=-1;if(s){const s=function(e,t,n,i,r,o){let s=r.beginRuleCapturedEOL?0:-1;const a=[];for(let t=r;t;t=t.pop()){const n=t.getRule(e);n instanceof Fh&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=Qh(l.rule,e,l.stack.endRule,n,i===s),d=a.findNextMatchSync(t,i,c);if(!d){0,r=l.stack.pop();break}if(-2!==d.ruleId){r=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Zh(e,t,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>i&&(i=d.captureIndices[0].end,n=!1))}return{stack:r,linePos:i,anchorPosition:s,isFirstLine:n}}(e,t,n,i,r,o);r=s.stack,i=s.linePos,n=s.isFirstLine,d=s.anchorPosition}const u=Date.now();for(;!c;){if(0!==a){if(Date.now()-u>a)return new Xh(r,!0)}h()}return new Xh(r,!1);function h(){const s=function(e,t,n,i,r,o){const s=function(e,t,n,i,r,o){const s=r.getRule(e),{ruleScanner:a,findOptions:l}=Jh(s,e,r.endRule,n,i===o),c=a.findNextMatchSync(t,i,l);if(c)return{captureIndices:c.captureIndices,matchedRuleId:c.ruleId};return null}(e,t,n,i,r,o),a=e.getInjections();if(0===a.length)return s;const l=function(e,t,n,i,r,o,s){let a,l=Number.MAX_VALUE,c=null,d=0;const u=o.contentNameScopesList.getScopeNames();for(let o=0,h=e.length;o<h;o++){const h=e[o];if(!h.matcher(u))continue;const p=t.getRule(h.ruleId),{ruleScanner:f,findOptions:m}=Jh(p,t,null,i,r===s),_=f.findNextMatchSync(n,r,m);if(!_)continue;0;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=h.priority,l===r))break}if(c)return{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a};return null}(a,e,t,n,i,r,o);if(!l)return s;if(!s)return l;const c=s.captureIndices[0].start,d=l.captureIndices[0].start;if(d<c||l.priorityMatch&&d===c)return l;return s}(e,t,n,i,r,d);if(!s)return o.produce(r,l),void(c=!0);const a=s.captureIndices,u=s.matchedRuleId,h=!!(a&&a.length>0)&&a[0].end>i;if(-1===u){const s=r.getRule(e);0,o.produce(r,a[0].start),r=r.withContentNameScopesList(r.nameScopesList),Zh(e,t,n,r,o,s.endCaptures,a),o.produce(r,a[0].end);const u=r;if(r=r.parent,d=u.getAnchorPos(),!h&&u.getEnterPos()===i)return r=u,o.produce(r,l),void(c=!0)}else{const s=e.getRule(u);o.produce(r,a[0].start);const p=r,f=s.getName(t.content,a),m=r.contentNameScopesList.pushAttributed(f,e);if(r=r.push(u,i,d,a[0].end===l,null,m,m),s instanceof qh){const i=s;0,Zh(e,t,n,r,o,i.beginCaptures,a),o.produce(r,a[0].end),d=a[0].end;const u=i.getContentName(t.content,a),f=m.pushAttributed(u,e);if(r=r.withContentNameScopesList(f),i.endHasBackReferences&&(r=r.withEndRule(i.getEndWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(r))return r=r.pop(),o.produce(r,l),void(c=!0)}else if(s instanceof Fh){const i=s;0,Zh(e,t,n,r,o,i.beginCaptures,a),o.produce(r,a[0].end),d=a[0].end;const u=i.getContentName(t.content,a),f=m.pushAttributed(u,e);if(r=r.withContentNameScopesList(f),i.whileHasBackReferences&&(r=r.withEndRule(i.getWhileWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(r))return r=r.pop(),o.produce(r,l),void(c=!0)}else{if(Zh(e,t,n,r,o,s.captures,a),o.produce(r,a[0].end),r=r.pop(),!h)return r=r.safePop(),o.produce(r,l),void(c=!0)}}a[0].end>i&&(i=a[0].end,n=!1)}}function Jh(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function Qh(e,t,n,i,r){return{ruleScanner:e.compileWhileAG(t,n,i,r),findOptions:0}}function Zh(e,t,n,i,r,o,s){if(0===o.length)return;const a=t.content,l=Math.min(o.length,s.length),c=[],d=s[0].end;for(let t=0;t<l;t++){const l=o[t];if(null===l)continue;const u=s[t];if(0===u.length)continue;if(u.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=u.start;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?r.produceFromScopes(c[c.length-1].scopes,u.start):r.produce(i,u.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,s),o=i.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,s),d=o.pushAttributed(c,e),h=i.push(l.retokenizeCapturedWithRuleId,u.start,-1,!1,null,o,d),p=e.createOnigString(a.substring(0,u.end));Kh(e,p,n&&0===u.start,u.start,h,r,!1,0),yh(p);continue}const h=l.getName(a,s);if(null!==h){const t=(c.length>0?c[c.length-1].scopes:i.contentNameScopesList).pushAttributed(h,e);c.push(new ep(t,u.end))}}for(;c.length>0;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var ep=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function tp(e,t,n,i,r){const o=gh(t,np),s=Hh.getCompiledRuleId(n,i,r.repository);for(const n of o)e.push({debugSelector:t,matcher:n.matcher,ruleId:s,grammar:r,priority:n.priority})}function np(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let i=n;i<t.length;i++)if(ip(t[i],e))return n=i+1,!0;return!1})}function ip(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}var rp=class{constructor(e,t,n,i,r,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Wh(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=op(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const e of Object.keys(r)){const t=gh(e,np);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:r[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),t=[],n=this._rootScopeName,i=e(n);if(i){const e=i.injections;if(e)for(let n in e)tp(t,n,e[n],this,i);const r=this._grammarRepository.injections(n);r&&r.forEach(e=>{const n=this.getExternalGrammar(e);if(n){const e=n.injectionSelector;e&&tp(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=op(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){let r;if(-1===this._rootId&&(this._rootId=Hh.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==ap.NULL)r=!1,t.reset();else{r=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),i=mh.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),o=this.getRule(this._rootId).getName(null,null);let s;s=o?sp.createRootAndLookUpScopeName(o,i,this):sp.createRoot("unknown",i),t=new ap(null,this._rootId,-1,-1,!1,null,s,s)}e+="\n";const o=this.createOnigString(e),s=o.content.length,a=new cp(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Kh(this,o,r,0,t,a,!0,i);return yh(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function op(e,t){return(e=Xu(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var sp=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(const t of n)r=sh.push(r,t.scopeNames),i=new e(i,r,t.encodedTokenAttributes);return i}static createRoot(t,n){return new e(null,new sh(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const r=i.getMetadataForScope(t),o=new sh(null,t),s=i.themeProvider.themeMatch(o),a=e.mergeAttributes(n,r,s);return new e(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let i=-1,r=0,o=0;return null!==n&&(i=n.fontStyle,r=n.foregroundId,o=n.backgroundId),mh.set(e,t.languageId,t.tokenType,null,i,r,o)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const i=t.split(/ /g);let r=this;for(const t of i)r=e._pushAttributed(r,t,n);return r}static _pushAttributed(t,n,i){const r=i.getMetadataForScope(n),o=t.scopePath.push(n),s=i.themeProvider.themeMatch(o),a=e.mergeAttributes(t.tokenAttributes,r,s);return new e(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},ap=class e{constructor(e,t,n,i,r,o,s,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=r,this.endRule=o,this.nameScopesList=s,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&sp.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,o,s,a){return new e(this,t,n,i,r,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=sp.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,sp.fromExtension(i,n.contentNameScopesList))}},lp=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):gh(e,np).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>gh(e,np).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},cp=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(n=mh.set(n,0,_h(e.type),null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}return i&&(n=mh.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n?void(this._lastTokenEndIndex=t):(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),void(this._lastTokenEndIndex=t))}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},dp=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,function(e,t,n,i,r,o,s,a){return new rp(e,t,n,i,r,o,s,a)}(e,o,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},up=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new dp(oh.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(oh.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new lp(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,i,r){const o=new kh(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(e=>this._loadSingleGrammar(e.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,n,i,r)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,i=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,t=0,n=null,i=null,r=null){return this._syncRegistry.grammarForScopeName(e,t,n,i,r)}},hp=ap.NULL;const pp=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class fp{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function mp(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new fp(n,i,t)}function _p(e){return e.toLowerCase()}fp.prototype.normal={},fp.prototype.property={},fp.prototype.space=void 0;class gp{constructor(e,t){this.attribute=t,this.property=e}}gp.prototype.attribute="",gp.prototype.booleanish=!1,gp.prototype.boolean=!1,gp.prototype.commaOrSpaceSeparated=!1,gp.prototype.commaSeparated=!1,gp.prototype.defined=!1,gp.prototype.mustUseProperty=!1,gp.prototype.number=!1,gp.prototype.overloadedBoolean=!1,gp.prototype.property="",gp.prototype.spaceSeparated=!1,gp.prototype.space=void 0;let bp=0;const yp=Mp(),vp=Mp(),wp=Mp(),xp=Mp(),kp=Mp(),Sp=Mp(),Cp=Mp();function Mp(){return 2**++bp}const zp=Object.keys(e);class Ap extends gp{constructor(t,n,i,r){let o=-1;if(super(t,n),Tp(this,"space",r),"number"==typeof i)for(;++o<zp.length;){const t=zp[o];Tp(this,zp[o],(i&e[t])===e[t])}}}function Tp(e,t,n){n&&(e[t]=n)}function Pp(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new Ap(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[_p(i)]=i,n[_p(o.attribute)]=i}return new fp(t,n,e.space)}Ap.prototype.defined=!0;const Np=Pp({properties:{ariaActiveDescendant:null,ariaAtomic:vp,ariaAutoComplete:null,ariaBusy:vp,ariaChecked:vp,ariaColCount:xp,ariaColIndex:xp,ariaColSpan:xp,ariaControls:kp,ariaCurrent:null,ariaDescribedBy:kp,ariaDetails:null,ariaDisabled:vp,ariaDropEffect:kp,ariaErrorMessage:null,ariaExpanded:vp,ariaFlowTo:kp,ariaGrabbed:vp,ariaHasPopup:null,ariaHidden:vp,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kp,ariaLevel:xp,ariaLive:null,ariaModal:vp,ariaMultiLine:vp,ariaMultiSelectable:vp,ariaOrientation:null,ariaOwns:kp,ariaPlaceholder:null,ariaPosInSet:xp,ariaPressed:vp,ariaReadOnly:vp,ariaRelevant:null,ariaRequired:vp,ariaRoleDescription:kp,ariaRowCount:xp,ariaRowIndex:xp,ariaRowSpan:xp,ariaSelected:vp,ariaSetSize:xp,ariaSort:null,ariaValueMax:xp,ariaValueMin:xp,ariaValueNow:xp,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Op(e,t){return t in e?e[t]:t}function Rp(e,t){return Op(e,t.toLowerCase())}const Lp=Pp({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Sp,acceptCharset:kp,accessKey:kp,action:null,allow:null,allowFullScreen:yp,allowPaymentRequest:yp,allowUserMedia:yp,alt:null,as:null,async:yp,autoCapitalize:null,autoComplete:kp,autoFocus:yp,autoPlay:yp,blocking:kp,capture:null,charSet:null,checked:yp,cite:null,className:kp,cols:xp,colSpan:null,content:null,contentEditable:vp,controls:yp,controlsList:kp,coords:xp|Sp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yp,defer:yp,dir:null,dirName:null,disabled:yp,download:wp,draggable:vp,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yp,formTarget:null,headers:kp,height:xp,hidden:wp,high:xp,href:null,hrefLang:null,htmlFor:kp,httpEquiv:kp,id:null,imageSizes:null,imageSrcSet:null,inert:yp,inputMode:null,integrity:null,is:null,isMap:yp,itemId:null,itemProp:kp,itemRef:kp,itemScope:yp,itemType:kp,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yp,low:xp,manifest:null,max:null,maxLength:xp,media:null,method:null,min:null,minLength:xp,multiple:yp,muted:yp,name:null,nonce:null,noModule:yp,noValidate:yp,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yp,optimum:xp,pattern:null,ping:kp,placeholder:null,playsInline:yp,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yp,referrerPolicy:null,rel:kp,required:yp,reversed:yp,rows:xp,rowSpan:xp,sandbox:kp,scope:null,scoped:yp,seamless:yp,selected:yp,shadowRootClonable:yp,shadowRootDelegatesFocus:yp,shadowRootMode:null,shape:null,size:xp,sizes:null,slot:null,span:xp,spellCheck:vp,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xp,step:null,style:null,tabIndex:xp,target:null,title:null,translate:null,type:null,typeMustMatch:yp,useMap:null,value:vp,width:xp,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kp,axis:null,background:null,bgColor:null,border:xp,borderColor:null,bottomMargin:xp,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yp,declare:yp,event:null,face:null,frame:null,frameBorder:null,hSpace:xp,leftMargin:xp,link:null,longDesc:null,lowSrc:null,marginHeight:xp,marginWidth:xp,noResize:yp,noHref:yp,noShade:yp,noWrap:yp,object:null,profile:null,prompt:null,rev:null,rightMargin:xp,rules:null,scheme:null,scrolling:vp,standby:null,summary:null,text:null,topMargin:xp,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xp,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yp,disableRemotePlayback:yp,prefix:null,property:null,results:xp,security:null,unselectable:null},space:"html",transform:Rp}),Ep=Pp({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cp,accentHeight:xp,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xp,amplitude:xp,arabicForm:null,ascent:xp,attributeName:null,attributeType:null,azimuth:xp,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xp,by:null,calcMode:null,capHeight:xp,className:kp,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xp,diffuseConstant:xp,direction:null,display:null,dur:null,divisor:xp,dominantBaseline:null,download:yp,dx:null,dy:null,edgeMode:null,editable:null,elevation:xp,enableBackground:null,end:null,event:null,exponent:xp,externalResourcesRequired:null,fill:null,fillOpacity:xp,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Sp,g2:Sp,glyphName:Sp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xp,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xp,horizOriginX:xp,horizOriginY:xp,id:null,ideographic:xp,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xp,k:xp,k1:xp,k2:xp,k3:xp,k4:xp,kernelMatrix:Cp,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xp,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xp,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xp,overlineThickness:xp,paintOrder:null,panose1:null,path:null,pathLength:xp,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kp,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xp,pointsAtY:xp,pointsAtZ:xp,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cp,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cp,rev:Cp,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cp,requiredFeatures:Cp,requiredFonts:Cp,requiredFormats:Cp,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xp,specularExponent:xp,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xp,strikethroughThickness:xp,string:null,stroke:null,strokeDashArray:Cp,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xp,strokeOpacity:xp,strokeWidth:null,style:null,surfaceScale:xp,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cp,tabIndex:xp,tableValues:null,target:null,targetX:xp,targetY:xp,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cp,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xp,underlineThickness:xp,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xp,values:null,vAlphabetic:xp,vMathematical:xp,vectorEffect:null,vHanging:xp,vIdeographic:xp,version:null,vertAdvY:xp,vertOriginX:xp,vertOriginY:xp,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xp,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Op}),Ip=Pp({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Dp=Pp({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rp}),Bp=Pp({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),jp=mp([Np,Lp,Ip,Dp,Bp],"html"),qp=mp([Np,Ep,Ip,Dp,Bp],"svg"),Fp={}.hasOwnProperty;const Hp=/["&'<>`]/g,$p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Gp=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Vp=/[|\\{}()[\]^$+*?.]/g,Up=new WeakMap;function Wp(e,t){return e=e.replace(t.subset?function(e){let t=Up.get(e);t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Vp,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),Up.set(e,t));return t}(t.subset):Hp,n),t.subset||t.escapeOnly?e:e.replace($p,function(e,n,i){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,i.charCodeAt(n+2),t)}).replace(Gp,n);function n(e,n,i){return t.format(e.charCodeAt(0),i.charCodeAt(n+1),t)}}const Yp=/[\dA-Fa-f]/;const Xp=/\d/;const Kp=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Jp={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Qp=["cent","copy","divide","gt","lt","not","para","times"],Zp={}.hasOwnProperty,ef={};let tf;for(tf in Jp)Zp.call(Jp,tf)&&(ef[Jp[tf]]=tf);const nf=/[^\dA-Za-z]/;function rf(e,t,n){let i,r=function(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!Yp.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(i=function(e,t,n,i){const r=String.fromCharCode(e);if(Zp.call(ef,r)){const e=ef[r],o="&"+e;return n&&Kp.includes(e)&&!Qp.includes(e)&&(!i||t&&61!==t&&nf.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const i=function(e,t,n){const i="&#"+String(e);return n&&t&&!Xp.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function of(e,t){return Wp(e,Object.assign({format:rf},t))}const sf=/^>|^->|<!--|-->|--!>|<!-$/g,af=[">"],lf=["<",">"];function cf(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}function df(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const uf=/[A-Z]/g,hf=/-[a-z]/g,pf=/^data[-\w.:]+$/i;function ff(e){return"-"+e.toLowerCase()}function mf(e){return e.charAt(1).toUpperCase()}function _f(e){return e.join(" ").trim()}const gf=/[ \t\n\f\r]/g;function bf(e){return"object"==typeof e?"text"===e.type&&yf(e.value):yf(e)}function yf(e){return""===e.replace(gf,"")}const vf=kf(1),wf=kf(-1),xf=[];function kf(e){return function(t,n,i){const r=t?t.children:xf;let o=(n||0)+e,s=r[o];if(!i)for(;s&&bf(s);)o+=e,s=r[o];return s}}const Sf={}.hasOwnProperty;function Cf(e){return function(t,n,i){return Sf.call(e,t.tagName)&&e[t.tagName](t,n,i)}}const Mf=Cf({body:function(e,t,n){const i=vf(n,t);return!i||"comment"!==i.type},caption:zf,colgroup:zf,dd:function(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dt:function(e,t,n){const i=vf(n,t);return Boolean(i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName))},head:zf,html:function(e,t,n){const i=vf(n,t);return!i||"comment"!==i.type},li:function(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&"li"===i.tagName},optgroup:function(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},p:function(e,t,n){const i=vf(n,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:Af,rt:Af,tbody:function(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},td:Tf,tfoot:function(e,t,n){return!vf(n,t)},th:Tf,thead:function(e,t,n){const i=vf(n,t);return Boolean(i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName))},tr:function(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&"tr"===i.tagName}});function zf(e,t,n){const i=vf(n,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&bf(i.value.charAt(0)))}function Af(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function Tf(e,t,n){const i=vf(n,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}const Pf=Cf({body:function(e){const t=vf(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&bf(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,n){const i=wf(n,t),r=vf(e,-1,!0);if(n&&i&&"element"===i.type&&"colgroup"===i.tagName&&Mf(i,n.children.indexOf(i),n))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const n=e.children[0];return!n||"element"===n.type},html:function(e){const t=vf(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const i=wf(n,t),r=vf(e,-1);if(n&&i&&"element"===i.type&&("thead"===i.tagName||"tbody"===i.tagName)&&Mf(i,n.children.indexOf(i),n))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const Nf={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Of(e,t,n){const i=function(e,t){const n=_p(t);let i=t,r=gp;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&pf.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(hf,mf);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!hf.test(e)){let n=e.replace(uf,ff);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=Ap}return new r(i,t)}(e.schema,t),r=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,o=e.settings.allowDangerousCharacters?0:1;let s,a=e.quote;if(!i.overloadedBoolean||n!==i.attribute&&""!==n?!i.boolean&&!i.overloadedBoolean||"string"==typeof n&&n!==i.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=of(i.attribute,Object.assign({},e.settings.characterReferences,{subset:Nf.name[r][o]}));return!0===n?l:(n=Array.isArray(n)?(i.commaSeparated?df:_f)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(s=of(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Nf.unquoted[r][o]}))),s!==n&&(e.settings.quoteSmart&&cf(n,a)>cf(n,e.alternative)&&(a=e.alternative),s=a+of(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?Nf.single:Nf.double)[r][o],attribute:!0}))+a),l+(s?"="+s:s)))}const Rf=["<","&"];function Lf(e,t,n,i){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?of(e.value,Object.assign({},i.settings.characterReferences,{subset:Rf})):e.value}const Ef=function(e,t){const n=t||{};function i(t,...n){let r=i.invalid;const o=i.handlers;if(t&&Fp.call(t,e)){const n=String(t[e]);r=Fp.call(o,n)?o[n]:i.unknown}if(r)return r.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,i){return i.settings.bogusComments?"<?"+of(e.value,Object.assign({},i.settings.characterReferences,{subset:af}))+">":"\x3c!--"+e.value.replace(sf,function(e){return of(e,Object.assign({},i.settings.characterReferences,{subset:lf}))})+"--\x3e"},doctype:function(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,i){const r=i.schema,o="svg"!==r.space&&i.settings.omitOptionalTags;let s="svg"===r.space?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===r.space&&"svg"===e.tagName&&(i.schema=qp);const c=function(e,t){const n=[];let i,r=-1;if(t)for(i in t)if(null!==t[i]&&void 0!==t[i]){const r=Of(e,i,t[i]);r&&n.push(r)}for(;++r<n.length;){const t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&'"'!==t&&"'"!==t&&(n[r]+=" ")}return n.join("")}(i,e.properties),d=i.all("html"===r.space&&"template"===e.tagName?e.content:e);return i.schema=r,d&&(s=!1),!c&&o&&Pf(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),s&&("svg"===r.space||i.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!i.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),s||o&&Mf(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Lf(e,0,n,i)},root:function(e,t,n,i){return i.all(e)},text:Lf}});const If={},Df={},Bf=[];function jf(e,t,n){return Ef(e,t,n,this)}function qf(e){const t=[],n=e&&e.children||Bf;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function Ff(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},i="string"==typeof e?e:e.name;for(const[e,r]of Object.entries(t?.colorReplacements||{}))"string"==typeof r?n[e]=r:e===i&&Object.assign(n,r);return n}function Hf(e,t){return e&&t?.[e?.toLowerCase()]||e}async function $f(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function Gf(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Vf(e){return"ansi"===e||Gf(e)}function Uf(e){return"none"===e}function Wf(e){return Uf(e)}function Yf(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Xf(e,t=!1){const n=e.split(/(\r?\n)/g);let i=0;const r=[];for(let e=0;e<n.length;e+=2){const o=t?n[e]+(n[e+1]||""):n[e];r.push([o,i]),i+=n[e].length,i+=n[e+1]?.length||0}return r}const Kf="light-dark()",Jf=["color","background-color"];function Qf(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&dh.Italic&&(t["font-style"]="italic"),e.fontStyle&dh.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&dh.Underline&&n.push("underline"),e.fontStyle&dh.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Zf(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const em=new WeakMap;function tm(e,t){em.set(e,t)}function nm(e){return em.get(e)}class im{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new im(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,hp])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,i]=e;this.lang=n,this._stacks={[i]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;function i(e){if(n.has(e))return;n.add(e);const r=e?.nameScopesList?.scopeName;r&&t.push(r),e.parent&&i(e.parent)}return i(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function rm(){const e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new Yu(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...i.indexToPos(e),offset:e}}{const t=i.lines[e.line];if(void 0===t)throw new Yu(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Yu(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:i.posToIndex(e.line,n)}}};const i=function(e){const t=Xf(e,!0).map(([e])=>e);return{lines:t,indexToPos:function(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=n,r=0;for(const e of t){if(i<e.length)break;i-=e.length,r++}return{line:r,character:i}},posToIndex:function(e,n){let i=0;for(let n=0;n<e;n++)i+=t[n].length;return i+=n,i}}}(t.source),r=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));!function(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Yu(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const t=e[i],r=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,o=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,s=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,a=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(r||o||s||a){if(r&&o)continue;if(s&&a)continue;if(s&&n.start.offset===n.end.offset)continue;if(o&&t.start.offset===t.end.offset)continue;throw new Yu(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(r),e.set(t.meta,{decorations:r,converter:i,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(!this.options.decorations?.length)return;const n=function(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{const t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?function(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}(e,t):e})):e}(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]));return n},code(e){if(!this.options.decorations?.length)return;const n=t(this),i=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(i.length!==n.converter.lines.length)throw new Yu(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function r(e,t,n,r){const o=i[e];let a="",l=-1,c=-1;if(0===t&&(l=0),0===n&&(c=0),n===Number.POSITIVE_INFINITY&&(c=o.children.length),-1===l||-1===c)for(let e=0;e<o.children.length;e++)a+=om(o.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new Yu(`Failed to find start index for decoration ${JSON.stringify(r.start)}`);if(-1===c)throw new Yu(`Failed to find end index for decoration ${JSON.stringify(r.end)}`);const d=o.children.slice(l,c);if(r.alwaysWrap||d.length!==o.children.length)if(r.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};s(e,r,"wrapper"),o.children.splice(l,d.length,e)}else s(d[0],r,"token");else s(o,r,"line")}function o(e,t){i[e]=s(i[e],t,"line")}function s(e,t,n){const i=t.properties||{},r=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...i,class:e.properties.class},t.properties?.class&&Yf(e,t.properties.class),e=r(e,n)||e}const a=[],l=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(const e of l){const{start:t,end:n}=e;if(t.line===n.line)r(t.line,t.character,n.character,e);else if(t.line<n.line){r(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let i=t.line+1;i<n.line;i++)a.unshift(()=>o(i,e));r(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function om(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(om).join(""):""}const sm=[rm()];function am(e){const t=function(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...sm]}var lm=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],cm={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function dm(e,t){const n=e.indexOf("",t);if(-1!==n&&"["===e[n+1]){const t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}function um(e){const t=e.shift();if("2"===t){const t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function hm(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(0===i)t.push({type:"resetAll"});else if(i<=9){cm[i]&&t.push({type:"setDecoration",value:cm[i]})}else if(i<=29){const e=cm[i-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:lm[i-30]}});else if(38===i){const n=um(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===i)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:lm[i-40]}});else if(48===i){const n=um(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===i?t.push({type:"resetBackgroundColor"}):53===i?t.push({type:"setDecoration",value:"overline"}):55===i?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:lm[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:lm[i-100+8]}})}return t}var pm={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function fm(e=pm){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(e){return function(){if(i)return i;i=[];for(let e=0;e<lm.length;e++)i.push(t(lm[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let r=0;r<6;r++)for(let o=0;o<6;o++)i.push(n([e[t],e[r],e[o]]));let r=8;for(let e=0;e<24;e++,r+=10)i.push(n([r,r,r]));return i}()[e]}return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return r(e.index)}}}}function mm(e,t,n){const i=Ff(e,n),r=Xf(t),o=fm(Object.fromEntries(lm.map(t=>[t,e.colors?.[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]]))),s=function(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let o=0;do{const s=dm(i,o),a=s.sequence?i.substring(o,s.startPosition):i.substring(o);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const i=hm(s.sequence);for(const r of i)"resetAll"===r.type?(e=null,t=null,n.clear()):"resetForegroundColor"===r.type?e=null:"resetBackgroundColor"===r.type?t=null:"resetDecoration"===r.type&&n.delete(r.value);for(const r of i)"setForegroundColor"===r.type?e=r.value:"setBackgroundColor"===r.type?t=r.value:"setDecoration"===r.type&&n.add(r.value)}o=s.position}while(o<i.length);return r}}}();return r.map(t=>s.parse(t[0]).map(n=>{let r,s;n.decorations.has("reverse")?(r=n.background?o.value(n.background):e.bg,s=n.foreground?o.value(n.foreground):e.fg):(r=n.foreground?o.value(n.foreground):e.fg,s=n.background?o.value(n.background):void 0),r=Hf(r,i),s=Hf(s,i),n.decorations.has("dim")&&(r=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(e=>`${e}${e}`).join("")}80`}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(r));let a=dh.None;return n.decorations.has("bold")&&(a|=dh.Bold),n.decorations.has("italic")&&(a|=dh.Italic),n.decorations.has("underline")&&(a|=dh.Underline),n.decorations.has("strikethrough")&&(a|=dh.Strikethrough),{content:n.value,offset:t[1],color:r,bgColor:s,fontStyle:a}}))}function _m(e,t,n={}){const{lang:i="text",theme:r=e.getLoadedThemes()[0]}=n;if(Gf(i)||Uf(r))return Xf(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:o,colorMap:s}=e.setTheme(r);if("ansi"===i)return mm(o,t,n);const a=e.getLanguage(i);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Yu(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new Yu(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return function(e,t,n,i,r){const o=bm(e,t,n,i,r),s=new im(bm(e,t,n,i,r).stateStack,t.name,n.name);return tm(o.tokens,s),o.tokens}(t,a,o,s,n)}function gm(...e){if(2===e.length)return nm(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=i;if(Gf(r)||Uf(o))throw new Yu("Plain language does not have grammar state");if("ansi"===r)throw new Yu("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(r);return new im(bm(n,l,s,a,i).stateStack,l.name,s.name)}function bm(e,t,n,i,r){const o=Ff(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=r,l=Xf(e);let c=r.grammarState?function(e,t){if(!(e instanceof im))throw new Yu("Invalid grammar state");return e.getInternalStack(t)}(r.grammarState,n.name)??hp:null!=r.grammarContextCode?bm(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:hp,d=[];const u=[];for(let e=0,h=l.length;e<h;e++){const[h,p]=l[e];if(""===h){d=[],u.push([]);continue}if(s>0&&h.length>=s){d=[],u.push([{content:h,offset:p,color:"",fontStyle:0}]);continue}let f,m,_;r.includeExplanation&&(f=t.tokenizeLine(h,c,a),m=f.tokens,_=0);const g=t.tokenizeLine2(h,c,a),b=g.tokens.length/2;for(let e=0;e<b;e++){const t=g.tokens[2*e],s=e+1<b?g.tokens[2*e+2]:h.length;if(t===s)continue;const a=g.tokens[2*e+1],l=Hf(i[mh.getForeground(a)],o),c=mh.getFontStyle(a),u={content:h.substring(t,s),offset:p+t,color:l,fontStyle:c};if(r.includeExplanation){const e=[];if("scopeName"!==r.includeExplanation)for(const t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}u.explanation=[];let i=0;for(;t+i<s;){const t=m[_],n=h.substring(t.startIndex,t.endIndex);i+=n.length,u.explanation.push({content:n,scopes:"scopeName"===r.includeExplanation?ym(t.scopes):vm(e,t.scopes)}),_+=1}}d.push(u)}u.push(d),d=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function ym(e){return e.map(e=>({scopeName:e}))}function vm(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];n[i]={scopeName:r,themeMatches:km(e,r,t.slice(0,i))}}return n}function wm(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function xm(e,t,n){if(!wm(e[e.length-1],t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)wm(e[i],n[r])&&(i-=1),r-=1;return-1===i}function km(e,t,n){const i=[];for(const{selectors:r,settings:o}of e)for(const e of r)if(xm(e,t,n)){i.push(o);break}return i}function Sm(e,t,n){const i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),r=i.map(i=>{const r=_m(e,t,{...n,theme:i.theme});return{tokens:r,state:nm(r),theme:"string"==typeof i.theme?i.theme:i.theme.name}}),o=function(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(e=>e[i]),o=t.map(()=>[]);t.forEach((e,t)=>e.push(o[t]));const s=r.map(()=>0),a=r.map(e=>e[0]);for(;a.every(e=>e);){const e=Math.min(...a.map(e=>e.content.length));for(let t=0;t<n;t++){const n=a[t];n.content.length===e?(o[t].push(n),s[t]+=1,a[t]=r[t][s[t]]):(o[t].push({...n,content:n.content.slice(0,e)}),a[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...r.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{const s={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(s.explanation=e.explanation),o.forEach((e,n)=>{const{content:o,explanation:a,offset:l,...c}=e[t][r];s.variants[i[n].color]=c}),s})),a=r[0].state?new im(Object.fromEntries(r.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),r[0].state.lang):void 0;return a&&tm(s,a),s}function Cm(e,t,n){let i,r,o,s,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:t.color===c?1:0);if(0===h.length)throw new Yu("`themes` option must not be empty");const p=Sm(e,t,n);if(l=nm(p),c&&Kf!==c&&!h.find(e=>e.color===c))throw new Yu(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=h.map(t=>e.getTheme(t.theme)),m=h.map(e=>e.color);o=p.map(e=>e.map(e=>function(e,t,n,i,r="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(t=>Qf(e.variants[t])),a=new Set(s.flatMap(e=>Object.keys(e))),l={},c=(e,i)=>{const r="color"===i?"":"background-color"===i?"-bg":`-${i}`;return n+t[e]+("color"===i?"":r)};return s.forEach((e,n)=>{for(const o of a){const a=e[o]||"inherit";if(0===n&&i&&Jf.includes(o))if(i===Kf&&s.length>1){const e=t.findIndex(e=>"light"===e),i=t.findIndex(e=>"dark"===e);if(-1===e||-1===i)throw new Yu('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=s[e][o]||"inherit",u=s[i][o]||"inherit";l[o]=`light-dark(${d}, ${u})`,"css-vars"===r&&(l[c(n,o)]=a)}else l[o]=a;else"css-vars"===r&&(l[c(n,o)]=a)}}),o.htmlStyle=l,o}(e,m,d,c,u))),l&&tm(o,l);const _=h.map(e=>Ff(e.theme,n));r=Mm(h,f,_,d,c,"fg",u),i=Mm(h,f,_,d,c,"bg",u),s=`shiki-themes ${f.map(e=>e.name).join(" ")}`,a=c?void 0:[r,i].join(";")}else{if(!("theme"in n))throw new Yu("Invalid options, either `theme` or `themes` must be provided");{const a=Ff(n.theme,n);o=_m(e,t,n);const c=e.getTheme(n.theme);i=Hf(c.bg,a),r=Hf(c.fg,a),s=c.name,l=nm(o)}}return{tokens:o,fg:r,bg:i,themeName:s,rootStyle:a,grammarState:l}}function Mm(e,t,n,i,r,o,s){return e.map((a,l)=>{const c=Hf(t[l][o],n[l])||"inherit",d=`${i+a.color}${"bg"===o?"-bg":""}:${c}`;if(0===l&&r){if(r===Kf&&e.length>1){const i=e.findIndex(e=>"light"===e.color),r=e.findIndex(e=>"dark"===e.color);if(-1===i||-1===r)throw new Yu('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Hf(t[i][o],n[i])||"inherit"}, ${Hf(t[r][o],n[r])||"inherit"});${d}`}return c}return"css-vars"===s?d:null}).filter(e=>!!e).join(";")}function zm(e,t,n,i={meta:{},options:n,codeToHast:(t,n)=>zm(e,t,n),codeToTokens:(t,n)=>Cm(e,t,n)}){let r=t;for(const e of am(n))r=e.preprocess?.call(i,r,n)||r;let{tokens:o,fg:s,bg:a,themeName:l,rootStyle:c,grammarState:d}=Cm(e,r,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;!0===u?o=function(e){return e.map(e=>{const t=[];let n="",i=0;return e.forEach((r,o)=>{const s=!(r.fontStyle&&(r.fontStyle&dh.Underline||r.fontStyle&dh.Strikethrough));s&&r.content.match(/^\s+$/)&&e[o+1]?(i||(i=r.offset),n+=r.content):n?(s?t.push({...r,offset:i,content:n+r.content}):t.push({content:n,offset:i},r),i=0,n=""):t.push(r)}),t})}(o):"never"===u&&(o=function(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;const t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;const[,n,i,r]=t;if(!n&&!r)return e;const o=[{...e,offset:e.offset+n.length,content:i}];return n&&o.unshift({content:n,offset:e.offset}),r&&o.push({content:r,offset:e.offset+n.length+i.length}),o}))}(o)),h&&(o=function(e){return e.map(e=>{const t=[];for(const n of e){if(0===t.length){t.push({...n});continue}const e=t[t.length-1],i=Zf(e.htmlStyle||Qf(e)),r=Zf(n.htmlStyle||Qf(n)),o=e.fontStyle&&(e.fontStyle&dh.Underline||e.fontStyle&dh.Strikethrough),s=n.fontStyle&&(n.fontStyle&dh.Underline||n.fontStyle&dh.Strikethrough);o||s||i!==r?t.push({...n}):e.content+=n.content}return t})}(o));const p={...i,get source(){return r}};for(const e of am(n))o=e.tokens?.call(p,o)||o;return function(e,t,n,i=nm(e)){const r=am(t),o=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...!1!==l&&null!=l?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([e])=>!e.startsWith("_")))},children:[]},d={type:"element",tagName:"code",properties:{},children:o};const u=[],h={...n,structure:a,addClassToHast:Yf,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return d},get lines(){return u}};if(e.forEach((e,t)=>{t&&("inline"===a?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===a&&o.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},i=0;for(const o of e){let e={type:"element",tagName:"span",properties:{...o.htmlAttrs},children:[{type:"text",value:o.content}]};const l=Zf(o.htmlStyle||Qf(o));l&&(e.properties.style=l);for(const s of r)e=s?.span?.call(h,e,t+1,i,n,o)||e;"inline"===a?s.children.push(e):"classic"===a&&n.children.push(e),i+=o.content.length}if("classic"===a){for(const e of r)n=e?.line?.call(h,n,t+1)||n;u.push(n),o.push(n)}}),"classic"===a){for(const e of r)d=e?.code?.call(h,d)||d;c.children.push(d);for(const e of r)c=e?.pre?.call(h,c)||c;s.children.push(c)}let p=s;for(const e of r)p=e?.root?.call(h,p)||p;i&&tm(p,i);return p}(o,{...n,fg:s,bg:a,themeName:l,rootStyle:c},p,d)}const Am=function(e,t){const n=t||If,i=n.quote||'"',r='"'===i?"'":'"';if('"'!==i&&"'"!==i)throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:jf,all:qf,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||pp,characterReferences:n.characterReferences||Df,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?qp:jp,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)};function Tm(e,t,n){const i={meta:{},options:n,codeToHast:(t,n)=>zm(e,t,n),codeToTokens:(t,n)=>Cm(e,t,n)};let r=Am(zm(e,t,n,i));for(const e of am(n))r=e.postprocess?.call(i,r,n)||r;return r}const Pm="#333333",Nm="#bbbbbb",Om="#fffffe",Rm="#1e1e1e",Lm="__shiki_resolved";function Em(e){if(e?.[Lm])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(i=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i="light"===t.type?Pm:Nm),n||(n="light"===t.type?Om:Rm),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const o=new Map;function s(e){if(o.has(e))return o.get(e);r+=1;const n=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?s(e):(o.set(e,n),n)}t.settings=t.settings.map(e=>{const n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),i=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!i)return e;const r={...e,settings:{...e.settings}};if(n){const n=s(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,r.settings.foreground=n}if(i){const n=s(e.settings.background);t.colorReplacements[n]=e.settings.background,r.settings.background=n}return r});for(const e of Object.keys(t.colors||{}))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){const n=s(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Lm,{enumerable:!1,writable:!1,value:!0}),t}async function Im(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Vf(e)).map(async e=>await $f(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function Dm(e){return(await Promise.all(e.map(async e=>Wf(e)?null:Em(await $f(e))))).filter(e=>!!e)}let Bm=3,jm=!1;class qm extends Error{constructor(e){super(e),this.name="ShikiError"}}class Fm extends up{constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Em(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=oh.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){if(this._alias[e]){const t=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],t.has(e))throw new qm(`Circular alias \`${Array.from(t).join(" -> ")} -> ${e}\``);t.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(const e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const t of e)this.resolveEmbeddedLanguages(t);const t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){const e=t.filter(([e,t])=>t&&t.embeddedLangs?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new qm(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(const[e,n]of t)this._resolver.addLanguage(n);for(const[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap.get(t))}}class Hm{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let e=1;e<=t.length;e++){const i=t.slice(0,e).join(".");n=[...n,...this._injections.get(i)||[]]}return n}}let $m=0;function Gm(e){$m+=1,!1!==e.warnings&&$m>=10&&$m%10==0&&console.warn(`[Shiki] ${$m} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new qm("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(Em),r=new Hm(e.engine,n),o=new Fm(r,i,n,e.langAlias);let s;function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();const t=o.getTheme(e);if(!t)throw new qm(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),o.loadLanguages(e.flat(1))}function c(...e){d();for(const t of e.flat(1))o.loadTheme(t)}function d(){if(t)throw new qm("Shiki instance has been disposed")}function u(){t||(t=!0,o.dispose(),$m-=1)}return{setTheme:function(e){d();const t=a(e);return s!==e&&(o.setTheme(t),s=e),{theme:t,colorMap:o.getColorMap()}},getTheme:a,getLanguage:function(e){d();const t=o.getGrammar("string"==typeof e?e:e.name);if(!t)throw new qm(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),o.getLoadedThemes()},getLoadedLanguages:function(){return d(),o.getLoadedLanguages()},loadLanguage:async function(...e){return l(await Im(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await Dm(e))},loadThemeSync:c,dispose:u,[Symbol.dispose]:u}}async function Vm(e){e.engine||function(e,t=3){if(Bm&&!("number"==typeof Bm&&t>Bm)){if(jm)throw new Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([Dm(e.themes||[]),Im(e.langs||[]),e.engine]);return Gm({...e,themes:t,langs:n,engine:i})}async function Um(e){const t=await Vm(e);return{getLastGrammarState:(...e)=>gm(t,...e),codeToTokensBase:(e,n)=>_m(t,e,n),codeToTokensWithThemes:(e,n)=>Sm(t,e,n),codeToTokens:(e,n)=>Cm(t,e,n),codeToHast:(e,n)=>zm(t,e,n),codeToHtml:(e,n)=>Tm(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Wm(e){const t=e.langs,n=e.themes,i=e.engine;return async function(e){function r(n){if("string"==typeof n){if(Vf(n))return[];n=e.langAlias?.[n]||n;const i=t[n];if(!i)throw new Yu(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return i}return n}function o(e){if(Wf(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new Yu(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}const s=(e.themes??[]).map(e=>o(e)),a=(e.langs??[]).map(e=>r(e)),l=await Um({engine:e.engine??i(),...e,themes:s,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(r)),loadTheme:(...e)=>l.loadTheme(...e.map(o)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function Ym(e,t){const n=function(e){let t;return async function(n={}){if(t){const e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}}(e);async function i(e,i){const r=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),o=await(t?.guessEmbeddedLanguages?.(e,i.lang,r));return o&&await r.loadLanguage(...o),r}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await i(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await i(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await i(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await i(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await i(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class Xm extends Error{constructor(e){super(e),this.name="ShikiError"}}function Km(){return"undefined"!=typeof performance?performance.now():Date.now()}const Jm=(e,t)=>e+(t-e%t)%t;async function Qm(e){let t,n;const i={};function r(e){n=e,i.HEAPU8=new Uint8Array(e),i.HEAPU32=new Uint32Array(e)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}const s="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){const i=t+n;let r=t;for(;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&s)return s.decode(e.subarray(t,r));let o="";for(;t<r;){let n=e[t++];if(!(128&n)){o+=String.fromCharCode(n);continue}const i=63&e[t++];if(192==(224&n)){o+=String.fromCharCode((31&n)<<6|i);continue}const r=63&e[t++];if(n=224==(240&n)?(15&n)<<12|i<<6|r:(7&n)<<18|i<<12|r<<6|63&e[t++],n<65536)o+=String.fromCharCode(n);else{const e=n-65536;o+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return o}(i.HEAPU8,e,t):""}const l={emscripten_get_now:Km,emscripten_memcpy_big:function(e,t,n){i.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=i.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let i=1;i<=4;i*=2){let r=t*(1+.2/i);r=Math.min(r,e+100663296);if(o(Math.min(n,Jm(Math.max(e,r),65536))))return!0}return!1},fd_write:()=>0};return await async function(){const n={env:l,wasi_snapshot_preview1:l},o=await e(n);t=o.memory,r(t.buffer),Object.assign(i,o),i.UTF8ToString=a}(),i}var Zm=Object.defineProperty,e_=(e,t,n)=>((e,t,n)=>t in e?Zm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let t_=null;class n_{constructor(e){e_(this,"utf16Length"),e_(this,"utf8Length"),e_(this,"utf16Value"),e_(this,"utf8Value"),e_(this,"utf16OffsetToUtf8"),e_(this,"utf8OffsetToUtf16");const t=e.length,n=n_._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;i&&(r[t]=n);const o=i?new Uint32Array(n+1):null;i&&(o[n]=t);const s=new Uint8Array(n);let a=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let c=l,d=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(c=65536+(l-55296<<10)|t-56320,d=!0)}i&&(r[n]=a,d&&(r[n+1]=a),c<=127?o[a+0]=n:c<=2047?(o[a+0]=n,o[a+1]=n):c<=65535?(o[a+0]=n,o[a+1]=n,o[a+2]=n):(o[a+0]=n,o[a+1]=n,o[a+2]=n,o[a+3]=n)),c<=127?s[a++]=c:c<=2047?(s[a++]=192|(1984&c)>>>6,s[a++]=128|(63&c)>>>0):c<=65535?(s[a++]=224|(61440&c)>>>12,s[a++]=128|(4032&c)>>>6,s[a++]=128|(63&c)>>>0):(s[a++]=240|(1835008&c)>>>18,s[a++]=128|(258048&c)>>>12,s[a++]=128|(4032&c)>>>6,s[a++]=128|(63&c)>>>0),d&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){const r=e.charCodeAt(n);let o=r,s=!1;if(r>=55296&&r<=56319&&n+1<i){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(o=65536+(r-55296<<10)|t-56320,s=!0)}t+=o<=127?1:o<=2047?2:o<=65535?3:4,s&&n++}return t}createString(e){const t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}const i_=class e{constructor(t){if(e_(this,"id",++e.LAST_ID),e_(this,"_onigBinding"),e_(this,"content"),e_(this,"utf16Length"),e_(this,"utf8Length"),e_(this,"utf16OffsetToUtf8"),e_(this,"utf8OffsetToUtf16"),e_(this,"ptr"),!t_)throw new Xm("Must invoke loadWasm first.");this._onigBinding=t_,this.content=t;const n=new n_(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=t_.omalloc(1e4)),e._sharedPtrInUse=!0,t_.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(t_)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};e_(i_,"LAST_ID",0),e_(i_,"_sharedPtr",0),e_(i_,"_sharedPtrInUse",!1);let r_,o_=i_;class s_{constructor(e){if(e_(this,"_onigBinding"),e_(this,"_ptr"),!t_)throw new Xm("Must invoke loadWasm first.");const t=[],n=[];for(let i=0,r=e.length;i<r;i++){const r=new n_(e[i]);t[i]=r.createString(t_),n[i]=r.utf8Length}const i=t_.omalloc(4*e.length);t_.HEAPU32.set(t,i/4);const r=t_.omalloc(4*e.length);t_.HEAPU32.set(n,r/4);const o=t_.createOnigScanner(i,r,e.length);for(let n=0,i=e.length;n<i;n++)t_.ofree(t[n]);t_.ofree(r),t_.ofree(i),0===o&&function(e){throw new Xm(e.UTF8ToString(e.getLastOnigError()))}(t_),this._onigBinding=t_,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if("number"==typeof n&&(i=n),"string"==typeof e){e=new o_(e);const n=this._findNextMatchSync(e,t,!1,i);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){const r=this._onigBinding,o=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(0===o)return null;const s=r.HEAPU32;let a=o/4;const l=s[a++],c=s[a++],d=[];for(let t=0;t<c;t++){const n=e.convertUtf8OffsetToUtf16(s[a++]),i=e.convertUtf8OffsetToUtf16(s[a++]);d[t]={start:n,end:i,length:i-n}}return{index:l,captureIndices:d}}}function a_(e){if(r_)return r_;return r_=async function(){t_=await Qm(async t=>{let n=e;var i;return n=await n,"function"==typeof n&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator?n=await n.instantiator(t):!function(e){return"function"==typeof e.default}(n)?(function(e){return void 0!==e.data}(n)&&(n=n.data),!function(e){return"undefined"!=typeof Response&&e instanceof Response}(n)?!function(e){return"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||"undefined"!=typeof Buffer&&Buffer.isBuffer?.(e)||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||"undefined"!=typeof Uint32Array&&e instanceof Uint32Array}(n)?n instanceof WebAssembly.Module?n=await l_(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await l_(n.default)(t)):n=await l_(n)(t):n="function"==typeof WebAssembly.instantiateStreaming?await(i=n,e=>WebAssembly.instantiateStreaming(i,e))(t):await function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(n)(t)):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),r_}function l_(e){return t=>WebAssembly.instantiate(e,t)}const c_=Wm({langs:Vu,themes:Wu,engine:()=>async function(e){return e&&await a_(e),{createScanner:e=>new s_(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new o_(e)}}(r.e(4709).then(r.bind(r,4709)))}),{codeToHtml:d_,codeToHast:u_,codeToTokens:h_,codeToTokensBase:p_,codeToTokensWithThemes:f_,getSingletonHighlighter:m_,getLastGrammarState:__}=Ym(c_,{guessEmbeddedLanguages:function(e,t,n){const i=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))i.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))i.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))i.add(t[1]);if(!n)return Array.from(i);const r=n.getBundledLanguages();return Array.from(i).filter(e=>e&&r[e])}}),g_=["id","data-type"],b_=["data-id","onClick"],y_=["innerHTML"],v_=["disabled"],w_=Bn({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:i}=t,r=Kt(),o=Kt(),s=Kt(),a=Kt();function l(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>l(e)):void 0}function c(){const t=e.cube._draglist;if(!t)return;const n=e.cube.get_upstream_sum_scale();t.scale_h=n.sx,t.scale_v=n.sy}function d(){const t=r.value,n=s.value;t&&n&&(e.cube._draglist=new Io.DragList(t,"horizental","data-id","insert"),c(),e.cube._draglist.register_start(c),l(e.cube))}let u;cr(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=a.value;t&&n&&(n.value=t.code)},{immediate:!0}),cr(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=a.value,i=n?.previousElementSibling;if(!t||!n||!i)return;const r=n.parentElement;yn(()=>{const t=i.nextElementSibling,n=i.firstElementChild;if(t&&n){if(r){const t=n.style.backgroundColor;if(t.startsWith("rgb")){const n=t.replace("rgb","rgba").replace(")",", 0.85)");e.cube.attrs.codebg=n}else e.cube.attrs.codebg=t;e.cube.attrs.caret=n.style.color}n.style.border="none",n.style.outline="none"}})}),ni(()=>{d(),function(){const t=s.value,n=a.value;if(!t)return;n&&(n.value=e.cube.active_tab?.code||"");const i=o.value;if(!i)return;u=new Io.DragDiff(i);let r=e.cube.attrs.width,l=e.cube.attrs.height,c=r,d=l;u.register_down(()=>{r=e.cube.attrs.width,l=e.cube.attrs.height}),u.register_move((e,n)=>{c=Math.round(e+r),d=Math.round(n+l),t.style.width=c+"px",t.style.height=d+"px"}),u.register_up((t,n)=>{if(r===c&&l===d)return;const i=e.cube.courier.get_recorder(),o=Math.round(t+r),s=Math.round(n+l);i.tell(e.cube,Lo.resize(e.cube.id,o,s)),e.cube.history.record(i)}),u.register_cancel(()=>{e.cube.attrs.width=r,e.cube.attrs.height=l})}()}),si(()=>{u?.off()});const h=wo(()=>({"caret-color":e.cube.attrs.caret}));function p(e){e.stopPropagation()}function f(t){const n=t.previousElementSibling;t.parentElement;if(!n)return;const i=t.value,{id:r,courier:o,history:s}=e.cube,a=e.cube.tabbar_height,l=e.cube.max_height_auto,c=o.get_recorder(),d=Fu.update(r,e.cube.active_tab_id,i);c.tell(e.cube,d),yn(()=>{const n=t.scrollHeight+a;console.log("🟡",e.cube.attrs.height,t.scrollHeight,a);const i=Math.min(l,n),o=Lo.set_attr(r,{height:i});c.tell(e.cube,o),s.record(c)})}function m(e){const t=e.currentTarget;t.value;f(t)}function _(e){const{hotkeys:n,clipboard:i,history:r}=t,o=e.key.toLowerCase();if([n.data[A["scope-add"]]].some(t=>n.validate(e,t)))return e.preventDefault();if(t.scope_count_normal>0&&["backspace","delete"].includes(o)){e.preventDefault(),e.stopPropagation();const t=i.delete_scope();return void(t&&r.record(t))}const s=e.currentTarget;if("tab"===o){e.preventDefault(),e.stopPropagation();let t=s.value;const n=s.selectionStart,i=s.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(i),s.value=t,s.selectionStart=n+1,s.selectionEnd=n+1,f(s)}}function g(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function b(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?Io.DomAnimation.scroll_element(n,t,"horizental"):Io.DomAnimation.scroll_element(n,-t,"horizental")}function y(e){const t=e.currentTarget,n=t.firstElementChild,i=t.lastElementChild;if(!n||!i)return;const r=e.shiftKey,{scrollLeft:o,scrollTop:s,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?r?o+c.width<a&&(e.preventDefault(),e.stopPropagation(),Io.DomAnimation.scroll_element(t,20,"horizental")):s+c.height<l&&(e.preventDefault(),e.stopPropagation(),Io.DomAnimation.scroll_element(t,20,"vertical")):r?o>0&&(e.preventDefault(),e.stopPropagation(),Io.DomAnimation.scroll_element(t,-20,"horizental")):s>0&&(e.preventDefault(),e.stopPropagation(),Io.DomAnimation.scroll_element(t,-20,"vertical"))}function v(t){ha(t,e.cube)}return(t,l)=>(Nr(),Ir("div",{class:"cube-code",id:t.cube.id,"data-type":Zt(n).code,ref_key:"code",ref:s,style:me(t.cube.css),onPointerdown:p,onBeforeinput:p,onCompositionstart:p,onContextmenu:v},[Hr("div",{class:"code-tabbar",onWheel:b},[Hr("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[(Nr(!0),Ir(Cr,null,_i(t.cube.items,n=>(Nr(),Ir("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:i}=e.cube,r=n.get_recorder();r.tell(e.cube,Fu.change_active(e.cube.id,t.id)),i.record(r)}(n)},[Hr("div",{class:ve(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},Ce(n.name),3)],8,b_))),128))],512)],32),Hr("div",{class:"code-box",onWheel:y},[Hr("div",{class:"code-box-inner",style:me({background:t.cube.attrs.codebg})},[Hr("span",{class:"code-highlight",onWheel:l[0]||(l[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,y_),Hr("textarea",{disabled:Zt(i).is_read_mode,ref_key:"textarea",ref:a,style:me(h.value),onKeyup:g,onKeydown:_,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:m},null,44,v_)],4)],32),Hr("div",{class:"code-dragger",ref_key:"code_dragger",ref:o},null,512)],44,g_))}}),x_=(0,Js.A)(w_,[["__scopeId","data-v-046389ca"]]),k_={".py":"python",".java":"java",".c":"c",".cpp":"c++",".js":"javascript",".html":"html",".css":"css",".php":"php",".rb":"ruby",".go":"go",".swift":"swift",".kt":"kotlin",".rs":"rust",".ts":"typescript",".sh":"shell",".pl":"perl",".cs":"c#",".sql":"sql",".r":"r",".m":"matlab",".adb":"ada",".ads":"ada",".lua":"lua",".scala":"scala",".dart":"dart",".hs":"haskell",".erl":"erlang",".ex":"elixir",".jl":"julia",".groovy":"groovy",".fs":"f#",".clj":"clojure",".scm":"scheme",".ml":"ocaml",".pas":"pascal",".d":"d",".nim":"nim",".zig":"zig",".v":"v",".coffee":"coffeescript",".litcoffee":"coffeescript",".vue":"vue",".svelte":"svelte",".elm":"elm",".purs":"purescript",".exs":"elixir",".eex":"elixir",".heex":"elixir",".tcl":"tcl",".tk":"tcl",".awk":"awk",".ps1":"powershell",".psm1":"powershell",".psd1":"powershell",".bat":"batch",".cmd":"batch",".json":"json",".xml":"xml",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".md":"markdown",".markdown":"markdown",".tex":"latex",".sty":"latex",".cls":"latex",".bib":"bibtex",".csv":"csv",".tsv":"tsv",".log":"log"};function S_(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}const C_="dracula";class M_ extends cs{_code_html=Kt("");static _langs=[...Object.keys(Vu)];static _themes=[...Object.keys(Wu)];static get langs(){return[...this._langs]}static get themes(){return[...this._themes]}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get tabbar_height(){return 36}get max_height_auto(){return 600}get langs(){return[...M_._langs]}get themes(){return[...M_._themes]}_draglist;get component(){return x_}get items(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}set active_tab_id(e){const t=this.items.find(t=>t.id===e);t&&(this.info.active_tab_id=t.id)}get active_tab(){return this.items.find(e=>e.id===this.active_tab_id)}get code_html(){return this._code_html.value}get info(){return this.data.info}get css(){const e=this.config.data.line_indent,t=this.attrs.indent,n=this.attrs.width,i=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:i+"px"}}get attrs(){return this.data.attrs}init(){this.update_active_code_html()}export(){return this.base_export()}gc(){super.base_gc()}build_child(e){}update_data(e,t){return M_.update_data(e,t)}update_active_code_html(){if(0===this.items.length)this._code_html.value="";else{const e=this.active_tab;if(!e)return;this.code_to_html(e).then(e=>{this._code_html.value=e})}}code_to_html(e){return d_(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return M_.meta}create_tab(e,t,n=C_){return{id:To.get_id(),name:t,lang:e,code:"",theme:n||C_}}replace_id(e,t={}){return M_.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return Mo.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),i=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(i).then(e=>{Mo.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:i,id:r}=this,o=i.get_recorder(),s=this.items.find(e=>e.id===t);if(!s)return;const a=s.lang;return s.lang=n,o.add_recover(Fu.change_lang(r,t,a)),this.update_active_code_html(),o}change_theme(e){const{tabid:t,theme:n}=e,{courier:i,id:r}=this,o=i.get_recorder(),s=this.items.find(e=>e.id===t);if(!s)return;const a=s.theme;return s.theme=n,o.add_recover(Fu.change_theme(r,t,a)),this.update_active_code_html(),o}code_update(e){const{tabid:t,code:n}=e,{courier:i,id:r}=this,o=i.get_recorder();o.add_cmd(e);const s=this.items.find(e=>e.id===t);if(!s)return;const a=s.code;return s.code=n,o.add_recover(Fu.update(r,t,a)),this.update_active_code_html(),o}code_add(e){const{item:t,focus:n}=e,{courier:i,id:r}=this,o=i.get_recorder();return o.add_cmd(e),this.info.tabs.push(t),o.add_recover(Fu.remove(r,t.id)),this.update_active_code_html(),n&&o.tell(this,Fu.change_active(r,t.id)),yn(()=>{this._draglist?.init()}),o}code_remove(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const s=this.items.indexOf(o),a=this.items[s-1]||this.items[s+1];return s>=0&&this.items.splice(s,1),r.add_recover(Fu.add(i,o)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),yn(()=>{this._draglist?.init()}),r}code_rename(e){const{tabid:t,filename:n}=e,{courier:i,id:r}=this,o=i.get_recorder();o.add_cmd(e);const s=this.items.find(e=>e.id===t);if(!s)return;const a=s.name;return s.name=n,o.add_recover(Fu.rename(r,t,a)),o}change_active(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return o;const s=this.active_tab_id;return this.active_tab_id=t,r.add_recover(Fu.change_active(i,s)),this.update_active_code_html(),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,o=new Ro(t),s=(this.meta,this.dom?.querySelector("textarea"));return s?.focus(),o}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,o=new Ro(t),s=(this.meta,this.dom?.querySelector("textarea"));return s?.focus(),o}static get meta(){return{cubename:"代码块",type:n.code,block:!0,version:1,show:!0}}static get_default(){return{id:To.get_id(),type:n.code,info:{tabs:[],active_tab_id:""},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static get_default_by_string(e="typescript",t=""){const i={name:`code${this.get_format_from_lang(e)}`,id:To.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:To.get_id(),type:n.code,info:{tabs:[i],active_tab_id:i.id},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t}static get_format_from_lang(e){for(let t in k_)if(k_[t]===e)return t;return""}static get_lang_from_format(e){return k_[e]}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}S_([Go(g.change_lang)],M_.prototype,"change_lang",null),S_([Go(g.change_theme)],M_.prototype,"change_theme",null),S_([Go(g.code_update)],M_.prototype,"code_update",null),S_([Go(g.code_add)],M_.prototype,"code_add",null),S_([Go(g.code_remove)],M_.prototype,"code_remove",null),S_([Go(g.code_rename)],M_.prototype,"code_rename",null),S_([Go(g.change_active)],M_.prototype,"change_active",null),S_([Go(s.cursor_in_tail)],M_.prototype,"on_cursor_in_tail",null),S_([Go(s.cursor_in_head)],M_.prototype,"on_cursor_in_head",null);const z_=["id","data-type","innerHTML"],A_=Bn({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:i}=e.cube.root;function r(){i.emit_show_cube_editor(e.cube)}const o=wo(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>(Nr(),Ir("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":Zt(n).fomula,style:me(o.value),innerHTML:e.cube.mathml},null,12,z_))}}),T_=(0,Js.A)(A_,[["__scopeId","data-v-b85f3e3c"]]);class P_{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new P_(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class N_{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new N_(t,P_.range(this,e))}}class O_{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,i,r="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var s=o.lexer.input;n=o.start,i=o.end,n===s.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var a=s.slice(n,i).replace(/[^]/g,"$&̲");r+=(n>15?"…"+s.slice(n-15,n):s.slice(0,n))+a+(i+15<s.length?s.slice(i,i+15)+"…":s.slice(i))}var l=new Error(r);return l.name="ParseError",l.__proto__=O_.prototype,l.position=n,null!=n&&null!=i&&(l.length=i-n),l.rawMessage=e,l}}O_.prototype.__proto__=Error.prototype;var R_=/([A-Z])/g,L_={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},E_=/[&><"']/g;var I_=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},D_={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(E_,e=>L_[e])},hyphenate:function(e){return e.replace(R_,"-$1").toLowerCase()},getBaseElem:I_,isCharacterBox:function(e){var t=I_(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},B_={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function j_(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class q_{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},B_)if(B_.hasOwnProperty(t)){var n=B_[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:j_(n)}}reportNonstrict(e,t,n){var i=this.strict;if("function"==typeof i&&(i=i(e,t,n)),i&&"ignore"!==i){if(!0===i||"error"===i)throw new O_("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===i?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var i=this.strict;if("function"==typeof i)try{i=i(e,t,n)}catch(e){i="error"}return!(!i||"ignore"===i)&&(!0===i||"error"===i||("warn"===i?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=D_.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class F_{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return H_[$_[this.id]]}sub(){return H_[G_[this.id]]}fracNum(){return H_[V_[this.id]]}fracDen(){return H_[U_[this.id]]}cramp(){return H_[W_[this.id]]}text(){return H_[Y_[this.id]]}isTight(){return this.size>=2}}var H_=[new F_(0,0,!1),new F_(1,0,!0),new F_(2,1,!1),new F_(3,1,!0),new F_(4,2,!1),new F_(5,2,!0),new F_(6,3,!1),new F_(7,3,!0)],$_=[4,5,4,5,6,7,6,7],G_=[5,5,5,5,7,7,7,7],V_=[2,3,4,5,6,7,6,7],U_=[3,3,5,5,7,7,7,7],W_=[1,1,3,3,5,5,7,7],Y_=[0,1,2,3,2,3,2,3],X_={DISPLAY:H_[0],TEXT:H_[2],SCRIPT:H_[4],SCRIPTSCRIPT:H_[6]},K_=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var J_=[];function Q_(e){for(var t=0;t<J_.length;t+=2)if(e>=J_[t]&&e<=J_[t+1])return!0;return!1}K_.forEach(e=>e.blocks.forEach(e=>J_.push(...e)));var Z_=80,eg={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class tg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return D_.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join("")}}var ng={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},ig={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},rg={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function og(e,t,n){if(!ng[t])throw new Error("Font metrics not found for font: "+t+".");var i=e.charCodeAt(0),r=ng[t][i];if(!r&&e[0]in rg&&(i=rg[e[0]].charCodeAt(0),r=ng[t][i]),r||"text"!==n||Q_(i)&&(r=ng[t][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}var sg={};var ag=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],lg=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],cg=function(e,t){return t.size<2?e:ag[e-1][t.size-1]};class dg{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||dg.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=lg[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new dg(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:cg(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:lg[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=cg(dg.BASESIZE,e);return this.size===t&&this.textSize===dg.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==dg.BASESIZE?["sizing","reset-size"+this.size,"size"+dg.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!sg[t=e>=5?0:e>=3?1:2]){var n=sg[t]={cssEmPerMu:ig.quad[t]/18};for(var i in ig)ig.hasOwnProperty(i)&&(n[i]=ig[i][t])}return sg[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}dg.BASESIZE=6;var ug={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},hg={ex:!0,em:!0,mu:!0},pg=function(e){return"string"!=typeof e&&(e=e.unit),e in ug||e in hg||"ex"===e},fg=function(e,t){var n;if(e.unit in ug)n=ug[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var i;if(i=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=i.fontMetrics().xHeight;else{if("em"!==e.unit)throw new O_("Invalid unit: '"+e.unit+"'");n=i.fontMetrics().quad}i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},mg=function(e){return+e.toFixed(4)+"em"},_g=function(e){return e.filter(e=>e).join(" ")},gg=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},bg=function(e){var t=document.createElement(e);for(var n in t.className=_g(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},yg=/[\s"'>/=\x00-\x1f]/,vg=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+D_.escape(_g(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=D_.hyphenate(i)+":"+this.style[i]+";");for(var r in n&&(t+=' style="'+D_.escape(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(r)){if(yg.test(r))throw new O_("Invalid attribute name '"+r+"'");t+=" "+r+'="'+D_.escape(this.attributes[r])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+="</"+e+">"};class wg{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,gg.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return D_.contains(this.classes,e)}toNode(){return bg.call(this,"span")}toMarkup(){return vg.call(this,"span")}}class xg{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,gg.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return D_.contains(this.classes,e)}toNode(){return bg.call(this,"a")}toMarkup(){return vg.call(this,"a")}}class kg{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return D_.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+D_.escape(this.src)+'" alt="'+D_.escape(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=D_.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+D_.escape(t)+'"'),e+="'/>"}}var Sg={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Cg{constructor(e,t,n,i,r,o,s,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=r||0,this.width=o||0,this.classes=s||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<K_.length;t++)for(var n=K_[t],i=0;i<n.blocks.length;i++){var r=n.blocks[i];if(e>=r[0]&&e<=r[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Sg[this.text])}hasClass(e){return D_.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=mg(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=_g(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=D_.escape(_g(this.classes)),t+='"');var n="";for(var i in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(i)&&(n+=D_.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+D_.escape(n)+'"');var r=D_.escape(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class Mg{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+D_.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class zg{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",eg[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+D_.escape(this.alternate)+'"/>':'<path d="'+D_.escape(eg[this.pathName])+'"/>'}}class Ag{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+D_.escape(this.attributes[t])+'"');return e+="/>"}}function Tg(e){if(e instanceof Cg)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Pg={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ng={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Og={math:{},text:{}};function Rg(e,t,n,i,r,o){Og[e][r]={font:t,group:n,replace:i},o&&i&&(Og[e][i]=Og[e][r])}var Lg="math",Eg="text",Ig="main",Dg="ams",Bg="accent-token",jg="bin",qg="close",Fg="inner",Hg="mathord",$g="op-token",Gg="open",Vg="punct",Ug="rel",Wg="spacing",Yg="textord";Rg(Lg,Ig,Ug,"≡","\\equiv",!0),Rg(Lg,Ig,Ug,"≺","\\prec",!0),Rg(Lg,Ig,Ug,"≻","\\succ",!0),Rg(Lg,Ig,Ug,"∼","\\sim",!0),Rg(Lg,Ig,Ug,"⊥","\\perp"),Rg(Lg,Ig,Ug,"⪯","\\preceq",!0),Rg(Lg,Ig,Ug,"⪰","\\succeq",!0),Rg(Lg,Ig,Ug,"≃","\\simeq",!0),Rg(Lg,Ig,Ug,"∣","\\mid",!0),Rg(Lg,Ig,Ug,"≪","\\ll",!0),Rg(Lg,Ig,Ug,"≫","\\gg",!0),Rg(Lg,Ig,Ug,"≍","\\asymp",!0),Rg(Lg,Ig,Ug,"∥","\\parallel"),Rg(Lg,Ig,Ug,"⋈","\\bowtie",!0),Rg(Lg,Ig,Ug,"⌣","\\smile",!0),Rg(Lg,Ig,Ug,"⊑","\\sqsubseteq",!0),Rg(Lg,Ig,Ug,"⊒","\\sqsupseteq",!0),Rg(Lg,Ig,Ug,"≐","\\doteq",!0),Rg(Lg,Ig,Ug,"⌢","\\frown",!0),Rg(Lg,Ig,Ug,"∋","\\ni",!0),Rg(Lg,Ig,Ug,"∝","\\propto",!0),Rg(Lg,Ig,Ug,"⊢","\\vdash",!0),Rg(Lg,Ig,Ug,"⊣","\\dashv",!0),Rg(Lg,Ig,Ug,"∋","\\owns"),Rg(Lg,Ig,Vg,".","\\ldotp"),Rg(Lg,Ig,Vg,"⋅","\\cdotp"),Rg(Lg,Ig,Yg,"#","\\#"),Rg(Eg,Ig,Yg,"#","\\#"),Rg(Lg,Ig,Yg,"&","\\&"),Rg(Eg,Ig,Yg,"&","\\&"),Rg(Lg,Ig,Yg,"ℵ","\\aleph",!0),Rg(Lg,Ig,Yg,"∀","\\forall",!0),Rg(Lg,Ig,Yg,"ℏ","\\hbar",!0),Rg(Lg,Ig,Yg,"∃","\\exists",!0),Rg(Lg,Ig,Yg,"∇","\\nabla",!0),Rg(Lg,Ig,Yg,"♭","\\flat",!0),Rg(Lg,Ig,Yg,"ℓ","\\ell",!0),Rg(Lg,Ig,Yg,"♮","\\natural",!0),Rg(Lg,Ig,Yg,"♣","\\clubsuit",!0),Rg(Lg,Ig,Yg,"℘","\\wp",!0),Rg(Lg,Ig,Yg,"♯","\\sharp",!0),Rg(Lg,Ig,Yg,"♢","\\diamondsuit",!0),Rg(Lg,Ig,Yg,"ℜ","\\Re",!0),Rg(Lg,Ig,Yg,"♡","\\heartsuit",!0),Rg(Lg,Ig,Yg,"ℑ","\\Im",!0),Rg(Lg,Ig,Yg,"♠","\\spadesuit",!0),Rg(Lg,Ig,Yg,"§","\\S",!0),Rg(Eg,Ig,Yg,"§","\\S"),Rg(Lg,Ig,Yg,"¶","\\P",!0),Rg(Eg,Ig,Yg,"¶","\\P"),Rg(Lg,Ig,Yg,"†","\\dag"),Rg(Eg,Ig,Yg,"†","\\dag"),Rg(Eg,Ig,Yg,"†","\\textdagger"),Rg(Lg,Ig,Yg,"‡","\\ddag"),Rg(Eg,Ig,Yg,"‡","\\ddag"),Rg(Eg,Ig,Yg,"‡","\\textdaggerdbl"),Rg(Lg,Ig,qg,"⎱","\\rmoustache",!0),Rg(Lg,Ig,Gg,"⎰","\\lmoustache",!0),Rg(Lg,Ig,qg,"⟯","\\rgroup",!0),Rg(Lg,Ig,Gg,"⟮","\\lgroup",!0),Rg(Lg,Ig,jg,"∓","\\mp",!0),Rg(Lg,Ig,jg,"⊖","\\ominus",!0),Rg(Lg,Ig,jg,"⊎","\\uplus",!0),Rg(Lg,Ig,jg,"⊓","\\sqcap",!0),Rg(Lg,Ig,jg,"∗","\\ast"),Rg(Lg,Ig,jg,"⊔","\\sqcup",!0),Rg(Lg,Ig,jg,"◯","\\bigcirc",!0),Rg(Lg,Ig,jg,"∙","\\bullet",!0),Rg(Lg,Ig,jg,"‡","\\ddagger"),Rg(Lg,Ig,jg,"≀","\\wr",!0),Rg(Lg,Ig,jg,"⨿","\\amalg"),Rg(Lg,Ig,jg,"&","\\And"),Rg(Lg,Ig,Ug,"⟵","\\longleftarrow",!0),Rg(Lg,Ig,Ug,"⇐","\\Leftarrow",!0),Rg(Lg,Ig,Ug,"⟸","\\Longleftarrow",!0),Rg(Lg,Ig,Ug,"⟶","\\longrightarrow",!0),Rg(Lg,Ig,Ug,"⇒","\\Rightarrow",!0),Rg(Lg,Ig,Ug,"⟹","\\Longrightarrow",!0),Rg(Lg,Ig,Ug,"↔","\\leftrightarrow",!0),Rg(Lg,Ig,Ug,"⟷","\\longleftrightarrow",!0),Rg(Lg,Ig,Ug,"⇔","\\Leftrightarrow",!0),Rg(Lg,Ig,Ug,"⟺","\\Longleftrightarrow",!0),Rg(Lg,Ig,Ug,"↦","\\mapsto",!0),Rg(Lg,Ig,Ug,"⟼","\\longmapsto",!0),Rg(Lg,Ig,Ug,"↗","\\nearrow",!0),Rg(Lg,Ig,Ug,"↩","\\hookleftarrow",!0),Rg(Lg,Ig,Ug,"↪","\\hookrightarrow",!0),Rg(Lg,Ig,Ug,"↘","\\searrow",!0),Rg(Lg,Ig,Ug,"↼","\\leftharpoonup",!0),Rg(Lg,Ig,Ug,"⇀","\\rightharpoonup",!0),Rg(Lg,Ig,Ug,"↙","\\swarrow",!0),Rg(Lg,Ig,Ug,"↽","\\leftharpoondown",!0),Rg(Lg,Ig,Ug,"⇁","\\rightharpoondown",!0),Rg(Lg,Ig,Ug,"↖","\\nwarrow",!0),Rg(Lg,Ig,Ug,"⇌","\\rightleftharpoons",!0),Rg(Lg,Dg,Ug,"≮","\\nless",!0),Rg(Lg,Dg,Ug,"","\\@nleqslant"),Rg(Lg,Dg,Ug,"","\\@nleqq"),Rg(Lg,Dg,Ug,"⪇","\\lneq",!0),Rg(Lg,Dg,Ug,"≨","\\lneqq",!0),Rg(Lg,Dg,Ug,"","\\@lvertneqq"),Rg(Lg,Dg,Ug,"⋦","\\lnsim",!0),Rg(Lg,Dg,Ug,"⪉","\\lnapprox",!0),Rg(Lg,Dg,Ug,"⊀","\\nprec",!0),Rg(Lg,Dg,Ug,"⋠","\\npreceq",!0),Rg(Lg,Dg,Ug,"⋨","\\precnsim",!0),Rg(Lg,Dg,Ug,"⪹","\\precnapprox",!0),Rg(Lg,Dg,Ug,"≁","\\nsim",!0),Rg(Lg,Dg,Ug,"","\\@nshortmid"),Rg(Lg,Dg,Ug,"∤","\\nmid",!0),Rg(Lg,Dg,Ug,"⊬","\\nvdash",!0),Rg(Lg,Dg,Ug,"⊭","\\nvDash",!0),Rg(Lg,Dg,Ug,"⋪","\\ntriangleleft"),Rg(Lg,Dg,Ug,"⋬","\\ntrianglelefteq",!0),Rg(Lg,Dg,Ug,"⊊","\\subsetneq",!0),Rg(Lg,Dg,Ug,"","\\@varsubsetneq"),Rg(Lg,Dg,Ug,"⫋","\\subsetneqq",!0),Rg(Lg,Dg,Ug,"","\\@varsubsetneqq"),Rg(Lg,Dg,Ug,"≯","\\ngtr",!0),Rg(Lg,Dg,Ug,"","\\@ngeqslant"),Rg(Lg,Dg,Ug,"","\\@ngeqq"),Rg(Lg,Dg,Ug,"⪈","\\gneq",!0),Rg(Lg,Dg,Ug,"≩","\\gneqq",!0),Rg(Lg,Dg,Ug,"","\\@gvertneqq"),Rg(Lg,Dg,Ug,"⋧","\\gnsim",!0),Rg(Lg,Dg,Ug,"⪊","\\gnapprox",!0),Rg(Lg,Dg,Ug,"⊁","\\nsucc",!0),Rg(Lg,Dg,Ug,"⋡","\\nsucceq",!0),Rg(Lg,Dg,Ug,"⋩","\\succnsim",!0),Rg(Lg,Dg,Ug,"⪺","\\succnapprox",!0),Rg(Lg,Dg,Ug,"≆","\\ncong",!0),Rg(Lg,Dg,Ug,"","\\@nshortparallel"),Rg(Lg,Dg,Ug,"∦","\\nparallel",!0),Rg(Lg,Dg,Ug,"⊯","\\nVDash",!0),Rg(Lg,Dg,Ug,"⋫","\\ntriangleright"),Rg(Lg,Dg,Ug,"⋭","\\ntrianglerighteq",!0),Rg(Lg,Dg,Ug,"","\\@nsupseteqq"),Rg(Lg,Dg,Ug,"⊋","\\supsetneq",!0),Rg(Lg,Dg,Ug,"","\\@varsupsetneq"),Rg(Lg,Dg,Ug,"⫌","\\supsetneqq",!0),Rg(Lg,Dg,Ug,"","\\@varsupsetneqq"),Rg(Lg,Dg,Ug,"⊮","\\nVdash",!0),Rg(Lg,Dg,Ug,"⪵","\\precneqq",!0),Rg(Lg,Dg,Ug,"⪶","\\succneqq",!0),Rg(Lg,Dg,Ug,"","\\@nsubseteqq"),Rg(Lg,Dg,jg,"⊴","\\unlhd"),Rg(Lg,Dg,jg,"⊵","\\unrhd"),Rg(Lg,Dg,Ug,"↚","\\nleftarrow",!0),Rg(Lg,Dg,Ug,"↛","\\nrightarrow",!0),Rg(Lg,Dg,Ug,"⇍","\\nLeftarrow",!0),Rg(Lg,Dg,Ug,"⇏","\\nRightarrow",!0),Rg(Lg,Dg,Ug,"↮","\\nleftrightarrow",!0),Rg(Lg,Dg,Ug,"⇎","\\nLeftrightarrow",!0),Rg(Lg,Dg,Ug,"△","\\vartriangle"),Rg(Lg,Dg,Yg,"ℏ","\\hslash"),Rg(Lg,Dg,Yg,"▽","\\triangledown"),Rg(Lg,Dg,Yg,"◊","\\lozenge"),Rg(Lg,Dg,Yg,"Ⓢ","\\circledS"),Rg(Lg,Dg,Yg,"®","\\circledR"),Rg(Eg,Dg,Yg,"®","\\circledR"),Rg(Lg,Dg,Yg,"∡","\\measuredangle",!0),Rg(Lg,Dg,Yg,"∄","\\nexists"),Rg(Lg,Dg,Yg,"℧","\\mho"),Rg(Lg,Dg,Yg,"Ⅎ","\\Finv",!0),Rg(Lg,Dg,Yg,"⅁","\\Game",!0),Rg(Lg,Dg,Yg,"‵","\\backprime"),Rg(Lg,Dg,Yg,"▲","\\blacktriangle"),Rg(Lg,Dg,Yg,"▼","\\blacktriangledown"),Rg(Lg,Dg,Yg,"■","\\blacksquare"),Rg(Lg,Dg,Yg,"⧫","\\blacklozenge"),Rg(Lg,Dg,Yg,"★","\\bigstar"),Rg(Lg,Dg,Yg,"∢","\\sphericalangle",!0),Rg(Lg,Dg,Yg,"∁","\\complement",!0),Rg(Lg,Dg,Yg,"ð","\\eth",!0),Rg(Eg,Ig,Yg,"ð","ð"),Rg(Lg,Dg,Yg,"╱","\\diagup"),Rg(Lg,Dg,Yg,"╲","\\diagdown"),Rg(Lg,Dg,Yg,"□","\\square"),Rg(Lg,Dg,Yg,"□","\\Box"),Rg(Lg,Dg,Yg,"◊","\\Diamond"),Rg(Lg,Dg,Yg,"¥","\\yen",!0),Rg(Eg,Dg,Yg,"¥","\\yen",!0),Rg(Lg,Dg,Yg,"✓","\\checkmark",!0),Rg(Eg,Dg,Yg,"✓","\\checkmark"),Rg(Lg,Dg,Yg,"ℶ","\\beth",!0),Rg(Lg,Dg,Yg,"ℸ","\\daleth",!0),Rg(Lg,Dg,Yg,"ℷ","\\gimel",!0),Rg(Lg,Dg,Yg,"ϝ","\\digamma",!0),Rg(Lg,Dg,Yg,"ϰ","\\varkappa"),Rg(Lg,Dg,Gg,"┌","\\@ulcorner",!0),Rg(Lg,Dg,qg,"┐","\\@urcorner",!0),Rg(Lg,Dg,Gg,"└","\\@llcorner",!0),Rg(Lg,Dg,qg,"┘","\\@lrcorner",!0),Rg(Lg,Dg,Ug,"≦","\\leqq",!0),Rg(Lg,Dg,Ug,"⩽","\\leqslant",!0),Rg(Lg,Dg,Ug,"⪕","\\eqslantless",!0),Rg(Lg,Dg,Ug,"≲","\\lesssim",!0),Rg(Lg,Dg,Ug,"⪅","\\lessapprox",!0),Rg(Lg,Dg,Ug,"≊","\\approxeq",!0),Rg(Lg,Dg,jg,"⋖","\\lessdot"),Rg(Lg,Dg,Ug,"⋘","\\lll",!0),Rg(Lg,Dg,Ug,"≶","\\lessgtr",!0),Rg(Lg,Dg,Ug,"⋚","\\lesseqgtr",!0),Rg(Lg,Dg,Ug,"⪋","\\lesseqqgtr",!0),Rg(Lg,Dg,Ug,"≑","\\doteqdot"),Rg(Lg,Dg,Ug,"≓","\\risingdotseq",!0),Rg(Lg,Dg,Ug,"≒","\\fallingdotseq",!0),Rg(Lg,Dg,Ug,"∽","\\backsim",!0),Rg(Lg,Dg,Ug,"⋍","\\backsimeq",!0),Rg(Lg,Dg,Ug,"⫅","\\subseteqq",!0),Rg(Lg,Dg,Ug,"⋐","\\Subset",!0),Rg(Lg,Dg,Ug,"⊏","\\sqsubset",!0),Rg(Lg,Dg,Ug,"≼","\\preccurlyeq",!0),Rg(Lg,Dg,Ug,"⋞","\\curlyeqprec",!0),Rg(Lg,Dg,Ug,"≾","\\precsim",!0),Rg(Lg,Dg,Ug,"⪷","\\precapprox",!0),Rg(Lg,Dg,Ug,"⊲","\\vartriangleleft"),Rg(Lg,Dg,Ug,"⊴","\\trianglelefteq"),Rg(Lg,Dg,Ug,"⊨","\\vDash",!0),Rg(Lg,Dg,Ug,"⊪","\\Vvdash",!0),Rg(Lg,Dg,Ug,"⌣","\\smallsmile"),Rg(Lg,Dg,Ug,"⌢","\\smallfrown"),Rg(Lg,Dg,Ug,"≏","\\bumpeq",!0),Rg(Lg,Dg,Ug,"≎","\\Bumpeq",!0),Rg(Lg,Dg,Ug,"≧","\\geqq",!0),Rg(Lg,Dg,Ug,"⩾","\\geqslant",!0),Rg(Lg,Dg,Ug,"⪖","\\eqslantgtr",!0),Rg(Lg,Dg,Ug,"≳","\\gtrsim",!0),Rg(Lg,Dg,Ug,"⪆","\\gtrapprox",!0),Rg(Lg,Dg,jg,"⋗","\\gtrdot"),Rg(Lg,Dg,Ug,"⋙","\\ggg",!0),Rg(Lg,Dg,Ug,"≷","\\gtrless",!0),Rg(Lg,Dg,Ug,"⋛","\\gtreqless",!0),Rg(Lg,Dg,Ug,"⪌","\\gtreqqless",!0),Rg(Lg,Dg,Ug,"≖","\\eqcirc",!0),Rg(Lg,Dg,Ug,"≗","\\circeq",!0),Rg(Lg,Dg,Ug,"≜","\\triangleq",!0),Rg(Lg,Dg,Ug,"∼","\\thicksim"),Rg(Lg,Dg,Ug,"≈","\\thickapprox"),Rg(Lg,Dg,Ug,"⫆","\\supseteqq",!0),Rg(Lg,Dg,Ug,"⋑","\\Supset",!0),Rg(Lg,Dg,Ug,"⊐","\\sqsupset",!0),Rg(Lg,Dg,Ug,"≽","\\succcurlyeq",!0),Rg(Lg,Dg,Ug,"⋟","\\curlyeqsucc",!0),Rg(Lg,Dg,Ug,"≿","\\succsim",!0),Rg(Lg,Dg,Ug,"⪸","\\succapprox",!0),Rg(Lg,Dg,Ug,"⊳","\\vartriangleright"),Rg(Lg,Dg,Ug,"⊵","\\trianglerighteq"),Rg(Lg,Dg,Ug,"⊩","\\Vdash",!0),Rg(Lg,Dg,Ug,"∣","\\shortmid"),Rg(Lg,Dg,Ug,"∥","\\shortparallel"),Rg(Lg,Dg,Ug,"≬","\\between",!0),Rg(Lg,Dg,Ug,"⋔","\\pitchfork",!0),Rg(Lg,Dg,Ug,"∝","\\varpropto"),Rg(Lg,Dg,Ug,"◀","\\blacktriangleleft"),Rg(Lg,Dg,Ug,"∴","\\therefore",!0),Rg(Lg,Dg,Ug,"∍","\\backepsilon"),Rg(Lg,Dg,Ug,"▶","\\blacktriangleright"),Rg(Lg,Dg,Ug,"∵","\\because",!0),Rg(Lg,Dg,Ug,"⋘","\\llless"),Rg(Lg,Dg,Ug,"⋙","\\gggtr"),Rg(Lg,Dg,jg,"⊲","\\lhd"),Rg(Lg,Dg,jg,"⊳","\\rhd"),Rg(Lg,Dg,Ug,"≂","\\eqsim",!0),Rg(Lg,Ig,Ug,"⋈","\\Join"),Rg(Lg,Dg,Ug,"≑","\\Doteq",!0),Rg(Lg,Dg,jg,"∔","\\dotplus",!0),Rg(Lg,Dg,jg,"∖","\\smallsetminus"),Rg(Lg,Dg,jg,"⋒","\\Cap",!0),Rg(Lg,Dg,jg,"⋓","\\Cup",!0),Rg(Lg,Dg,jg,"⩞","\\doublebarwedge",!0),Rg(Lg,Dg,jg,"⊟","\\boxminus",!0),Rg(Lg,Dg,jg,"⊞","\\boxplus",!0),Rg(Lg,Dg,jg,"⋇","\\divideontimes",!0),Rg(Lg,Dg,jg,"⋉","\\ltimes",!0),Rg(Lg,Dg,jg,"⋊","\\rtimes",!0),Rg(Lg,Dg,jg,"⋋","\\leftthreetimes",!0),Rg(Lg,Dg,jg,"⋌","\\rightthreetimes",!0),Rg(Lg,Dg,jg,"⋏","\\curlywedge",!0),Rg(Lg,Dg,jg,"⋎","\\curlyvee",!0),Rg(Lg,Dg,jg,"⊝","\\circleddash",!0),Rg(Lg,Dg,jg,"⊛","\\circledast",!0),Rg(Lg,Dg,jg,"⋅","\\centerdot"),Rg(Lg,Dg,jg,"⊺","\\intercal",!0),Rg(Lg,Dg,jg,"⋒","\\doublecap"),Rg(Lg,Dg,jg,"⋓","\\doublecup"),Rg(Lg,Dg,jg,"⊠","\\boxtimes",!0),Rg(Lg,Dg,Ug,"⇢","\\dashrightarrow",!0),Rg(Lg,Dg,Ug,"⇠","\\dashleftarrow",!0),Rg(Lg,Dg,Ug,"⇇","\\leftleftarrows",!0),Rg(Lg,Dg,Ug,"⇆","\\leftrightarrows",!0),Rg(Lg,Dg,Ug,"⇚","\\Lleftarrow",!0),Rg(Lg,Dg,Ug,"↞","\\twoheadleftarrow",!0),Rg(Lg,Dg,Ug,"↢","\\leftarrowtail",!0),Rg(Lg,Dg,Ug,"↫","\\looparrowleft",!0),Rg(Lg,Dg,Ug,"⇋","\\leftrightharpoons",!0),Rg(Lg,Dg,Ug,"↶","\\curvearrowleft",!0),Rg(Lg,Dg,Ug,"↺","\\circlearrowleft",!0),Rg(Lg,Dg,Ug,"↰","\\Lsh",!0),Rg(Lg,Dg,Ug,"⇈","\\upuparrows",!0),Rg(Lg,Dg,Ug,"↿","\\upharpoonleft",!0),Rg(Lg,Dg,Ug,"⇃","\\downharpoonleft",!0),Rg(Lg,Ig,Ug,"⊶","\\origof",!0),Rg(Lg,Ig,Ug,"⊷","\\imageof",!0),Rg(Lg,Dg,Ug,"⊸","\\multimap",!0),Rg(Lg,Dg,Ug,"↭","\\leftrightsquigarrow",!0),Rg(Lg,Dg,Ug,"⇉","\\rightrightarrows",!0),Rg(Lg,Dg,Ug,"⇄","\\rightleftarrows",!0),Rg(Lg,Dg,Ug,"↠","\\twoheadrightarrow",!0),Rg(Lg,Dg,Ug,"↣","\\rightarrowtail",!0),Rg(Lg,Dg,Ug,"↬","\\looparrowright",!0),Rg(Lg,Dg,Ug,"↷","\\curvearrowright",!0),Rg(Lg,Dg,Ug,"↻","\\circlearrowright",!0),Rg(Lg,Dg,Ug,"↱","\\Rsh",!0),Rg(Lg,Dg,Ug,"⇊","\\downdownarrows",!0),Rg(Lg,Dg,Ug,"↾","\\upharpoonright",!0),Rg(Lg,Dg,Ug,"⇂","\\downharpoonright",!0),Rg(Lg,Dg,Ug,"⇝","\\rightsquigarrow",!0),Rg(Lg,Dg,Ug,"⇝","\\leadsto"),Rg(Lg,Dg,Ug,"⇛","\\Rrightarrow",!0),Rg(Lg,Dg,Ug,"↾","\\restriction"),Rg(Lg,Ig,Yg,"‘","`"),Rg(Lg,Ig,Yg,"$","\\$"),Rg(Eg,Ig,Yg,"$","\\$"),Rg(Eg,Ig,Yg,"$","\\textdollar"),Rg(Lg,Ig,Yg,"%","\\%"),Rg(Eg,Ig,Yg,"%","\\%"),Rg(Lg,Ig,Yg,"_","\\_"),Rg(Eg,Ig,Yg,"_","\\_"),Rg(Eg,Ig,Yg,"_","\\textunderscore"),Rg(Lg,Ig,Yg,"∠","\\angle",!0),Rg(Lg,Ig,Yg,"∞","\\infty",!0),Rg(Lg,Ig,Yg,"′","\\prime"),Rg(Lg,Ig,Yg,"△","\\triangle"),Rg(Lg,Ig,Yg,"Γ","\\Gamma",!0),Rg(Lg,Ig,Yg,"Δ","\\Delta",!0),Rg(Lg,Ig,Yg,"Θ","\\Theta",!0),Rg(Lg,Ig,Yg,"Λ","\\Lambda",!0),Rg(Lg,Ig,Yg,"Ξ","\\Xi",!0),Rg(Lg,Ig,Yg,"Π","\\Pi",!0),Rg(Lg,Ig,Yg,"Σ","\\Sigma",!0),Rg(Lg,Ig,Yg,"Υ","\\Upsilon",!0),Rg(Lg,Ig,Yg,"Φ","\\Phi",!0),Rg(Lg,Ig,Yg,"Ψ","\\Psi",!0),Rg(Lg,Ig,Yg,"Ω","\\Omega",!0),Rg(Lg,Ig,Yg,"A","Α"),Rg(Lg,Ig,Yg,"B","Β"),Rg(Lg,Ig,Yg,"E","Ε"),Rg(Lg,Ig,Yg,"Z","Ζ"),Rg(Lg,Ig,Yg,"H","Η"),Rg(Lg,Ig,Yg,"I","Ι"),Rg(Lg,Ig,Yg,"K","Κ"),Rg(Lg,Ig,Yg,"M","Μ"),Rg(Lg,Ig,Yg,"N","Ν"),Rg(Lg,Ig,Yg,"O","Ο"),Rg(Lg,Ig,Yg,"P","Ρ"),Rg(Lg,Ig,Yg,"T","Τ"),Rg(Lg,Ig,Yg,"X","Χ"),Rg(Lg,Ig,Yg,"¬","\\neg",!0),Rg(Lg,Ig,Yg,"¬","\\lnot"),Rg(Lg,Ig,Yg,"⊤","\\top"),Rg(Lg,Ig,Yg,"⊥","\\bot"),Rg(Lg,Ig,Yg,"∅","\\emptyset"),Rg(Lg,Dg,Yg,"∅","\\varnothing"),Rg(Lg,Ig,Hg,"α","\\alpha",!0),Rg(Lg,Ig,Hg,"β","\\beta",!0),Rg(Lg,Ig,Hg,"γ","\\gamma",!0),Rg(Lg,Ig,Hg,"δ","\\delta",!0),Rg(Lg,Ig,Hg,"ϵ","\\epsilon",!0),Rg(Lg,Ig,Hg,"ζ","\\zeta",!0),Rg(Lg,Ig,Hg,"η","\\eta",!0),Rg(Lg,Ig,Hg,"θ","\\theta",!0),Rg(Lg,Ig,Hg,"ι","\\iota",!0),Rg(Lg,Ig,Hg,"κ","\\kappa",!0),Rg(Lg,Ig,Hg,"λ","\\lambda",!0),Rg(Lg,Ig,Hg,"μ","\\mu",!0),Rg(Lg,Ig,Hg,"ν","\\nu",!0),Rg(Lg,Ig,Hg,"ξ","\\xi",!0),Rg(Lg,Ig,Hg,"ο","\\omicron",!0),Rg(Lg,Ig,Hg,"π","\\pi",!0),Rg(Lg,Ig,Hg,"ρ","\\rho",!0),Rg(Lg,Ig,Hg,"σ","\\sigma",!0),Rg(Lg,Ig,Hg,"τ","\\tau",!0),Rg(Lg,Ig,Hg,"υ","\\upsilon",!0),Rg(Lg,Ig,Hg,"ϕ","\\phi",!0),Rg(Lg,Ig,Hg,"χ","\\chi",!0),Rg(Lg,Ig,Hg,"ψ","\\psi",!0),Rg(Lg,Ig,Hg,"ω","\\omega",!0),Rg(Lg,Ig,Hg,"ε","\\varepsilon",!0),Rg(Lg,Ig,Hg,"ϑ","\\vartheta",!0),Rg(Lg,Ig,Hg,"ϖ","\\varpi",!0),Rg(Lg,Ig,Hg,"ϱ","\\varrho",!0),Rg(Lg,Ig,Hg,"ς","\\varsigma",!0),Rg(Lg,Ig,Hg,"φ","\\varphi",!0),Rg(Lg,Ig,jg,"∗","*",!0),Rg(Lg,Ig,jg,"+","+"),Rg(Lg,Ig,jg,"−","-",!0),Rg(Lg,Ig,jg,"⋅","\\cdot",!0),Rg(Lg,Ig,jg,"∘","\\circ",!0),Rg(Lg,Ig,jg,"÷","\\div",!0),Rg(Lg,Ig,jg,"±","\\pm",!0),Rg(Lg,Ig,jg,"×","\\times",!0),Rg(Lg,Ig,jg,"∩","\\cap",!0),Rg(Lg,Ig,jg,"∪","\\cup",!0),Rg(Lg,Ig,jg,"∖","\\setminus",!0),Rg(Lg,Ig,jg,"∧","\\land"),Rg(Lg,Ig,jg,"∨","\\lor"),Rg(Lg,Ig,jg,"∧","\\wedge",!0),Rg(Lg,Ig,jg,"∨","\\vee",!0),Rg(Lg,Ig,Yg,"√","\\surd"),Rg(Lg,Ig,Gg,"⟨","\\langle",!0),Rg(Lg,Ig,Gg,"∣","\\lvert"),Rg(Lg,Ig,Gg,"∥","\\lVert"),Rg(Lg,Ig,qg,"?","?"),Rg(Lg,Ig,qg,"!","!"),Rg(Lg,Ig,qg,"⟩","\\rangle",!0),Rg(Lg,Ig,qg,"∣","\\rvert"),Rg(Lg,Ig,qg,"∥","\\rVert"),Rg(Lg,Ig,Ug,"=","="),Rg(Lg,Ig,Ug,":",":"),Rg(Lg,Ig,Ug,"≈","\\approx",!0),Rg(Lg,Ig,Ug,"≅","\\cong",!0),Rg(Lg,Ig,Ug,"≥","\\ge"),Rg(Lg,Ig,Ug,"≥","\\geq",!0),Rg(Lg,Ig,Ug,"←","\\gets"),Rg(Lg,Ig,Ug,">","\\gt",!0),Rg(Lg,Ig,Ug,"∈","\\in",!0),Rg(Lg,Ig,Ug,"","\\@not"),Rg(Lg,Ig,Ug,"⊂","\\subset",!0),Rg(Lg,Ig,Ug,"⊃","\\supset",!0),Rg(Lg,Ig,Ug,"⊆","\\subseteq",!0),Rg(Lg,Ig,Ug,"⊇","\\supseteq",!0),Rg(Lg,Dg,Ug,"⊈","\\nsubseteq",!0),Rg(Lg,Dg,Ug,"⊉","\\nsupseteq",!0),Rg(Lg,Ig,Ug,"⊨","\\models"),Rg(Lg,Ig,Ug,"←","\\leftarrow",!0),Rg(Lg,Ig,Ug,"≤","\\le"),Rg(Lg,Ig,Ug,"≤","\\leq",!0),Rg(Lg,Ig,Ug,"<","\\lt",!0),Rg(Lg,Ig,Ug,"→","\\rightarrow",!0),Rg(Lg,Ig,Ug,"→","\\to"),Rg(Lg,Dg,Ug,"≱","\\ngeq",!0),Rg(Lg,Dg,Ug,"≰","\\nleq",!0),Rg(Lg,Ig,Wg," ","\\ "),Rg(Lg,Ig,Wg," ","\\space"),Rg(Lg,Ig,Wg," ","\\nobreakspace"),Rg(Eg,Ig,Wg," ","\\ "),Rg(Eg,Ig,Wg," "," "),Rg(Eg,Ig,Wg," ","\\space"),Rg(Eg,Ig,Wg," ","\\nobreakspace"),Rg(Lg,Ig,Wg,null,"\\nobreak"),Rg(Lg,Ig,Wg,null,"\\allowbreak"),Rg(Lg,Ig,Vg,",",","),Rg(Lg,Ig,Vg,";",";"),Rg(Lg,Dg,jg,"⊼","\\barwedge",!0),Rg(Lg,Dg,jg,"⊻","\\veebar",!0),Rg(Lg,Ig,jg,"⊙","\\odot",!0),Rg(Lg,Ig,jg,"⊕","\\oplus",!0),Rg(Lg,Ig,jg,"⊗","\\otimes",!0),Rg(Lg,Ig,Yg,"∂","\\partial",!0),Rg(Lg,Ig,jg,"⊘","\\oslash",!0),Rg(Lg,Dg,jg,"⊚","\\circledcirc",!0),Rg(Lg,Dg,jg,"⊡","\\boxdot",!0),Rg(Lg,Ig,jg,"△","\\bigtriangleup"),Rg(Lg,Ig,jg,"▽","\\bigtriangledown"),Rg(Lg,Ig,jg,"†","\\dagger"),Rg(Lg,Ig,jg,"⋄","\\diamond"),Rg(Lg,Ig,jg,"⋆","\\star"),Rg(Lg,Ig,jg,"◃","\\triangleleft"),Rg(Lg,Ig,jg,"▹","\\triangleright"),Rg(Lg,Ig,Gg,"{","\\{"),Rg(Eg,Ig,Yg,"{","\\{"),Rg(Eg,Ig,Yg,"{","\\textbraceleft"),Rg(Lg,Ig,qg,"}","\\}"),Rg(Eg,Ig,Yg,"}","\\}"),Rg(Eg,Ig,Yg,"}","\\textbraceright"),Rg(Lg,Ig,Gg,"{","\\lbrace"),Rg(Lg,Ig,qg,"}","\\rbrace"),Rg(Lg,Ig,Gg,"[","\\lbrack",!0),Rg(Eg,Ig,Yg,"[","\\lbrack",!0),Rg(Lg,Ig,qg,"]","\\rbrack",!0),Rg(Eg,Ig,Yg,"]","\\rbrack",!0),Rg(Lg,Ig,Gg,"(","\\lparen",!0),Rg(Lg,Ig,qg,")","\\rparen",!0),Rg(Eg,Ig,Yg,"<","\\textless",!0),Rg(Eg,Ig,Yg,">","\\textgreater",!0),Rg(Lg,Ig,Gg,"⌊","\\lfloor",!0),Rg(Lg,Ig,qg,"⌋","\\rfloor",!0),Rg(Lg,Ig,Gg,"⌈","\\lceil",!0),Rg(Lg,Ig,qg,"⌉","\\rceil",!0),Rg(Lg,Ig,Yg,"\\","\\backslash"),Rg(Lg,Ig,Yg,"∣","|"),Rg(Lg,Ig,Yg,"∣","\\vert"),Rg(Eg,Ig,Yg,"|","\\textbar",!0),Rg(Lg,Ig,Yg,"∥","\\|"),Rg(Lg,Ig,Yg,"∥","\\Vert"),Rg(Eg,Ig,Yg,"∥","\\textbardbl"),Rg(Eg,Ig,Yg,"~","\\textasciitilde"),Rg(Eg,Ig,Yg,"\\","\\textbackslash"),Rg(Eg,Ig,Yg,"^","\\textasciicircum"),Rg(Lg,Ig,Ug,"↑","\\uparrow",!0),Rg(Lg,Ig,Ug,"⇑","\\Uparrow",!0),Rg(Lg,Ig,Ug,"↓","\\downarrow",!0),Rg(Lg,Ig,Ug,"⇓","\\Downarrow",!0),Rg(Lg,Ig,Ug,"↕","\\updownarrow",!0),Rg(Lg,Ig,Ug,"⇕","\\Updownarrow",!0),Rg(Lg,Ig,$g,"∐","\\coprod"),Rg(Lg,Ig,$g,"⋁","\\bigvee"),Rg(Lg,Ig,$g,"⋀","\\bigwedge"),Rg(Lg,Ig,$g,"⨄","\\biguplus"),Rg(Lg,Ig,$g,"⋂","\\bigcap"),Rg(Lg,Ig,$g,"⋃","\\bigcup"),Rg(Lg,Ig,$g,"∫","\\int"),Rg(Lg,Ig,$g,"∫","\\intop"),Rg(Lg,Ig,$g,"∬","\\iint"),Rg(Lg,Ig,$g,"∭","\\iiint"),Rg(Lg,Ig,$g,"∏","\\prod"),Rg(Lg,Ig,$g,"∑","\\sum"),Rg(Lg,Ig,$g,"⨂","\\bigotimes"),Rg(Lg,Ig,$g,"⨁","\\bigoplus"),Rg(Lg,Ig,$g,"⨀","\\bigodot"),Rg(Lg,Ig,$g,"∮","\\oint"),Rg(Lg,Ig,$g,"∯","\\oiint"),Rg(Lg,Ig,$g,"∰","\\oiiint"),Rg(Lg,Ig,$g,"⨆","\\bigsqcup"),Rg(Lg,Ig,$g,"∫","\\smallint"),Rg(Eg,Ig,Fg,"…","\\textellipsis"),Rg(Lg,Ig,Fg,"…","\\mathellipsis"),Rg(Eg,Ig,Fg,"…","\\ldots",!0),Rg(Lg,Ig,Fg,"…","\\ldots",!0),Rg(Lg,Ig,Fg,"⋯","\\@cdots",!0),Rg(Lg,Ig,Fg,"⋱","\\ddots",!0),Rg(Lg,Ig,Yg,"⋮","\\varvdots"),Rg(Eg,Ig,Yg,"⋮","\\varvdots"),Rg(Lg,Ig,Bg,"ˊ","\\acute"),Rg(Lg,Ig,Bg,"ˋ","\\grave"),Rg(Lg,Ig,Bg,"¨","\\ddot"),Rg(Lg,Ig,Bg,"~","\\tilde"),Rg(Lg,Ig,Bg,"ˉ","\\bar"),Rg(Lg,Ig,Bg,"˘","\\breve"),Rg(Lg,Ig,Bg,"ˇ","\\check"),Rg(Lg,Ig,Bg,"^","\\hat"),Rg(Lg,Ig,Bg,"⃗","\\vec"),Rg(Lg,Ig,Bg,"˙","\\dot"),Rg(Lg,Ig,Bg,"˚","\\mathring"),Rg(Lg,Ig,Hg,"","\\@imath"),Rg(Lg,Ig,Hg,"","\\@jmath"),Rg(Lg,Ig,Yg,"ı","ı"),Rg(Lg,Ig,Yg,"ȷ","ȷ"),Rg(Eg,Ig,Yg,"ı","\\i",!0),Rg(Eg,Ig,Yg,"ȷ","\\j",!0),Rg(Eg,Ig,Yg,"ß","\\ss",!0),Rg(Eg,Ig,Yg,"æ","\\ae",!0),Rg(Eg,Ig,Yg,"œ","\\oe",!0),Rg(Eg,Ig,Yg,"ø","\\o",!0),Rg(Eg,Ig,Yg,"Æ","\\AE",!0),Rg(Eg,Ig,Yg,"Œ","\\OE",!0),Rg(Eg,Ig,Yg,"Ø","\\O",!0),Rg(Eg,Ig,Bg,"ˊ","\\'"),Rg(Eg,Ig,Bg,"ˋ","\\`"),Rg(Eg,Ig,Bg,"ˆ","\\^"),Rg(Eg,Ig,Bg,"˜","\\~"),Rg(Eg,Ig,Bg,"ˉ","\\="),Rg(Eg,Ig,Bg,"˘","\\u"),Rg(Eg,Ig,Bg,"˙","\\."),Rg(Eg,Ig,Bg,"¸","\\c"),Rg(Eg,Ig,Bg,"˚","\\r"),Rg(Eg,Ig,Bg,"ˇ","\\v"),Rg(Eg,Ig,Bg,"¨",'\\"'),Rg(Eg,Ig,Bg,"˝","\\H"),Rg(Eg,Ig,Bg,"◯","\\textcircled");var Xg={"--":!0,"---":!0,"``":!0,"''":!0};Rg(Eg,Ig,Yg,"–","--",!0),Rg(Eg,Ig,Yg,"–","\\textendash"),Rg(Eg,Ig,Yg,"—","---",!0),Rg(Eg,Ig,Yg,"—","\\textemdash"),Rg(Eg,Ig,Yg,"‘","`",!0),Rg(Eg,Ig,Yg,"‘","\\textquoteleft"),Rg(Eg,Ig,Yg,"’","'",!0),Rg(Eg,Ig,Yg,"’","\\textquoteright"),Rg(Eg,Ig,Yg,"“","``",!0),Rg(Eg,Ig,Yg,"“","\\textquotedblleft"),Rg(Eg,Ig,Yg,"”","''",!0),Rg(Eg,Ig,Yg,"”","\\textquotedblright"),Rg(Lg,Ig,Yg,"°","\\degree",!0),Rg(Eg,Ig,Yg,"°","\\degree"),Rg(Eg,Ig,Yg,"°","\\textdegree",!0),Rg(Lg,Ig,Yg,"£","\\pounds"),Rg(Lg,Ig,Yg,"£","\\mathsterling",!0),Rg(Eg,Ig,Yg,"£","\\pounds"),Rg(Eg,Ig,Yg,"£","\\textsterling",!0),Rg(Lg,Dg,Yg,"✠","\\maltese"),Rg(Eg,Dg,Yg,"✠","\\maltese");for(var Kg='0123456789/@."',Jg=0;Jg<14;Jg++){var Qg=Kg.charAt(Jg);Rg(Lg,Ig,Yg,Qg,Qg)}for(var Zg='0123456789!@*()-=+";:?/.,',eb=0;eb<25;eb++){var tb=Zg.charAt(eb);Rg(Eg,Ig,Yg,tb,tb)}for(var nb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ib=0;ib<52;ib++){var rb=nb.charAt(ib);Rg(Lg,Ig,Hg,rb,rb),Rg(Eg,Ig,Yg,rb,rb)}Rg(Lg,Dg,Yg,"C","ℂ"),Rg(Eg,Dg,Yg,"C","ℂ"),Rg(Lg,Dg,Yg,"H","ℍ"),Rg(Eg,Dg,Yg,"H","ℍ"),Rg(Lg,Dg,Yg,"N","ℕ"),Rg(Eg,Dg,Yg,"N","ℕ"),Rg(Lg,Dg,Yg,"P","ℙ"),Rg(Eg,Dg,Yg,"P","ℙ"),Rg(Lg,Dg,Yg,"Q","ℚ"),Rg(Eg,Dg,Yg,"Q","ℚ"),Rg(Lg,Dg,Yg,"R","ℝ"),Rg(Eg,Dg,Yg,"R","ℝ"),Rg(Lg,Dg,Yg,"Z","ℤ"),Rg(Eg,Dg,Yg,"Z","ℤ"),Rg(Lg,Ig,Hg,"h","ℎ"),Rg(Eg,Ig,Hg,"h","ℎ");for(var ob="",sb=0;sb<52;sb++){var ab=nb.charAt(sb);Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56320+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56372+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56424+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56580+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56684+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56736+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56788+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56840+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56944+sb)),Rg(Eg,Ig,Yg,ab,ob),sb<26&&(Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56632+sb)),Rg(Eg,Ig,Yg,ab,ob),Rg(Lg,Ig,Hg,ab,ob=String.fromCharCode(55349,56476+sb)),Rg(Eg,Ig,Yg,ab,ob))}Rg(Lg,Ig,Hg,"k",ob=String.fromCharCode(55349,56668)),Rg(Eg,Ig,Yg,"k",ob);for(var lb=0;lb<10;lb++){var cb=lb.toString();Rg(Lg,Ig,Hg,cb,ob=String.fromCharCode(55349,57294+lb)),Rg(Eg,Ig,Yg,cb,ob),Rg(Lg,Ig,Hg,cb,ob=String.fromCharCode(55349,57314+lb)),Rg(Eg,Ig,Yg,cb,ob),Rg(Lg,Ig,Hg,cb,ob=String.fromCharCode(55349,57324+lb)),Rg(Eg,Ig,Yg,cb,ob),Rg(Lg,Ig,Hg,cb,ob=String.fromCharCode(55349,57334+lb)),Rg(Eg,Ig,Yg,cb,ob)}for(var db="ÐÞþ",ub=0;ub<3;ub++){var hb=db.charAt(ub);Rg(Lg,Ig,Hg,hb,hb),Rg(Eg,Ig,Yg,hb,hb)}var pb=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],fb=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],mb=function(e,t,n){return Og[n][e]&&Og[n][e].replace&&(e=Og[n][e].replace),{value:e,metrics:og(e,t,n)}},_b=function(e,t,n,i,r){var o,s=mb(e,t,n),a=s.metrics;if(e=s.value,a){var l=a.italic;("text"===n||i&&"mathit"===i.font)&&(l=0),o=new Cg(e,a.height,a.depth,l,a.skew,a.width,r)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),o=new Cg(e,0,0,0,0,0,r);if(i){o.maxFontSize=i.sizeMultiplier,i.style.isTight()&&o.classes.push("mtight");var c=i.getColor();c&&(o.style.color=c)}return o},gb=(e,t)=>{if(_g(e.classes)!==_g(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var i in e.style)if(e.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;for(var r in t.style)if(t.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;return!0},bb=function(e){for(var t=0,n=0,i=0,r=0;r<e.children.length;r++){var o=e.children[r];o.height>t&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},yb=function(e,t,n,i){var r=new wg(e,t,n,i);return bb(r),r},vb=(e,t,n,i)=>new wg(e,t,n,i),wb=function(e){var t=new tg(e);return bb(t),t},xb=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}return i+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},kb={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Sb={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Cb={fontMap:kb,makeSymbol:_b,mathsym:function(e,t,n,i){return void 0===i&&(i=[]),"boldsymbol"===n.font&&mb(e,"Main-Bold",t).metrics?_b(e,"Main-Bold",t,n,i.concat(["mathbf"])):"\\"===e||"main"===Og[t][e].font?_b(e,"Main-Regular",t,n,i):_b(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},makeSpan:yb,makeSvgSpan:vb,makeLineSpan:function(e,t,n){var i=yb([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=mg(i.height),i.maxFontSize=1,i},makeAnchor:function(e,t,n,i){var r=new xg(e,t,n,i);return bb(r),r},makeFragment:wb,wrapFragment:function(e,t){return e instanceof tg?yb([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:i}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,r=i,o=1;o<t.length;o++){var s=-t[o].shift-r-t[o].elem.depth,a=s-(t[o-1].elem.height+t[o-1].elem.depth);r+=s,n.push({type:"kern",size:a}),n.push(t[o])}return{children:n,depth:i}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),r=0,o=0;o<n.length;o++){var s=n[o];if("elem"===s.type){var a=s.elem;r=Math.max(r,a.maxFontSize,a.height)}}r+=2;var l=yb(["pstrut"],[]);l.style.height=mg(r);for(var c=[],d=i,u=i,h=i,p=0;p<n.length;p++){var f=n[p];if("kern"===f.type)h+=f.size;else{var m=f.elem,_=f.wrapperClasses||[],g=f.wrapperStyle||{},b=yb(_,[l,m],void 0,g);b.style.top=mg(-r-h-m.depth),f.marginLeft&&(b.style.marginLeft=f.marginLeft),f.marginRight&&(b.style.marginRight=f.marginRight),c.push(b),h+=m.height+m.depth}d=Math.min(d,h),u=Math.max(u,h)}var y,v=yb(["vlist"],c);if(v.style.height=mg(u),d<0){var w=yb([],[]),x=yb(["vlist"],[w]);x.style.height=mg(-d);var k=yb(["vlist-s"],[new Cg("​")]);y=[yb(["vlist-r"],[v,k]),yb(["vlist-r"],[x])]}else y=[yb(["vlist-r"],[v])];var S=yb(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,n){var i=e.mode,r=e.text,o=["mord"],s="math"===i||"text"===i&&t.font,a=s?t.font:t.fontFamily,l="",c="";if(55349===r.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,i="math"===t?0:1;if(119808<=n&&n<120484){var r=Math.floor((n-119808)/26);return[pb[r][2],pb[r][i]]}if(120782<=n&&n<=120831){var o=Math.floor((n-120782)/10);return[fb[o][2],fb[o][i]]}if(120485===n||120486===n)return[pb[0][2],pb[0][i]];if(120486<n&&n<120782)return["",""];throw new O_("Unsupported character: "+e)}(r,i)),l.length>0)return _b(r,l,i,t,o.concat(c));if(a){var d,u;if("boldsymbol"===a){var h=function(e,t,n,i,r){return"textord"!==r&&mb(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(r,i,0,0,n);d=h.fontName,u=[h.fontClass]}else s?(d=kb[a].fontName,u=[a]):(d=xb(a,t.fontWeight,t.fontShape),u=[a,t.fontWeight,t.fontShape]);if(mb(r,d,i).metrics)return _b(r,d,i,t,o.concat(u));if(Xg.hasOwnProperty(r)&&"Typewriter"===d.slice(0,10)){for(var p=[],f=0;f<r.length;f++)p.push(_b(r[f],d,i,t,o.concat(u)));return wb(p)}}if("mathord"===n)return _b(r,"Math-Italic",i,t,o.concat(["mathnormal"]));if("textord"===n){var m=Og[i][r]&&Og[i][r].font;if("ams"===m){var _=xb("amsrm",t.fontWeight,t.fontShape);return _b(r,_,i,t,o.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==m&&m){var g=xb(m,t.fontWeight,t.fontShape);return _b(r,g,i,t,o.concat(g,t.fontWeight,t.fontShape))}var b=xb("textrm",t.fontWeight,t.fontShape);return _b(r,b,i,t,o.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=yb(["mspace"],[],t),i=fg(e,t);return n.style.marginRight=mg(i),n},staticSvg:function(e,t){var[n,i,r]=Sb[e],o=new zg(n),s=new Mg([o],{width:mg(i),height:mg(r),style:"width:"+mg(i),viewBox:"0 0 "+1e3*i+" "+1e3*r,preserveAspectRatio:"xMinYMin"}),a=vb(["overlay"],[s],t);return a.height=r,a.style.height=mg(r),a.style.width=mg(i),a},svgData:Sb,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1];n instanceof Cg&&i instanceof Cg&&gb(n,i)&&(n.text+=i.text,n.height=Math.max(n.height,i.height),n.depth=Math.max(n.depth,i.depth),n.italic=i.italic,e.splice(t+1,1),t--)}return e}},Mb={number:3,unit:"mu"},zb={number:4,unit:"mu"},Ab={number:5,unit:"mu"},Tb={mord:{mop:Mb,mbin:zb,mrel:Ab,minner:Mb},mop:{mord:Mb,mop:Mb,mrel:Ab,minner:Mb},mbin:{mord:zb,mop:zb,mopen:zb,minner:zb},mrel:{mord:Ab,mop:Ab,mopen:Ab,minner:Ab},mopen:{},mclose:{mop:Mb,mbin:zb,mrel:Ab,minner:Mb},mpunct:{mord:Mb,mop:Mb,mrel:Ab,mopen:Mb,mclose:Mb,mpunct:Mb,minner:Mb},minner:{mord:Mb,mop:Mb,mbin:zb,mrel:Ab,mopen:Mb,mpunct:Mb,minner:Mb}},Pb={mord:{mop:Mb},mop:{mord:Mb,mop:Mb},mbin:{},mrel:{},mopen:{},mclose:{mop:Mb},mpunct:{},minner:{mop:Mb}},Nb={},Ob={},Rb={};function Lb(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:o,mathmlBuilder:s}=e,a={type:t,numArgs:i.numArgs,argTypes:i.argTypes,allowedInArgument:!!i.allowedInArgument,allowedInText:!!i.allowedInText,allowedInMath:void 0===i.allowedInMath||i.allowedInMath,numOptionalArgs:i.numOptionalArgs||0,infix:!!i.infix,primitive:!!i.primitive,handler:r},l=0;l<n.length;++l)Nb[n[l]]=a;t&&(o&&(Ob[t]=o),s&&(Rb[t]=s))}function Eb(e){var{type:t,htmlBuilder:n,mathmlBuilder:i}=e;Lb({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:i})}var Ib=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},Db=function(e){return"ordgroup"===e.type?e.body:[e]},Bb=Cb.makeSpan,jb=["leftmost","mbin","mopen","mrel","mop","mpunct"],qb=["rightmost","mrel","mclose","mpunct"],Fb={display:X_.DISPLAY,text:X_.TEXT,script:X_.SCRIPT,scriptscript:X_.SCRIPTSCRIPT},Hb={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},$b=function(e,t,n,i){void 0===i&&(i=[null,null]);for(var r=[],o=0;o<e.length;o++){var s=Xb(e[o],t);if(s instanceof tg){var a=s.children;r.push(...a)}else r.push(s)}if(Cb.tryCombineChars(r),!n)return r;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Fb[c.style]))}var d=Bb([i[0]||"leftmost"],[],t),u=Bb([i[1]||"rightmost"],[],t),h="root"===n;return Gb(r,(e,t)=>{var n=t.classes[0],i=e.classes[0];"mbin"===n&&D_.contains(qb,i)?t.classes[0]="mord":"mbin"===i&&D_.contains(jb,n)&&(e.classes[0]="mord")},{node:d},u,h),Gb(r,(e,t)=>{var n=Wb(t),i=Wb(e),r=n&&i?e.hasClass("mtight")?Pb[n][i]:Tb[n][i]:null;if(r)return Cb.makeGlue(r,l)},{node:d},u,h),r},Gb=function e(t,n,i,r,o){r&&t.push(r);for(var s=0;s<t.length;s++){var a=t[s],l=Vb(a);if(l)e(l.children,n,i,null,o);else{var c=!a.hasClass("mspace");if(c){var d=n(a,i.node);d&&(i.insertAfter?i.insertAfter(d):(t.unshift(d),s++))}c?i.node=a:o&&a.hasClass("newline")&&(i.node=Bb(["leftmost"])),i.insertAfter=(e=>n=>{t.splice(e+1,0,n),s++})(s)}}r&&t.pop()},Vb=function(e){return e instanceof tg||e instanceof xg||e instanceof wg&&e.hasClass("enclosing")?e:null},Ub=function e(t,n){var i=Vb(t);if(i){var r=i.children;if(r.length){if("right"===n)return e(r[r.length-1],"right");if("left"===n)return e(r[0],"left")}}return t},Wb=function(e,t){return e?(t&&(e=Ub(e,t)),Hb[e.classes[0]]||null):null},Yb=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Bb(t.concat(n))},Xb=function(e,t,n){if(!e)return Bb();if(Ob[e.type]){var i=Ob[e.type](e,t);if(n&&t.size!==n.size){i=Bb(t.sizingClasses(n),[i],t);var r=t.sizeMultiplier/n.sizeMultiplier;i.height*=r,i.depth*=r}return i}throw new O_("Got group of unknown type: '"+e.type+"'")};function Kb(e,t){var n=Bb(["base"],e,t),i=Bb(["strut"]);return i.style.height=mg(n.height+n.depth),n.depth&&(i.style.verticalAlign=mg(-n.depth)),n.children.unshift(i),n}function Jb(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var i,r=$b(e,t,"root");2===r.length&&r[1].hasClass("tag")&&(i=r.pop());for(var o,s=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var c=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(c=!0);c||(s.push(Kb(a,t)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(s.push(Kb(a,t)),a=[]),s.push(r[l]));a.length>0&&s.push(Kb(a,t)),n?((o=Kb($b(n,t,!0))).classes=["tag"],s.push(o)):i&&s.push(i);var d=Bb(["katex-html"],s);if(d.setAttribute("aria-hidden","true"),o){var u=o.children[0];u.style.height=mg(d.height+d.depth),d.depth&&(u.style.verticalAlign=mg(-d.depth))}return d}function Qb(e){return new tg(e)}class Zb{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=_g(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof ey&&this.children[n+1]instanceof ey){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof ey;)i+=this.children[++n].toText();e.appendChild(new ey(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=D_.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+D_.escape(_g(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class ey{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return D_.escape(this.toText())}toText(){return this.text}}var ty={MathNode:Zb,TextNode:ey,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":e>=-.05556&&e<=-.05555?" ⁣":e>=-.1667&&e<=-.1666?" ⁣":e>=-.2223&&e<=-.2222?" ⁣":e>=-.2778&&e<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",mg(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+mg(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Qb},ny=function(e,t,n){return!Og[t][e]||!Og[t][e].replace||55349===e.charCodeAt(0)||Xg.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=Og[t][e].replace),new ty.TextNode(e)},iy=function(e){return 1===e.length?e[0]:new ty.MathNode("mrow",e)},ry=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var i=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var r=e.text;return D_.contains(["\\imath","\\jmath"],r)?null:(Og[i][r]&&Og[i][r].replace&&(r=Og[i][r].replace),og(r,Cb.fontMap[n].fontName,i)?Cb.fontMap[n].variant:null)};function oy(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof ey&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof ey&&","===n.text}return!1}var sy=function(e,t,n){if(1===e.length){var i=ly(e[0],t);return n&&i instanceof Zb&&"mo"===i.type&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var r,o=[],s=0;s<e.length;s++){var a=ly(e[s],t);if(a instanceof Zb&&r instanceof Zb){if("mtext"===a.type&&"mtext"===r.type&&a.getAttribute("mathvariant")===r.getAttribute("mathvariant")){r.children.push(...a.children);continue}if("mn"===a.type&&"mn"===r.type){r.children.push(...a.children);continue}if(oy(a)&&"mn"===r.type){r.children.push(...a.children);continue}if("mn"===a.type&&oy(r))a.children=[...r.children,...a.children],o.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===r.type||oy(r))){var l=a.children[0];l instanceof Zb&&"mn"===l.type&&(l.children=[...r.children,...l.children],o.pop())}else if("mi"===r.type&&1===r.children.length){var c=r.children[0];if(c instanceof ey&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof ey&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),o.pop())}}}o.push(a),r=a}return o},ay=function(e,t,n){return iy(sy(e,t,n))},ly=function(e,t){if(!e)return new ty.MathNode("mrow");if(Rb[e.type])return Rb[e.type](e,t);throw new O_("Got group of unknown type: '"+e.type+"'")};function cy(e,t,n,i,r){var o,s=sy(e,n);o=1===s.length&&s[0]instanceof Zb&&D_.contains(["mrow","mtable"],s[0].type)?s[0]:new ty.MathNode("mrow",s);var a=new ty.MathNode("annotation",[new ty.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new ty.MathNode("semantics",[o,a]),c=new ty.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),i&&c.setAttribute("display","block");var d=r?"katex":"katex-mathml";return Cb.makeSpan([d],[c])}var dy=function(e){return new dg({style:e.displayMode?X_.DISPLAY:X_.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},uy=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Cb.makeSpan(n,[e])}return e},hy={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},py={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},fy=function(e,t,n,i,r){var o,s=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=Cb.makeSpan(["stretchy",t],[],r),"fbox"===t){var a=r.color&&r.getColor();a&&(o.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Ag({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Ag({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Mg(l,{width:"100%",height:mg(s)});o=Cb.makeSvgSpan([],[c],r)}return o.height=s,o.style.height=mg(s),o},my=function(e){var t=new ty.MathNode("mo",[new ty.TextNode(hy[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},_y=function(e,t){var{span:n,minWidth:i,height:r}=function(){var n=4e5,i=e.label.slice(1);if(D_.contains(["widehat","widecheck","widetilde","utilde"],i)){var r,o,s,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===i||"widecheck"===i?(r=420,n=2364,s=.42,o=i+"4"):(r=312,n=2340,s=.34,o="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===i||"widecheck"===i?(n=[0,1062,2364,2364,2364][l],r=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],o=i+l):(n=[0,600,1033,2339,2340][l],r=[0,260,286,306,312][l],s=[0,.26,.286,.3,.306,.34][l],o="tilde"+l)}var c=new zg(o),d=new Mg([c],{width:"100%",height:mg(s),viewBox:"0 0 "+n+" "+r,preserveAspectRatio:"none"});return{span:Cb.makeSvgSpan([],[d],t),minWidth:0,height:s}}var u,h,p,f=[],m=py[i],[_,g,b]=m,y=b/1e3,v=_.length;if(1===v)u=["hide-tail"],h=[m[3]];else if(2===v)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==v)throw new Error("Correct katexImagesData or update code here to support\n "+v+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<v;w++){var x=new zg(_[w]),k=new Mg([x],{width:"400em",height:mg(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),S=Cb.makeSvgSpan([u[w]],[k],t);if(1===v)return{span:S,minWidth:g,height:y};S.style.height=mg(y),f.push(S)}return{span:Cb.makeSpan(["stretchy"],f,t),minWidth:g,height:y}}();return n.height=r,n.style.height=mg(r),i>0&&(n.style.minWidth=mg(i)),n};function gy(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function by(e){var t=yy(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function yy(e){return e&&("atom"===e.type||Ng.hasOwnProperty(e.type))?e:null}var vy=(e,t)=>{var n,i,r;e&&"supsub"===e.type?(n=(i=gy(e.base,"accent")).base,e.base=n,r=function(e){if(e instanceof wg)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Xb(e,t)),e.base=i):n=(i=gy(e,"accent")).base;var o=Xb(n,t.havingCrampedStyle()),s=0;if(i.isShifty&&D_.isCharacterBox(n)){var a=D_.getBaseElem(n);s=Tg(Xb(a,t.havingCrampedStyle())).skew}var l,c="\\c"===i.label,d=c?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight);if(i.isStretchy)l=_y(i,t),l=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+mg(2*s)+")",marginLeft:mg(2*s)}:void 0}]},t);else{var u,h;"\\vec"===i.label?(u=Cb.staticSvg("vec",t),h=Cb.svgData.vec[1]):((u=Tg(u=Cb.makeOrd({mode:i.mode,text:i.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),l=Cb.makeSpan(["accent-body"],[u]);var p="\\textcircled"===i.label;p&&(l.classes.push("accent-full"),d=o.height);var f=s;p||(f-=h/2),l.style.left=mg(f),"\\textcircled"===i.label&&(l.style.top=".2em"),l=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var m=Cb.makeSpan(["mord","accent"],[l],t);return r?(r.children[0]=m,r.height=Math.max(m.height,r.height),r.classes[0]="mord",r):m},wy=(e,t)=>{var n=e.isStretchy?my(e.label):new ty.MathNode("mo",[ny(e.label,e.mode)]),i=new ty.MathNode("mover",[ly(e.base,t),n]);return i.setAttribute("accent","true"),i},xy=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Lb({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Ib(t[0]),i=!xy.test(e.funcName),r=!i||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:i,isShifty:r,base:n}},htmlBuilder:vy,mathmlBuilder:wy}),Lb({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],i=e.parser.mode;return"math"===i&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),i="text"),{type:"accent",mode:i,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:vy,mathmlBuilder:wy}),Lb({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"accentUnder",mode:n.mode,label:i,base:r}},htmlBuilder:(e,t)=>{var n=Xb(e.base,t),i=_y(e,t),r="\\utilde"===e.label?.12:0,o=Cb.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:r},{type:"elem",elem:n}]},t);return Cb.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=my(e.label),i=new ty.MathNode("munder",[ly(e.base,t),n]);return i.setAttribute("accentunder","true"),i}});var ky=e=>{var t=new ty.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Lb({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i,funcName:r}=e;return{type:"xArrow",mode:i.mode,label:r,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,i=t.style,r=t.havingStyle(i.sup()),o=Cb.wrapFragment(Xb(e.body,r,t),t),s="\\x"===e.label.slice(0,2)?"x":"cd";o.classes.push(s+"-arrow-pad"),e.below&&(r=t.havingStyle(i.sub()),(n=Cb.wrapFragment(Xb(e.below,r,t),t)).classes.push(s+"-arrow-pad"));var a,l=_y(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((o.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=o.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else a=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),Cb.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,i=my(e.label);if(i.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var r=ky(ly(e.body,t));if(e.below){var o=ky(ly(e.below,t));n=new ty.MathNode("munderover",[i,o,r])}else n=new ty.MathNode("mover",[i,r])}else if(e.below){var s=ky(ly(e.below,t));n=new ty.MathNode("munder",[i,s])}else n=ky(),n=new ty.MathNode("mover",[i,n]);return n}});var Sy=Cb.makeSpan;function Cy(e,t){var n=$b(e.body,t,!0);return Sy([e.mclass],n,t)}function My(e,t){var n,i=sy(e.body,t);return"minner"===e.mclass?n=new ty.MathNode("mpadded",i):"mord"===e.mclass?e.isCharacterBox?(n=i[0]).type="mi":n=new ty.MathNode("mi",i):(e.isCharacterBox?(n=i[0]).type="mo":n=new ty.MathNode("mo",i),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Lb({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+i.slice(5),body:Db(r),isCharacterBox:D_.isCharacterBox(r)}},htmlBuilder:Cy,mathmlBuilder:My});var zy=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};Lb({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:zy(t[0]),body:Db(t[1]),isCharacterBox:D_.isCharacterBox(t[1])}}}),Lb({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:i,funcName:r}=e,o=t[1],s=t[0];n="\\stackrel"!==r?zy(o):"mrel";var a={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==r,body:Db(o)},l={type:"supsub",mode:s.mode,base:a,sup:"\\underset"===r?null:s,sub:"\\underset"===r?s:null};return{type:"mclass",mode:i.mode,mclass:n,body:[l],isCharacterBox:D_.isCharacterBox(l)}},htmlBuilder:Cy,mathmlBuilder:My}),Lb({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:zy(t[0]),body:Db(t[0])}},htmlBuilder(e,t){var n=$b(e.body,t,!0),i=Cb.makeSpan([e.mclass],n,t);return i.style.textShadow="0.02em 0.01em 0.04px",i},mathmlBuilder(e,t){var n=sy(e.body,t),i=new ty.MathNode("mstyle",n);return i.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),i}});var Ay={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ty=()=>({type:"styling",body:[],mode:"math",style:"display"}),Py=e=>"textord"===e.type&&"@"===e.text,Ny=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function Oy(e,t,n){var i=Ay[e];switch(i){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(i,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var r={type:"atom",text:i,mode:"math",family:"rel"},o={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[r],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[o],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}Lb({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"cdlabel",mode:n.mode,side:i.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),i=Cb.wrapFragment(Xb(e.label,n,t),t);return i.classes.push("cd-label-"+e.side),i.style.bottom=mg(.8-i.depth),i.height=0,i.depth=0,i},mathmlBuilder(e,t){var n=new ty.MathNode("mrow",[ly(e.label,t)]);return(n=new ty.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new ty.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Lb({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Cb.wrapFragment(Xb(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new ty.MathNode("mrow",[ly(e.fragment,t)])}),Lb({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,i=gy(t[0],"ordgroup").body,r="",o=0;o<i.length;o++){r+=gy(i[o],"textord").text}var s,a=parseInt(r);if(isNaN(a))throw new O_("\\@char has non-numeric argument "+r);if(a<0||a>=1114111)throw new O_("\\@char with invalid code point "+r);return a<=65535?s=String.fromCharCode(a):(a-=65536,s=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:s}}});var Ry=(e,t)=>{var n=$b(e.body,t.withColor(e.color),!1);return Cb.makeFragment(n)},Ly=(e,t)=>{var n=sy(e.body,t.withColor(e.color)),i=new ty.MathNode("mstyle",n);return i.setAttribute("mathcolor",e.color),i};Lb({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,i=gy(t[0],"color-token").color,r=t[1];return{type:"color",mode:n.mode,color:i,body:Db(r)}},htmlBuilder:Ry,mathmlBuilder:Ly}),Lb({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:i}=e,r=gy(t[0],"color-token").color;n.gullet.macros.set("\\current@color",r);var o=n.parseExpression(!0,i);return{type:"color",mode:n.mode,color:r,body:o}},htmlBuilder:Ry,mathmlBuilder:Ly}),Lb({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:i}=e,r="["===i.gullet.future().text?i.parseSizeGroup(!0):null,o=!i.settings.displayMode||!i.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:i.mode,newLine:o,size:r&&gy(r,"size").value}},htmlBuilder(e,t){var n=Cb.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=mg(fg(e.size,t)))),n},mathmlBuilder(e,t){var n=new ty.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",mg(fg(e.size,t)))),n}});var Ey={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Iy=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new O_("Expected a control sequence",e);return t},Dy=(e,t,n,i)=>{var r=e.gullet.macros.get(n.text);null==r&&(n.noexpand=!0,r={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,r,i)};Lb({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var i=t.fetch();if(Ey[i.text])return"\\global"!==n&&"\\\\globallong"!==n||(i.text=Ey[i.text]),gy(t.parseFunction(),"internal");throw new O_("Invalid token after macro prefix",i)}}),Lb({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=t.gullet.popToken(),r=i.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r))throw new O_("Expected a control sequence",i);for(var o,s=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(i=t.gullet.popToken()).text){if("{"===t.gullet.future().text){o=t.gullet.future(),a[s].push("{");break}if(i=t.gullet.popToken(),!/^[1-9]$/.test(i.text))throw new O_('Invalid argument number "'+i.text+'"');if(parseInt(i.text)!==s+1)throw new O_('Argument number "'+i.text+'" out of order');s++,a.push([])}else{if("EOF"===i.text)throw new O_("Expected a macro definition");a[s].push(i.text)}var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(r,{tokens:l,numArgs:s,delimiters:a},n===Ey[n]),{type:"internal",mode:t.mode}}}),Lb({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=Iy(t.gullet.popToken());t.gullet.consumeSpaces();var r=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return Dy(t,i,r,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Lb({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=Iy(t.gullet.popToken()),r=t.gullet.popToken(),o=t.gullet.popToken();return Dy(t,i,o,"\\\\globalfuture"===n),t.gullet.pushToken(o),t.gullet.pushToken(r),{type:"internal",mode:t.mode}}});var By=function(e,t,n){var i=og(Og.math[e]&&Og.math[e].replace||e,t,n);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},jy=function(e,t,n,i){var r=n.havingBaseStyle(t),o=Cb.makeSpan(i.concat(r.sizingClasses(n)),[e],n),s=r.sizeMultiplier/n.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=r.sizeMultiplier,o},qy=function(e,t,n){var i=t.havingBaseStyle(n),r=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=mg(r),e.height-=r,e.depth+=r},Fy=function(e,t,n,i,r,o){var s=function(e,t,n,i){return Cb.makeSymbol(e,"Size"+t+"-Regular",n,i)}(e,t,r,i),a=jy(Cb.makeSpan(["delimsizing","size"+t],[s],i),X_.TEXT,i,o);return n&&qy(a,i,X_.TEXT),a},Hy=function(e,t,n){var i;return i="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Cb.makeSpan(["delimsizinginner",i],[Cb.makeSpan([],[Cb.makeSymbol(e,t,n)])])}},$y=function(e,t,n){var i=ng["Size4-Regular"][e.charCodeAt(0)]?ng["Size4-Regular"][e.charCodeAt(0)][4]:ng["Size1-Regular"][e.charCodeAt(0)][4],r=new zg("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),o=new Mg([r],{width:mg(i),height:mg(t),style:"width:"+mg(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),s=Cb.makeSvgSpan([],[o],n);return s.height=t,s.style.height=mg(t),s.style.width=mg(i),{type:"elem",elem:s}},Gy={type:"kern",size:-.008},Vy=["|","\\lvert","\\rvert","\\vert"],Uy=["\\|","\\lVert","\\rVert","\\Vert"],Wy=function(e,t,n,i,r,o){var s,a,l,c,d="",u=0;s=l=c=e,a=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?s=l="⏐":"\\Downarrow"===e?s=l="‖":"\\updownarrow"===e?(s="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(s="\\Uparrow",l="‖",c="\\Downarrow"):D_.contains(Vy,e)?(l="∣",d="vert",u=333):D_.contains(Uy,e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(s="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(s="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=s="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(s="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=s="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(s="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(s="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(s="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(s="⎧",a="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(s="⎫",a="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(s="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(s="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(s="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(s="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=By(s,h,r),f=p.height+p.depth,m=By(l,h,r),_=m.height+m.depth,g=By(c,h,r),b=g.height+g.depth,y=0,v=1;if(null!==a){var w=By(a,h,r);y=w.height+w.depth,v=2}var x=f+b+y,k=x+Math.max(0,Math.ceil((t-x)/(v*_)))*v*_,S=i.fontMetrics().axisHeight;n&&(S*=i.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var z=k-f-b,A=Math.round(1e3*k),T=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*z)),P=new zg(d,T),N=(u/1e3).toFixed(3)+"em",O=(A/1e3).toFixed(3)+"em",R=new Mg([P],{width:N,height:O,viewBox:"0 0 "+u+" "+A}),L=Cb.makeSvgSpan([],[R],i);L.height=A/1e3,L.style.width=N,L.style.height=O,M.push({type:"elem",elem:L})}else{if(M.push(Hy(c,h,r)),M.push(Gy),null===a){var E=k-f-b+.016;M.push($y(l,E,i))}else{var I=(k-f-b-y)/2+.016;M.push($y(l,I,i)),M.push(Gy),M.push(Hy(a,h,r)),M.push(Gy),M.push($y(l,I,i))}M.push(Gy),M.push(Hy(s,h,r))}var D=i.havingBaseStyle(X_.TEXT),B=Cb.makeVList({positionType:"bottom",positionData:C,children:M},D);return jy(Cb.makeSpan(["delimsizing","mult"],[B],D),X_.TEXT,i,o)},Yy=.08,Xy=function(e,t,n,i,r){var o=function(e,t,n){t*=1e3;var i="";switch(e){case"sqrtMain":i=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,Z_);break;case"sqrtSize1":i=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,Z_);break;case"sqrtSize2":i=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,Z_);break;case"sqrtSize3":i=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,Z_);break;case"sqrtSize4":i=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,Z_);break;case"sqrtTall":i=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,Z_,n)}return i}(e,i,n),s=new zg(e,o),a=new Mg([s],{width:"400em",height:mg(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Cb.makeSvgSpan(["hide-tail"],[a],r)},Ky=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Jy=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Qy=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Zy=[0,1.2,1.8,2.4,3],ev=[{type:"small",style:X_.SCRIPTSCRIPT},{type:"small",style:X_.SCRIPT},{type:"small",style:X_.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],tv=[{type:"small",style:X_.SCRIPTSCRIPT},{type:"small",style:X_.SCRIPT},{type:"small",style:X_.TEXT},{type:"stack"}],nv=[{type:"small",style:X_.SCRIPTSCRIPT},{type:"small",style:X_.SCRIPT},{type:"small",style:X_.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],iv=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},rv=function(e,t,n,i){for(var r=Math.min(2,3-i.style.size);r<n.length&&"stack"!==n[r].type;r++){var o=By(e,iv(n[r]),"math"),s=o.height+o.depth;if("small"===n[r].type&&(s*=i.havingBaseStyle(n[r].style).sizeMultiplier),s>t)return n[r]}return n[n.length-1]},ov=function(e,t,n,i,r,o){var s;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),s=D_.contains(Qy,e)?ev:D_.contains(Ky,e)?nv:tv;var a=rv(e,t,s,i);return"small"===a.type?function(e,t,n,i,r,o){var s=Cb.makeSymbol(e,"Main-Regular",r,i),a=jy(s,t,i,o);return n&&qy(a,i,t),a}(e,a.style,n,i,r,o):"large"===a.type?Fy(e,a.size,n,i,r,o):Wy(e,t,n,i,r,o)},sv={sqrtImage:function(e,t){var n,i,r=t.havingBaseSizing(),o=rv("\\surd",e*r.sizeMultiplier,nv,r),s=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,d=0;return"small"===o.type?(e<1?s=1:e<1.4&&(s=.7),c=(1+a)/s,(n=Xy("sqrtMain",l=(1+a+Yy)/s,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",i=.833/s):"large"===o.type?(d=1080*Zy[o.size],c=(Zy[o.size]+a)/s,l=(Zy[o.size]+a+Yy)/s,(n=Xy("sqrtSize"+o.size,l,d,a,t)).style.minWidth="1.02em",i=1/s):(l=e+a+Yy,c=e+a,d=Math.floor(1e3*e+a)+80,(n=Xy("sqrtTall",l,d,a,t)).style.minWidth="0.742em",i=1.056),n.height=c,n.style.height=mg(l),{span:n,advanceWidth:i,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*s}},sizedDelim:function(e,t,n,i,r){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),D_.contains(Ky,e)||D_.contains(Qy,e))return Fy(e,t,!1,n,i,r);if(D_.contains(Jy,e))return Wy(e,Zy[t],!1,n,i,r);throw new O_("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Zy,customSizedDelim:ov,leftRightDelim:function(e,t,n,i,r,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,a=5/i.fontMetrics().ptPerEm,l=Math.max(t-s,n+s),c=Math.max(l/500*901,2*l-a);return ov(e,c,!0,i,r,o)}},av={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},lv=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function cv(e,t){var n=yy(e);if(n&&D_.contains(lv,n.text))return n;throw new O_(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function dv(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Lb({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=cv(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:av[e.funcName].size,mclass:av[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Cb.makeSpan([e.mclass]):sv.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(ny(e.delim,e.mode));var n=new ty.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var i=mg(sv.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",i),n.setAttribute("maxsize",i),n}}),Lb({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new O_("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:cv(t[0],e).text,color:n}}}),Lb({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=cv(t[0],e),i=e.parser;++i.leftrightDepth;var r=i.parseExpression(!1);--i.leftrightDepth,i.expect("\\right",!1);var o=gy(i.parseFunction(),"leftright-right");return{type:"leftright",mode:i.mode,body:r,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{dv(e);for(var n,i,r=$b(e.body,t,!0,["mopen","mclose"]),o=0,s=0,a=!1,l=0;l<r.length;l++)r[l].isMiddle?a=!0:(o=Math.max(r[l].height,o),s=Math.max(r[l].depth,s));if(o*=t.sizeMultiplier,s*=t.sizeMultiplier,n="."===e.left?Yb(t,["mopen"]):sv.leftRightDelim(e.left,o,s,t,e.mode,["mopen"]),r.unshift(n),a)for(var c=1;c<r.length;c++){var d=r[c].isMiddle;d&&(r[c]=sv.leftRightDelim(d.delim,o,s,d.options,e.mode,[]))}if("."===e.right)i=Yb(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;i=sv.leftRightDelim(e.right,o,s,u,e.mode,["mclose"])}return r.push(i),Cb.makeSpan(["minner"],r,t)},mathmlBuilder:(e,t)=>{dv(e);var n=sy(e.body,t);if("."!==e.left){var i=new ty.MathNode("mo",[ny(e.left,e.mode)]);i.setAttribute("fence","true"),n.unshift(i)}if("."!==e.right){var r=new ty.MathNode("mo",[ny(e.right,e.mode)]);r.setAttribute("fence","true"),e.rightColor&&r.setAttribute("mathcolor",e.rightColor),n.push(r)}return iy(n)}}),Lb({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=cv(t[0],e);if(!e.parser.leftrightDepth)throw new O_("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Yb(t,[]);else{n=sv.sizedDelim(e.delim,1,t,e.mode,[]);var i={delim:e.delim,options:t};n.isMiddle=i}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?ny("|","text"):ny(e.delim,e.mode),i=new ty.MathNode("mo",[n]);return i.setAttribute("fence","true"),i.setAttribute("lspace","0.05em"),i.setAttribute("rspace","0.05em"),i}});var uv=(e,t)=>{var n,i,r,o=Cb.wrapFragment(Xb(e.body,t),t),s=e.label.slice(1),a=t.sizeMultiplier,l=0,c=D_.isCharacterBox(e.body);if("sout"===s)(n=Cb.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===s){var d=fg({number:.6,unit:"pt"},t),u=fg({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+d+u;o.style.paddingLeft=mg(h/2+d);var p=Math.floor(1e3*h*a),f="M400000 "+(i=p)+" H0 L"+i/2+" 0 l65 45 L145 "+(i-80)+" H400000z",m=new Mg([new zg("phase",f)],{width:"400em",height:mg(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=Cb.makeSvgSpan(["hide-tail"],[m],t)).style.height=mg(h),l=o.depth+d+u}else{/cancel/.test(s)?c||o.classes.push("cancel-pad"):"angl"===s?o.classes.push("anglpad"):o.classes.push("boxpad");var _=0,g=0,b=0;/box/.test(s)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=_=t.fontMetrics().fboxsep+("colorbox"===s?0:b)):"angl"===s?(_=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-o.depth)):g=_=c?.2:0,n=fy(o,s,_,g,t),/fbox|boxed|fcolorbox/.test(s)?(n.style.borderStyle="solid",n.style.borderWidth=mg(b)):"angl"===s&&.049!==b&&(n.style.borderTopWidth=mg(b),n.style.borderRightWidth=mg(b)),l=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:o,shift:0}]},t);else{var y=/cancel|phase/.test(s)?["svg-align"]:[];r=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:y}]},t)}return/cancel/.test(s)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(s)&&!c?Cb.makeSpan(["mord","cancel-lap"],[r],t):Cb.makeSpan(["mord"],[r],t)},hv=(e,t)=>{var n=0,i=new ty.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ly(e.body,t)]);switch(e.label){case"\\cancel":i.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":i.setAttribute("notation","downdiagonalstrike");break;case"\\phase":i.setAttribute("notation","phasorangle");break;case"\\sout":i.setAttribute("notation","horizontalstrike");break;case"\\fbox":i.setAttribute("notation","box");break;case"\\angl":i.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,i.setAttribute("width","+"+2*n+"pt"),i.setAttribute("height","+"+2*n+"pt"),i.setAttribute("lspace",n+"pt"),i.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);i.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":i.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&i.setAttribute("mathbackground",e.backgroundColor),i};Lb({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,o=gy(t[0],"color-token").color,s=t[1];return{type:"enclose",mode:i.mode,label:r,backgroundColor:o,body:s}},htmlBuilder:uv,mathmlBuilder:hv}),Lb({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,o=gy(t[0],"color-token").color,s=gy(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:i.mode,label:r,backgroundColor:s,borderColor:o,body:a}},htmlBuilder:uv,mathmlBuilder:hv}),Lb({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),Lb({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"enclose",mode:n.mode,label:i,body:r}},htmlBuilder:uv,mathmlBuilder:hv}),Lb({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var pv={};function fv(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:o,mathmlBuilder:s}=e,a={type:t,numArgs:i.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r},l=0;l<n.length;++l)pv[n[l]]=a;o&&(Ob[t]=o),s&&(Rb[t]=s)}var mv={};function _v(e,t){mv[e]=t}function gv(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var bv=e=>{if(!e.parser.settings.displayMode)throw new O_("{"+e.envName+"} can be used only in display mode.")};function yv(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function vv(e,t,n){var{hskipBeforeAndAfter:i,addJot:r,cols:o,arraystretch:s,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)s=1;else if(!(s=parseFloat(p))||s<0)throw new O_("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],m=[f],_=[],g=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function v(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new N_("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),g.push(gv(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),f.push(w);var x=e.fetch().text;if("&"===x){if(u&&f.length===u){if(c||a)throw new O_("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){v(),1===f.length&&"styling"===w.type&&0===w.body[0].body.length&&(m.length>1||!d)&&m.pop(),g.length<m.length+1&&g.push([]);break}if("\\\\"!==x)throw new O_("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),_.push(k?k.value:null),v(),g.push(gv(e)),f=[],m.push(f),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:r,arraystretch:s,body:m,cols:o,rowGaps:_,hskipBeforeAndAfter:i,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:h}}function wv(e){return"d"===e.slice(0,1)?"display":"text"}var xv=function(e,t){var n,i,r=e.body.length,o=e.hLinesBeforeRow,s=0,a=new Array(r),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(X_.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?fg({number:3,unit:"ex"},t):12*d,p=3*d,f=e.arraystretch*h,m=.7*f,_=.3*f,g=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(g+=.25),l.push({pos:g,isDashed:e[t]})}for(b(o[0]),n=0;n<e.body.length;++n){var y=e.body[n],v=m,w=_;s<y.length&&(s=y.length);var x=new Array(y.length);for(i=0;i<y.length;++i){var k=Xb(y[i],t);w<k.depth&&(w=k.depth),v<k.height&&(v=k.height),x[i]=k}var S=e.rowGaps[n],C=0;S&&(C=fg(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=v,x.depth=w,g+=v,x.pos=g,g+=w+C,a[n]=x,b(o[n+1])}var M,z,A=g/2+t.fontMetrics().axisHeight,T=e.cols||[],P=[],N=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<r;++n){var O=a[n],R=O.pos-A,L=e.tags[n],E=void 0;(E=!0===L?Cb.makeSpan(["eqn-num"],[],t):!1===L?Cb.makeSpan([],[],t):Cb.makeSpan([],$b(L,t,!0),t)).depth=O.depth,E.height=O.height,N.push({type:"elem",elem:E,shift:R})}for(i=0,z=0;i<s||z<T.length;++i,++z){for(var I=T[z]||{},D=!0;"separator"===I.type;){if(D||((M=Cb.makeSpan(["arraycolsep"],[])).style.width=mg(t.fontMetrics().doubleRuleSep),P.push(M)),"|"!==I.separator&&":"!==I.separator)throw new O_("Invalid separator type: "+I.separator);var B="|"===I.separator?"solid":"dashed",j=Cb.makeSpan(["vertical-separator"],[],t);j.style.height=mg(g),j.style.borderRightWidth=mg(c),j.style.borderRightStyle=B,j.style.margin="0 "+mg(-c/2);var q=g-A;q&&(j.style.verticalAlign=mg(-q)),P.push(j),I=T[++z]||{},D=!1}if(!(i>=s)){var F=void 0;(i>0||e.hskipBeforeAndAfter)&&0!==(F=D_.deflt(I.pregap,u))&&((M=Cb.makeSpan(["arraycolsep"],[])).style.width=mg(F),P.push(M));var H=[];for(n=0;n<r;++n){var $=a[n],G=$[i];if(G){var V=$.pos-A;G.depth=$.depth,G.height=$.height,H.push({type:"elem",elem:G,shift:V})}}H=Cb.makeVList({positionType:"individualShift",children:H},t),H=Cb.makeSpan(["col-align-"+(I.align||"c")],[H]),P.push(H),(i<s-1||e.hskipBeforeAndAfter)&&0!==(F=D_.deflt(I.postgap,u))&&((M=Cb.makeSpan(["arraycolsep"],[])).style.width=mg(F),P.push(M))}}if(a=Cb.makeSpan(["mtable"],P),l.length>0){for(var U=Cb.makeLineSpan("hline",t,c),W=Cb.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:a,shift:0}];l.length>0;){var X=l.pop(),K=X.pos-A;X.isDashed?Y.push({type:"elem",elem:W,shift:K}):Y.push({type:"elem",elem:U,shift:K})}a=Cb.makeVList({positionType:"individualShift",children:Y},t)}if(0===N.length)return Cb.makeSpan(["mord"],[a],t);var J=Cb.makeVList({positionType:"individualShift",children:N},t);return J=Cb.makeSpan(["tag"],[J],t),Cb.makeFragment([a,J])},kv={c:"center ",l:"left ",r:"right "},Sv=function(e,t){for(var n=[],i=new ty.MathNode("mtd",[],["mtr-glue"]),r=new ty.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var s=e.body[o],a=[],l=0;l<s.length;l++)a.push(new ty.MathNode("mtd",[ly(s[l],t)]));e.tags&&e.tags[o]&&(a.unshift(i),a.push(i),e.leqno?a.unshift(r):a.push(r)),n.push(new ty.MathNode("mtr",a))}var c=new ty.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",mg(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,f="",m=!1,_=0,g=p.length;"separator"===p[0].type&&(u+="top ",_=1),"separator"===p[p.length-1].type&&(u+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(h+=kv[p[b].align],m&&(f+="none "),m=!0):"separator"===p[b].type&&m&&(f+="|"===p[b].separator?"solid ":"dashed ",m=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(f)&&c.setAttribute("columnlines",f.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],v="",w=1;w<y.length;w++)v+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",v.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;u+=k[0].length>0?"left ":"",u+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==u&&(c=new ty.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new ty.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},Cv=function(e,t){-1===e.envName.indexOf("ed")&&bv(e);var n,i=[],r=e.envName.indexOf("at")>-1?"alignat":"align",o="split"===e.envName,s=vv(e.parser,{cols:i,addJot:!0,autoTag:o?void 0:yv(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++){c+=gy(t[0].body[d],"textord").text}n=Number(c),a=2*n}var u=!a;s.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var i=gy(e[t],"styling");gy(i.body[0],"ordgroup").body.unshift(l)}if(u)a<e.length&&(a=e.length);else{var r=e.length/2;if(n<r)throw new O_("Too many math in a row: expected "+n+", but got "+r,e[0])}});for(var h=0;h<a;++h){var p="r",f=0;h%2==1?p="l":h>0&&u&&(f=1),i[h]={type:"align",align:p,pregap:f,postgap:0}}return s.colSeparationType=u?"align":"alignat",s};fv({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(yy(t[0])?[t[0]]:gy(t[0],"ordgroup").body).map(function(e){var t=by(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new O_("Unknown column alignment: "+t,e)}),i={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return vv(e.parser,i,wv(e.envName))},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",i={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var r=e.parser;if(r.consumeSpaces(),"["===r.fetch().text){if(r.consume(),r.consumeSpaces(),n=r.fetch().text,-1==="lcr".indexOf(n))throw new O_("Expected l or c or r",r.nextToken);r.consume(),r.consumeSpaces(),r.expect("]"),r.consume(),i.cols=[{type:"align",align:n}]}}var o=vv(e.parser,i,wv(e.envName)),s=Math.max(0,...o.body.map(e=>e.length));return o.cols=new Array(s).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=vv(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(yy(t[0])?[t[0]]:gy(t[0],"ordgroup").body).map(function(e){var t=by(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new O_("Unknown column alignment: "+t,e)});if(n.length>1)throw new O_("{subarray} can contain only one column");var i={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((i=vv(e.parser,i,"script")).body.length>0&&i.body[0].length>1)throw new O_("{subarray} can contain only one column");return i},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=vv(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},wv(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Cv,htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){D_.contains(["gather","gather*"],e.envName)&&bv(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:yv(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return vv(e.parser,t,"display")},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Cv,htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){bv(e);var t={autoTag:yv(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return vv(e.parser,t,"display")},htmlBuilder:xv,mathmlBuilder:Sv}),fv({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(bv(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new O_("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var i=[],r=[i],o=0;o<t.length;o++){for(var s=t[o],a=Ty(),l=0;l<s.length;l++)if(Py(s[l])){i.push(a);var c=by(s[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new O_('Expected one of "<>AV=|." after @',s[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<s.length;p++){if(Ny(s[p],c)){h=!1,l=p;break}if(Py(s[p]))throw new O_("Missing a "+c+" character to complete a CD arrow.",s[p]);d[u].body.push(s[p])}if(h)throw new O_("Missing a "+c+" character to complete a CD arrow.",s[l])}}var f={type:"styling",body:[Oy(c,d,e)],mode:"math",style:"display"};i.push(f),a=Ty()}else a.body.push(s[l]);o%2==0?i.push(a):i.shift(),i=[],r.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:r,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(r[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(r.length+1).fill([])}}(e.parser)),htmlBuilder:xv,mathmlBuilder:Sv}),_v("\\nonumber","\\gdef\\@eqnsw{0}"),_v("\\notag","\\nonumber"),Lb({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new O_(e.funcName+" valid only within array environment")}});var Mv=pv;Lb({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];if("ordgroup"!==r.type)throw new O_("Invalid environment name",r);for(var o="",s=0;s<r.body.length;++s)o+=gy(r.body[s],"textord").text;if("\\begin"===i){if(!Mv.hasOwnProperty(o))throw new O_("No such environment: "+o,r);var a=Mv[o],{args:l,optArgs:c}=n.parseArguments("\\begin{"+o+"}",a),d={mode:n.mode,envName:o,parser:n},u=a.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=gy(n.parseFunction(),"environment");if(p.name!==o)throw new O_("Mismatch: \\begin{"+o+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:o,nameGroup:r}}});var zv=(e,t)=>{var n=e.font,i=t.withFont(n);return Xb(e.body,i)},Av=(e,t)=>{var n=e.font,i=t.withFont(n);return ly(e.body,i)},Tv={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Lb({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=Ib(t[0]),o=i;return o in Tv&&(o=Tv[o]),{type:"font",mode:n.mode,font:o.slice(1),body:r}},htmlBuilder:zv,mathmlBuilder:Av}),Lb({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,i=t[0],r=D_.isCharacterBox(i);return{type:"mclass",mode:n.mode,mclass:zy(i),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:i}],isCharacterBox:r}}}),Lb({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i,breakOnTokenText:r}=e,{mode:o}=n,s=n.parseExpression(!0,r);return{type:"font",mode:o,font:"math"+i.slice(1),body:{type:"ordgroup",mode:n.mode,body:s}}},htmlBuilder:zv,mathmlBuilder:Av});var Pv=(e,t)=>{var n=t;return"display"===e?n=n.id>=X_.SCRIPT.id?n.text():X_.DISPLAY:"text"===e&&n.size===X_.DISPLAY.size?n=X_.TEXT:"script"===e?n=X_.SCRIPT:"scriptscript"===e&&(n=X_.SCRIPTSCRIPT),n},Nv=(e,t)=>{var n,i=Pv(e.size,t.style),r=i.fracNum(),o=i.fracDen();n=t.havingStyle(r);var s=Xb(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;s.height=s.height<a?a:s.height,s.depth=s.depth<l?l:s.depth}n=t.havingStyle(o);var c,d,u,h,p,f,m,_,g,b,y=Xb(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=fg(e.barSize,t),c=Cb.makeLineSpan("frac-line",t,d)):c=Cb.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),i.size===X_.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,f=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),f=t.fontMetrics().denom2),c){var v=t.fontMetrics().axisHeight;h-s.depth-(v+.5*d)<p&&(h+=p-(h-s.depth-(v+.5*d))),v-.5*d-(y.height-f)<p&&(f+=p-(v-.5*d-(y.height-f)));var w=-(v-.5*d);m=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:c,shift:w},{type:"elem",elem:s,shift:-h}]},t)}else{var x=h-s.depth-(y.height-f);x<p&&(h+=.5*(p-x),f+=.5*(p-x)),m=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:s,shift:-h}]},t)}return n=t.havingStyle(i),m.height*=n.sizeMultiplier/t.sizeMultiplier,m.depth*=n.sizeMultiplier/t.sizeMultiplier,_=i.size===X_.DISPLAY.size?t.fontMetrics().delim1:i.size===X_.SCRIPTSCRIPT.size?t.havingStyle(X_.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?Yb(t,["mopen"]):sv.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(i),e.mode,["mopen"]),b=e.continued?Cb.makeSpan([]):null==e.rightDelim?Yb(t,["mclose"]):sv.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(i),e.mode,["mclose"]),Cb.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,Cb.makeSpan(["mfrac"],[m]),b],t)},Ov=(e,t)=>{var n=new ty.MathNode("mfrac",[ly(e.numer,t),ly(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var i=fg(e.barSize,t);n.setAttribute("linethickness",mg(i))}}else n.setAttribute("linethickness","0px");var r=Pv(e.size,t.style);if(r.size!==t.style.size){n=new ty.MathNode("mstyle",[n]);var o=r.size===X_.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var s=[];if(null!=e.leftDelim){var a=new ty.MathNode("mo",[new ty.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}if(s.push(n),null!=e.rightDelim){var l=new ty.MathNode("mo",[new ty.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return iy(s)}return n};Lb({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:i,funcName:r}=e,o=t[0],s=t[1],a=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:i.mode,continued:!1,numer:o,denom:s,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:Nv,mathmlBuilder:Ov}),Lb({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],o=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:r,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Lb({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:i,token:r}=e;switch(i){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:r}}});var Rv=["display","text","script","scriptscript"],Lv=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Lb({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:i}=e,r=t[4],o=t[5],s=Ib(t[0]),a="atom"===s.type&&"open"===s.family?Lv(s.text):null,l=Ib(t[1]),c="atom"===l.type&&"close"===l.family?Lv(l.text):null,d=gy(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var f=gy(p.body[0],"textord");h=Rv[Number(f.text)]}}else p=gy(p,"textord"),h=Rv[Number(p.text)];return{type:"genfrac",mode:i.mode,numer:r,denom:o,continued:!1,hasBarLine:n,barSize:u,leftDelim:a,rightDelim:c,size:h}},htmlBuilder:Nv,mathmlBuilder:Ov}),Lb({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:i,token:r}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:gy(t[0],"size").value,token:r}}}),Lb({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],o=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(gy(t[1],"infix").size),s=t[2],a=o.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:a,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Nv,mathmlBuilder:Ov});var Ev=(e,t)=>{var n,i,r=t.style;"supsub"===e.type?(n=e.sup?Xb(e.sup,t.havingStyle(r.sup()),t):Xb(e.sub,t.havingStyle(r.sub()),t),i=gy(e.base,"horizBrace")):i=gy(e,"horizBrace");var o,s=Xb(i.base,t.havingBaseStyle(X_.DISPLAY)),a=_y(i,t);if(i.isOver?(o=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(o=Cb.makeVList({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=Cb.makeSpan(["mord",i.isOver?"mover":"munder"],[o],t);o=i.isOver?Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Cb.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Cb.makeSpan(["mord",i.isOver?"mover":"munder"],[o],t)};Lb({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"horizBrace",mode:n.mode,label:i,isOver:/^\\over/.test(i),base:t[0]}},htmlBuilder:Ev,mathmlBuilder:(e,t)=>{var n=my(e.label);return new ty.MathNode(e.isOver?"mover":"munder",[ly(e.base,t),n])}}),Lb({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[1],r=gy(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:r})?{type:"href",mode:n.mode,href:r,body:Db(i)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=$b(e.body,t,!1);return Cb.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ay(e.body,t);return n instanceof Zb||(n=new Zb("mrow",[n])),n.setAttribute("href",e.href),n}}),Lb({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=gy(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:i}))return n.formatUnsupportedCmd("\\url");for(var r=[],o=0;o<i.length;o++){var s=i[o];"~"===s&&(s="\\textasciitilde"),r.push({type:"textord",mode:"text",text:s})}var a={type:"text",mode:n.mode,font:"\\texttt",body:r};return{type:"href",mode:n.mode,href:i,body:Db(a)}}}),Lb({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Db(t[0])}},htmlBuilder(e,t){var n=$b(e.body,t,!1);return Cb.makeFragment(n)},mathmlBuilder:(e,t)=>new ty.MathNode("mrow",sy(e.body,t))}),Lb({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:i,funcName:r,token:o}=e,s=gy(t[0],"raw").string,a=t[1];i.settings.strict&&i.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(r){case"\\htmlClass":l.class=s,n={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,n={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,n={command:"\\htmlStyle",style:s};break;case"\\htmlData":for(var c=s.split(","),d=0;d<c.length;d++){var u=c[d].split("=");if(2!==u.length)throw new O_("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return i.settings.isTrusted(n)?{type:"html",mode:i.mode,attributes:l,body:Db(a)}:i.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=$b(e.body,t,!1),i=["enclosing"];e.attributes.class&&i.push(...e.attributes.class.trim().split(/\s+/));var r=Cb.makeSpan(i,n,t);for(var o in e.attributes)"class"!==o&&e.attributes.hasOwnProperty(o)&&r.setAttribute(o,e.attributes[o]);return r},mathmlBuilder:(e,t)=>ay(e.body,t)}),Lb({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Db(t[0]),mathml:Db(t[1])}},htmlBuilder:(e,t)=>{var n=$b(e.html,t,!1);return Cb.makeFragment(n)},mathmlBuilder:(e,t)=>ay(e.mathml,t)});var Iv=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new O_("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!pg(n))throw new O_("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Lb({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:i}=e,r={number:0,unit:"em"},o={number:.9,unit:"em"},s={number:0,unit:"em"},a="";if(n[0])for(var l=gy(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":a=u;break;case"width":r=Iv(u);break;case"height":o=Iv(u);break;case"totalheight":s=Iv(u);break;default:throw new O_("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=gy(t[0],"url").url;return""===a&&(a=(a=(a=h).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),i.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:i.mode,alt:a,width:r,height:o,totalheight:s,src:h}:i.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=fg(e.height,t),i=0;e.totalheight.number>0&&(i=fg(e.totalheight,t)-n);var r=0;e.width.number>0&&(r=fg(e.width,t));var o={height:mg(n+i)};r>0&&(o.width=mg(r)),i>0&&(o.verticalAlign=mg(-i));var s=new kg(e.src,e.alt,o);return s.height=n,s.depth=i,s},mathmlBuilder:(e,t)=>{var n=new ty.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var i=fg(e.height,t),r=0;if(e.totalheight.number>0&&(r=fg(e.totalheight,t)-i,n.setAttribute("valign",mg(-r))),n.setAttribute("height",mg(i+r)),e.width.number>0){var o=fg(e.width,t);n.setAttribute("width",mg(o))}return n.setAttribute("src",e.src),n}}),Lb({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=gy(t[0],"size");if(n.settings.strict){var o="m"===i[1],s="mu"===r.value.unit;o?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" supports only mu units, not "+r.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:r.value}},htmlBuilder:(e,t)=>Cb.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=fg(e.dimension,t);return new ty.SpaceNode(n)}}),Lb({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"lap",mode:n.mode,alignment:i.slice(5),body:r}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Cb.makeSpan([],[Xb(e.body,t)]),n=Cb.makeSpan(["inner"],[n],t)):n=Cb.makeSpan(["inner"],[Xb(e.body,t)]);var i=Cb.makeSpan(["fix"],[]),r=Cb.makeSpan([e.alignment],[n,i],t),o=Cb.makeSpan(["strut"]);return o.style.height=mg(r.height+r.depth),r.depth&&(o.style.verticalAlign=mg(-r.depth)),r.children.unshift(o),r=Cb.makeSpan(["thinbox"],[r],t),Cb.makeSpan(["mord","vbox"],[r],t)},mathmlBuilder:(e,t)=>{var n=new ty.MathNode("mpadded",[ly(e.body,t)]);if("rlap"!==e.alignment){var i="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",i+"width")}return n.setAttribute("width","0px"),n}}),Lb({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:i}=e,r=i.mode;i.switchMode("math");var o="\\("===n?"\\)":"$",s=i.parseExpression(!1,o);return i.expect(o),i.switchMode(r),{type:"styling",mode:i.mode,style:"text",body:s}}}),Lb({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new O_("Mismatched "+e.funcName)}});var Dv=(e,t)=>{switch(t.style.size){case X_.DISPLAY.size:return e.display;case X_.TEXT.size:return e.text;case X_.SCRIPT.size:return e.script;case X_.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Lb({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Db(t[0]),text:Db(t[1]),script:Db(t[2]),scriptscript:Db(t[3])}},htmlBuilder:(e,t)=>{var n=Dv(e,t),i=$b(n,t,!1);return Cb.makeFragment(i)},mathmlBuilder:(e,t)=>{var n=Dv(e,t);return ay(n,t)}});var Bv=(e,t,n,i,r,o,s)=>{e=Cb.makeSpan([],[e]);var a,l,c,d=n&&D_.isCharacterBox(n);if(t){var u=Xb(t,i.havingStyle(r.sup()),i);l={elem:u,kern:Math.max(i.fontMetrics().bigOpSpacing1,i.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=Xb(n,i.havingStyle(r.sub()),i);a={elem:h,kern:Math.max(i.fontMetrics().bigOpSpacing2,i.fontMetrics().bigOpSpacing4-h.height)}}if(l&&a){var p=i.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+s;c=Cb.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:mg(-o)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:mg(o)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}else if(a){var f=e.height-s;c=Cb.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:mg(-o)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},i)}else{if(!l)return e;var m=e.depth+s;c=Cb.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:mg(o)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}var _=[c];if(a&&0!==o&&!d){var g=Cb.makeSpan(["mspace"],[],i);g.style.marginRight=mg(o),_.unshift(g)}return Cb.makeSpan(["mop","op-limits"],_,i)},jv=["\\smallint"],qv=(e,t)=>{var n,i,r,o=!1;"supsub"===e.type?(n=e.sup,i=e.sub,r=gy(e.base,"op"),o=!0):r=gy(e,"op");var s,a=t.style,l=!1;if(a.size===X_.DISPLAY.size&&r.symbol&&!D_.contains(jv,r.name)&&(l=!0),r.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==r.name&&"\\oiiint"!==r.name||(d=r.name.slice(1),r.name="oiint"===d?"\\iint":"\\iiint"),s=Cb.makeSymbol(r.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var u=s.italic,h=Cb.staticSvg(d+"Size"+(l?"2":"1"),t);s=Cb.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),r.name="\\"+d,s.classes.unshift("mop"),s.italic=u}}else if(r.body){var p=$b(r.body,t,!0);1===p.length&&p[0]instanceof Cg?(s=p[0]).classes[0]="mop":s=Cb.makeSpan(["mop"],p,t)}else{for(var f=[],m=1;m<r.name.length;m++)f.push(Cb.mathsym(r.name[m],r.mode,t));s=Cb.makeSpan(["mop"],f,t)}var _=0,g=0;return(s instanceof Cg||"\\oiint"===r.name||"\\oiiint"===r.name)&&!r.suppressBaseShift&&(_=(s.height-s.depth)/2-t.fontMetrics().axisHeight,g=s.italic),o?Bv(s,n,i,t,a,g,_):(_&&(s.style.position="relative",s.style.top=mg(_)),s)},Fv=(e,t)=>{var n;if(e.symbol)n=new Zb("mo",[ny(e.name,e.mode)]),D_.contains(jv,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Zb("mo",sy(e.body,t));else{n=new Zb("mi",[new ey(e.name.slice(1))]);var i=new Zb("mo",[ny("⁡","text")]);n=e.parentIsSupSub?new Zb("mrow",[n,i]):Qb([n,i])}return n},Hv={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Lb({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=i;return 1===r.length&&(r=Hv[r]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:qv,mathmlBuilder:Fv}),Lb({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Db(i)}},htmlBuilder:qv,mathmlBuilder:Fv});var $v={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Lb({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:qv,mathmlBuilder:Fv}),Lb({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:qv,mathmlBuilder:Fv}),Lb({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,i=n;return 1===i.length&&(i=$v[i]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:qv,mathmlBuilder:Fv});var Gv=(e,t)=>{var n,i,r,o,s=!1;if("supsub"===e.type?(n=e.sup,i=e.sub,r=gy(e.base,"operatorname"),s=!0):r=gy(e,"operatorname"),r.body.length>0){for(var a=r.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=$b(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof Cg&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=Cb.makeSpan(["mop"],l,t)}else o=Cb.makeSpan(["mop"],[],t);return s?Bv(o,n,i,t,t.style,0,0):o};function Vv(e,t,n){for(var i=$b(e,t,!1),r=t.sizeMultiplier/n.sizeMultiplier,o=0;o<i.length;o++){var s=i[o].classes.indexOf("sizing");s<0?Array.prototype.push.apply(i[o].classes,t.sizingClasses(n)):i[o].classes[s+1]==="reset-size"+t.size&&(i[o].classes[s+1]="reset-size"+n.size),i[o].height*=r,i[o].depth*=r}return Cb.makeFragment(i)}Lb({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"operatorname",mode:n.mode,body:Db(r),alwaysHandleSupSub:"\\operatornamewithlimits"===i,limits:!1,parentIsSupSub:!1}},htmlBuilder:Gv,mathmlBuilder:(e,t)=>{for(var n=sy(e.body,t.withFont("mathrm")),i=!0,r=0;r<n.length;r++){var o=n[r];if(o instanceof ty.SpaceNode);else if(o instanceof ty.MathNode)switch(o.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var s=o.children[0];1===o.children.length&&s instanceof ty.TextNode?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):i=!1;break;default:i=!1}else i=!1}if(i){var a=n.map(e=>e.toText()).join("");n=[new ty.TextNode(a)]}var l=new ty.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new ty.MathNode("mo",[ny("⁡","text")]);return e.parentIsSupSub?new ty.MathNode("mrow",[l,c]):ty.newDocumentFragment([l,c])}}),_v("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Eb({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Cb.makeFragment($b(e.body,t,!1)):Cb.makeSpan(["mord"],$b(e.body,t,!0),t),mathmlBuilder:(e,t)=>ay(e.body,t,!0)}),Lb({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,i=t[0];return{type:"overline",mode:n.mode,body:i}},htmlBuilder(e,t){var n=Xb(e.body,t.havingCrampedStyle()),i=Cb.makeLineSpan("overline-line",t),r=t.fontMetrics().defaultRuleThickness,o=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:i},{type:"kern",size:r}]},t);return Cb.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new ty.MathNode("mo",[new ty.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new ty.MathNode("mover",[ly(e.body,t),n]);return i.setAttribute("accent","true"),i}}),Lb({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"phantom",mode:n.mode,body:Db(i)}},htmlBuilder:(e,t)=>{var n=$b(e.body,t.withPhantom(),!1);return Cb.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=sy(e.body,t);return new ty.MathNode("mphantom",n)}}),Lb({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"hphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=Cb.makeSpan([],[Xb(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var i=0;i<n.children.length;i++)n.children[i].height=0,n.children[i].depth=0;return n=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Cb.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=sy(Db(e.body),t),i=new ty.MathNode("mphantom",n),r=new ty.MathNode("mpadded",[i]);return r.setAttribute("height","0px"),r.setAttribute("depth","0px"),r}}),Lb({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"vphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=Cb.makeSpan(["inner"],[Xb(e.body,t.withPhantom())]),i=Cb.makeSpan(["fix"],[]);return Cb.makeSpan(["mord","rlap"],[n,i],t)},mathmlBuilder:(e,t)=>{var n=sy(Db(e.body),t),i=new ty.MathNode("mphantom",n),r=new ty.MathNode("mpadded",[i]);return r.setAttribute("width","0px"),r}}),Lb({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,i=gy(t[0],"size").value,r=t[1];return{type:"raisebox",mode:n.mode,dy:i,body:r}},htmlBuilder(e,t){var n=Xb(e.body,t),i=fg(e.dy,t);return Cb.makeVList({positionType:"shift",positionData:-i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new ty.MathNode("mpadded",[ly(e.body,t)]),i=e.dy.number+e.dy.unit;return n.setAttribute("voffset",i),n}}),Lb({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Lb({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:i}=e,r=n[0],o=gy(t[0],"size"),s=gy(t[1],"size");return{type:"rule",mode:i.mode,shift:r&&gy(r,"size").value,width:o.value,height:s.value}},htmlBuilder(e,t){var n=Cb.makeSpan(["mord","rule"],[],t),i=fg(e.width,t),r=fg(e.height,t),o=e.shift?fg(e.shift,t):0;return n.style.borderRightWidth=mg(i),n.style.borderTopWidth=mg(r),n.style.bottom=mg(o),n.width=i,n.height=r+o,n.depth=-o,n.maxFontSize=1.125*r*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=fg(e.width,t),i=fg(e.height,t),r=e.shift?fg(e.shift,t):0,o=t.color&&t.getColor()||"black",s=new ty.MathNode("mspace");s.setAttribute("mathbackground",o),s.setAttribute("width",mg(n)),s.setAttribute("height",mg(i));var a=new ty.MathNode("mpadded",[s]);return r>=0?a.setAttribute("height",mg(r)):(a.setAttribute("height",mg(r)),a.setAttribute("depth",mg(-r))),a.setAttribute("voffset",mg(r)),a}});var Uv=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Lb({type:"sizing",names:Uv,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:i,parser:r}=e,o=r.parseExpression(!1,n);return{type:"sizing",mode:r.mode,size:Uv.indexOf(i)+1,body:o}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Vv(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),i=sy(e.body,n),r=new ty.MathNode("mstyle",i);return r.setAttribute("mathsize",mg(n.sizeMultiplier)),r}}),Lb({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:i}=e,r=!1,o=!1,s=n[0]&&gy(n[0],"ordgroup");if(s)for(var a="",l=0;l<s.body.length;++l){if("t"===(a=s.body[l].text))r=!0;else{if("b"!==a){r=!1,o=!1;break}o=!0}}else r=!0,o=!0;var c=t[0];return{type:"smash",mode:i.mode,body:c,smashHeight:r,smashDepth:o}},htmlBuilder:(e,t)=>{var n=Cb.makeSpan([],[Xb(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].depth=0;var o=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Cb.makeSpan(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ty.MathNode("mpadded",[ly(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Lb({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i}=e,r=n[0],o=t[0];return{type:"sqrt",mode:i.mode,body:o,index:r}},htmlBuilder(e,t){var n=Xb(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Cb.wrapFragment(n,t);var i=t.fontMetrics().defaultRuleThickness,r=i;t.style.id<X_.TEXT.id&&(r=t.fontMetrics().xHeight);var o=i+r/4,s=n.height+n.depth+o+i,{span:a,ruleWidth:l,advanceWidth:c}=sv.sqrtImage(s,t),d=a.height-l;d>n.height+n.depth+o&&(o=(o+d-n.height-n.depth)/2);var u=a.height-n.height-o-l;n.style.paddingLeft=mg(c);var h=Cb.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(X_.SCRIPTSCRIPT),f=Xb(e.index,p,t),m=.6*(h.height-h.depth),_=Cb.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:f}]},t),g=Cb.makeSpan(["root"],[_]);return Cb.makeSpan(["mord","sqrt"],[g,h],t)}return Cb.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:i}=e;return i?new ty.MathNode("mroot",[ly(n,t),ly(i,t)]):new ty.MathNode("msqrt",[ly(n,t)])}});var Wv={display:X_.DISPLAY,text:X_.TEXT,script:X_.SCRIPT,scriptscript:X_.SCRIPTSCRIPT};Lb({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:i,parser:r}=e,o=r.parseExpression(!0,n),s=i.slice(1,i.length-5);return{type:"styling",mode:r.mode,style:s,body:o}},htmlBuilder(e,t){var n=Wv[e.style],i=t.havingStyle(n).withFont("");return Vv(e.body,i,t)},mathmlBuilder(e,t){var n=Wv[e.style],i=t.havingStyle(n),r=sy(e.body,i),o=new ty.MathNode("mstyle",r),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return o.setAttribute("scriptlevel",s[0]),o.setAttribute("displaystyle",s[1]),o}});Eb({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===X_.DISPLAY.size||n.alwaysHandleSupSub)?qv:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===X_.DISPLAY.size||n.limits)?Gv:null:"accent"===n.type?D_.isCharacterBox(n.base)?vy:null:"horizBrace"===n.type&&!e.sub===n.isOver?Ev:null:null}(e,t);if(n)return n(e,t);var i,r,o,{base:s,sup:a,sub:l}=e,c=Xb(s,t),d=t.fontMetrics(),u=0,h=0,p=s&&D_.isCharacterBox(s);if(a){var f=t.havingStyle(t.style.sup());i=Xb(a,f,t),p||(u=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(l){var m=t.havingStyle(t.style.sub());r=Xb(l,m,t),p||(h=c.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}o=t.style===X_.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=mg(.5/d.ptPerEm/g),y=null;if(r){var v=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Cg||v)&&(y=mg(-c.italic))}if(i&&r){u=Math.max(u,o,i.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var w=4*d.defaultRuleThickness;if(u-i.depth-(r.height-h)<w){h=w-(u-i.depth)+r.height;var x=.8*d.xHeight-(u-i.depth);x>0&&(u+=x,h-=x)}var k=[{type:"elem",elem:r,shift:h,marginRight:b,marginLeft:y},{type:"elem",elem:i,shift:-u,marginRight:b}];_=Cb.makeVList({positionType:"individualShift",children:k},t)}else if(r){h=Math.max(h,d.sub1,r.height-.8*d.xHeight);var S=[{type:"elem",elem:r,marginLeft:y,marginRight:b}];_=Cb.makeVList({positionType:"shift",positionData:h,children:S},t)}else{if(!i)throw new Error("supsub must have either sup or sub.");u=Math.max(u,o,i.depth+.25*d.xHeight),_=Cb.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:i,marginRight:b}]},t)}var C=Wb(c,"right")||"mord";return Cb.makeSpan([C],[c,Cb.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,i=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(i=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var r,o=[ly(e.base,t)];if(e.sub&&o.push(ly(e.sub,t)),e.sup&&o.push(ly(e.sup,t)),i)r=n?"mover":"munder";else if(e.sub)if(e.sup){var s=e.base;r=s&&"op"===s.type&&s.limits&&t.style===X_.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(t.style===X_.DISPLAY||s.limits)?"munderover":"msubsup"}else{var a=e.base;r=a&&"op"===a.type&&a.limits&&(t.style===X_.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===X_.DISPLAY)?"munder":"msub"}else{var l=e.base;r=l&&"op"===l.type&&l.limits&&(t.style===X_.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===X_.DISPLAY)?"mover":"msup"}return new ty.MathNode(r,o)}}),Eb({type:"atom",htmlBuilder:(e,t)=>Cb.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new ty.MathNode("mo",[ny(e.text,e.mode)]);if("bin"===e.family){var i=ry(e,t);"bold-italic"===i&&n.setAttribute("mathvariant",i)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Yv={mi:"italic",mn:"normal",mtext:"normal"};Eb({type:"mathord",htmlBuilder:(e,t)=>Cb.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new ty.MathNode("mi",[ny(e.text,e.mode,t)]),i=ry(e,t)||"italic";return i!==Yv[n.type]&&n.setAttribute("mathvariant",i),n}}),Eb({type:"textord",htmlBuilder:(e,t)=>Cb.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,i=ny(e.text,e.mode,t),r=ry(e,t)||"normal";return n="text"===e.mode?new ty.MathNode("mtext",[i]):/[0-9]/.test(e.text)?new ty.MathNode("mn",[i]):"\\prime"===e.text?new ty.MathNode("mo",[i]):new ty.MathNode("mi",[i]),r!==Yv[n.type]&&n.setAttribute("mathvariant",r),n}});var Xv={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Kv={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Eb({type:"spacing",htmlBuilder(e,t){if(Kv.hasOwnProperty(e.text)){var n=Kv[e.text].className||"";if("text"===e.mode){var i=Cb.makeOrd(e,t,"textord");return i.classes.push(n),i}return Cb.makeSpan(["mspace",n],[Cb.mathsym(e.text,e.mode,t)],t)}if(Xv.hasOwnProperty(e.text))return Cb.makeSpan(["mspace",Xv[e.text]],[],t);throw new O_('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Kv.hasOwnProperty(e.text)){if(Xv.hasOwnProperty(e.text))return new ty.MathNode("mspace");throw new O_('Unknown type of space "'+e.text+'"')}return new ty.MathNode("mtext",[new ty.TextNode(" ")])}});var Jv=()=>{var e=new ty.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Eb({type:"tag",mathmlBuilder(e,t){var n=new ty.MathNode("mtable",[new ty.MathNode("mtr",[Jv(),new ty.MathNode("mtd",[ay(e.body,t)]),Jv(),new ty.MathNode("mtd",[ay(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Qv={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Zv={"\\textbf":"textbf","\\textmd":"textmd"},ew={"\\textit":"textit","\\textup":"textup"},tw=(e,t)=>{var n=e.font;return n?Qv[n]?t.withTextFontFamily(Qv[n]):Zv[n]?t.withTextFontWeight(Zv[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(ew[n]):t};Lb({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"text",mode:n.mode,body:Db(r),font:i}},htmlBuilder(e,t){var n=tw(e,t),i=$b(e.body,n,!0);return Cb.makeSpan(["mord","text"],i,n)},mathmlBuilder(e,t){var n=tw(e,t);return ay(e.body,n)}}),Lb({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Xb(e.body,t),i=Cb.makeLineSpan("underline-line",t),r=t.fontMetrics().defaultRuleThickness,o=Cb.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:r},{type:"elem",elem:i},{type:"kern",size:3*r},{type:"elem",elem:n}]},t);return Cb.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new ty.MathNode("mo",[new ty.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new ty.MathNode("munder",[ly(e.body,t),n]);return i.setAttribute("accentunder","true"),i}}),Lb({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Xb(e.body,t),i=t.fontMetrics().axisHeight,r=.5*(n.height-i-(n.depth+i));return Cb.makeVList({positionType:"shift",positionData:r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new ty.MathNode("mpadded",[ly(e.body,t)],["vcenter"])}),Lb({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new O_("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=nw(e),i=[],r=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var s=n[o];"~"===s&&(s="\\textasciitilde"),i.push(Cb.makeSymbol(s,"Typewriter-Regular",e.mode,r,["mord","texttt"]))}return Cb.makeSpan(["mord","text"].concat(r.sizingClasses(t)),Cb.tryCombineChars(i),r)},mathmlBuilder(e,t){var n=new ty.TextNode(nw(e)),i=new ty.MathNode("mtext",[n]);return i.setAttribute("mathvariant","monospace"),i}});var nw=e=>e.body.replace(/ /g,e.star?"␣":" "),iw=Nb,rw="[ \r\n\t]",ow="(\\\\[a-zA-Z@]+)"+rw+"*",sw="[̀-ͯ]",aw=new RegExp(sw+"+$"),lw="("+rw+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]"+sw+"*|[\ud800-\udbff][\udc00-\udfff]"+sw+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+ow+"|\\\\[^\ud800-\udfff])";class cw{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(lw,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new N_("EOF",new P_(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new O_("Unexpected character: '"+e[t]+"'",new N_(e[t],new P_(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[i]){var r=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===r?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=r+1,this.lex()}return new N_(i,new P_(this,t,this.tokenRegex.lastIndex))}}class dw{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new O_("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var r=this.undefStack[this.undefStack.length-1];r&&!r.hasOwnProperty(e)&&(r[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var uw=mv;_v("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),_v("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),_v("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),_v("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),_v("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),_v("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),_v("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var hw={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};_v("\\char",function(e){var t,n=e.popToken(),i="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])i=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new O_("\\char` missing argument");i=n.text.charCodeAt(0)}else t=10;if(t){if(null==(i=hw[n.text])||i>=t)throw new O_("Invalid base-"+t+" digit "+n.text);for(var r;null!=(r=hw[e.future().text])&&r<t;)i*=t,i+=r,e.popToken()}return"\\@char{"+i+"}"});var pw=(e,t,n,i)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new O_("\\newcommand's first argument must be a macro name");var o=r[0].text,s=e.isDefined(o);if(s&&!t)throw new O_("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!s&&!n)throw new O_("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new O_("Invalid number of arguments: "+l);a=parseInt(l),r=e.consumeArg().tokens}return s&&i||e.macros.set(o,{tokens:r,numArgs:a}),""};_v("\\newcommand",e=>pw(e,!1,!0,!1)),_v("\\renewcommand",e=>pw(e,!0,!1,!1)),_v("\\providecommand",e=>pw(e,!0,!0,!0)),_v("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),_v("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),_v("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),iw[n],Og.math[n],Og.text[n]),""}),_v("\\bgroup","{"),_v("\\egroup","}"),_v("~","\\nobreakspace"),_v("\\lq","`"),_v("\\rq","'"),_v("\\aa","\\r a"),_v("\\AA","\\r A"),_v("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),_v("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),_v("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),_v("ℬ","\\mathscr{B}"),_v("ℰ","\\mathscr{E}"),_v("ℱ","\\mathscr{F}"),_v("ℋ","\\mathscr{H}"),_v("ℐ","\\mathscr{I}"),_v("ℒ","\\mathscr{L}"),_v("ℳ","\\mathscr{M}"),_v("ℛ","\\mathscr{R}"),_v("ℭ","\\mathfrak{C}"),_v("ℌ","\\mathfrak{H}"),_v("ℨ","\\mathfrak{Z}"),_v("\\Bbbk","\\Bbb{k}"),_v("·","\\cdotp"),_v("\\llap","\\mathllap{\\textrm{#1}}"),_v("\\rlap","\\mathrlap{\\textrm{#1}}"),_v("\\clap","\\mathclap{\\textrm{#1}}"),_v("\\mathstrut","\\vphantom{(}"),_v("\\underbar","\\underline{\\text{#1}}"),_v("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),_v("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),_v("\\ne","\\neq"),_v("≠","\\neq"),_v("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),_v("∉","\\notin"),_v("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),_v("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),_v("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),_v("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),_v("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),_v("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),_v("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),_v("⟂","\\perp"),_v("‼","\\mathclose{!\\mkern-0.8mu!}"),_v("∌","\\notni"),_v("⌜","\\ulcorner"),_v("⌝","\\urcorner"),_v("⌞","\\llcorner"),_v("⌟","\\lrcorner"),_v("©","\\copyright"),_v("®","\\textregistered"),_v("️","\\textregistered"),_v("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),_v("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),_v("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),_v("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),_v("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),_v("⋮","\\vdots"),_v("\\varGamma","\\mathit{\\Gamma}"),_v("\\varDelta","\\mathit{\\Delta}"),_v("\\varTheta","\\mathit{\\Theta}"),_v("\\varLambda","\\mathit{\\Lambda}"),_v("\\varXi","\\mathit{\\Xi}"),_v("\\varPi","\\mathit{\\Pi}"),_v("\\varSigma","\\mathit{\\Sigma}"),_v("\\varUpsilon","\\mathit{\\Upsilon}"),_v("\\varPhi","\\mathit{\\Phi}"),_v("\\varPsi","\\mathit{\\Psi}"),_v("\\varOmega","\\mathit{\\Omega}"),_v("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),_v("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),_v("\\boxed","\\fbox{$\\displaystyle{#1}$}"),_v("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),_v("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),_v("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),_v("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),_v("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var fw={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};_v("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in fw?t=fw[n]:("\\not"===n.slice(0,4)||n in Og.math&&D_.contains(["bin","rel"],Og.math[n].group))&&(t="\\dotsb"),t});var mw={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};_v("\\dotso",function(e){return e.future().text in mw?"\\ldots\\,":"\\ldots"}),_v("\\dotsc",function(e){var t=e.future().text;return t in mw&&","!==t?"\\ldots\\,":"\\ldots"}),_v("\\cdots",function(e){return e.future().text in mw?"\\@cdots\\,":"\\@cdots"}),_v("\\dotsb","\\cdots"),_v("\\dotsm","\\cdots"),_v("\\dotsi","\\!\\cdots"),_v("\\dotsx","\\ldots\\,"),_v("\\DOTSI","\\relax"),_v("\\DOTSB","\\relax"),_v("\\DOTSX","\\relax"),_v("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),_v("\\,","\\tmspace+{3mu}{.1667em}"),_v("\\thinspace","\\,"),_v("\\>","\\mskip{4mu}"),_v("\\:","\\tmspace+{4mu}{.2222em}"),_v("\\medspace","\\:"),_v("\\;","\\tmspace+{5mu}{.2777em}"),_v("\\thickspace","\\;"),_v("\\!","\\tmspace-{3mu}{.1667em}"),_v("\\negthinspace","\\!"),_v("\\negmedspace","\\tmspace-{4mu}{.2222em}"),_v("\\negthickspace","\\tmspace-{5mu}{.277em}"),_v("\\enspace","\\kern.5em "),_v("\\enskip","\\hskip.5em\\relax"),_v("\\quad","\\hskip1em\\relax"),_v("\\qquad","\\hskip2em\\relax"),_v("\\tag","\\@ifstar\\tag@literal\\tag@paren"),_v("\\tag@paren","\\tag@literal{({#1})}"),_v("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new O_("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),_v("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),_v("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),_v("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),_v("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),_v("\\newline","\\\\\\relax"),_v("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var _w=mg(ng["Main-Regular"]["T".charCodeAt(0)][1]-.7*ng["Main-Regular"]["A".charCodeAt(0)][1]);_v("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+_w+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),_v("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+_w+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),_v("\\hspace","\\@ifstar\\@hspacer\\@hspace"),_v("\\@hspace","\\hskip #1\\relax"),_v("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),_v("\\ordinarycolon",":"),_v("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),_v("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),_v("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),_v("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),_v("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),_v("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),_v("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),_v("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),_v("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),_v("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),_v("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),_v("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),_v("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),_v("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),_v("∷","\\dblcolon"),_v("∹","\\eqcolon"),_v("≔","\\coloneqq"),_v("≕","\\eqqcolon"),_v("⩴","\\Coloneqq"),_v("\\ratio","\\vcentcolon"),_v("\\coloncolon","\\dblcolon"),_v("\\colonequals","\\coloneqq"),_v("\\coloncolonequals","\\Coloneqq"),_v("\\equalscolon","\\eqqcolon"),_v("\\equalscoloncolon","\\Eqqcolon"),_v("\\colonminus","\\coloneq"),_v("\\coloncolonminus","\\Coloneq"),_v("\\minuscolon","\\eqcolon"),_v("\\minuscoloncolon","\\Eqcolon"),_v("\\coloncolonapprox","\\Colonapprox"),_v("\\coloncolonsim","\\Colonsim"),_v("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),_v("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),_v("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),_v("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),_v("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),_v("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),_v("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),_v("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),_v("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),_v("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),_v("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),_v("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),_v("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),_v("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),_v("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),_v("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),_v("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),_v("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),_v("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),_v("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),_v("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),_v("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),_v("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),_v("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),_v("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),_v("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),_v("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),_v("\\imath","\\html@mathml{\\@imath}{ı}"),_v("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),_v("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),_v("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),_v("⟦","\\llbracket"),_v("⟧","\\rrbracket"),_v("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),_v("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),_v("⦃","\\lBrace"),_v("⦄","\\rBrace"),_v("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),_v("⦵","\\minuso"),_v("\\darr","\\downarrow"),_v("\\dArr","\\Downarrow"),_v("\\Darr","\\Downarrow"),_v("\\lang","\\langle"),_v("\\rang","\\rangle"),_v("\\uarr","\\uparrow"),_v("\\uArr","\\Uparrow"),_v("\\Uarr","\\Uparrow"),_v("\\N","\\mathbb{N}"),_v("\\R","\\mathbb{R}"),_v("\\Z","\\mathbb{Z}"),_v("\\alef","\\aleph"),_v("\\alefsym","\\aleph"),_v("\\Alpha","\\mathrm{A}"),_v("\\Beta","\\mathrm{B}"),_v("\\bull","\\bullet"),_v("\\Chi","\\mathrm{X}"),_v("\\clubs","\\clubsuit"),_v("\\cnums","\\mathbb{C}"),_v("\\Complex","\\mathbb{C}"),_v("\\Dagger","\\ddagger"),_v("\\diamonds","\\diamondsuit"),_v("\\empty","\\emptyset"),_v("\\Epsilon","\\mathrm{E}"),_v("\\Eta","\\mathrm{H}"),_v("\\exist","\\exists"),_v("\\harr","\\leftrightarrow"),_v("\\hArr","\\Leftrightarrow"),_v("\\Harr","\\Leftrightarrow"),_v("\\hearts","\\heartsuit"),_v("\\image","\\Im"),_v("\\infin","\\infty"),_v("\\Iota","\\mathrm{I}"),_v("\\isin","\\in"),_v("\\Kappa","\\mathrm{K}"),_v("\\larr","\\leftarrow"),_v("\\lArr","\\Leftarrow"),_v("\\Larr","\\Leftarrow"),_v("\\lrarr","\\leftrightarrow"),_v("\\lrArr","\\Leftrightarrow"),_v("\\Lrarr","\\Leftrightarrow"),_v("\\Mu","\\mathrm{M}"),_v("\\natnums","\\mathbb{N}"),_v("\\Nu","\\mathrm{N}"),_v("\\Omicron","\\mathrm{O}"),_v("\\plusmn","\\pm"),_v("\\rarr","\\rightarrow"),_v("\\rArr","\\Rightarrow"),_v("\\Rarr","\\Rightarrow"),_v("\\real","\\Re"),_v("\\reals","\\mathbb{R}"),_v("\\Reals","\\mathbb{R}"),_v("\\Rho","\\mathrm{P}"),_v("\\sdot","\\cdot"),_v("\\sect","\\S"),_v("\\spades","\\spadesuit"),_v("\\sub","\\subset"),_v("\\sube","\\subseteq"),_v("\\supe","\\supseteq"),_v("\\Tau","\\mathrm{T}"),_v("\\thetasym","\\vartheta"),_v("\\weierp","\\wp"),_v("\\Zeta","\\mathrm{Z}"),_v("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),_v("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),_v("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),_v("\\bra","\\mathinner{\\langle{#1}|}"),_v("\\ket","\\mathinner{|{#1}\\rangle}"),_v("\\braket","\\mathinner{\\langle{#1}\\rangle}"),_v("\\Bra","\\left\\langle#1\\right|"),_v("\\Ket","\\left|#1\\right\\rangle");var gw=e=>t=>{var n=t.consumeArg().tokens,i=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,s=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",s),r.length&&n.macros.set("\\|",a));var o=t;!t&&r.length&&("|"===n.future().text&&(n.popToken(),o=!0));return{tokens:o?r:i,numArgs:0}};t.macros.set("|",l(!1)),r.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...o,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};_v("\\bra@ket",gw(!1)),_v("\\bra@set",gw(!0)),_v("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),_v("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),_v("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),_v("\\angln","{\\angl n}"),_v("\\blue","\\textcolor{##6495ed}{#1}"),_v("\\orange","\\textcolor{##ffa500}{#1}"),_v("\\pink","\\textcolor{##ff00af}{#1}"),_v("\\red","\\textcolor{##df0030}{#1}"),_v("\\green","\\textcolor{##28ae7b}{#1}"),_v("\\gray","\\textcolor{gray}{#1}"),_v("\\purple","\\textcolor{##9d38bd}{#1}"),_v("\\blueA","\\textcolor{##ccfaff}{#1}"),_v("\\blueB","\\textcolor{##80f6ff}{#1}"),_v("\\blueC","\\textcolor{##63d9ea}{#1}"),_v("\\blueD","\\textcolor{##11accd}{#1}"),_v("\\blueE","\\textcolor{##0c7f99}{#1}"),_v("\\tealA","\\textcolor{##94fff5}{#1}"),_v("\\tealB","\\textcolor{##26edd5}{#1}"),_v("\\tealC","\\textcolor{##01d1c1}{#1}"),_v("\\tealD","\\textcolor{##01a995}{#1}"),_v("\\tealE","\\textcolor{##208170}{#1}"),_v("\\greenA","\\textcolor{##b6ffb0}{#1}"),_v("\\greenB","\\textcolor{##8af281}{#1}"),_v("\\greenC","\\textcolor{##74cf70}{#1}"),_v("\\greenD","\\textcolor{##1fab54}{#1}"),_v("\\greenE","\\textcolor{##0d923f}{#1}"),_v("\\goldA","\\textcolor{##ffd0a9}{#1}"),_v("\\goldB","\\textcolor{##ffbb71}{#1}"),_v("\\goldC","\\textcolor{##ff9c39}{#1}"),_v("\\goldD","\\textcolor{##e07d10}{#1}"),_v("\\goldE","\\textcolor{##a75a05}{#1}"),_v("\\redA","\\textcolor{##fca9a9}{#1}"),_v("\\redB","\\textcolor{##ff8482}{#1}"),_v("\\redC","\\textcolor{##f9685d}{#1}"),_v("\\redD","\\textcolor{##e84d39}{#1}"),_v("\\redE","\\textcolor{##bc2612}{#1}"),_v("\\maroonA","\\textcolor{##ffbde0}{#1}"),_v("\\maroonB","\\textcolor{##ff92c6}{#1}"),_v("\\maroonC","\\textcolor{##ed5fa6}{#1}"),_v("\\maroonD","\\textcolor{##ca337c}{#1}"),_v("\\maroonE","\\textcolor{##9e034e}{#1}"),_v("\\purpleA","\\textcolor{##ddd7ff}{#1}"),_v("\\purpleB","\\textcolor{##c6b9fc}{#1}"),_v("\\purpleC","\\textcolor{##aa87ff}{#1}"),_v("\\purpleD","\\textcolor{##7854ab}{#1}"),_v("\\purpleE","\\textcolor{##543b78}{#1}"),_v("\\mintA","\\textcolor{##f5f9e8}{#1}"),_v("\\mintB","\\textcolor{##edf2df}{#1}"),_v("\\mintC","\\textcolor{##e0e5cc}{#1}"),_v("\\grayA","\\textcolor{##f6f7f7}{#1}"),_v("\\grayB","\\textcolor{##f0f1f2}{#1}"),_v("\\grayC","\\textcolor{##e3e5e6}{#1}"),_v("\\grayD","\\textcolor{##d6d8da}{#1}"),_v("\\grayE","\\textcolor{##babec2}{#1}"),_v("\\grayF","\\textcolor{##888d93}{#1}"),_v("\\grayG","\\textcolor{##626569}{#1}"),_v("\\grayH","\\textcolor{##3b3e40}{#1}"),_v("\\grayI","\\textcolor{##21242c}{#1}"),_v("\\kaBlue","\\textcolor{##314453}{#1}"),_v("\\kaGreen","\\textcolor{##71B307}{#1}");var bw={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class yw{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new dw(uw,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new cw(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:i,end:n}=this.consumeArg(["]"]))}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new N_("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i,r=this.future(),o=0,s=0;do{if(i=this.popToken(),t.push(i),"{"===i.text)++o;else if("}"===i.text){if(-1===--o)throw new O_("Extra }",i)}else if("EOF"===i.text)throw new O_("Unexpected end of input in a macro argument, expected '"+(e&&n?e[s]:"}")+"'",i);if(e&&n)if((0===o||1===o&&"{"===e[s])&&i.text===e[s]){if(++s===e.length){t.splice(-s,s);break}}else s=0}while(0!==o||n);return"{"===r.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new O_("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var r=this.popToken();if(n[i]!==r.text)throw new O_("Use of the macro doesn't match its definition",r)}}for(var o=[],s=0;s<e;s++)o.push(this.consumeArg(t&&t[s+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new O_("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(null==i||e&&i.unexpandable){if(e&&null==i&&"\\"===n[0]&&!this.isDefined(n))throw new O_("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var r=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs)for(var s=(r=r.slice()).length-1;s>=0;--s){var a=r[s];if("#"===a.text){if(0===s)throw new O_("Incomplete placeholder at end of macro body",a);if("#"===(a=r[--s]).text)r.splice(s+1,1);else{if(!/^[1-9]$/.test(a.text))throw new O_("Not a valid argument number",a);r.splice(s,2,...o[+a.text-1])}}}return this.pushTokens(r),r.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new N_(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var i="function"==typeof t?t(this):t;if("string"==typeof i){var r=0;if(-1!==i.indexOf("#"))for(var o=i.replace(/##/g,"");-1!==o.indexOf("#"+(r+1));)++r;for(var s=new cw(i,this.settings),a=[],l=s.lex();"EOF"!==l.text;)a.push(l),l=s.lex();return a.reverse(),{tokens:a,numArgs:r}}return i}isDefined(e){return this.macros.has(e)||iw.hasOwnProperty(e)||Og.math.hasOwnProperty(e)||Og.text.hasOwnProperty(e)||bw.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:iw.hasOwnProperty(e)&&!iw[e].primitive}}var vw=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ww=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),xw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},kw={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Sw{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new yw(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new O_("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new N_("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==Sw.endOfExpression.indexOf(i.text))break;if(t&&i.text===t)break;if(e&&iw[i.text]&&iw[i.text].infix)break;var r=this.parseAtom(t);if(!r)break;"internal"!==r.type&&n.push(r)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,i=0;i<e.length;i++)if("infix"===e[i].type){if(-1!==n)throw new O_("only one infix operator per group",e[i].token);n=i,t=e[i].replaceWith}if(-1!==n&&t){var r,o,s=e.slice(0,n),a=e.slice(n+1);return r=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},o=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[r,e[n],o],[]):this.callFunction(t,[r,o],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),i=n.text;this.consume(),this.consumeSpaces();do{var r;t=this.parseGroup(e)}while("internal"===(null==(r=t)?void 0:r.type));if(!t)throw new O_("Expected group after '"+i+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]}}parseAtom(e){var t,n,i=this.parseGroup("atom",e);if("internal"===(null==i?void 0:i.type))return i;if("text"===this.mode)return i;for(;;){this.consumeSpaces();var r=this.fetch();if("\\limits"===r.text||"\\nolimits"===r.text){if(i&&"op"===i.type){var o="\\limits"===r.text;i.limits=o,i.alwaysHandleSupSub=!0}else{if(!i||"operatorname"!==i.type)throw new O_("Limit controls must follow a math operator",r);i.alwaysHandleSupSub&&(i.limits="\\limits"===r.text)}this.consume()}else if("^"===r.text){if(t)throw new O_("Double superscript",r);t=this.handleSupSubscript("superscript")}else if("_"===r.text){if(n)throw new O_("Double subscript",r);n=this.handleSupSubscript("subscript")}else if("'"===r.text){if(t)throw new O_("Double superscript",r);var s={type:"textord",mode:this.mode,text:"\\prime"},a=[s];for(this.consume();"'"===this.fetch().text;)a.push(s),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!ww[r.text])break;var l=vw.test(r.text),c=[];for(c.push(new N_(ww[r.text])),this.consume();;){var d=this.fetch().text;if(!ww[d])break;if(vw.test(d)!==l)break;c.unshift(new N_(ww[d])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||n?{type:"supsub",mode:this.mode,base:i,sup:t,sub:n}:i}parseFunction(e,t){var n=this.fetch(),i=n.text,r=iw[i];if(!r)return null;if(this.consume(),t&&"atom"!==t&&!r.allowedInArgument)throw new O_("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!r.allowedInText)throw new O_("Can't use function '"+i+"' in text mode",n);if("math"===this.mode&&!1===r.allowedInMath)throw new O_("Can't use function '"+i+"' in math mode",n);var{args:o,optArgs:s}=this.parseArguments(i,r);return this.callFunction(i,o,s,n,e)}callFunction(e,t,n,i,r){var o={funcName:e,parser:this,token:i,breakOnTokenText:r},s=iw[e];if(s&&s.handler)return s.handler(o,t,n);throw new O_("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var i=[],r=[],o=0;o<n;o++){var s=t.argTypes&&t.argTypes[o],a=o<t.numOptionalArgs;(t.primitive&&null==s||"sqrt"===t.type&&1===o&&null==r[0])&&(s="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",s,a);if(a)r.push(l);else{if(null==l)throw new O_("Null argument, please report this as a bug");i.push(l)}}return{args:i,optArgs:r}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var i=this.parseArgumentGroup(n,"text");return null!=i?{type:"styling",mode:i.mode,body:[i],style:"text"}:null;case"raw":var r=this.parseStringGroup("raw",n);return null!=r?{type:"raw",mode:"text",string:r.text}:null;case"primitive":if(n)throw new O_("A primitive argument cannot be optional");var o=this.parseGroup(e);if(null==o)throw new O_("Expected group as "+e,this.fetch());return o;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new O_("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var i,r="";"EOF"!==(i=this.fetch()).text;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n,i=this.fetch(),r=i,o="";"EOF"!==(n=this.fetch()).text&&e.test(o+n.text);)o+=(r=n).text,this.consume();if(""===o)throw new O_("Invalid "+t+": '"+i.text+"'",i);return i.range(r,o)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new O_("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new O_("Invalid size: '"+t.text+"'",t);var r={number:+(i[1]+i[2]),unit:i[3]};if(!pg(r))throw new O_("Invalid unit: '"+r.unit+"'",t);return{type:"size",mode:this.mode,value:r,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var r=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:r};return t&&this.switchMode(i),o}parseGroup(e,t){var n,i=this.fetch(),r=i.text;if("{"===r||"\\begingroup"===r){this.consume();var o="{"===r?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,o),a=this.fetch();this.expect(o),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:P_.range(i,a),body:s,semisimple:"\\begingroup"===r||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===r[0]&&!bw.hasOwnProperty(r)){if(this.settings.throwOnError)throw new O_("Undefined control sequence: "+r,i);n=this.formatUnsupportedCmd(r),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],r=i.text;"-"===r&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:P_.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:P_.range(i,e[n+1]),text:"--"}),t-=1)),"'"!==r&&"`"!==r||e[n+1].text!==r||(e.splice(n,2,{type:"textord",mode:"text",loc:P_.range(i,e[n+1]),text:r+r}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i="*"===n.charAt(0);if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new O_("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:i}}kw.hasOwnProperty(t[0])&&!Og[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=kw[t[0]]+t.slice(1));var r,o=aw.exec(t);if(o&&("i"===(t=t.substring(0,o.index))?t="ı":"j"===t&&(t="ȷ")),Og[this.mode][t]){this.settings.strict&&"math"===this.mode&&db.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var s,a=Og[this.mode][t].group,l=P_.range(e);if(Pg.hasOwnProperty(a)){var c=a;s={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else s={type:a,mode:this.mode,loc:l,text:t};r=s}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Q_(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),r={type:"textord",mode:"text",loc:P_.range(e),text:t}}if(this.consume(),o)for(var d=0;d<o[0].length;d++){var u=o[0][d];if(!xw[u])throw new O_("Unknown accent ' "+u+"'",e);var h=xw[u][this.mode]||xw[u].text;if(!h)throw new O_("Accent "+u+" unsupported in "+this.mode+" mode",e);r={type:"accent",mode:this.mode,loc:P_.range(e),label:h,isStretchy:!1,isShifty:!0,base:r}}return r}}Sw.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var Cw=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Sw(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new O_("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new N_("\\df@tag")])}]}return i};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."));var Mw=function(e,t,n){if(n.throwOnError||!(e instanceof O_))throw e;var i=Cb.makeSpan(["katex-error"],[new Cg(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},zw=function(e,t){var n=new q_(t);try{return function(e,t,n){var i,r=dy(n);if("mathml"===n.output)return cy(e,t,r,n.displayMode,!0);if("html"===n.output){var o=Jb(e,r);i=Cb.makeSpan(["katex"],[o])}else{var s=cy(e,t,r,n.displayMode,!1),a=Jb(e,r);i=Cb.makeSpan(["katex"],[s,a])}return uy(i,n)}(Cw(e,n),e,n)}catch(t){return Mw(t,e,n)}},Aw=function(e,t){return zw(e,t).toMarkup()};class Tw{static update(e,t,n,i=!1){return{id:e,name:v.update,size:n,latex:t,block:i}}}class Pw extends cs{_mathml=Kt("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return T_}get mathml(){const e=this.attrs.size+this.info;return Pw.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return Pw.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e,t){return Pw.update_data(e,t)}replace_id(e,t={}){return Pw.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:i}=e,{courier:r,id:o}=this,s=r.get_recorder();s.add_cmd(e);const a=this.info,l=this.attrs.block,c=this.attrs.size;return this.data.info=t,this.data.attrs.block=n,this.data.attrs.size=i,s.add_recover(Tw.update(o,a,c,l)),s}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return Aw(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:n.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},i={}){return{id:To.get_id(),type:n.fomula,info:e,attrs:{block:!1,size:y.h4,...i},css:t}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([Go(v.update)],Pw.prototype,"update",null);class Nw{static add_title(e,t){return{id:e,name:w.add_title,data:t}}static remove_title(e){return{id:e,name:w.remove_title}}static add_cell(e,t){return{id:e,name:w.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:w.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:w.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:w.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:w.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:w.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:w.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:w.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:w.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:w.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:w.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:w.col_resize,cols:t,step:n}}}function Ow(e,t){const{hotkeys:n,courier:i,id:r,history:o}=t,s=Mo.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const a=e.key.toLowerCase(),l=e.shiftKey,c=t.get_active_cell();if(!c)return s?.tip_info("未发现激活单元格");if(a===P.up)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_top(e.top))return s?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(Ec.get_default());n.tell(t,Nw.add_row(t.id,c.row,r)),o.record(n)}else{if(t.get_cell(c.row-1,c.col))return s?.tip_info("上方已存在单元格");if(c.row-1<0)return s?.tip_info("上方已达边界");{const e=i.get_recorder(),n={row:c.row-1,col:c.col,rowspan:1,colspan:1,data:Ec.get_default()};e.tell(t,Nw.add_cell(t.id,n)),o.record(e)}}else if(a===P.down)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_bottom(e.bottom))return s?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(Ec.get_default());n.tell(t,Nw.add_row(t.id,c.row+c.rowspan,r)),o.record(n)}else{if(t.get_cell(c.row+1,c.col))return s?.tip_info("下方已存在单元格");if(c.row+1>=t.size[0])return s?.tip_info("下方已达边界");{const e=i.get_recorder(),n={row:c.row+1,col:c.col,rowspan:1,colspan:1,data:Ec.get_default()};e.tell(t,Nw.add_cell(t.id,n)),o.record(e)}}else if(a===P.left)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_left(e.left))return s?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(Ec.get_default());n.tell(t,Nw.add_col(t.id,c.col,r)),o.record(n)}else{if(t.get_cell(c.row,c.col-1))return s?.tip_info("左侧已存在单元格");if(c.col-1<0)return s?.tip_info("左侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col-1,rowspan:1,colspan:1,data:Ec.get_default()};e.tell(t,Nw.add_cell(t.id,n)),o.record(e)}}else if(a===P.right)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_right(e.right))return s?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(Ec.get_default());n.tell(t,Nw.add_col(t.id,c.col+c.colspan,r)),o.record(n)}else{if(t.get_cell(c.row,c.col+1))return s?.tip_info("右侧已存在单元格");if(c.col+1>=t.size[1])return s?.tip_info("右侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col+1,rowspan:1,colspan:1,data:Ec.get_default()};e.tell(t,Nw.add_cell(t.id,n)),o.record(e)}}}const Rw={drag_cell:void 0,hover:void 0};function Lw(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),Rw.drag_cell=t}function Ew(e,t){if(Rw.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),Rw.hover=n}function Iw(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function Dw(e,t){const{drag_cell:n,hover:i}=Rw,{pcube:r,courier:o,history:s}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),i&&i.classList.remove("cube-cell-selection");const l=o.get_recorder();l.tell(r,Nw.moveto(r.id,t.box.id,[n.box.id])),s.record(l)}const Bw={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function jw(e,t){const{root:n,cursor:i}=t;if(e.ctrlKey)e.stopPropagation();else{To.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const i=t.find_dom_cube(n),r=i?.find_upstream_untill(t);if(!r)return;const o=t.cells.find(e=>e.box===r);if(!o)return;Bw.down_point={x:e.clientX,y:e.clientY},Bw.has_down=!0,Bw.anchor=o}}function qw(e,t){const{cursor:n}=t,{down_point:i,has_down:r,anchor:o,has_move:s}=Bw;if(!i)return;if(Bw.has_move=Math.sqrt((e.clientX-i.x)**2+(e.clientY-i.y)**2)>5,!r||!o||!s||e.buttons<=0)return;const a=e.target;if(!(a instanceof Node))return;const l=t.find_dom_cube(a),c=l?.find_upstream_untill(t),d=t.cells.find(e=>e.box===c);if(!d||d===o)return void t.clear_selection();const u={left:Math.min(o.col,d.col),right:Math.max(o.col+o.colspan-1,d.col+d.colspan-1),top:Math.min(o.row,d.row),bottom:Math.max(o.row+o.rowspan-1,d.row+d.rowspan-1)},h=t.get_rectarea_cell(u);t.clear_selection();for(let e of h.cells)e.selection=!0;h.cells.length>1&&e.stopPropagation()}function Fw(e,t){const{cursor:n}=t;Bw.has_down=!1,Bw.anchor=void 0}const Hw=["id","data-type"],$w=Bn({__name:"cube-table",props:{cube:{}},setup(e){const t=qn("dragger"),i=qn("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function o(e){return{"cube-cell-selection":e.selection}}const s=wo(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return ni(()=>{const n=t.value,r=i.value;if(!n||!r)return;let o=e.cube.data.attrs.width,s=o;const a=new Io.DragDiff(n);a.register_down(()=>{o=e.cube.data.attrs.width}),a.register_move((t,n)=>{o+t<e.cube.min_width||(s=o+t,r.style.width=s+"px")}),a.register_up((t,n)=>{if(s===o)return;const{courier:i,history:r}=e.cube,a=i.get_recorder();a.tell(e.cube,Lo.resize(e.cube.id,s)),r.record(a)}),a.register_cancel(()=>{r.style.width=o+"px"})}),(e,a)=>(Nr(),Ir("div",{ref_key:"box",ref:i,class:"cube-table",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).table,onPointerdown:a[0]||(a[0]=t=>Zt(jw)(t,e.cube)),onPointermove:a[1]||(a[1]=t=>Zt(qw)(t,e.cube)),onPointerup:a[2]||(a[2]=t=>Zt(Fw)(t,e.cube)),onPointercancel:a[3]||(a[3]=t=>Zt(Fw)(t,e.cube)),onKeyup:a[4]||(a[4]=t=>Zt(Ow)(t,e.cube)),onContextmenu:a[5]||(a[5]=t=>Zt(ha)(t,e.cube))},[e.cube.title?(Nr(),Dr(Oa,{key:0,class:"cube-table-title",cube:Ut(e.cube.title)},null,8,["cube"])):Yr("v-if",!0),Hr("div",{class:"cube-table-container",style:me(s.value)},[(Nr(!0),Ir(Cr,null,_i(e.cube.cells,(e,t)=>(Nr(),Dr(Oa,{key:e.box.id,cube:Ut(e.box),style:me(r(e)),class:ve(o(e)),draggable:"true",onDragstart:t=>Zt(Lw)(t,e),onDragenter:t=>Zt(Ew)(t,e),onDragleave:t=>Zt(Iw)(t,e),onDrop:t=>Zt(Dw)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),Hr("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,Hw))}}),Gw=(0,Js.A)($w,[["__scopeId","data-v-47068d72"]]);function Vw(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Uw extends cs{cells=Dt([]);_title=Kt(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return Gw}get meta(){return Uw.meta}get children(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),this.title&&e.unshift(this.title),e.push(...t.map(e=>e.box)),e}get cells_sorted(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),e.push(...t),e}get css(){const e=this.attrs;return{...super.css,width:e.width+"px"}}get attrs(){return this.data.attrs}get cols(){return this.data.info.cols}get size(){return this.data.info.size}get selection_cells(){const e=[];for(let t of this.cells_sorted)t.selection&&e.push(t);return e}get min_width(){return 500}constructor(e,t){super(e,t);return this.setup(e,t)}build_child(e){e.info.title&&(this.title=Ut(new Ec(e.info.title,this)));for(let t of e.info.cells){const e=new Ec(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:Ut(e),selection:!1};this.cells.push(n)}}export(){const e=this.base_export();this.title&&(e.info.title=this.title.export()),e.info.cells=[];for(let t of this.cells)e.info.cells.push(this.get_cell_data(t));return e}update_data(e,t){return Uw.update_data(e,t)}gc(){this.base_gc()}get_cell_data(e){return{row:e.row,col:e.col,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()}}replace_id(e,t={}){return Uw.replace_id(this.root,e,t)}get_rows(e){const t=[];for(let n of this.cells_sorted)e>=n.row&&e<n.row+n.rowspan&&t.push(n);return t}get_cols(e){const t=[];for(let n of this.cells_sorted)e>=n.col&&e<n.col+n.colspan&&t.push(n);return t}check_orderly_col(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.right)).size,r=1===new Set(n.map(e=>e.left)).size;return i&&r}check_orderly_col_left(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.left)).size}check_orderly_col_right(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.right)).size}check_orderly_row(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.bottom)).size,r=1===new Set(n.map(e=>e.top)).size;return i&&r}check_orderly_row_top(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));new Set(n.map(e=>e.bottom)).size;return 1===new Set(n.map(e=>e.top)).size}check_orderly_row_bottom(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.bottom)).size}get_cell_area(e){return{left:e.col,right:e.col+e.colspan-1,top:e.row,bottom:e.row+e.rowspan-1}}get_cell(e,t){for(let n of this.cells){const i=e>=n.row&&e<n.row+n.rowspan,r=t>=n.col&&t<n.col+n.colspan;if(i&&r)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:i,top:r,bottom:o}=e;for(let s of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=s,u=a,h=a+l-1,p=c,f=c+d-1;if(n>=p&&n<=f||n<=p&&f<=i||i>=p&&i<=f){if(u<r&&h>=r){e.top=a;break}if(u<=o&&h>o){e.bottom=a+l-1;break}}if(r>=u&&r<=h||r<u&&o>=h||o>=u&&o<=h){if(p<n&&f>=n){e.left=c;break}if(p<=i&&f>i){e.right=c+d-1;break}}s===this.cells[this.cells.length-1]&&(t=!0)}}const n=[];for(let t of this.cells_sorted){let{row:i,col:r,rowspan:o,colspan:s}=t;r>=e.left&&r+s-1<=e.right&&i>=e.top&&i+o-1<=e.bottom&&n.push(t)}return{...e,cells:n}}clear_selection(){for(let e of this.cells)e.selection=!1}get_active_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t?.find_upstream_untill(this);return this.cells.find(e=>e.box===n)}set_selection_area(e){this.get_rectarea_cell(e);for(let e of this.cells)e.selection=!1;for(let e of this.cells)e.selection=!0}get_focus_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t.find_upstream_untill(this);return n?this.cells.find(e=>e.box.id===n.id):void 0}get_selection_area(){let e,t;const n=this.selection_cells;if(0===n.length)return;for(let i of n){const n=this.get_cell_area(i);e||(e=[n.top,n.bottom]),t||(t=[n.left,n.right]),n.top<e[0]&&(e[0]=n.top),n.left<t[0]&&(t[0]=n.left),n.bottom>e[1]&&(e[1]=n.bottom),n.right>t[1]&&(t[1]=n.right)}if(!e||!t)return;return{left:t[0],right:t[1],top:e[0],bottom:e[1]}}get_selection_size(){const e=this.get_selection_area();if(e)return[e.bottom-e.top+1,e.right-e.left+1]}get_selection_text(){const e=this.selection_cells;let t="";if(0===e.length)return t;for(let n of e)t+=n.box.text;return t}copy_selection_table(){const e=this.get_selection_size(),t=this.selection_cells,n=this.get_selection_area();if(!e||!t||!n)return;const i=[];for(let e of t)i.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const r=Uw.get_default_by_data(e,i);return r.attrs=structuredClone(Vt(this.attrs)),r}add_title(e){const{data:t}=e,{courier:n,cursor:i,id:r}=this,o=n.get_recorder();o.add_cmd(e);const s=new Ec(t,this);return this.title=Ut(s),o.add_recover(Nw.remove_title(r)),o}remove_title(e){const{id:t,courier:n,cursor:i}=this;if(!this.title)return;const r=this.title.export(),o=n.get_recorder();return o.add_cmd(e),this.title=void 0,o.add_recover(Nw.add_title(t,r)),o}add_cell(e){const{id:t,courier:n,cursor:i}=this,{data:r}=e;this.clear_selection();const o=n.get_recorder();o.add_cmd(e);const s={row:r.row,col:r.col,rowspan:r.rowspan,colspan:r.colspan,box:Ut(new Ec(r.data,this)),selection:!1};return this.cells.push(s),o.add_recover(Nw.remove_cell(t,s.box.id)),o}remove_cell(e){const{id:t,courier:n,cursor:i}=this,{cid:r}=e,o=n.get_recorder();o.add_cmd(e);const s=this.cells.findIndex(e=>e.box.id===r),a=this.cells[s];if(!a)return;const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan,data:a.box.export()};return s>=0&&this.cells.splice(s,1),o.add_recover(Nw.add_cell(t,l)),o}add_row(e){const{courier:t,cursor:n,id:i}=this,{index:r,rows:o}=e,s=t.get_recorder(),a=[];for(let e=0;e<o.length;e++){const t=o[e];a.push({row:r,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<r||s.tell(this,Nw.update_cell_area(i,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)s.tell(this,Nw.add_cell(i,e));return s}remove_row(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,o=this.get_rows(r),s=n.get_recorder();for(let e of o)s.tell(this,Nw.remove_cell(t,e.box.id));return this.size[0]--,s}add_col(e){const{id:t,cursor:n,courier:i}=this,{index:r,cols:o}=e,s=i.get_recorder(),a=[];for(let e=0;e<o.length;e++){const t=o[e];a.push({row:e,col:r,rowspan:1,colspan:1,data:t})}s.tell(this,Nw.add_grid_col(t,r,2));for(let e of this.cells)e.col<r||s.tell(this,Nw.update_cell_area(t,e.box.id,{row:e.row,col:e.col+1,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)s.tell(this,Nw.add_cell(t,e));return s}remove_col(e){const{id:t,cursor:n,courier:i}=this,{index:r}=e;if(!this.check_orderly_col(r))return Mo.tips?.tip_info("目标列不整齐");let o;for(let e=0;e<=this.size[0]&&(o||(o=this.get_cell(e,r),!o));e++);if(!o)return;const s=i.get_recorder();for(let e=o.col;e<o.col+o.colspan;e++)s.tell(this,Nw.remove_grid_col(t,e));const a=this.get_cols(r);for(let e of a)s.tell(this,Nw.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<r)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};s.tell(this,Nw.update_cell_area(t,e.box.id,n))}return s}moveto(e){const{id:t,courier:n,cursor:i}=this,{tid:r,cells:o}=e,s=n.get_recorder(),a=this.cells.find(e=>e.box.id===r);if(!a)return;const l=a.box,c=this.cells_sorted.filter(e=>e.box.id!==r&&o.includes(e.box.id));for(let e of c){const n=e.box.export();s.tell(this,Nw.remove_cell(t,e.box.id)),s.tell(l,Lo.insert_child(l.id,n.info,l.child_count))}return s}update_area(e){const{id:t,courier:n,cursor:i}=this,{tid:r,area:o}=e,s=n.get_recorder(),a=this.cells.find(e=>e.box.id===r);if(!a)return;s.add_cmd(e);const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return a.row=o.row,a.col=o.col,a.rowspan=o.rowspan,a.colspan=o.colspan,s.add_recover(Nw.update_cell_area(t,r,l)),s}merge_cell(e){const{id:t,cursor:n,courier:i}=this,{area:r}=e,o=i.get_recorder(),s=this.get_rectarea_cell(r);let a=s.cells[0];if(!a)return;const l={row:r.top,col:r.left,rowspan:r.bottom-r.top+1,colspan:r.right-r.left+1},c=a.box.id;return o.tell(this,Nw.update_cell_area(t,c,l)),o.tell(this,Nw.moveto(t,c,s.cells.map(e=>e.box.id))),o}add_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r,width:o}=e,s=n.get_recorder();return s.add_cmd(e),this.cols.splice(r,0,o),this.size[1]++,s.add_recover(Nw.remove_grid_col(t,r)),s}remove_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,o=n.get_recorder(),s=this.cols.splice(r,1);if(0!==s.length)return this.size[1]--,o.add_recover(Nw.add_grid_col(t,r,s[0])),o}col_resize(e){const{id:t,courier:n,cursor:i}=this,{cols:r,step:o}=e,s=n.get_recorder();s.add_cmd(e);let a=!1;for(let e=r[0];e<=r[1];e++){let t=this.cols[e]+o;t<=0||(a=!0,this.cols[e]=t)}if(a)return s.add_recover(Nw.col_resize(t,r,-o)),s}delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,cursor:o,history:s}=this,a=r.get_recorder();let[l,c]=this.get_valid_range(n);if(0===l&&c>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;a.tell(this,Lo.delete_child(this.id,"backward",[1,this.child_count],i)),a.tell(e,Lo.delete_child(e.id,"backward",[0,e.child_count],i))}else a.merge(this.remove_self());else{let e=[];for(let t=l;t<c;t++){let n=this.children[t];e.push(n.id)}for(let t of e)a.tell(this,Nw.remove_cell(this.id,t))}return a}static get meta(){return{cubename:"表格",type:n.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const i=[],r=[];r.length=t,r.fill(2);for(let n=0;n<e;n++)for(let e=0;e<t;e++){const t={row:n,col:e,rowspan:1,colspan:1,data:Ec.get_default()};i.push(t)}return{id:To.get_id(),type:n.table,info:{size:[e,t],cols:r,cells:i},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[i,r]=e,o=[];return o.length=r,o.fill(2),{id:To.get_id(),type:n.table,info:{size:[i,r],cols:o,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();n[i]=r,t.id=r,t.info.title&&(t.info.title=Ec.replace_id(e,t.info.title,n));for(let i of t.info.cells)i.data=Ec.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}Vw([Go(w.add_title)],Uw.prototype,"add_title",null),Vw([Go(w.remove_title)],Uw.prototype,"remove_title",null),Vw([Go(w.add_cell)],Uw.prototype,"add_cell",null),Vw([Go(w.remove_cell)],Uw.prototype,"remove_cell",null),Vw([Go(w.add_row)],Uw.prototype,"add_row",null),Vw([Go(w.remove_row)],Uw.prototype,"remove_row",null),Vw([Go(w.add_col)],Uw.prototype,"add_col",null),Vw([Go(w.remove_col)],Uw.prototype,"remove_col",null),Vw([Go(w.moveto)],Uw.prototype,"moveto",null),Vw([Go(w.update_area)],Uw.prototype,"update_area",null),Vw([Go(w.merge)],Uw.prototype,"merge_cell",null),Vw([Go(w.add_grid_col)],Uw.prototype,"add_grid_col",null),Vw([Go(w.remove_grid_col)],Uw.prototype,"remove_grid_col",null),Vw([Go(w.col_resize)],Uw.prototype,"col_resize",null),Vw([Go(i.cube_delete_child)],Uw.prototype,"delete_child",null);const Ww=["id","data-type"],Yw=Bn({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>(Nr(),Ir("div",{class:"cube-tip",style:me(e.cube.css),id:e.cube.id,"data-type":Zt(n).tip},[$r(Oa,{cube:e.cube.box},null,8,["cube"])],12,Ww))}),Xw=(0,Js.A)(Yw,[["__scopeId","data-v-433bbb71"]]);function Kw(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class Jw extends cs{get component(){return Xw}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)e instanceof cs&&r.push(e.export());return{children:i,data:r}}replace_id(e,t={}){return Jw.replace_id(this.root,e,t)}build_child(e){this.box=new Ec(e.info,this)}update_data(e,t){return Jw.update_data(e,t)}export(){const e=this.base_export();return e.info=this.box.export(),e}gc(){super.base_gc()}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let o=this.get_valid_index(n);const s=this.create_child_block(i);this.splice(o,0,...s),r.add_recover(Lo.delete_child(this.id,"backward",[o,o+s.length]));const a=this.children[o+1];return a?r.tell(a,Eo.in_head(a.id)):r.tell(this.child_last,Eo.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,o=t.get_recorder();o.add_cmd(e);const{dir:s,range:a}=e,[l,c]=a;let d=l<0?0:l,u=c>this.child_count?this.child_count:c;if(d>=u)return;if(d<=0&&u>=this.child_count)return this.is_empty?o.tell(r,Lo.delete_child(n,s,[i,i+1])):o.tell(this,Lo.reset(this.id,[])),o;const h=this.children[d-1],p=this.children[u],f=u-d;let m=this.splice(l,f);return o.add_recover(Lo.insert_child(this.id,m.data,l)),"backward"===s?h?o.tell(h,Eo.in_tail(h.id)):p&&o.tell(p,Eo.in_head(p.id)):"forward"===s&&(p?o.tell(p,Eo.in_head(p.id)):h&&o.tell(h,Eo.in_tail(h.id))),o}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new Ro(t),o=[];for(let e of this.children)o.push(e.export());const s=To.build_cubes(i,this);this.splice(0,this.child_count,...s);return r.add_recover(Lo.reset(this.id,o)),r}get meta(){return Jw.meta}static get meta(){return{cubename:"提示",type:n.tip,block:!0,version:1,show:!0}}static get_default(e,t={},i={}){return{id:To.get_id(),type:n.tip,info:Ec.get_default(e),attrs:i,css:t}}static get_default_by_string(e,t={},i={}){const r=Pc.get_default_by_string(e),o=Ec.get_default([r]);return{id:To.get_id(),type:n.tip,info:o,attrs:i,css:t}}static replace_id(e,t,n={}){const i=t.id,r=To.get_id();return n[i]=r,t.id=r,t.info=Ec.replace_id(e,t.info,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Kw([Go(i.cube_insert_child)],Jw.prototype,"on_insert_child",null),Kw([Go(i.cube_delete_child)],Jw.prototype,"on_delete_child",null),Kw([Go(i.cube_reset)],Jw.prototype,"on_reset",null);const Qw=["id","data-type"],Zw=Bn({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=Kt(),i=Kt();Dt({open:!1});let r;return ni(()=>{const n=t.value;if(!n)return;const o=i.value;if(!o)return;r=new Io.DragDiff(o);let s=e.cube.attrs.width,a=e.cube.attrs.height,l=s,c=a;r.register_down(()=>{s=e.cube.attrs.width,a=e.cube.attrs.height}),r.register_move((t,i)=>{l=Math.round(t+s),l<e.cube.min_width&&(l=e.cube.min_width),n.style.width=l+"px",n.style.height=c+"px"}),r.register_up((t,n)=>{if(s===l&&a===c)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+s);i.tell(e.cube,Lo.resize(e.cube.id,r)),e.cube.history.record(i)}),r.register_cancel(()=>{e.cube.attrs.width=s,e.cube.attrs.height=a})}),si(()=>{r?.off()}),(r,o)=>(Nr(),Ir("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:me(r.cube.css),id:r.cube.id,"data-type":Zt(n).box_columns,onContextmenu:o[0]||(o[0]=e=>Zt(ha)(e,r.cube))},[Hr("div",{class:"box-columns-content",style:me(e.cube.attrs.column_count?{"column-count":e.cube.attrs.column_count}:e.cube.attrs.column_width?{"column-width":e.cube.attrs.column_width+"px"}:{})},[(Nr(!0),Ir(Cr,null,_i(r.cube.children,e=>(Nr(),Dr(Oa,{key:e.id,cube:e},null,8,["cube"]))),128))],4),Hr("div",{class:"box-columns-dragger",ref_key:"dragger",ref:i},null,512)],44,Qw))}}),ex=(0,Js.A)(Zw,[["__scopeId","data-v-84430922"]]);function tx(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}class nx extends cs{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return ex}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return nx.meta}get min_width(){return 200}build_child(e){const t=To.build_cubes(e.info,this);this._children.push(...t)}update_data(e,t){return nx.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}gc(){this.base_gc()}replace_id(e,t){return nx.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();r.add_cmd(e);const o=To.build_cubes(e.data,this),s=this.child_count;return this._children.push(...o),r.add_recover(Lo.delete_child(this.id,"backward",[s,this.child_count])),r}on_delete_child(e){const{courier:t,history:n}=this,{dir:i,range:r,reserve:o}=e,s=t.get_recorder(),a=this.get_valid_index(r[0]),l=this.get_valid_index(r[1]),c=[],d=this._children.splice(a,l-a);for(let e of d)c.push(e.export());return s.add_recover(Lo.insert_child(this.id,c,a)),s}static replace_id(e,t,n){const i=t.id,r=n[i]||To.get_id();return n[i]=r,t.id=r,To.replace_id(e,e.cube_versions,t.info,n),t}static get_default(){const e=Ec.get_default(),t=Ec.get_default(),i=Ec.get_default();return{id:To.get_id(),type:n.box_columns,info:[e,t,i],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:n.box_columns,block:!0,version:1,show:!0}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}tx([Go(i.cube_insert_child)],nx.prototype,"on_insert_child",null),tx([Go(i.cube_delete_child)],nx.prototype,"on_delete_child",null);class ix{static reset(e,t){return{id:e,name:S.reset_explanation,explanation:t}}}const rx=["id","data-type"],ox=Bn({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function i(){t.emit_show_cube_editor(e.cube)}return(t,r)=>(Nr(),Ir("ruby",{class:"cube-rt",id:t.cube.id,style:me(t.cube.css),"data-type":Zt(n).rt,onClick:i},[Ur(Ce(t.cube.info.text)+" ",1),Hr("rt",{style:me({"font-size":`max(calc(0.6 * ${e.cube.css["font-size"]||"16px"}),${ax.min_size}px)`})},Ce(t.cube.info.explanation),5),r[0]||(r[0]=Ur("​ ",-1))],12,rx))}}),sx=ox;class ax extends cs{data;static get min_size(){return 12}static get scale(){return.6}constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return sx}get meta(){return ax.meta}build_child(e){}update_data(e,t){return ax.update_data(e,t)}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return ax.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=this.info.explanation;this.info.explanation=t;const o=ix.reset(this.id,r);return i.add_recover(o),i}static get meta(){return{cubename:"标注文本",type:n.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",i={}){return{id:To.get_id(),type:n.rt,info:{text:e,explanation:t},attrs:{},css:i}}static replace_id(e,t,n){const i=t.id;return t.id=n[i]||To.get_id(),n[i]=t.id,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);o>3&&s&&Object.defineProperty(t,n,s)}([Go(S.reset_explanation)],ax.prototype,"reset_explanation",null)})(),o})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepsky=t():e.deepsky=t()}(self,()=>(()=>{var e,t,n={3193:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}},7248:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>b,DragList:()=>v,Iteration:()=>a,List:()=>m,MathBase:()=>u,MathLine:()=>f,MathPoint:()=>p,MathPolygon:()=>_,MathRect:()=>h,Notice:()=>o,_RectPosition:()=>s});var n,i,r,s=function(e){return e.left_mid="left-mid",e.left_top="left-top",e.left_bottom="left-bottom",e.top_mid="top-mid",e.bottom_mid="bottom-mid",e.right_top="right-top",e.right_mid="right-mid",e.right_bottom="right_bottom",e.center="center",e}({});class o{static rope(e,t){return(...n)=>{let i=Symbol();return this.scope[e]=i,t(()=>i===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...i){return new Promise(r=>{if(n)return r(!1);n=setTimeout(()=>{e(...i),n=void 0,r(!0)},t)})}}static debounce(e,t=100){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}}r={},(i="scope")in(n=o)?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r;class a{static*zip(...e){const t=Math.min(...e.map(e=>e.length));for(let n=0;n<t;n++)yield e.map(e=>e[n])}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{static get_month_name(e){let t;return t=e||new Date,this.month_names[t.getMonth()]}static get_week_name(e){let t;return t=e||new Date,this.weeks_names[t.getDay()]}static get_date_string(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}static get_week_string(e){let t;t=e||new Date;const n=t.getDate(),i=t.getDay(),r=new Date(t.getFullYear(),t.getMonth(),n-i),s=new Date(t.getFullYear(),t.getMonth(),n+(6-i));return`${this.get_date_string(r)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const i=n.getFullYear(),r=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(i,r,s-o),l=a.getFullYear(),c=a.getMonth(),d=a.getDate();t.push(a);for(let e=1;e<=6;e++)t.push(new Date(l,c,d+e));return t}}l(c,"month_names",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),l(c,"weeks_names",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);class d{static scroll_element(e,t,n="vertical"){let i=t;const r=()=>{if(Math.abs(i)>2){let t=i/10;i-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(r)}"vertical"===n?e.scrollTop+=i:e.scrollLeft+=i};r()}}class u{static sum(e){let t=0;for(let n of e)t+=n;return t}}class h{static get_rect_point(e,t){const{x:n,y:i,width:r,height:o}=e,a=i+o,l=n+r,c=n+r/2,d=i+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:i};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:i};if(t===s.right_mid)return{x:l,y:d};if(t===s.right_bottom)return{x:l,y:a};if(t===s.bottom_mid)return{x:c,y:a};if(t===s.top_mid)return{x:c,y:i};if(t===s.center)return{x:c,y:d};throw Error("MathRect: the position keyword is invalid")}static is_point_in_rect(e,t,n=!0){const i=e.x===t.x||e.x===t.x+t.width,r=e.y===t.y||e.y===t.y+t.height,s=e.x>t.x&&e.x<t.x+t.width,o=e.y>t.y&&e.y<t.y+t.height;return n?(s||i)&&(o||r):s&&o}static get_point_in_rects(e,t,n=!0){const i=[];for(let r of t)this.is_point_in_rect(e,r,n)&&i.push(r);return i}static get_point_center(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}static move_rect_to_other(e,t,n,i=5){const r={width:e.width,height:Math.abs(e.y-n.y)},s={width:e.width,height:Math.abs(e.height-(n.y+n.height))},o={width:Math.abs(n.x-e.x),height:e.height},a={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(h.can_include_size(s,t)){const r=t.width+n.x-e.width,s=n.y+n.height+i;return{x:r<0?n.x:n.x-r,y:s}}if(h.can_include_size(r,t)){const r=t.width+n.x-e.width,s=n.y-t.height-i;return{x:r<0?n.x:n.x-r,y:s}}if(h.can_include_size(o,t)){const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}if(h.can_include_size(a,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}if(h.can_include_size(e,t)){const i=e.y+e.height-t.height;let r=n.x;return a.width>=t.width?r=n.x+n.width:o.width>=t.width&&(r=n.x-t.width),{x:r,y:i}}return{x:n.x,y:0}}static move_rect_in_other(e,t){if(h.is_include(t,e))return{dx:0,dy:0};let n=0,i=0;return e.x<t.x?n=t.x-e.x:e.x+e.width>t.x+t.width&&(n=t.x+t.width-(e.x+e.width)),e.y<t.y?i=t.y-e.y:e.y+e.height>t.y+t.height&&(i=t.y+t.height-(e.y+e.height)),{dx:n,dy:i}}static can_include_size(e,t){return t.width<=e.width&&t.height<=e.height}static is_include(e,t){return!(!this.can_include_size(e,t)||t.x<e.x||t.x>e.x+e.width-t.width||t.y<e.y||t.y>e.y+e.height-t.height)}static check_intersection(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),s=Math.abs(n.y-i.y);return r<=(e.width+t.width)/2&&s<=(e.height+t.height)/2}static limit_point_in_rect(e,t){const n=t.x,i=t.y,r=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>r&&(o=r),a<i&&(a=i),a>s&&(a=s),{x:o,y:a}}static point_distance_with_rect(e,t){if(this.is_point_in_rect(e,t,!0))return 0;const n=t.x+t.width/2,i=t.y+t.height/2,r=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(i-e.y);return o<=r&&a>s?a-s:a<=s&&o>r?o-r:Math.sqrt(Math.pow(o-r,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),i=this.get_point_center(t),r=Math.abs(n.x-i.x),s=Math.abs(n.y-i.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(r<=o&&s<=a)return 0;if(r>o&&s<=a)return r-o;if(r<=o&&s>a)return s-a;{let e=Math.pow(r-o,2),t=Math.pow(s-a,2);return Math.sqrt(e+t)}}static get_nearest_rect(e,t){if(0===t.length)return;let n,i=Number.POSITIVE_INFINITY;for(let r of t){let t=this.point_distance_with_rect(e,r);t<i&&(i=t,n=r)}return n}static get_shadow_point_horizental(e,t){let n=t.x,i=t.y+t.height/2;return n=e.x<=t.x?t.x:e.x>=t.x+t.width?t.x+t.width:e.x,{x:n,y:i}}static merge(...e){const t=e[0];let n=t.x,i=t.x+t.width,r=t.y,s=t.y+t.height;for(let t of e.slice(1)){const{x:e,y:o,width:a,height:l}=t;e<n&&(n=e),e+a>i&&(i=e+a),o<r&&(r=o),o+l>s&&(s=o+l)}return{x:n,y:r,width:i-n,height:s-r}}}class p{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t,n=100){const i=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:i/r}static distance(e,t){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)}static find_closet_point(e,t){let n=1/0,i=e[0];const{x:r,y:s}=t;for(let t of e){let e=Math.pow(r-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,i=o,r=s)}}return{from:i,to:r}}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(p,"path",document.createElementNS("http://www.w3.org/2000/svg","path"));class _{static polygon_center(e){let t=0,n=0,i=0;const r=e.length;for(let s=0;s<r;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%r],d=o*c-l*a;i+=d,t+=(o+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:s}=e[i],{x:o,y:a}=e[(i+1)%n];t+=r*a-o*s}return t/2}}class f{static check_intersection(e,t){const{from:n,to:i}=e,{from:r,to:s}=t;let o,a;if(o=n.x===i.x?Number.POSITIVE_INFINITY:(i.y-n.y)/(i.x-n.x),a=r.x===s.x?Number.POSITIVE_INFINITY:(s.y-r.y)/(s.x-r.x),o===a)return!1;const l=Math.min(n.x,i.x),c=Math.max(n.x,i.x),d=Math.min(n.y,i.y),u=Math.max(n.y,i.y),h=Math.min(r.x,s.x),p=Math.max(r.x,s.x),_=Math.min(r.y,s.y),f=Math.max(r.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-r.x)+r.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=_&&t<=f}if(a===Number.POSITIVE_INFINITY){const e=r.x,t=(i.y-n.y)/(i.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=_&&t<=f}{const e=(r.y-n.y+o*n.x-a*r.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=_&&t<=f}}}class m{static swap(e,t,n){const i=e[t],r=e[n];e[t]=r,e[n]=i}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b{get el(){return this._el}init(){this._handler_down=e=>this._pointdown(e),this._handler_move=e=>this._pointmove(e),this._handler_up=e=>this._pointup(e),this._handler_cancel=e=>this._pointercancel(e),this.el.addEventListener("pointerdown",this._handler_down),document.documentElement.addEventListener("pointermove",this._handler_move),document.documentElement.addEventListener("pointerup",this._handler_up),document.documentElement.addEventListener("pointercancel",this._handler_cancel)}_pointdown(e){e.stopPropagation(),e.preventDefault();const t=e.target;this.el.contains(t)&&(this._is_down=!0,this._down_point={x:e.clientX,y:e.clientY},this._func_down&&this._func_down())}_pointmove(e){if(!this._is_down||!this._down_point||e.buttons<=0)return;e.stopPropagation(),e.preventDefault(),this._is_move=!0;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._func_move&&this._func_move(t,n)}_pointup(e){if(e.preventDefault(),e.stopPropagation(),!this._is_down||!this._is_move)return;if(this._is_down=!1,this._is_move=!1,!this._down_point)return;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._down_point=void 0,this._func_up&&this._func_up(t,n)}_pointercancel(e){this._is_down&&this._is_move&&(this._is_down=!1,this._is_move=!1,this._down_point=void 0,this._func_cancel&&this._func_cancel())}off(){this.el.removeEventListener("pointerdown",this._handler_down),document.documentElement.removeEventListener("pointermove",this._handler_move),document.documentElement.removeEventListener("pointerup",this._handler_up),document.documentElement.removeEventListener("pointercancel",this._handler_cancel)}register_down(e){this._func_down=e}register_move(e){this._func_move=e}register_up(e){this._func_up=e}register_cancel(e){this._func_cancel=e}constructor(e){g(this,"_el",void 0),g(this,"_handler_down",void 0),g(this,"_handler_move",void 0),g(this,"_handler_up",void 0),g(this,"_handler_cancel",void 0),g(this,"_func_down",void 0),g(this,"_func_move",void 0),g(this,"_func_up",void 0),g(this,"_func_cancel",void 0),g(this,"_is_down",!1),g(this,"_is_move",!1),g(this,"_down_point",void 0),this._el=e,this.init()}}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class v{init(){const e=this.order,t=new Set;this.order=[];for(let e=0;e<this.container.children.length;e++){const n=this.container.children[e],i=n.getAttribute(this.attr);i&&n instanceof HTMLElement&&(n.setAttribute("draggable","true"),n.style.position="absolute","horizental"===this.dir?n.style.left="0px":n.style.top="0px",this.order_origin.push(i),t.add(i),this.map.has(i)||this.register(n),this.map.set(i,n))}const n=this.init_container();this.container.addEventListener("dragenter",e=>{e.preventDefault()}),this.container.addEventListener("dragover",e=>{e.preventDefault()});for(let n of e)t.has(n)?(this.order.push(n),t.delete(n)):this.map.delete(n);for(let e of t)this.order.push(e);return this.sort(),n}sort(){for(let e=0;e<this.order.length;e++){const t=this.order[e],n=this.map.get(t);if(!n)continue;const i=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${i}px)`:n.style.transform=`translateY(${i}px)`}for(let e of this.callback)e([...this.order])}init_container(){let e=0;for(const[t,n]of this.map)"horizental"===this.dir?e+=n.getBoundingClientRect().width/this.scale_h:e+=n.getBoundingClientRect().height/this.scale_v;return"horizental"===this.dir?this.container.style.width=e+"px":this.container.style.height=e+"px",e}sum_translate(e){let t=0;for(let n of e){const e=this.map.get(n);e&&("horizental"===this.dir?t+=e.getBoundingClientRect().width/this.scale_h:t+=e.getBoundingClientRect().height/this.scale_v)}return t}register(e){this._func_start=this.on_dragstart.bind(this),this._func_over=this.on_dragover.bind(this),this._func_enter=this.on_dragenter.bind(this),this._func_end=this.on_dragend.bind(this),e.addEventListener("dragstart",this._func_start,{capture:!0}),e.addEventListener("dragover",this._func_over,{capture:!0}),e.addEventListener("dragenter",this._func_enter,{capture:!0}),e.addEventListener("dragend",this._func_end,{capture:!0}),this.realtime||e.addEventListener("drop",this.on_drop.bind(this),{capture:!0})}on_dragstart(e){e.stopPropagation();const t=e.currentTarget;if(t instanceof HTMLElement&&(this.drag_id=t.getAttribute(this.attr),this.drag_id))for(let t of this.callback_start)t(e,this.drag_id);this.container.style.setProperty(this.css_var_point_events,"none")}on_dragenter(e){if(e.stopPropagation(),e.preventDefault(),!this.realtime)return;const t=e.currentTarget;if(e.target!==t)return;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),s=this.order.indexOf(i);r<0||s<0||("swap"===this.effect?m.swap(this.order,r,s):(this.order.splice(s,1),this.order.splice(r,0,i)),this.init_container(),this.sort())}on_dragover(e){e.preventDefault(),e.stopPropagation()}on_drop(e){e.stopPropagation();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),i=this.drag_id;if(!n||!i||n===i)return;const r=this.order.indexOf(n),s=this.order.indexOf(i);r<0||s<0||("swap"===this.effect?m.swap(this.order,r,s):(this.order.splice(s,1),this.order.splice(r,0,i)),this.sort())}on_dragend(e){this.container.style.setProperty(this.css_var_point_events,"auto");for(let t of this.callback_end)t(e)}register_start(e){this.callback_start.add(e)}register_dropend(e){this.callback_end.add(e)}register_callback(e){this.callback.add(e)}off_callback(e){this.callback.delete(e)}off_callback_start(e){this.callback_start.delete(e)}off_callback_drop(e){this.callback_end.delete(e)}constructor(e,t,n,i,r=!0){y(this,"container",void 0),y(this,"drag_id",void 0),y(this,"dir","vertical"),y(this,"effect",void 0),y(this,"attr",void 0),y(this,"realtime",!0),y(this,"order_origin",[]),y(this,"order",[]),y(this,"css_var_point_events","--drag-item-point-event"),y(this,"map",new Map),y(this,"callback",new Set),y(this,"callback_start",new Set),y(this,"callback_end",new Set),y(this,"scale_h",1),y(this,"scale_v",1),y(this,"_func_start",void 0),y(this,"_func_over",void 0),y(this,"_func_enter",void 0),y(this,"_func_end",void 0),y(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=r,this.effect=i,e.style.position="relative"}}return t})(),e.exports=t()}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var s=i[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"chunk/"+e+"-"+r.h()+".js",r.miniCssF=e=>{},r.h=()=>"25be6d62a1e259bb29fc",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",r.l=(n,i,s,o)=>{if(e[n])e[n].push(i);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[i];var h=(t,i)=>{a.onerror=a.onload=null,clearTimeout(p);var r=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(i)),t)return t(i)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={3057:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=s);var o=r.p+r.u(t),a=new Error;r.l(o,n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(l)l(r)}for(t&&t(n);c<o.length;c++)s=o[c],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},n=self.webpackChunkdeepsky=self.webpackChunkdeepsky||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";r.r(s),r.d(s,{CodeLanguageMap:()=>Lm,CommandApi:()=>vu,CommandBoxFolder:()=>Pd,CommandBoxRoot:()=>Xc,CommandCode:()=>Qu,CommandDetailList:()=>ku,CommandFomula:()=>Fw,CommandLinker:()=>Nd,CommandListOrdered:()=>Gu,CommandRt:()=>Dx,CommandTable:()=>Gw,CommandText:()=>ed,CommandTextLink:()=>Dc,CommandTodo:()=>Pu,CubeAnnotation:()=>Rc,CubeApi:()=>yu,CubeBase:()=>Ps,CubeBox:()=>kd,CubeBoxColumns:()=>Ex,CubeBoxFolder:()=>zd,CubeBoxRoot:()=>Yc,CubeCode:()=>Dm,CubeDetailList:()=>zu,CubeDoc:()=>pd,CubeFomula:()=>Hw,CubeHandler:()=>Rs,CubeImg:()=>gc,CubeLine:()=>gd,CubeLinker:()=>Ld,CubeList:()=>Hu,CubeListOrdered:()=>Ku,CubeLost:()=>xc,CubeMap:()=>hu,CubeNode:()=>ou,CubePostil:()=>Qc,CubeRt:()=>Fx,CubeSubMap:()=>zx,CubeTable:()=>sx,CubeText:()=>rd,CubeTextLink:()=>jc,CubeTip:()=>hx,CubeTodo:()=>Du,LayoutChecker:()=>ea,LinkerLine:()=>Ed,LinkerPoint:()=>Id,Map2D:()=>Hl,MapChild:()=>Fl,MapInteraction:()=>Yd,MapNodeBase:()=>Yl,MapNodeLayoutEnv:()=>Wl,MapTools:()=>Gl,Matrix2D:()=>$l,NodeBase2D:()=>Kl,NodeLayout:()=>Ul,NodeLayoutInvert:()=>Vl,NodeLayoutMeter:()=>Xl,NodeObserver:()=>Xd,NodeShape:()=>au,Note:()=>As,NoteApi:()=>Ss,NoteBase:()=>ks,NoteClipBoard:()=>Vs,NoteConfig:()=>Us,NoteCourier:()=>Xs,NoteCubes:()=>Es,NoteCursor:()=>Ys,NoteEvent:()=>$s,NoteHistory:()=>oc,NoteHotkeys:()=>Fs,NoteListener:()=>Ls,NoteMeta:()=>Ms,NotePainter:()=>Gs,NotePlayer:()=>sc,NoteScope:()=>Zl,NoteStats:()=>Hs,NoteTools:()=>rc,Recorder:()=>ac,StatusAnnotation:()=>td,StatusApi:()=>wu,StatusBox:()=>wd,StatusBoxFolder:()=>Ad,StatusBoxRoot:()=>Kc,StatusCode:()=>Bm,StatusCube:()=>Jl,StatusDetailList:()=>Au,StatusDoc:()=>_d,StatusFomula:()=>$w,StatusImg:()=>mc,StatusLine:()=>fd,StatusList:()=>$u,StatusListOrdered:()=>Ju,StatusLost:()=>kc,StatusMap:()=>du,StatusNode:()=>su,StatusNodeBase:()=>Ql,StatusPostil:()=>Zc,StatusRt:()=>Ix,StatusSubmap:()=>Ax,StatusTable:()=>ox,StatusText:()=>nd,StatusTextLink:()=>Bc,StatusTip:()=>dx,StatusTodo:()=>Eu,_ApiCommandNames:()=>c,_CodeCommandNames:()=>p,_CubeCommandName:()=>w,_CursorCommandName:()=>x,_DetaiListCommandName:()=>d,_DocCommandName:()=>o,_FomulaCommandNames:()=>m,_FomulaSize:()=>f,_HotKeys:()=>T,_HotKeysGroup:()=>z,_Keys:()=>N,_LinkerAnchor:()=>b,_LinkerCommandNames:()=>y,_ListCommandNames:()=>u,_ListOrderedCommandNames:()=>h,_MapCommandName:()=>k,_MapGroup:()=>a,_NavigationKey:()=>P,_NodeCommandName:()=>S,_NoteCores:()=>t,_NoteCubeTypes:()=>n,_NoteEvents:()=>M,_NoteMode:()=>A,_PlayStatus:()=>C,_RtCommandNames:()=>v,_TableCommandNames:()=>g,_TextCommandName:()=>i,_TextLinkCommandNames:()=>l,_TodoCommandNames:()=>_,cmd:()=>Os,key:()=>qs,keymap:()=>js,node_observer:()=>Kd});var e={};r.r(e),r.d(e,{boolean:()=>Pp,booleanish:()=>Np,commaOrSpaceSeparated:()=>Ip,commaSeparated:()=>Ep,number:()=>Op,overloadedBoolean:()=>Rp,spaceSeparated:()=>Lp});var t=function(e){return e.courier="courier",e.cursor="cursor",e.config="config",e.cubes="cubes",e.clipboard="clipboard",e.event="event",e.fomula="fomula",e.float="float",e.painter="painter",e.player="player",e.hotkeys="hotkeys",e.history="history",e.scope="scope",e.stats="stats",e}({}),n=function(e){return e.api="api",e.annotation="annotation",e.box="box",e.box_root="box-root",e.box_folder="box-folder",e.box_columns="box-columns",e.code="code",e.doc="doc",e.detail_list="detail-list",e.fomula="fomula",e.img="img",e.lost="lost",e.line="line",e.list="list",e.list_ordered="list-ordered",e.linker="linker",e.link="link",e.map="map",e.submap="submap",e.node="node",e.postil="postil",e.rt="rt",e.text="text",e.tip="tip",e.todo="todo",e.table="table",e}({}),i=function(e){return e.text_reset="cube-text:text-reset",e.text_merge="cube-text:text-merge",e.text_break="cube-text:text-break",e}({}),o=function(){return{}}(),a=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),l=function(e){return e.update="text-link:update",e}({}),c=function(e){return e.reset="cube-api:reset",e}({}),d=function(e){return e.insert_row="cube-detail-list:insert-row",e.remove_row="cube-detail-list:remove-row",e.change_width_col1="cube-detail-list:change-width-col1",e}({}),u=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e.reset="cube-list:reset",e.transform="cube-list:transform",e}({}),h=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e.reset="cube-list-ordered:reset",e}({}),p=function(e){return e.change_lang="cube-code:change-lang",e.change_active="cube-code:change-active",e.change_theme="cube-code:change-theme",e.code_update="cube-code:update-code",e.code_add="cube-code:code-add",e.code_remove="cube-code:code-remove",e.code_rename="cube-code:code-rename",e}({}),_=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e.reset="cube-todo:reset",e}({}),f=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),m=function(e){return e.update="cube-fomula:update",e}({}),g=function(e){return e.add_title="cube-table:add-title",e.remove_title="cube-table:remove-title",e.add_cell="cube-table:add-cell",e.remove_cell="cube-table:remove-cell",e.add_row="cube-table:add-row",e.remove_row="cube-table:remove-row",e.add_col="cube-table:add-col",e.remove_col="cube-table:remove-col",e.add_grid_col="cube-table:add-grid-col",e.remove_grid_col="cube-table:remove-grid-col",e.merge="cube-table:merge",e.moveto="cube-table:moveto",e.update_area="cube-table:update-area",e.reorder="cube-table:reorder",e.col_resize="cube-table:col-resize",e}({}),b=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),y=function(e){return e.update="linker:update",e}({}),v=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),w=function(e){return e.cube_insert_child="cube-insert-child",e.cube_delete_child="cube-delete-child",e.cube_reset="cube-reset",e.cube_delete_adjacent="cube-delete-adjacent",e.cube_set_selection_css="cube-set-selection-css",e.cube_insert="cube-insert",e.cube_delete="cube-delete",e.cube_partition="cube-partition",e.cube_reorder="cube-reorder",e.cube_set_css="cube-set-css",e.cube_set_attr="cube-set-attr",e.cube_move="cube-move",e.cube_merge="cube-merge",e.cube_postil_add="cube-postil-add",e.cube_postil_remove="cube-postil-remove",e}({}),x=function(e){return e.cursor_in_head="cursor:in-head",e.cursor_in_tail="cursor:in-tail",e.loc="cursor:loc",e}({}),k=function(e){return e.node_add="node-add",e.node_remove="node-remove",e.linker_add="linker-add",e.linker_remove="linker-remove",e.update_attrs="update-attrs",e}({}),S=function(e){return e.layout_update="node:layout-update",e.append_child="node:append-child",e}({}),C=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),M=function(e){return e["asset-save"]="note-event:asset-save",e["asset-download"]="note-event:asset-download",e["asset-copy"]="note-event:asset-copy",e.export="note-event:export",e["replace-id"]="note-event:replace-id",e["edit-before"]="note-event:edit-before",e["edit-after"]="note-event:edit-after",e["text-merge"]="note-event:text-merge",e.esc="note-event:esc",e["selection-change"]="note-event:selection-change",e["cursor-nav-before"]="note-event:cursor-nav-before",e["cursor-nav-after"]="note-event:cursor-nav-after",e["enter-before"]="note-event:enter-before",e["enter-after"]="note-event:enter-after",e["show-cube-editor"]="note-event:show-cube-editor",e["text-link-edit"]="note-event:text-link-edit",e["note-input-before"]="note-event:note-input-before",e["note-input-compositionend"]="note-event:note-input-compositionend",e["note-input-compositionend-before"]="note-event:note-input-compositionend-before",e["note-input-compositionupdate"]="note-event:note-input-compositionupdate",e["status-update"]="note-event:status-update",e["fig-click"]="note-event:fig-click",e}({}),A=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),T=function(e){return e["break-line"]="换行",e["cursor-nav"]="光标导航",e["cursor-nav-extend"]="光标复选",e["format-brush-apply"]="应用格式刷",e["format-brush-copy"]="复制格式刷",e.undo="撤销",e.redo="重做",e["indent-line"]="缩进",e["unindent-line"]="反向缩进",e["clear-css"]="重置样式",e["scope-clear"]="清空块选区",e["scope-add"]="添加块选区",e["root-add-next"]="向后添加根级块",e["root-add-prev"]="向前添加根级块",e["break-root"]="分裂根级块",e["break-text"]="文本块换行",e["fold-block"]="折叠所在块",e["text-add-annotation"]="添加批注",e["text-italic"]="斜体",e["text-bold"]="加粗",e["text-underline"]="下划线",e["text-align-left"]="左对齐",e["text-align-center"]="居中对齐",e["text-align-right"]="右对齐",e["text-partition"]="分裂文本块",e}({}),z=function(e){return e.core="核心",e.common="通用",e.text="文本块",e.block="块",e.scope="块选区",e.dict="字典",e.bookmark="书签",e.search="搜索",e.css="样式",e.float="面板",e.other="其他",e}({}),P=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),N=function(e){return e.enter="Enter",e}({});function R(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const O={},L=[],E=()=>{},I=()=>!1,D=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),B=e=>e.startsWith("onUpdate:"),j=Object.assign,q=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},F=Object.prototype.hasOwnProperty,H=(e,t)=>F.call(e,t),$=Array.isArray,G=e=>"[object Map]"===Q(e),V=e=>"[object Set]"===Q(e),U=e=>"function"==typeof e,W=e=>"string"==typeof e,Y=e=>"symbol"==typeof e,X=e=>null!==e&&"object"==typeof e,K=e=>(X(e)||U(e))&&U(e.then)&&U(e.catch),J=Object.prototype.toString,Q=e=>J.call(e),Z=e=>"[object Object]"===Q(e),ee=e=>W(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,te=R(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ne=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ie=/-\w/g,re=ne(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),se=/\B([A-Z])/g,oe=ne(e=>e.replace(se,"-$1").toLowerCase()),ae=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),le=ne(e=>e?`on${ae(e)}`:""),ce=(e,t)=>!Object.is(e,t),de=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ue=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},he=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let pe;const _e=()=>pe||(pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{});function fe(e){if($(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],r=W(i)?ye(i):fe(i);if(r)for(const e in r)t[e]=r[e]}return t}if(W(e)||X(e))return e}const me=/;(?![^(]*\))/g,ge=/:([^]+)/,be=/\/\*[^]*?\*\//g;function ye(e){const t={};return e.replace(be,"").split(me).forEach(e=>{if(e){const n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ve(e){let t="";if(W(e))t=e;else if($(e))for(let n=0;n<e.length;n++){const i=ve(e[n]);i&&(t+=i+" ")}else if(X(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const we="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",xe=R(we);function ke(e){return!!e||""===e}const Se=e=>!(!e||!0!==e.__v_isRef),Ce=e=>W(e)?e:null==e?"":$(e)||X(e)&&(e.toString===J||!U(e.toString))?Se(e)?Ce(e.value):JSON.stringify(e,Me,2):String(e),Me=(e,t)=>Se(t)?Me(e,t.value):G(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[Ae(t,i)+" =>"]=n,e),{})}:V(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:Y(t)?Ae(t):!X(t)||$(t)||Z(t)?t:String(t),Ae=(e,t="")=>{var n;return Y(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let Te,ze;class Pe{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Te,!e&&Te&&(this.index=(Te.scopes||(Te.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Te;try{return Te=this,e()}finally{Te=t}}else 0}on(){1===++this._on&&(this.prevScope=Te,Te=this)}off(){this._on>0&&0===--this._on&&(Te=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Ne=new WeakSet;class Re{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Te&&Te.active&&Te.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Ne.has(this)&&(Ne.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||Ie(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Xe(this),je(this);const e=ze,t=Ve;ze=this,Ve=!0;try{return this.fn()}finally{0,qe(this),ze=e,Ve=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)$e(e);this.deps=this.depsTail=void 0,Xe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Ne.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Fe(this)&&this.run()}get dirty(){return Fe(this)}}let Oe,Le,Ee=0;function Ie(e,t=!1){if(e.flags|=8,t)return e.next=Le,void(Le=e);e.next=Oe,Oe=e}function De(){Ee++}function Be(){if(--Ee>0)return;if(Le){let e=Le;for(Le=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Oe;){let t=Oe;for(Oe=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function je(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function qe(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),$e(i),Ge(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function Fe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(He(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function He(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Ke)return;if(e.globalVersion=Ke,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!Fe(e)))return;e.flags|=2;const t=e.dep,n=ze,i=Ve;ze=e,Ve=!0;try{je(e);const n=e.fn(e._value);(0===t.version||ce(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{ze=n,Ve=i,qe(e),e.flags&=-3}}function $e(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)$e(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function Ge(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ve=!0;const Ue=[];function We(){Ue.push(Ve),Ve=!1}function Ye(){const e=Ue.pop();Ve=void 0===e||e}function Xe(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=ze;ze=void 0;try{t()}finally{ze=e}}}let Ke=0;class Je{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qe{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!ze||!Ve||ze===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==ze)t=this.activeLink=new Je(ze,this),ze.deps?(t.prevDep=ze.depsTail,ze.depsTail.nextDep=t,ze.depsTail=t):ze.deps=ze.depsTail=t,Ze(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=ze.depsTail,t.nextDep=void 0,ze.depsTail.nextDep=t,ze.depsTail=t,ze.deps===t&&(ze.deps=e)}return t}trigger(e){this.version++,Ke++,this.notify(e)}notify(e){De();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Be()}}}function Ze(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const et=new WeakMap,tt=Symbol(""),nt=Symbol(""),it=Symbol("");function rt(e,t,n){if(Ve&&ze){let t=et.get(e);t||et.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new Qe),i.map=t,i.key=n),i.track()}}function st(e,t,n,i,r,s){const o=et.get(e);if(!o)return void Ke++;const a=e=>{e&&e.trigger()};if(De(),"clear"===t)o.forEach(a);else{const r=$(e),s=r&&ee(n);if(r&&"length"===n){const e=Number(i);o.forEach((t,n)=>{("length"===n||n===it||!Y(n)&&n>=e)&&a(t)})}else switch((void 0!==n||o.has(void 0))&&a(o.get(n)),s&&a(o.get(it)),t){case"add":r?s&&a(o.get("length")):(a(o.get(tt)),G(e)&&a(o.get(nt)));break;case"delete":r||(a(o.get(tt)),G(e)&&a(o.get(nt)));break;case"set":G(e)&&a(o.get(tt))}}Be()}function ot(e){const t=Vt(e);return t===e?t:(rt(t,0,it),$t(e)?t:t.map(Wt))}function at(e){return rt(e=Vt(e),0,it),e}const lt={__proto__:null,[Symbol.iterator](){return ct(this,Symbol.iterator,Wt)},concat(...e){return ot(this).concat(...e.map(e=>$(e)?ot(e):e))},entries(){return ct(this,"entries",e=>(e[1]=Wt(e[1]),e))},every(e,t){return ut(this,"every",e,t,void 0,arguments)},filter(e,t){return ut(this,"filter",e,t,e=>e.map(Wt),arguments)},find(e,t){return ut(this,"find",e,t,Wt,arguments)},findIndex(e,t){return ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ut(this,"findLast",e,t,Wt,arguments)},findLastIndex(e,t){return ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return pt(this,"includes",e)},indexOf(...e){return pt(this,"indexOf",e)},join(e){return ot(this).join(e)},lastIndexOf(...e){return pt(this,"lastIndexOf",e)},map(e,t){return ut(this,"map",e,t,void 0,arguments)},pop(){return _t(this,"pop")},push(...e){return _t(this,"push",e)},reduce(e,...t){return ht(this,"reduce",e,t)},reduceRight(e,...t){return ht(this,"reduceRight",e,t)},shift(){return _t(this,"shift")},some(e,t){return ut(this,"some",e,t,void 0,arguments)},splice(...e){return _t(this,"splice",e)},toReversed(){return ot(this).toReversed()},toSorted(e){return ot(this).toSorted(e)},toSpliced(...e){return ot(this).toSpliced(...e)},unshift(...e){return _t(this,"unshift",e)},values(){return ct(this,"values",Wt)}};function ct(e,t,n){const i=at(e),r=i[t]();return i===e||$t(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const dt=Array.prototype;function ut(e,t,n,i,r,s){const o=at(e),a=o!==e&&!$t(e),l=o[t];if(l!==dt[t]){const t=l.apply(e,s);return a?Wt(t):t}let c=n;o!==e&&(a?c=function(t,i){return n.call(this,Wt(t),i,e)}:n.length>2&&(c=function(t,i){return n.call(this,t,i,e)}));const d=l.call(o,c,i);return a&&r?r(d):d}function ht(e,t,n,i){const r=at(e);let s=n;return r!==e&&($t(e)?n.length>3&&(s=function(t,i,r){return n.call(this,t,i,r,e)}):s=function(t,i,r){return n.call(this,t,Wt(i),r,e)}),r[t](s,...i)}function pt(e,t,n){const i=Vt(e);rt(i,0,it);const r=i[t](...n);return-1!==r&&!1!==r||!Gt(n[0])?r:(n[0]=Vt(n[0]),i[t](...n))}function _t(e,t,n=[]){We(),De();const i=Vt(e)[t].apply(e,n);return Be(),Ye(),i}const ft=R("__proto__,__v_isRef,__isVue"),mt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(Y));function gt(e){Y(e)||(e=String(e));const t=Vt(this);return rt(t,0,e),t.hasOwnProperty(e)}class bt{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?Et:Lt:r?Ot:Rt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=$(e);if(!i){let e;if(s&&(e=lt[t]))return e;if("hasOwnProperty"===t)return gt}const o=Reflect.get(e,t,Xt(e)?e:n);return(Y(t)?mt.has(t):ft(t))?o:(i||rt(e,0,t),r?o:Xt(o)?s&&ee(t)?o:o.value:X(o)?i?jt(o):Dt(o):o)}}class yt extends bt{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=Ht(r);if($t(n)||Ht(n)||(r=Vt(r),n=Vt(n)),!$(e)&&Xt(r)&&!Xt(n))return t||(r.value=n),!0}const s=$(e)&&ee(t)?Number(t)<e.length:H(e,t),o=Reflect.set(e,t,n,Xt(e)?e:i);return e===Vt(i)&&(s?ce(n,r)&&st(e,"set",t,n):st(e,"add",t,n)),o}deleteProperty(e,t){const n=H(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&st(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return Y(t)&&mt.has(t)||rt(e,0,t),n}ownKeys(e){return rt(e,0,$(e)?"length":tt),Reflect.ownKeys(e)}}class vt extends bt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const wt=new yt,xt=new vt,kt=new yt(!0),St=e=>e,Ct=e=>Reflect.getPrototypeOf(e);function Mt(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function At(e,t){const n={get(n){const i=this.__v_raw,r=Vt(i),s=Vt(n);e||(ce(n,s)&&rt(r,0,n),rt(r,0,s));const{has:o}=Ct(r),a=t?St:e?Yt:Wt;return o.call(r,n)?a(i.get(n)):o.call(r,s)?a(i.get(s)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&rt(Vt(t),0,tt),t.size},has(t){const n=this.__v_raw,i=Vt(n),r=Vt(t);return e||(ce(t,r)&&rt(i,0,t),rt(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,s=r.__v_raw,o=Vt(s),a=t?St:e?Yt:Wt;return!e&&rt(o,0,tt),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}};j(n,e?{add:Mt("add"),set:Mt("set"),delete:Mt("delete"),clear:Mt("clear")}:{add(e){t||$t(e)||Ht(e)||(e=Vt(e));const n=Vt(this);return Ct(n).has.call(n,e)||(n.add(e),st(n,"add",e,e)),this},set(e,n){t||$t(n)||Ht(n)||(n=Vt(n));const i=Vt(this),{has:r,get:s}=Ct(i);let o=r.call(i,e);o||(e=Vt(e),o=r.call(i,e));const a=s.call(i,e);return i.set(e,n),o?ce(n,a)&&st(i,"set",e,n):st(i,"add",e,n),this},delete(e){const t=Vt(this),{has:n,get:i}=Ct(t);let r=n.call(t,e);r||(e=Vt(e),r=n.call(t,e));i&&i.call(t,e);const s=t.delete(e);return r&&st(t,"delete",e,void 0),s},clear(){const e=Vt(this),t=0!==e.size,n=e.clear();return t&&st(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,s=Vt(r),o=G(s),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,c=r[e](...i),d=n?St:t?Yt:Wt;return!t&&rt(s,0,l?nt:tt),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[d(e[0]),d(e[1])]:d(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function Tt(e,t){const n=At(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(H(n,i)&&i in t?n:t,i,r)}const zt={get:Tt(!1,!1)},Pt={get:Tt(!1,!0)},Nt={get:Tt(!0,!1)};const Rt=new WeakMap,Ot=new WeakMap,Lt=new WeakMap,Et=new WeakMap;function It(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Q(e).slice(8,-1))(e))}function Dt(e){return Ht(e)?e:qt(e,!1,wt,zt,Rt)}function Bt(e){return qt(e,!1,kt,Pt,Ot)}function jt(e){return qt(e,!0,xt,Nt,Lt)}function qt(e,t,n,i,r){if(!X(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=It(e);if(0===s)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,2===s?i:n);return r.set(e,a),a}function Ft(e){return Ht(e)?Ft(e.__v_raw):!(!e||!e.__v_isReactive)}function Ht(e){return!(!e||!e.__v_isReadonly)}function $t(e){return!(!e||!e.__v_isShallow)}function Gt(e){return!!e&&!!e.__v_raw}function Vt(e){const t=e&&e.__v_raw;return t?Vt(t):e}function Ut(e){return!H(e,"__v_skip")&&Object.isExtensible(e)&&ue(e,"__v_skip",!0),e}const Wt=e=>X(e)?Dt(e):e,Yt=e=>X(e)?jt(e):e;function Xt(e){return!!e&&!0===e.__v_isRef}function Kt(e){return Qt(e,!1)}function Jt(e){return Qt(e,!0)}function Qt(e,t){return Xt(e)?e:new Zt(e,t)}class Zt{constructor(e,t){this.dep=new Qe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Vt(e),this._value=t?e:Wt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||$t(e)||Ht(e);e=n?e:Vt(e),ce(e,t)&&(this._rawValue=e,this._value=n?e:Wt(e),this.dep.trigger())}}function en(e){return Xt(e)?e.value:e}const tn={get:(e,t,n)=>"__v_raw"===t?e:en(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return Xt(r)&&!Xt(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function nn(e){return Ft(e)?e:new Proxy(e,tn)}class rn{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Qe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ke-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||ze===this))return Ie(this,!0),!0}get value(){const e=this.dep.track();return He(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const sn={},on=new WeakMap;let an;function ln(e,t,n=O){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=e=>r?e:$t(e)||!1===r||0===r?cn(e,1):cn(e);let d,u,h,p,_=!1,f=!1;if(Xt(e)?(u=()=>e.value,_=$t(e)):Ft(e)?(u=()=>c(e),_=!0):$(e)?(f=!0,_=e.some(e=>Ft(e)||$t(e)),u=()=>e.map(e=>Xt(e)?e.value:Ft(e)?c(e):U(e)?l?l(e,2):e():void 0)):u=U(e)?t?l?()=>l(e,2):e:()=>{if(h){We();try{h()}finally{Ye()}}const t=an;an=d;try{return l?l(e,3,[p]):e(p)}finally{an=t}}:E,t&&r){const e=u,t=!0===r?1/0:r;u=()=>cn(e(),t)}const m=Te,g=()=>{d.stop(),m&&m.active&&q(m.effects,d)};if(s&&t){const e=t;t=(...t)=>{e(...t),g()}}let b=f?new Array(e.length).fill(sn):sn;const y=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(r||_||(f?e.some((e,t)=>ce(e,b[t])):ce(e,b))){h&&h();const n=an;an=d;try{const n=[e,b===sn?void 0:f&&b[0]===sn?[]:b,p];b=e,l?l(t,3,n):t(...n)}finally{an=n}}}else d.run()};return a&&a(y),d=new Re(u),d.scheduler=o?()=>o(y,!1):y,p=e=>function(e,t=!1,n=an){if(n){let t=on.get(n);t||on.set(n,t=[]),t.push(e)}}(e,!1,d),h=d.onStop=()=>{const e=on.get(d);if(e){if(l)l(e,4);else for(const t of e)t();on.delete(d)}},t?i?y(!0):b=d.run():o?o(y.bind(null,!0),!0):d.run(),g.pause=d.pause.bind(d),g.resume=d.resume.bind(d),g.stop=g,g}function cn(e,t=1/0,n){if(t<=0||!X(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,Xt(e))cn(e.value,t,n);else if($(e))for(let i=0;i<e.length;i++)cn(e[i],t,n);else if(V(e)||G(e))e.forEach(e=>{cn(e,t,n)});else if(Z(e)){for(const i in e)cn(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&cn(e[i],t,n)}return e}function dn(e,t,n,i){try{return i?e(...i):e()}catch(e){hn(e,t,n)}}function un(e,t,n,i){if(U(e)){const r=dn(e,t,n,i);return r&&K(r)&&r.catch(e=>{hn(e,t,n)}),r}if($(e)){const r=[];for(let s=0;s<e.length;s++)r.push(un(e[s],t,n,i));return r}}function hn(e,t,n,i=!0){t&&t.vnode;const{errorHandler:r,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||O;if(t){let i=t.parent;const s=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,s,o))return;i=i.parent}if(r)return We(),dn(r,null,10,[e,s,o]),void Ye()}!function(e,t,n,i=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,i,s)}const pn=[];let _n=-1;const fn=[];let mn=null,gn=0;const bn=Promise.resolve();let yn=null;function vn(e){const t=yn||bn;return e?t.then(this?e.bind(this):e):t}function wn(e){if(!(1&e.flags)){const t=Mn(e),n=pn[pn.length-1];!n||!(2&e.flags)&&t>=Mn(n)?pn.push(e):pn.splice(function(e){let t=_n+1,n=pn.length;for(;t<n;){const i=t+n>>>1,r=pn[i],s=Mn(r);s<e||s===e&&2&r.flags?t=i+1:n=i}return t}(t),0,e),e.flags|=1,xn()}}function xn(){yn||(yn=bn.then(An))}function kn(e){$(e)?fn.push(...e):mn&&-1===e.id?mn.splice(gn+1,0,e):1&e.flags||(fn.push(e),e.flags|=1),xn()}function Sn(e,t,n=_n+1){for(0;n<pn.length;n++){const t=pn[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;0,pn.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function Cn(e){if(fn.length){const e=[...new Set(fn)].sort((e,t)=>Mn(e)-Mn(t));if(fn.length=0,mn)return void mn.push(...e);for(mn=e,gn=0;gn<mn.length;gn++){const e=mn[gn];0,4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}mn=null,gn=0}}const Mn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function An(e){try{for(_n=0;_n<pn.length;_n++){const e=pn[_n];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),dn(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;_n<pn.length;_n++){const e=pn[_n];e&&(e.flags&=-2)}_n=-1,pn.length=0,Cn(),yn=null,(pn.length||fn.length)&&An(e)}}let Tn=null,zn=null;function Pn(e){const t=Tn;return Tn=e,zn=e&&e.type.__scopeId||null,t}function Nn(e,t=Tn,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&Er(-1);const r=Pn(t);let s;try{s=e(...n)}finally{Pn(r),i._d&&Er(1)}return s};return i._n=!0,i._c=!0,i._d=!0,i}function Rn(e,t){if(null===Tn)return e;const n=bs(Tn),i=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,s,o,a=O]=t[e];r&&(U(r)&&(r={mounted:r,updated:r}),r.deep&&cn(s),i.push({dir:r,instance:n,value:s,oldValue:void 0,arg:o,modifiers:a}))}return e}function On(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(We(),un(l,n,8,[e.el,a,e,t]),Ye())}}const Ln=Symbol("_vte"),En=e=>e.__isTeleport;const In=Symbol("_leaveCb");Symbol("_enterCb");const Dn=[Function,Array];Boolean,Boolean;function Bn(e,t){6&e.shapeFlag&&e.component?(e.transition=t,Bn(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function jn(e,t){return U(e)?(()=>j({name:e.name},t,{setup:e}))():e}function qn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Fn(e){const t=rs(),n=Jt(null);if(t){const i=t.refs===O?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}else 0;return n}const Hn=new WeakMap;function $n(e,t,n,i,r=!1){if($(e))return void e.forEach((e,s)=>$n(e,t&&($(t)?t[s]:t),n,i,r));if(Vn(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&$n(e,t,n,i.component.subTree));const s=4&i.shapeFlag?bs(i.component):i.el,o=r?null:s,{i:a,r:l}=e;const c=t&&t.r,d=a.refs===O?a.refs={}:a.refs,u=a.setupState,h=Vt(u),p=u===O?I:e=>H(h,e);if(null!=c&&c!==l)if(Gn(t),W(c))d[c]=null,p(c)&&(u[c]=null);else if(Xt(c)){c.value=null;const e=t;e.k&&(d[e.k]=null)}if(U(l))dn(l,a,12,[o,d]);else{const t=W(l),i=Xt(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?u[l]:d[l]:l.value;if(r)$(n)&&q(n,s);else if($(n))n.includes(s)||n.push(s);else if(t)d[l]=[s],p(l)&&(u[l]=d[l]);else{const t=[s];l.value=t,e.k&&(d[e.k]=t)}}else t?(d[l]=o,p(l)&&(u[l]=o)):i&&(l.value=o,e.k&&(d[e.k]=o))};if(o){const t=()=>{a(),Hn.delete(e)};t.id=-1,Hn.set(e,t),er(t,n)}else Gn(e),a()}else 0}}function Gn(e){const t=Hn.get(e);t&&(t.flags|=8,Hn.delete(e))}_e().requestIdleCallback,_e().cancelIdleCallback;const Vn=e=>!!e.type.__asyncLoader;const Un=e=>e.type.__isKeepAlive;RegExp,RegExp;function Wn(e,t){return $(e)?e.some(e=>Wn(e,t)):W(e)?e.split(",").includes(t):"[object RegExp]"===Q(e)&&(e.lastIndex=0,e.test(t))}function Yn(e,t){Kn(e,"a",t)}function Xn(e,t){Kn(e,"da",t)}function Kn(e,t,n=is){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(ei(t,i,n),n){let e=n.parent;for(;e&&e.parent;)Un(e.parent.vnode)&&Jn(i,t,n,e),e=e.parent}}function Jn(e,t,n,i){const r=ei(t,e,i,!0);ai(()=>{q(i[t],r)},n)}function Qn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Zn(e){return 128&e.shapeFlag?e.ssContent:e}function ei(e,t,n=is,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{We();const r=as(n),s=un(t,n,e,i);return r(),Ye(),s});return i?r.unshift(s):r.push(s),s}}const ti=e=>(t,n=is)=>{hs&&"sp"!==e||ei(e,(...e)=>t(...e),n)},ni=ti("bm"),ii=ti("m"),ri=ti("bu"),si=ti("u"),oi=ti("bum"),ai=ti("um"),li=ti("sp"),ci=ti("rtg"),di=ti("rtc");function ui(e,t=is){ei("ec",e,t)}const hi="components";const pi=Symbol.for("v-ndc");function _i(e){return W(e)?fi(hi,e,!1)||e:e||pi}function fi(e,t,n=!0,i=!1){const r=Tn||is;if(r){const n=r.type;if(e===hi){const e=ys(n,!1);if(e&&(e===t||e===re(t)||e===ae(re(t))))return n}const s=mi(r[e]||n[e],t)||mi(r.appContext[e],t);return!s&&i?n:s}}function mi(e,t){return e&&(e[t]||e[re(t)]||e[ae(re(t))])}function gi(e,t,n,i){let r;const s=n&&n[i],o=$(e);if(o||W(e)){let n=!1,i=!1;o&&Ft(e)&&(n=!$t(e),i=Ht(e),e=at(e)),r=new Array(e.length);for(let o=0,a=e.length;o<a;o++)r[o]=t(n?i?Yt(Wt(e[o])):Wt(e[o]):e[o],o,void 0,s&&s[o])}else if("number"==typeof e){0,r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,s&&s[n])}else if(X(e))if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,o=n.length;i<o;i++){const o=n[i];r[i]=t(e[o],o,i,s&&s[i])}}else r=[];return n&&(n[i]=r),r}const bi=e=>e?cs(e)?bs(e):bi(e.parent):null,yi=j(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>bi(e.parent),$root:e=>bi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ai(e),$forceUpdate:e=>e.f||(e.f=()=>{wn(e.update)}),$nextTick:e=>e.n||(e.n=vn.bind(e.proxy)),$watch:e=>hr.bind(e)}),vi=(e,t)=>e!==O&&!e.__isScriptSetup&&H(e,t),wi={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(vi(i,t))return o[t]=1,i[t];if(r!==O&&H(r,t))return o[t]=2,r[t];if((c=e.propsOptions[0])&&H(c,t))return o[t]=3,s[t];if(n!==O&&H(n,t))return o[t]=4,n[t];ki&&(o[t]=0)}}const d=yi[t];let u,h;return d?("$attrs"===t&&rt(e.attrs,0,""),d(e)):(u=a.__cssModules)&&(u=u[t])?u:n!==O&&H(n,t)?(o[t]=4,n[t]):(h=l.config.globalProperties,H(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return vi(r,t)?(r[t]=n,!0):i!==O&&H(i,t)?(i[t]=n,!0):!H(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:s,type:o}},a){let l,c;return!!(n[a]||e!==O&&"$"!==a[0]&&H(e,a)||vi(t,a)||(l=s[0])&&H(l,a)||H(i,a)||H(yi,a)||H(r.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:H(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function xi(e){return $(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let ki=!0;function Si(e){const t=Ai(e),n=e.proxy,i=e.ctx;ki=!1,t.beforeCreate&&Ci(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:p,updated:_,activated:f,deactivated:m,beforeDestroy:g,beforeUnmount:b,destroyed:y,unmounted:v,render:w,renderTracked:x,renderTriggered:k,errorCaptured:S,serverPrefetch:C,expose:M,inheritAttrs:A,components:T,directives:z,filters:P}=t;if(c&&function(e,t){$(e)&&(e=Ni(e));for(const n in e){const i=e[n];let r;r=X(i)?"default"in i?ji(i.from||n,i.default,!0):ji(i.from||n):ji(i),Xt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,i,null),o)for(const e in o){const t=o[e];U(t)&&(i[e]=t.bind(n))}if(r){0;const t=r.call(n,n);0,X(t)&&(e.data=Dt(t))}if(ki=!0,s)for(const e in s){const t=s[e],r=U(t)?t.bind(n,n):U(t.get)?t.get.bind(n,n):E;0;const o=!U(t)&&U(t.set)?t.set.bind(n):E,a=ws({get:r,set:o});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)Mi(a[e],i,n,e);if(l){const e=U(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(is){let n=is.provides;const i=is.parent&&is.parent.provides;i===n&&(n=is.provides=Object.create(i)),n[e]=t}else 0}(t,e[t])})}function N(e,t){$(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&Ci(d,e,"c"),N(ni,u),N(ii,h),N(ri,p),N(si,_),N(Yn,f),N(Xn,m),N(ui,S),N(di,x),N(ci,k),N(oi,b),N(ai,v),N(li,C),$(M))if(M.length){const t=e.exposed||(e.exposed={});M.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===E&&(e.render=w),null!=A&&(e.inheritAttrs=A),T&&(e.components=T),z&&(e.directives=z),C&&qn(e)}function Ci(e,t,n){un($(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Mi(e,t,n,i){let r=i.includes(".")?pr(n,i):()=>n[i];if(W(e)){const n=t[e];U(n)&&dr(r,n)}else if(U(e))dr(r,e.bind(n));else if(X(e))if($(e))e.forEach(e=>Mi(e,t,n,i));else{const i=U(e.handler)?e.handler.bind(n):t[e.handler];U(i)&&dr(r,i,e)}else 0}function Ai(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>Ti(l,e,o,!0)),Ti(l,t,o)):l=t,X(t)&&s.set(t,l),l}function Ti(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&Ti(e,s,n,!0),r&&r.forEach(t=>Ti(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=zi[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const zi={data:Pi,props:Li,emits:Li,methods:Oi,computed:Oi,beforeCreate:Ri,created:Ri,beforeMount:Ri,mounted:Ri,beforeUpdate:Ri,updated:Ri,beforeDestroy:Ri,beforeUnmount:Ri,destroyed:Ri,unmounted:Ri,activated:Ri,deactivated:Ri,errorCaptured:Ri,serverPrefetch:Ri,components:Oi,directives:Oi,watch:function(e,t){if(!e)return t;if(!t)return e;const n=j(Object.create(null),e);for(const i in t)n[i]=Ri(e[i],t[i]);return n},provide:Pi,inject:function(e,t){return Oi(Ni(e),Ni(t))}};function Pi(e,t){return t?e?function(){return j(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function Ni(e){if($(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ri(e,t){return e?[...new Set([].concat(e,t))]:t}function Oi(e,t){return e?j(Object.create(null),e,t):t}function Li(e,t){return e?$(e)&&$(t)?[...new Set([...e,...t])]:j(Object.create(null),xi(e),xi(null!=t?t:{})):t}function Ei(){return{app:null,config:{isNativeTag:I,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ii=0;function Di(e,t){return function(n,i=null){U(n)||(n=j({},n)),null==i||X(i)||(i=null);const r=Ei(),s=new WeakSet,o=[];let a=!1;const l=r.app={_uid:Ii++,_component:n,_props:i,_container:null,_context:r,_instance:null,version:xs,get config(){return r.config},set config(e){0},use:(e,...t)=>(s.has(e)||(e&&U(e.install)?(s.add(e),e.install(l,...t)):U(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,o,c){if(!a){0;const d=l._ceVNode||Gr(n,i);return d.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),o&&t?t(d,s):e(d,s,c),a=!0,l._container=s,s.__vue_app__=l,bs(d.component)}},onUnmount(e){o.push(e)},unmount(){a&&(un(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=Bi;Bi=l;try{return e()}finally{Bi=t}}};return l}}let Bi=null;function ji(e,t,n=!1){const i=rs();if(i||Bi){let r=Bi?Bi._context.provides:i?null==i.parent||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&U(t)?t.call(i&&i.proxy):t}else 0}const qi={},Fi=()=>Object.create(qi),Hi=e=>Object.getPrototypeOf(e)===qi;function $i(e,t,n,i){const[r,s]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(te(l))continue;const c=t[l];let d;r&&H(r,d=re(l))?s&&s.includes(d)?(o||(o={}))[d]=c:n[d]=c:br(e.emitsOptions,l)||l in i&&c===i[l]||(i[l]=c,a=!0)}if(s){const t=Vt(n),i=o||O;for(let o=0;o<s.length;o++){const a=s[o];n[a]=Gi(r,t,a,i[a],e,!H(i,a))}}return a}function Gi(e,t,n,i,r,s){const o=e[n];if(null!=o){const e=H(o,"default");if(e&&void 0===i){const e=o.default;if(o.type!==Function&&!o.skipFactory&&U(e)){const{propsDefaults:s}=r;if(n in s)i=s[n];else{const o=as(r);i=s[n]=e.call(null,t),o()}}else i=e;r.ce&&r.ce._setProp(n,i)}o[0]&&(s&&!e?i=!1:!o[1]||""!==i&&i!==oe(n)||(i=!0))}return i}const Vi=new WeakMap;function Ui(e,t,n=!1){const i=n?Vi:t.propsCache,r=i.get(e);if(r)return r;const s=e.props,o={},a=[];let l=!1;if(!U(e)){const i=e=>{l=!0;const[n,i]=Ui(e,t,!0);j(o,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!s&&!l)return X(e)&&i.set(e,L),L;if($(s))for(let e=0;e<s.length;e++){0;const t=re(s[e]);Wi(t)&&(o[t]=O)}else if(s){0;for(const e in s){const t=re(e);if(Wi(t)){const n=s[e],i=o[t]=$(n)||U(n)?{type:n}:j({},n),r=i.type;let l=!1,c=!0;if($(r))for(let e=0;e<r.length;++e){const t=r[e],n=U(t)&&t.name;if("Boolean"===n){l=!0;break}"String"===n&&(c=!1)}else l=U(r)&&"Boolean"===r.name;i[0]=l,i[1]=c,(l||H(i,"default"))&&a.push(t)}}}const c=[o,a];return X(e)&&i.set(e,c),c}function Wi(e){return"$"!==e[0]&&!te(e)}const Yi=e=>"_"===e||"_ctx"===e||"$stable"===e,Xi=e=>$(e)?e.map(Kr):[Kr(e)],Ki=(e,t,n)=>{if(t._n)return t;const i=Nn((...e)=>Xi(t(...e)),n);return i._c=!1,i},Ji=(e,t,n)=>{const i=e._ctx;for(const n in e){if(Yi(n))continue;const r=e[n];if(U(r))t[n]=Ki(0,r,i);else if(null!=r){0;const e=Xi(r);t[n]=()=>e}}},Qi=(e,t)=>{const n=Xi(t);e.slots.default=()=>n},Zi=(e,t,n)=>{for(const i in t)!n&&Yi(i)||(e[i]=t[i])};const er=Cr;function tr(e,t){_e().__VUE__=!0;const{insert:n,remove:i,patchProp:r,createElement:s,createText:o,createComment:a,setText:l,setElementText:c,parentNode:d,nextSibling:u,setScopeId:h=E,insertStaticContent:p}=e,_=(e,t,n,i=null,r=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!qr(e,t)&&(i=V(e),j(e,r,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Ar:f(e,t,n,i);break;case Tr:m(e,t,n,i);break;case zr:null==e&&g(t,n,i,o);break;case Mr:M(e,t,n,i,r,s,o,a,l);break;default:1&u?y(e,t,n,i,r,s,o,a,l):6&u?A(e,t,n,i,r,s,o,a,l):(64&u||128&u)&&c.process(e,t,n,i,r,s,o,a,l,Y)}null!=d&&r?$n(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&$n(e.ref,null,s,e,!0)},f=(e,t,i,r)=>{if(null==e)n(t.el=o(t.children),i,r);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},m=(e,t,i,r)=>{null==e?n(t.el=a(t.children||""),i,r):t.el=e.el},g=(e,t,n,i)=>{[e.el,e.anchor]=p(e.children,t,n,i,e.el,e.anchor)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=u(e),i(e),e=n;i(t)},y=(e,t,n,i,r,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?v(t,n,i,r,s,o,a,l):k(e,t,r,s,o,a,l)},v=(e,t,i,o,a,l,d,u)=>{let h,p;const{props:_,shapeFlag:f,transition:m,dirs:g}=e;if(h=e.el=s(e.type,l,_&&_.is,_),8&f?c(h,e.children):16&f&&x(e.children,h,null,o,a,nr(e,l),d,u),g&&On(e,null,o,"created"),w(h,e,e.scopeId,d,o),_){for(const e in _)"value"===e||te(e)||r(h,e,null,_[e],l,o);"value"in _&&r(h,"value",null,_.value,l),(p=_.onVnodeBeforeMount)&&Zr(p,o,e)}g&&On(e,null,o,"beforeMount");const b=rr(a,m);b&&m.beforeEnter(h),n(h,t,i),((p=_&&_.onVnodeMounted)||b||g)&&er(()=>{p&&Zr(p,o,e),b&&m.enter(h),g&&On(e,null,o,"mounted")},a)},w=(e,t,n,i,r)=>{if(n&&h(e,n),i)for(let t=0;t<i.length;t++)h(e,i[t]);if(r){let n=r.subTree;if(t===n||Sr(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;w(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},x=(e,t,n,i,r,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Jr(e[c]):Kr(e[c]);_(null,l,t,n,i,r,s,o,a)}},k=(e,t,n,i,s,o,a)=>{const l=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const p=e.props||O,_=t.props||O;let f;if(n&&ir(n,!1),(f=_.onVnodeBeforeUpdate)&&Zr(f,n,t,e),h&&On(t,e,n,"beforeUpdate"),n&&ir(n,!0),(p.innerHTML&&null==_.innerHTML||p.textContent&&null==_.textContent)&&c(l,""),u?S(e.dynamicChildren,u,l,n,i,nr(t,s),o):a||R(e,t,l,null,n,i,nr(t,s),o,!1),d>0){if(16&d)C(l,p,_,n,s);else if(2&d&&p.class!==_.class&&r(l,"class",null,_.class,s),4&d&&r(l,"style",p.style,_.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const i=e[t],o=p[i],a=_[i];a===o&&"value"!==i||r(l,i,o,a,s,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else a||null!=u||C(l,p,_,n,s);((f=_.onVnodeUpdated)||h)&&er(()=>{f&&Zr(f,n,t,e),h&&On(t,e,n,"updated")},i)},S=(e,t,n,i,r,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],u=l.el&&(l.type===Mr||!qr(l,c)||198&l.shapeFlag)?d(l.el):n;_(l,c,u,null,i,r,s,o,!0)}},C=(e,t,n,i,s)=>{if(t!==n){if(t!==O)for(const o in t)te(o)||o in n||r(e,o,t[o],null,s,i);for(const o in n){if(te(o))continue;const a=n[o],l=t[o];a!==l&&"value"!==o&&r(e,o,l,a,s,i)}"value"in n&&r(e,"value",t.value,n.value,s)}},M=(e,t,i,r,s,a,l,c,d)=>{const u=t.el=e?e.el:o(""),h=t.anchor=e?e.anchor:o("");let{patchFlag:p,dynamicChildren:_,slotScopeIds:f}=t;f&&(c=c?c.concat(f):f),null==e?(n(u,i,r),n(h,i,r),x(t.children||[],i,h,s,a,l,c,d)):p>0&&64&p&&_&&e.dynamicChildren?(S(e.dynamicChildren,_,i,s,a,l,c),(null!=t.key||s&&t===s.subTree)&&sr(e,t,!0)):R(e,t,i,h,s,a,l,c,d)},A=(e,t,n,i,r,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,l):T(t,n,i,r,s,o,l):z(e,t,l)},T=(e,t,n,i,r,s,o)=>{const a=e.component=ns(e,i,r);if(Un(e)&&(a.ctx.renderer=Y),ps(a,!1,o),a.asyncDep){if(r&&r.registerDep(a,P,o),!e.el){const i=a.subTree=Gr(Tr);m(null,i,t,n),e.placeholder=i.el}}else P(a,e,t,n,r,s,o)},z=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;0;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==o&&(i?!o||xr(i,o,c):!!o);if(1024&l)return!0;if(16&l)return i?xr(i,o,c):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==i[n]&&!br(c,n))return!0}}return!1}(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void N(i,t,n);i.next=t,i.update()}else t.el=e.el,i.vnode=t},P=(e,t,n,i,r,s,o)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:c}=e;{const n=or(e);if(n)return t&&(t.el=c.el,N(e,t,o)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let u,h=t;0,ir(e,!1),t?(t.el=c.el,N(e,t,o)):t=c,n&&de(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Zr(u,l,t,c),ir(e,!0);const p=yr(e);0;const f=e.subTree;e.subTree=p,_(f,p,d(f.el),V(f),e,r,s),t.el=p.el,null===h&&kr(e,p.el),i&&er(i,r),(u=t.props&&t.props.onVnodeUpdated)&&er(()=>Zr(u,l,t,c),r)}else{let o;const{el:a,props:l}=t,{bm:c,m:d,parent:u,root:h,type:p}=e,f=Vn(t);if(ir(e,!1),c&&de(c),!f&&(o=l&&l.onVnodeBeforeMount)&&Zr(o,u,t),ir(e,!0),a&&K){const t=()=>{e.subTree=yr(e),K(a,e.subTree,e,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{h.ce&&!1!==h.ce._def.shadowRoot&&h.ce._injectChildStyle(p);const o=e.subTree=yr(e);0,_(null,o,n,i,e,r,s),t.el=o.el}if(d&&er(d,r),!f&&(o=l&&l.onVnodeMounted)){const e=t;er(()=>Zr(o,u,e),r)}(256&t.shapeFlag||u&&Vn(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&er(e.a,r),e.isMounted=!0,t=n=i=null}};e.scope.on();const l=e.effect=new Re(a);e.scope.off();const c=e.update=l.run.bind(l),u=e.job=l.runIfDirty.bind(l);u.i=e,u.id=e.uid,l.scheduler=()=>wn(u),ir(e,!0),c()},N=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=Vt(r),[l]=e.propsOptions;let c=!1;if(!(i||o>0)||16&o){let i;$i(e,t,r,s)&&(c=!0);for(const s in a)t&&(H(t,s)||(i=oe(s))!==s&&H(t,i))||(l?!n||void 0===n[s]&&void 0===n[i]||(r[s]=Gi(l,a,s,void 0,e,!0)):delete r[s]);if(s!==a)for(const e in s)t&&H(t,e)||(delete s[e],c=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let o=n[i];if(br(e.emitsOptions,o))continue;const d=t[o];if(l)if(H(s,o))d!==s[o]&&(s[o]=d,c=!0);else{const t=re(o);r[t]=Gi(l,a,t,d,e,!1)}else d!==s[o]&&(s[o]=d,c=!0)}}c&&st(e.attrs,"set","")}(e,t.props,i,n),((e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=O;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:Zi(r,t,n):(s=!t.$stable,Ji(t,r)),o=t}else t&&(Qi(e,t),o={default:1});if(s)for(const e in r)Yi(e)||null!=o[e]||delete r[e]})(e,t.children,n),We(),Sn(e),Ye()},R=(e,t,n,i,r,s,o,a,l=!1)=>{const d=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:_}=t;if(p>0){if(128&p)return void D(d,h,n,i,r,s,o,a,l);if(256&p)return void I(d,h,n,i,r,s,o,a,l)}8&_?(16&u&&G(d,r,s),h!==d&&c(n,h)):16&u?16&_?D(d,h,n,i,r,s,o,a,l):G(d,r,s,!0):(8&u&&c(n,""),16&_&&x(h,n,i,r,s,o,a,l))},I=(e,t,n,i,r,s,o,a,l)=>{t=t||L;const c=(e=e||L).length,d=t.length,u=Math.min(c,d);let h;for(h=0;h<u;h++){const i=t[h]=l?Jr(t[h]):Kr(t[h]);_(e[h],i,n,null,r,s,o,a,l)}c>d?G(e,r,s,!0,!1,u):x(t,n,i,r,s,o,a,l,u)},D=(e,t,n,i,r,s,o,a,l)=>{let c=0;const d=t.length;let u=e.length-1,h=d-1;for(;c<=u&&c<=h;){const i=e[c],d=t[c]=l?Jr(t[c]):Kr(t[c]);if(!qr(i,d))break;_(i,d,n,null,r,s,o,a,l),c++}for(;c<=u&&c<=h;){const i=e[u],c=t[h]=l?Jr(t[h]):Kr(t[h]);if(!qr(i,c))break;_(i,c,n,null,r,s,o,a,l),u--,h--}if(c>u){if(c<=h){const e=h+1,u=e<d?t[e].el:i;for(;c<=h;)_(null,t[c]=l?Jr(t[c]):Kr(t[c]),n,u,r,s,o,a,l),c++}}else if(c>h)for(;c<=u;)j(e[c],r,s,!0),c++;else{const p=c,f=c,m=new Map;for(c=f;c<=h;c++){const e=t[c]=l?Jr(t[c]):Kr(t[c]);null!=e.key&&m.set(e.key,c)}let g,b=0;const y=h-f+1;let v=!1,w=0;const x=new Array(y);for(c=0;c<y;c++)x[c]=0;for(c=p;c<=u;c++){const i=e[c];if(b>=y){j(i,r,s,!0);continue}let d;if(null!=i.key)d=m.get(i.key);else for(g=f;g<=h;g++)if(0===x[g-f]&&qr(i,t[g])){d=g;break}void 0===d?j(i,r,s,!0):(x[d-f]=c+1,d>=w?w=d:v=!0,_(i,t[d],n,null,r,s,o,a,l),b++)}const k=v?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(r=n[n.length-1],e[r]<l){t[i]=r,n.push(i);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<l?s=a+1:o=a;l<e[n[s]]&&(s>0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(x):L;for(g=k.length-1,c=y-1;c>=0;c--){const e=f+c,u=t[e],h=t[e+1],p=e+1<d?h.el||h.placeholder:i;0===x[c]?_(null,u,n,p,r,s,o,a,l):v&&(g<0||c!==k[g]?B(u,n,p,2):g--)}}},B=(e,t,r,s,o=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:h}=e;if(6&h)return void B(e.component.subTree,t,r,s);if(128&h)return void e.suspense.move(t,r,s);if(64&h)return void l.move(e,t,r,Y);if(l===Mr){n(a,t,r);for(let e=0;e<d.length;e++)B(d[e],t,r,s);return void n(e.anchor,t,r)}if(l===zr)return void(({el:e,anchor:t},i,r)=>{let s;for(;e&&e!==t;)s=u(e),n(e,i,r),e=s;n(t,i,r)})(e,t,r);if(2!==s&&1&h&&c)if(0===s)c.beforeEnter(a),n(a,t,r),er(()=>c.enter(a),o);else{const{leave:s,delayLeave:o,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?i(a):n(a,t,r)},u=()=>{a._isLeaving&&a[In](!0),s(a,()=>{d(),l&&l()})};o?o(a,d,u):u()}else n(a,t,r)},j=(e,t,n,i=!1,r=!1)=>{const{type:s,props:o,ref:a,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h,cacheIndex:p}=e;if(-2===u&&(r=!1),null!=a&&(We(),$n(a,null,n,e,!0),Ye()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const _=1&d&&h,f=!Vn(e);let m;if(f&&(m=o&&o.onVnodeBeforeUnmount)&&Zr(m,t,e),6&d)$(e.component,n,i);else{if(128&d)return void e.suspense.unmount(n,i);_&&On(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,Y,i):c&&!c.hasOnce&&(s!==Mr||u>0&&64&u)?G(c,t,n,!1,!0):(s===Mr&&384&u||!r&&16&d)&&G(l,t,n),i&&q(e)}(f&&(m=o&&o.onVnodeUnmounted)||_)&&er(()=>{m&&Zr(m,t,e),_&&On(e,null,t,"unmounted")},n)},q=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===Mr)return void F(n,r);if(t===zr)return void b(e);const o=()=>{i(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},F=(e,t)=>{let n;for(;e!==t;)n=u(e),i(e),e=n;i(t)},$=(e,t,n)=>{const{bum:i,scope:r,job:s,subTree:o,um:a,m:l,a:c}=e;ar(l),ar(c),i&&de(i),r.stop(),s&&(s.flags|=8,j(o,e,t,n)),a&&er(a,t),er(()=>{e.isUnmounted=!0},t)},G=(e,t,n,i=!1,r=!1,s=0)=>{for(let o=s;o<e.length;o++)j(e[o],t,n,i,r)},V=e=>{if(6&e.shapeFlag)return V(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[Ln];return n?u(n):t};let U=!1;const W=(e,t,n)=>{null==e?t._vnode&&j(t._vnode,null,null,!0):_(t._vnode||null,e,t,null,null,null,n),t._vnode=e,U||(U=!0,Sn(),Cn(),U=!1)},Y={p:_,um:j,m:B,r:q,mt:T,mc:x,pc:R,pbc:S,n:V,o:e};let X,K;return t&&([X,K]=t(Y)),{render:W,hydrate:X,createApp:Di(W,X)}}function nr({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ir({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function rr(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function sr(e,t,n=!1){const i=e.children,r=t.children;if($(i)&&$(r))for(let e=0;e<i.length;e++){const t=i[e];let s=r[e];1&s.shapeFlag&&!s.dynamicChildren&&((s.patchFlag<=0||32===s.patchFlag)&&(s=r[e]=Jr(r[e]),s.el=t.el),n||-2===s.patchFlag||sr(t,s)),s.type===Ar&&-1!==s.patchFlag&&(s.el=t.el),s.type!==Tr||s.el||(s.el=t.el)}}function or(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:or(t)}function ar(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const lr=Symbol.for("v-scx"),cr=()=>{{const e=ji(lr);return e}};function dr(e,t,n){return ur(e,t,n)}function ur(e,t,n=O){const{immediate:i,deep:r,flush:s,once:o}=n;const a=j({},n);const l=t&&i||!t&&"post"!==s;let c;if(hs)if("sync"===s){const e=cr();c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=E,e.resume=E,e.pause=E,e}const d=is;a.call=(e,t,n)=>un(e,d,t,n);let u=!1;"post"===s?a.scheduler=e=>{er(e,d&&d.suspense)}:"sync"!==s&&(u=!0,a.scheduler=(e,t)=>{t?e():wn(e)}),a.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const h=ln(e,t,a);return hs&&(c?c.push(h):l&&h()),h}function hr(e,t,n){const i=this.proxy,r=W(e)?e.includes(".")?pr(i,e):()=>i[e]:e.bind(i,i);let s;U(t)?s=t:(s=t.handler,n=t);const o=as(this),a=ur(r,s.bind(i),n);return o(),a}function pr(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const _r=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${re(t)}Modifiers`]||e[`${oe(t)}Modifiers`];function fr(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||O;let r=n;const s=t.startsWith("update:"),o=s&&_r(i,t.slice(7));let a;o&&(o.trim&&(r=n.map(e=>W(e)?e.trim():e)),o.number&&(r=n.map(he)));let l=i[a=le(t)]||i[a=le(re(t))];!l&&s&&(l=i[a=le(oe(t))]),l&&un(l,e,6,r);const c=i[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,un(c,e,6,r)}}const mr=new WeakMap;function gr(e,t,n=!1){const i=n?mr:t.emitsCache,r=i.get(e);if(void 0!==r)return r;const s=e.emits;let o={},a=!1;if(!U(e)){const i=e=>{const n=gr(e,t,!0);n&&(a=!0,j(o,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||a?($(s)?s.forEach(e=>o[e]=null):j(o,s),X(e)&&i.set(e,o),o):(X(e)&&i.set(e,null),null)}function br(e,t){return!(!e||!D(t))&&(t=t.slice(2).replace(/Once$/,""),H(e,t[0].toLowerCase()+t.slice(1))||H(e,oe(t))||H(e,t))}function yr(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:d,props:u,data:h,setupState:p,ctx:_,inheritAttrs:f}=e,m=Pn(e);let g,b;try{if(4&n.shapeFlag){const e=r||i,t=e;g=Kr(c.call(t,e,d,u,p,h,_)),b=a}else{const e=t;0,g=Kr(e.length>1?e(u,{attrs:a,slots:o,emit:l}):e(u,null)),b=t.props?a:vr(a)}}catch(t){Pr.length=0,hn(t,e,1),g=Gr(Tr)}let y=g;if(b&&!1!==f){const e=Object.keys(b),{shapeFlag:t}=y;e.length&&7&t&&(s&&e.some(B)&&(b=wr(b,s)),y=Ur(y,b,!1,!0))}return n.dirs&&(y=Ur(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Bn(y,n.transition),g=y,Pn(m),g}const vr=e=>{let t;for(const n in e)("class"===n||"style"===n||D(n))&&((t||(t={}))[n]=e[n]);return t},wr=(e,t)=>{const n={};for(const i in e)B(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function xr(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(t[s]!==e[s]&&!br(n,s))return!0}return!1}function kr({vnode:e,parent:t},n){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.el=e.el),i!==e)break;(e=t.vnode).el=n,t=t.parent}}const Sr=e=>e.__isSuspense;function Cr(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):kn(e)}const Mr=Symbol.for("v-fgt"),Ar=Symbol.for("v-txt"),Tr=Symbol.for("v-cmt"),zr=Symbol.for("v-stc"),Pr=[];let Nr=null;function Rr(e=!1){Pr.push(Nr=e?null:[])}function Or(){Pr.pop(),Nr=Pr[Pr.length-1]||null}let Lr=1;function Er(e,t=!1){Lr+=e,e<0&&Nr&&t&&(Nr.hasOnce=!0)}function Ir(e){return e.dynamicChildren=Lr>0?Nr||L:null,Or(),Lr>0&&Nr&&Nr.push(e),e}function Dr(e,t,n,i,r,s){return Ir($r(e,t,n,i,r,s,!0))}function Br(e,t,n,i,r){return Ir(Gr(e,t,n,i,r,!0))}function jr(e){return!!e&&!0===e.__v_isVNode}function qr(e,t){return e.type===t.type&&e.key===t.key}const Fr=({key:e})=>null!=e?e:null,Hr=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?W(e)||Xt(e)||U(e)?{i:Tn,r:e,k:t,f:!!n}:e:null);function $r(e,t=null,n=null,i=0,r=null,s=(e===Mr?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fr(t),ref:t&&Hr(t),scopeId:zn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Tn};return a?(Qr(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=W(n)?8:16),Lr>0&&!o&&Nr&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&Nr.push(l),l}const Gr=Vr;function Vr(e,t=null,n=null,i=0,r=null,s=!1){if(e&&e!==pi||(e=Tr),jr(e)){const i=Ur(e,t,!0);return n&&Qr(i,n),Lr>0&&!s&&Nr&&(6&i.shapeFlag?Nr[Nr.indexOf(e)]=i:Nr.push(i)),i.patchFlag=-2,i}if(vs(e)&&(e=e.__vccOpts),t){t=function(e){return e?Gt(e)||Hi(e)?j({},e):e:null}(t);let{class:e,style:n}=t;e&&!W(e)&&(t.class=ve(e)),X(n)&&(Gt(n)&&!$(n)&&(n=j({},n)),t.style=fe(n))}return $r(e,t,n,i,r,W(e)?1:Sr(e)?128:En(e)?64:X(e)?4:U(e)?2:0,s,!0)}function Ur(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=ve([t.class,i.class]));else if("style"===e)t.style=fe([t.style,i.style]);else if(D(e)){const n=t[e],r=i[e];!r||n===r||$(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=i[e])}return t}(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Fr(c),ref:t&&t.ref?n&&s?$(s)?s.concat(Hr(t)):[s,Hr(t)]:Hr(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Mr?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ur(e.ssContent),ssFallback:e.ssFallback&&Ur(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Bn(d,l.clone(d)),d}function Wr(e=" ",t=0){return Gr(Ar,null,e,t)}function Yr(e,t){const n=Gr(zr,null,e);return n.staticCount=t,n}function Xr(e="",t=!1){return t?(Rr(),Br(Tr,null,e)):Gr(Tr,null,e)}function Kr(e){return null==e||"boolean"==typeof e?Gr(Tr):$(e)?Gr(Mr,null,e.slice()):jr(e)?Jr(e):Gr(Ar,null,String(e))}function Jr(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ur(e)}function Qr(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if($(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),Qr(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||Hi(t)?3===i&&Tn&&(1===Tn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Tn}}else U(t)?(t={default:t,_ctx:Tn},n=32):(t=String(t),64&i?(n=16,t=[Wr(t)]):n=8);e.children=t,e.shapeFlag|=n}function Zr(e,t,n,i=null){un(e,t,7,[n,i])}const es=Ei();let ts=0;function ns(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||es,s={uid:ts++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Pe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ui(i,r),emitsOptions:gr(i,r),emit:null,emitted:null,propsDefaults:O,inheritAttrs:i.inheritAttrs,ctx:O,data:O,props:O,attrs:O,slots:O,refs:O,setupState:O,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=fr.bind(null,s),e.ce&&e.ce(s),s}let is=null;const rs=()=>is||Tn;let ss,os;{const e=_e(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};ss=t("__VUE_INSTANCE_SETTERS__",e=>is=e),os=t("__VUE_SSR_SETTERS__",e=>hs=e)}const as=e=>{const t=is;return ss(e),e.scope.on(),()=>{e.scope.off(),ss(t)}},ls=()=>{is&&is.scope.off(),ss(null)};function cs(e){return 4&e.vnode.shapeFlag}let ds,us,hs=!1;function ps(e,t=!1,n=!1){t&&os(t);const{props:i,children:r}=e.vnode,s=cs(e);!function(e,t,n,i=!1){const r={},s=Fi();e.propsDefaults=Object.create(null),$i(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:Bt(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,i,s,t),((e,t,n)=>{const i=e.slots=Fi();if(32&e.vnode.shapeFlag){const e=t._;e?(Zi(i,t,n),n&&ue(i,"_",e,!0)):Ji(t,i)}else t&&Qi(e,t)})(e,r,n||t);const o=s?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wi),!1;const{setup:i}=n;if(i){We();const n=e.setupContext=i.length>1?gs(e):null,r=as(e),s=dn(i,e,0,[e.props,n]),o=K(s);if(Ye(),r(),!o&&!e.sp||Vn(e)||qn(e),o){if(s.then(ls,ls),t)return s.then(n=>{_s(e,n,t)}).catch(t=>{hn(t,e,0)});e.asyncDep=s}else _s(e,s,t)}else fs(e,t)}(e,t):void 0;return t&&os(!1),o}function _s(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:X(t)&&(e.setupState=nn(t)),fs(e,n)}function fs(e,t,n){const i=e.type;if(!e.render){if(!t&&ds&&!i.render){const t=i.template||Ai(e).template;if(t){0;const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:o}=i,a=j(j({isCustomElement:n,delimiters:s},r),o);i.render=ds(t,a)}}e.render=i.render||E,us&&us(e)}{const t=as(e);We();try{Si(e)}finally{Ye(),t()}}}const ms={get:(e,t)=>(rt(e,0,""),e[t])};function gs(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,ms),slots:e.slots,emit:e.emit,expose:t}}function bs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(nn(Ut(e.exposed)),{get:(t,n)=>n in t?t[n]:n in yi?yi[n](e):void 0,has:(e,t)=>t in e||t in yi})):e.proxy}function ys(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}function vs(e){return U(e)&&"__vccOpts"in e}const ws=(e,t)=>{const n=function(e,t,n=!1){let i,r;return U(e)?i=e:(i=e.get,r=e.set),new rn(i,r,n)}(e,0,hs);return n};const xs="3.5.21";class ks{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof pd)return e}get courier(){return this.root.courier}get history(){return this.root.history}get cursor(){return this.root.cursor}get event(){return this.root.event}get listener(){return this.root.listener}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get config(){return this.root.config}get stats(){return this.root.stats}get hotkeys(){return this.root.hotkeys}constructor(e){this._root=e}}class Ss{static _funcs=new Map;static get url(){return this._funcs.get("asset-url")}static get tips(){return this._funcs.get("tip")}static register_asset_url(e){this._funcs.set("asset-url",e)}static register_tip(e){this._funcs.set("tip",e)}}let Cs=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};class Ms{_cubes=new Map;_versions={};_note;init(e){this.register_cube_core();const t=structuredClone(e.versions||{});return this._versions=Object.freeze(t),e.type===n.doc?this._note=new pd(e):e.type===n.map?this._note=new hu(e):console.error(`NoteMeta: unrecognized note type ${e}`),this._note}get note(){return this._note}get clipboard(){return this._note?.clipboard}get courier(){return this._note?.courier}get history(){return this._note?.history}get cursor(){return this._note?.cursor}get event(){return this._note?.event}get listener(){return this._note?.listener}get painter(){return this._note?.painter}get cubes(){return this._note?.cubes}get config(){return this._note?.config}get stats(){return this._note?.stats}get hotkeys(){return this._note?.hotkeys}get versions(){const e=this.clipboard?.pasted_from?.versions;return e||this._versions}get metas(){const e=new Map;for(let[t,n]of this._cubes)e.set(t,n.meta);return e}register_cube(e){const t=e.meta;t||console.error(`NoteMeta: can't find member meta in ${e}`),this._cubes.set(t.type,e)}find_cube(e){return this._cubes.get(e)}export_versions(){const e={[pd.meta.type]:pd.meta.version,[hu.meta.type]:hu.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}get_sdk_meta(){return{version:"1.118.4",time_publish:1771153066824}}register_cube_core(){this.register_cube(rd),this.register_cube(gd),this.register_cube(gc),this.register_cube(Qc),this.register_cube(jc),this.register_cube(Rc),this.register_cube(Yc),this.register_cube(Hu),this.register_cube(Ku),this.register_cube(Du),this.register_cube(hx),this.register_cube(zu),this.register_cube(sx),this.register_cube(Hw),this.register_cube(Dm),this.register_cube(yu),this.register_cube(kd),this.register_cube(zd),this.register_cube(ou),this.register_cube(Ld),this.register_cube(Ex),this.register_cube(zx),this.register_cube(Fx)}}const As=new Ms;class Ts{static insert_child(e,t,n){return{id:e,name:w.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,i=!1){return{id:e,name:w.cube_delete_child,dir:t,range:n,reserve:i}}static insert(e,t,n,i,r,s){return{id:e,name:w.cube_insert,data:t,start_id:n,end_id:i,offset_end:s,offset_start:r}}static delete(e,t,n,i,r,s,o=!1){return{id:e,name:w.cube_delete,dir:t,start_id:n,end_id:i,offset_start:r,offset_end:s,reserve:o}}static delete_adjacent(e,t,n,i){return{id:e,name:w.cube_delete_adjacent,from:t,offset:i,from_id:n}}static set_selection_css(e,t,n,i,r,s,o=!1,a=!1){return{id:e,name:w.cube_set_selection_css,css:t,start_id:n,end_id:i,offset_start:r,offset_end:s,toggle:o,replace:a}}static set_css(e,t,n=!1,i=!1){return{id:e,name:w.cube_set_css,css:t,toggle:n,replace:i}}static partition(e,t,n,i,r){return{name:w.cube_partition,id:e,start_id:t,end_id:n,offset_start:i,offset_end:r}}static reorder(e,t,n){return{id:e,name:w.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:w.cube_reset,data:t}}static merge(e,t,n,i){return{id:e,name:w.cube_merge,method:t,cubeid:n,offset:i}}static postil_add(e,t=[]){return{name:w.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:w.cube_postil_remove,id:e,range:t}}static set_attr(e,t){return{id:e,name:w.cube_set_attr,attr:t}}static resize(e,t,n=-1){return n>0?this.set_attr(e,{width:t,height:n}):this.set_attr(e,{width:t})}static fold(e,t){return this.set_attr(e,{fold:t})}}class zs{static loc(e,t,n,i){return{name:x.loc,id:e,from:n,from_offset:i,offset:t}}static in_head(e){return{id:e,name:x.cursor_in_head}}static in_tail(e){return{id:e,name:x.cursor_in_tail}}}class Ps{handler=new Map;handler_vip=new Map;constructor(){}on(e){const t=this.get_cmd_handler_vip(e.name)||this.get_cmd_handler(e.name);if(t)return t(e)}get_cmd_handler(e){return this.handler.get(e)}get_cmd_handler_vip(e){return this.handler_vip.get(e)}set_cmd_handler(e,t){this.handler.set(e,t)}set_cmd_handler_vip(e,t){this.handler_vip.set(e,t)}event_capture(e){return{stop:!1}}event_bubble(e){return{stop:!1}}static get_default(...e){throw Error("sub-cube have't implement get_default method")}static get meta(){throw Error("sub-cube have't implement attribution meta")}}const Ns=new Map;class Rs{static get_cmd_handler(e,t){const n=Ns.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=Ns.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),Ns.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=Ns.get(t.type);if(n)for(let[t,i]of n)e.set_cmd_handler_vip(t,i.bind(e))}}function Os(e){return(t,n)=>{const i=t[n];if(!i)return;const r=t.meta;Rs.set_cmd_handler(r.type,e,i)}}class Ls extends ks{timer_float_check=!1;constructor(e){super(e),this.listen()}listen(){this.listen_esc()}listen_esc(){this.event.on_esc(()=>{const e=this.root.cubes.postils;for(let[t,n]of e)n.show&&(n.show=!1);this.root instanceof hu&&this.root.clear_node_editing();const t=this.root.cubes.get_types_cube(n.submap);for(let[e,n]of t)n.clear_node_editing()})}check_float(){const{stats:e,cubes:t}=this.root;this.timer_float_check||requestAnimationFrame(()=>{let e=!0;for(let t of this.root.scopes.scopes)e=!1,t.update_area();for(let[n,i]of t.postils)i.show&&(e=!1,i.update_pos());e||this.check_float()})}}class Es extends ks{_map=Bt({});_types=Bt(new Map);_count=Bt({});constructor(e){super(e)}get postils(){return this._types.get(n.postil)||new Map}get meta(){return Es.meta}get_types_cube(e){return this._types.get(e)||new Map}add_cube(e){const t=e.id,n=e.meta.type;void 0===this._count[t]?this._count[t]=1:this._count[t]++,this._map[t]=e;const i=this._types.get(n);i?i.set(t,e):this._types.set(n,Bt(new Map([[t,e]])))}remove_cube(e){const t=e.id,n=e.meta.type;0===--this._count[t]&&(delete this._map[t],this._types.get(n)?.delete(t))}find_cube(e){return this._map[e]}find_postil(e){for(let t of Object.values(this.postils)){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}clear_all_map_selected(){const e=this.get_types_cube(n.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof hu&&this.root.clear_node_selected()}static get meta(){return{type:t.cubes,version:1}}}class Is{static node_add(e,t){return{id:e,name:k.node_add,data:t}}static node_remove(e,t){return{id:e,name:k.node_remove,data:t}}static linker_add(e,t){return{id:e,name:k.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:k.linker_remove,data:t}}static update_attr(e,t){return{id:e,name:k.update_attrs,data:t}}}class Ds{static layout_change(e,t){return{id:e,name:S.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:S.append_child,previd:t}}}function Bs(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const js=new Map;function qs(e){return(t,n)=>{let i=t[n];js.set(e,i)}}class Fs extends ks{handlers=Dt(new Map);data;get meta(){return Fs.meta}constructor(e){super(e),this.data=Dt(Fs.default_hotkeys)}listen(e){this.listen_cursor_hotkey(e),this.listen_uncursor_hotkey(e),this.listen_cvx(e)}listen_cursor_hotkey(e){const t=this;e.addEventListener("keydown",e=>{const n=t.stats.mode,i=e.key.toLowerCase(),r=document.activeElement;let s=!1;if(n===A.edit&&r!==document.body){for(let[n,i]of js){let r=t.data[n];r.cursor&&(t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i.bind(t)(e)))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor&&(t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),s=!0,i(e)))}if(!s&&"tab"===i){s=!0;const{cursor:t,courier:n,history:i}=this,{cube_end:r,cube_start:o,offset_start:a,offset_end:l,has_selection:c,cube_selection:d}=t,u=n.get_recorder();if(!d||!r||!o)return;e.preventDefault(),c&&u.tell(d,Ts.delete(d.id,"backward",o.id,r.id,a,l,!0));const h=o.text,p=h.slice(0,a)+"\t"+h.slice(a),_=ed.reset(o.id,p),f=zs.loc(o.id,a+1,o.id,l);u.tell(o,_,f),i.record(u)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,i=document.activeElement,r=[P.down,P.left,P.right,P.up],s=e.key.toLowerCase();this.root;let o=!1;if(this.cursor.cube_end||i===document.body){for(let[n,i]of js){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i.bind(t)(e))}for(let[n,i]of t.handlers){let r=t.data[n];r.cursor||t.validate(e,r)&&(console.log("🟪命中快捷键",r.name),o=!0,i(e))}}o||i!==document.body||n!==A.edit||(" "===s?this.listen_map_space(e):"backspace"===s||"delete"===s?this.listen_map_delete(e):"enter"===s?this.listen_map_enter(e):"tab"===s?this.listen_map_tab(e):r.includes(s)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,i=e.key.toLowerCase(),r=this.cubes.get_types_cube(n.submap),s=[P.down,P.left,P.right,P.up];if(t instanceof hu&&t.nodes_selected.size>0)s.includes(i)&&t.move_select(i);else for(let[e,t]of r)t.move_select(i)}listen_map_delete(e){const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof hu){const e=[...this.root.nodes_selected].map(e=>e.id);r.tell(this.root,Is.node_remove(this.root.id,e))}const s=this.cubes.get_types_cube(n.submap);for(let[e,t]of s){const e=[...t.nodes_selected].map(e=>e.id);r.tell(t,Is.node_remove(t.id,e))}i.record(r)}listen_map_enter(e){const{courier:t,history:i}=this,r=t.get_recorder();let s=!1;if(this.root instanceof hu){const t=this.root.nodes_selected;for(let n of t){const t=n.env.upstream;if(!t){s=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const o=Ds.append_child(t.id,i);r.tell(t,o)}}const o=this.cubes.get_types_cube(n.submap);for(let[t,n]of o){const t=n.get_nodes_selected();for(let n of t){const t=n.env.upstream;if(!t){s=!0;continue}let i=n.id;e.shiftKey&&(i=n.env.prev_node?.id||null);const o=Ds.append_child(t.id,i);r.tell(t,o)}}s&&Ss.tips?.tip_warning("无法在没有布局上游的节点添加同级"),i.record(r)}listen_map_tab(e){e.preventDefault();const{courier:t,history:i}=this,r=t.get_recorder();if(this.root instanceof hu){const e=this.root.nodes_selected;for(let t of e){const e=Ds.append_child(t.id);r.tell(t,e)}}const s=this.cubes.get_types_cube(n.submap);for(let[e,t]of s){const e=t.get_nodes_selected();for(let t of e){const e=Ds.append_child(t.id);r.tell(t,e)}}i.record(r)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof hu){const e=t.nodes_selected;for(let t of e)t.editable=!0}const i=t.cubes.get_types_cube(n.submap);for(let[e,t]of i){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof hu&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof rd&&t){e.preventDefault();const n=await this.clipboard.paste(t);this.history.record(n)}}),t.addEventListener("copy",e=>{const t=e.clipboardData,{doc:n,hotkeys:i,cursor:r}=this;t&&(this.root.scopes.scope_count_normal>0||r.has_selection||r.cube_end instanceof rd)&&(e.preventDefault(),this.clipboard.copy(t))}),t.addEventListener("cut",e=>{const t=e.clipboardData,{root:n,cursor:i}=this;t&&(n.scopes.scope_count_normal>0||i.cube_end instanceof rd)&&(e.preventDefault(),this.clipboard.cut(t))})}register(e,t){this.data[t.name]=t,this.handlers.set(t.name,e)}reset(e){Object.assign(this.data,e)}reset_handler(e,t){this.handlers.set(e,t)}export(){return structuredClone(Vt(this.data))}update_data(...e){return{}}validate(e,t){return t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&t.ctrl===e.ctrlKey&&(0===t.key.length||t.key.includes(e.key.toLocaleLowerCase()))}which(e){for(let t of Object.values(this.data))if(this.validate(e,t))return t}validate_hotkeys(e){for(let t of Object.values(this.data))if(this.validate(e,t))return!0;return!1}get_hotkey_str(e){const t=this.data[e];if(!t)return"";let n="";return t.meta&&(n+="meta + "),t.ctrl&&(n+="ctrl + "),t.alt&&(n+="alt + "),t.shift&&(n+="shift + "),n+=t.key,n}clear_scope(e){e.preventDefault(),this.root.scopes.clear_scope(!1)}clear_css(e){e.preventDefault();const{cursor:t}=this;this.root.painter.clear()}bold(e){e.preventDefault(),this.root.painter.paint({"font-weight":"700"},!0)}unindent_line(e){e.preventDefault(),this.root.painter.unindent()}indent_line(e){e.preventDefault(),this.root.painter.indent()}undo(e){e.preventDefault(),this.root.history.undo()}redo(e){e.preventDefault(),this.root.history.redo()}cursor_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;if(!t)return;if(!n.range)return;e.preventDefault();const i=[P.down,P.end,P.home,P.left,P.right,P.up],r=e.key.toLocaleLowerCase();if(i.includes(r)){if(this.event.emit_cursor_nav_before(e).some(e=>!1===e))return}r===P.left?n.move_left():r===P.right?n.move_right():r===P.up?n.move_up():r===P.down?n.move_down():r===P.home?n.move_home():r===P.end&&n.move_end(),this.event.emit_cursor_nav_after(e)}cursor_extend_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;t&&n.cube_end instanceof rd&&(e.preventDefault(),e.key.toLocaleLowerCase()===P.left?n.extend_left():e.key.toLocaleLowerCase()===P.right?n.extend_right():e.key.toLocaleLowerCase()===P.up?n.extend_up():e.key.toLocaleLowerCase()===P.down?n.extend_down():e.key.toLocaleLowerCase()===P.home?n.extend_home():e.key.toLocaleLowerCase()===P.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:r}=this;if(n.has_selection)return;e.preventDefault();const s=new ac(t),{cube_end:o,cube_start:a,cube_selection:l,offset_end:c,offset_start:d}=n;if(o){if(o instanceof rd){const e=o.text.slice(0,c)+"\n​"+o.text.slice(c),t=o.id,n=ed.reset(t,e),i=zs.loc(t,c+2,t,c);s.tell(o,n,i)}i.record(s)}}break(e){if(this.event.emit_enter_before(e).some(e=>"stop"===e))return;if(!this.cursor.get_focus_line())return;e.preventDefault();const{courier:t,history:n,cursor:i,doc:r}=this,{cube_end:s,cube_start:o,cube_selection:a,offset_end:l,offset_start:c}=i;if(!a||!s||!o)return;const d=new ac(t),u=o.id,h=s.id;i.has_selection&&d.tell(a,Ts.delete(a.id,"backward",u,h,c,l,!0)),d.tell(o,ed.break(o.id,c)),n.record(d),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:i}=this,{cube_end:r,offset_end:s}=t;if(!r)return;const o=r.find_upstream_target(e=>e instanceof Yc);if(!o)return;const a=r.find_upstream_untill(o);if(!a)return;const l=[],c=a.index,d=o.children.slice(c);for(let e of d)l.push(e.export());const u=Yc.get_default(l),h=n.get_recorder(),p=o.pcube;h.tell(p,Ts.insert_child(p.id,[u],o.index+1)),h.tell(o,Ts.delete_child(o.id,"backward",[c,o.child_count])),r instanceof rd&&(await vn(),r.set_cursor_in_head(s)),i.record(h)}text_partition(e){const{cursor:t,history:n,courier:i}=this,r=Ss.tips,{cube_selection:s,offset_end:o,offset_start:a}=t;if(!(s instanceof rd))return r?.tip_warning("选区必须在一个文本块内");const l=i.get_recorder(),c=s.id;l.tell(s,Ts.partition(c,c,c,a,o)),n.record(l)}add_scope(e){this.root.scopes.add_scope()}underline(e){const{cursor:t,courier:n,history:i}=this,{cube_selection:r,cube_end:s,cube_start:o,offset_start:a,offset_end:l}=t,c=new ac(n);if(!r||!o||!s)return;c.tell(r,Ts.set_selection_css(r.id,{"text-decoration-line":"underline"},o.id,s.id,a,l,!0)),i.record(c)}copy_format(e){const{root:t}=this;e.preventDefault(),t.painter.copy_format()}apply_format(e){const{root:t}=this;e.preventDefault(),t.painter.apply_format_brush()}italic(e){e.preventDefault(),this.painter.paint({"font-style":"italic"},!0)}align_left(e){e.preventDefault(),this.painter.paint({"text-align":"left"},!0)}align_center(e){e.preventDefault(),this.painter.paint({"text-align":"center"},!0)}align_right(e){e.preventDefault(),this.painter.paint({"text-align":"right"},!0)}next_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof Yc);if(!r)return;const s=r.pcube,o=new ac(this.courier),a=Yc.get_default();o.tell(s,Ts.insert_child(s.id,[a],r.index+1)),n.record(o)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:i}=t;if(!i)return;const r=i.find_upstream_target(e=>e instanceof Yc);if(!r)return;const s=r.pcube,o=new ac(this.courier),a=Yc.get_default();o.tell(s,Ts.insert_child(s.id,[a],r.index)),n.record(o)}add_annotation(e){e.preventDefault();const t=Ss.tips,{cursor:n,courier:i,history:r}=this,{cube_selection:s,cube_start:o,cube_end:a,offset_end:l,offset_start:c}=n,d=new ac(i);if(!s||!o||!a)return t?.tip_warning("未发现光标或选区");const u=o.id,h=a.id,p=Rc.get_default();if(n.has_selection)if(s instanceof rd)if(d.tell(s,Ts.partition(s.id,u,h,c,l)),0===c){if(s.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(s,Ts.postil_add(s.id,[p])),d.tell(s,zs.loc(s.id,l,s.id,l))}else{const e=s.next_cube;if(e instanceof rd){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),d;d.tell(e,Ts.postil_add(e.id,[p])),d.tell(e,zs.loc(e.id,e.len,e.id,e.len))}}else t?.tip_warning("选区跨越多个文本块");else a instanceof rd&&(d.merge(a.add_annotation()),d.tell(a,zs.loc(a.id,l,a.id,l)));r.record(d)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:i}=t;if(!n)return;let r,s=n;for(;!r;){let e=s.pcube;if(e instanceof zd||e instanceof Yc)r=e;else if(e instanceof tc)return;s=e}if(r){const e=r.child_first,t=n.find_upstream_untill(r)===e,s=this.courier.get_recorder(),o=!r.attrs.fold,a=Ts.set_attr(r.id,{fold:o});s.tell(r,a),t?s.tell(n,zs.loc(n.id,i,n.id,i)):o&&e&&s.tell(e,zs.in_tail(e.id)),this.history.record(s)}}static get meta(){return{type:t.hotkeys,version:1}}static get default_hotkeys(){return{[T["fold-block"]]:{name:T["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:z.block},[T["text-partition"]]:{name:T["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:z.text},[T["text-add-annotation"]]:{name:T["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:z.text},[T["scope-clear"]]:{name:T["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:z.scope},[T["clear-css"]]:{name:T["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:z.css},[T["root-add-prev"]]:{name:T["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:z.block},[T["root-add-next"]]:{name:T["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:z.block},[T["text-align-left"]]:{name:T["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:z.common},[T["text-align-center"]]:{name:T["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:z.common},[T["text-align-right"]]:{name:T["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:z.common},[T["break-text"]]:{name:T["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:z.text},[T["break-line"]]:{name:T["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:z.core},[T["break-root"]]:{name:T["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:z.block},[T["cursor-nav"]]:{name:T["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:z.core},[T["cursor-nav-extend"]]:{name:T["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[P.down,P.left,P.right,P.up,P.home,P.end],group:z.core},[T.undo]:{name:T.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:z.common},[T.redo]:{name:T.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:z.common},[T["indent-line"]]:{name:T["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:z.common},[T["unindent-line"]]:{name:T["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:z.common},[T["text-bold"]]:{name:T["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:z.text},[T["scope-add"]]:{name:T["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:z.scope},[T["text-underline"]]:{name:T["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:z.text},[T["text-italic"]]:{name:T["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:z.text},[T["format-brush-copy"]]:{name:T["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:z.common},[T["format-brush-apply"]]:{name:T["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:z.common}}}}Bs([qs(T["scope-clear"])],Fs.prototype,"clear_scope",null),Bs([qs(T["clear-css"])],Fs.prototype,"clear_css",null),Bs([qs(T["text-bold"])],Fs.prototype,"bold",null),Bs([qs(T["unindent-line"])],Fs.prototype,"unindent_line",null),Bs([qs(T["indent-line"])],Fs.prototype,"indent_line",null),Bs([qs(T.undo)],Fs.prototype,"undo",null),Bs([qs(T.redo)],Fs.prototype,"redo",null),Bs([qs(T["cursor-nav"])],Fs.prototype,"cursor_navigation",null),Bs([qs(T["cursor-nav-extend"])],Fs.prototype,"cursor_extend_navigation",null),Bs([qs(T["break-text"])],Fs.prototype,"text_break",null),Bs([qs(T["break-line"])],Fs.prototype,"break",null),Bs([qs(T["break-root"])],Fs.prototype,"break_root",null),Bs([qs(T["text-partition"])],Fs.prototype,"text_partition",null),Bs([qs(T["scope-add"])],Fs.prototype,"add_scope",null),Bs([qs(T["text-underline"])],Fs.prototype,"underline",null),Bs([qs(T["format-brush-copy"])],Fs.prototype,"copy_format",null),Bs([qs(T["format-brush-apply"])],Fs.prototype,"apply_format",null),Bs([qs(T["text-italic"])],Fs.prototype,"italic",null),Bs([qs(T["text-align-left"])],Fs.prototype,"align_left",null),Bs([qs(T["text-align-center"])],Fs.prototype,"align_center",null),Bs([qs(T["text-align-right"])],Fs.prototype,"align_right",null),Bs([qs(T["root-add-next"])],Fs.prototype,"next_root",null),Bs([qs(T["root-add-prev"])],Fs.prototype,"prev_root",null),Bs([qs(T["text-add-annotation"])],Fs.prototype,"add_annotation",null),Bs([qs(T["fold-block"])],Fs.prototype,"fold_block",null);class Hs extends ks{_count_word=Kt(0);_active_root_index=Kt(0);_anchor_root_id=Kt("");_mode=Kt(A.read);_view=Kt("doc");_in_composition_mode=Kt(!1);_in_recording=Kt(!1);_showing=Kt(!1);view_point=Dt({x:0,y:0});get view(){return this._view.value}set view(e){this._view.value=e}get is_doc_view(){return"doc"===this.view}get is_map_view(){return"map"===this.view}get mode_name(){return{[A.edit]:"编辑模式",[A.read]:"阅读模式",[A.export]:"导出模式"}[this.mode]}get showing(){return this._showing.value}set showing(e){this._showing.value=e,this.event.emit_status_update()}get is_recording(){return this._in_recording.value}set is_recording(e){this._in_recording.value=e,this.event.emit_status_update()}get len_undo(){return this.history.len_undo}get len_redo(){return this.history.len_redo}get is_read_mode(){return this._mode.value===A.read}get is_edit_mode(){return this._mode.value===A.edit}get in_composition_mode(){return this._in_composition_mode.value}set in_composition_mode(e){this._in_composition_mode.value=e,this.event.emit_status_update()}get mode(){return this._mode.value}set mode(e){const t=this.mode;this._mode.value=e,t!==e&&this.event.emit_status_update()}get anchor_root_id(){return this._anchor_root_id.value}set anchor_root_id(e){this._anchor_root_id.value=e,this.event.emit_status_update()}get anchor_root(){return this.root instanceof pd?this.root.children.find(e=>e.id===this.anchor_root_id):this.root.find_cube(this.anchor_root_id)}get count_root(){return this.root.child_count}get count_word(){return this._count_word.value}get active_root(){return this.root.children[this.active_root_index-1]}get active_root_index(){return this._active_root_index.value}set active_root_index(e){this._active_root_index.value=e,this.event.emit_status_update()}get count_scope(){return this.root.scopes.scopes.size}get count_scope_freeze(){return this.root.scopes.scope_count_freeze}get count_scope_normal(){return this.root.scopes.scope_count_normal}get meta(){return Hs.meta}constructor(e){super(e)}update_count_word(e){this._count_word.value+=e,this.event.emit_status_update()}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.stats,version:1}}}class $s extends ks{_listener=new Map;_updating_status=!1;get meta(){return $s.meta}constructor(e){super(e),this._listen()}_listen(){document.documentElement.addEventListener("keyup",e=>{"Escape"===e.key&&this.emit_esc()}),document.addEventListener("selectionchange",e=>{this.emit_selection_change(e)})}on(e,t){const n=this._listener.get(e);n?n.add(t):this._listener.set(e,new Set([t]))}emit(e,...t){const n=this._listener.get(e);if(!n)return[];const i=[];for(let e of n)i.push(e(...t));return i}off(e){for(let[t,n]of this._listener)for(let t of n)e===t&&n.delete(t)}on_asset_save(e){const t=Ss.tips,n=this._listener.get(M["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(M["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=Ss.tips,r=this._listener.get(M["asset-save"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const s=[...r][0];return!!s&&await s(e,t,n)}on_asset_download(e){const t=Ss.tips,n=this._listener.get(M["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(M["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=Ss.tips,i=this._listener.get(M["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const r=[...i][0];return!!r&&await r(e,t)}on_asset_copy(e){const t=Ss.tips,n=this._listener.get(M["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(M["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=Ss.tips,r=this._listener.get(M["asset-copy"]);if(!r)return i?.tip_warning("未注册保存函数"),!1;const s=[...r][0];return!!s&&await s(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(M["replace-id"]);if(!n)return!1;for(let i of n)i(e,t)}on_replace_id(e){const t=this._listener.get(M["replace-id"]);t?t.add(e):this._listener.set(M["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(M["edit-before"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_before(e){const t=this._listener.get(M["edit-before"]);t?t.add(e):this._listener.set(M["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(M["edit-after"]);if(!n)return!1;for(let i of n)i(e,t)}on_edit_after(e){const t=this._listener.get(M["edit-after"]);t?t.add(e):this._listener.set(M["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(M["text-merge"]);if(!n)return!1;for(let i of n)i(e,t)}on_text_merge(e){const t=this._listener.get(M["text-merge"]);t?t.add(e):this._listener.set(M["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(M.esc);t?t.add(e):this._listener.set(M.esc,new Set([e]))}emit_esc(){const e=this._listener.get(M.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(M["selection-change"],e)}emit_selection_change(e){this.emit(M["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(M["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(M["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(M["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(M["cursor-nav-after"],e)}on_enter_before(e){this.on(M["enter-before"],e)}emit_enter_before(e){return this.emit(M["enter-before"],e)}on_enter_after(e){this.on(M["enter-after"],e)}emit_enter_after(e){return this.emit(M["enter-after"],e)}on_show_cube_editor(e){this.on(M["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(M["show-cube-editor"],e)}on_text_link_edit(e){this.on(M["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(M["text-link-edit"],e)}on_note_input_before(e){return this.on(M["note-input-before"],e)}emit_note_input_before(e){return this.emit(M["note-input-before"],e)}on_note_compositionend_before(e){return this.on(M["note-input-compositionend-before"],e)}emit_note_compositionend_before(e){return this.emit(M["note-input-compositionend-before"],e)}on_note_compositionend(e){return this.on(M["note-input-compositionend"],e)}emit_note_compositionend(e){return this.emit(M["note-input-compositionend"],e)}on_note_compositionupdate(e){return this.on(M["note-input-compositionupdate"],e)}emit_note_compositionupdate(e){return this.emit(M["note-input-compositionupdate"],e)}on_status_update(e){return this.on(M["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t=e,n={mode:this.stats.mode,count_word:this.stats.count_word,count_scope_normal:this.stats.count_scope_normal,count_scope_all:this.root.scopes.scope_size,count_stack_redo:this.history.len_redo,count_stack_undo:this.history.len_undo,count_root:this.stats.count_root,active_root_index:this.stats.active_root_index,anchor_root_id:this.stats.anchor_root_id,note_recording:this.stats.is_recording,note_composition_input:this.stats.in_composition_mode,note_showing:this.stats.showing,map_matrix:{...t.matrix2d}};this.emit(M["status-update"],n),this._updating_status=!1}))}on_fig_click(e){return this.on(M["fig-click"],e)}emit_fig_click(e){return this.emit(M["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.event,version:1}}}class Gs extends ks{_format_brush=null;get meta(){return Gs.meta}get format_brush(){const e={};return this._format_brush&&Object.assign(e,this._format_brush),e}constructor(e){super(e)}paint(e,t=!1){const{root:n,cursor:i,history:r,courier:s}=this,o=new ac(s);if(!e)return;const a=structuredClone(Vt(e));if(a["text-align"]){const t=e["text-align"];o.merge(this.text_align(t)),delete a["text-align"]}if(n.scopes.scope_count_normal>0){const e=n.scopes.get_scope_cubes();for(let n of e){const e=n.cube;for(let i of e.children.slice(...n.range))o.tell(i,Ts.set_css(i.id,structuredClone(a),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=i;if(!e||!n||!r)return;const c=Ts.set_selection_css(e.id,a,n.id,r.id,s,l,t);o.tell(e,c)}r.record(o)}clear(){const{root:e,cursor:t,history:n,courier:i}=this,r=new ac(i),s={};if(e.scopes.scope_count_normal>0){const t=e.scopes.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range))r.tell(n,Ts.set_css(n.id,structuredClone(s),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:i,offset_start:o,offset_end:a}=t;if(!e||!n||!i)return;const l=Ts.set_selection_css(e.id,s,n.id,i.id,o,a,!1,!0);r.tell(e,l)}n.record(r)}text_align(e){const{root:t,cursor:n,history:i,courier:r}=this,s=new ac(r),o={"text-align":e};if(t.scopes.scope_count_normal>0){const e=t.scopes.get_scope_cubes();for(let t of e){const e=t.cube;for(let n of e.children.slice(...t.range))s.tell(n,Ts.set_css(n.id,structuredClone(o)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=Ts.set_css(t.id,structuredClone(o));s.tell(t,e)}}return s}indent(){const{root:e,cursor:t,history:n,courier:i,config:r}=this,s=new ac(i);if(e.scopes.scope_count_normal>0){const t=e.scopes.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range)){const e=n.attrs.indent>0?n.attrs.indent+1:1;s.tell(n,Ts.set_attr(n.id,{indent:e}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0,n=e>0?e+1:1;s.tell(t,Ts.set_attr(t.id,{indent:n}))}}n.record(s)}unindent(){const{root:e,cursor:t,history:n,courier:i}=this,r=new ac(i);if(e.scopes.scope_count_normal>0){const t=e.scopes.get_scope_cubes();for(let e of t){const t=e.cube.children.slice(...e.range);for(let e of t){let t=e.attrs.indent;t>0&&r.tell(e,Ts.set_attr(e.id,{indent:t-1}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0;e>0&&r.tell(t,Ts.set_attr(t.id,{indent:e-1}))}}n.record(r)}copy_format(){const{root:e,cursor:t}=this;if(e.scopes.scope_count_normal>0){const t=[...e.scopes.scope_normal][0].focus_cube;this._format_brush=structuredClone(Vt(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone(Vt(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:i}=this,r=new ac(n);if(t.scopes.scope_count_normal>0){const n=t.scopes.get_scope_cubes();for(let t of n)for(let n of t.cube.children.slice(...t.range)){const t=Ts.set_css(n.id,e,!1,!0);r.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:i,offset_end:s}=this.cursor;if(!e||!t||!n)return;const o=Ts.set_selection_css(e.id,this.format_brush,n.id,t.id,i,s,!1,!0);r.tell(e,o)}i.record(r)}static get meta(){return{type:t.painter,version:1}}}class Vs extends ks{_copy_data=[];_img_mime=["image/png","image/jpeg","image/gif"];_paste_stack=[];get pasted_from(){return this._paste_stack[this._paste_stack.length-1]}get is_pasting(){return this._paste_stack.length>0}get copy_data(){return[...this._copy_data]}get pasting(){return this._paste_stack.length>0}get meta(){return Vs.meta}constructor(e){super(e)}async copy(e){const{root:t,cursor:n}=this;return t.scopes.scope_count_normal>0?this.copy_scope(e):this.copy_selection(e)}async copy_selection(e){const{root:t,cursor:i}=this;if(i.has_selection){this._copy_data=i.find_inline_data();let n=i.get_selection_text();const r={noteid:t.id,versions:As.export_versions(),cubedata:this._copy_data},s=JSON.stringify(r);return e.setData("application/json",s),e.setData("text/plain",n),!0}{const{cube_end:r}=i;if(!r)return!1;const s=[r.export()];this._copy_data=s;let o="";for(let e of this._copy_data)e.type===n.text&&(o+=e.info);const a={noteid:t.id,versions:As.export_versions(),cubedata:s},l=JSON.stringify(a);return e.setData("application/json",l),e.setData("text/plain",o),!0}}async copy_scope(e){const t=Ss.tips;if(0===this.root.scopes.scope_size)return t?.tip_info("无块选区,未复制内容"),!1;if(0===this.root.scopes.scope_count_normal)return t?.tip_info("无正常块选区,未复制内容"),!1;const n=this.root.scopes.get_scope_cubes();this.root.scopes.clear_scope();const i=[];let r="";for(let e of n){for(let t of e.cube.children.slice(...e.range))r+=t.text;i.push(...e.cube.copy(...e.range))}this._copy_data=i;const s={noteid:this.root.id,versions:As.export_versions(),cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",r),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,versions:As.export_versions(),cubedata:t},i=JSON.stringify(n),r=(new TextEncoder).encode(i),s=JSON.stringify([...r]),o=new Blob([e],{type:"text/plain"}),a=new Blob([s],{type:"text/html"}),l=new ClipboardItem({[o.type]:o,[a.type]:a});return this.set_clipboard_data(l)}async paste(e){const{cursor:t,courier:n}=this,i=e.items,r=n.get_recorder();let s=[];r.merge(this.delete()),await vn();for(let e=0;e<i.length;e++){const t=i[e];if(t.type.startsWith("image")){const e=t.getAsFile();e&&s.push(e)}}if(s.length>0){for(let e of s){const t=await this.paste_img(e);r.merge(t)}return r}const o=e.getData("application/json");if(o){let e=!1;try{const t=JSON.parse(o);if(t&&t.cubedata&&t.noteid)return this._paste_stack.push(t),e=!0,r.merge(this.paste_cubes(t.cubedata)),r}catch(e){}finally{e&&this._paste_stack.pop()}}const a=e.getData("text/html");if(a)try{const e=new DOMParser,t=e.parseFromString(a,"text/html").body.textContent.trim(),n=JSON.parse(t),i=new Uint8Array(n),s=(new TextDecoder).decode(i),o=JSON.parse(s);let l=!1;try{if(o&&o.cubedata&&o.noteid)return this._paste_stack.push(o),l=!0,r.merge(this.paste_cubes(o.cubedata)),r}catch(e){}finally{l&&this._paste_stack.pop()}}catch(e){console.error("🟥paste",e)}const l=e.getData("text/plain");if(l){const e=this.get_cubedata_from_text(l);return r.merge(this.paste_cubes(e)),r}return r}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=rd.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=gd.get_default_by_string(e);n.push(t)}return n}paste_cubes(e){if(0===e.length)return;const{courier:t,history:n,cursor:i}=this,r=new ac(t),{cube_selection:s,cube_end:o,cube_start:a,offset_start:l,offset_end:c}=i;if(!s||!o||!a)return;i.has_selection&&r.tell(s,Ts.delete(s.id,"backward",a.id,o.id,l,c,!0));const d=rc.replace_id(this.root,e);return r.tell(a,Ts.insert(a.id,d,a.id,a.id,l,l)),r}async paste_img(e){const{courier:t,history:n,cursor:i}=this,r=new ac(t),{cube_selection:s,cube_end:o,cube_start:a,offset_start:l,offset_end:c}=i;if(!s||!o||!a)return;const d=gc.get_default();if(this.root.isdev)d.info=URL.createObjectURL(e),r.tell(o,Ts.insert(o.id,[d],a.id,o.id,l,c));else{const t=d.id+".png",n=t;await this.event.emit_asset_save("image",t,e);d.info=n,r.tell(o,Ts.insert(o.id,[d],a.id,o.id,l,c))}return r}delete(){const{root:e,courier:t,cursor:n}=this;return e.scopes.scope_count_normal>0?this.delete_scope():n.has_selection?this.delete_selection():void 0}delete_selection(){const{courier:e,cursor:t,history:n}=this,i=new ac(e),{cube_end:r,cube_start:s,cube_selection:o,offset_start:a,offset_end:l}=t;if(!o||!r||!s)return;const c=s.id,d=r.id,u=o.id,h=Ts.delete(u,"backward",c,d,a,l);return i.tell(o,h),i}delete_scope(){const e=Ss.tips,{root:t,courier:n,history:i,cursor:r}=this;if(0===t.scopes.scope_size)return void e?.tip_info("无块选区");if(0===t.scopes.scope_count_normal)return void e?.tip_info("无常规块选区");const s=new ac(n),o=this._root.scopes.get_scope_cubes(),a=new Map;for(let e of o){let t=a.get(e.cube);t?t.push(e.range):a.set(e.cube,[e.range])}const l=new Set;for(let[e,t]of a){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)l.add(e)}for(let e of l)s.merge(e.remove_self())}return this.root.scopes.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:i}=this;t.scopes.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:i,history:r,cursor:s}=this,o=Ss.tips;if(0===t.scopes.scope_size)return o?.tip_info("无块选区"),!1;if(0===t.scopes.scope_count_normal)return o?.tip_info("无常规块选区"),!1;const a=new ac(i),l=this._root.scopes.get_scope_cubes(),c=new Map;for(let e of l){let t=c.get(e.cube);t?t.push(e.range):c.set(e.cube,[e.range])}const d=[];for(let[e,t]of c){const n=new Set,i=e.children;for(let r of t){const t=i.slice(r[0],r[1]);for(let e of t)n.add(e);d.push(...e.copy(...r))}for(let e of n)a.merge(e.remove_self())}this._copy_data=d;let u="";for(let e of this._copy_data)e.type===n.text&&(u+=e.info);const h={noteid:this.root.id,versions:As.export_versions(),cubedata:d},p=JSON.stringify(h);e.setData("text/plain",u),e.setData("application/json",p),this.root.scopes.clear_scope(),r.record(a)}cut_selection(e){const{courier:t,cursor:i,history:r}=this,s=new ac(t),{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=i;if(l&&o&&a)if(i.has_selection){this._copy_data=i.find_inline_data();let t="";for(let e of this._copy_data)e.type===n.text&&(t+=e.info);const u={noteid:this.root.id,versions:As.export_versions(),cubedata:this._copy_data},h=JSON.stringify(u);e.setData("text/plain",t),e.setData("application/json",h);const p=a.id,_=o.id,f=l.id,m=Ts.delete(f,"backward",p,_,c,d);s.tell(l,m),r.record(s)}else{const t=o.export();this._copy_data=[t];let i="";for(let e of this._copy_data)e.type===n.text&&(i+=e.info);const a={noteid:this.root.id,versions:As.export_versions(),cubedata:this._copy_data},l=JSON.stringify(a);e.setData("text/plain",i),e.setData("application/json",l);const c=o.pcube,d=o.index,u=Ts.delete_child(c.id,"backward",[d,d+1]);s.tell(c,u),r.record(s)}}set_clipboard_data(e){return new Promise((t,n)=>{navigator.clipboard?navigator.clipboard.write([e]).then(e=>t(!0)).catch(e=>{t(!1),console.error("写入粘贴板数据失败",e)}):t(!1)})}read_clipboard(){return new Promise(e=>{navigator.clipboard?navigator.clipboard.read().then(async t=>{const n=new Map;for(let e of t)if(e instanceof ClipboardItem){const t=e.types;for(let i of t)await e.getType(i).then(async e=>n.set(e.type,e))}e(n)}):e(new Map)})}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.clipboard,version:1}}}class Us extends ks{cp=Us.default_config;_data_raw=Us.default_config;data=Dt(this._data_raw);constructor(e){super(e)}get data_raw(){return{...this._data_raw}}get meta(){return Us.meta}get css_vars(){const e=this.data;return{"--text-transition":""+(e.text_transition?"0.5s":"none"),"--text-family":`${e.text_family}`,"--text-fontsize":`${e.text_fontsize||16}px`}}init(e){Object.assign(this._data_raw,e)}export(){return structuredClone(Vt(this.data))}static get meta(){return{type:t.config,version:4}}static get default_config(){return{text_transition:!0,text_family:'"Comic Sans MS"',text_fontsize:16,code_theme:"dracula",line_indent:40,history_length:1/0,player_speed:150,revert_scope:!1,map_node_gap_x:40,map_node_gap_y:40,map_node_padding:8,map_node_exit_by_esc:!0,map_node_default_width:140,map_lod_scale:.5,map_scale_max:5,map_scale_min:.1,map_scale_step:.1,scroll_distance:20,map_linker_type:"bezier2",map_linker_width:2,map_linker_anchor_in:b.arrow,map_linker_anchor_out:b.point}}}var Ws=r(7248);class Ys extends ks{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return Ys.meta}get has_selection(){return!this.selection.isCollapsed}get client_rect(){return this.range?.getBoundingClientRect()}get client_rects(){return this.range?.getClientRects()}get range(){if(0!==this.selection?.rangeCount)return this.selection?.getRangeAt(0)}get ranges(){const e=[];for(let t=0;t<this.selection.rangeCount;t++)e.push(this.selection.getRangeAt(0));return e}get offset_start(){return this.range?this.range?.startOffset:-1}get offset_end(){return this.range?this.range?.endOffset:-1}get node_start(){return this.range?.startContainer}get node_end(){return this.range?.endContainer}get node_focus(){return this.selection.focusNode}get node_anchor(){return this.selection.anchorNode}get top_edge(){return this.safa_distance}get bottom_edge(){return document.documentElement.clientHeight-this.safa_distance}get cube_selection(){if(!this.range)return;const e=this.range.commonAncestorContainer,t=this.stats.active_root;if(t){return this.get_node_cube(e,t)||this.get_node_cube(e,this.root)}return this.get_node_cube(e,this.root)}get cube_start(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.startContainer,i=this.get_node_cube(n,t);return i instanceof rd?i:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,i=this.get_node_cube(n,t);return i instanceof rd?i:void 0}get cube_focus(){const e=this.cube_selection,t=this.node_focus;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof ic?n:void 0}get cube_anchor(){const e=this.cube_selection,t=this.node_anchor;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof ic?n:void 0}constructor(e){super(e);let t=window.getSelection();if(!t)throw Error("NoteCursor : can't find Selection API");this.selection=t}move_up_by_coor(){}locate_next_line(e,t,n){let i="up"===e?t.prev_line:t.next_line;const r=t.clientRect;let s=i?.clientRect;for(;i&&s&&r&&(s.left>=r.right||s.right<=r.left);){let t="up"===e?i.prev_line:i.next_line;if(!t)break;i=t,s=t.clientRect}if(!i)return;const o=[],a=new Map;for(let e of i.children)if(e instanceof rd){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)o.push(t[n]),a.set(t[n],e)}const l="up"===e?Ws.MathRect.get_rect_point(n.left,Ws._RectPosition.left_mid):Ws.MathRect.get_rect_point(n.left,Ws._RectPosition.right_mid),c=Ws.MathRect.get_nearest_rect(l,o);if(!c)return;const d=Ws.MathRect.get_shadow_point_horizental(l,c),u=document.caretPositionFromPoint(d.x,d.y);if(u&&u.offsetNode instanceof Text)this.set_cursor(u.offsetNode,u.offset);else if(u&&!(u.offsetNode instanceof Text)){const e=a.get(c);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const i=[],r=[],s=new Map;for(let e of t.children)if(e instanceof rd){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];i.push(r),s.set(r,e)}}if(1===i.length)return!1;if("up"===e){const e=n.left.top;for(let t of i)t.bottom<=e&&r.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of i)t.y>=e&&r.push(t)}if(r.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=Ws.MathRect.get_nearest_rect(t,r);if(!i)return!1;const o=Ws.MathRect.get_shadow_point_horizental(t,i),a=document.caretPositionFromPoint(o.x,o.y);if(a&&a.offsetNode instanceof Text)return this.set_cursor(a.offsetNode,a.offset),!0;{const e=s.get(i);if(!e)return!1;e.set_cursor_in_tail()}}return!1}move_vertical(e){const{cube_start:t,cube_end:n}=this;if(!(t instanceof rd&&n instanceof rd))return;const i="up"===e?t.line:n.line,r=this.get_selection_edge_position();if(!i||!r)return;this.locate_current_line(e,i,r)||this.locate_next_line(e,i,r)}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:s}=this,o=new ac(s);if(!(e instanceof rd))return;if(this.has_selection)return this.set_cursor(this.range.startContainer,this.range.startOffset);if(e.drop_zero_width_space(t).pos>0)if(e.is_empty){let t=e.prev_cube_deep;t&&o.tell(t,zs.in_tail(t.id))}else{const n=e.find_text_nav_pos(t,"left");i&&this.set_cursor(i,n)}else{const t=e.prev_cube_deep;t&&o.tell(t,zs.in_tail(t.id))}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:i}=this,{doc:r,courier:s}=this,o=new ac(s);if(e instanceof rd){if(this.has_selection)return this.set_cursor(this.range.endContainer,this.range.endOffset);if(n<e.drop_zero_width_space(n).len)if(e.is_empty){let t=e.next_cube_deep;t&&o.tell(t,zs.in_head(t.id))}else{const t=e.find_text_nav_pos(n,"right");i&&this.set_cursor(i,t)}else{const t=e.next_cube_deep;t&&o.tell(t,zs.in_head(t.id))}}}move_up(){this.move_vertical("up")}move_down(){return this.move_vertical("down")}move_end(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const s=this.range.getClientRects();if(0===s.length)return;const o=Ws.MathRect.get_rect_point(s[s.length-1],Ws._RectPosition.center);let a=rc.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],u=d;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(Ws.MathRect.is_point_in_rect(o,t)){u=t;break}}if(u!==d)return this.locate_cursor_on_rect(u,Ws._RectPosition.right_mid)}let h=e.next_cube;if(!h)return this.locate_cursor_on_rect(u,Ws._RectPosition.right_mid);for(a=rc.get_client_rects(h.id);a;){if(l=a.length,c=a[0],c.x<u.right)return this.locate_cursor_on_rect(u,Ws._RectPosition.right_mid);if(l>1)return this.locate_cursor_on_rect(c,Ws._RectPosition.right_mid);if(h=h?.next_cube,!h)return this.locate_cursor_on_rect(c,Ws._RectPosition.right_mid);a=rc.get_client_rects(h.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const s=this.range.getClientRects();if(0===s.length)return;const o=Ws.MathRect.get_rect_point(s[s.length-1],Ws._RectPosition.center);let a=rc.get_client_rects(e.id);if(!a)return;let l=a.length,c=a[0],d=a[a.length-1],u=c;if(l>1){for(let e=0;e<l;e++){const t=a[e];if(Ws.MathRect.is_point_in_rect(o,t)){u=t;break}}if(u!==c)return this.locate_cursor_on_rect(u,Ws._RectPosition.left_mid)}let h=e.prev_cube;if(!h)return this.locate_cursor_on_rect(u,Ws._RectPosition.left_mid);for(a=rc.get_client_rects(h.id);a;){if(l=a.length,d=a[a.length-1],d.right>u.left)return this.locate_cursor_on_rect(u,Ws._RectPosition.left_mid);if(l>1)return this.locate_cursor_on_rect(d,Ws._RectPosition.left_mid);if(h=h?.prev_cube,!h)return this.locate_cursor_on_rect(d,Ws._RectPosition.left_mid);a=rc.get_client_rects(h.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_left(),vn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_right(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_right(),vn(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_up(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_up();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_down();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_home();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:i}=this.range,{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=r||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:i;this.set_cursor(d,u),this.move_end();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}is_contains_selection(e){const t=[];for(let e of this.ranges)t.push(e.commonAncestorContainer);for(let n of t){if(!this.get_node_cube(n,e))return!1}return!0}get_node_cube(e,t){let n=e instanceof Element?e:e.parentElement;const i=[];for(;n;){if(n.id){let e;if(i.push(n.id),e=(this.root,t.find_cube(n.id)),e)return e}n=n.parentElement}}get_focus_line(){const{cube_end:e}=this;if(e)return e instanceof rd?e.line:void 0}set_cursor(e,t){if(!(e instanceof Text))throw Error("NoteCursor : curosr only be set in TextNode");let n=Math.min(e.length,t);this.selection?.setPosition(e,n),e.parentElement&&e.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}locate_cursor_on_rect(e,t){let n=Ws.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),r=window.getSelection();if(i&&r&&i.offsetNode instanceof Text)return r.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:i,root:r}=this,s=document.caretPositionFromPoint(e,t),o=s?.offsetNode,a=new ac(n);if(o){if(o instanceof Text)s.offsetNode instanceof Text&&(o.parentElement?.parentElement?.focus(),this.set_cursor(s.offsetNode,s.offset));else{const e=r.cursor.get_node_cube(o,r);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube;n.block||a.tell(e,zs.in_head(e.id))}i.record(a)}}set_cursor_by_coor(e,t){if(t<=this.top_edge){let e=document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;Ws.DomAnimation.scroll_element(document.documentElement,-this.scroll_distance,"vertical"),t+=n}else if(t>=this.bottom_edge){let e=document.documentElement.scrollHeight-document.documentElement.clientHeight-document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;Ws.DomAnimation.scroll_element(document.documentElement,this.scroll_distance,"vertical"),t-=n}const n=document.caretPositionFromPoint(e,t);if(n&&n.offsetNode instanceof Text){this.set_cursor(n.offsetNode,n.offset);let e=this.get_selection_edge_position()?.right;if(!e)return;return e.y<=this.top_edge?window.scrollBy({top:-this.scroll_distance,behavior:"smooth"}):e.y>=this.bottom_edge&&window.scrollBy({top:this.scroll_distance,behavior:"smooth"}),n}}get_selection_edge_position(){if(!this.range)return;const e=this.range.getClientRects();if(0===e.length)return;const t=e[0],n=e[e.length-1];return{left:new DOMRect(t.x,t.y,0,t.height),right:new DOMRect(n.x,n.y,0,n.height)}}set_selection_between(e,t,n,i){this.selection.setBaseAndExtent(e,t,n,i)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:i,offset_end:r}=this;let s="";if(e&&!this.has_selection&&n instanceof rd)return n.text;if(this.cube_selection instanceof rd)return this.cube_selection.text.slice(i,r);{let e=!1,o=!1;const a=this.find_inline_cube();for(let l of a){for(let a of l){if(o)break;e||a!==n||(e=!0,a instanceof rd&&(s+=a.text.slice(i))),o||a!==t||(o=!0,a instanceof rd&&(s+=a.text.slice(0,r))),e&&!o&&a instanceof rd&&a!==n&&a!==t&&(s+=a.text)}s+="\n"}}return s}find_cube_by_coor(e){const{x:t,y:n}=e,i=document.elementFromPoint(t,n);if(i)return this.get_node_cube(i,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:i}=this;if(t instanceof rd){let e=t.line;if(e)return[e]}else{if(t instanceof gd)return[t];if(n instanceof rd&&i instanceof rd){const t=n.line,r=i.line;if(t&&r){let n=t;for(;n&&(e.push(n),n!==r);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:i,offset_end:r}=this;if(!t||!n)return e;if(!(t instanceof rd&&n instanceof rd))return e;const s=this.find_selection_lines();if(0===s.length)return[];const o=s[0],a=s[s.length-1],l=t.index,c=n.index;if(1===s.length){const t=[];for(let e of o.children.slice(l,c+1))t.push(e);e.push(t)}else{let t=[];for(let e of o.children.slice(l))t.push(e);e.push(t),t=[];for(let n of s.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of a.children.slice(0,c+1))t.push(e);e.push(t)}return e}find_inline_data(){const e=[],t=this.find_inline_cube();if(0===t.length)return e;const n=t[0],i=t[t.length-1],r=n[0],s=i[i.length-1],{cube_start:o,cube_end:a,offset_start:l,offset_end:c}=this;if(!o||!a)return e;if(o===a){const t=o.export();t.info=t.info.slice(l,c),e.push(t)}else if(n===i){if(o instanceof rd&&o===r){const t=o.export();t.info=t.info.slice(l),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(a instanceof rd&&a===s){const t=a.export();t.info=t.info.slice(0,c),e.push(t)}}else{if(o instanceof rd&&o===r){const t=o.export();t.info=t.info.slice(l),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=gd.get_default(n.map(e=>e.export()));e.push(t)}const d=gd.get_default(i.slice(0,-1).map(e=>e.export()));if(a instanceof rd&&a===s){const e=a.export();e.info=e.info.slice(0,c),d.info.push(e)}e.push(d)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.cursor,version:1}}}class Xs extends ks{command_group_do=[];command_group_undo=[];get meta(){return Xs.meta}execute_command_group(e){if(this.stats.mode===A.read)return;const t=(e,n,i)=>{n<i.length&&vn(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new ac(this)}pass(e){if(this.stats.mode===A.read)return;const t=e,n=e.id,i=this.root.find_cube(n);if(!i)return console.error("未发现cube:",n);console.log("🟡",i,e);const r=new ac(this);let s=i.on(t);return s instanceof ac&&r.merge(s),r}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.courier,version:1}}}class Ks{_float;_visible=Kt(!1);_css=Dt({position:"fixed"});_cube=Kt(null);constructor(e){this._float=e}get visible(){return this._visible.value}get float(){return this._float}get cube(){return this._cube.value}get css(){return this._css}async show(e,t){this._visible.value=!0;const n=e.currentTarget;await vn();const i={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=n.getBoundingClientRect(),s={x:e.clientX,y:e.clientY,width:1,height:1},o=Ws.MathRect.move_rect_to_other(i,r,s,12);this._css.left=`${o.x}px`,this._css.top=`${o.y}px`,this._cube.value=Ut(t)}close(){this._visible.value=!1,this._cube.value=null}}class Js extends Ks{_css=Dt({});_cube=Kt(null);constructor(e){super(e),this._listen()}_listen(){const e=this.float.event;e.on_esc(this.close.bind(this)),e.on_fig_click(this.close.bind(this))}get cube(){return this._cube.value}}class Qs extends ks{_float_node_layout=new Js(this);constructor(e){super(e)}get float_node_layout(){return this._float_node_layout}get meta(){return Qs.meta}static get meta(){return{type:t.float,version:1}}}const Zs=jn({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>(Rr(),Br(_i(e.cube.component),{cube:Ut(e.cube)},null,8,["cube"]))});function eo(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:i}=t,{deltaY:r,currentTarget:s}=e,o=t.config.data.revert_scope;r>0&&!o?t.expand("down"):t.expand("up")}const to={class:"iconbox"},no=jn({__name:"note-scope",props:{selection:{}},setup(e){const t=ws(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);if(0===t)return;return{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px"}}),n=ws(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);if(0===t)return;return{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px",display:e.selection.pos.width<30?"none":"unset"}});function i(){e.selection.freeze=!e.selection.freeze}function r(t,n,i){t.stopPropagation();const{root:r}=e.selection,s=new ac(r.courier),o=n.get_scope_info(),a=o.cube.children[o.range[0]],l=o.cube.children[o.range[1]-1];if("A"===i&&l)if(l instanceof Yc){const e=Yc.get_default();s.tell(o.cube,Ts.insert_child(o.cube.id,[e],l.index+1))}else{const e=gd.get_default(),t=Ts.insert_child(o.cube.id,[e],l.index+1);s.tell(o.cube,t)}else if("B"===i&&a)if(a instanceof Yc){const e=Yc.get_default();s.tell(o.cube,Ts.insert_child(o.cube.id,[e],a.index))}else{const e=gd.get_default(),t=Ts.insert_child(o.cube.id,[e],a.index);s.tell(o.cube,t)}r.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>(Rr(),Dr("div",{class:ve(["note-scope",{freeze:e.selection.freeze}]),style:fe(e.selection.css),onWheel:o[3]||(o[3]=t=>en(eo)(t,e.selection)),onClick:i,onContextmenu:s},[$r("div",to,[$r("div",{class:"iconfont icon-a-copy",style:fe(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>r(t,e.selection,"A"))},null,4),$r("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:fe(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),$r("div",{class:"iconfont icon-B-copy",style:fe(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>r(t,e.selection,"B"))},null,4)])],38))}});var io=r(3193);const ro=(0,io.A)(no,[["__scopeId","data-v-c8092bce"]]),so=["d","id","data-type","marker-start","marker-end"],oo=jn({__name:"cube-linker",props:{cube:{}},setup(e){const{status:t,pcube:n}=e.cube;return(i,r)=>(Rr(),Dr("path",{d:en(t).path,id:i.cube.id,class:ve(["cube-linker",{"line-delete-selected":n.status.is_line_deleted(e.cube)}]),style:fe(en(t).css),"data-type":i.cube.type,"marker-start":`url(#${en(t).anchor_left})`,"marker-end":`url(#${en(t).anchor_right})`},null,14,so))}}),ao=(0,io.A)(oo,[["__scopeId","data-v-0adda379"]]),lo=["cx","cy"],co=jn({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>(Rr(),Dr(Mr,null,[en(t).show?(Rr(),Dr("circle",{key:0,cx:en(t).x,cy:en(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,lo)):Xr("v-if",!0),Xr(' <g data-flag="drag-nodes" :transform="get_matrix()" style="pointer-events: none; user-select: none; opacity: 0.8" v-if="info_node_drag.show">\n <path d="M -54.5 -18 L 54.5 -18 Q 56.5 -18 56.5 -16 L 56.5 16 Q 56.5 18 54.5 18 L -54.5 18 Q -56.5 18 -56.5 16 L -56.5 -16 Q -56.5 -18 -54.5 -18 z" style="fill: rgba(255, 255, 255, 0.05); stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\n <path d="M -54.5 -18 L -54.5 -20 Q -54.5 -22 -52.5 -22 L 58.5 -22 Q 60.5 -22 60.5 -20 L 60.5 14 Q 60.5 16 58.5 16 L 56.5 16" style="fill: none; stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\n <text x="0" y="7" text-anchor="middle" font-size="14" style="fill: rgb(113 117 122)">已选择{{info_node_drag.count}}个节点</text>\n </g> ')],2112))}}),uo={class:"map-status"},ho={class:"tool-item map-scale"},po={class:"tool-item map-nodes"},_o=jn({__name:"map-status",props:{cube:{}},setup(e){const{status:t}=e.cube;ws(()=>e.cube.cubes.get_types_cube(n.node));function i(t){const n=e.cube.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(i,t,t)}return(e,n)=>(Rr(),Dr("div",uo,[$r("div",ho,[$r("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:n[0]||(n[0]=e=>i(-.1))}),$r("span",null,Ce((100*t.matrix2d.a).toFixed(0)+"%"),1),$r("span",{class:"iconfont icon-add",onClick:n[1]||(n[1]=e=>i(.1))})]),$r("div",po,[$r("span",null,"节点 :"+Ce(`${en(t).nodes_view_count}✦${en(t).nodes_count}`),1)])]))}}),fo=(0,io.A)(_o,[["__scopeId","data-v-a10baed6"]]);const mo=new class{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},go=Dt({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),bo=Dt({open:!1,data:{},submit(){}});function yo(e,t){bo.open=!0,bo.submit=t,bo.data=e}function vo(e){const t=[...ba(e,!0),{usable:!0,title:"语言",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){const t={cube:e,title:"选择语言",layout:"grid",is_cube_menu:!1,active:[e.active_tab?.lang||""],menus:e.langs.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:s,active_tab:o}=e;if(!o)return;const a=i.get_recorder();a.tell(e,Qu.change_lang(s,o.id,t)),r.record(a)}}))};return t}(e),click(e){}},{usable:!0,title:"主题",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){const t={cube:e,title:"选择主题",layout:"grid",is_cube_menu:!1,active:[e.active_tab?.theme||""],menus:e.themes.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:i,history:r,id:s,active_tab:o}=e;if(!o)return;const a=i.get_recorder();a.tell(e,Qu.change_theme(s,o.id,t)),r.record(a)}}))};return t}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){yo({文件名:""},t=>{const n=t["文件名"],i=n.lastIndexOf(".");let r="typescript";if(i>=0){const e=n.slice(i);r=Lm[e]||r}const{code_theme:s}=e.config.data,o=e.create_tab(r,n,s),a=e.courier.get_recorder();a.tell(e,Qu.add(e.id,o)),e.history.record(a)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){yo({文件名:e.active_tab?.name||""},t=>{const n=e.active_tab;if(!n)return;const i=t["文件名"],r=e.courier.get_recorder();r.tell(e,Qu.rename(e.id,n.id,i)),e.history.record(r)})},mouseenter(e){}},{usable:!0,title:"复制代码",icon:["iconfont","icon-copy"],click(t){e.copy_code()},mouseenter(e){}},{usable:!0,title:"清空代码",icon:["iconfont","icon-eraser"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,Qu.update(e.id,n.id,"")),e.history.record(i)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const i=e.courier.get_recorder();i.tell(e,Qu.remove(e.id,n.id)),e.history.record(i)},mouseenter(e){}}];return{cube:e,title:e.meta.cubename,layout:"grid",is_cube_menu:!0,active:[],menus:t}}function wo(e){const t=e.get_active_cell(),n=[...ba(e),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:i,id:r}=e,s=i.get_recorder();if(e.title){const t=Gw.remove_title(r);s.tell(e,t)}else{const t=kd.get_default(),n=Gw.add_title(r,t);s.tell(e,n)}n.record(s)}},{usable:e.selection_cells.length>0,title:"复制子表",icon:["iconfont","icon-grid"],has_submenu:!1,mouseenter(e){},click(t){const{clipboard:n}=e,i=Ss.tips,r=e.copy_selection_table();if(!r)return Ss.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[r]),i?.tip_success("复制子表成功")}},{usable:e.selection_cells.length>0,title:"合并单元格",icon:["iconfont","icon-hebingdanyuange"],has_submenu:!1,mouseenter(e){},click(t){!function(e){const{courier:t,id:n,history:i}=e,r=Ss.tips,s=t.get_recorder(),o=e.get_selection_area();if(!o)return r?.tip_info("无选中单元格");s.tell(e,Gw.merge(n,o)),i.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){Mo(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){Mo(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){xo(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){ko(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){So(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){Co(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){xo(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){ko(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){So(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){Co(e,!0)}},{usable:!!t,title:"删除当前行",icon:["iconfont","icon-shanchuhang"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=Ss.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=e.check_orderly_row(l.row);if(!c)return o?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,Gw.remove_row(s,l.row)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前列",icon:["iconfont","icon-shanchulie"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=Ss.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=e.check_orderly_col(l.col);if(!c)return o?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,Gw.remove_col(s,l.col)),r.record(t)}}(e)}},{usable:!!t,title:"删除当前单元格",icon:["iconfont","icon-list-delete-cell"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:i,history:r,id:s}=e,o=Ss.tips,{cube_end:a}=t,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");const c=n.get_recorder();c.tell(e,Gw.remove_cell(s,l.box.id)),r.record(c)}(e)}}];return{cube:e,title:e.meta.cubename,layout:"grid",is_cube_menu:!0,active:[],menus:n}}function xo(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Ss.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col-1))return o?.tip_info("左侧已存在单元格");if(l.col-1<0)return o?.tip_info("左侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col-1,rowspan:1,colspan:1,data:kd.get_default()};t.tell(e,Gw.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_left(t.left))return o?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(kd.get_default());n.tell(e,Gw.add_col(e.id,l.col,r)),s.record(n)}}function ko(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Ss.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row,l.col+1))return o?.tip_info("右侧已存在单元格");if(l.col+1>=e.size[1])return o?.tip_info("右侧已达边界");{const t=i.get_recorder(),n={row:l.row,col:l.col+1,rowspan:1,colspan:1,data:kd.get_default()};t.tell(e,Gw.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_col_right(t.right))return o?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[0];t++)r.push(kd.get_default());n.tell(e,Gw.add_col(e.id,l.col+l.colspan,r)),s.record(n)}}function So(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Ss.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row-1,l.col))return o?.tip_info("上方已存在单元格");if(l.row-1<0)return o?.tip_info("上方已达边界");{const t=i.get_recorder(),n={row:l.row-1,col:l.col,rowspan:1,colspan:1,data:kd.get_default()};t.tell(e,Gw.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_top(t.top))return o?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(kd.get_default());n.tell(e,Gw.add_row(e.id,l.row,r)),s.record(n)}}function Co(e,t=!1){const{cursor:n,courier:i,stats:r,history:s}=e,o=Ss.tips,{cube_end:a}=n,l=e.get_active_cell();if(!l)return o?.tip_info("未发现激活单元格");if(t){if(e.get_cell(l.row+1,l.col))return o?.tip_info("下方已存在单元格");if(l.row+1>=e.size[0])return o?.tip_info("下方已达边界");{const t=i.get_recorder(),n={row:l.row+1,col:l.col,rowspan:1,colspan:1,data:kd.get_default()};t.tell(e,Gw.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(l);if(!e.check_orderly_row_bottom(t.bottom))return o?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let t=0;t<e.size[1];t++)r.push(kd.get_default());n.tell(e,Gw.add_row(e.id,l.row+l.rowspan,r)),s.record(n)}}function Mo(e,t){const{cursor:n,courier:i,stats:r,history:s,id:o}=e,a=Ss.tips,{cube_end:l}=n,c=e.get_active_cell();if(!c)return a?.tip_info("未发现激活单元格");const d=i.get_recorder(),u=e.get_cell_area(c);d.tell(e,Gw.col_resize(o,[u.left,u.right],t)),s.record(d)}let Ao,To,zo=!1,Po=null,No=null;function Ro(e){const{courier:t,history:n,id:i,cubes:r}=e,s=t.get_recorder();s.tell(e,Ts.fold(i,!e.attrs.fold)),n.record(s);for(let t of Object.values(r.postils))t.pcube?.top===e&&t.visible(!1);const o=e.child_first.id;if(!o)return;const a=document.getElementById(o);a?.scrollIntoView({block:"nearest",behavior:"smooth"})}function Oo(e,t){Ro(t)}function Lo(e,t){e.preventDefault();const{root:n,stats:i}=t;i.anchor_root_id===t.id?i.anchor_root_id="":n.stats.anchor_root_id=t.id}function Eo(e){const t=[...ba(e),{usable:!0,title:"添加块",shortcut:"",has_submenu:!1,icon:["iconfont","icon-add"],mouseenter(){},click(){!function(e){const{courier:t,history:n}=e,i=t.get_recorder(),r=[kd.get_default()];i.tell(e,Ts.insert_child(e.id,r,e.child_count)),n.record(i)}(e)}},{usable:!0,title:"布局•限定列宽",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:120,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Do(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Do(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Do(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Do(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Do(e,200)}}],n={cube:e,title:"限定列宽",layout:"list",is_cube_menu:!1,active:[e.attrs.column_width],menus:t};return n}(e),click(){}},{usable:!0,title:"布局•限定列数",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:2,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Io(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Io(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Io(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Io(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){Io(e,6)}}],n={cube:e,title:"限定列数",layout:"list",is_cube_menu:!1,active:[e.attrs.column_count],menus:t};return n}(e),click(){}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}function Io(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,Ts.set_attr(e.id,{column_count:t,column_width:null})),i.record(r)}function Do(e,t){const{courier:n,history:i}=e,r=n.get_recorder();r.tell(e,Ts.set_attr(e.id,{column_width:t,column_count:null})),i.record(r)}class Bo{static reset(e,t){return{id:e,name:u.reset,data:t}}static add(e,t,n){return{id:e,name:u.add,data:t,pos:n}}static remove(e,t){return{id:e,name:u.remove,range:t}}static indent(e,t){return{id:e,name:u.indent,items:t}}}function jo(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Bo.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Bo.indent(n.id,r)),s.record(l)}}function qo(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Gu.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Gu.indent(n.id,r)),s.record(l)}}function Fo(e,t=!1){const n=e,{cursor:i,courier:r,history:s}=e,{cube_start:o,cube_end:a}=i;if(!o||!a)return;const l=r.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!1});l.tell(n,Pu.indent(n.id,r)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const i=n.items.slice(e.index,t.index+1),r=[];for(let e of i)r.push({id:e.data.id,indent:!0});l.tell(n,Pu.indent(n.id,r)),s.record(l)}}function Ho(e,t="tail"){const{courier:n,history:i}=e,r=new ac(n),s=[kd.get_default(),kd.get_default()],o=ku.insert_row(e.id,t,[s]);r.tell(e,o),i.record(r)}const $o=Dt({alpha:10,bg:"#ffffff"}),Go=window.matchMedia("(prefers-color-scheme: dark)");Go.addEventListener("change",e=>{e.matches?($o.bg="#000000",console.log("切换到深色模式")):($o.bg="#ffffff",console.log("切换到浅色模式"))});function Vo(e,t,n="#FFFFFF"){return function(e,t,n="#FFFFFF"){const i=/^#([0-9A-F]{3}){1,2}$/i;if(!i.test(e)||!i.test(n))throw new Error("Invalid hex color format");const r=e=>{let t=e.replace("#","");return 3===t.length&&(t=t.split("").map(e=>e+e).join("")),t},s=r(e),o=r(n),a={r:parseInt(s.substring(0,2),16),g:parseInt(s.substring(2,4),16),b:parseInt(s.substring(4,6),16)},l={r:parseInt(o.substring(0,2),16),g:parseInt(o.substring(2,4),16),b:parseInt(o.substring(4,6),16)},c=[];for(let e=0;e<t;e++){const n=e/(t-1||1),i=Math.round(a.r+(l.r-a.r)*n),r=Math.round(a.g+(l.g-a.g)*n),s=Math.round(a.b+(l.b-a.b)*n),o="#"+((1<<24)+(i<<16)+(r<<8)+s).toString(16).slice(1).toUpperCase(),d=Uo(i,r,s,150);c.push({fill:o,color:d})}return c}(e,t,n)}function Uo(e,t,n,i=158){return(299*e+587*t+114*n)/1e3>i?"#000000":"#FFFFFF"}function Wo(e){if(!/^#([0-9A-F]{3,4}){1,2}$/i.test(e))throw new Error(`Invalid hex color format: ${e}`);let t=e.replace("#","").toUpperCase();return 3!==t.length&&4!==t.length||(t=t.split("").map(e=>e+e).join("")),6===t.length&&(t+="FF"),{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:parseInt(t.substring(6,8),16)/255}}Go.matches?($o.bg="#000000",console.log("当前是深色模式")):($o.bg="#ffffff",console.log("当前是浅色模式(或无偏好)"));const Yo={class:"menu-node-fill"},Xo={class:"box-items"},Ko=["onClick"],Jo=["onClick"],Qo=jn({__name:"menu-node-fill",props:{cube:{},hide:{type:Function}},setup(e){const t=[...Vo("#000000",13).slice(0,-1),...Vo("#ff006e",13).slice(0,-1),...Vo("#fb5607",13).slice(0,-1),...Vo("#f0f600",13).slice(0,-1),...Vo("#affc41",13).slice(0,-1),...Vo("#06d6a0",13).slice(0,-1),...Vo("#00b4d8",13).slice(0,-1),...Vo("#5c7aff",13).slice(0,-1),...Vo("#7400b8",13).slice(0,-1)],n=ws(()=>{const e=[{name:"清空",value:{fill:null,color:null},css:{background:"transparent"}},{name:"透明",value:{fill:"transparent"},css:{background:"transparent"}}],n=function(e){if(e<1||e>10)throw new Error("透明度等级必须在1-10之间");if(!Number.isInteger(e))throw new Error("透明度等级必须是整数");const t=(e-1)/9;return Math.round(255*t).toString(16).toUpperCase().padStart(2,"0")}($o.alpha);for(let i of t){let t=i.fill+n;e.push({name:"",value:{fill:t},css:{background:t}})}return e});return(t,i)=>(Rr(),Dr("div",Yo,[i[0]||(i[0]=$r("div",{class:"menu-title"},[$r("span",{class:"title iconfont icon-sp"},"节点填充色")],-1)),$r("div",Xo,[(Rr(),Dr(Mr,null,gi(10,e=>$r("div",{class:ve(["alpha-item",{active:en($o).alpha===e}]),onClick:t=>{return n=e,void($o.alpha=n);var n}},Ce(e),11,Ko)),64)),(Rr(!0),Dr(Mr,null,gi(n.value,t=>(Rr(),Dr("div",{class:"background-item",style:fe(t.css),onClick:n=>function(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,t.value);r.tell(e.cube,s),i.record(r)}(t)},Ce(t.name),13,Jo))),256))])]))}}),Zo=(0,io.A)(Qo,[["__scopeId","data-v-15cc2cdb"]]);class ea{static check_allow(e,t,n=!0){if(e?.is_layout_root&&!e.attrs.root||!e?.env.layout_root||n&&!t)return!0;const i=e.env.layout_type;return"right"===i?this.right.includes(t):"left"===i?this.left.includes(t):"up"===i?this.up.includes(t):"down"===i?this.down.includes(t):"time-right"===i?this.time_right.includes(t):"time-down"!==i||this.time_down.includes(t)}static get left(){return["left","time-down"]}static get right(){return["right","time-down","time-right"]}static get up(){return["up","left","right","time-right"]}static get down(){return["down","left","right","time-right","time-down"]}static get time_right(){return["time-down","down","up"]}static get time_down(){return["time-right","left","right"]}static get_layout_icons(e){if(!e)return[];return{right:["iconfont","icon-right"],left:["iconfont","icon-left"],up:["iconfont","icon-up"],down:["iconfont","icon-down"],"time-down":["iconfont","icon-time-down"],"time-right":["iconfont","icon-time-right"]}[e]||[]}static get_layout_detail(e){return[{type:null,name:"无布局",icon:["iconfont","icon-close"],usable:this.check_allow(e,null)},{type:"right",name:"向右逻辑图",icon:["iconfont","icon-right"],usable:this.check_allow(e,"right")},{type:"left",name:"向左逻辑图",icon:["iconfont","icon-left"],usable:this.check_allow(e,"left")},{type:"up",name:"向上逻辑图",icon:["iconfont","icon-up"],usable:this.check_allow(e,"up")},{type:"down",name:"向下逻辑图",icon:["iconfont","icon-down"],usable:this.check_allow(e,"down")},{type:"time-right",name:"时间向右逻辑图",icon:["iconfont","icon-time-right"],usable:this.check_allow(e,"time-right")},{type:"time-down",name:"时间向下逻辑图",icon:["iconfont","icon-time-down"],usable:this.check_allow(e,"time-down")}]}}const ta={class:"menu-node-layout"},na=["onClick"],ia=jn({__name:"menu-node-layout",props:{cube:{},hide:{type:Function}},setup(e){const t=e.cube,n=ws(()=>ea.get_layout_detail(t?.env.upstream));return(i,r)=>(Rr(),Dr("div",ta,[(Rr(!0),Dr(Mr,null,gi(n.value,n=>(Rr(),Dr("div",{class:ve(["layout-item",{usable:n.usable}]),onClick:i=>function(t,n){if(!t||!n.usable)return e.hide();const{courier:i,history:r}=t,s=i.get_recorder(),o=Ds.layout_change(t.id,{layout:n.type});s.tell(t,o),r.record(s),e.hide()}(en(t),n)},[$r("div",{class:ve(n.icon)},null,2)],10,na))),256))]))}}),ra=(0,io.A)(ia,[["__scopeId","data-v-753af6a8"]]),sa={class:"menu-node-linker"},oa={class:"box-items"},aa=jn({__name:"menu-node-linker",props:{cube:{},hide:{type:Function}},setup(e){function t(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{anchor_out:t});r.tell(e.cube,s),i.record(r)}function n(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{anchor_in:t});r.tell(e.cube,s),i.record(r)}function i(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{line_type:t});r.tell(e.cube,s),i.record(r)}function r(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{line_width:t});r.tell(e.cube,s),i.record(r)}function s(t){return{active:t===e.cube.status.node_anchor_out}}function o(t){return{active:t===e.cube.status.node_anchor_in}}function a(t){return{active:t===e.cube.status.node_line_type}}function l(t){return{active:t===e.cube.status.node_line_width}}return(e,c)=>(Rr(),Dr("div",sa,[c[28]||(c[28]=$r("div",{class:"menu-title"},[$r("span",{class:"title iconfont icon-sp"},"节点连线")],-1)),$r("div",oa,[c[20]||(c[20]=$r("div",{class:"item header"},"出点",-1)),$r("div",{class:ve(["item iconfont icon-a-Arrow-Right",s(en(b).arrow)]),onClick:c[0]||(c[0]=e=>t(en(b).arrow))},null,2),$r("div",{class:ve(["item iconfont icon-circle",s(en(b).point)]),onClick:c[1]||(c[1]=e=>t(en(b).point))},null,2),$r("div",{class:ve(["item iconfont icon-square",s(en(b).square)]),onClick:c[2]||(c[2]=e=>t(en(b).square))},null,2),$r("div",{class:ve(["item iconfont icon-cube",s(en(b).rhomb)]),onClick:c[3]||(c[3]=e=>t(en(b).rhomb))},null,2),c[21]||(c[21]=$r("div",{class:"item"},null,-1)),c[22]||(c[22]=$r("div",{class:"item"},null,-1)),c[23]||(c[23]=$r("div",{class:"item header"},"线型",-1)),$r("div",{class:ve(["item iconfont icon-zhixian",a("line")]),onClick:c[4]||(c[4]=e=>i("line"))},null,2),$r("div",{class:ve(["item iconfont icon-line-type",a("bezier2")]),onClick:c[5]||(c[5]=e=>i("bezier2"))},null,2),$r("div",{class:ve(["item iconfont icon-zhexian1",a("polyline")]),onClick:c[6]||(c[6]=e=>i("polyline"))},null,2),$r("div",{class:ve(["item iconfont icon-zhexian2",a("polyline2")]),onClick:c[7]||(c[7]=e=>i("polyline2"))},null,2),$r("div",{class:ve(["item iconfont icon-zhexian3",a("polyline3")]),onClick:c[8]||(c[8]=e=>i("polyline3"))},null,2),$r("div",{class:ve(["item iconfont icon-bolangxian",a("wave")]),onClick:c[9]||(c[9]=e=>i("wave"))},null,2),c[24]||(c[24]=$r("div",{class:"item header"},"入点",-1)),$r("div",{class:ve(["item iconfont icon-a-Arrow-Right",o(en(b).arrow)]),onClick:c[10]||(c[10]=e=>n(en(b).arrow))},null,2),$r("div",{class:ve(["item iconfont icon-circle",o(en(b).point)]),onClick:c[11]||(c[11]=e=>n(en(b).point))},null,2),$r("div",{class:ve(["item iconfont icon-square",o(en(b).square)]),onClick:c[12]||(c[12]=e=>n(en(b).square))},null,2),$r("div",{class:ve(["item iconfont icon-cube",o(en(b).rhomb)]),onClick:c[13]||(c[13]=e=>n(en(b).rhomb))},null,2),c[25]||(c[25]=$r("div",{class:"item"},null,-1)),c[26]||(c[26]=$r("div",{class:"item"},null,-1)),c[27]||(c[27]=$r("div",{class:"item header"},"线宽",-1)),$r("div",{class:ve(["item line-1",l(1)]),onClick:c[14]||(c[14]=e=>r(1))},null,2),$r("div",{class:ve(["item line-2",l(2)]),onClick:c[15]||(c[15]=e=>r(2))},null,2),$r("div",{class:ve(["item line-3",l(3)]),onClick:c[16]||(c[16]=e=>r(3))},null,2),$r("div",{class:ve(["item line-4",l(4)]),onClick:c[17]||(c[17]=e=>r(4))},null,2),$r("div",{class:ve(["item line-5",l(5)]),onClick:c[18]||(c[18]=e=>r(5))},null,2),$r("div",{class:ve(["item line-6",l(6)]),onClick:c[19]||(c[19]=e=>r(6))},null,2)])]))}}),la=(0,io.A)(aa,[["__scopeId","data-v-65935804"]]),ca={class:"menu-node-gap"},da={class:"box-items"},ua=jn({__name:"menu-node-gap",props:{cube:{},hide:{type:Function}},setup(e){function t(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{gap_x:t});r.tell(e.cube,s),i.record(r)}function n(t){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{gap_y:t});r.tell(e.cube,s),i.record(r)}function i(t){return{active:t===e.cube.map2d.node_gap_x}}function r(t){return{active:t===e.cube.map2d.node_gap_y}}return(e,s)=>(Rr(),Dr("div",ca,[s[18]||(s[18]=$r("div",{class:"menu-title"},[$r("span",{class:"title iconfont icon-sp"},"节点间隔")],-1)),$r("div",da,[s[16]||(s[16]=$r("div",{class:"item header"},"水平间隔",-1)),$r("div",{class:ve(["item gap-h",i(10)]),onClick:s[0]||(s[0]=e=>t(10))},"10",2),$r("div",{class:ve(["item gap-h",i(20)]),onClick:s[1]||(s[1]=e=>t(20))},"20",2),$r("div",{class:ve(["item gap-h",i(30)]),onClick:s[2]||(s[2]=e=>t(30))},"30",2),$r("div",{class:ve(["item gap-h",i(40)]),onClick:s[3]||(s[3]=e=>t(40))},"40",2),$r("div",{class:ve(["item gap-h",i(50)]),onClick:s[4]||(s[4]=e=>t(50))},"50",2),$r("div",{class:ve(["item gap-h",i(60)]),onClick:s[5]||(s[5]=e=>t(60))},"60",2),$r("div",{class:ve(["item gap-h",i(70)]),onClick:s[6]||(s[6]=e=>t(70))},"70",2),$r("div",{class:ve(["item gap-h",i(80)]),onClick:s[7]||(s[7]=e=>t(80))},"80",2),s[17]||(s[17]=$r("div",{class:"item header"},"垂直间隔",-1)),$r("div",{class:ve(["item gap-v",r(10)]),onClick:s[8]||(s[8]=e=>n(10))},"10",2),$r("div",{class:ve(["item gap-v",r(20)]),onClick:s[9]||(s[9]=e=>n(20))},"20",2),$r("div",{class:ve(["item gap-v",r(30)]),onClick:s[10]||(s[10]=e=>n(30))},"30",2),$r("div",{class:ve(["item gap-v",r(40)]),onClick:s[11]||(s[11]=e=>n(40))},"40",2),$r("div",{class:ve(["item gap-v",r(50)]),onClick:s[12]||(s[12]=e=>n(50))},"50",2),$r("div",{class:ve(["item gap-v",r(60)]),onClick:s[13]||(s[13]=e=>n(60))},"60",2),$r("div",{class:ve(["item gap-v",r(70)]),onClick:s[14]||(s[14]=e=>n(70))},"70",2),$r("div",{class:ve(["item gap-v",r(80)]),onClick:s[15]||(s[15]=e=>n(80))},"80",2)])]))}}),ha=(0,io.A)(ua,[["__scopeId","data-v-31440402"]]);function pa(e){const t=[{usable:!0,title:"切换布局根",icon:["iconfont","icon-system-mind-map-filled"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.courier.get_recorder(),i=Ds.layout_change(e.id,{root:!e.attrs.root});n.tell(e,i),e.history.record(n)}},{usable:!0,title:"切换布局",icon:["iconfont","icon-layout-2-fill"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(ra)}}(e),click(e){}},{usable:!0,title:"切换折叠",icon:["iconfont","icon-minus"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.courier.get_recorder(),i=Ds.layout_change(e.id,{fold:!e.attrs.fold});n.tell(e,i),e.history.record(n)}},{usable:!0,title:"填充色",icon:["iconfont","icon-background"],shortcut:"",has_submenu:!0,mouseenter:t=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(Zo)}}(e),click(e){}},{usable:!0,title:"连线",icon:["iconfont","icon-background"],shortcut:"",has_submenu:!0,mouseenter:t=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(la)}}(e),click(e){}},{usable:!0,title:"布局间隔",icon:["iconfont","icon-bimgis_suanliang"],shortcut:"",has_submenu:!0,mouseenter:t=>function(e){return{type:"component",cube:e,is_cube_menu:!1,component:Ut(ha)}}(e),click(e){}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}async function _a(e,t){const n=t.root;if(n instanceof hu&&n.interaction.flowing)return;e.preventDefault(),e.stopPropagation(),go.cube=t,go.point={x:e.clientX,y:e.clientY},go.stack_pos.length=0,go.stack_rect.length=0,go.stack_menus.length=0;const i=fa(t);i&&(go.menu=i)}function fa(e){return e instanceof ou?pa(e):e instanceof Dm?vo(e):e instanceof sx?wo(e):e instanceof Yc?function(e){const t=[...ba(e),{usable:!e.attrs.fold,title:"折叠",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){Ro(e)}},{usable:!!e.attrs.fold,title:"展开",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){Ro(e)}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof Ex?Eo(e):e instanceof Hu?function(e){const t=[{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){jo(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){jo(e,!0)}},{get usable(){return!(e.pcube instanceof yu)},title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=rc.get_id(),s.type=n.list_ordered;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Ts.delete_child(o.id,"backward",[a,a+1],!0),d=Ts.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{get usable(){return!(e.pcube instanceof yu)},title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=rc.get_id(),s.type=n.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Ts.delete_child(o.id,"backward",[a,a+1],!0),d=Ts.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return e.pcube instanceof yu||t.unshift(...ba(e)),{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof Ku?function(e){const t=[...ba(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){qo(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){qo(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=rc.get_id(),s.type=n.list;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Ts.delete_child(o.id,"backward",[a,a+1],!0),d=Ts.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=rc.get_id(),s.type=n.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Ts.delete_child(o.id,"backward",[a,a+1],!0),d=Ts.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof Du?function(e){const t=[...ba(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){Fo(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){Fo(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=rc.get_id(),s.type=n.list;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Ts.delete_child(o.id,"backward",[a,a+1],!0),d=Ts.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:i,history:r}=e,s=structuredClone(e.export());s.id=rc.get_id(),s.type=n.list_ordered;const o=e.pcube,a=e.index,l=i.get_recorder(),c=Ts.delete_child(o.id,"backward",[a,a+1],!0),d=Ts.insert_child(o.id,[s],a);l.tell(o,c,d),r.record(l)}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof gc?function(e){const t=[{usable:!0,title:"下载",icon:["iconfont","icon-download"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){e.event.emit_asset_download("image",e.info)}},{usable:!0,title:"复制到粘贴板",icon:["iconfont","icon-copy"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.dom?.querySelector("img");if(!n)return Ss.tips?.tip_error("复制失败");fetch(n.src).then(e=>e.blob()).then(async t=>{const n=new ClipboardItem({"image/png":t});await e.clipboard.set_clipboard_data(n)&&Ss.tips?.tip_success("复制成功🍊")})}},{usable:!0,title:"文字环绕",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){const t=[{usable:!0,title:"无环绕",icon:["iconfont","icon-close"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.clear_float())}},{usable:!0,title:"左环绕",icon:["iconfont","icon-floatleft"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float_image("L"))}},{usable:!0,title:"右环绕",icon:["iconfont","icon-floatright"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float_image("R"))}}];return{cube:e,title:"文字环绕",layout:"list",is_cube_menu:!1,active:[],menus:t}}(e),click(e){}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof zu?function(e){const t=[...ba(e,!1),{usable:!0,title:"向下插入行",shortcut:"ctrl + enter",icon:["iconfont","icon-cc-arrow-down-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof kd&&Ho(e,Math.floor(i.index/2)+1)}},{usable:!0,title:"向上插入行",shortcut:"ctrl + shift + enter",icon:["iconfont","icon-cc-arrow-up-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const i=n.find_upstream_untill(e);i instanceof kd&&Ho(e,Math.floor(i.index/2))}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):e instanceof yu?function(e){const t=[...ba(e),{usable:!e.exceptions,title:"添加异常块",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){e.add_exceptions()}}];return{cube:e,title:e.meta.cubename,layout:"list",is_cube_menu:!0,active:[],menus:t}}(e):void 0}function ma(e,t,n,i=5){e.width,Math.abs(e.y-n.y),e.width,Math.abs(e.height-(n.y+n.height)),Math.abs(n.x-e.x),e.height;const r={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(Ws.MathRect.can_include_size(r,t)){const r=n.y+t.height-e.height;return{x:n.x+n.width+i,y:r<0?n.y:n.y-r}}{const r=n.y+t.height-e.height;return{x:n.x-t.width-i,y:r<0?n.y:n.y-r}}}function ga(e,t){const{courier:n,history:i}=e,r=n.get_recorder(),s=e.pcube;if("A"===t)if(e instanceof Yc){const t=Yc.get_default();r.tell(s,Ts.insert_child(s.id,[t],e.index+1))}else{const t=gd.get_default(),n=Ts.insert_child(s.id,[t],e.index+1);r.tell(s,n)}else if("B"===t&&e)if(e instanceof Yc){const t=Yc.get_default();r.tell(s,Ts.insert_child(s.id,[t],e.index))}else{const t=gd.get_default(),n=Ts.insert_child(s.id,[t],e.index);r.tell(s,n)}i.record(r)}function ba(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){ga(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){ga(e,"A")}}],i={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(i),n}let ya;const va="undefined"!=typeof window&&window.trustedTypes;if(va)try{ya=va.createPolicy("vue",{createHTML:e=>e})}catch(e){}const wa=ya?e=>ya.createHTML(e):e=>e,xa="undefined"!=typeof document?document:null,ka=xa&&xa.createElement("template"),Sa={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?xa.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?xa.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?xa.createElement(e,{is:n}):xa.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>xa.createTextNode(e),createComment:e=>xa.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>xa.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{ka.innerHTML=wa("svg"===i?`<svg>${e}</svg>`:"mathml"===i?`<math>${e}</math>`:e);const r=ka.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ca=Symbol("_vtc");Boolean;const Ma=Symbol("_vod"),Aa=Symbol("_vsh");const Ta=Symbol("");const za=/(?:^|;)\s*display\s*:/;const Pa=/\s*!important$/;function Na(e,t,n){if($(n))n.forEach(n=>Na(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=Oa[t];if(n)return n;let i=re(t);if("filter"!==i&&i in e)return Oa[t]=i;i=ae(i);for(let n=0;n<Ra.length;n++){const r=Ra[n]+i;if(r in e)return Oa[t]=r}return t}(e,t);Pa.test(n)?e.setProperty(oe(i),n.replace(Pa,""),"important"):e[i]=n}}const Ra=["Webkit","Moz","ms"],Oa={};const La="http://www.w3.org/1999/xlink";function Ea(e,t,n,i,r,s=xe(t)){i&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(La,t.slice(6,t.length)):e.setAttributeNS(La,t,n):null==n||s&&!ke(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Y(n)?String(n):n)}function Ia(e,t,n,i,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?wa(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const i="OPTION"===s?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=ke(n):null==n&&"string"===i?(n="",o=!0):"number"===i&&(n=0,o=!0)}try{e[t]=n}catch(e){0}o&&e.removeAttribute(r||t)}function Da(e,t,n,i){e.addEventListener(t,n,i)}const Ba=Symbol("_vei");function ja(e,t,n,i,r=null){const s=e[Ba]||(e[Ba]={}),o=s[t];if(i&&o)o.value=i;else{const[n,a]=function(e){let t;if(qa.test(e)){let n;for(t={};n=e.match(qa);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):oe(e.slice(2));return[n,t]}(t);if(i){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();un(function(e,t){if($(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=$a(),n}(i,r);Da(e,n,o,a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const qa=/(?:Once|Passive|Capture)$/;let Fa=0;const Ha=Promise.resolve(),$a=()=>Fa||(Ha.then(()=>Fa=0),Fa=Date.now());const Ga=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement;Symbol("_moveCb"),Symbol("_enterCb");const Va=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?e=>de(t,e):t};function Ua(e){e.target.composing=!0}function Wa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ya=Symbol("_assign"),Xa={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[Ya]=Va(r);const s=i||r.props&&"number"===r.props.type;Da(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=he(i)),e[Ya](i)}),n&&Da(e,"change",()=>{e.value=e.value.trim()}),t||(Da(e,"compositionstart",Ua),Da(e,"compositionend",Wa),Da(e,"change",Wa))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(e[Ya]=Va(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:he(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}};const Ka=j({patchProp:(e,t,n,i,r,s)=>{const o="svg"===r;"class"===t?function(e,t,n){const i=e[Ca];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,o):"style"===t?function(e,t,n){const i=e.style,r=W(n);let s=!1;if(n&&!r){if(t)if(W(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Na(i,t,"")}else for(const e in t)null==n[e]&&Na(i,e,"");for(const e in n)"display"===e&&(s=!0),Na(i,e,n[e])}else if(r){if(t!==n){const e=i[Ta];e&&(n+=";"+e),i.cssText=n,s=za.test(n)}}else t&&e.removeAttribute("style");Ma in e&&(e[Ma]=s?i.display:"",e[Aa]&&(i.display="none"))}(e,n,i):D(t)?B(t)||ja(e,t,0,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&Ga(t)&&U(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(Ga(t)&&W(n))return!1;return t in e}(e,t,i,o))?(Ia(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Ea(e,t,i,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&W(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),Ea(e,t,i,o)):Ia(e,re(t),i,0,t)}},Sa);let Ja;function Qa(){return Ja||(Ja=tr(Ka))}const Za=(...e)=>{const t=Qa().createApp(...e);const{mount:n}=t;return t.mount=e=>{const i=tl(e);if(!i)return;const r=t._component;U(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const s=n(i,!1,el(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function el(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function tl(e){if(W(e)){return document.querySelector(e)}return e}const nl={class:"dialog-form"},il={class:"form-grid"},rl={class:"label"},sl=["onUpdate:modelValue"],ol=jn({__name:"menu-dialog",setup(e){const t=Kt();function n(){const e=t.value;e&&(bo.open=!1,e.close())}function i(){n(),bo.submit(bo.data)}return dr(()=>bo.open,()=>{const e=t.value;e&&(bo.open?e.showModal():e.close())}),(e,r)=>(Rr(),Dr("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[$r("div",nl,[$r("div",{class:"close-corner",onClick:n}),$r("div",il,[(Rr(!0),Dr(Mr,null,gi(Object.keys(en(bo).data),e=>(Rr(),Dr(Mr,{key:e},[$r("div",rl,Ce(e),1),Rn($r("input",{type:"text",autofocus:"","onUpdate:modelValue":t=>en(bo).data[e]=t},null,8,sl),[[Xa,en(bo).data[e]]])],64))),128))]),$r("div",{class:"dialog-submit",onClick:i},"确认")])],544))}}),al=(0,io.A)(ol,[["__scopeId","data-v-13d4fd0e"]]),ll={class:"title iconfont icon-sp"},cl={key:0,class:"iconfont icon-arrow-right"},dl=["onPointerdown","onMouseenter"],ul={class:"item-shortcut"},hl={key:0,class:"iconfont icon-arrow-right"},pl=["onMouseenter"],_l={class:"title iconfont icon-sp"},fl={key:0,class:"iconfont icon-arrow-right"},ml=["onPointerdown","onMouseenter"],gl={class:"item-shortcut"},bl={key:0,class:"iconfont icon-arrow-right"},yl=jn({__name:"note-menu",props:{root:{}},setup(e){const t=Kt(),n=Kt([]);dr(()=>go.point,async()=>{const e=t.value;if(!e)return;await vn(),go.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=e.getBoundingClientRect(),r={x:go.point.x,y:go.point.y,width:0,height:0},s=Ws.MathRect.move_rect_to_other(n,i,r);go.css={left:s.x+"px",top:s.y+"px"}}),dr(go.stack_menus,async()=>{await vn();const e=n.value;if(!e)return;go.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<go.stack_menus.length;n++){const i=go.stack_rect[n],r=ma(t,e[n].getBoundingClientRect(),i);go.stack_pos.push({left:r.x+"px",top:r.y+"px"})}});const i=ws(()=>go.menu);function r(){go.stack_menus.length=Math.max(0,go.stack_menus.length-1),go.stack_rect.length=Math.max(0,go.stack_rect.length-1)}function s(e,t=!1){t?(go.stack_menus.length=e,go.stack_rect.length=e,go.menu=void 0):(go.stack_menus.length=e,go.stack_rect.length=e)}function o(e,t){if(!t.is_cube_menu)return;const n=t?.cube?.pcube;if(!n||n instanceof tc)return;const i=fa(n);if(!i)return;s(go.stack_menus.findLastIndex(e=>e.is_cube_menu)+1);const r=e.currentTarget;go.stack_rect.push(r.getBoundingClientRect()),go.stack_menus.push(i)}function a(e,t,n){if(s(t),!n.has_submenu)return;const i=e.currentTarget;go.stack_rect.push(i.getBoundingClientRect());const r=n.mouseenter(e);r&&go.stack_menus.push(r)}function l(e,t){t.usable&&(r(),t.click(e))}function c(e){const t=e.usable;return{cursor:t?"pointer":"not-allowed",color:t?"unset":"var(--menu-item-disable-color)"}}function d(e){e.stopPropagation()}function u(e){return{"layout-list":!e.layout||"list"===e.layout,"layout-grid":"grid"===e.layout}}function h(e){return e.is_cube_menu&&function(e){if(!e)return!1;const t=[ou,Dm,sx,Yc,Ex,Hu,Ku,Du,gc,zu,yu],n=e.pcube;if(!n)return!1;for(const e of t)if(n instanceof e)return!0;return!1}(e.cube)}return ii(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const i=e.target;i&&!n.contains(i)&&(go.menu=void 0,go.stack_menus.length=0,go.stack_pos.length=0,go.stack_rect.length=0)},{capture:!0})}),(e,s)=>(Rr(),Dr("div",{class:"note-menus",style:fe(en(go).css),ref_key:"dom",ref:t,onWheel:d},[Xr(" 弹窗 "),Gr(al),Xr(" 主菜单列表 "),i.value?(Rr(),Dr("div",{key:0,class:"menu menu-list",ref_key:"ms",ref:n},[$r("div",{class:"menu-title",onMouseenter:s[0]||(s[0]=e=>o(e,i.value))},[$r("span",ll,Ce(i.value.title),1),h(i.value)?(Rr(),Dr("div",cl)):Xr("v-if",!0)],32),$r("div",{class:ve(["box-menu-items",u(i.value)])},[(Rr(!0),Dr(Mr,null,gi(i.value.menus,e=>(Rr(),Dr("div",{class:ve(["menu-item",{"active-item":i.value.active.includes(e.title)}]),style:fe(c(e)),key:e.title,onPointerdown:t=>l(t,e),onMouseenter:t=>a(t,0,e)},[$r("div",{class:ve(["item-title",e.icon])},Ce(e.title),3),$r("div",ul,Ce(e.shortcut),1),e.has_submenu?(Rr(),Dr("div",hl)):Xr("v-if",!0)],46,dl))),128))],2)],512)):Xr("v-if",!0),Xr(" 子菜单组 "),(Rr(!0),Dr(Mr,null,gi(en(go).stack_menus,(e,t)=>(Rr(),Dr("div",{class:"menu submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:fe(en(go).stack_pos[t])},["component"===e.type?(Rr(),Br(_i(e.component),{key:0,cube:Ut(e.cube),hide:Ut(r)},null,8,["cube","hide"])):(Rr(),Dr(Mr,{key:1},[$r("div",{class:"menu-title",onMouseenter:t=>o(t,e)},[$r("span",_l,Ce(e.title),1),h(e)?(Rr(),Dr("div",fl)):Xr("v-if",!0)],40,pl),$r("div",{class:ve(["box-menu-items",u(e)])},[(Rr(!0),Dr(Mr,null,gi(e.menus,n=>(Rr(),Dr("div",{class:ve(["menu-item",{"active-item":e.active.includes(n.title)}]),style:fe(c(n)),key:n.title,onPointerdown:e=>l(e,n),onMouseenter:e=>a(e,t+1,n)},[$r("div",{class:ve(["item-title",n.icon])},Ce(n.title),3),$r("div",gl,Ce(n.shortcut),1),n.has_submenu?(Rr(),Dr("div",bl)):Xr("v-if",!0)],46,ml))),128))],2)],64))],4))),256))],36))}}),vl=(0,io.A)(yl,[["__scopeId","data-v-e918d6f6"]]),wl=["onClick"],xl=jn({__name:"float-node-layout",props:{float:{}},setup(e){const t=e.float.float_node_layout,n=ws(()=>{const e=ea.get_layout_detail(t.cube?.env.upstream);return console.log("layouts:",e),e});return(e,i)=>en(t).visible?(Rr(),Dr("div",{key:0,class:"float-node-layout",style:fe(en(t).css)},[(Rr(!0),Dr(Mr,null,gi(n.value,e=>(Rr(),Dr("div",{class:ve(["layout-item",{usable:e.usable}]),onClick:n=>function(e,n){if(!e||!n.usable)return t.close();const{courier:i,history:r}=e,s=i.get_recorder(),o=Ds.layout_change(e.id,{layout:n.type});s.tell(e,o),r.record(s),t.close()}(en(t).cube,e)},[$r("div",{class:ve(e.icon)},null,2)],10,wl))),256))],4)):Xr("v-if",!0)}}),kl=(0,io.A)(xl,[["__scopeId","data-v-7b0d16c7"]]),Sl={class:"note-float"},Cl=jn({__name:"note-float",props:{root:{}},setup(e){const t=e.root.float;return(e,n)=>(Rr(),Dr("div",Sl,[Gr(kl,{float:en(t)},null,8,["float"])]))}}),Ml=(0,io.A)(Cl,[["__scopeId","data-v-a9c1c4fe"]]);class Al extends ks{has_down=!1;down_caret=void 0;constructor(e){super(e)}get root(){return this._root}pointerdown(e){if(this.root.stats.is_read_mode)return e.preventDefault();e.preventDefault(),this.has_down=!0,this.down_caret=document.caretPositionFromPoint(e.clientX,e.clientY),this.click_selection_text(e),this.cursor.locate_cursor_by_coor(e.clientX,e.clientY)}pointermove(e){this.stats.view_point={x:e.clientX,y:e.clientY},this.drag_selection_text(e)}pointercancel(e){this.has_down=!1,this.down_caret=null}pointerup(e){e.preventDefault(),this.has_down=!1,this.down_caret=null}beforeinput(e){if(this.stats.in_composition_mode)return;if(this.event.emit_note_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:i}=this,r=e.data,{cube_end:s,cube_start:o,cube_selection:a,offset_start:l,offset_end:c}=n;if(!a||!s||!o)return;const d=o.id,u=s.id,h=a.id;if("insertText"===e.inputType){if(!(a instanceof rd&&r)){const e=t.get_recorder(),n=rd.get_default(r||"​"),s=Ts.insert(h,[n],d,u,l,c);return e.tell(a,s),i.record(e)}{const e=t.get_recorder();this.ins(e,this.root,r,a,l,c),i.record(e)}}else if("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType){const n=t.get_recorder();if(!this.root.scopes.scope_count_normal){let t="deleteContentBackward"===e.inputType?"backward":"forward";const r=Ts.delete(h,t,d,u,l,c);return n.tell(a,r),i.record(n)}{const e=this.clipboard.delete_scope();e&&this.history.record(e)}}}compositionstart(e){this.stats.in_composition_mode=!0,this.clear_selection_text()}compositionupdate(e){this.event.emit_note_compositionupdate(e).some(e=>"stop"===e)}compositionend(e){if(this.event.emit_note_compositionend_before(e).some(e=>"stop"===e))return;const{courier:t,cursor:n,history:i,stats:r,event:s}=this.root;if(n.has_selection)return;if(!r.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,u=e.data,h=new ac(t);if(l&&o&&a){if(l instanceof rd){const e=l.text,t=d-u.length,n=`${e.slice(0,t)}${u}${e.slice(t)}`,i=ed.reset(l.id,n),r=zs.loc(l.id,d,l.id,t);h.tell(l,i,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");r.in_composition_mode=!1,i.record(h),s.emit_note_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:i,cube_start:r,cube_selection:s,offset_start:o,offset_end:a}=e;if(!s||!i||!r)return;const l=new ac(t);l.tell(s,Ts.delete(s.id,"backward",r.id,i.id,o,a)),n.record(l)}ins(e,t,n,i,r,s){const{courier:o,history:a}=t,l=i.text,c=l.slice(0,r)+n+l.slice(s),d=r+n.length,u=ed.reset(i.id,c),h=zs.loc(i.id,d,i.id,r);e.tell(i,u,h);const p=Ts.merge(i.id,"both",i.id,d);return e.tell(i,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:i,offsetNode:r}=this.down_caret;n instanceof Text&&r instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,r,i)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!rc.check_mouse_key(e,"left"))return;const t=document.caretPositionFromPoint(e.clientX,e.clientY);t&&this.down_caret.offsetNode instanceof Text&&t.offsetNode instanceof Text&&this.cursor.set_selection_between(this.down_caret.offsetNode,this.down_caret.offset,t.offsetNode,t.offset)}}class Tl extends Al{}const zl=["id","data-type"],Pl=["transform"],Nl=["data-group"],Rl=["data-group"],Ol=["data-group"],Ll=["data-group"],El=["d"],Il=["d","marker-start","marker-end"],Dl=["d"],Bl={class:"doc-postils"},jl=jn({__name:"cube-map",props:{cube:{}},setup(e){const{status:t}=e.cube,n=new Tl(e.cube),i=Kt(),r=new ResizeObserver(t=>{e.cube.get_view_rect(),mo.resolve()});ii(()=>{const t=i.value;t&&r.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const s=e=>n.pointerdown(e),o=e=>n.pointermove(e),l=e=>n.pointerup(e),c=e=>n.pointercancel(e),d=e=>n.compositionstart(e),u=e=>n.compositionupdate(e),h=e=>n.compositionend(e),p=e=>n.beforeinput(e);return ii(()=>{document.documentElement.addEventListener("pointerup",l),document.documentElement.addEventListener("pointermove",o),document.documentElement.addEventListener("pointercancel",c)}),(e,n)=>(Rr(),Dr("div",{class:"cube-map",id:e.cube.id,"data-type":e.cube.type},[$r("div",{class:"note",onPointerdown:s,onCompositionstart:d,onCompositionupdate:u,onCompositionend:h,onBeforeinput:p},[(Rr(),Dr("svg",{ref_key:"svg",ref:i,style:fe(en(t).css)},[$r("g",{transform:en(t).matrix2d_dom_string},[$r("g",{"data-group":en(a).markers,class:"group-defs"},[...n[0]||(n[0]=[Yr('<defs data-v-70d32f2e>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-70d32f2e><path d="M 0 0 L 6 3 L 0 6 z" data-v-70d32f2e></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-70d32f2e><circle cx="3" cy="3" r="3" data-v-70d32f2e></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-70d32f2e><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-70d32f2e></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-70d32f2e><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-70d32f2e></rect></marker></defs>',1)])],8,Nl),$r("g",{"data-group":en(a).linkers,class:"group-linkers"},[(Rr(!0),Dr(Mr,null,gi(en(t).linkers_view,e=>(Rr(),Br(ao,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Rl),$r("g",{"data-group":en(a).nodes,class:"group-nodes"},[(Rr(!0),Dr(Mr,null,gi(en(t).nodes_view,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Ol),$r("g",{"data-group":en(a).placeholder,class:"group-placeholder"},[en(t).placeholder_box_selector?(Rr(),Dr("path",{key:0,class:"placeholder-box-selector",d:en(t).placeholder_box_selector},null,8,El)):Xr("v-if",!0),(Rr(!0),Dr(Mr,null,gi(en(t).placeholder_linkers,e=>(Rr(),Dr(Mr,{key:e.path},[e?(Rr(),Dr("path",{key:0,class:"placeholder-linker",d:e.path,style:fe({stroke:e.stroke,"stroke-width":e.width}),"marker-start":`url(#${e.anchor_start})`,"marker-end":`url(#${e.anchor_end})`},null,12,Il)):Xr("v-if",!0)],64))),128)),en(t).placeholder_line_delete?(Rr(),Dr("path",{key:1,class:"placeholder-line-delete",d:en(t).placeholder_line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Dl)):Xr("v-if",!0),Gr(co,{interaction:e.cube.interaction},null,8,["interaction"])],8,Ll)],8,Pl)],4)),Xr(" doc-cubes "),$r("div",Bl,[(Rr(!0),Dr(Mr,null,gi(e.cube.cubes.postils,([e,t])=>(Rr(),Br(Zs,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),Xr(" scope selection "),(Rr(!0),Dr(Mr,null,gi(e.cube.scopes.scopes,e=>(Rr(),Br(ro,{key:e.id,selection:Ut(e)},null,8,["selection"]))),128)),Xr(" map status "),Gr(fo,{cube:e.cube},null,8,["cube"]),Xr(" menus "),Gr(vl,{root:e.cube},null,8,["root"]),Gr(Ml,{root:e.cube},null,8,["root"])],8,zl))}}),ql=(0,io.A)(jl,[["__scopeId","data-v-70d32f2e"]]);class Fl extends Ps{_pcube;_children=[];_has_postil=Kt(!1);postil=null;data;constructor(e,t){super(),this._pcube=t;const n=structuredClone(e),i=As.versions,r=this.update_data(i[this.meta.type],n);this.data=r.data,this._setup(),this.cubes.add_cube(this)}get pcube(){return this._pcube}get has_postil(){return this._has_postil.value}set has_postil(e){this._has_postil.value=e,this.status.update_has_postil(e)}get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get float(){return this.root.float}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof gd&&(e+="\n");return this instanceof gd&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof tc)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof Qc?this:this.pcube.host_postil}get in_postil(){return this instanceof Qc||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_first_line(){for(let e of this._children)if(e instanceof gd)return e}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof ic)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof ic)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return this.status.update_children(this._children),{children:i,data:r}}_setup(){this.set_cmd_handler(w.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(w.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(w.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(w.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(w.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(w.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(w.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(w.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(x.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(x.cursor_in_tail,this.on_cursor_in_tail.bind(this)),Rs.init_cmd_handler(this)}setup(){this.build_child(this.data)}create_child_block(e){const t=rc.pick(e);return rc.build_cubes(t.list,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone(this.data);return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof zx||t instanceof ql)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}remove_self(e="backward"){const{pcube:t,courier:n,index:i}=this,r=new ac(n);return r.tell(t,Ts.delete_child(t.id,e,[i,i+1])),r}merge(e){const{pcube:t,cursor:n,courier:i}=this,{cube_end:r,offset_end:s}=n;if(!r)return;const o=new ac(i);return o.tell(this,Ts.merge(this.id,e,r.id,s)),o}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t instanceof ic&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof ic;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:i,start_id:r,end_id:s,offset_end:o,offset_start:a,toggle:l,replace:c}=e,d=new ac(n);if(r!==s||o!==a){if(s&&!r){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Ts.set_selection_css(t.id,i,null,s,"head",o,l,c)),d}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Ts.set_selection_css(t.id,i,r,null,a,"tail",l,c)),d}if("tail"===o&&"head"===a){for(let e of this.children)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d}if(s&&r){const e=this.find_cube(r),t=this.find_cube(s),n=e?.find_upstream_untill(this),u=t?.find_upstream_untill(this);if(!n||!u)return;const h=this.children.slice(n.index+1,u.index);for(let e of h)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(n,Ts.set_selection_css(n.id,i,r,null,a,"tail",l,c)),n!==u&&d.tell(u,Ts.set_selection_css(u.id,i,null,s,"head",o,l,c)),d}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i}=this,r=new ac(t),{data:s,end_id:o,start_id:a,offset_end:l,offset_start:c}=e,d=this.find_cube(a),u=this.find_cube(o),h=d?.find_upstream_untill(this),p=u?.find_upstream_untill(this);if(!h||!p)return r;if(u!==d||c!==l)if(h&&h===p)r.tell(h,Ts.delete(h.id,"backward",a,o,c,l)),r.tell(h,Ts.insert(h.id,s,a,o,c,l));else{r.tell(p,Ts.delete(p.id,"backward",null,o,"head",l)),r.tell(this,Ts.delete_child(this.id,"backward",[h.index+1,p.index])),r.tell(this,Ts.insert_child(this.id,s,h.index+1)),r.tell(h,Ts.delete(h.id,"backward",a,null,c,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&r.tell(t,zs.in_tail(e.id))}else r.tell(u,Ts.insert(o,s,a,o,c,l));return r}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new ac(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Ts.delete_child(this.id,i,[0,t.index],l)),c.tell(t,Ts.delete(t.id,i,r,s,"head",o,l)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Ts.delete_child(this.id,i,[t.index+1,this.child_count],l)),c.tell(t,Ts.delete(t.id,i,r,s,a,o,l)),c}if("head"===a&&"tail"===o){if(l){if(this.is_empty)return;c.tell(this,Ts.delete_child(this.id,i,[1,this.child_count]));const e=this.child_first;e.meta.block?c.tell(e,Ts.delete_child(e.id,i,[0,e.child_count],l)):e instanceof rd?(c.tell(e,ed.reset(e.id,"​")),c.tell(e,zs.loc(e.id,1,e.id,1))):c.tell(e,Ts.reset(e.id,[]))}else c.tell(this.pcube,Ts.delete_child(this.pid,"backward",[this.index,this.index+1]));return c}if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,u=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,Ts.delete(n.id,i,r,s,a,o,!0));else if(c.tell(l,Ts.delete(l.id,i,null,s,"head",o)),c.tell(this,Ts.delete_child(this.id,"backward",[d+1,u])),c.tell(n,Ts.delete(n.id,i,r,null,a,"tail",!0)),e instanceof rd){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return c}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:r,replace:s}=e,o=t.get_recorder();if(o.add_cmd(e),s){const e=structuredClone(this.css);return this.data.css=i,o.add_recover(Ts.set_css(this.id,e,!1,!0)),o}if(0===Object.keys(i).length)return;let a=!0;const l=structuredClone(this.css),c=structuredClone(this.css);for(let e in i){const t=i[e],n=this.css[e]||null;l[e]=n,null===t||r&&t===n?(a=!1,delete c[e]):t!==n&&(a=!1,c[e]=t)}return this.data.css=c,a?void 0:(this.status.update_css(),o.add_recover(Ts.set_css(this.id,l)),o)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(this.attrs[e])||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return this.status.update_attrs(),r.add_recover(Ts.set_attr(this.id,s)),r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i,index:r}=this,{from:s,from_id:o,offset:a}=e,l=new ac(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&l.tell(n,Ts.delete_child(i,"backward",[this.index,this.index+1])),"left"===s?l.tell(e,zs.in_head(e.id)):l.tell(t,zs.in_tail(t.id))}else l.tell(n,Ts.delete_child(i,"backward",[this.index,this.index+1]));return l}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new ac(t),i=this.postil;return e.tell(i,Ts.insert_child(i.id,n,i.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const i=t.get_recorder();i.add_cmd(e);const r=Qc.get_default(n),s=new Qc(r,this);return this.postil=s,i.add_recover(Ts.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,i}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[i,r]=n,s=this.postil;if(!s)return;let o=i<0?0:i,a=r>s.child_count?s.child_count:r;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const i=s.export();return n.add_recover(Ts.postil_add(this.id,i.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new ac(t);return e.tell(s,Ts.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new ac(t);if(this.meta.block){const e=this.child_first;if(!e)return s;s.tell(e,zs.in_head(e.id))}else if(this instanceof rd)this.prev_cube instanceof rd&&this.len>=1?this.set_cursor_in_head(1):this.set_cursor_in_head(0);else if(r&&r instanceof rd)r.set_cursor_in_head();else{const e=rd.get_default();s.tell(i,Ts.insert_child(i.id,[e],this.index+1))}return s}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new ac(t);if(this.meta.block){const e=this.child_last;if(!e)return s;s.tell(e,zs.in_tail(e.id))}else if(this instanceof rd)this.next_cube instanceof rd&&this.len>=1?this.set_cursor_in_tail(1):this.set_cursor_in_tail(0);else if(n&&n instanceof rd)n.set_cursor_in_tail();else{const e=rd.get_default();s.tell(i,Ts.insert_child(i.id,[e],this.index))}return s}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}class Hl{_cube;constructor(e){this._cube=e}get cube(){return this._cube}get pcube(){return this.cube.pcube}}class $l{static get_default(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static to_array(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static is_default(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f}static get_matrix(e,t,n,i,r,s){return{a:e,b:t,c:n,d:i,e:r,f:s}}static get_matrix_translate(e,t){return{a:1,b:0,c:0,d:1,e,f:t}}static get_matrix_scale(e,t){return{a:e,b:0,c:0,d:t,e:0,f:0}}static get_matrix_reflection_horizental(){return{a:1,b:0,c:0,d:-1,e:0,f:0}}static get_matrix_reflection_vertical(){return{a:-1,b:0,c:0,d:1,e:0,f:0}}static multiply(e,t){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}static translate(e,t,n){const i=this.get_matrix_translate(t,n);return this.multiply(e,i)}static get_dom_string(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${i},${r.toFixed(1)},${s.toFixed(1)},${o.toFixed(1)})`}static map_point_to_view(e,t){return{x:e.x+t.x,y:e.y+t.y}}static view_point_to_map(e,t){return{x:e.x-t.x,y:e.y-t.y}}}class Gl{static path=document.createElementNS("http://www.w3.org/2000/svg","path");static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],i=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*i,r=this.path.getPointAtLength(t);n.push({x:r.x,y:r.y})}return n}static get_line_k(e,t){const n=t.y-e.y,i=t.x-e.x;if(0===i)return Number.POSITIVE_INFINITY;return n/i}static find_closest_point(e,t){let n=1/0,i=e[0];const{x:r,y:s}=t;for(let t of e){let e=(r-t.x)**2+(s-t.y)**2;e<n&&(n=e,i=t)}return i}static offset_points(e,t){const n=[],{x:i,y:r}=t;for(let t of e)n.push({x:t.x+i,y:t.y+r});return n}static find_closest_points(e,t){let n=1/0,i=e[0],r=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,i=o,r=s)}}return{from:i,to:r}}static polygonCentroid(e){let t=0,n=0,i=0;const r=e.length;for(let s=0;s<r;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%r],d=o*c-l*a;i+=d,t+=(o+l)*d,n+=(a+c)*d}return i*=.5,t/=6*i,n/=6*i,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let i=0;i<n;i++){const{x:r,y:s}=e[i],{x:o,y:a}=e[(i+1)%n];t+=r*a-o*s}return t/2}static find_line_to_layout_root(e,t=new Set){if(e.is_layout_root)return{has_root:!0,line:[e]};t.add(e.id);for(let n of e.from){if(t.has(n))continue;const i=e.pcube.get_node(n);if(i){if(i.is_layout_root)return{has_root:!0,line:[e,i]};{const n=this.find_line_to_layout_root(i,t);if(n.has_root)return n.line.unshift(e),n}}}return{has_root:!1,line:[]}}static get_linker_id(e,t){return e+"-"+t}static wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}static create_linker_info(e,t,n){const i=e.get_node(t),r=e.get_node(n),s=i?.to.size||0,o=r?.from.size||0;return{linker:Ld.get_default(t,n),index_from:o,index_to:s}}}class Vl{static layout_tree(e){const t=e.env.layout_type;if(t)return"right"===t?this.right(e):"left"===t?this.left(e):"down"===t?this.down(e):"up"===t?this.up(e):"time-down"===t?this.time_down(e):"time-right"===t?this.time_right(e):void 0}static right(e){const t=e.map2d,n=t.rect,i=t.size_tree;return{x:n.x,y:n.y+n.height/2-i.height/2}}static left(e){const t=e.map2d,n=t.rect,i=(t.pos,t.size_tree);return{x:n.x+n.width-i.width,y:n.y+n.height/2-i.height/2}}static down(e){const t=e.map2d,n=t.rect,i=t.pos,r=t.size_tree;return{x:i.x+n.width/2-r.width/2,y:i.y}}static up(e){const t=e.map2d,n=t.rect,i=t.size_tree;return{x:n.x+n.width/2-i.width/2,y:n.y+n.height-i.height}}static time_down(e){const t=e.map2d,n=t.rect;t.pos;let i=n.width;const r=e.env.downstream_visible;for(let e of r){const t=e.map2d.rect.width;t>i&&(i=t)}return{x:n.x+n.width/2-i/2,y:n.y}}static time_right(e){const t=e.map2d,n=t.rect;t.pos;let i=n.height;const r=e.env.downstream_visible;for(let e of r){const t=e.map2d.rect.height;t>i&&(i=t)}return{x:n.x,y:n.y+n.height/2-i/2}}}class Ul{static layout_tree(e){if(0==e.count_to)return[];const t=e.env.layout_type,n=e.env.downstream_visible;return"right"===t?this.right(e,n):"left"===t?this.left(e,n):"down"===t?this.down(e,n):"up"===t?this.up(e,n):"time-down"===t?this.time_down(e,n):"time-right"===t?this.time_right(e,n):this.none(e,n),n}static none(e,t){for(let e=0;e<t.length;e++){const n=t[e],i=Vl.layout_tree(n);i&&n.map2d.update_pos_tree(i.x,i.y,!1)}}static right(e,t){const n=e.map2d.node_gap_x,i=e.map2d.node_gap_y,r=e.map2d,{pos_tree:s,rect:o}=r;let a=s.x+n+o.width,l=s.y,c=0;for(let e=0;e<t.length;e++){const n=t[e].map2d;n.update_pos_tree(a,l+c+e*i),c+=n.size_tree.height}}static left(e,t){const n=e.map2d.node_gap_x,i=e.map2d.node_gap_y,r=e.map2d,{pos_tree:s,rect:o,size_tree:a}=r;let l=s.x+a.width-o.width-n,c=s.y,d=0;for(let e=0;e<t.length;e++){const n=t[e].map2d;n.update_pos_tree(l-n.size_tree.width,c+d+e*i),d+=n.size_tree.height}}static down(e,t){const n=e.map2d.node_gap_x,i=e.map2d.node_gap_y,r=e.map2d,{pos_tree:s,rect:o}=r;let a=s.x,l=s.y+i+o.height,c=0;for(let e=0;e<t.length;e++){const i=t[e].map2d;i.update_pos_tree(a+c+e*n,l),c+=i.size_tree.width}}static up(e,t){const n=e.map2d.node_gap_x,i=e.map2d.node_gap_y,r=e.map2d,{pos_tree:s,rect:o,size_tree:a}=r;let l=s.x,c=s.y+a.height-o.height-i,d=0;for(let e=0;e<t.length;e++){const i=t[e].map2d;i.update_pos_tree(l+d+e*n,c-i.size_tree.height),d+=i.size_tree.width}}static time_right(e,t){const n=e.map2d.node_gap_x,i=(e.map2d.node_gap_y,e.map2d),{pos:r,rect:s}=i;let o=r.x+s.width+n,a=r.y+s.height/2,l=0;for(let e=0;e<t.length;e++){const i=t[e],r=i.map2d,{rect:s,size_tree:c}=r,d=i.attrs.layout;"right"===d||"left"===d?r.update_pos_tree(o+l+e*n,a-c.height/2):"up"===d?r.update_pos_tree(o+l+e*n,a-(c.height-s.height/2)):r.update_pos_tree(o+l+e*n,a-s.height/2),l+=r.size_tree.width}}static time_down(e,t){const n=e.map2d.node_gap_y,i=e.map2d.rect;let r=i.x+i.width/2,s=i.y+i.height+n,o=0;for(let e=0;e<t.length;e++){const i=t[e],a=i.map2d,l=i.env.layout_type,{rect:c,size_tree:d}=a;"left"===l?a.update_pos_tree(r-(d.width-c.width/2),s+o+e*n):"down"===l||"up"===l?a.update_pos_tree(r-d.width/2,s+o+e*n):a.update_pos_tree(r-c.width/2,s+o+e*n),o+=a.size_tree.height}}}class Wl{_node;_map;_upenv;_env={root:void 0,upstream:void 0,downstream:[],layout:null,downstream_all:[],prev:void 0,next:void 0,index:0};constructor(e){this._node=e,this._map=e.pcube}get env(){return{...this._env}}get root(){return this._env.root}get status(){return this.node.status}get map2d(){return this.node.map2d}get map(){return this._map}get to(){return this.node.to}get from(){return this.node.from}get attrs(){return this._node.attrs}get upenv(){return this._upenv}get nodes_to(){return this.node.nodes_to}get nodes_from(){return this.node.nodes_from}get node(){return this._node}get index(){return this.upstream?this.upstream.env.downstream.indexOf(this.node):0}get prev_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e-1]}get next_node(){if(!this.upstream)return;const e=this.index;return this.upstream.env.downstream[e+1]}get level(){return this.is_captive?this.layout_line.length-1:0}get layout_type(){return this._env.layout||this.node.attrs.layout||null}get upstream(){return this._env.upstream}get downstream_nodes_count(){return this._env.downstream_all.length}get downstream_visible(){return this.folded_self?[]:this.downstream}get downstream(){return this._env.downstream}get downstream_nodes(){return this._env.downstream_all}get is_captive(){return!this.is_layout_root&&(this.layout_root&&this.upstream?.env.layout_type)}get is_under_root(){const e=this.layout_root,t=this.layout_root!==this.node;return e&&t}get has_layout_ability(){return this.layout_root}get is_under_free_root(){const e=this.layout_root;return!!e&&!e.env.layout_type}get layout_line(){if(this.is_layout_root)return[this.node];if(!this.upstream)return[];const e=[];let t=this.node;for(;t;){if(e.unshift(t),t.is_layout_root)return e;t=t.env.upstream}return[]}get is_layout_root(){return this.node.is_layout_root||!1}get layout_root(){return this.is_layout_root?this.node:this._env.root}get folded_upstream(){return!this.is_layout_root&&(this.upenv?.folded_self||this.upenv?.folded_upstream)}get folded_self(){return this.node.attrs.fold}get folded(){return this.folded_self||this.folded_upstream}get raw_layout_type(){return this._env.layout||this.attrs.layout||null}clear(){this._upenv=void 0,this._env.upstream=void 0,this._env.downstream.length=0,this._env.layout=null,this._env.root=this.node.is_layout_root?this.node:void 0,this.map2d.update_pos()}check_env(e=!0){const t=Gl.find_line_to_layout_root(this.node);return!t.has_root&&e&&this.clear(),{...t,root:t.line[t.line.length-1]}}free_root(){if(this.check_env(!1).has_root)return;const e=this.node.courier.get_recorder();if(this.folded_self){const t=Ds.layout_change(this.node.id,{fold:!1});e.tell(this.node,t)}const t=this._env.downstream_all;this.clear();const n=new Map;for(let e of t){e.env.clear();const t=e.env.check_env();t.has_root&&n.set(e,t)}const i=new Map;for(let[e,t]of n)for(let e of t.line.slice(1)){const n=t.line[t.line.length-1];if(n&&(e.env.is_captive||e.is_layout_root)){const t=i.get(n);(!t||t.env.level>e.env.level)&&i.set(n,e);break}}for(let[e,t]of i)t.env.flow("downstream"),t.map2d.flow("downstream"),t.map2d.flow("upstream"),t.env.root?.layout_throttle();return e}update(e,t){if(e===this)return console.error("🟠Error: Layout Env loop");this._upenv=e,this._env.upstream=e.node,this._env.root=e.layout_root,this._env.layout=e.get_downstream_layout_type(this.node),this._env.index=t,this._env.prev=e.env.downstream[t-1],this._env.next=e.env.downstream[t+1],this.status.update_layout_type(this.layout_type),this.status.update_has_layout_ability(this.has_layout_ability)}flow(e="downstream",t=!0){if(this._node.is_layout_root&&this.clear(),this._env.downstream.length=0,this._env.downstream_all.length=0,t){if(!this.check_env().has_root)return this._env}for(let e of this.nodes_to){const{has_root:t,line:n}=e.env.check_env();t&&(n[1]===this.node&&(this._env.downstream.push(e),this._env.downstream_all.push(e)))}if(this.status.update_downstream_nodes_count(this.downstream_nodes_count),"self"===e)for(let e=0;e<this._env.downstream.length;e++){this._env.downstream[e].env.update(this,e)}else if("downstream"===e)for(let e=0;e<this._env.downstream.length;e++){const t=this._env.downstream[e];t.env.update(this,e);const n=t.env.flow("downstream",!1);this._env.downstream_all.push(...n.downstream_all)}return this._env}get_downstream_layout_type(e){const t=this.layout_type;if(!t)return null;if(e===this.node)return t;const n=e.attrs.layout||null;return ea.check_allow(this._node,n,!1)?n:"right"===t?"right":"left"===t?"left":"up"===t?"up":"down"===t?"down":"time-right"===t?"time-down":"time-down"===t?"right":t}}class Yl extends Fl{_editable=Kt(!1);_waiter=new Set;_layouted_self=!1;_env=new Wl(this);constructor(e,t){super(e,t),this._init_handler()}get layouted_self(){return this._layouted_self}get is_selected(){return this.pcube.is_node_selected(this)}get env(){return this._env}get mis(){return 2}get map(){return this.pcube}get matrix2d(){return this.attrs.matrix2d}get show(){return this.pcube.is_node_visible(this)}get attrs(){return this.data.attrs}get editable(){return this._editable.value}set editable(e){this.pcube.set_node_editing(this,e),this._editable.value=e;const t=this.courier.get_recorder(),n=this.child_last,i=zs.in_tail(n.id);t.tell(n,i),this.history.record(t)}get is_folded(){return this.attrs.fold||!1}get is_layout_root(){return this.data.attrs.root||!1}get from(){const e=this.pcube.get_node_from(this.id);return new Set(e||[])}get to(){const e=this.pcube.get_node_to(this.id);return new Set(e||[])}get linkers_from(){const e=[];for(let t of this.from){const n=Gl.get_linker_id(t,this.id),i=this.pcube.get_linker(n);i&&e.push(i)}return e}get linkers_to(){const e=[];for(let t of this.to){const n=Gl.get_linker_id(this.id,t),i=this.pcube.get_linker(n);i&&e.push(i)}return e}get node_last(){const e=this.pcube.get_node_to(this.id),t=e?e[e.length-1]:this.id;return this.pcube.get_node(t)||this}get count_from(){return this.from.size}get count_to(){return this.to.size}get nodes_to(){const e=[];for(let t of this.to){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get nodes_from(){const e=[];for(let t of this.from){const n=this.pcube.get_node(t);n&&e.push(n)}return e}get matrix2d_real(){const{a:e,b:t,c:n,d:i,e:r,f:s}=this.matrix2d;if(this.is_layout_root||!this.env.upstream)return{...this.matrix2d};{const r=this.map2d.pos;return{a:e,b:t,c:n,d:i,e:r.x,f:r.y}}}_init_handler(){this.set_cmd_handler(w.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(w.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(w.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(w.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(w.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(S.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(S.layout_update,this.on_layout_update.bind(this))}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof zx||t instanceof hu)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}move_to_center(){const e=this.courier.get_recorder(),t=this.pcube.get_view_center(),n=this.pcube.transform_point(t),i=this.map2d.pos_center,r=this.pcube.real_point_to_fig(i),s=n.x-r.x,o=n.y-r.y,a=$l.multiply(this.pcube.matrix2d,$l.get_matrix_translate(s,o)),l=Ds.layout_change(this.id,{matrix2d:a});return e.tell(this,l),e}move_in_fig_view(){if(this.check_in_fig_view(!0))return;const e=this.pcube,t=e.view_rect,{dx:n,dy:i}=Ws.MathRect.move_rect_in_other(this.map2d.rect,t),r=$l.multiply(e.matrix2d,$l.get_matrix_translate(n,i));e.reset_matrix(r),this.map.check_show()}check_in_fig_view(e=!1){const t=this.pcube.view_rect;return e?Ws.MathRect.is_include(t,this.map2d.rect):Ws.MathRect.check_intersection(t,this.map2d.rect)}check_show_downstream(){return this.env.folded}layout(){let e=Date.now();if(this.is_layout_root&&this.map2d.update_pos_tree_root(),this.env.has_layout_ability){const t=Ul.layout_tree(this);for(let e of t)e.layout();this.is_layout_root&&console.log("⚫布局根布局",this.id,Date.now()-e)}this.is_layout_root&&this.map.check_show_throttle()}layout_throttle=Ws.Notice.throttle(this.layout.bind(this),10);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:i}=t,r=this.map2d.rect_cbox;if(this.layouted_self&&Math.abs(r.width-i)<this.mis&&Math.abs(r.height-n)<this.mis)return;const s={width:Math.ceil(i),height:Math.ceil(n)};this.map2d.update_size(s.width,s.height);for(let e of this._waiter)e();this._layouted_self=!0}wait_layout_self(){return new Promise(e=>{this.layouted_self?e(!0):this._waiter.add(e)})}check_show_line(){const e=this.id;for(let t of this.to){const n=Gl.get_linker_id(e,t),i=this.pcube.get_linker(n);i&&(this.attrs.fold?this.pcube.set_linker_visible(i,!1):i.to_node?.show||this.show?this.pcube.set_linker_visible(i,!0):this.pcube.set_linker_visible(i,!1))}for(let t of this.from){const n=Gl.get_linker_id(t,e),i=this.pcube.get_linker(n);if(!i)continue;let r=i.from_node;const s=!r?.attrs.fold,o=this.show||r?.show;s&&o?this.pcube.set_linker_visible(i,!0):this.pcube.set_linker_visible(i,!1)}}gc(){this.base_gc(),this.map?.grider.remove_node(this)}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return{children:i,data:r}}reset_matrix(e){Object.assign(this.attrs.matrix2d,e),this.map2d.update_pos()}get_node(e){if(e)return this.pcube.get_node(e)}get_layout_index(e){return e.indexOf(this)}translate(e,t){const n=$l.translate(this.matrix2d,e,t);this.reset_matrix(n)}break_link_node(e){this.from.delete(e),this.to.delete(e)}remove_self(){for(let e of this.from){const t=this.pcube.find_child_cube(e);t&&t instanceof Yl&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof Yl&&t.break_link_node(this.id)}return super.remove_self()}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,s=rc.build_cubes(n,this);return this.splice(0,this.child_count,...s),i.add_recover(Ts.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new ac(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Ts.reorder(this.id,o.id,c)),a}on_insert_child(e){const{courier:t}=this,i=t.get_recorder();i.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return i;const o=[];for(let e of s)e.type===n.box_root&&o.push(new Yc(e,this));let a=this.get_valid_index(r);this.splice(a,0,...o);const l=o[o.length-1];return l&&i.tell(l,zs.in_tail(l.id)),i.add_recover(Ts.delete_child(this.id,"backward",[a,a+o.length])),i}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],u=a-o;if(o!==a){if(o<=0&&a>=this.child_count){this.child_first;l.tell(this,Ts.reset(this.id,[]));const e=Ts.insert_child(this.id,[Yc.get_default()],0);return l.tell(this,e),l}{let e=this.splice(o,u);c&&"backward"===r||!d?l.tell(c,zs.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,zs.in_head(d.id));const t=e.data;l.add_recover(Ts.insert_child(this.id,t,o))}return l}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,s=new ac(t),{data:o,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,u=this.find_cube(l),h=this.find_cube(a),p=u?.find_upstream_untill(this),_=h?.find_upstream_untill(this);if(!p||!_)return s;if(h!==u||d!==c)if(p&&p===_)s.tell(p,Ts.delete(p.id,"backward",l,a,d,c)),s.tell(p,Ts.insert(p.id,o,l,a,d,c));else{s.tell(_,Ts.delete(_.id,"backward",null,a,"head",c)),s.tell(this,Ts.delete_child(this.id,"backward",[p.index+1,_.index])),s.tell(this,Ts.insert_child(this.id,e.data,p.index+1)),s.tell(p,Ts.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,zs.in_tail(t.id))}}else s.tell(h,Ts.insert(a,o,l,a,d,c));return s}on_layout_update(e){const{courier:t,history:n}=this,i={...e.attrs},r=t.get_recorder(),s=structuredClone(Vt(this.data.attrs));r.add_cmd(e);const o={fold:s.fold,is_under_root:this.env.is_under_root,upstream:this.env.upstream,is_root:this.is_layout_root};!("layout"in i)||!i.layout||this.env.is_under_root||"root"in i||s.root||(i.root=!0);for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t)}let a=!1,l=!1,c=!1;const d="layout"in i&&s.layout!==i.layout,u="fold"in i&&o.fold!==i.fold,h="gap_x"in i&&s.gap_x!==i.gap_x,p="gap_y"in i&&s.gap_y!==i.gap_y,_="root"in i&&s.root!==i.root;if("matrix2d"in i&&i.matrix2d&&!this.env.is_captive&&(this.map2d.update_pos(),this.env.has_layout_ability)){if(this.env.is_under_free_root){const e=Vl.layout_tree(this);e&&this.map2d.update_pos_tree(e.x,e.y,!1)}this.layout_throttle(),this.is_layout_root&&(c=!0)}if(_)if(!o.is_root&&i.root)o.upstream?.env.flow("self"),o.upstream?.map2d.flow("self"),o.upstream?.map2d.flow("upstream"),o.upstream?.env.layout_root?.layout_throttle(),this.env.flow("downstream"),this.map2d.flow("downstream"),this.layout_throttle(),l=!0,a=!0,c=!0;else if(o.is_root&&!this.is_layout_root){const e=Gl.find_line_to_layout_root(this);if(e.has_root){const t=e.line[1];t?.env.flow("downstream"),t?.map2d.flow("self"),t?.map2d.flow("upstream"),t?.env.layout_root?.layout_throttle()}else r.merge(this.env.free_root()),this.map.check_show_throttle()}if(l||d&&(this.is_layout_root?this.env.flow("downstream"):this.env.upstream?.env.flow("downstream"),this.env.layout_root?.layout_throttle(),l=!0,c=!0),a||(d||u||h||p)&&(this.map2d.flow("downstream"),this.map2d.flow("upstream"),this.env.layout_root?.layout_throttle(),a=!0),c||(d||u||h||p)&&this.env.layout_root?.layout_throttle(),this.status.update_attrs(),"line_type"in i&&s.line_type!==i.line_type){for(let e of this.linkers_to)e.map2d.update_path();console.log("⚪节点连线类型变化",this.linkers_to)}const f=Ds.layout_change(this.id,s);return r.add_recover(f),r}on_append_child(e){const{courier:t,history:n,pcube:i}=this,{previd:r}=e,s=this.map2d.node_gap_x,o=t.get_recorder(),a=this.node_last.map2d,l={x:a.pos.x,y:a.pos.y+a.rect.height+s},c=ou.get_default(l),d=Is.node_add(i.id,[c]);o.tell(i,d);const u=Gl.create_linker_info(this.pcube,this.id,c.id),h=Is.linker_add(i.id,[u]);o.tell(i,h);const p=i.get_node_to(this.id),_=p?.indexOf(c.id);if(p&&void 0!==_&&_>=0)if(null===r)p.splice(_,1),p.unshift(c.id);else if(r){const e=p.indexOf(r);e>=0&&(p.splice(_,1),p.splice(e+1,0,c.id))}return o}static get_default_node_size(e=0){return{width:Us.default_config.map_node_default_width+2*e,height:52+2*e}}static get_default_node_pos(e,t){const{map_node_padding:n}=t.config.data_raw,i=t.view_point_to_real(e),r=Yl.get_default_node_size(n);return{x:i.x-r.width/2,y:i.y-r.height/2}}}class Xl{_map2d;constructor(e){this._map2d=e}get map2d(){return this._map2d}get env(){return this.map2d.env}get_pos(){const e=this.env.layout_type;return"right"===e?this.pos_right():"left"===e?this.pos_left():"down"===e?this.pos_down():"up"===e?this.pos_up():"time-right"===e?this.pos_time_right():"time-down"===e?this.pos_time_down():void 0}get_size_tree(){const e=this.map2d.node,t=e.env.downstream_visible,n=e.env.layout_type,i=this.map2d.rect;return 0===t.length?{...i}:"left"===n?this.size_tree_left(t):"right"===n?this.size_tree_right(t):"down"===n?this.size_tree_down(t):"up"===n?this.size_tree_up(t):"time-right"===n?this.size_tree_time_right(t):"time-down"===n?this.size_tree_time_down(t):void 0}get_root_pos_tree(){return Vl.layout_tree(this.map2d.node)}pos_left(){const e=this.map2d,t={x:0,y:0},n=e.pos_tree,i=e.rect,r=e.size_tree;return t.x=n.x+r.width-i.width,t.y=n.y+r.height/2-i.height/2,t}pos_right(){const e=this.map2d,t={x:0,y:0},n=e.pos_tree,i=e.rect,r=e.size_tree;return t.x=n.x,t.y=n.y-i.height/2+r.height/2,t}pos_up(){const e=this.map2d,t={x:0,y:0},n=e.pos_tree,i=e.rect,r=e.size_tree;return t.x=n.x+r.width/2-i.width/2,t.y=n.y+r.height-i.height,t}pos_down(){const e=this.map2d,t={x:0,y:0},n=e.pos_tree,i=e.rect,r=e.size_tree;return t.x=n.x+r.width/2-i.width/2,t.y=n.y,t}pos_time_right(){const e=this.map2d,t={x:0,y:0},n=e.pos_tree;t.x=n.x;const i=e.node.env.downstream;if(0===i.length)return n;const r=e.rect.height/2;let s=r;for(let e of i){let t=e.map2d.size_tree,n=e.map2d.rect.height/2;if("up"===e.env.layout_type){let e=t.height-n;e>s&&(s=e)}else{n>s&&(s=n)}}return t.y=n.y+s-r,t}pos_time_down(){const e=this.map2d,t=e.pos_tree,n=e.node.env.downstream;if(0===n.length)return t;const i={x:0,y:0};i.y=t.y;const r=e.rect.width/2;let s=r;for(let e of n){let t=e.map2d.size_tree,n=e.map2d.rect.width/2;if("left"===e.env.layout_type){let e=t.width-n;e>s&&(s=e)}else{n>s&&(s=n)}}return i.x=t.x+s-r,i}size_tree_left(e){const t=this.map2d,n={width:0,height:0},i=this.map2d.node_gap_x,r=this.map2d.node_gap_y,s=t.rect;let o=0,a={width:0,height:0},l=0,c={width:0,height:0},d=0;for(let t of e){let e=t.map2d.size_tree,n=t.map2d.rect;d+=e.height,e.width>o&&(o=e.width,a=n),e.height>l&&(l=e.height,c=n)}return n.width=s.width+i+o,n.height=Math.max(s.height,d+(e.length-1)*r),n}size_tree_right(e){const t={width:0,height:0},n=this.map2d.node_gap_x,i=this.map2d.node_gap_y,r=this.map2d.rect;let s=0,o=0,a=0;for(let t of e){let e=t.map2d.size_tree;t.map2d.rect;a+=e.height,e.width>s&&(s=e.width),e.height>o&&(o=e.height)}return t.width=r.width+n+s,t.height=Math.max(r.height,a+(e.length-1)*i),t}size_tree_down(e){const t={width:0,height:0},n=this.map2d.node_gap_x,i=this.map2d.node_gap_y,r=this.map2d.rect;let s=0,o={width:0,height:0},a=0,l={width:0,height:0},c=0;for(let t of e){let e=t.map2d.size_tree,n=t.map2d.rect;c+=e.width,e.width>s&&(s=e.width,o=n),e.height>a&&(a=e.height,l=n)}return t.width=Math.max(r.width,c+(e.length-1)*n),t.height=r.height+i+a,t}size_tree_up(e){const t={width:0,height:0},n=this.map2d.node_gap_x,i=this.map2d.node_gap_y,r=this.map2d.rect;let s=0,o={width:0,height:0},a=0,l={width:0,height:0},c=0;for(let t of e){let e=t.map2d.size_tree,n=t.map2d.rect;c+=e.width,e.width>s&&(s=e.width,o=n),e.height>a&&(a=e.height,l=n)}return t.width=Math.max(r.width,c+(e.length-1)*n),t.height=r.height+i+a,t}size_tree_time_right(e){const t={width:0,height:0},n=this.map2d.node_gap_x,i=(this.map2d.node_gap_y,this.map2d.rect);let r=i.height/2,s=0,o=r,a=r;for(let t of e){let e=t.map2d.size_tree,n=t.map2d.rect.height/2,i=t.env.layout_type;if(s+=e.width,n>o&&(o=n),n>a&&(a=n),"up"===i){let t=e.height-n;t>o&&(o=t)}else{let t=e.height-n;t>a&&(a=t)}}return t.width=i.width+s+e.length*n,t.height=o+a,t}size_tree_time_down(e){const t={width:0,height:0},n=(this.map2d.node_gap_x,this.map2d.node_gap_y),i=this.map2d.rect;let r=i.width/2,s=0,o=r,a=r;for(let t of e){let e=t.map2d.size_tree,n=t.map2d.rect.width/2,i=t.env.layout_type;if(s+=e.height,n>o&&(o=n),n>a&&(a=n),"left"===i){let t=e.width-n;t>o&&(o=t)}else{let t=e.width-n;t>a&&(a=t)}}return t.width=o+a,t.height=i.height+s+e.length*n,t}}class Kl extends Hl{_meter=new Xl(this);_shape_type="rect";_shape_path="";_shape_sample=[];_size_tree=Yl.get_default_node_size();_rect_cbox={x:Us.default_config.map_node_padding,y:Us.default_config.map_node_padding,...Yl.get_default_node_size()};_rect={x:0,y:0,...Yl.get_default_node_size()};_pos_tree={x:0,y:0};_synced_rect=!1;constructor(e){super(e);const t=e.data.attrs,n=t.matrix2d,i=n.e,r=n.f;this.shape_type=t.shape||"rect",this.pos_tree={x:i,y:r},this.rect={x:i,y:r}}get cube(){return this._cube}get node(){return this._cube}get map(){return this.cube.map}get meter(){return this._meter}get config(){return this.cube.config}get env(){return this.cube.env}get status(){return this.cube.status}get matrix2d(){return{...this.node.matrix2d}}get attrs(){return this.cube.attrs}get rect(){return{...this._rect}}set rect(e){Object.assign(this._rect,e),this.sync_rect()}get rect_cbox(){return{...this._rect_cbox}}set rect_cbox(e){Object.assign(this._rect_cbox,e),this.status.update_rect_cbox(this._rect_cbox)}get sample_count(){return 8}get shape_type(){return this._shape_type}set shape_type(e){this._shape_type=e,this.status.update_shape_type(e)}get shape_path(){return this._shape_path}set shape_path(e){this._shape_path=e,this.status.update_shape_path(e)}get shape_sample(){return[...this._shape_sample]}set shape_sample(e){this._shape_sample.length=0,this._shape_sample.push(...e),this.status.update_shape_sample(e)}get size_tree(){return{...this._size_tree}}set size_tree(e){Object.assign(this._size_tree,e)}get pos(){return{x:this._rect.x,y:this._rect.y}}get pos_center(){return{x:this._rect.x+this._rect.width/2,y:this._rect.y+this._rect.height/2}}get pos_tree(){return{...this._pos_tree}}set pos_tree(e){Object.assign(this._pos_tree,e)}get is_layout_root(){return this.cube.is_layout_root}get up2d(){return this.env.upstream?.map2d}get node_fill(){return this.is_layout_root?this.attrs.fill:this.attrs.fill||this.up2d?.node_fill}get node_line_type(){return this.is_layout_root?this.attrs.line_type||this.node.config.data_raw.map_linker_type:this.attrs.line_type||this.up2d?.node_line_type||this.node.config.data_raw.map_linker_type}get node_line_width(){return this.is_layout_root?this.attrs.line_width||this.node.config.data_raw.map_linker_width:this.attrs.line_width||this.up2d?.node_line_width||this.node.config.data_raw.map_linker_width}get node_line_anchor_in(){return this.is_layout_root?this.attrs.anchor_in||this.node.config.data_raw.map_linker_anchor_in:this.attrs.anchor_in||this.up2d?.node_line_anchor_in||this.node.config.data_raw.map_linker_anchor_in}get node_line_anchor_out(){return this.is_layout_root?this.attrs.anchor_out||this.node.config.data_raw.map_linker_anchor_out:this.attrs.anchor_out||this.up2d?.node_line_anchor_out||this.node.config.data_raw.map_linker_anchor_out}get node_gap_x(){return this.is_layout_root?this.attrs.gap_x||this.node.config.data_raw.map_node_gap_x:this.attrs.gap_x||this.up2d?.node_gap_x||this.node.config.data_raw.map_node_gap_x}get node_gap_y(){return this.is_layout_root?this.attrs.gap_y||this.node.config.data_raw.map_node_gap_y:this.attrs.gap_y||this.up2d?.node_gap_y||this.node.config.data_raw.map_node_gap_y}update_pos_cbox(){const e=this.node.attrs.shape,{width:t,height:n}=this.rect,{map_node_padding:i}=this.node.config.data,r=t/2,s=n/2;"circle"===e?(this.rect_cbox={x:r-this._rect_cbox.width/2,y:s-this._rect_cbox.height/2},this._rect_cbox.x=r-this._rect_cbox.width/2,this._rect_cbox.y=s-this._rect_cbox.height/2):(this._rect_cbox.x=i,this._rect_cbox.y=i)}update_pos(){if(this.env.is_captive){if(this.env.folded_self)Object.assign(this._rect,this.pos_tree),this._synced_rect=!1;else if(this.env.has_layout_ability){const e=this.meter.get_pos();e&&(Object.assign(this._rect,e),this._synced_rect=!1)}}else{const e=this.matrix2d,t=e.e,n=e.f;Object.assign(this._rect,{x:t,y:n}),this._synced_rect=!1}this.map.grider.update_node(this.node)}get_pos_center(){const e=this.rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}update_pos_tree_root(){if(!this.node.is_layout_root)return;const e=this.node.env.layout_type,t=this.matrix2d.e,n=this.matrix2d.f;if(!e||this.node.attrs.fold)this._pos_tree.x=t,this._pos_tree.y=n;else{const e=this.meter.get_root_pos_tree();e&&Object.assign(this._pos_tree,e)}}update_pos_tree(e,t,n=!0){this._pos_tree.x=e,this._pos_tree.y=t,n&&this.update_pos()}update_size(e,t){this.rect_cbox={width:e,height:t},this.update_size_bound(),this.update_pos_cbox(),this.pcube.has_layout&&Promise.resolve().then(async()=>{if(this.flow("upstream"),this.pcube.has_layout&&!this.node.clipboard.pasting){const e=this.node.env.layout_root;e&&e.layout_throttle()}})}update_size_bound(){const{map_node_padding:e}=this.node.config.data,t=this._rect_cbox.width+2*e,n=this._rect_cbox.height+2*e;this.rect={width:t,height:n},this.update_path(),this.update_sample()}update_size_tree(){const e=this.meter.get_size_tree();e&&Object.assign(this._size_tree,e)}flow(e="downstream"){const t=this.env.downstream_visible;if(0===t.length&&Object.assign(this._size_tree,this.rect),"downstream"===e){for(let e of t)e.map2d.flow();this.update_size_tree()}else if("upstream"===e){this.update_size_tree();const t=this.env.upstream;t?.is_layout_root?t.map2d.flow("self"):t?.map2d.flow(e)}else"self"===e&&this.update_size_tree()}get_bound_rect_point(e){const t=this.rect;return Ws.MathRect.get_rect_point(t,e)}update_path(){this.shape_path=au.get_shaple(this.node,this.node.config.data_raw.map_node_padding)}update_sample(){if("rect"===this.shape_type){const e=this.rect,t=Ws.MathRect.get_rect_point;this.shape_sample=[t(e,Ws._RectPosition.left_top),t(e,Ws._RectPosition.top_mid),t(e,Ws._RectPosition.right_top),t(e,Ws._RectPosition.right_mid),t(e,Ws._RectPosition.right_bottom),t(e,Ws._RectPosition.bottom_mid),t(e,Ws._RectPosition.left_bottom),t(e,Ws._RectPosition.left_mid),t(e,Ws._RectPosition.left_top)]}else this.shape_sample=Gl.svg_path_sample(this.shape_path,this.sample_count)}sync_rect(){this._synced_rect||(this.status.update_rect(this._rect),this.update_sample(),this._synced_rect=!0)}update_linkers(e){if("to"===e||"all"===e)for(let e of this.node.linkers_to)e.map2d.update_path();if("from"===e||"all"===e)for(let e of this.node.linkers_from)e.map2d.update_path()}}class Jl{__children=[];_cube;_data;_children=Bt(this.__children);_has_postil=Kt(!1);constructor(e){this._cube=e}get cube(){return this._cube}get info(){return this._data.info}get attrs(){return{...this._data.attrs}}get css(){const e=this._data.attrs,t=this.cube.config,n=(e.indent||0)*t.data.line_indent+"px";return{...this._data.css,"margin-left":n}}get children(){return[...this._children]}get has_postil(){return this._has_postil.value}get child_first(){return this._children[0]}get child_last(){return this._children[this._children.length-1]}get child_count(){return this._children.length}init(){this._data=Dt(structuredClone(this.cube.data)),this.__children.splice(0,this.__children.length,...this.cube.children)}update_has_postil(e){this._has_postil.value=e}update_info(){this._data.info=this.cube.info}update_children(e){const t=e||this.cube.children;this._children.splice(0,this._children.length,...t)}update_attrs(e){const t=e||this.cube.attrs;Object.assign(this._data.attrs,t)}update_css(e){const t=e||this.cube.css;Object.assign(this._data.css,t)}}class Ql extends Jl{_rect_cbox=Dt({x:0,y:0,...Yl.get_default_node_size()});_rect=Dt({x:10,y:10,...Yl.get_default_node_size()});_editable=Kt(!1);_shape_type=Kt("rect");_shape_path=Kt("");_shape_sample=Bt([]);_layout_type=Kt(null);_downstream_nodes_count=Kt(0);_has_layout_ability=Kt(!0);constructor(e){super(e)}get cube(){return this._cube}get config(){return this.cube.config}get env(){return this.cube.env}get attrs(){return this._data.attrs}get upstream(){return this.env.upstream}get map2d(){return this.cube.map2d}get layout_type(){return this._layout_type.value}get has_layout_ability(){return this._has_layout_ability.value}get downstream_nodes_count(){return this._downstream_nodes_count.value}get css(){return{...super.css,fill:this.node_fill}}get rect(){return{...this._rect}}get rect_cbox(){return{...this._rect_cbox}}get matrix2d(){return{...this.attrs.matrix2d}}get is_layout_root(){return this.attrs.root||!1}get upstatus(){return this.upstream?.status}get node_fill(){return this.is_layout_root?this.attrs.fill:this.attrs.fill||this.upstream?.status.node_fill}get node_line_type(){return this.is_layout_root?this.attrs.line_type||this.cube.config.data.map_linker_type:this.attrs.line_type||this.upstatus?.node_line_type||this.cube.config.data.map_linker_type}get node_line_width(){return this.is_layout_root?this.attrs.line_width||this.cube.config.data.map_linker_width:this.attrs.line_width||this.upstatus?.node_line_width||this.cube.config.data.map_linker_width}get node_anchor_in(){return this.is_layout_root?this.attrs.anchor_in||this.cube.config.data.map_linker_anchor_in:this.attrs.anchor_in||this.upstatus?.node_anchor_in||this.cube.config.data.map_linker_anchor_in}get node_anchor_out(){return this.is_layout_root?this.attrs.anchor_out||this.cube.config.data.map_linker_anchor_out:this.attrs.anchor_out||this.upstatus?.node_anchor_out||this.cube.config.data.map_linker_anchor_out}get node_gap_x(){return this.is_layout_root?this.attrs.gap_x||this.cube.config.data.map_node_gap_x:this.attrs.gap_x||this.upstatus?.node_gap_x||this.cube.config.data.map_node_gap_x}get node_gap_y(){return this.is_layout_root?this.attrs.gap_y||this.cube.config.data.map_node_gap_y:this.attrs.gap_y||this.upstatus?.node_gap_y||this.cube.config.data.map_node_gap_y}get matrix2d_dom_string(){const{a:e,b:t,c:n,d:i,e:r,f:s}=this.cube.matrix2d,o=this.rect;return`matrix(${e.toFixed(1)},${t},${n},${i.toFixed(1)},${o.x.toFixed(1)},${o.y.toFixed(1)})`}get editable(){return this._editable.value}get shape_type(){return this._shape_type.value}get shape_path(){return this._shape_path.value}get shape_sample(){return[...this._shape_sample]}update_has_layout_ability(e){return Promise.resolve().then(()=>{this._has_layout_ability.value=e})}update_downstream_nodes_count(e){this._downstream_nodes_count.value=e}update_layout_type(e){return Promise.resolve().then(()=>{this._layout_type.value=e})}update_rect(e){Object.assign(this._rect,e)}update_rect_cbox(e){Object.assign(this._rect_cbox,e)}update_matrix2d(e){Object.assign(this.attrs.matrix2d,e||this.cube.matrix2d)}update_editable(e){return Promise.resolve().then(()=>{this._editable.value=e})}update_shape_type(e){return Promise.resolve().then(()=>{this._shape_type.value=e})}update_shape_path(e){return Promise.resolve().then(()=>{this._shape_path.value=e})}update_shape_sample(e){return Promise.resolve().then(()=>{this._shape_sample.splice(0,this._shape_sample.length,...e)})}update_attrs(e){super.update_attrs(e),this.update_matrix2d(this.cube.matrix2d)}}class Zl extends ks{_id=Cs();scroll_offset=100;_freeze=Kt(!1);get meta(){return Zl.meta}get id(){return this._id}pos=Dt({x:0,y:0,width:0,height:0});css=Dt({});get freeze(){return this._freeze.value}set freeze(e){this._freeze.value=e}_direction=null;get focus_cube(){return this.selection_line[this.selection_line.length-1]}get second_cube(){return this.selection_line.length<=1?void 0:this.selection_line[this.selection_line.length-2]}get len(){return this.selection_line.length}selection_line=[];constructor(e,t){super(e),this.selection_line.push(t),this.listener.check_float()}expand(e){if(!(this.focus_cube instanceof Qc&&this._direction===e))if("up"===e){if("down"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.prev_cube||this.focus_cube.pcube;if(!e||e instanceof tc)return;if(e instanceof Fl)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="up"),this.selection_line.push(e),this.update_area())}else{if("up"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.next_cube||this.focus_cube.pcube;if(!e||e instanceof tc)return;if(e instanceof Fl)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="down"),this.selection_line.push(e),this.update_area())}}shrink(){1!==this.selection_line.length&&(this.selection_line.pop(),this.update_area())}update_area(e=!0){if(e){const e=[];for(let t of this.selection_line){const n=t.clientRect;n&&e.push(n)}if(0===e.length)return this.remove();const t=Ws.MathRect.merge(...e);this.css.width=`${t.width}px`,this.css.height=`${t.height}px`,this.css.left=t.x+"px",this.css.top=t.y+"px",this.pos.x=t.x+document.documentElement.scrollLeft,this.pos.y=t.y+document.documentElement.scrollTop,this.pos.width=t.width,this.pos.height=t.height}else{const e=this.pos.x-document.documentElement.scrollLeft,t=this.pos.y-document.documentElement.scrollTop;this.css.left=e+"px",this.css.top=t+"px"}}find_line_next(e){if(this.selection_line.indexOf(e)<this.selection_line.length)return this.selection_line[this.selection_line.length-1]}find_line_prev(e){const t=this.selection_line.indexOf(e);if(t>0)return this.selection_line[t-1]}get_scope_info(){let e=this.focus_cube.level;const t=this.focus_cube.pcube,n=[],i=[];for(let t of this.selection_line){const r=t.level,s=t.index;r===e&&(n.push(t),i.push(s))}return{cube:t,range:[Math.min(...i),Math.max(...i)+1],from:this.id}}remove(){this.root.scopes.remove_scope(this.id),this.event.emit_status_update()}find_scope_lines(){const e=this.root.scopes.get_scope_cubes(),t=[],n=[];for(let n of e)t.push(...rc.get_flat_cube(n.cube));for(let e of t)e instanceof gd&&n.push(e);return n}find_inline_data(){const e=[],t=this.find_scope_lines();for(let n of t)e.push(...n.children);return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.scope,version:1}}}class ec extends ks{_raw_scopes=new Set;_scopes=Bt(this._raw_scopes);constructor(e){super(e)}get scope_size(){return this._scopes.size}get raw_scopes(){return new Set(this._raw_scopes)}get scopes(){return new Set(this._scopes)}get scope_count_freeze(){let e=0;for(let t of this.scopes)t.freeze&&e++;return e}get raw_scope_count_freeze(){let e=0;for(let t of this.raw_scopes)t.freeze&&e++;return e}get scope_count_normal(){return this.scopes.size-this.scope_count_freeze}get raw_scope_count_normal(){return this.raw_scopes.size-this.raw_scope_count_freeze}get scope_normal(){const e=new Set;for(let t of this.scopes)t.freeze||e.add(t);return e}get raw_scope_normal(){const e=new Set;for(let t of this.raw_scopes)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this.scopes)t.freeze&&e.add(t);return e}get raw_scope_freeze(){const e=new Set;for(let t of this.raw_scopes)t.freeze&&e.add(t);return e}clear_scopes(){this._scopes.clear()}add_scope_by_cube(e){const t=new Zl(this.root,e);this._scopes.add(t),this.event.emit_status_update()}add_scope(e=!1){if(e){const e=this.cursor.cube_end;if(!e||e instanceof tc)return Ss.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(e)}else{const e=this.stats.view_point,t=this.cursor.find_cube_by_coor(e);if(!(t&&t instanceof ic))return Ss.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(t)}}remove_scope(e){if(e instanceof Zl)this._scopes.delete(e);else for(let t of this._scopes)if(t.id===e){this._scopes.delete(t);break}}clear_scope(e=!0){for(let t of this._scopes)e&&t.freeze||this.remove_scope(t)}freeze_scopes(){for(let e of this._scopes)e.freeze=!0}sort_scope(){const e=[...this._scopes];return e.sort((e,t)=>e.pos.y-t.pos.y),e}get_scope_cubes(e=!1,t=!0){if(0===this._scopes.size)return[];const n=[],i=e?this.sort_scope():this._scopes;for(let e of i)t&&e.freeze||n.push(e.get_scope_info());return n}get_scope_cubes_data(){const e=this.get_scope_cubes(),t=[];for(let n of e)t.push(...n.cube.copy(n.range[0],n.range[1]));return t}}class tc extends Ps{_dom;_children=[];_cubes=new Es(this);_hotkeys=new Fs(this);_config=new Us(this);_history=new oc(this);_cursor=new Ys(this);_courier=new Xs(this);_clipboard=new Vs(this);_painter=new Gs(this);_event=new $s(this);_stats=new Hs(this);_listener=new Ls(this);_float=new Qs(this);_scopes=new ec(this);_isdev=!1;data;constructor(e){super();const t=structuredClone(e),n=this.update_data(As.versions[this.meta.type],t);if(!n.data||!n.usable)throw Error(`CubeRoot setup data failed, data unusable after update${n}`);this.data=n.data,this._cubes.add_cube(this),this.set_cmd_handler(w.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(w.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(w.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(w.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(w.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(w.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(w.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(w.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(x.cursor_in_tail,this.on_cursor_in_tail.bind(this)),Rs.init_cmd_handler(this)}get children(){return[...this._children]}get scopes(){return this._scopes}get editable(){return!0}get config(){return this._config}get hotkeys(){return this._hotkeys}get stats(){return this._stats}get cubes(){return this._cubes}get cursor(){return this._cursor}get listener(){return this._listener}get float(){return this._float}get courier(){return this._courier}get history(){return this._history}get clipboard(){return this._clipboard}get painter(){return this._painter}get event(){return this._event}get root(){return this}get isdev(){return this._isdev}get dom(){return document.getElementById(this.id)}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get pid(){}get index(){return 0}get css(){return{...this.data.css}}get attrs(){return structuredClone(this.data.attrs)}get info(){return this.data.info}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_last(){return this.children[this.children.length-1]}get id(){return this.data.id}get pcube(){}get type(){return this.data.type}get versions(){return structuredClone(this.data.versions)}get level(){return 0}get in_postil(){return!1}get host_postil(){return null}get next_cube_deep(){}get prev_cube_deep(){}get root_dom(){return this._dom}get is_empty(){const e=1===this.child_count,t=this.child_first.is_empty;return e&&t}get prev_cube(){}get next_cube(){}set_dev(e=!0){this._isdev=e,window.root=this}setup(){this.build_child(this.data)}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}is_contains_cube(e){return!!e&&e.root===this}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}copy(e,t){const n=this.children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_upstream_untill(){}delete_edge(e,t){const{courier:n}=this,i=new ac(n);if("backward"===t){const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.prev_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.next_cube;if(r&&n.type===r.type)return r.merge("left");if(n)return i.tell(n,zs.in_tail(n.id))}else{const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.next_cube_deep;if(n&&n.is_empty)return n.remove_self();const r=n?.prev_cube;if(r&&n.type===r.type)return n.merge("left");if(n)return i.tell(n,zs.in_tail(n.id))}}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return this.status.update_children(this._children),{children:i,data:r}}get_sdk_version(){return As.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=this.export().info,s=rc.build_cubes(n,this);return this.splice(0,this.child_count,...s),i.add_recover(Ts.reset(this.id,r)),i}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new ac(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Ts.reorder(this.id,o.id,c)),a}on_insert_cube(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:i,data:r}=e;if(0===r.length)return n;const s=rc.pick(r,!0),o=[],a=Yc.get_default();s.head.length>0&&a.info.push(gd.get_default(s.head)),a.info.push(...s.body),s.tail.length>0&&a.info.push(gd.get_default(s.tail)),o.push(new Yc(a,this));for(let e of s.roots)o.push(new Yc(e,this));let l=this.get_valid_index(i);this.splice(l,0,...o);const c=o[o.length-1];return c&&n.tell(c,zs.in_tail(c.id)),n.add_recover(Ts.delete_child(this.id,"backward",[l,l+o.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:i}=this,{dir:r,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],u=a-o;if(o!==a){if(o<=0&&a>=this.child_count){const e=this.child_first;return this.child_count>1&&l.tell(this,Ts.delete_child(this.id,r,[1,this.child_count])),e.is_empty||l.tell(e,Ts.reset(e.id,[])),l}{let e=this.splice(o,u);c&&"backward"===r||!d?l.tell(c,zs.in_tail(c.id)):(d&&"forward"===r||!c)&&l.tell(d,zs.in_head(d.id));const t=e.data;l.add_recover(Ts.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:i,pid:r}=this,{css:s,start_id:o,end_id:a,offset_end:l,offset_start:c}=e,d=new ac(n);if(o!==a||l!==c){if(a&&!o){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Ts.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(t,Ts.set_selection_css(t.id,s,null,a,"head",l)),d}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Ts.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(t,Ts.set_selection_css(t.id,s,o,null,c,"tail")),d}if("tail"===l&&"head"===c){for(let e of this.children)d.tell(e,Ts.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d}if(a&&o){const e=this.find_cube(o),t=this.find_cube(a),n=e?.find_upstream_untill(this),i=t?.find_upstream_untill(this);if(!n||!i)return;const r=this.children.slice(n.index+1,i.index);for(let e of r)d.tell(e,Ts.set_selection_css(e.id,s,e.id,e.id,"head","tail"));return d.tell(n,Ts.set_selection_css(n.id,s,o,null,c,"tail")),d.tell(i,Ts.set_selection_css(i.id,s,null,a,"head",l)),d}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i,pcube:r}=this,s=new ac(t),{data:o,end_id:a,start_id:l,offset_end:c,offset_start:d}=e,u=this.find_cube(l),h=this.find_cube(a),p=u?.find_upstream_untill(this),_=h?.find_upstream_untill(this);if(!p||!_)return s;if(h!==u||d!==c)if(p&&p===_)s.tell(p,Ts.delete(p.id,"backward",l,a,d,c)),s.tell(p,Ts.insert(p.id,o,l,a,d,c));else{s.tell(_,Ts.delete(_.id,"backward",null,a,"head",c)),s.tell(this,Ts.delete_child(this.id,"backward",[p.index+1,_.index])),s.tell(this,Ts.insert_child(this.id,e.data,p.index+1)),s.tell(p,Ts.delete(p.id,"backward",l,null,d,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,zs.in_tail(t.id))}}else s.tell(h,Ts.insert(a,o,l,a,d,c));return s}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new ac(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Ts.delete_child(this.id,i,[0,t.index])),c.tell(t,Ts.delete(t.id,i,r,s,"head",o)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Ts.delete_child(this.id,i,[t.index+1,this.child_count])),c.tell(t,Ts.delete(t.id,i,r,s,a,o)),c}if("head"===a&&"tail"===o)return c.tell(this,Ts.reset(this.id,[])),c;if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!(e instanceof rd&&t instanceof rd))return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,u=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,Ts.delete(n.id,i,r,s,a,o,!0));else{c.tell(l,Ts.delete(l.id,i,null,s,"head",o)),c.tell(this,Ts.delete_child(this.id,"backward",[d+1,u])),c.tell(n,Ts.delete(n.id,i,r,null,a,"tail",!0));let t=0;if("number"==typeof a&&(t=a),c.tell(n,Ts.merge(n.id,"right",r,t)),n.is_empty)c.tell(this,Ts.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof rd){const n=e.pcube;c.tell(n,Ts.merge(n.id,"right",r,t))}}return c}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(Vt(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return this.status.update_attrs(this.attrs),r.add_recover(Ts.set_attr(this.id,s)),r}on_cursor_in_tail(e){const{courier:t}=this,n=this.child_last,i=new ac(t);if(n)return i.tell(n,zs.in_tail(n.id)),i}}class nc extends Jl{_scopes=Bt(new Set);constructor(e){super(e)}get scopes(){return new Set(this._scopes)}get css(){const e=this.cube.config.css_vars;return{...super.css,...e}}get scopes_count(){return this._scopes.size}get scope_count_normal(){let e=0;for(let t of this._scopes)t.freeze||e++;return e}get scope_count_freeze(){return this.scopes_count-this.scope_count_normal}get scope_normal(){const e=new Set;for(let t of this._scopes)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this._scopes)t.freeze&&e.add(t);return e}init(){this._data=Dt(structuredClone({...this.cube.data,info:[]})),this.update_children()}add_scope(e){this._scopes.add(Ut(e))}remove_scope(e){this._scopes.delete(e)}clear_scopes(){this._scopes.clear()}}class ic extends Ps{_pcube;_children=[];_has_postil=!1;data;postil=null;constructor(e,t){super(),this._pcube=t;const n=structuredClone(e),i=As.versions,r=this.update_data(i[this.meta.type],n);this.data=r.data,this._setup(),this.cubes.add_cube(this)}get pcube(){return this._pcube}get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get float(){return this.root.float}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof gd&&(e+="\n");return this instanceof gd&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof tc)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get has_postil(){return this._has_postil}set has_postil(e){this._has_postil=e,this.status.update_has_postil(e)}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof Qc?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e;){if(e instanceof Yl)return e;e=e.pcube}}get in_postil(){return this instanceof Qc||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_first_line(){for(let e of this._children)if(e instanceof gd)return e}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return this.data.css||(this.data.css={}),{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof ic)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof ic)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}splice(e,t,...n){const i=this._children.splice(e,t,...n);for(let e of i)e.gc();const r=[];for(let e of i)r.push(e.export());return this.status.update_children(this._children),{children:i,data:r}}_setup(){this.set_cmd_handler(w.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(w.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(w.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(w.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(w.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(w.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(w.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(w.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(x.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(x.cursor_in_tail,this.on_cursor_in_tail.bind(this)),Rs.init_cmd_handler(this)}setup(){this.build_child(this.data)}create_child_block(e){const t=rc.pick(e);return rc.build_cubes(t.list,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone(Vt(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),i=[];for(let e of n){let t=e.export();i.push(t)}return i}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof zx||t instanceof hu)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}remove_self(e="backward"){const{pcube:t,courier:n,index:i}=this,r=new ac(n);return r.tell(t,Ts.delete_child(t.id,e,[i,i+1])),r}merge(e){const{pcube:t,cursor:n,courier:i}=this,{cube_end:r,offset_end:s}=n;if(!r)return;const o=i.get_recorder();return o.tell(this,Ts.merge(this.id,e,r.id,s)),o}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:i,start_id:r,end_id:s,offset_end:o,offset_start:a,toggle:l,replace:c}=e,d=new ac(n);if(r!==s||o!==a){if(s&&!r){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Ts.set_selection_css(t.id,i,null,s,"head",o,l,c)),d}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(t,Ts.set_selection_css(t.id,i,r,null,a,"tail",l,c)),d}if("tail"===o&&"head"===a){for(let e of this.children)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d}if(s&&r){const e=this.find_cube(r),t=this.find_cube(s),n=e?.find_upstream_untill(this),u=t?.find_upstream_untill(this);if(!n||!u)return;const h=this.children.slice(n.index+1,u.index);for(let e of h)d.tell(e,Ts.set_selection_css(e.id,i,e.id,e.id,"head","tail",l,c));return d.tell(n,Ts.set_selection_css(n.id,i,r,null,a,"tail",l,c)),n!==u&&d.tell(u,Ts.set_selection_css(u.id,i,null,s,"head",o,l,c)),d}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:i}=this,r=new ac(t),{data:s,end_id:o,start_id:a,offset_end:l,offset_start:c}=e,d=this.find_cube(a),u=this.find_cube(o),h=d?.find_upstream_untill(this),p=u?.find_upstream_untill(this);if(!h||!p)return r;if(u!==d||c!==l)if(h&&h===p)r.tell(h,Ts.delete(h.id,"backward",a,o,c,l)),r.tell(h,Ts.insert(h.id,s,a,o,c,l));else{r.tell(p,Ts.delete(p.id,"backward",null,o,"head",l)),r.tell(this,Ts.delete_child(this.id,"backward",[h.index+1,p.index])),r.tell(this,Ts.insert_child(this.id,s,h.index+1)),r.tell(h,Ts.delete(h.id,"backward",a,null,c,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&r.tell(t,zs.in_tail(e.id))}else r.tell(u,Ts.insert(o,s,a,o,c,l));return r}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:i,start_id:r,end_id:s,offset_end:o,offset_start:a,reserve:l}=e,c=new ac(t);if(!r&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Ts.delete_child(this.id,i,[0,t.index],l)),c.tell(t,Ts.delete(t.id,i,r,s,"head",o,l)),c}if(r&&!s){const e=this.find_cube(r),t=e?.find_upstream_untill(this);if(!t||!e)return;return c.tell(this,Ts.delete_child(this.id,i,[t.index+1,this.child_count],l)),c.tell(t,Ts.delete(t.id,i,r,s,a,o,l)),c}if("head"===a&&"tail"===o){if(l){if(this.is_empty)return;c.tell(this,Ts.delete_child(this.id,i,[1,this.child_count]));const e=this.child_first;e.meta.block?c.tell(e,Ts.delete_child(e.id,i,[0,e.child_count],l)):e instanceof rd?(c.tell(e,ed.reset(e.id,"​")),c.tell(e,zs.loc(e.id,1,e.id,1))):c.tell(e,Ts.reset(e.id,[]))}else c.tell(this.pcube,Ts.delete_child(this.pid,"backward",[this.index,this.index+1]));return c}if(r&&s){const e=this.find_cube(r),t=this.find_cube(s);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return c;const d=n.index,u=l.index;if(r!==s||a!==o)if(n===l)c.tell(n,Ts.delete(n.id,i,r,s,a,o,!0));else if(c.tell(l,Ts.delete(l.id,i,null,s,"head",o)),c.tell(this,Ts.delete_child(this.id,"backward",[d+1,u])),c.tell(n,Ts.delete(n.id,i,r,null,a,"tail",!0)),e instanceof rd){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return c}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:r,replace:s}=e,o=t.get_recorder();if(o.add_cmd(e),s){const e=structuredClone(Vt(this.css));return this.data.css=i,o.add_recover(Ts.set_css(this.id,e,!1,!0)),o}if(0===Object.keys(i).length)return;let a=!0;const l=structuredClone(Vt(this.css)),c=structuredClone(Vt(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;l[e]=n,null===t||r&&t===n?(a=!1,delete c[e]):t!==n&&(a=!1,c[e]=t)}return this.data.css=c,a?void 0:(this.status.update_css(this.css),o.add_recover(Ts.set_css(this.id,l)),o)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===Object.keys(i).length)return;const s={};for(let e in i){const t=i[e];s[e]=structuredClone(Vt(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return this.status.update_attrs(this.attrs),r.add_recover(Ts.set_attr(this.id,s)),r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i,index:r}=this,{from:s,from_id:o,offset:a}=e,l=new ac(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&l.tell(n,Ts.delete_child(i,"backward",[this.index,this.index+1])),"left"===s?l.tell(e,zs.in_head(e.id)):l.tell(t,zs.in_tail(t.id))}else l.tell(n,Ts.delete_child(i,"backward",[this.index,this.index+1]));return l}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new ac(t);return e.tell(this.postil,Ts.insert_child(this.postil.id,n,this.postil.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const i=t.get_recorder();i.add_cmd(e);const r=Qc.get_default(n),s=new Qc(r,this);return this.postil=s,i.add_recover(Ts.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,i}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[i,r]=n,s=this.postil;if(!s)return;let o=i<0?0:i,a=r>s.child_count?s.child_count:r;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const i=s.export();return n.add_recover(Ts.postil_add(this.id,i.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new ac(t);return e.tell(s,Ts.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new ac(t);if(this.meta.block){const e=this.child_first;if(!e)return s;s.tell(e,zs.in_head(e.id))}else if(this instanceof rd)this.prev_cube instanceof rd&&this.len>=1?this.set_cursor_in_head(1):this.set_cursor_in_head(0);else if(r&&r instanceof rd)r.set_cursor_in_head();else{const e=rd.get_default();s.tell(i,Ts.insert_child(i.id,[e],this.index+1))}return s}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new ac(t);if(this.meta.block){const e=this.child_last;if(!e)return s;s.tell(e,zs.in_tail(e.id))}else if(this instanceof rd)this.next_cube instanceof rd&&this.len>=1?this.set_cursor_in_tail(1):this.set_cursor_in_tail(0);else if(n&&n instanceof rd)n.set_cursor_in_tail();else{const e=rd.get_default();s.tell(i,Ts.insert_child(i.id,[e],this.index))}return s}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}class rc{static get_id(){return Cs()}static get_char_zws(){return"​"}static async sleep(e=100){return new Promise(t=>{setTimeout(t,e)})}static is_same_style(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n){if(e[i]!==t[i])return!1}return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),i=new Set(Object.keys(t)),r=new Set([...n,...i]);if(n.size!==r.size||n.size!==i.size)return!1;for(let i of n){if(e[i]!==t[i])return!1}return!0}async locate(e,t,n=!0){const{courier:i,history:r}=e,s=e.find_cube(t),o=Ss.tips;if(s instanceof ic&&s.top){const e=s.top;if(s.find_upstream_untill(e)!==e.child_first){const t=i.get_recorder();t.tell(e,Ts.fold(e.id,!1)),r.record(t)}}const a=document.getElementById(t);if(!a)return o?.tip_error("未发现书签锚点");let l=a.style.backgroundColor;a.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===a.style.backgroundColor&&(a.style.backgroundColor=l)},3e3),n&&a.scrollIntoView({block:"center",behavior:"instant"})}static exports(e){const t=[];for(let n of e)t.push(n.export());return t}static build_cubes(e,t,n=[]){for(let i of e){if(!i)continue;let e=As.find_cube(i.type);if(e)n.push(new e(i,t));else{const e=new xc(i,t,"未注册cube");n.push(e)}}return n}static get_client_rects(e){const t=document.getElementById(e);if(t)return t.getClientRects()}static pick(e,t=!1){const i=As.metas;let r=[],s=[],o=[],a=[],l=null,c=e,d=[];for(let t=0;t<e.length;t++){const i=e[t];if(i.type===n.box_root){c=e.slice(0,t),d=e.slice(t+1),l=i,a.push(l);break}}let u=-1,h=-1;for(let e=0;e<c.length;e++){const t=c[e];i.get(t.type)?.block&&(u<0?u=e:h=e)}if(u>=0&&h>=0){const e=c.slice(0,u),a=c.slice(h+1),l=[];let d=gd.get_default();d.info=[];for(let e of c.slice(u,h+1))i.get(e.type)?.block?(e.type===n.box&&t?l.push(...e.info):l.push(e),d.info.length>0&&(l.push(d),d=gd.get_default(),d.info=[])):d.info.push(e);r=e,s=l,o=a}else if(u>=0&&h<0){r=c.slice(0,u),o=c.slice(u+1);const e=c.slice(u,u+1);if(t)for(let t of e)t.type===n.box?s.push(...t.info):s.push(t);else s=e}else r=c,s=[],o=[];if(l){let e=gd.get_default();e.info=[];for(let t of d)t.type===n.box_root?(l=t,a.push(t)):i.get(t.type)?.block?(t.type===n.box?l.info.push(...t.info):l.info.push(t),e.info.length>0&&l&&(l.info.push(e),e=gd.get_default())):e.info.push(t);e.info.length>0&&l&&l.info.push(e)}const p=[];if(r.length>0&&p.push(gd.get_default(r)),s.length>0&&p.push(...s),o.length>0&&p.push(gd.get_default(o)),a.length>0)for(let e of a)p.push(...e.info);return{head:r,body:s,tail:o,roots:a,list:p}}static find_line(e,t="first"){if(e instanceof gd)return e;const n=As.metas.get(e.type);if(!n||!n.block)return;const i="first"===t?e.children:e.children.reverse();for(let e of i){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!rd.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,i=[];if(t)for(let e of n)i.push(e),i.push(...this.get_flat_cube(e));else{i.push(...n);for(let e of i)i.push(...e.children)}return i}static replace_id(e,t,n={}){const i=As.versions,r=[];for(let s of t){const t=As.find_cube(s.type);if(!t||!t.replace_id)continue;const o=i[t.meta.type]||1,a=t.update_data(o,s);r.push(t.replace_id(e,a.data,n))}return r}static insert_cubes(e,t){const{courier:n,history:i,cursor:r}=e,{cube_selection:s,cube_start:o,cube_end:a,offset_end:l,offset_start:c}=r;if(!s||!o||!a)return;const d=new ac(n);return r.has_selection&&d.tell(s,Ts.delete(s.id,"backward",o.id,a.id,c,l)),d.tell(o,Ts.insert(o.id,t,o.id,o.id,c,c)),d}static check_mouse_key(e,t){let n={left:{pointermove:{button:-1,buttons:1},pointerdown:{button:0,buttons:1},pointerup:{button:0,buttons:0}},right:{pointermove:{button:-1,buttons:2},pointerdown:{button:2,buttons:2},pointerup:{button:2,buttons:0}},mid:{pointermove:{button:-1,buttons:4},pointerdown:{button:1,buttons:4},pointerup:{button:1,buttons:0}}}[t][e.type];return e.button==n.button&&e.buttons==n.buttons}}class sc extends ks{_record;_resolve;_status=C.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return sc.meta}get status(){return this._status}constructor(e,t){const n=Ss.tips;super(e),this._record=t,this._prev_tip_remove=n?.tip_info("播放器已就绪,点我播放",1/0,this.play.bind(this))}waiting(){return new Promise(e=>{this._resolve=e;[C.pending,C.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=Ss.tips;this.clear_message(),this.status!==C.stop&&(this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)));for(let e of this._record.stack){const t=this.courier.get_recorder();for(let n of e.do){await rc.sleep(this.config.data.player_speed),await vn(),this.stats.showing=!0;let e=this.root.find_cube(n.id);e?(e.dom?.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}),t.tell(e,n)):console.warn(`未发现演示cube:${n}`)}await vn(),this.history.record(t),await this.waiting()}this._status=C.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=Ss.tips;this.clear_message(),this._status!==C.stop&&(this._status=C.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=Ss.tips;this.clear_message(),this._status!==C.stop&&(this._resolve&&this._resolve(),this._status=C.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)))}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:t.player,version:1}}}class oc extends ks{stack_undo=Bt([]);stack_redo=Bt([]);get meta(){return oc.meta}get len_undo(){return this.stack_undo.length}get len_redo(){return this.stack_redo.length}constructor(e){super(e)}execute_command_group(e){let t=Promise.resolve();for(let n of e)t.then(()=>vn(()=>this.courier.pass(n)))}undo(){const e=Ss.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_undo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_redo.push(t);const n=t.stack_undo;this.execute_command_group(n),this.event.emit_status_update()}redo(){const e=Ss.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_redo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_undo.push(t);const n=t.stack_do;this.execute_command_group(n),this.event.emit_status_update()}record(e){if(!this.stats.is_read_mode&&0!==e.stack_undo.length){if(this.config.data.history_length>0&&this.config.data.history_length<Number.POSITIVE_INFINITY){const e=this.stack_undo.length-this.config.data.history_length;e>0&&this.stack_undo.splice(0,e)}this.stack_undo.push(e),this.event.emit_status_update()}}play(e){return new sc(this.root,e)}export(e=0){const t=this.stack_undo.slice(e),n={version:this.meta.version,stack:[],docid:this.root.id};for(let e of t)n.stack.push({do:e.stack_do,undo:e.stack_undo});return n}download(e="record.json"){const t=this.export(),n=document.createElement("a");n.download="filename";const i=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(i),n.click()}update_data(...e){return{}}clear_stack(){this.stack_undo.length=0,this.stack_redo.length=0,this.event.emit_status_update()}static get meta(){return{type:t.history,version:1}}}class ac{do=[];undo=[];courier;get len_do(){return this.do.length}get len_undo(){return this.undo.length}get stack_do(){const e=[];return e.push(...this.do),e}get stack_undo(){const e=[];return e.push(...this.undo),e}constructor(e){this.courier=e}add_cmd(e){this.do.push(structuredClone(Vt(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof ac&&this.merge(t)}tick(e,t){vn(()=>{t?this.tell(t,e):this.courier.pass(e)})}get_cube_upstream(e,t=!0){let n=[],i=t?e:e.pcube;for(;i;)n.push(i),i=i.pcube;return n}tell(e,...t){const n=Ss.tips;if(!e)return this;if(this.courier.stats.mode===A.read)return n?.tip_info("只读模式不可操作"),this;const i=this.get_cube_upstream(e,!1).reverse();if(e instanceof ic)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_capture(r).stop)return this}for(let n of t){if(!e||e.id!==n.id)continue;console.log("🟩",e,e.type,n),this.courier.event.emit_edit_before(e,n);let t=e.on(n);this.merge(t),this.courier.event.emit_edit_after(e,n)}if(e instanceof ic)for(let n of i){const r={recorder:this,path:[...i],tcube:e,cmds:structuredClone(t)};if(n.event_bubble(r).stop)return this}return this}merge(e){return e instanceof ac?(this.do.push(...structuredClone(Vt(e.stack_do))),this.undo.unshift(...structuredClone(Vt(e.stack_undo))),this):this}}function lc(e,t){return t.css.width?Number.parseInt(t.css.width.trim().slice(0,-2)):e.getBoundingClientRect().width}function cc(e,t,n,i){e.stopPropagation(),e.preventDefault(),i.isdown=!0,i.dir=n,i.dom=t.dom;const r=e.currentTarget,s=r.parentElement?.parentElement;if(!s)return;i.x=e.clientX,i.width_origin=t.css.width;const o=lc(s,t);i.width=o,i.width_result=o}const dc=["id","data-type"],uc={class:"tools-left"},hc={class:"tools-right"},pc=["src","loading"],_c=jn({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:n,status:i}=e.cube,r={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},s=Dt({resize_origin_width:-1,resize_result:-1,resize_scroll:!1}),o=t.id,a=Ss.url,l=t=>cc(t,e.cube,"left",r),c=t=>cc(t,e.cube,"right",r),d=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const i="left"===n.dir?1:-1,r=e.clientX-n.x,s=Math.abs(n.width-r*i);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,r),u=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,s=new ac(i);s.tell(t,Ts.set_css(t.id,{width:n.width_result+"px"})),r.record(s)}(0,e.cube,r),h=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:r}=t.root,s=new ac(i);s.tell(t,Ts.set_css(t.id,{width:n.width_result+"px"})),r.record(s)}(0,e.cube,r);function p(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}function _(t){if(!s.resize_scroll)return;const{deltaY:n}=t,r=t.currentTarget;if(!r)return;t.preventDefault(),t.stopPropagation();let o=lc(r,e.cube)+10*Math.sign(n);i.update_css({width:o+"px"}),s.resize_result=o}return ii(()=>{document.documentElement.addEventListener("pointermove",d),document.documentElement.addEventListener("pointerup",u),document.documentElement.addEventListener("pointercancel",h)}),ai(()=>{document.documentElement.removeEventListener("pointermove",d),document.documentElement.removeEventListener("pointerup",u),document.documentElement.removeEventListener("pointercancel",h)}),(r,d)=>(Rr(),Dr("div",{class:ve(["cube-img",{"resize-scroll":s.resize_scroll}]),id:r.cube.id,"data-type":r.cube.type,onContextmenu:d[1]||(d[1]=e=>en(_a)(e,r.cube)),onWheel:_},[$r("div",uc,[$r("div",{class:"dragger",onPointerdown:l},null,32)]),$r("div",hc,[$r("div",{class:"dragger",onPointerdown:c},null,32)]),$r("img",{style:fe(en(i).css),src:t.isdev?e.cube.info:a?a(o,"image",e.cube.info):void 0,alt:"",onErrorOnce:p,onClick:d[0]||(d[0]=t=>function(t){const n=t.currentTarget;if(s.resize_scroll=!s.resize_scroll)s.resize_origin_width=lc(n,e.cube);else{if(s.resize_origin_width<0||s.resize_result<0)return;const{courier:t,history:n}=e.cube.root;e.cube.status.update_css({width:s.resize_origin_width+"px"});const i=t.get_recorder();i.tell(e.cube,Ts.set_css(e.cube.id,{width:s.resize_result+"px"})),n.record(i)}}(t)),loading:en(n).mode===en(A).export?"eager":"lazy"},null,44,pc)],42,dc))}}),fc=(0,io.A)(_c,[["__scopeId","data-v-1477f378"]]);class mc extends Jl{constructor(e){super(e)}}class gc extends ic{_status=new mc(this);constructor(e,t){super(e,t);const n=As.clipboard?.pasted_from;n&&this.event.emit_asset_copy(n.noteid,"image",e.info),this.setup(),this.status.init()}get status(){return this._status}get is_empty(){return 0===this.data.info.trim().length}get meta(){return gc.meta}get component(){return fc}build_child(){}update_data(e,t){return gc.update_data(e,t)}float_image(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),r=Ts.set_css(this.id,n,!0);return i.tell(this,r),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=Ts.set_css(this.id,{float:null},!0);return t.tell(this,n),t}gc(){super.base_gc()}export(){return this.base_export()}replace_id(e,t={}){return gc.replace_id(this.root,e,t)}static get meta(){return{type:n.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t}static get_default(e="",t={},i={}){return{id:rc.get_id(),type:n.img,info:e,css:t,attrs:i}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(1===e&&t.info.startsWith("image://")&&(t.info=t.info.slice(8)),{data:t,usable:!0})}}const bc=["id","data-type"],yc={class:"lost-info"},vc=jn({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>(Rr(),Dr("div",{class:"cube-lost",id:e.cube.id,"data-type":en(n).lost,style:fe(e.cube.css)},[t[2]||(t[2]=$r("div",{class:"lost-title"},"异常方块",-1)),$r("div",yc,[t[0]||(t[0]=$r("div",null,"方块类型:",-1)),$r("div",null,Ce(e.cube.cube_name),1),t[1]||(t[1]=$r("div",null,"异常原因:",-1)),$r("div",null,Ce(e.cube.msg),1)])],12,bc))}),wc=(0,io.A)(vc,[["__scopeId","data-v-0b0feb78"]]);class xc extends ic{_status=new kc(this);_msg=Kt("");constructor(e,t,n){super(e,t),this.msg=n,this.status.init()}get status(){return this._status}get msg(){return this._msg.value}set msg(e){this._msg.value=e}get component(){return wc}get meta(){return xc.meta}get cube_name(){return this.data.type}get is_empty(){return!1}get children(){return[]}build_child(){}update_data(e,t){return xc.update_data(e,t)}gc(){}replace_id(e,t={}){return xc.replace_id(this.root,e,t)}export(){const e=this.base_export();return e.attrs.postil&&(e.info.attrs.postil=e.attrs.postil),e}on_cursor_in_head(e){const{courier:t,next_cube:n}=this,i=new ac(t);return n&&i.tell(n,zs.in_head(n.id)),i}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,i=new ac(t);return n&&i.tell(n,zs.in_head(n.id)),i}static get_default(e){return{id:Cs(),type:n.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:n.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}class kc extends Jl{constructor(e){super(e)}}const Sc=["id","data-type"],Cc=jn({__name:"cube-text",props:{cube:{}},setup(e){const{status:t}=e.cube;function n(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,i)=>(Rr(),Dr("span",{class:ve(["cube-text",{"text-mark":en(t).has_postil}]),style:fe(en(t).css),onClick:n,id:e.cube.id,"data-type":e.cube.type},Ce(en(t).text),15,Sc))}}),Mc=(0,io.A)(Cc,[["__scopeId","data-v-1c7b2bca"]]),Ac=["id","data-type"],Tc={class:"iconbox"},zc=jn({__name:"cube-annotation",props:{cube:{}},setup(e){const{status:t}=e.cube,n=Dt({fold:!1});function i(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=e.cube.index,s=new ac(t);s.tell(i,Ts.delete_child(i.id,"backward",[r,r+1])),n.record(s)}function r(){n.fold=!n.fold}return(e,s)=>(Rr(),Dr("div",{class:"cube-annotation",style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type},[$r("div",Tc,[$r("div",{class:ve(["iconfont","icon-fold",n.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),$r("div",{class:"iconfont icon-Delete",onClick:i,title:"删除批注块"})]),n.fold?Xr("v-if",!0):(Rr(),Dr("div",{key:0,class:ve(["annotation-contents",{"annotation-fold":n.fold}])},[(Rr(!0),Dr(Mr,null,gi(en(t).children,e=>(Rr(),Br(Zs,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,Ac))}}),Pc=(0,io.A)(zc,[["__scopeId","data-v-261158e4"]]);function Nc(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Rc extends ic{_status=new td(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get component(){return Pc}get meta(){return Rc.meta}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}build_child(e){rc.build_cubes(e.info,this,this._children)}update_data(e,t){return Rc.update_data(e,t)}replace_id(e,t={}){return Rc.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Ts.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,zs.in_head(a.id)):r.tell(this.child_last,zs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,u=c>this.child_count?this.child_count:c;if(d>=u)return;if(d<=0&&u>=this.child_count)return this.is_empty?s.tell(r,Ts.delete_child(n,o,[i,i+1])):s.tell(this,Ts.reset(this.id,[])),s;const h=this.children[d-1],p=this.children[u],_=u-d;let f=this.splice(l,_);return s.add_recover(Ts.insert_child(this.id,f.data,l)),"backward"===o?h?s.tell(h,zs.in_tail(h.id)):p&&s.tell(p,zs.in_head(p.id)):"forward"===o&&(p?s.tell(p,zs.in_head(p.id)):h&&s.tell(h,zs.in_tail(h.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new ac(t),s=[];for(let e of this.children)s.push(e.export());const o=rc.build_cubes(i,this);this.splice(0,this.child_count,...o);return r.add_recover(Ts.reset(this.id,s)),r}static get meta(){return{cubename:"批注",type:n.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const i={id:Cs(),type:n.text,info:"​",attrs:{},css:{}},r={id:Cs(),type:n.line,info:[i],attrs:{},css:{}},s={id:Cs(),type:n.box,info:[r],attrs:{},css:{}};return{id:Cs(),type:n.annotation,info:[s],css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;let s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Nc([Os(w.cube_insert_child)],Rc.prototype,"on_insert_child",null),Nc([Os(w.cube_delete_child)],Rc.prototype,"on_delete_child",null),Nc([Os(w.cube_reset)],Rc.prototype,"on_reset",null);const Oc=["id","data-type"],Lc={class:"title"},Ec=jn({__name:"cube-text-link",props:{cube:{}},setup(e){const{status:t}=e.cube;function n(){const t=document.createElement("a");t.href=e.cube.data.info.url,t.target="_blank",t.click()}function i(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:i,index:r}=e.cube,s=new ac(t);s.tell(i,Ts.delete_child(i.id,"backward",[r,r+1])),n.record(s)}return(e,s)=>(Rr(),Dr("div",{class:"cube-link",style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type},[$r("div",Lc,Ce(en(t).info.title),1),$r("div",{class:"link",onClick:n},Ce(en(t).info.url),1),$r("div",{class:"iconbox"},[$r("div",{class:"iconfont icon-rename",onClick:i}),$r("div",{class:"iconfont icon-Delete",onClick:r})])],12,Oc))}}),Ic=(0,io.A)(Ec,[["__scopeId","data-v-22099721"]]);class Dc{static update(e,t,n){return{id:e,name:l.update,title:t,url:n}}}class Bc extends Jl{constructor(e){super(e)}}class jc extends ic{_status=new Bc(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get info(){return this.data.info}get component(){return Ic}get meta(){return jc.meta}get url(){return this.data.info.url}get title(){return this.data.info.title}build_child(e){}gc(){}export(){return this.base_export()}replace_id(e,t={}){return jc.replace_id(this.root,e,t)}update_data(e,t){return jc.update_data(e,t)}on_update_info(e){const{courier:t,cursor:n}=this,{url:i,title:r}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=i,this.info.title=r,this.status.update_info(),s.add_recover(Dc.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:n.link,block:!0,show:!1,version:1}}static get_default(e,t,i={},r={}){return{id:Cs(),type:n.link,info:{url:e,title:t},css:i,attrs:r}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Os(l.update)],jc.prototype,"on_update_info",null);const qc=["id","data-type"],Fc=jn({__name:"cube-postil",props:{cube:{}},setup(e){const{status:t}=e.cube,n=ws(()=>e.cube.children.filter(e=>e instanceof jc)),i=ws(()=>e.cube.children.filter(e=>!(e instanceof jc)));function r(){e.cube.visible(!1)}function s(){const{courier:t,history:n}=e.cube.root,i=e.cube.pcube,r=new ac(t);r.tell(i,Ts.postil_remove(i.id,[0,e.cube.child_count])),n.record(r)}function o(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?Ws.DomAnimation.scroll_element(t,20,"vertical"):Ws.DomAnimation.scroll_element(t,-20,"vertical")}return(e,a)=>e.cube.show?(Rr(),Dr("div",{key:0,class:"cube-postil",style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type},[$r("div",{class:"iconbox"},[$r("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:s}),$r("div",{class:"iconfont icon-close close",title:"关闭",onClick:r})]),$r("div",{class:"mark-contents",onWheel:o},[(Rr(!0),Dr(Mr,null,gi(n.value,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128)),(Rr(!0),Dr(Mr,null,gi(i.value,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,qc)):Xr("v-if",!0)}}),Hc=(0,io.A)(Fc,[["__scopeId","data-v-051248a7"]]),$c=["id","data-type"],Gc={class:"cube-box-root-content"},Vc=jn({__name:"cube-box-root",props:{cube:{}},setup(e){const{status:t}=e.cube,n=e.cube,i=ws(()=>({opacity:(e.cube.child_count+10)/60})),r=e=>function(e,t){if(e.stopPropagation(),!zo)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(Po=n,Ao=t,document.body.style.setProperty("--box-root-pointer-events","none"))}(e,n),s=e=>function(e,t){if(!zo||!Ao)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==Ao&&(n!==No&&No?.classList.remove("drag-enter"),No=n,To=t,No.classList.add("drag-enter"))}(e,n),o=e=>function(e,t){zo&&(e.preventDefault(),e.stopPropagation(),Ao&&To&&Po&&No&&Ao!==To&&(Po.style["view-transition-name"]=Ao.id,document.startViewTransition(()=>{if(!(Ao&&To&&Po&&No))return;const{courier:e,history:n}=t,i=new ac(e),r=Po.getBoundingClientRect(),s=To.index,o=Ao.export(),a=To.pcube;Ao.pcube===a?i.tell(Ao.pcube,Ts.reorder(Ao.pid,Ao.id,To.index)):(i.merge(Ao.remove_self()),i.tell(a,Ts.insert_child(a.id,[o],s))),n.record(i);const l=No.getBoundingClientRect(),c=l.x-r.x,d=l.y-r.y;document.body.style.setProperty("--x",c+"px"),document.body.style.setProperty("--y",d+"px")}),zo=!1))}(e,n),a=e=>(No&&No.classList.remove("drag-enter"),Po&&Po.classList.remove("drag-enter"),void(zo=!1)),l=e=>function(e){e.preventDefault(),e.stopPropagation(),No&&No.classList.add("drag-enter")}(e),c=e=>function(e){e.stopPropagation(),No&&No.classList.remove("drag-enter")}(e),d=e=>function(e){const t=e.target;t instanceof HTMLElement&&"cube-box-root-dragger"===t.dataset.tag&&(zo=!0,e.stopPropagation())}(e),u=e=>function(e,t){const{stats:n}=t.root,i=t.index+1;n.active_root_index=i}(0,n);function h(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,n)=>(Rr(),Dr("div",{class:"cube-box-root",style:fe(en(t).css),draggable:"true",id:e.cube.id,"data-type":e.cube.type,onContextmenu:n[2]||(n[2]=t=>en(_a)(t,e.cube)),onFocusin:u,onDragstart:r,onDragenter:s,onDrop:o,onDragend:a,onDragover:l,onDragleave:c,onPointerdown:d},[$r("div",{class:ve(["cube-dragger",h(e.cube)]),style:fe(i.value),onClick:n[0]||(n[0]=t=>en(Oo)(t,e.cube)),onContextmenu:n[1]||(n[1]=t=>en(Lo)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),$r("div",Gc,[en(t).attrs.fold?(Rr(),Br(Zs,{key:0,cube:en(t).child_first},null,8,["cube"])):(Rr(!0),Dr(Mr,{key:1},gi(en(t).children,e=>(Rr(),Br(Zs,{key:e.id,cube:Ut(e)},null,8,["cube"]))),128))])],44,$c))}}),Uc=(0,io.A)(Vc,[["__scopeId","data-v-441dae5d"]]);function Wc(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Yc extends ic{_status=new Kc(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Uc}get meta(){return Yc.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof gd&&this.child_first.is_empty}get attrs(){return this.data.attrs}build_child(e){rc.build_cubes(e.info,this,this._children)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return Yc.update_data(e,t)}replace_id(e,t={}){return Yc.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,s=new ac(t);if("left"===n){this.prev_cube_deep instanceof Yc?s.tell(this,Ts.merge(this.id,"left",r,i)):s.tell(this,zs.in_head(this.id))}else if("right"===n){this.next_cube_deep instanceof Yc?s.merge(this.on(Ts.merge(this.id,"right",r,i))):s.tell(this,zs.in_tail(this.id))}return s}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new ac(t);if("left"===o&&n instanceof Yc){const e=this.export().info;c.tell(n,Ts.insert_child(n.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof Yc){const e=i.export().info;c.tell(this,Ts.insert_child(this.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof Yc&&i instanceof Yc){const e=this.export().info,t=i.export().info;c.tell(n,Ts.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=zs.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof Yc&&!(i instanceof Yc)){const e=this.export().info;c.tell(n,Ts.insert_child(n.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof Yc)&&i instanceof Yc){const e=i.export().info;c.tell(this,Ts.insert_child(this.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new ac(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Ts.reorder(this.id,o.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=rc.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof rd&&e.is_empty)return;const t=this.export().info,n=new gd(gd.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(Ts.reset(this.id,t)),i.tell(n,zs.in_tail(n.id))}else{const e=this.export().info,t=rc.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Ts.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;let s=this.get_valid_index(n);const o=rc.pick(i,!0),a=rc.build_cubes(o.list,this);this.splice(s,0,...a),r.add_recover(Ts.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?r.tell(l,zs.in_tail(l.id)):r.tell(c,zs.in_head(c.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(!(u>=h)){if(u<=0&&h>=this.child_count&&!a){if(a){if(this.is_empty)return;l.tell(this,Ts.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Ts.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,Ts.delete_child(n,s,[i,i+1])):l.tell(this,Ts.reset(this.id,[]));return l}{const e=this.children[u-1],t=this.children[h],n=h-u;let i=this.splice(c,n);l.add_recover(Ts.insert_child(this.id,i.data,c)),"backward"===s?e?l.tell(e,zs.in_tail(e.id)):t&&l.tell(t,zs.in_head(t.id)):"forward"===s&&(t?l.tell(t,zs.in_head(t.id)):e&&l.tell(e,zs.in_tail(e.id)))}return l}}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!rd.is_empty_text(e))}static get meta(){return{type:n.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[gd.get_default()]:e;return{id:rc.get_id(),type:n.box_root,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Wc([Os(w.cube_delete_adjacent)],Yc.prototype,"on_cube_delete_adjacent",null),Wc([Os(w.cube_merge)],Yc.prototype,"on_merge",null),Wc([Os(w.cube_reorder)],Yc.prototype,"on_cube_reorder",null),Wc([Os(w.cube_reset)],Yc.prototype,"on_cube_reset",null),Wc([Os(w.cube_insert_child)],Yc.prototype,"on_insert_child",null),Wc([Os(w.cube_delete_child)],Yc.prototype,"on_delete_child",null);class Xc{}class Kc extends Jl{constructor(e){super(e)}}function Jc(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Qc extends ic{_status=new Zc(this);_handler_update_pos;_handler_corrent;_timer_corrent;_show=Kt(!1);constructor(e,t){super(e,t),this.setup(),this.status.init(),t.has_postil=!0}get status(){return this._status}get default_size(){return{x:0,y:0,width:180,height:130}}get show(){return this._show.value}set show(e){this._show.value=e,e&&this.root.listener.check_float()}get has_annotation(){for(let e of this.children)if(e instanceof Rc)return!0;return!1}get meta(){return Qc.meta}get component(){return Hc}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){rc.build_cubes(e.info,this,this._children)}update_data(e,t){return Qc.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}gc(){super.base_gc(),this.root.cubes.remove_cube(this),this._handler_update_pos&&(this.root.event.off(this._handler_update_pos),this._handler_update_pos=null)}replace_id(e,t={}){return Qc.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Ts.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,zs.in_head(a.id)):r.tell(this.child_last,zs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,u=c>this.child_count?this.child_count:c;if(d>=u)return;if(d<=0&&u>=this.child_count)return s.tell(this,Ts.reset(this.id,[])),s;const h=this.children[d-1],p=this.children[u],_=u-d;let f=this.splice(l,_);return s.add_recover(Ts.insert_child(this.id,f.data,l)),"backward"===o?h?s.tell(h,zs.in_tail(h.id)):p&&s.tell(p,zs.in_head(p.id)):"forward"===o&&(p?s.tell(p,zs.in_head(p.id)):h&&s.tell(h,zs.in_tail(h.id))),s}on_reset(e){const{courier:t,history:n}=this,{data:i}=e,r=new ac(t),s=[];for(let e of this.children)s.push(e.export());const o=rc.build_cubes(i,this);this.splice(0,this.child_count,...o);return r.add_recover(Ts.reset(this.id,s)),r}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,vn(()=>{const n=e.get_recorder();n.tell(t,zs.in_tail(t.id)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){vn(()=>{const e=this.pcube.clientRect,t=this.clientRect||this.default_size;if(!e)return void(this.show=!1);const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},i=Ws.MathRect.move_rect_to_other(n,t,e,5);this.status.update_css({left:`${i.x}px`,top:`${i.y}px`})})}static get_default(e=[],t={}){return{id:Cs(),type:n.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:n.postil,show:!1,version:2,block:!0}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){if(e>this.meta.version)return{data:t,usable:!1};const n=structuredClone(t);return e<2?(n.info=[Yc.get_default(n.info)],{data:n,usable:!0}):{data:t,usable:!0}}}Jc([Os(w.cube_insert_child)],Qc.prototype,"on_insert_child",null),Jc([Os(w.cube_delete_child)],Qc.prototype,"on_delete_child",null),Jc([Os(w.cube_reset)],Qc.prototype,"on_reset",null);class Zc extends Jl{constructor(e){super(e)}}class ed{static reset(e,t){return{id:e,name:i.text_reset,info:t}}static break(e,t){return{id:e,name:i.text_break,offset:t}}}class td extends Jl{constructor(e){super(e)}}class nd extends Jl{constructor(e){super(e)}get cube(){return this._cube}get text(){return this._data.info}update_text(){this._data.info=this.cube.text}}function id(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class rd extends ic{_status=new nd(this);constructor(e,t){super(e,t),this.setup(),this.status.init(),this.init()}get status(){return this._status}get attrs(){return this.data.attrs}get component(){return Mc}get meta(){return rd.meta}get is_empty(){return rd.is_empty_text(this.data)}get len(){return this.text.length}get text(){return this.data.info}get text_node(){const e=this.dom?.firstChild;if(e instanceof Text)return e}get children(){return[]}get line(){let e=this.pcube;for(;e;){if(e instanceof gd)return e;e=e.pcube}}init(){this.root.stats.update_count_word(this.len)}build_child(e){const t=e.attrs?.postil;t&&(this.postil=new Qc(t,this),this.has_postil=!0)}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return rd.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e,t){return rd.update_data(e,t)}merge_text(e){const{courier:t}=this,n=t.get_recorder(),i=this.prev_cube,r=this.next_cube,s=i instanceof rd,o=r instanceof rd;if(s&&o){const t=Ts.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=Ts.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(o){const t=Ts.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_cursor_loc(e){const{from:t,from_offset:n,offset:i}=e,{courier:r}=this,s=r.get_recorder();return s.add_cmd(e),this.set_cursor_in_head(i),s.add_recover(zs.loc(t,n,this.id,i)),s}on_partition(e){const{courier:t,cursor:n,pcube:i}=this,{start_id:r,end_id:s,offset_end:o,offset_start:a}=e,l=this.get_valid_index(a),c=this.get_valid_index(o),d=new ac(t),u=this.text.slice(0,l),h=this.text.slice(l,c),p=this.text.slice(c);if(h){const e=rd.get_default(h,structuredClone(Vt(this.css)));if(u){if(u){const t=ed.reset(this.id,u),n=zs.loc(this.id,u.length,this.id,u.length);if(d.tell(this,t,n),p){const e=rd.get_default(p,structuredClone(Vt(this.css)));d.tell(i,Ts.insert_child(i.id,[e],this.index+1))}d.tell(i,Ts.insert_child(i.id,[e],this.index+1))}}else{const e=ed.reset(this.id,h),t=zs.loc(this.id,h.length,this.id,h.length);if(d.tell(this,e,t),p){const e=rd.get_default(p,structuredClone(Vt(this.css)));d.tell(i,Ts.insert_child(i.id,[e],this.index+1))}}return d}if(0===l){const e=rd.get_default();d.tell(i,Ts.insert_child(i.id,[e],this.index))}else if(l===this.len){const e=rd.get_default();d.tell(i,Ts.insert_child(i.id,[e],this.index+1))}else if(l>0&&l<this.len){const e=rd.get_default(p,structuredClone(Vt(this.css))),t=Ts.insert_child(i.id,[e],this.index+1),n=ed.reset(this.id,u),r=zs.loc(this.id,u.length,this.id,u.length);return d.tell(i,t),d.tell(this,n,r),d}return d}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r,pid:s,index:o}=this,{method:a,offset:l,cubeid:c}=e;let d=this.get_valid_index(l);const u=new ac(t);if("left"===a&&n instanceof rd&&this.can_merge_with(n)){const e=n.id,t=Ts.delete_child(s,"forward",[o-1,o]),r=ed.reset(this.id,n.text+this.text),a=zs.loc(this.id,d+n.len,this.id,d);u.tell(i,t),u.tell(this,r,a),this.event.emit_text_merge(e,this.id)}else if("right"===a&&r instanceof rd&&this.can_merge_with(r)){const e=r.id,t=Ts.delete_child(s,"backward",[o+1,o+2]),n=ed.reset(this.id,this.text+r.text),a=zs.loc(this.id,d,this.id,d);u.tell(i,t),u.tell(this,n,a),this.event.emit_text_merge(e,this.id)}else if("both"===a)if(n instanceof rd&&r instanceof rd&&this.can_merge_with(n)&&this.can_merge_with(r)){const e=n.len+d,t=n.id,s=r.id;u.tell(i,Ts.delete_child(this.pid,"backward",[this.index-1,this.index])),u.tell(i,Ts.delete_child(this.pid,"backward",[this.index+1,this.index+2])),u.tell(this,ed.reset(this.id,n.text+this.text+r.text)),u.tell(this,zs.loc(this.id,e,this.id,d)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof rd&&this.can_merge_with(n)){const e=n.id;u.tell(i,Ts.delete_child(s,"forward",[o-1,o])),u.tell(this,ed.reset(this.id,n.text+this.text)),u.tell(this,zs.loc(this.id,d+n.len,this.id,d)),this.event.emit_text_merge(e,this.id)}else if(r instanceof rd&&this.can_merge_with(r)){const e=r.id;u.tell(i,Ts.delete_child(s,"backward",[o+1,o+2])),u.tell(this,ed.reset(this.id,this.text+r.text)),u.tell(this,zs.loc(this.id,d,this.id,d)),this.event.emit_text_merge(e,this.id)}return u}on_cube_insert(e){const{data:t,start_id:n,end_id:i,offset_end:r,offset_start:s}=e,{courier:o,pid:a,pcube:l}=this,c=new ac(o);this.cursor.has_selection;let d=s,u=r;if(d<0&&(d=0),u>this.text.length&&(u=this.text.length),r!==s){const e=Ts.delete(this.id,"backward",this.id,this.id,s,r,!0);c.tell(this,e)}const h=rc.pick(t),p=this.text.slice(0,d),_=this.text.slice(u);if(h.head.length>0)if(p)if(p&&_){const e=ed.reset(this.id,p),t=zs.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=rd.get_default(_,structuredClone(Vt(this.css)),structuredClone(Vt(this.attrs)));c.tell(l,Ts.insert_child(a,[n],this.index+1)),c.tell(l,Ts.insert_child(a,h.head,this.index+1))}else _||c.tell(l,Ts.insert_child(a,h.head,this.index+1));else c.tell(l,Ts.insert_child(a,h.head,this.index));const f=[...h.body];if(h.tail.length>0&&f.push(gd.get_default(h.tail)),h.roots.length>0)for(let e of h.roots)f.push(...e.info);if(f.length>0){if(0===h.head.length&&r>0&&r<this.len){const e=ed.reset(this.id,p),t=zs.loc(this.id,p.length,this.id,p.length);c.tell(this,e,t);const n=rd.get_default(_,structuredClone(Vt(this.css)),structuredClone(Vt(this.attrs)));c.tell(l,Ts.insert_child(a,[n],this.index+1))}c.tell(l,Ts.insert_child(this.pid,f,this.index+h.head.length+1))}return c}on_cube_delete(e){const{courier:t,index:n,pcube:i,pid:r}=this,{dir:s,start_id:o,end_id:a,offset_start:l,offset_end:c,reserve:d}=e,u=new ac(t),h=this.get_valid_index(l),p=this.get_valid_index(c),_=h!==p||"head"===l||"tail"===c;if(0===h&&p===this.len){if(d){const e=ed.reset(this.id,"​"),t=zs.loc(this.id,1,this.id,this.len);u.tell(this,e,t)}else u.tell(i,Ts.delete_child(r,"backward",[n,n+1]));return u}const f=this.text.slice(0,h),m=this.text.slice(p);if(_){const e=ed.reset(this.id,f+m),t=zs.loc(this.id,h,this.id,p);u.tell(this,e,t)}else{const e=h;if("backward"===s)if(0===e||0===rd.drop_zero_width_space(this.text,h).pos){const e=this.prev_cube;e&&!e.meta.block?u.tell(e,Ts.delete_adjacent(e.id,"right",this.id,0)):u.merge(this._delete_edge(s))}else if(this.is_empty)u.tell(i,Ts.delete_child(r,"backward",[n,n+1]));else{const e=this.find_text_deleted(h,"left"),t=ed.reset(this.id,e.text),n=zs.loc(this.id,e.pos,this.id,f.length);u.tell(this,t,n),e.text&&u.tell(this,Ts.merge(this.id,"both",this.id,f.length-1))}else if("forward"===s)if(e===this.len||e===rd.drop_zero_width_space(this.text,h).len){const e=this.next_cube;e&&!e.meta.block?u.tell(e,Ts.delete_adjacent(e.id,"left",this.id,this.len)):u.merge(this._delete_edge(s))}else if(this.is_empty)u.tell(i,Ts.delete_child(r,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right"),n=ed.reset(this.id,t.text),i=zs.loc(this.id,f.length,this.id,f.length),r=Ts.merge(this.id,"both",this.id,f.length);u.tell(this,n,i),u.tell(this,r)}}return u}on_text_reset(e){const{courier:t,pid:n,index:i,pcube:r,len:s}=this,{info:o}=e,a=t.get_recorder();a.add_cmd(e);let l=this.text;!o&&this.is_empty;const c=rd.drop_zero_intelligence(o,0);return this.data.info=c.text,this.status.update_text(),As.stats?.update_count_word(c.len-s),a.add_recover(ed.reset(this.id,l)),a}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:i}=this,{css:r,start_id:s,end_id:o,offset_start:a,offset_end:l,toggle:c,replace:d}=e;if(0===Object.keys(r).length&&!d)return;const u=new ac(t),h=this.get_valid_index(a),p=this.get_valid_index(l),_=rd.drop_zero_width_space(this.text.slice(0,h),0).text,f=rd.drop_zero_width_space(this.text.slice(h,p),0).text,m=rd.drop_zero_width_space(this.text.slice(p),0).text;if(0===h&&p===this.len||h===p&&s===o)u.tell(this,Ts.set_css(this.id,r,c,d)),u.tell(this,Ts.merge(this.id,"both",this.id,p));else if(0===h&&f){const e=structuredClone(Vt(this.css)),t=ed.reset(this.id,f),s=zs.loc(this.id,p,this.id,p);if(u.tell(this,t,s),u.tell(this,Ts.set_css(this.id,r,c,d)),m){const t=rd.get_default(m,e);u.tell(i,Ts.insert_child(n,[t],this.index+1));const r=i.find_cube(t.id);r&&u.tell(r,Ts.merge(t.id,"both",t.id,0))}u.tell(this,zs.in_tail(this.id)),u.tell(this,Ts.merge(this.id,"left",this.id,this.len))}else if(h>0){if(_){const e=ed.reset(this.id,_),t=zs.loc(this.id,h,this.id,h),n=Ts.merge(this.id,"left",this.id,p);u.tell(this,e,t,n)}if(m){const e=rd.get_default(m,structuredClone(Vt(this.css))),t=[e];u.tell(i,Ts.insert_child(n,t,this.index+1));const r=i.find_cube(e.id);r&&u.tell(r,Ts.merge(r.id,"right",r.id,0))}if(f){const e=rd.get_default(f,structuredClone(Vt(this.css)));u.tell(i,Ts.insert_child(n,[e],this.index+1));const t=i.find_cube(e.id);t&&(u.tell(t,Ts.set_css(e.id,r,c,d)),u.tell(t,Ts.merge(e.id,"both",e.id,_.length+h)))}}return u}on_cube_break(e){const{courier:t,cursor:n,pcube:i,pid:r,index:s}=this,o=i.pcube;if(!o)return;const{offset:a}=e;let l=s+1;const c=new ac(t),d=this.text[a-1],u=this.text[a];let h=a,p=!1;if(d){const e=d.charCodeAt(0);55296<=e&&e<=56319&&(p=!0)}if(u&&!p){const e=u.charCodeAt(0);56320<=e&&e<=57343&&(p=!0)}p&&(h+=1),c.tell(this,Ts.partition(this.id,this.id,this.id,h,h));const _=[];for(let e of i.children.slice(l))_.push(e.export());c.tell(i,Ts.delete_child(i.id,"backward",[l,i.child_count]));const f=gd.get_default(_),m=this.line;m&&m.inherit_line([f]),c.tell(o,Ts.insert_child(o.id,[f],i.index+1));const g=i.next_cube;return g?.id===f.id&&c.tell(g,zs.in_head(g.id)),c}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:i,from_id:r,offset:s}=e,o=new ac(t);if("left"===i)if(this.is_empty)o.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?o.tell(this,zs.in_head(this.id)):o.tell(this,Ts.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)o.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?o.tell(this,zs.in_tail(this.id)):o.tell(this,Ts.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return o}add_link(e,t){const{cursor:n,courier:i}=this,r=i.get_recorder(),s=jc.get_default(t,e);return r.tell(this,Ts.postil_add(this.id,[s])),r}add_annotation(e){const t=this.courier.get_recorder(),n=e||Rc.get_default();return t.tell(this,Ts.postil_add(this.id,[n])),t}get_valid_index(e){return"head"===e?0:"tail"===e?this.text.length:e<0?0:e>this.text.length?this.text.length:e}set_cursor_in_head(e=0){const t=this.get_valid_index(e);vn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}set_cursor_in_tail(e=0){let t=this.len-this.get_valid_index(e);vn(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}find_text_nav_pos(e,t){const n=this.text;let i=e;if(e<0&&(i=0),e>n.length&&(i=n.length),"left"===t){let e=i-1,t=n[e];for(;"​"===t&&e>=0;)e-=1,t=n[e];if(t){const n=t.charCodeAt(0);56320<=n&&n<=57343&&(e-=1)}return e<0?0:e}{let e=i+1,t=n[e];for(;"​"===t&&e<n.length;)e+=1,t=n[e];if(t){const n=t.charCodeAt(0);55296<=n&&n<=56319&&(e+=1)}return e>n.length?n.length:e}}find_text_deleted(e,t){if(e<0)return{text:this.text,pos:0};if(e>this.len)return{text:this.text,pos:this.len};if("left"===t){let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,n),r=this.text.slice(e),s=i[i.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(i=i.slice(0,-1),e-=1)}return{text:i+r,pos:n}}{let n=this.find_text_nav_pos(e,t),i=this.text.slice(0,e),r=this.text.slice(n),s=r[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(r=r.slice(1))}return{text:i+r,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,i]=t;if(n===i){if("backward"===e){return 0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(i-1,"right")!==this.len}return this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left")}{if(0===n&&i===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(i-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return rd.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=rc.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=rc.is_same_attrs(this.attrs,e.attrs),i=!this.postil&&!e.postil;return t&&n&&i}_delete_edge(e){const{courier:t}=this,n=this.pcube;if("backward"===e){const e=this.prev_cube_deep,i=e?.next_cube;if(!(i instanceof ic))return;if(this.in_postil&&!e?.in_postil)return;if(i&&e.type===i.type){const e=i.merge("left");if(e&&e.len_undo>0)return e}if(i&&1===i.child_count&&i.child_first.meta.block){const e=this.courier.get_recorder(),t=i.pcube,n=i.index,r=i.child_first.export(),s=rc.pick([r],!0),o=Ts.insert_child(t.id,s.list,n);if(e.tell(t,o),e.len_undo>0)return e.merge(i.remove_self()),e}if(n&&n.is_empty&&n instanceof ic){const e=this.courier.get_recorder();if(e.merge(n.remove_self()),e.len_undo>0)return e}if(e&&e.is_empty){const n=new ac(t);return n.merge(e.remove_self()),i&&n.tell(i,zs.in_head(i.id)),n}if(e){return new ac(t).tell(e,zs.in_tail(e.id))}}else{const e=this.next_cube_deep,t=e?.prev_cube;if(!(t instanceof ic))return;if(this.in_postil&&!e?.in_postil)return;if(t&&e?.type===t?.type){const e=t.merge("right");if(e&&e.len_undo>0)return e}if(t&&1===t.child_count&&t.child_first.meta.block){const e=this.courier.get_recorder(),n=t.pcube,i=t.index,r=t.child_first.export(),s=rc.pick([r],!0),o=Ts.insert_child(n.id,s.list,i);if(e.tell(n,o),e.len_undo>0)return e.merge(t.remove_self()),e}if(n&&n.is_empty&&n instanceof ic){const e=this.courier.get_recorder();if(e.merge(n.remove_self()),e.len_undo>0)return e}if(e&&e.is_empty){const n=this.courier.get_recorder();return n.merge(e.remove_self()),t&&n.tell(t,zs.in_tail(t.id)),n}if(e){return this.courier.get_recorder().tell(e,zs.in_tail(e.id))}}}static drop_zero_width_space(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),s=e.slice(i);if(r){for(let e of r)"​"!==e&&(n+=e);i=n.length}if(s)for(let e of s)"​"!==e&&(n+=e);return{text:n,pos:i,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",i=t;i<0&&(i=0),i>e.length&&(i=e.length);const r=e.slice(0,i),s=e.slice(i);if(r){for(let e=0;e<r.length;e++){let t=r[e],i=r[e-1];"​"===t&&"\n"!==i||(n+=t)}i=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],i=s[e-1];"​"===t&&"\n"!==i||(n+=t)}return n||(n="​",i=1),{text:n,pos:i,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==n.text)return!1;let t="";for(let n of e.info)if("​"!==n&&(t+=n),t.length>0)return!1;return 0===t.length}static get meta(){return{version:1,type:n.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},i={}){const r=e||"​";return{id:Cs(),type:n.text,info:r,css:structuredClone(Vt(t)),attrs:structuredClone(Vt(i))}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,e.event.emit_replace_id(i,r),t}static update_data(e,t){return t.info=t.info.replace("\r",""),t.info||(t.info="​"),e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}id([Os(x.loc)],rd.prototype,"on_cursor_loc",null),id([Os(w.cube_partition)],rd.prototype,"on_partition",null),id([Os(w.cube_merge)],rd.prototype,"on_cube_merge",null),id([Os(w.cube_insert)],rd.prototype,"on_cube_insert",null),id([Os(w.cube_delete)],rd.prototype,"on_cube_delete",null),id([Os(i.text_reset)],rd.prototype,"on_text_reset",null),id([Os(w.cube_set_selection_css)],rd.prototype,"on_cube_set_selection_css",null),id([Os(i.text_break)],rd.prototype,"on_cube_break",null),id([Os(w.cube_delete_adjacent)],rd.prototype,"on_cube_delete_adjacent",null);const sd=["id","data-type","contenteditable"],od=jn({__name:"cube-line",props:{cube:{}},setup(e){const{status:t}=e.cube;return(e,n)=>(Rr(),Dr("div",{class:ve(["cube-line",{"line-first-letter-lower":en(t).attrs.first_letter_lower}]),id:e.cube.id,"data-type":e.cube.type,style:fe(en(t).css),contenteditable:e.cube.editable,spellcheck:"false"},[(Rr(!0),Dr(Mr,null,gi(en(t).children,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],14,sd))}}),ad=(0,io.A)(od,[["__scopeId","data-v-085fb75a"]]);class ld extends Al{dragenter(e){e.preventDefault()}dragover(e){e.preventDefault()}dragleave(e){e.preventDefault()}drop(e){e.preventDefault();const{cursor:t}=this.root,{cube_end:n,offset_end:i}=t,r=e.dataTransfer;if(!r)return;const s=new DOMParser,o=r.getData("text/plain"),a=r.getData("text/html"),l=r.files;if(console.log("🍊",{files:l,html:a,text:o}),console.log("❤",(new DOMParser).parseFromString(a,"text/html")),o){const e=this.courier.get_recorder();console.log("💠text",o);const{offset_end:t,offset_start:n,cube_selection:i}=this.cursor;if(!(i instanceof rd))return;this.ins(e,this._root,o,i,n,t),this.history.record(e)}if(a){const e=s.parseFromString(a,"text/html");console.log("💠html",e)}}handler_click_foot(e){e.preventDefault();const{courier:t,cursor:n,history:i}=this.root,r=this.root.child_last;if(r&&r.is_empty){let e=r;for(;e;){if(e instanceof rd){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new ac(t),n=Yc.get_default();e.tell(this.root,Ts.insert_child(this.root.id,[n],this.root.child_count)),i.record(e)}}}const cd=["id","data-type"],dd={class:"doc-postils"},ud=jn({__name:"cube-doc",props:{cube:{}},setup(e){const{status:t}=e.cube,n=new ld(e.cube),i=e=>n.pointerdown(e),r=e=>n.pointermove(e),s=e=>n.pointerup(e),o=e=>n.pointercancel(e),a=e=>n.handler_click_foot(e),l=e=>n.compositionstart(e),c=e=>n.compositionupdate(e),d=e=>n.compositionend(e),u=e=>n.beforeinput(e),h=e=>n.dragover(e),p=e=>n.dragenter(e),_=e=>n.dragleave(e),f=e=>n.drop(e);return ii(()=>{document.documentElement.addEventListener("pointerup",s),document.documentElement.addEventListener("pointermove",r),document.documentElement.addEventListener("pointercancel",o)}),(e,n)=>(Rr(),Dr("div",{class:"cube-doc",id:e.cube.id,"data-type":e.cube.type,style:fe(en(t).css),onDragover:h,onDragenter:p,onDragleave:_,onDrop:f},[$r("div",{class:"note",onPointerdown:i,onCompositionstart:l,onCompositionupdate:c,onCompositionend:d,onBeforeinput:u},[(Rr(!0),Dr(Mr,null,gi(en(t).children,e=>(Rr(),Br(_i(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),Xr(" footer "),$r("div",{class:"cube-doc-footer",onPointerdown:a},null,32),Xr(" doc-cubes "),$r("div",dd,[(Rr(!0),Dr(Mr,null,gi(e.cube.cubes.postils,([e,t])=>(Rr(),Br(Zs,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),Xr(" scope selection "),(Rr(!0),Dr(Mr,null,gi(en(t).scopes,e=>(Rr(),Br(ro,{key:e.id,selection:Ut(e)},null,8,["selection"]))),128)),Xr(" menus "),Gr(vl,{root:e.cube},null,8,["root"]),Gr(Ml,{root:e.cube},null,8,["root"])],44,cd))}}),hd=(0,io.A)(ud,[["__scopeId","data-v-0a98b4e5"]]);class pd extends tc{_status=new _d(this);_app;constructor(e){super(e),this.setup(),this.status.init(),this._app=Za(hd,{cube:this})}get status(){return this._status}get app(){return this._app}get component(){return hd}get meta(){return pd.meta}get doc(){return this}build_child(e){rc.build_cubes(e.info,this,this._children)}gc(){}export(){const e=structuredClone({...this.data,info:[]});e.versions=As.export_versions();for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return pd.update_data(e,t)}replace_id(e,t={}){return pd.replace_id(this.root,e,t)}render(e){this._dom=e,this.hotkeys.listen(e),this.app.mount(e),this.event.emit_status_update()}static get meta(){return{type:n.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){return{id:Cs(),type:n.doc,versions:As.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}class _d extends nc{constructor(e){super(e)}}class fd extends Jl{constructor(e){super(e)}}function md(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class gd extends ic{_status=new fd(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return ad}get editable(){if(this.stats.is_read_mode)return!1;const e=this.host_postil,t=this.host_node;return!e&&t?t.editable:!(!e||t)||(!e||!t||(e.level>t.level||t.editable))}get meta(){return gd.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}get attrs(){return this.data.attrs}get child_first_text(){for(let e of this._children)if(e instanceof rd)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof rd)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof pd)return;let t=rc.find_line(e,"first");if(t)return t;e=e.next_cube_deep}}get prev_line(){let e=this.prev_cube_deep;for(;e;){if(e instanceof pd)return;let t=rc.find_line(e,"last");if(t)return t;e=e.prev_cube_deep}}build_child(e){rc.build_cubes(e.info,this,this._children)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}update_data(e,t){return gd.update_data(e,t)}gc(){super.base_gc()}replace_id(e,t={}){return gd.replace_id(this.root,e,t)}inherit_line(e){const t=Math.min(...e.map(e=>e.attrs.indent||0));for(let n of e){const e=this.attrs.indent;if(e){const i=n.attrs.indent||0;n.attrs.indent=e+i-t}this.css["text-indent"]&&n.type===this.type&&(n.css["text-indent"]=this.css["text-indent"])}}on_cube_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s,pcube:o}=this,{method:a,cubeid:l,offset:c}=e,d=new ac(t);if("left"===a&&n instanceof gd){const e=rc.exports(this.children),t=rc.filter_out_empty(e);d.tell(n,Ts.insert_child(n.id,t,"tail")),d.merge(this.remove_self("backward"));const i=n.find_child_cube(l);if(i){const e=zs.loc(l,c,l,c);d.tell(i,e)}}else if("right"===a&&i instanceof gd){const e=i.export().info,t=rc.filter_out_empty(e);d.tell(this,Ts.insert_child(this.id,t,"tail")),d.tell(o,Ts.delete_child(s,"backward",[r+1,r+2]));const n=this.find_child_cube(l);n&&d.tell(n,zs.loc(l,c,l,c))}else if("both"===a)if(n instanceof gd&&i instanceof gd){const e=rc.filter_out_empty(this.export().info),t=rc.filter_out_empty(i.export().info);d.tell(n,Ts.insert_child(n.id,e.concat(t),"tail")),d.tell(o,Ts.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_child_cube(l);r&&d.tell(r,zs.loc(l,c,l,c))}else if(n instanceof gd&&!(i instanceof gd)){const e=rc.filter_out_empty(this.export().info);d.tell(n,Ts.insert_child(n.id,e,"tail")),d.tell(o,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(l);t&&d.tell(t,zs.loc(l,c,l,c))}else if(!(n instanceof gd)&&i instanceof gd){const e=rc.filter_out_empty(i.export().info);d.tell(this,Ts.insert_child(this.id,e,"tail")),d.tell(o,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_child_cube(l);t&&d.tell(t,zs.loc(l,c,l,c))}return d}on_cube_reset(e){const{courier:t}=this,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=rc.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new rd(rd.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(Ts.reset(this.id,e)),i.tell(t,zs.in_tail(t.id))}else{const e=this.export().info,t=rc.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Ts.reset(this.id,e))}return i}on_insert_child(e){const{courier:t,pid:n,pcube:i}=this,{pos:r,data:s}=e,o=new ac(t);if(0===s.length)return o;let a=this.get_valid_index(r);const l=rc.pick(s);if(l.head.length>0){o.add_cmd(e);const t=rc.build_cubes(s,this),n=t[t.length-1];this.splice(a,0,...t),o.add_recover(Ts.delete_child(this.id,"backward",[a,a+t.length])),n&&o.tell(n,zs.in_tail(n.id))}const c=[...l.body];if(l.tail.length>0&&c.push(gd.get_default(l.tail)),l.roots.length>0)for(let e of l.roots)c.push(...e.info);if(c.length>0)if(this.inherit_line(c),this.is_empty)o.tell(i,Ts.insert_child(n,c,this.index)),o.tell(i,Ts.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(a+l.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const r=t.map(e=>e.export()),s=gd.get_default(r);this.inherit_line([s]),o.tell(this,Ts.delete_child(this.id,"backward",[e,this.child_count])),o.tell(i,Ts.insert_child(n,[s],this.index+1))}}o.tell(i,Ts.insert_child(n,c,this.index+1))}return o}on_delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,pid:s,index:o,pcube:a}=this,l=r.get_recorder();l.add_cmd(e);const[c,d]=n;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(!(u>=h)){if(u<=0&&h>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;e instanceof rd?(l.tell(this,Ts.delete_child(this.id,t,[1,this.child_count])),l.tell(e,ed.reset(e.id,"​")),l.tell(e,zs.loc(e.id,1,e.id,1))):l.tell(this,Ts.reset(this.id,[]))}else this.is_empty?l.tell(a,Ts.delete_child(s,t,[o,o+1])):l.tell(this,Ts.reset(this.id,[]));else{const e=this.children[u-1],n=this.children[h],i=h-u;if(u>=this.child_count||i<=0)return;let r=this.splice(u,i);l.add_recover(Ts.insert_child(this.id,r.data,c)),"backward"===t?e?l.tell(e,zs.in_tail(e.id)):n&&l.tell(n,zs.in_head(n.id)):"forward"===t&&(n?l.tell(n,zs.in_head(n.id)):e&&l.tell(e,zs.in_tail(e.id)))}return l}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:i,next_cube:r,pcube:s}=this,{from:o,from_id:a,offset:l}=e,c=new ac(t);if("left"===o){this.prev_cube_deep instanceof gd?c.tell(this,Ts.merge(this.id,"left",a,l)):c.tell(this,zs.in_head(this.id))}else if("right"===o){this.next_cube_deep instanceof gd?c.tell(this,Ts.merge(this.id,"right",a,l)):c.tell(this,zs.in_tail(this.id))}return c}static filter_out_empty(e){return e.filter(e=>!rd.is_empty_text(e))}static get meta(){return{version:1,type:n.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},i={}){const r=0===e.length?[rd.get_default()]:e;return{id:Cs(),type:n.line,info:r,css:t,attrs:i}}static get_default_by_string(e="​",t={},i={}){const r=[rd.get_default(e||"​")];return{id:Cs(),type:n.line,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}md([Os(w.cube_merge)],gd.prototype,"on_cube_merge",null),md([Os(w.cube_reset)],gd.prototype,"on_cube_reset",null),md([Os(w.cube_insert_child)],gd.prototype,"on_insert_child",null),md([Os(w.cube_delete_child)],gd.prototype,"on_delete_child",null),md([Os(w.cube_delete_adjacent)],gd.prototype,"on_cube_delete_adjacent",null);const bd=["id","data-type"],yd=jn({__name:"cube-box",props:{cube:{}},setup(e){const{status:t}=e.cube;function n(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=zs.in_tail(e.cube.id);r.tell(e.cube,s),i.record(r)}}return(e,i)=>(Rr(),Dr("div",{class:"cube-box",style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type,onPointerup:n},[(Rr(!0),Dr(Mr,null,gi(en(t).children,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],44,bd))}}),vd=(0,io.A)(yd,[["__scopeId","data-v-4cbc1d48"]]);class wd extends Jl{constructor(e){super(e)}}function xd(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class kd extends ic{_status=new wd(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return vd}get attrs(){return this.data.attrs}get meta(){return kd.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){rc.build_cubes(e.info,this,this._children)}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return kd.update_data(e,t)}gc(){super.base_gc()}replace_id(e,t={}){return kd.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new ac(t);if("left"===o&&n instanceof kd){const e=this.export().info;c.tell(n,Ts.insert_child(n.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_child_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof kd){const e=i.export().info;c.tell(this,Ts.insert_child(this.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof kd&&i instanceof kd){const e=this.export().info,t=i.export().info;c.tell(n,Ts.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=zs.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof kd&&!(i instanceof kd)){const e=this.export().info;c.tell(n,Ts.insert_child(n.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof kd)&&i instanceof kd){const e=i.export().info;c.tell(this,Ts.insert_child(this.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}return c}on_box_order(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new ac(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Ts.reorder(this.id,o.id,c)),a}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Ts.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,zs.in_head(a.id)):r.tell(this.child_last,zs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(!(u>=h)){if(u<=0&&h>=this.child_count)if(a){if(this.is_empty)return;l.tell(this,Ts.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Ts.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,Ts.delete_child(n,s,[i,i+1])):l.tell(this,Ts.reset(this.id,[]));else{const e=this.children[u-1],t=this.children[h],n=h-u;if(u>=this.child_count||n<=0)return;let i=this.splice(u,n);l.add_recover(Ts.insert_child(this.id,i.data,c)),"backward"===s?e?l.tell(e,zs.in_tail(e.id)):t&&l.tell(t,zs.in_head(t.id)):"forward"===s&&(t?l.tell(t,zs.in_head(t.id)):e&&l.tell(e,zs.in_tail(e.id)))}return l}}on_box_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=rc.filter_out_empty(n);if(0===r.length){if(this.is_empty)return;const e=this.export().info,t=new gd(gd.get_default(),this);this.splice(0,this.child_count,t),i.add_recover(Ts.reset(this.id,e)),i.tell(t,zs.in_tail(t.id))}else{const e=this.export().info,t=rc.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Ts.reset(this.id,e))}return i}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:i}=this,{from:r,from_id:s,offset:o}=e,a=new ac(t);if("left"===r){if(this.prev_cube_deep instanceof kd)a.tell(this,Ts.merge(this.id,"left",s,o));else{const e=this.export().info,t=this.child_first.id;a.tell(n,Ts.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,Ts.delete_adjacent(t,r,s,o))}}else if("right"===r){if(this.next_cube_deep instanceof kd)a.merge(this.on(Ts.merge(this.id,"right",s,o)));else{const e=this.export().info,t=this.child_first.id;a.tell(n,Ts.insert_child(i,e,this.index)),a.merge(this.remove_self());const l=n.find_cube(t);l&&a.tell(l,Ts.delete_adjacent(t,r,s,o))}}return a}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static get meta(){return{type:n.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=[];return 0===e.length?r.push(gd.get_default()):r.push(...rc.pick(e).list),{id:rc.get_id(),type:n.box,info:r,css:t,attrs:i}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}xd([Os(w.cube_merge)],kd.prototype,"on_merge",null),xd([Os(w.cube_reorder)],kd.prototype,"on_box_order",null),xd([Os(w.cube_insert_child)],kd.prototype,"on_insert_child",null),xd([Os(w.cube_delete_child)],kd.prototype,"on_delete_child",null),xd([Os(w.cube_reset)],kd.prototype,"on_box_reset",null),xd([Os(w.cube_delete_adjacent)],kd.prototype,"on_cube_delete_adjacent",null);const Sd=["id","data-type"],Cd=jn({__name:"cube-box-folder",props:{cube:{}},setup(e){const{status:t}=e.cube;return(e,n)=>(Rr(),Dr("div",{class:ve(["cube-box-folder",{"cube-box-folder-active":en(t).attrs.fold}]),id:e.cube.id,style:fe(en(t).css),"data-type":e.cube.type},[en(t).attrs.fold?(Rr(),Br(Zs,{key:0,cube:en(t).child_first},null,8,["cube"])):(Rr(!0),Dr(Mr,{key:1},gi(en(t).children,e=>(Rr(),Br(Zs,{key:e.id,cube:Ut(e)},null,8,["cube"]))),128)),$r("div",{class:ve(["folder-tag",{"folder-tag-active":en(t).attrs.fold}]),onClick:n[0]||(n[0]=t=>function(e,t){const{courier:n,history:i,cubes:r,id:s,pcube:o}=t,a=n.get_recorder();a.tell(t,Ts.fold(s,!t.attrs.fold)),i.record(a);for(let e of Object.values(r.postils))e.find_upstream_untill(o)===t&&e.visible(!1);const l=t.child_first.id;if(!l)return;const c=document.getElementById(l);c?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,Sd))}}),Md=(0,io.A)(Cd,[["__scopeId","data-v-54b23713"]]);class Ad extends Jl{constructor(e){super(e)}}function Td(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class zd extends ic{_status=new Ad(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return Md}get meta(){return zd.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof gd&&this.child_first.is_empty}get attrs(){return this.data.attrs}build_child(e){rc.build_cubes(e.info,this,this._children)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e,t){return zd.update_data(e,t)}replace_id(e,t){return zd.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:i,from_id:r}=e,s=new ac(t);if("left"===n){this.prev_cube_deep instanceof zd?s.tell(this,Ts.merge(this.id,"left",r,i)):s.tell(this,zs.in_head(this.id))}else if("right"===n){this.next_cube_deep instanceof zd?s.merge(this.on(Ts.merge(this.id,"right",r,i))):s.tell(this,zs.in_tail(this.id))}return s}on_merge(e){const{courier:t,prev_cube:n,next_cube:i,index:r,pid:s}=this,{method:o,cubeid:a,offset:l}=e,c=new ac(t);if("left"===o&&n instanceof zd){const e=this.export().info;c.tell(n,Ts.insert_child(n.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if("right"===o&&i instanceof zd){const e=i.export().info;c.tell(this,Ts.insert_child(this.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if("both"===o)if(n instanceof zd&&i instanceof zd){const e=this.export().info,t=i.export().info;c.tell(n,Ts.insert_child(n.id,e.concat(t),"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"backward",[this.index,this.index+2]));const r=n.find_cube(a);if(r){const e=zs.loc(a,l,a,l);c.tell(r,e)}}else if(n instanceof zd&&!(i instanceof zd)){const e=this.export().info;c.tell(n,Ts.insert_child(n.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(this.pid,"forward",[r,r+1]));const t=n.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}else if(!(n instanceof zd)&&i instanceof zd){const e=i.export().info;c.tell(this,Ts.insert_child(this.id,e,"tail")),c.tell(this.pcube,Ts.delete_child(s,"backward",[r+1,r+2]));const t=this.find_cube(a);if(t){const e=zs.loc(a,l,a,l);c.tell(t,e)}}return c}on_cube_reorder(e){const{courier:t,history:n,cursor:i}=this,{cubeid:r,index:s}=e,o=this.find_child_cube(r);if(!o||o.index===s)return;const a=new ac(t);let l=0,c=o.index;return"tail"===s?l=this.child_count:"number"==typeof s&&(l=s),this.splice(c,1),this.splice(l,0,o),a.add_recover(Ts.reorder(this.id,o.id,c)),a}on_cube_reset(e){const t=this.courier,{data:n}=e,i=t.get_recorder();i.add_cmd(e);const r=rc.filter_out_empty(n);if(0===r.length){const e=this.children[0];if(1===this.child_count&&e instanceof rd&&e.is_empty)return;const t=this.export().info,n=new gd(gd.get_default(),this);this.splice(0,this.child_count,n),i.add_recover(Ts.reset(this.id,t)),i.tell(n,zs.in_tail(n.id))}else{const e=this.export().info,t=rc.build_cubes(r,this);this.splice(0,this.child_count,...t),i.add_recover(Ts.reset(this.id,e))}return i}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Ts.delete_child(this.id,"backward",[s,s+o.length]));const a=o[o.length-1],l=this.children[s+1];return a?r.tell(a,zs.in_tail(a.id)):r.tell(l,zs.in_head(l.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,l=t.get_recorder();l.add_cmd(e);const[c,d]=o;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count){if(a){if(this.is_empty)return;l.tell(this,Ts.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&l.tell(e,Ts.delete_child(e.id,s,[0,e.child_count],a))}else this.is_empty?l.tell(r,Ts.delete_child(n,s,[i,i+1])):l.tell(this,Ts.reset(this.id,[]));return l}const p=this.children[u-1],_=this.children[h],f=h-u;let m=this.splice(c,f);return l.add_recover(Ts.insert_child(this.id,m.data,c)),"backward"===s?p?l.tell(p,zs.in_tail(p.id)):_&&l.tell(_,zs.in_head(_.id)):"forward"===s&&(_?l.tell(_,zs.in_head(_.id)):p&&l.tell(p,zs.in_tail(p.id))),l}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!rd.is_empty_text(e))}static get meta(){return{type:n.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},i={fold:!1}){const r=0===e.length?[gd.get_default()]:e;return{id:rc.get_id(),type:n.box_folder,info:r,css:t,attrs:i}}static replace_id(e,t,n){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info){const t=As.find_cube(i.type);t&&t.replace_id&&s.push(t.replace_id(e,i,n))}return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Td([Os(w.cube_delete_adjacent)],zd.prototype,"on_cube_delete_adjacent",null),Td([Os(w.cube_merge)],zd.prototype,"on_merge",null),Td([Os(w.cube_reorder)],zd.prototype,"on_cube_reorder",null),Td([Os(w.cube_reset)],zd.prototype,"on_cube_reset",null),Td([Os(w.cube_insert_child)],zd.prototype,"on_insert_child",null),Td([Os(w.cube_delete_child)],zd.prototype,"on_delete_child",null);class Pd{}class Nd{static update(e,t){return{id:e,name:y.update,attrs:t}}}class Rd extends Hl{_linker;_point_from={x:0,y:0};_point_to={x:0,y:0};_path="";_sample=[];_from_node;_to_node;constructor(e){super(e),this._linker=e,this._from_node=this.pcube.get_node(this.linker.from_id),this._to_node=this.pcube.get_node(this.linker.to_id)}get linker(){return this._linker}get status(){return this.linker.status}get path(){return this._path}get attrs(){return this.cube.attrs}get sample(){return[...this._sample]}get from_node(){return this.linker.from_node}get to_node(){return this.linker.to_node}get line_type(){return this.attrs.type||this.from_node?.status.node_line_type||"bezier2"}get anchor_left(){return this.from_node?.attrs.anchor_out||b.point}get anchor_right(){return this.to_node?.attrs.anchor_in||b.arrow}get line_stroke(){return this.attrs.stroke||this.from_node?.map2d.node_fill}get line_width(){return this.attrs.stroke_width||this.from_node?.map2d.node_line_width||2}get rect(){return{x:Math.min(this._point_from.x,this._point_to.x),y:Math.min(this._point_from.y,this._point_to.y),width:Math.abs(this._point_from.x-this._point_to.x),height:Math.abs(this._point_from.y-this._point_to.y)}}update_path(){const e=this.linker,t=e.from_node,n=e.to_node;if(!t||!n)return"";const i=this.line_type,r=Id.find(t,n);if(r){this._point_from=r.from,this._point_to=r.to;const e=Ed.draw({type:i,...r});this._path=e,this._sample=Gl.svg_path_sample(e,8),this.status.update_path(e),this.status.update_sample(this._sample)}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof zx||t instanceof hu)&&e.push(t),t.pcube);)t=t.pcube;let n=1,i=1;for(let t of e){const{a:e,d:r}=t.matrix2d;n*=e,i*=r}return{sx:n,sy:i}}}class Od extends Jl{_path=Kt("");_point_from=Dt({x:0,y:0});_point_to=Dt({x:0,y:0});_sample=Dt([]);constructor(e){super(e)}get map2d(){return this.cube.map2d}get cube(){return this._cube}get path(){return this._path.value}get point_from(){return this._point_from}get point_to(){return this._point_to}set point_from(e){Object.assign(this._point_from,e)}set point_to(e){Object.assign(this._point_to,e)}get map(){return this.cube.pcube}get from_node(){return this.cube.from_node}get to_node(){return this.cube.to_node}get line_type(){return this.attrs.type||this.from_node?.status.node_line_type||"bezier2"}get sample(){return[...this._sample]}get anchor_left(){return this.from_node?.status.attrs.anchor_out||b.point}get anchor_right(){return this.to_node?.status.attrs.anchor_in||b.arrow}get line_stroke(){return this.attrs.stroke||this.from_node?.status.node_fill}get line_width(){return this.attrs.stroke_width||this.from_node?.status.node_line_width||2}get css(){return{...super.css,stroke:this.line_stroke,"stroke-width":this.line_width}}update_path(e){return Promise.resolve().then(()=>{this._path.value=e})}update_sample(e){return Promise.resolve().then(()=>{this._sample.splice(0,this._sample.length,...e)})}fresh_sample(){return Gl.svg_path_sample(this.path,8)}}class Ld extends Fl{_status=new Od(this);_map2d=new Rd(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get map2d(){return this._map2d}get status(){return this._status}get show(){return this.pcube.is_linker_visible(this)}get info(){return this.data.info}get rect(){return this.map2d.rect}get component(){return ao}get from_id(){return this.attrs.from}get to_id(){return this.attrs.to}get from_node(){return this.pcube.get_node(this.from_id)}get to_node(){return this.pcube.get_node(this.to_id)}get meta(){return Ld.meta}get id(){return Gl.get_linker_id(this.from_id,this.to_id)}export(){const e=this.base_export();return e.attrs.from=this.from_id,e.attrs.to=this.to_id,e}build_child(e){}update_data(e,t){return Ld.update_data(e,t)}replace_id(e,t={}){return Ld.replace_id(this.root,e,t)}get_linker_info(){const e=this.from_node,t=this.to_node;if(!e||!t)return;const n=this.pcube.get_node_to(e.id),i=this.pcube.get_node_from(t.id),r=n?.indexOf(t.id)||-1,s=i?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:r}}on_linker_update(e){const{courier:t,history:n}=this,{attrs:i}=e,r=t.get_recorder();r.add_cmd(e);const s=structuredClone(Vt(this.data.attrs));Object.assign(this.attrs,i),this.status.update_attrs(i);const o=Nd.update(this.id,s);return r.add_recover(o),r}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t.attrs.from=n[t.attrs.from]||t.attrs.from,t.attrs.to=n[t.attrs.to]||t.attrs.to,t}static get meta(){return{cubename:"连接线",type:n.linker,block:!1,version:1,show:!1}}static get_default(e,t,i){return{id:Gl.get_linker_id(e,t),type:n.linker,info:{},attrs:{from:e,to:t},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Os(y.update)],Ld.prototype,"on_linker_update",null);class Ed{static draw(e){const{type:t,from:n,to:i}=e;return"line"===t?this.line(n,i):"bezier2"===t?this.bezier2(n,i):"polyline"===t?this.polyline(n,i):"polyline2"===t?this.polyline2(n,i):"polyline3"===t?this.polyline3(n,i):"wave"===t?this.wave(n,i):this.bezier2(n,i)}static get_line(e,t,n){return"line"===n?this.line(e,t):"bezier2"===n?this.bezier2(e,t):"polyline"===n?this.polyline(e,t):"polyline2"===n?this.polyline2(e,t):"polyline3"===n?this.polyline3(e,t):"wave"===n?this.wave(e,t):this.bezier2(e,t)}static line(e,t){return`M${e.x.toFixed(1)} ${e.y.toFixed(1)}L${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static bezier2(e,t){const n=(e.x+t.x)/2,i=n,r=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${i} ${r} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const i=(e.x+t.x)/2,r=e,s=t,o=i,a=r.y,l=i,c=s.y,d=Math.sign(e.x-t.x),u=Math.sign(t.y-e.y),h=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${r.x} ${r.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+u*n} V ${c+h*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const i=e,r=t,s=(e.x+t.x)/2,o=i.y;return`M${i.x} ${i.y} L${s} ${o} L ${r.x} ${r.y}`}static polyline3(e,t,n=4){const i=(e.x+t.x)/2,r=e,s=t,o=(r.y,i),a=s.y;return`M${r.x} ${r.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,i=8){const r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s),a=Math.atan2(s,r),l=i??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const i=t/d,o=e.x+r*i,u=e.y+s*i,h=l*Math.sin(i*n*Math.PI*2),p=o+-Math.sin(a)*h,_=u+Math.cos(a)*h;if(0===t)c+=` M ${p} ${_}`;else{const i=(t-1)/d,o=l*Math.sin(i*n*Math.PI*2),u=-Math.sin(a)*o,h=Math.cos(a)*o,f=e.x+r*i+u,m=e.y+s*i+h;c+=` C ${f+(p-f)/3} ${m+(_-m)/3}, ${p-(p-f)/3} ${_-(_-m)/3}, ${p} ${_}`}}return c}}class Id{static map={right:this.right.bind(this),left:this.left.bind(this),down:this.down.bind(this),up:this.up.bind(this),"time-right":this.time_right.bind(this),"time-down":this.time_down.bind(this)};static find(e,t){const n=e.env.layout_type;if(t.env.upstream!==e)return this.free_to_any(e,t);if(n){return(0,this.map[n])(e,t)}return this.free_to_any(e,t)}static get_point(e){const t=e.env.layout_type;if(!t)return;const n=e.map2d.rect;return"right"===t?Ws.MathRect.get_rect_point(n,Ws._RectPosition.right_mid):"left"===t?Ws.MathRect.get_rect_point(n,Ws._RectPosition.left_mid):"down"===t?Ws.MathRect.get_rect_point(n,Ws._RectPosition.bottom_mid):"up"===t?Ws.MathRect.get_rect_point(n,Ws._RectPosition.top_mid):"time-down"===t?Ws.MathRect.get_rect_point(n,Ws._RectPosition.bottom_mid):"time-right"===t?Ws.MathRect.get_rect_point(n,Ws._RectPosition.right_mid):void 0}static time_down(e,t){const n=(t.env.prev_node||e).map2d.rect,i=t.map2d.rect;return{from:Ws.MathRect.get_rect_point(n,Ws._RectPosition.bottom_mid),to:Ws.MathRect.get_rect_point(i,Ws._RectPosition.top_mid)}}static time_right(e,t){const n=(t.env.prev_node||e).map2d.rect,i=t.map2d.rect;return{from:Ws.MathRect.get_rect_point(n,Ws._RectPosition.right_mid),to:Ws.MathRect.get_rect_point(i,Ws._RectPosition.left_mid)}}static up(e,t){const n=e.map2d.rect,i=t.map2d.rect;return{from:Ws.MathRect.get_rect_point(n,Ws._RectPosition.top_mid),to:Ws.MathRect.get_rect_point(i,Ws._RectPosition.bottom_mid)}}static right(e,t){const n=e.map2d.rect,i=t.map2d.rect;return{from:Ws.MathRect.get_rect_point(n,Ws._RectPosition.right_mid),to:Ws.MathRect.get_rect_point(i,Ws._RectPosition.left_mid)}}static left(e,t){const n=e.map2d.rect,i=t.map2d.rect;return{from:Ws.MathRect.get_rect_point(n,Ws._RectPosition.left_mid),to:Ws.MathRect.get_rect_point(i,Ws._RectPosition.right_mid)}}static down(e,t){const n=e.map2d.rect,i=t.map2d.rect;return{from:Ws.MathRect.get_rect_point(n,Ws._RectPosition.bottom_mid),to:Ws.MathRect.get_rect_point(i,Ws._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.map2d.shape_sample,i=t.map2d.shape_sample;if(0!==n.length&&0!==i.length)return Gl.find_closest_points(n,i)}}class Dd extends ks{_interaction;_flow=!1;scope_down=null;fig_matrix_origin;pos_down_real;m;count=0;rate=3;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-drag"}reset_status(){this._flow=!1}down(e,t){this.scope_down=t;const{selector:n}=t;"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&!e.ctrlKey&&(e.stopPropagation(),e.preventDefault(),this.pos_down_real=this.map.view_point_to_real(t.pos),this._flow=!0,this.fig_matrix_origin={...this.map.matrix2d})}move(e){if(!this._flow||!this.scope_down||!this._interaction.check_mouse_key(e,"right"))return;if(this.count++,this.count%this.rate===0)return;this.count=1,e.stopPropagation(),e.preventDefault();const{map_sum_scale:t}=this.scope_down,n=e.clientX,i=e.clientY,r=(n-this.scope_down.pos.x)/t.sx,s=(i-this.scope_down.pos.y)/t.sy;this.m=$l.multiply(this.fig_matrix_origin,$l.get_matrix_translate(r,s)),this.map.reset_matrix(this.m)}up(e){if(!this._flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const t=this.courier.get_recorder();this.map.reset_matrix(this.fig_matrix_origin);const n=Is.update_attr(this.map.id,{matrix2d:this.m});t.tell(this.map,n),this.history.record(t),this._flow=!1,this.map.reset_matrix(this.m),this.map.check_show()}cancel(e){this._flow&&(this._flow=!1,this.map.check_show())}leave(e){this._flow&&(this._flow=!1,this.map.check_show())}wheel(e){}dblclick(e){}contextmenu(e){}}class Bd extends ks{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-scale"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){if(!e.ctrlKey)return;e.stopPropagation(),e.preventDefault();const{map_scale_step:t}=this.config.data,n=e.deltaY,i=-Math.sign(n),r={x:e.clientX,y:e.clientY},s=i*t;this.map.scale_by_point(r,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class jd extends ks{_interaction;_flow=!1;count=0;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-wheel"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){e.stopPropagation(),e.preventDefault(),this.count++;const t=-Math.sign(e.deltaY)*this.config.data.scroll_distance;if(!e.ctrlKey){if(e.shiftKey){const e=$l.multiply(this.map.matrix2d,$l.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=$l.multiply(this.map.matrix2d,$l.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}class qd extends ks{_interaction;down_point;view_cubes=[];flow=!1;count=0;rate=4;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:line-delete"}reset(){this.flow=!1,this.map.status.update_placeholder_line_delete(""),this.view_cubes=[]}down(e,t){const{selector:n,pos:i,view_cubes:r}=t;this.stats.is_read_mode||"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&e.ctrlKey&&(e.stopPropagation(),e.preventDefault(),this.flow=!0,this.down_point=this.map.view_point_to_real(i),this.view_cubes=r)}move(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault(),this.count++;const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),i=Ed.line(this.down_point,n);if(this.map.status.update_placeholder_line_delete(i),this.count%this.rate!==0)return;this.count=1;const r={from:this.down_point,to:n};this.map.clear_line_deleted();for(let e of this.view_cubes)if(e instanceof Yl){let t=e.map2d.shape_sample[0];for(let n of e.map2d.shape_sample.slice(1)){const i={from:t,to:n};if(Ws.MathLine.check_intersection(i,r)){this.map.set_line_deleted(e,!0);break}t=n}}else if(e instanceof Ld){let t=e.map2d.sample[0];for(let n of e.map2d.sample.slice(1)){const i={from:t,to:n};if(Ws.MathLine.check_intersection(i,r)){this.map.set_line_deleted(e,!0);break}t=n}}}up(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this.root,i=t.get_recorder(),r=this.map.id,s=[],o=[],a=this.map.line_deleted;for(let e of a)e instanceof Yl?s.push(e.id):e instanceof Ld&&o.push(e.id);const l=Is.node_remove(r,s),c=Is.linker_remove(r,o);i.tell(this.map,l,c),n.record(i),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class Fd extends ks{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-add"}down(e,t){}move(e){}up(e){this.flow&&(this.flow=!1)}cancel(e){this.flow}wheel(e){}leave(){}dblclick(e,t){const{selector:n,pos:i}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:r,history:s}=this,o=Yl.get_default_node_pos(i,this.map),a=[ou.get_default(o)],l=Is.node_add(this.map.id,a),c=r.get_recorder();c.tell(this.map,l),s.record(c)}contextmenu(e){}}class Hd extends ks{_interaction;_flow=!1;point_down;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-box-selected"}reset(){this.flow=!1,this.map.status.update_placeholder_box_selector("")}down(e,t){const{pos:n,selector:i}=t,{type:r,res:s}=i;"fig"===r&&this._interaction.check_mouse_key(e,"left")&&(e.preventDefault(),this.flow=!0,this.point_down=this.map.view_point_to_real(n))}move(e){if(!this.flow)return;this.count++,e.preventDefault();const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),i=this.get_rect_area(this.point_down,n);if(this.map.status.update_placeholder_box_selector(i),this.count%this.rate!==0)return;this.count=1;const r={x:Math.min(this.point_down.x,n.x),y:Math.min(this.point_down.y,n.y),width:Math.abs(n.x-this.point_down.x),height:Math.abs(n.y-this.point_down.y)},s=this.map.get_nodes_intersection(r);this.map.clear_node_selected();for(let e of s)this.map.set_node_selected(e,!0)}up(e){this.flow&&(e.stopPropagation(),e.preventDefault(),this.reset())}cancel(e){this.flow&&this.reset()}wheel(e){}leave(){}dblclick(e,t){}contextmenu(e){}get_rect_area(e,t,n=4){const i=t.x-e.x,r=t.y-e.y,s=Math.sign(i)*n,o=Math.sign(r)*n,a=e,l=a.x+i,c=a.y,d=t,u=a.x,h=a.y+r;return`M${a.x+s} ${a.y}H${l-s}Q${l} ${c} ${l} ${c+o}V${d.y-o}Q${d.x} ${d.y} ${d.x-s} ${d.y}H ${u+s}Q${u} ${h} ${u} ${h-o}V${a.y+o}Q${a.x} ${a.y} ${a.x+s} ${a.y}Z`}check_intersection(e,t){const n=e.x+e.width/2,i=e.y+e.height/2,r=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-r),a=Math.abs(i-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class $d extends ks{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-click-select"}down(e,t){const{selector:n,pos:i}=t,{type:r,res:s}=n;if("node"!==r||n.res.editable)return;e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.map.clear_node_selected();const o=this.map.status.is_node_selected(s);s.pcube.set_node_selected(s,!o)}move(e){this.flow}up(e){this.flow}leave(e){}cancel(e){}wheel(e){}dblclick(e){}contextmenu(e){}}class Gd extends ks{_interaction;_flow=!1;down_node;down_pos;matrix=new Map;matrix_translate=$l.get_matrix_translate(0,0);scope_down;recover_select=!1;has_down=!1;view_cubes=[];near;intention="none";constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-drag"}reset_status(){this.recover_select=!1,this.matrix.clear(),this.flow=!1,this.has_down=!1,this._interaction.info_node_drag.show=!1,this.view_cubes=[]}down(e,t){this.scope_down=t;const{selector:n,pos:i,selected_nodes:r,view_cubes:s}=t;if("node"===n.type&&this.map.interaction.check_mouse_key(e,"left")&&!n.res.editable)if(e.stopPropagation(),e.preventDefault(),this.reset_status(),this.has_down=!0,this.view_cubes=s,this.down_node=n.res,this.down_pos=this.map.view_point_to_real(i),r.has(this.down_node))for(let e of r)e.env.is_captive||this.matrix.set(e,{...e.matrix2d});else this.down_node.env.is_captive||this.matrix.set(this.down_node,{...this.down_node.matrix2d})}move(e){if(!this.has_down||!this.map.interaction.check_mouse_key(e,"left")||!this.down_pos||0===this.matrix.size)return;this.flow=!0,e.preventDefault();const t=this._interaction.info_node_drag,n={x:e.clientX,y:e.clientY},i=this.map.view_point_to_real(n),r=i.x-this.down_pos.x,s=i.y-this.down_pos.y;if(!this.recover_select){this.map.clear_node_selected();for(let[e]of this.matrix)this.map.set_node_selected(e,!0);this.recover_select=!0}t.show=!1,this.matrix_translate=$l.get_matrix_translate(r,s);for(let[e,t]of this.matrix){if(!t)continue;const n=$l.multiply(t,this.matrix_translate);e.reset_matrix(n),e.map2d.update_sample(),e.map2d.sync_rect(),e.map2d.update_linkers("all")}}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this,i=t.get_recorder();if(e.ctrlKey);else{const e=new Set,t=new Set;for(let[n,i]of this.matrix)if(i&&(n.reset_matrix(i),t.add(n),n.is_layout_root&&(e.add(n),!n.env.layout_type)))for(let e of n.env.downstream_nodes)t.add(e);for(let e of t){const t=e.matrix2d,n=$l.multiply(t,this.matrix_translate),r=Ds.layout_change(e.id,{matrix2d:n});i.tell(e,r)}n.record(i),this.map.grider.update_nodes([...this.matrix.keys()]);for(let t of e)t.layout_throttle()}this.reset_status()}cancel(e){this.flow&&this.reset_status()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class Vd extends ks{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit"}down(e,t){}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){const{selector:n,pos:i}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class Ud extends ks{_interaction;_flow=!1;constructor(e){super(e.root),this._interaction=e}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit-exit"}down(e,t){const{selector:n}=t,{type:i,res:r}=n;"fig"!==i&&"empty"!==i||(e.stopPropagation(),e.preventDefault(),this.cubes.clear_all_map_selected(),this.map.clear_node_editing())}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){}contextmenu(e){}}class Wd extends ks{_interaction;_flow=!1;down_node;selected_nodes=new Set;recorver_selected=!1;has_down=!1;down_pos={x:0,y:0};constructor(e){super(e.root),this._interaction=e}get min_distance(){return 5}get flow(){return this._flow}set flow(e){this._flow=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-line"}reset_status(){this.flow=!1,this.has_down=!1,this.selected_nodes.clear(),this.map.status.update_placeholder_linkers([]),this.recorver_selected=!1}down(e,t){const{selector:n,pos:i,selected_nodes:r}=t;if("node"===n.type&&this._interaction.check_mouse_key(e,"right"))if(this.reset_status(),this.has_down=!0,e.preventDefault(),e.stopPropagation(),this.down_pos=i,this.down_node=n.res,r.has(this.down_node))for(let e of r)this.selected_nodes.add(e);else this.selected_nodes.add(this.down_node)}move(e){if(!this._interaction.check_mouse_key(e,"right")||!this.has_down)return;if(Math.sqrt((e.clientX-this.down_pos.x)**2+(e.clientY-this.down_pos.y)**2)<this.min_distance)return;this.flow=!0,e.stopPropagation(),e.preventDefault();const t=this._interaction.get_map_selector(e),{res:n,type:i}=t,r=this.map.status;if(r.update_placeholder_linkers([]),!this.recorver_selected){this.recorver_selected=!0,this.map.clear_node_selected();for(let e of this.selected_nodes)this.map.set_node_selected(e,!0)}if("node"===i)for(let e of this.selected_nodes){const{from:t,to:i}=Gl.find_closest_points(e.map2d.shape_sample,n.map2d.shape_sample),s=e.map2d.node_line_type;r.add_placeholder_linker({path:Ed.get_line(t,i,s),stroke:e.map2d.node_fill,width:e.map2d.node_line_width,anchor_start:e.map2d.node_line_anchor_out,anchor_end:b.arrow})}else{const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);for(let e of this.selected_nodes){const t=Gl.find_closest_point(e.map2d.shape_sample,n),i=e.map2d.node_line_type;r.add_placeholder_linker({path:Ed.get_line(t,n,i),stroke:e.map2d.node_fill,width:e.map2d.node_line_width,anchor_start:e.map2d.node_line_anchor_out,anchor_end:b.arrow})}}}async up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation(),await rc.sleep(1);const{courier:t,history:n}=this,i=this._interaction.get_map_selector(e),{res:r,type:s}=i;if("node"===s){if(r===this.down_node)return;const e=t.get_recorder();for(let t of this.selected_nodes){const n=Gl.get_linker_id(t.id,r.id);if(this.map.get_linker(n))Ss.tips?.tip_warning("已存在连接线");else{const n=Gl.create_linker_info(this.map,t.id,r.id),i=Is.linker_add(this.map.id,[n]);e.tell(this.map,i)}}n.record(e)}else if("fig"===s){const{courier:t,history:n}=this,i=t.get_recorder(),r=Yl.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),s=ou.get_default(r),o=Is.node_add(this.map.id,[s]);i.tell(this.map,o);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,s.id);if(this.map.get_linker(t)){Ss.tips?.tip_warning("已存在连接线");continue}const n=Gl.create_linker_info(this.map,e.id,s.id),r=Is.linker_add(this.map.id,[n]);i.tell(this.map,r)}n.record(i)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}class Yd extends ks{_map;interactions_pointer=[];interaction_keyboard=[];info_node_drag=Dt({show:!1,count:0,x:0,y:0});constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new Dd(this)),this.interactions_pointer.push(new Bd(this)),this.interactions_pointer.push(new Vd(this)),this.interactions_pointer.push(new Ud(this)),this.interactions_pointer.push(new Fd(this)),this.interactions_pointer.push(new Wd(this)),this.interactions_pointer.push(new Gd(this)),this.interactions_pointer.push(new Hd(this)),this.interactions_pointer.push(new qd(this)),this.interactions_pointer.push(new $d(this)),this.map instanceof tc&&this.interactions_pointer.push(new jd(this))}get flowing(){return this.interactions_pointer.some(e=>e.flow)}get map(){return this._map}register(e){e.addEventListener("pointerdown",this.pointerdown.bind(this)),e.addEventListener("pointermove",this.pointermove.bind(this)),e.addEventListener("pointerup",this.pointerup.bind(this)),e.addEventListener("pointercancel",this.pointercancel.bind(this)),e.addEventListener("pointerleave",this.pointerleave.bind(this)),e.addEventListener("wheel",this.wheel.bind(this)),e.addEventListener("dblclick",this.dblclick.bind(this)),e.addEventListener("contextmenu",this.contextmenu.bind(this))}check_mouse_key(e,t){return rc.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,i=t.id;if(i&&e){if(e===n.node){const e=this.map.get_node(i);if(e)return{type:"node",res:e}}else if(e===n.linker){const e=this.map.get_linker(i);if(e)return{type:"linker",res:e}}else if(e===n.map||e===n.submap)return{type:"fig",res:this.map};t=t.parentElement}else t=t.parentElement}return{type:"empty",res:void 0}}pointerdown(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.nodes_selected,view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()},{selector:n}=t,{res:i,type:r}=n;if("node"===r&&this.root.isdev){console.log("------------------------------------节点信息");const{map2d:t,env:n}=i;console.log("id",i.id),console.log("matrix:",{...t.matrix2d}),console.log("pos_tree:",t.pos_tree),console.log("rect:",t.rect),console.log("size_tree:",t.size_tree),console.log("layout_type:",n.layout_type),console.log("节点",i),this.check_mouse_key(e,"mid")&&i.a()}for(let n of this.interactions_pointer)n.down(e,t);"fig"===t.selector.type&&this.event.emit_fig_click(e)}pointermove(e){for(let t of this.interactions_pointer)t.move(e)}pointerup(e){for(let t of this.interactions_pointer)t.up(e)}pointercancel(e){for(let t of this.interactions_pointer)t.cancel(e)}pointerleave(e){for(let t of this.interactions_pointer)t.leave(e)}dblclick(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.nodes_selected,view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()};for(let n of this.interactions_pointer)n.dblclick(e,t)}wheel(e){for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}class Xd{_observer;_nodes={};constructor(){this._observer=new ResizeObserver(this.watch.bind(this))}watch(e,t){for(let t of e){const e=t.target,n=t.target.dataset.id,i=this._nodes[n];i&&e.isConnected&&i.layout_self(t)}}register(e,t){const n=e.dataset.id;n&&(this._nodes[n]=t,this._observer.observe(e))}unregister(e){const t=e.dataset.id;t&&(delete this._nodes[t],e&&this._observer.unobserve(e))}}const Kd=new Xd,Jd=["id","data-type","transform","data-editing"],Qd=["d"],Zd=["x","y","width","height"],eu=["data-id"],tu={class:"node-status"},nu=jn({__name:"cube-node",props:{cube:{}},setup(e){const{map2d:t,status:n}=e.cube,i=Kt();ii(()=>{const t=i.value;t&&Kd.register(t,e.cube)}),oi(()=>{const e=i.value;e&&Kd.unregister(e)});const r=ws(()=>({"node-selected":e.cube.pcube.status.is_node_selected(e.cube),"node-editable":n.editable,"line-delete-selected":e.cube.pcube.status.is_line_deleted(e.cube)}));function s(){const{courier:t,history:n}=e.cube,i=t.get_recorder(),r=Ds.layout_change(e.cube.id,{root:!1});i.tell(e.cube,r),n.record(i)}function o(t=!0){const{courier:n,history:i}=e.cube,r=n.get_recorder(),s=Ds.layout_change(e.cube.id,{fold:t});r.tell(e.cube,s),i.record(r)}const a=ws(()=>{const e=n.css.fill;return{"--fill":e,"--color":function(e,t="#FFFFFF",n=158){if(!e)return"";const i=Wo(e),{r,g:s,b:o,a}=i;if(1===a)return(299*r+587*s+114*o)/1e3>n?"#000000":"#FFFFFF";if(0===a){const e=Wo(t);return(299*e.r+587*e.g+114*e.b)/1e3>n?"#000000":"#FFFFFF"}const l=Wo(t);return(299*Math.round(r*a+l.r*(1-a))+587*Math.round(s*a+l.g*(1-a))+114*Math.round(o*a+l.b*(1-a)))/1e3>n?"#000000":"#FFFFFF"}(e,$o.bg)}});return(t,l)=>(Rr(),Dr("g",{id:t.cube.id,"data-type":t.cube.type,class:ve(["cube-node",r.value]),transform:en(n).matrix2d_dom_string,"data-editing":en(n).editable,style:fe(a.value)},[$r("path",{d:en(n).shape_path,ref:"p"},null,8,Qd),(Rr(),Dr("foreignObject",{x:en(n).rect_cbox.x,y:en(n).rect_cbox.y,width:en(n).rect_cbox.width,height:en(n).rect_cbox.height,style:fe(en(n).css)},[$r("div",{class:"cube-node-box",ref_key:"box",ref:i,"data-id":t.cube.id},[(Rr(!0),Dr(Mr,null,gi(en(n).children,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128)),Xr(" node statusbar "),$r("div",tu,[en(n).attrs.root?(Rr(),Dr("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:s})):Xr("v-if",!0),en(n).attrs.layout?(Rr(),Dr("div",{key:1,class:ve(en(ea).get_layout_icons(en(n).layout_type)),onClick:l[0]||(l[0]=t=>{return n=t,void e.cube.float.float_node_layout.show(n,e.cube);var n})},null,2)):Xr("v-if",!0),en(n).has_layout_ability&&en(n).downstream_nodes_count>0?(Rr(),Dr(Mr,{key:2},[en(n).attrs.fold?(Rr(),Dr("div",{key:0,class:"status-fold",onClick:l[1]||(l[1]=e=>o(!1))},Ce(en(n).downstream_nodes_count),1)):(Rr(),Dr("div",{key:1,class:"iconfont icon-minussquare",onClick:l[2]||(l[2]=e=>o(!0))}))],64)):Xr("v-if",!0)])],8,eu)],12,Zd))],14,Jd))}}),iu=(0,io.A)(nu,[["__scopeId","data-v-16c679c7"]]);class ru extends Kl{constructor(e){super(e)}get cube(){return this._cube}}class su extends Ql{constructor(e){super(e)}}class ou extends Yl{_status=new su(this);_map2d=new ru(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get map2d(){return this._map2d}get status(){return this._status}get meta(){return ou.meta}get component(){return iu}build_child(e){rc.build_cubes(e.info,this,this._children)}update_data(e,t){return ou.update_data(e,t)}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone(Vt(this.attrs)),e.attrs.matrix2d=this.matrix2d_real;for(let t of this._children)e.info.push(t.export());return e}replace_id(e,t={}){return ou.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:n.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,rc.replace_id(e,t.info,n),t}static get_default(e,t="rect"){return{id:rc.get_id(),type:n.node,info:[Yc.get_default()],attrs:{root:!1,matrix2d:{a:1,b:0,c:0,d:1,e:e.x,f:e.y},shape:t,layout:null},css:{}}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}a(e=!0,t="right",n=!1){const{courier:i}=this,r=i.get_recorder(),s=Ds.layout_change(this.id,{root:e,layout:t,fold:n});r.tell(this,s),this.history.record(r),this.env.layout_root?.layout()}}class au{static get_shaple(e,t=8){const n=e.attrs.shape;return"rect"===n?this.rect(e,t):"circle"===n?this.circle(e,t):this.rect(e)}static rect(e,t=8,n=8){const{width:i,height:r}=e.map2d.rect_cbox,s=0,o=0,a=i+2*t,l=0,c=i+2*t,d=r+2*t,u=0,h=r+2*t;return`M${s+n} ${o}H${a-n}Q${a} ${l} ${a} ${l+n}V${d-n}Q${c} ${d} ${c-n} ${d}H ${u+n}Q${u} ${h} ${u} ${h-n}V${o+n}Q${s} ${o} ${s+n} ${o}Z`}static circle(e,t=8){const{width:n,height:i}=e.map2d.rect_cbox,r=Math.sqrt(n*n+i*i)/2,s=0;return`M${r} ${s} A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} ${s}`}}class lu{_row;_col;_nodes=new Set;constructor(e,t){this._row=e,this._col=t}get pos(){return{row:this._row,col:this._col}}get row(){return this._row}get col(){return this._col}get nodes(){return new Set(this._nodes)}add_node(e){this._nodes.add(e)}remove_node(e){this._nodes.delete(e)}}class cu{_map;_nodes=new Map;_grider=[];_grid_width;_grid_height;constructor(e){this._map=e,this._grid_width=window.innerWidth,this._grid_height=window.innerHeight}get map(){return this._map}get grid_size(){return{width:this._grid_width,height:this._grid_height}}update_nodes(e){for(let t of e)this.update_node(t)}update_node(e){const t=this.get_node_griders(e),n=e.id;if(this._nodes.has(n)){this._nodes.get(n).forEach(t=>t.remove_node(e))}const i=[];for(let e of t){const t=e.row,n=e.col;if(this._grider[t]||(this._grider[t]=[]),!this._grider[t][n]){const e=new lu(t,n);this._grider[t][n]=e}i.push(this._grider[t][n])}this._nodes.set(n,i),i.forEach(t=>t.add_node(e))}remove_node(e){const t=e.id;if(this._nodes.has(t)){this._nodes.get(t).forEach(t=>t.remove_node(e)),this._nodes.delete(t)}}get_node_griders(e){const t=[],n=e.map2d.rect,i=Math.floor(n.y/this._grid_height),r=Math.floor((n.y+n.height)/this._grid_height),s=Math.floor(n.x/this._grid_width),o=Math.floor((n.x+n.width)/this._grid_width);for(let e=i;e<=r;e++)for(let n=s;n<=o;n++)t.push({row:e,col:n});return t}get_viewport_griders(){const e=this._map.get_view_rect(),t=[],n=Math.floor(e.y/this._grid_height),i=Math.floor((e.y+e.height)/this._grid_height),r=Math.floor(e.x/this._grid_width),s=Math.floor((e.x+e.width)/this._grid_width);for(let e=n;e<=i;e++)for(let n=r;n<=s;n++)this._grider[e]&&this._grider[e][n]&&t.push(this._grider[e][n]);return t}get_intersection_griders(e){const t=[],n=Math.floor(e.y/this._grid_height),i=Math.floor((e.y+e.height)/this._grid_height),r=Math.floor(e.x/this._grid_width),s=Math.floor((e.x+e.width)/this._grid_width);for(let e=n;e<=i;e++)for(let n=r;n<=s;n++)this._grider[e]&&this._grider[e][n]&&t.push(this._grider[e][n]);return t}get_intersection_nodes(e){const t=new Set,n=this.get_intersection_griders(e),i=this.grid_size;for(let r of n){const n={x:r.col*i.width,y:r.row*i.height,width:i.width,height:i.height};if(Ws.MathRect.is_include(e,n))for(let e of r.nodes)t.add(e);else for(let n of r.nodes)Ws.MathRect.check_intersection(e,n.map2d.rect)&&t.add(n)}return t}}class du extends nc{_nodes_count=Kt(0);_view_rect=Dt({x:0,y:0,width:0,height:0});_nodes_view=Bt(new Set);_linkers_view=Bt(new Set);_nodes_selected=Bt(new Set);_nodes_editing=Bt(new Set);_line_delete_selected=Bt(new Set);_placeholder_linkers=Dt([]);_placeholder_box_selector=Kt("");_placeholder_line_delete=Kt("");constructor(e){super(e)}get attrs(){return this._data.attrs}get matrix2d(){return{...this.attrs.matrix2d}}get line_delete_selected(){return new Set(this._line_delete_selected)}get nodes_count(){return this._nodes_count.value}get nodes_view_count(){return this._nodes_view.size}get view_rect(){return{...this._view_rect}}get view_center(){const e=this._view_rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}get map(){return this._cube}get matrix2d_dom_string(){return $l.get_dom_string(this.matrix2d)}get placeholder_linkers(){return[...this._placeholder_linkers]}get placeholder_box_selector(){return this._placeholder_box_selector.value}get placeholder_line_delete(){return this._placeholder_line_delete.value}get nodes_view(){return new Set(this._nodes_view)}get linkers_view(){return new Set(this._linkers_view)}get nodes_selected(){return new Set(this._nodes_selected)}get nodes_editing(){return new Set(this._nodes_editing)}reset_nodes_view(e){return Promise.resolve().then(()=>{this._nodes_view.clear();for(let t of e)this._nodes_view.add(t)})}reset_linkers_view(e){return Promise.resolve().then(()=>{this._linkers_view.clear();for(let t of e)this._linkers_view.add(t)})}remove_linker(e){return Promise.resolve().then(()=>{this._linkers_view.delete(e),this._line_delete_selected.delete(e)})}remove_node(e){return Promise.resolve().then(()=>{this._nodes_view.delete(e),this._nodes_selected.delete(e),this._nodes_editing.delete(e),this._line_delete_selected.delete(e),this._nodes_count.value--})}set_node_visible(e,t){return Promise.resolve().then(()=>{t?this._nodes_view.add(e):this._nodes_view.delete(e)})}set_linker_visible(e,t){return Promise.resolve().then(()=>{t?this._linkers_view.add(e):this._linkers_view.delete(e)})}set_node_editing(e,t){return Promise.resolve().then(()=>{t?this._nodes_editing.add(e):this._nodes_editing.delete(e)})}set_node_selected(e,t){return Promise.resolve().then(()=>{t?this._nodes_selected.add(e):this._nodes_selected.delete(e)})}set_line_deleted(e,t){return Promise.resolve().then(()=>{t?this._line_delete_selected.add(e):this._line_delete_selected.delete(e)})}is_node_visible(e){return this._nodes_view.has(e)}is_linker_visible(e){return this._linkers_view.has(e)}is_node_editing(e){return this._nodes_editing.has(e)}is_node_selected(e){return this._nodes_selected.has(e)}is_line_deleted(e){return this._line_delete_selected.has(e)}clear_line_deleted(){this._line_delete_selected.clear()}clear_node_editing(){for(let e of this.nodes_editing)e.editable=!1;this._nodes_editing.clear()}clear_node_selected(){this._nodes_selected.clear()}update_nodes_count(e){return Promise.resolve().then(()=>{this._nodes_count.value=e})}update_matrix2d(e){return Promise.resolve().then(()=>{Object.assign(this.attrs.matrix2d,e||this.map.matrix2d)})}update_view_rect(e){return Promise.resolve().then(()=>{Object.assign(this._view_rect,e)})}update_placeholder_box_selector(e){this._placeholder_box_selector.value=e}update_placeholder_line_delete(e){this._placeholder_line_delete.value=e}update_placeholder_linkers(e){this._placeholder_linkers.length=0,this._placeholder_linkers.push(...e)}add_placeholder_linker(e){this._placeholder_linkers.push(e)}}function uu(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class hu extends tc{_status=new du(this);_interaction=new Yd(this);_grider=new cu(this);_app;_has_layout=!1;_nodes=new Map;_linkers=new Map;_node_from=this.data.info.node_from;_node_to=this.data.info.node_to;_node_editing=new Set;_nodes_selected=new Set;_line_delete_selected=new Set;_view_nodes=new Set;_view_linkers=new Set;_view_rect={x:0,y:0,width:0,height:0};constructor(e){super(e),this.setup(),this.status.init(),this._app=Za(ql,{cube:this}),this.stats.view="map"}get nodes(){return new Map(this._nodes)}get linkers(){return new Map(this._linkers)}get nodes_selected(){return new Set(this._nodes_selected)}get nodes_editing(){return new Set(this._node_editing)}get nodes_view(){return new Set(this._view_nodes)}get linkers_view(){return new Set(this._view_linkers)}get line_deleted(){return new Set(this._line_delete_selected)}get id(){return this.data.id}get type(){return this.data.type}get status(){return this._status}get grider(){return this._grider}get interaction(){return this._interaction}get matrix2d(){return this.attrs.matrix2d}get matrix2d_dom_string(){return $l.get_dom_string(this.matrix2d)}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get app(){return this._app}get component(){return ql}get meta(){return hu.meta}get children(){return[...this._children]}get view_rect(){return{...this._view_rect}}wait_nodes_render(e){return Gl.wait_nodes_render(e)}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this._linkers.values())e(n)&&t.push(n),t.push(...n.filter(e));for(let n of this._nodes.values())e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this._linkers.values())e(t),t.each(e);for(let t of this._nodes.values())e(t),t.each(e)}find_child_cube(e){return this._nodes.get(e)||this._linkers.get(e)}pick(...e){for(let t of e)t instanceof Yl?(this._nodes.set(t.id,t),this._view_nodes.add(t),this.status.set_node_visible(t,!0)):t instanceof Ld&&(this._linkers.set(t.id,t),this._view_linkers.add(t),this.status.set_linker_visible(t,!0));this.status.update_nodes_count(this._nodes.size)}remove_node(e){this._nodes.delete(e.id),this._view_nodes.delete(e),this.grider.remove_node(e),this.status.remove_node(e),e.gc(),this.status.update_nodes_count(this._nodes.size)}remove_linker(e){const t=this.get_node_to(e.from_id),n=this.get_node_from(e.to_id);let i;if(t&&n){const r=t.indexOf(e.to_id),s=n.indexOf(e.from_id);t.splice(r,1),n.splice(s,1),i={linker:e.export(),index_to:r,index_from:s}}return this._linkers.delete(e.id),this._view_linkers.delete(e),this._status.remove_linker(e),e.gc(),i}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");for(let e of t){let t=new ou(e,this);this._nodes.set(t.id,t),this._view_nodes.add(t)}this.status.reset_nodes_view(this._view_nodes),this.status.update_nodes_count(this._nodes.size),console.timeEnd("🍋build-nodes");for(let e of n){const{from:t,to:n}=e.attrs,i=this.get_node(e.attrs.from),r=this.get_node(e.attrs.to);if(!i||!r){const e=this._node_to[t],i=e.indexOf(n);e.splice(i,0);const r=this._node_from[n],s=r.indexOf(t);r.splice(s,1);continue}const s=new Ld(e,this);this._linkers.set(s.id,s)}this.init_env()}init_env(){const e=[];for(let t of this._nodes.values())t.is_layout_root&&e.push(t);for(let t of e)t.env.flow("downstream")}init_map2d(){console.time("🍋wait-size-tree");const e=[];for(let t of this._nodes.values())t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.map2d.flow();console.timeEnd("🍋wait-size-tree")}init_grider(){const e=Date.now();this._grider.update_nodes(this._nodes.values()),console.log("🍋init-grider:",Date.now()-e)}gc(){}export(){const e=[],t=[],n={nodes:e,linkers:t,node_from:structuredClone(this._node_from),node_to:structuredClone(this._node_to)},i=structuredClone({...this.data,info:n});i.versions=As.export_versions();for(let t of this._nodes.values())e.push(t.export());for(let e of this._linkers.values())t.push(e.export());return i}update_data(e,t){return hu.update_data(e,t)}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg & nodes"),await mo.ps,await Gl.wait_nodes_render([...this._view_nodes]),console.timeEnd("🍋wait-svg & nodes"),await rc.sleep(100),this.init_map2d(),this.init_grider(),this.check_show(),this._has_layout=!0;const t=this.dom?.querySelector(".note");this.event.emit_status_update(),t&&(this.hotkeys.listen(t),this.interaction.register(t))}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,s=i.get_recorder();s.add_cmd(e);const o=rc.build_cubes(t,this);this.pick(...o);const a=t.map(e=>e.id);return s.add_recover(Is.node_remove(this.id,a)),Promise.resolve().then(async()=>{const e=o.map(e=>e.wait_layout_self());await Promise.all(e),this.grider.update_nodes(o)}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set,l=new Set,c=new Set;for(let e of t){const t=this.get_node(e);if(t){a.add(t);for(let e of t.env.downstream_nodes)a.add(e)}}for(let e of a){for(const t of e.linkers_from)c.add(t.id);for(const t of e.linkers_to)c.add(t.id)}for(let e of a){o.push(e.export());const t=e.env.layout_root;t&&t!==e&&l.add(e.env.layout_root),this.remove_node(e)}return s.tell(this,Is.linker_remove(this.id,[...c])),s.add_recover(Is.node_add(this.id,o)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,s=n.get_recorder();if(0===t.length)return;let o=Promise.resolve();s.add_cmd(e);const a=[],l=[],c=new Set,d=new Set;for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new Ld(i,this),s=r.from_node,o=r.to_node;if(!s||!o)continue;this.pick(r);let u=this.get_node_from(r.to_id),h=this.get_node_to(r.from_id);if(u?u.indexOf(r.from_id)<0&&u.splice(n,0,r.from_id):this._node_from[r.to_id]=[r.from_id],h?h.indexOf(r.to_id)<0&&h.splice(t,0,r.to_id):this._node_to[r.from_id]=[r.to_id],a.unshift(r.id),!o.env.is_captive){const{has_root:e,line:t}=Gl.find_line_to_layout_root(o);d.add(o),l.push(o.wait_layout_self()),t[1]&&c.add(t[1])}}const u=new Set;for(let e of c){e.env.flow(),e.map2d.flow("self"),e.map2d.flow("upstream");const t=e.env.layout_root;t&&u.add(t)}return s.add_recover(Is.linker_remove(this.id,a)),o.then(async()=>{await Promise.all(l);for(let e of d)e.env.is_captive||e.map2d.update_linkers("from");for(let e of u)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set,l=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,i=t.to_node;n&&a.add(n),i&&l.add(i);const r=this.remove_linker(t);r&&o.unshift(r)}if(0===o.length)return;for(let e of l){if(!e.env.check_env(!1).has_root){const t=Ds.layout_change(e.id,{root:!0});s.tell(e,t)}}const c=new Set;for(let e of a){e.env.flow(),e.map2d.flow("downstream"),e.map2d.flow("upstream");const t=e.env.layout_root;t&&c.add(t)}for(let e of c)e.layout_throttle();return s.add_recover(Is.linker_add(this.id,o)),s}on_update_attrs(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();return r.add_cmd(e),"matrix2d"in i&&i.matrix2d&&(r.add_recover(Is.update_attr(this.id,{matrix2d:{...this.matrix2d}})),this.reset_matrix(i.matrix2d)),r}replace_id(e,t={}){return hu.replace_id(this.root,e,t)}get_nodes_intersection(e){const t=this.grider.get_intersection_nodes(e);return Array.from(t)}get_linker_id(e,t){return Gl.get_linker_id(e,t)}get_linker(e){return this._linkers.get(e)}get_node(e){return this._nodes.get(e)}get_node_from(e){return this._node_from[e]}get_node_to(e){return this._node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),s={x:i,y:Math.max(0,n.top)},o={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y,u={x:Math.trunc(a.x),y:Math.trunc(a.y),width:Math.trunc(c),height:Math.trunc(d)};return Object.assign(this._view_rect,u),this.status.update_view_rect(u),u}get_view_center(){const e=this.view_rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[],n=this.grider.get_intersection_nodes(e);t.push(...n);for(let e of n)t.push(...e.linkers_from),t.push(...e.linkers_to);return t}set_node_visible(e,t){t?this._view_nodes.add(e):this._view_nodes.delete(e)}set_linker_visible(e,t){t?this._view_linkers.add(e):this._view_linkers.delete(e)}set_node_editing(e,t){t?this._node_editing.add(e):this._node_editing.delete(e),this.status.set_node_editing(e,t)}set_node_selected(e,t){t?this._nodes_selected.add(e):this._nodes_selected.delete(e),this.status.set_node_selected(e,t)}set_line_deleted(e,t){t?this._line_delete_selected.add(e):this._line_delete_selected.delete(e),this.status.set_line_deleted(e,t)}is_node_visible(e){return this._view_nodes.has(e)}is_linker_visible(e){return this._view_linkers.has(e)}is_node_editing(e){return this._node_editing.has(e)}is_node_selected(e){return this._nodes_selected.has(e)}is_line_deleted(e){return this._line_delete_selected.has(e)}clear_node_editing(){for(let e of this._node_editing)e.editable=!1;this._node_editing.clear()}clear_node_selected(){this._nodes_selected.clear(),this.status.clear_node_selected()}clear_line_deleted(){this._line_delete_selected.clear(),this.status.clear_line_deleted()}get_farest_node_selected(e){if(0!==this._nodes_selected.size){if(e===P.left){let e;for(let t of this._nodes_selected){const n=t.map2d.rect;(!e||n.x<e.map2d.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this._nodes_selected){const n=t.map2d.rect,i=e?.map2d.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this._nodes_selected){const n=t.map2d.rect,i=e?.map2d.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this._nodes_selected){const n=t.map2d.rect,i=e?.map2d.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.map2d.rect;let i=e,r=1/0;if(t===P.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.map2d.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.map2d.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.map2d.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.map2d.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}return i}move_select(e){if(0===this._nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.set_node_selected(n,!0),n.move_in_fig_view()}reset_matrix(e){Object.assign(this.matrix2d,e),this.get_view_rect(),this.status.update_matrix2d(e),this.event.emit_status_update()}translate(e,t){const n=$l.multiply(this.matrix2d,$l.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,s=this.matrix2d.a+t;if(s>i||s<r)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=o.x-l.x,d=o.y-l.y,u=$l.multiply(this.matrix2d,$l.get_matrix_translate(c,d));this.reset_matrix(u)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:s}=e;return{x:(r-t.x)/n,y:(s-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+s,y:n*a+r*l+o}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-i*l)/t,y:(l-o-n*a)/r}}find_layout_root(e){const t=new Set;for(let n of e){n.is_layout_root&&t.add(n)}return t}async layout(){console.time("🍋layout-nodes");const e=[];for(let t of this.nodes.values())t.is_layout_root&&t.attrs.layout&&e.push(t);for(let t of e)t.layout();console.timeEnd("🍋layout-nodes")}check_show(){console.time("🍋动态显示检查"),this.check_show_node(),this.check_show_line(),console.timeEnd("🍋动态显示检查")}check_show_node(){this._view_nodes.clear();const e=this._grider.get_viewport_griders();for(let t of e)for(let e of t.nodes)if(!e.env.folded_upstream){this._view_nodes.add(e);e.map2d.sync_rect()}this.status.reset_nodes_view(this._view_nodes)}check_show_line(){this._view_linkers.clear();for(let e of this._view_nodes)e.check_show_line();this.status.reset_linkers_view(this._view_linkers);for(let e of this._view_linkers)e.map2d.update_path()}layout_throttle=Ws.Notice.throttle(this.layout.bind(this),10);check_show_throttle=Ws.Notice.throttle(this.check_show.bind(this),10);static get meta(){return{type:n.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:rc.get_id(),type:n.map,versions:As.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:$l.get_default()}}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,rc.replace_id(e,t.info.nodes,n),rc.replace_id(e,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}uu([Os(k.node_add)],hu.prototype,"on_node_add",null),uu([Os(k.node_remove)],hu.prototype,"on_node_remove",null),uu([Os(k.linker_add)],hu.prototype,"on_linker_add",null),uu([Os(k.linker_remove)],hu.prototype,"on_linker_remove",null),uu([Os(k.update_attrs)],hu.prototype,"on_update_attrs",null);const pu=["id","data-type"],_u={class:"cube-api-functions"},fu={key:0,class:"cube-api-arguments"},mu={key:1,class:"cube-api-exceptions"},gu=jn({__name:"cube-api",props:{cube:{}},setup(e){const{status:t}=e.cube;return(e,n)=>(Rr(),Dr("div",{class:"cube-api",id:e.cube.id,"data-type":e.cube.type,style:fe(en(t).css),ref:"root",onContextmenu:n[0]||(n[0]=t=>en(_a)(t,e.cube))},[$r("div",_u,[n[1]||(n[1]=$r("div",{class:"legend"},"api",-1)),Gr(Zs,{cube:e.cube.functions},null,8,["cube"])]),e.cube.arguments?(Rr(),Dr("div",fu,[n[2]||(n[2]=$r("div",{class:"legend"},"arguments",-1)),Gr(Zs,{cube:en(t).arguments},null,8,["cube"])])):Xr("v-if",!0),e.cube.exceptions?(Rr(),Dr("div",mu,[n[3]||(n[3]=$r("div",{class:"legend"},"exceptions",-1)),Gr(Zs,{cube:en(t).exceptions},null,8,["cube"])])):Xr("v-if",!0)],44,pu))}}),bu=(0,io.A)(gu,[["__scopeId","data-v-55fae3a2"]]);class yu extends ic{_status=new wu(this);_functions;_arguments=void 0;_exceptions=void 0;_temp_funcnames=[];constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get functions(){return this._functions}get arguments(){return this._arguments}set arguments(e){this._arguments=e,this.status.update_arguments(e)}get exceptions(){return this._exceptions}set exceptions(e){this._exceptions=e,this.status.update_exceptions(e)}get component(){return bu}get children(){const e=[this._functions];return this.arguments&&e.push(this.arguments),this.exceptions&&e.push(this.exceptions),e}get meta(){return yu.meta}add_arguments(){if(this.arguments)return;const e=Hu.get_default();this.arguments=new Hu(e,this)}add_exceptions(){if(this.exceptions)return;const e=Hu.get_default();this.exceptions=new Hu(e,this)}replace_id(e,t={}){return yu.replace_id(this.root,e,t)}build_child(e){this._functions=new Hu(e.info.functions,this),e.info.arguments&&(this.arguments=new Hu(e.info.arguments,this)),e.info.exceptions&&(this.exceptions=new Hu(e.info.exceptions,this))}event_bubble(e){const{recorder:t,tcube:n,path:r,cmds:s}=e,o=[i.text_reset,u.remove,u.reset];r.includes(this.functions)&&s.find(e=>o.includes(e.name))&&this.parse(t);const a=s.find(e=>e.name===u.add);if(n===this.functions&&a)for(let e of a.data){const i=e.data.id,r=n.find_cube(i),s=r?.child_first_line;if(!s)continue;const o=rd.get_default("​",yu.type_funciton),a=Ts.insert_child(s.id,[o],1);t.tell(s,a)}return{stop:!1}}parse(e){const t=[];for(let e of this.functions.items){const{indent:n,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof rd);r&&t.push(r)}if(t.length===this._temp_funcnames.length){let e=!0;for(let n=0;n<t.length;n++){if(this._temp_funcnames[n]!==t[n].info){e=!1;break}}if(e)return}this._temp_funcnames=t.map(e=>e.info);const n=new Map;if(this.arguments)for(let e of this.arguments.items){const{indent:t,data:i}=e,r=i.child_first_line?.children.find(e=>e instanceof rd);r&&n.set(r.info,{item:e,text:r})}const i=new Set;for(let e of t){let t=e.data.info,n=t.indexOf("("),r=t.lastIndexOf(")");if(n>=r)continue;let s=t.slice(n+1,r).split(",").map(e=>e.trim()).filter(e=>e);for(let e of s)i.add(e)}i.size>0&&this.add_arguments();const r=[...n.values()];if(i.size===r.length){for(let[t,n]of Ws.Iteration.zip([...i],r))if(t!==n.text.info.trim()){const i=ed.reset(n.text.id,t);e.tell(n.text,i)}}else{const t=[];for(let e of i){const n=r.find(t=>t.text.info===e);if(n)t.push({indent:n.item.indent,data:n.item.data.export()});else{const n=gd.get_default([rd.get_default(e),rd.get_default(" "),rd.get_default("​",yu.type_argument)]);t.push(Hu.get_list_item([n]))}}if(this.arguments){const n=Bo.reset(this.arguments.id,t);e.tell(this.arguments,n)}}}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.functions=this.functions.export(),this.arguments&&(e.info.arguments=this.arguments.export()),this.exceptions&&(e.info.exceptions=this.exceptions.export()),e}update_data(e,t){return yu.update_data(e,t)}static get_funcitem_data(){return gd.get_default([rd.get_default(),rd.get_default(" "),rd.get_default("​",yu.type_funciton)])}static update_data(e,t){if(e>this.meta.version)return{data:t,usable:!1};if(e<2){const e=t,i=yu.get_default(e.css,e.attrs),r=[],s=[],o=i.info.functions,a=Hu.get_default();for(let t of e.info.names.info)if(t.type===n.line){const e=t.info.find(e=>e.type===n.text);r.push({name:e,type:void 0,desc:[]})}for(let t=0;t<e.info.funcs.length;t++){const i=e.info.funcs[t],s=i.desc.info[0],o=r[t];if(o){if(s.type===n.line){const e=s,t=e.info[0];if(t&&t.type===n.text&&(o.type=t),s.info.length>1){const t=gd.get_default(e.info.slice(1));o.desc.push(t)}}o.desc.push(...i.desc.info.slice(1))}}for(let t=0;t<e.info.args.length;t++){const i=e.info.args[t],{name:r,desc:o}=i,a=i.desc.info[0],l={name:rd.get_default(r),type:void 0,desc:[]};if(a.type===n.line){const e=a,t=e.info[0];if(t&&t.type===n.text&&(l.type=t),a.info.length>1){const t=gd.get_default(e.info.slice(1));l.desc.push(t)}}l.desc.push(...i.desc.info.slice(1)),s.push(l)}if(r.length>0){o.info.length=0;for(let e=0;e<r.length;e++){const t=r[e],n=gd.get_default([t.name,rd.get_default(" ")]),i=t.type||rd.get_default();Object.assign(i.css,this.type_funciton);const s=i.info.trim();s&&"​"!==s||(i.info="type"),n.info.push(i);const a=Hu.get_list_item([n,...t.desc]);o.info.push(a)}}if(s.length>0){a.info.length=0;for(let e=0;e<s.length;e++){const t=s[e],n=gd.get_default([t.name,rd.get_default(" ")]),i=t.type||rd.get_default();Object.assign(i.css,this.type_argument);const r=i.info.trim();r&&"​"!==r||(i.info="type"),n.info.push(i);const o=Hu.get_list_item([n,...t.desc]);a.info.push(o)}i.info.arguments=a}return{data:i,usable:!0}}return{data:t,usable:!0}}static get_default(e={},t={}){const i=this.get_funcitem_data();return{id:rc.get_id(),type:n.api,info:{functions:Hu.get_default([i])},css:e,attrs:t}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t.info.functions=Hu.replace_id(e,t.info.functions,n),t.info.arguments&&(t.info.arguments=Hu.replace_id(e,t.info.arguments,n)),t.info.exceptions&&(t.info.exceptions=Hu.replace_id(e,t.info.exceptions,n)),t}static get meta(){return{type:n.api,version:2,cubename:"Api",block:!0,show:!0}}static get type_funciton(){return{padding:"0px 4px",background:"var(--api-functions-type-bg)",color:"var(--api-functions-type-color)"}}static get type_argument(){return{padding:"0px 4px",background:"var(--api-arguments-type-bg)",color:"var(--api-arguments-type-color)"}}}class vu{}class wu extends Jl{_arguments=Jt(void 0);_exceptions=Jt(void 0);constructor(e){super(e)}get arguments(){return this._arguments.value}get exceptions(){return this._exceptions.value}update_arguments(e){return Promise.resolve().then(()=>{this._arguments.value=e})}update_exceptions(e){return Promise.resolve().then(()=>{this._exceptions.value=e})}}function xu(e,t="tail"){const{courier:n,history:i}=e,r=new ac(n),s=[kd.get_default(),kd.get_default()],o=ku.insert_row(e.id,t,[s]);r.tell(e,o),i.record(r)}class ku{static insert_row(e,t,n){return{id:e,name:d.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:d.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:d.change_width_col1}}}const Su=["id","data-type"],Cu=jn({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,n=Fn("root"),i=Kt();ii(()=>{const r=i.value,s=n.value;if(!r)return;const o=new Ws.DragDiff(r);let a=e.cube.attrs.width_col1,l=a;o.register_down(()=>{a=e.cube.attrs.width_col1}),o.register_move((e,n)=>{t.stats.is_read_mode||(l=Math.round(e+a),s?.style.setProperty("--width-col1",l+"px"))}),o.register_up((n,i)=>{if(t.stats.is_read_mode)return;if(a===l)return;const r=e.cube.courier.get_recorder(),s=Math.round(n+a);r.tell(e.cube,ku.change_width_col1(e.cube.id,s)),e.cube.history.record(r)}),o.register_cancel(()=>{e.cube.attrs.width=a,r.style.left=a-2+"px"})});const r=ws(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,s)=>(Rr(),Dr("div",{class:"cube-detail-list",id:t.cube.id,"data-type":t.cube.type,ref_key:"root",ref:n,style:fe(r.value),onContextmenu:s[1]||(s[1]=e=>en(_a)(e,t.cube))},[(Rr(!0),Dr(Mr,null,gi(t.cube.children,t=>(Rr(),Br(Zs,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),xu(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),xu(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),$r("div",{class:"adder-wrap",onClick:s[0]||(s[0]=()=>en(xu)(t.cube))},[...s[2]||(s[2]=[$r("div",{class:"adder"},null,-1)])]),$r("div",{class:"adjuster",ref_key:"adjuster",ref:i},null,512)],44,Su))}}),Mu=(0,io.A)(Cu,[["__scopeId","data-v-e697f078"]]);class Au extends Jl{_rows=Bt([]);constructor(e){super(e)}get children(){return[...this._children]}get cube(){return this._cube}get rows(){return[...this._rows]}init(){super.init(),this.update_rows()}update_rows(){this._rows.splice(0,this._rows.length,...this.cube.rows)}}function Tu(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class zu extends ic{_status=new Au(this);_rows=[];constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get rows(){return[...this._rows]}get component(){return Mu}get children(){const e=[];for(let t of this.rows)e.push(...t);return e}get attrs(){return this.data.attrs}get css_col1(){return this.attrs.width_col1||(this.attrs.width_col1=150),{width:this.attrs.width_col1+"px"}}get is_empty(){return!1}get row_count(){return this.rows.length}get col1(){return this.rows.map(e=>e[0])}get col2(){return this.rows.map(e=>e[1])}get meta(){return zu.meta}update_data(e,t){return zu.update_data(e,t)}build_child(e){for(let t of e.info){const e=new kd(t[0],this),n=new kd(t[1],this);this._rows.push([e,n])}}copy(e,t){if(e===t)return[this.children[e].export()];const n=Math.floor(e/2),i=Math.floor((t-1)/2),r=zu.get_default();r.info=[];for(let e=n;e<=i;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];r.info.push(n)}return 0===r.info.length?[]:[r]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs)),e.info=[];for(let[t,n]of this.rows){const i=t.export(),r=n.export();e.info.push([i,r])}return e}replace_id(e,t={}){return zu.replace_id(this.root,e,t)}splice_rows(e,t,...n){const i=this._rows.splice(e,t,...n);for(let[e,t]of i)e.gc(),t.gc();return this.status.update_rows(),i}check_delete_edge(e){return 0===e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:i}=e,r=t.get_recorder();r.add_cmd(e);const s=[];for(let[e,t]of i)s.push([new kd(e,this),new kd(t,this)]);let o=[0,0];return"tail"===n?(o=[this.row_count,this.row_count+s.length],this._rows.push(...s)):"head"===n?(o=[0,0+s.length],this._rows.unshift(...s)):(o=[n,n+s.length],this.splice_rows(n,0,...s)),this.status.update_rows(),r.add_recover(ku.remove_row(this.id,o)),r}remove_row(e){const{courier:t,cursor:n}=this,{range:i,reserve:r}=e,s=new ac(t);let[o,a]=i;if(o<0&&(o=0),a>this.row_count&&(a=this.row_count),0===o&&a>=this.row_count)if(r){if(this.is_empty)return;s.tell(this,ku.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,Ts.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,Ts.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this._rows[o-1]?.[1],t=this._rows[a+1]?.[1],n=this.splice_rows(o,a-o),i=[];for(let[e,t]of n)i.push([e.export(),t.export()]);s.add_recover(ku.insert_row(this.id,o,i)),e?s.tell(e,zs.in_tail(e.id)):t&&s.tell(t,zs.in_head(t.id))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),r.add_recover(ku.change_width_col1(i,s)),this.status.update_attrs(),r}delete_cube(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),u=Math.floor((c-1)/2),h=(this.children[l],ku.remove_row(this.id,[d,u+1],a));return this.remove_row(h)}static get meta(){return{type:n.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},i={}){const r=0===e.length?[[kd.get_default(),kd.get_default()]]:e;return{id:Cs(),type:n.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;const s=[];for(let i of t.info)s.push([kd.replace_id(e,i[0],n),kd.replace_id(e,i[1],n)]);return t.info=s,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(e<2&&(t.attrs.width_col1||(t.attrs.width_col1=150)),{data:t,usable:!0})}}Tu([Os(d.insert_row)],zu.prototype,"insert_row",null),Tu([Os(d.remove_row)],zu.prototype,"remove_row",null),Tu([Os(d.change_width_col1)],zu.prototype,"change_width_col1",null),Tu([Os(w.cube_delete_child)],zu.prototype,"delete_cube",null);class Pu{static reset(e,t){return{id:e,data:t,name:_.reset}}static add(e,t,n){return{id:e,name:_.add,data:t,pos:n}}static remove(e,t){return{id:e,name:_.remove,range:t}}static indent(e,t){return{id:e,name:_.indent,items:t}}static status(e,t,n){return{id:e,name:_.status,index:t,done:n}}}const Nu=["id","data-type"],Ru=["onClick"],Ou=jn({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t,status:n}=e.cube,{config:i}=t;return(t,r)=>(Rr(),Dr("div",{class:"cube-todo",id:t.cube.id,style:fe(en(n).css),"data-type":t.cube.type,onContextmenu:r[0]||(r[0]=e=>en(_a)(e,t.cube))},[(Rr(!0),Dr(Mr,null,gi(en(n).items,(n,r)=>(Rr(),Dr("div",{key:n.data.id,class:"todoitem",style:fe({"margin-left":n.indent*en(i).data.line_indent+"px"})},[$r("div",{class:ve(["todoitem-status",{active:n.done}]),onClick:()=>function(t,n){const i=Pu.status(e.cube.id,n,!t.done),r=e.cube.courier.get_recorder();r.tell(e.cube,i),e.cube.history.record(r)}(n,r)},null,10,Ru),Gr(Zs,{class:"todoitem-box",cube:n.data,onKeydown:e=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(a);n.tell(t,Pu.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(a);n.tell(t,Pu.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,Pu.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,Pu.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,Pu.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,Pu.indent(t.id,e)),s.record(a)}}}(e,t.cube,n,r)},null,8,["cube","onKeydown"])],4))),128))],44,Nu))}}),Lu=(0,io.A)(Ou,[["__scopeId","data-v-4bd91440"]]);class Eu extends Jl{_items=Dt([]);constructor(e){super(e)}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}get cube(){return this._cube}update_items(e){return Promise.resolve().then(()=>{const t=e||this.cube.items;this._items.splice(0,this._items.length,...t)})}update_indent(e,t){return Promise.resolve().then(()=>{const n=this._items.find(t=>t.data.id===e);n&&(n.indent=t)})}}function Iu(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Du extends ic{_status=new Eu(this);_items=[];constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get items(){return[...this._items]}get component(){return Lu}get children(){return[...this._items.map(e=>e.data)]}get meta(){return Du.meta}get info(){return this.data.info}update_data(e,t){return Du.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new kd(n.data,this),i={done:n.done,indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info=[...this.export_items()],e}export_items(){const e=[];for(let t of this._items)e.push({done:t.done,indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice_items(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({done:e.done,indent:e.indent,data:e.data.export()});return this.status.update_items(),{children:i,data:r}}replace_id(e,t={}){return Du.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new kd(n.data,this);t.push({done:n.done,indent:n.indent,data:e})}return t}create_item_data(e=0){return{done:!1,indent:e,data:kd.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Pu.reset(this.id,this.export_items());return this.splice_items(0,this._items.length,...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new kd(e.data,this);let n={done:e.done,indent:e.indent,data:Ut(t)};a.push(n)}this.splice_items(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,zs.in_tail(l.id)),s.add_recover(Pu.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(s<=0&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice_items(s,a);return r.add_recover(Pu.add(this.id,d.data,s)),l?r.tell(l,zs.in_tail(l.id)):c&&r.tell(c,zs.in_head(c.id)),r}indent_todoitem(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}),this.status.update_indent(e.id,t.indent))}return i.add_recover(Pu.indent(this.id,r)),i}update_status(e){const{courier:t}=this,{index:n,done:i}=e,r=t.get_recorder();r.add_cmd(e);const s=this._items[n];if(s)return s.done=i,r.add_recover(Pu.status(this.id,n,!i)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=Pu.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=kd.get_default();return{id:Cs(),type:n.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=rc.pick(e).list;return{done:t,indent:0,data:kd.get_default(n)}}static get meta(){return{cubename:"待办列表",type:n.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=kd.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Iu([Os(_.reset)],Du.prototype,"on_reset",null),Iu([Os(_.add)],Du.prototype,"add_item",null),Iu([Os(_.remove)],Du.prototype,"remove_item",null),Iu([Os(_.indent)],Du.prototype,"indent_todoitem",null),Iu([Os(_.status)],Du.prototype,"update_status",null),Iu([Os(w.cube_delete_child)],Du.prototype,"on_delete_child",null);const Bu=["id","data-type"],ju=jn({__name:"cube-list",props:{cube:{}},setup(e){const{status:t,config:n}=e.cube;return(e,i)=>(Rr(),Dr("div",{class:"cube-list",id:e.cube.id,style:fe(en(t).css),"data-type":e.cube.type,onContextmenu:i[0]||(i[0]=t=>en(_a)(t,e.cube))},[(Rr(!0),Dr(Mr,null,gi(en(t).items,(t,r)=>(Rr(),Dr("div",{key:t.data.id,class:"listitem",style:fe({"margin-left":t.indent*en(n).data.line_indent+"px"})},[i[1]||(i[1]=$r("div",{class:"listitem-symbol"},null,-1)),Gr(Zs,{class:"listitem-box",cube:t.data,onKeydown:n=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Bo.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Bo.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,Bo.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,Bo.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,Bo.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,Bo.indent(t.id,e)),s.record(a)}}}(n,e.cube,t,r)},null,8,["cube","onKeydown"])],4))),128))],44,Bu))}}),qu=(0,io.A)(ju,[["__scopeId","data-v-57490288"]]);function Fu(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Hu extends ic{_status=new $u(this);_items=[];constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get component(){return qu}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}get meta(){return Hu.meta}get info(){return this.data.info}update_data(e,t){return Hu.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new kd(n.data,this),i={indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=this.base_export();return e.info.length=0,e.info.push(...this.export_items()),e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice_items(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return this.status.update_items(),{children:i,data:r}}replace_id(e,t={}){return Hu.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new kd(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:kd.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Bo.reset(this.id,this.export_items());return this.splice_items(0,this._items.length,...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new kd(e.data,this);let n={indent:e.indent,data:Ut(t)};a.push(n)}this.splice_items(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,zs.in_tail(l.id)),s.add_recover(Bo.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(0===s&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice_items(s,a);return r.add_recover(Bo.add(this.id,d.data,s)),l?r.tell(l,zs.in_tail(l.id)):c&&r.tell(c,zs.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}),this.status.update_indent(e.id,t.indent))}return i.add_recover(Bo.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=Bo.remove(this.id,o);return this.remove_item(a)}static get_default(e=[]){let t=kd.get_default(e);return{id:Cs(),type:n.list,info:[{indent:0,data:t}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:kd.get_default(rc.pick(e).list)}}static get meta(){return{cubename:"列表",type:n.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=kd.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Fu([Os(u.reset)],Hu.prototype,"on_reset",null),Fu([Os(u.add)],Hu.prototype,"add_item",null),Fu([Os(u.remove)],Hu.prototype,"remove_item",null),Fu([Os(u.indent)],Hu.prototype,"indent_item",null),Fu([Os(w.cube_delete_child)],Hu.prototype,"on_delete_child",null);class $u extends Jl{_items=Dt([]);constructor(e){super(e)}get cube(){return this._cube}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}update_items(e){return Promise.resolve().then(()=>{const t=e||this.cube.items;this._items.splice(0,this._items.length,...t)})}update_indent(e,t){return Promise.resolve().then(()=>{const n=this._items.find(t=>t.data.id===e);n&&(n.indent=t)})}}class Gu{static reset(e,t){return{id:e,data:t,name:h.reset}}static add(e,t,n){return{id:e,name:h.add,data:t,pos:n}}static remove(e,t){return{id:e,name:h.remove,range:t}}static indent(e,t){return{id:e,name:h.indent,items:t}}}const Vu=["id","data-type"],Uu={class:"listitem-symbol"},Wu=jn({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t,config:n,status:i}=e.cube;return(e,t)=>(Rr(),Dr("div",{class:"cube-list-ordered",id:e.cube.id,style:fe(en(i).css),"data-type":e.cube.type,onContextmenu:t[0]||(t[0]=t=>en(_a)(t,e.cube))},[(Rr(!0),Dr(Mr,null,gi(en(i).items,(t,i)=>(Rr(),Dr("div",{key:t.data.id,class:"listitem",style:fe({"margin-left":t.indent*en(n).data.line_indent+"px"})},[$r("div",Uu,Ce(i+1),1),Gr(Zs,{class:"listitem-box",cube:t.data,onKeydown:n=>function(e,t,n,i){const{courier:r,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Gu.add(t.id,[o],i+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=r.get_recorder(),o=t.create_item_data(l);n.tell(t,Gu.add(t.id,[o],i)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,Gu.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,Gu.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:i}=o,a=r.get_recorder();if(n&&i){const e=n.find_upstream_untill(t),r=i.find_upstream_untill(t);if(!e||!r)return;const o=t.items.slice(e.index,r.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,Gu.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,Gu.indent(t.id,e)),s.record(a)}}}(n,e.cube,t,i)},null,8,["cube","onKeydown"])],4))),128))],44,Vu))}}),Yu=(0,io.A)(Wu,[["__scopeId","data-v-bbf0f1d4"]]);function Xu(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Ku extends ic{_status=new Ju(this);_items=Dt([]);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get component(){return Yu}get children(){return[...this._items.map(e=>e.data)]}get items(){return[...this._items]}get meta(){return Ku.meta}get info(){return this.data.info}update_data(e,t){return Ku.update_data(e,t)}build_child(e){this._items.push(...this.build_items(e.info))}build_items(e){const t=[];for(let n of e){let e=new kd(n.data,this),i={indent:n.indent,data:Ut(e)};t.push(i)}return t}export(){const e=super.base_export();e.info=[];for(let t of this._items)e.info.push({indent:t.indent,data:t.data.export()});return e}export_items(){const e=[];for(let t of this._items)e.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const i=this._items.slice(e,t);for(let e of i)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice_items(e,t,...n){const i=this._items.splice(e,t,...n),r=[];for(let e of i)e.data.gc(),r.push({indent:e.indent,data:e.data.export()});return this.status.update_items(),{children:i,data:r}}replace_id(e,t={}){return Ku.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new kd(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:kd.get_default()}}on_reset(e){const{data:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=Gu.reset(this.id,this.export_items());return this.splice_items(0,this._items.length,...this.build_items(t)),i.add_recover(r),i}add_item(e){const{data:t,pos:n}=e,{courier:i,pcube:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.get_valid_index(n),a=[];for(let e of t){const t=new kd(e.data,this);let n={indent:e.indent,data:Ut(t)};a.push(n)}this.splice_items(o,0,...a);const l=a[a.length-1]?.data;return l&&s.tell(l,zs.in_tail(l.id)),s.add_recover(Gu.remove(this.id,[o,o+a.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:i}=this,r=n.get_recorder();r.add_cmd(e);const[s,o]=t;if(0===s&&o>=this.child_count)return this.remove_self();const a=t[1]-t[0],l=this._items[s-1]?.data,c=this._items[o+1]?.data,d=this.splice_items(s,a);return r.add_recover(Gu.add(this.id,d.data,s)),l?r.tell(l,zs.in_tail(l.id)):c&&r.tell(c,zs.in_head(c.id)),r}indent_item(e){const{items:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=[];for(let e of t){let t=this._items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),r.push({id:e.id,indent:!e.indent}),this.status.update_indent(e.id,t.indent))}return i.add_recover(Gu.indent(this.id,r)),i}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,{dir:s,range:o}=e,a=Gu.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=kd.get_default();return{id:rc.get_id(),type:n.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:kd.get_default(rc.pick(e).list)}}static get meta(){return{cubename:"有序列表",type:n.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r;for(let i of t.info)i.data=kd.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Xu([Os(h.reset)],Ku.prototype,"on_reset",null),Xu([Os(h.add)],Ku.prototype,"add_item",null),Xu([Os(h.remove)],Ku.prototype,"remove_item",null),Xu([Os(h.indent)],Ku.prototype,"indent_item",null),Xu([Os(w.cube_delete_child)],Ku.prototype,"on_delete_child",null);class Ju extends Jl{_items=Dt([]);constructor(e){super(e)}get cube(){return super.cube}get items(){return[...this._items]}get children(){return[...this._items.map(e=>e.data)]}update_items(e){return Promise.resolve().then(()=>{const t=e||this.cube.items;this._items.splice(0,this._items.length,...t)})}update_indent(e,t){return Promise.resolve().then(()=>{const n=this._items.find(t=>t.data.id===e);n&&(n.indent=t)})}}class Qu{static update(e,t,n){return{id:e,name:p.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:p.code_add,item:Vt(t),focus:n}}static remove(e,t){return{id:e,name:p.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:p.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:p.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:p.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:p.change_theme}}}const Zu=[{id:"abap",name:"ABAP",import:()=>r.e(8617).then(r.bind(r,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>r.e(3516).then(r.bind(r,3516))},{id:"ada",name:"Ada",import:()=>r.e(7561).then(r.bind(r,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(535)]).then(r.bind(r,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7611),r.e(535),r.e(4886)]).then(r.bind(r,4886))},{id:"apache",name:"Apache Conf",import:()=>r.e(7625).then(r.bind(r,7625))},{id:"apex",name:"Apex",import:()=>r.e(9819).then(r.bind(r,9819))},{id:"apl",name:"APL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(7504)]).then(r.bind(r,7504))},{id:"applescript",name:"AppleScript",import:()=>r.e(2108).then(r.bind(r,2108))},{id:"ara",name:"Ara",import:()=>r.e(5611).then(r.bind(r,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>r.e(4354).then(r.bind(r,4354))},{id:"asm",name:"Assembly",import:()=>r.e(6324).then(r.bind(r,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(6940),r.e(4408)]).then(r.bind(r,4408))},{id:"awk",name:"AWK",import:()=>r.e(4862).then(r.bind(r,4862))},{id:"ballerina",name:"Ballerina",import:()=>r.e(5141).then(r.bind(r,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>r.e(2068).then(r.bind(r,2068))},{id:"beancount",name:"Beancount",import:()=>r.e(5026).then(r.bind(r,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>r.e(8753).then(r.bind(r,8753))},{id:"bibtex",name:"BibTeX",import:()=>r.e(4009).then(r.bind(r,4009))},{id:"bicep",name:"Bicep",import:()=>r.e(7688).then(r.bind(r,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(5283)]).then(r.bind(r,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>r.e(5314).then(r.bind(r,5314))},{id:"c",name:"C",import:()=>r.e(5814).then(r.bind(r,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>r.e(5728).then(r.bind(r,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([r.e(2473),r.e(8237)]).then(r.bind(r,8237))},{id:"clarity",name:"Clarity",import:()=>r.e(6677).then(r.bind(r,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>r.e(7681).then(r.bind(r,7681))},{id:"cmake",name:"CMake",import:()=>r.e(5936).then(r.bind(r,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(780)]).then(r.bind(r,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>r.e(9096).then(r.bind(r,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>r.e(6283).then(r.bind(r,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([r.e(7258),r.e(6563)]).then(r.bind(r,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>r.e(489).then(r.bind(r,489))},{id:"coq",name:"Coq",import:()=>r.e(8418).then(r.bind(r,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([r.e(1230),r.e(5814),r.e(4914)]).then(r.bind(r,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(5814),r.e(3894),r.e(3403)]).then(r.bind(r,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>r.e(2354).then(r.bind(r,2354))},{id:"css",name:"CSS",import:()=>r.e(1708).then(r.bind(r,1708))},{id:"csv",name:"CSV",import:()=>r.e(8849).then(r.bind(r,1230))},{id:"cue",name:"CUE",import:()=>r.e(172).then(r.bind(r,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>r.e(9806).then(r.bind(r,9806))},{id:"d",name:"D",import:()=>r.e(5177).then(r.bind(r,5177))},{id:"dart",name:"Dart",import:()=>r.e(9728).then(r.bind(r,9728))},{id:"dax",name:"DAX",import:()=>r.e(874).then(r.bind(r,874))},{id:"desktop",name:"Desktop",import:()=>r.e(6173).then(r.bind(r,6173))},{id:"diff",name:"Diff",import:()=>r.e(7670).then(r.bind(r,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>r.e(415).then(r.bind(r,415))},{id:"dotenv",name:"dotEnv",import:()=>r.e(2173).then(r.bind(r,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>r.e(3227).then(r.bind(r,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(3052)]).then(r.bind(r,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3330)]).then(r.bind(r,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([r.e(5814),r.e(9641)]).then(r.bind(r,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>r.e(2505).then(r.bind(r,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007),r.e(9524)]).then(r.bind(r,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([r.e(7900),r.e(2266)]).then(r.bind(r,2266))},{id:"fennel",name:"Fennel",import:()=>r.e(1631).then(r.bind(r,1631))},{id:"fish",name:"Fish",import:()=>r.e(9661).then(r.bind(r,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>r.e(9077).then(r.bind(r,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([r.e(8553),r.e(7549)]).then(r.bind(r,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>r.e(8553).then(r.bind(r,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([r.e(7900),r.e(9689)]).then(r.bind(r,9689))},{id:"gdresource",name:"GDResource",import:()=>r.e(7434).then(r.bind(r,7434))},{id:"gdscript",name:"GDScript",import:()=>r.e(4311).then(r.bind(r,4311))},{id:"gdshader",name:"GDShader",import:()=>r.e(6405).then(r.bind(r,6405))},{id:"genie",name:"Genie",import:()=>r.e(9017).then(r.bind(r,9017))},{id:"gherkin",name:"Gherkin",import:()=>r.e(4451).then(r.bind(r,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>r.e(2861).then(r.bind(r,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([r.e(3894),r.e(638)]).then(r.bind(r,638))},{id:"gleam",name:"Gleam",import:()=>r.e(8201).then(r.bind(r,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(8700)]).then(r.bind(r,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(5050)]).then(r.bind(r,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([r.e(5814),r.e(2723)]).then(r.bind(r,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>r.e(396).then(r.bind(r,396))},{id:"go",name:"Go",import:()=>r.e(3941).then(r.bind(r,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6940),r.e(6262),r.e(3170)]).then(r.bind(r,3170))},{id:"groovy",name:"Groovy",import:()=>r.e(1037).then(r.bind(r,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1230),r.e(6356)]).then(r.bind(r,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3949)]).then(r.bind(r,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(1655)]).then(r.bind(r,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>r.e(9045).then(r.bind(r,9045))},{id:"haxe",name:"Haxe",import:()=>r.e(8107).then(r.bind(r,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>r.e(6124).then(r.bind(r,6124))},{id:"hjson",name:"Hjson",import:()=>r.e(5203).then(r.bind(r,5203))},{id:"hlsl",name:"HLSL",import:()=>r.e(4598).then(r.bind(r,4598))},{id:"html",name:"HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940)]).then(r.bind(r,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(914)]).then(r.bind(r,914))},{id:"http",name:"HTTP",import:()=>Promise.all([r.e(7258),r.e(4714),r.e(6967),r.e(3894),r.e(6940),r.e(6262),r.e(3170),r.e(5119)]).then(r.bind(r,5119))},{id:"hxml",name:"HXML",import:()=>r.e(8320).then(r.bind(r,8320))},{id:"hy",name:"Hy",import:()=>r.e(7470).then(r.bind(r,7470))},{id:"imba",name:"Imba",import:()=>r.e(3702).then(r.bind(r,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>r.e(6343).then(r.bind(r,6343))},{id:"java",name:"Java",import:()=>r.e(6967).then(r.bind(r,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>r.e(7258).then(r.bind(r,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(3837)]).then(r.bind(r,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([r.e(7258),r.e(5536)]).then(r.bind(r,5536))},{id:"json",name:"JSON",import:()=>r.e(5709).then(r.bind(r,5709))},{id:"json5",name:"JSON5",import:()=>r.e(6010).then(r.bind(r,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>r.e(212).then(r.bind(r,212))},{id:"jsonl",name:"JSON Lines",import:()=>r.e(4843).then(r.bind(r,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>r.e(4962).then(r.bind(r,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>r.e(7922).then(r.bind(r,7922))},{id:"jsx",name:"JSX",import:()=>r.e(6262).then(r.bind(r,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([r.e(7258),r.e(1230),r.e(5814),r.e(4914),r.e(2473),r.e(9983),r.e(9910)]).then(r.bind(r,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>r.e(2660).then(r.bind(r,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>r.e(6297).then(r.bind(r,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([r.e(9983),r.e(7817)]).then(r.bind(r,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>r.e(8003).then(r.bind(r,8003))},{id:"less",name:"Less",import:()=>r.e(6964).then(r.bind(r,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(327)]).then(r.bind(r,327))},{id:"llvm",name:"LLVM IR",import:()=>r.e(3972).then(r.bind(r,3972))},{id:"log",name:"Log file",import:()=>r.e(3247).then(r.bind(r,3247))},{id:"logo",name:"Logo",import:()=>r.e(9730).then(r.bind(r,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([r.e(5814),r.e(4199)]).then(r.bind(r,4199))},{id:"luau",name:"Luau",import:()=>r.e(5744).then(r.bind(r,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>r.e(1757).then(r.bind(r,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>r.e(7900).then(r.bind(r,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([r.e(1708),r.e(4714),r.e(7611),r.e(6964),r.e(9175)]).then(r.bind(r,9175))},{id:"matlab",name:"MATLAB",import:()=>r.e(2492).then(r.bind(r,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7900),r.e(2215)]).then(r.bind(r,2215))},{id:"mdx",name:"MDX",import:()=>r.e(4452).then(r.bind(r,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>r.e(2860).then(r.bind(r,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>r.e(8499).then(r.bind(r,8499))},{id:"mojo",name:"Mojo",import:()=>r.e(9526).then(r.bind(r,9526))},{id:"move",name:"Move",import:()=>r.e(9104).then(r.bind(r,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>r.e(6239).then(r.bind(r,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>r.e(9876).then(r.bind(r,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([r.e(5814),r.e(697)]).then(r.bind(r,697))},{id:"nim",name:"Nim",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(5814),r.e(7900),r.e(4697)]).then(r.bind(r,4697))},{id:"nix",name:"Nix",import:()=>r.e(8212).then(r.bind(r,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>r.e(7374).then(r.bind(r,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>r.e(7148).then(r.bind(r,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>r.e(9788).then(r.bind(r,9788))},{id:"ocaml",name:"OCaml",import:()=>r.e(9057).then(r.bind(r,9057))},{id:"pascal",name:"Pascal",import:()=>r.e(9079).then(r.bind(r,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(9984)]).then(r.bind(r,9984))},{id:"php",name:"PHP",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6967),r.e(1230),r.e(7765),r.e(7966)]).then(r.bind(r,7765))},{id:"plsql",name:"PL/SQL",import:()=>r.e(8389).then(r.bind(r,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>r.e(4520).then(r.bind(r,4520))},{id:"polar",name:"Polar",import:()=>r.e(9845).then(r.bind(r,9845))},{id:"postcss",name:"PostCSS",import:()=>r.e(9270).then(r.bind(r,9270))},{id:"powerquery",name:"PowerQuery",import:()=>r.e(454).then(r.bind(r,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>r.e(1476).then(r.bind(r,1476))},{id:"prisma",name:"Prisma",import:()=>r.e(5731).then(r.bind(r,5731))},{id:"prolog",name:"Prolog",import:()=>r.e(9206).then(r.bind(r,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>r.e(5891).then(r.bind(r,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(6757)]).then(r.bind(r,6757))},{id:"puppet",name:"Puppet",import:()=>r.e(3593).then(r.bind(r,3593))},{id:"purescript",name:"PureScript",import:()=>r.e(9904).then(r.bind(r,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>r.e(2473).then(r.bind(r,2473))},{id:"qml",name:"QML",import:()=>Promise.all([r.e(7258),r.e(1803)]).then(r.bind(r,1803))},{id:"qmldir",name:"QML Directory",import:()=>r.e(4292).then(r.bind(r,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>r.e(402).then(r.bind(r,402))},{id:"r",name:"R",import:()=>r.e(9983).then(r.bind(r,9983))},{id:"racket",name:"Racket",import:()=>r.e(9281).then(r.bind(r,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>r.e(9780).then(r.bind(r,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(2354),r.e(245)]).then(r.bind(r,245))},{id:"reg",name:"Windows Registry Script",import:()=>r.e(5827).then(r.bind(r,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>r.e(3124).then(r.bind(r,3124))},{id:"rel",name:"Rel",import:()=>r.e(3043).then(r.bind(r,5424))},{id:"riscv",name:"RISC-V",import:()=>r.e(8684).then(r.bind(r,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(4007),r.e(8234)]).then(r.bind(r,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(4007)]).then(r.bind(r,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>r.e(7145).then(r.bind(r,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([r.e(1230),r.e(9478)]).then(r.bind(r,9478))},{id:"sass",name:"Sass",import:()=>r.e(8709).then(r.bind(r,8709))},{id:"scala",name:"Scala",import:()=>r.e(3947).then(r.bind(r,3947))},{id:"scheme",name:"Scheme",import:()=>r.e(9982).then(r.bind(r,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([r.e(1708),r.e(7611)]).then(r.bind(r,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>r.e(1624).then(r.bind(r,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>r.e(8249).then(r.bind(r,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>r.e(3894).then(r.bind(r,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([r.e(3894),r.e(9965)]).then(r.bind(r,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>r.e(1066).then(r.bind(r,1066))},{id:"solidity",name:"Solidity",import:()=>r.e(4780).then(r.bind(r,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(7642)]).then(r.bind(r,7642))},{id:"sparql",name:"SPARQL",import:()=>r.e(4108).then(r.bind(r,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>r.e(6514).then(r.bind(r,6514))},{id:"sql",name:"SQL",import:()=>r.e(1230).then(r.bind(r,8849))},{id:"ssh-config",name:"SSH Config",import:()=>r.e(3874).then(r.bind(r,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([r.e(1230),r.e(542)]).then(r.bind(r,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>r.e(41).then(r.bind(r,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4714),r.e(3454)]).then(r.bind(r,3454))},{id:"swift",name:"Swift",import:()=>r.e(8436).then(r.bind(r,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>r.e(6577).then(r.bind(r,6577))},{id:"systemd",name:"Systemd Units",import:()=>r.e(16).then(r.bind(r,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>r.e(4660).then(r.bind(r,4660))},{id:"tasl",name:"Tasl",import:()=>r.e(1839).then(r.bind(r,1839))},{id:"tcl",name:"Tcl",import:()=>r.e(7328).then(r.bind(r,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(3941),r.e(7095)]).then(r.bind(r,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>r.e(4385).then(r.bind(r,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([r.e(9983),r.e(9198)]).then(r.bind(r,9198))},{id:"toml",name:"TOML",import:()=>r.e(5363).then(r.bind(r,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(9556)]).then(r.bind(r,9556))},{id:"tsv",name:"TSV",import:()=>r.e(6045).then(r.bind(r,8426))},{id:"tsx",name:"TSX",import:()=>r.e(6940).then(r.bind(r,6940))},{id:"turtle",name:"Turtle",import:()=>r.e(4877).then(r.bind(r,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(6967),r.e(1230),r.e(5814),r.e(3894),r.e(6940),r.e(6262),r.e(4914),r.e(3170),r.e(2473),r.e(7611),r.e(4007),r.e(7765),r.e(4236)]).then(r.bind(r,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>r.e(4714).then(r.bind(r,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>r.e(794).then(r.bind(r,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>r.e(8711).then(r.bind(r,8711))},{id:"v",name:"V",import:()=>r.e(5443).then(r.bind(r,5443))},{id:"vala",name:"Vala",import:()=>r.e(7141).then(r.bind(r,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>r.e(8235).then(r.bind(r,8235))},{id:"verilog",name:"Verilog",import:()=>r.e(4283).then(r.bind(r,4283))},{id:"vhdl",name:"VHDL",import:()=>r.e(5521).then(r.bind(r,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>r.e(7567).then(r.bind(r,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432)]).then(r.bind(r,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(1432),r.e(7789)]).then(r.bind(r,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([r.e(7258),r.e(1708),r.e(4940),r.e(4714),r.e(7611),r.e(6964),r.e(1432),r.e(41),r.e(5954)]).then(r.bind(r,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>r.e(845).then(r.bind(r,845))},{id:"wasm",name:"WebAssembly",import:()=>r.e(7615).then(r.bind(r,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>r.e(8393).then(r.bind(r,8393))},{id:"wgsl",name:"WGSL",import:()=>r.e(5884).then(r.bind(r,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>r.e(2062).then(r.bind(r,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>r.e(6957).then(r.bind(r,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>r.e(5589).then(r.bind(r,5589))},{id:"xml",name:"XML",import:()=>Promise.all([r.e(6967),r.e(5585)]).then(r.bind(r,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([r.e(6967),r.e(5628)]).then(r.bind(r,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>r.e(4546).then(r.bind(r,4546))},{id:"zenscript",name:"ZenScript",import:()=>r.e(5099).then(r.bind(r,5099))},{id:"zig",name:"Zig",import:()=>r.e(3279).then(r.bind(r,3279))}],eh=Object.fromEntries(Zu.map(e=>[e.id,e.import])),th=Object.fromEntries(Zu.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),nh={...eh,...th},ih=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>r.e(2691).then(r.bind(r,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>r.e(7768).then(r.bind(r,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>r.e(7927).then(r.bind(r,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>r.e(1216).then(r.bind(r,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>r.e(7788).then(r.bind(r,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>r.e(2071).then(r.bind(r,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>r.e(9692).then(r.bind(r,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>r.e(3032).then(r.bind(r,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>r.e(8485).then(r.bind(r,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>r.e(284).then(r.bind(r,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>r.e(1545).then(r.bind(r,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>r.e(6083).then(r.bind(r,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>r.e(5647).then(r.bind(r,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>r.e(9179).then(r.bind(r,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>r.e(9976).then(r.bind(r,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>r.e(9831).then(r.bind(r,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>r.e(9809).then(r.bind(r,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>r.e(9681).then(r.bind(r,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>r.e(1425).then(r.bind(r,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>r.e(6865).then(r.bind(r,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>r.e(7824).then(r.bind(r,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>r.e(3646).then(r.bind(r,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>r.e(2419).then(r.bind(r,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>r.e(9225).then(r.bind(r,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>r.e(4112).then(r.bind(r,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>r.e(8931).then(r.bind(r,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>r.e(2184).then(r.bind(r,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>r.e(2142).then(r.bind(r,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>r.e(5638).then(r.bind(r,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>r.e(7831).then(r.bind(r,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>r.e(8426).then(r.bind(r,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>r.e(3492).then(r.bind(r,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>r.e(3720).then(r.bind(r,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>r.e(9294).then(r.bind(r,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>r.e(4081).then(r.bind(r,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>r.e(1729).then(r.bind(r,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>r.e(4614).then(r.bind(r,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>r.e(2934).then(r.bind(r,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>r.e(2535).then(r.bind(r,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>r.e(4214).then(r.bind(r,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>r.e(4552).then(r.bind(r,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>r.e(6736).then(r.bind(r,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>r.e(3906).then(r.bind(r,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>r.e(4445).then(r.bind(r,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>r.e(4465).then(r.bind(r,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>r.e(6980).then(r.bind(r,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>r.e(753).then(r.bind(r,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>r.e(5424).then(r.bind(r,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>r.e(8093).then(r.bind(r,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>r.e(4838).then(r.bind(r,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>r.e(5601).then(r.bind(r,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>r.e(1857).then(r.bind(r,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>r.e(7217).then(r.bind(r,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>r.e(1931).then(r.bind(r,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>r.e(321).then(r.bind(r,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>r.e(5034).then(r.bind(r,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>r.e(224).then(r.bind(r,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>r.e(5542).then(r.bind(r,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>r.e(6517).then(r.bind(r,6517))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>r.e(5143).then(r.bind(r,5143))}],rh=Object.fromEntries(ih.map(e=>[e.id,e.import]));class sh extends Error{constructor(e){super(e),this.name="ShikiError"}}function oh(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=oh(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=oh(e[n]);return t}(e):e}function ah(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function lh(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?lh(e.substring(0,e.length-1)):e.substr(1+~t)}var ch=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,dh=class{static hasCaptures(e){return null!==e&&(ch.lastIndex=0,ch.test(e))}static replaceCaptures(e,t,n){return e.replace(ch,(e,i,r,s)=>{let o=n[parseInt(i||r,10)];if(!o)return e;{let e=t.substring(o.start,o.end);for(;"."===e[0];)e=e.substring(1);switch(s){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function uh(e,t){return e<t?-1:e>t?1:0}function hh(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let i=0;i<n;i++){let n=uh(e[i],t[i]);if(0!==n)return n}return 0}return n-i}function ph(e){return!!/^#[0-9a-f]{6}$/i.test(e)||(!!/^#[0-9a-f]{8}$/i.test(e)||(!!/^#[0-9a-f]{3}$/i.test(e)||!!/^#[0-9a-f]{4}$/i.test(e)))}function _h(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var fh=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},mh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let e=0,r=t.length;e<r;e++){let r,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),r=e.split(",")}else r=Array.isArray(s.scope)?s.scope:[""];let o=-1;if("string"==typeof s.settings.fontStyle){o=0;let e=s.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++){switch(e[t]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8}}}let a=null;"string"==typeof s.settings.foreground&&ph(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&ph(s.settings.background)&&(l=s.settings.background);for(let t=0,s=r.length;t<s;t++){let s=r[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[i++]=new vh(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=uh(e.scope,t.scope);return 0!==n?n:(n=hh(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(r=t.background)}let s=new xh(t),o=new yh(n,s.getId(i),s.getId(r)),a=new Ch(new Sh(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];a.insert(0,n.scope,n.parentScopes,n.fontStyle,s.getId(n.foreground),s.getId(n.background))}return new mh(s,o,a)}(e,t)}_cachedMatchRoot=new fh(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>function(e,t){if(0===t.length)return!0;for(let n=0;n<t.length;n++){let i=t[n],r=!1;if(">"===i){if(n===t.length-1)return!1;i=t[++n],r=!0}for(;e&&!bh(e.scopeName,i);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new yh(n.fontStyle,n.foreground,n.background):null}},gh=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const i of n)t=new e(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new e(n,t[i]);return n}push(t){return new e(this,t)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function bh(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var yh=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};var vh=class{constructor(e,t,n,i,r,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=s}},wh=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(wh||{});var xh=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},kh=Object.freeze([]),Sh=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,i,r){this.scopeDepth=e,this.parentScopes=t||kh,this.fontStyle=n,this.foreground=i,this.background=r}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==i&&(this.background=i)}},Ch=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,i=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[i]&&i++,!(n>=e.parentScopes.length||i>=t.parentScopes.length);){const r=t.parentScopes[i].length-e.parentScopes[n].length;if(0!==r)return r;n++,i++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,i=t.indexOf(".");if(-1===i?(e=t,n=""):(e=t.substring(0,i),n=t.substring(i+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,i,r,s,o){if(""===n)return void this._doInsertHere(t,i,r,s,o);let a,l,c,d=n.indexOf(".");-1===d?(a=n,l=""):(a=n.substring(0,d),l=n.substring(d+1)),this._children.hasOwnProperty(a)?c=this._children[a]:(c=new e(this._mainRule.clone(),Sh.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,i,r,s,o)}_doInsertHere(e,t,n,i,r){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===hh(o.parentScopes,t))return void o.acceptOverwrite(e,n,i,r)}-1===n&&(n=this._mainRule.fontStyle),0===i&&(i=this._mainRule.foreground),0===r&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new Sh(e,t,n,i,r))}else this._mainRule.acceptOverwrite(e,n,i,r)}},Mh=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),i=e.getTokenType(t),r=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:s,background:o})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(t,n,i,r,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,u=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==i&&(c=i),null!==r&&(d=r?1:0),-1!==s&&(u=s),0!==o&&(h=o),0!==a&&(p=a),(l|c<<8|d<<10|u<<11|h<<15|p<<24)>>>0}};function Ah(e){return e}function Th(e,t){const n=[],i=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}(e);let r=i.next();for(;null!==r;){let e=0;if(2===r.length&&":"===r.charAt(1)){switch(r.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==r)break;r=i.next()}return n;function s(){if("-"===r){r=i.next();const e=s();return t=>!!e&&!e(t)}if("("===r){r=i.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===r||","===r);){do{r=i.next()}while("|"===r||","===r);t=o()}return t=>e.some(e=>e(t))}();return")"===r&&(r=i.next()),e}if(zh(r)){const e=[];do{e.push(r),r=i.next()}while(zh(r));return n=>t(e,n)}return null}function o(){const e=[];let t=s();for(;t;)e.push(t),t=s();return t=>e.every(e=>e(t))}}function zh(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ph(e){"function"==typeof e.dispose&&e.dispose()}var Nh=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Rh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Oh=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Lh=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Nh(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Oh;for(const n of e)Eh(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof Nh){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName))continue;if(this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Eh(e,t,n,i){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Nh?Dh({baseGrammar:s,selfGrammar:r},i):Ih(e.ruleName,{baseGrammar:s,selfGrammar:r,repository:r.repository},i);const o=n.injections(e.scopeName);if(o)for(const e of o)i.add(new Nh(e))}function Ih(e,t,n){if(t.repository&&t.repository[e]){Bh([t.repository[e]],t,n)}}function Dh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Bh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Bh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Bh(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const e=i.repository?ah({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&Bh(i.patterns,{...t,repository:e},n);const r=i.include;if(!r)continue;const s=Gh(r);switch(s.kind){case 0:Dh({...t,selfGrammar:t.baseGrammar},n);break;case 1:Dh(t,n);break;case 2:Ih(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const i=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const r={baseGrammar:t.baseGrammar,selfGrammar:i,repository:e};4===s.kind?Ih(s.ruleName,r,n):Dh(r,n)}else 4===s.kind?n.add(new Rh(s.scopeName,s.ruleName)):n.add(new Nh(s.scopeName))}}}var jh=class{kind=0},qh=class{kind=1},Fh=class{constructor(e){this.ruleName=e}kind=2},Hh=class{constructor(e){this.scopeName=e}kind=3},$h=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gh(e){if("$base"===e)return new jh;if("$self"===e)return new qh;const t=e.indexOf("#");if(-1===t)return new Hh(e);if(0===t)return new Fh(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new $h(n,i)}}var Vh=/\\(\d+)/,Uh=/\\(\d+)/g;Symbol("RuleId");var Wh=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=dh.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=dh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${lh(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?dh.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?dh.replaceCaptures(this._contentName,e,t):this._contentName}},Yh=class extends Wh{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},Xh=class extends Wh{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new ep(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new tp,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Kh=class extends Wh{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns){e.getRule(n).collectPatterns(e,t)}}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new tp,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Jh=class extends Wh{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,s,o,a,l,c){super(e,t,n,i),this._begin=new ep(r,this.id),this.beginCaptures=s,this._end=new ep(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new tp;for(const t of this.patterns){e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Qh=class extends Wh{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,s,o,a,l){super(e,t,n,i),this._begin=new ep(r,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new ep(o,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new tp;for(const t of this.patterns){e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new tp,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Zh=class e{static createCaptureRule(e,t,n,i,r){return e.registerRule(e=>new Yh(t,e,n,i,r))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new Xh(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,i));if(void 0===t.begin){t.repository&&(i=ah({},i,t.repository));let r=t.patterns;return void 0===r&&t.include&&(r=[{include:t.include}]),new Kh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(r,n,i))}return t.while?new Qh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,i),e._compilePatterns(t.patterns,n,i)):new Jh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,e._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let s=0;for(const e in t){if("$vscodeTextmateLocation"===e)continue;const t=parseInt(e,10);t>s&&(s=t)}for(let e=0;e<=s;e++)r[e]=null;for(const s in t){if("$vscodeTextmateLocation"===s)continue;const o=parseInt(s,10);let a=0;t[s].patterns&&(a=e.getCompiledRuleId(t[s],n,i)),r[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=Gh(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(i[o.include],n,i);break;case 2:let r=i[t.ruleName];r&&(a=e.getCompiledRuleId(r,n,i));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,i);if(c)if(l){let t=c.repository[l];t&&(a=e.getCompiledRuleId(t,n,c.repository))}else a=e.getCompiledRuleId(c.repository.$self,n,c.repository)}}else a=e.getCompiledRuleId(o,n,i);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof Kh||e instanceof Jh||e instanceof Qh)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},ep=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,i=[],r=!1;for(let s=0;s<t;s++){if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(i.push(e.substring(n,s)),i.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(r=!0),s++}}this.hasAnchor=r,0===n?this.source=e:(i.push(e.substring(n,t)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=Vh.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return Uh.lastIndex=0,this.source.replace(Uh,(e,t)=>_h(n[parseInt(t,10)]||""))}_buildAnchorCache(){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let e,t,n,i,r=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),r[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(i=this.source.charAt(e+1),"A"===i?(r[e+1]="￿",s[e+1]="￿",o[e+1]="A",a[e+1]="A"):"G"===i?(r[e+1]="￿",s[e+1]="G",o[e+1]="￿",a[e+1]="G"):(r[e+1]=i,s[e+1]=i,o[e+1]=i,a[e+1]=i),e++);return{A0_G0:r.join(""),A0_G1:s.join(""),A1_G0:o.join(""),A1_G1:a.join("")}}resolveAnchors(e,t){return this.hasAnchor&&this._anchorCache&&"string"==typeof this.source?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},tp=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new np(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(e=>e.resolveAnchors(t,n));return new np(e,i,this._items.map(e=>e.ruleId))}},np=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},ip=class{constructor(e,t){this.languageId=e,this.tokenType=t}},rp=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new ip(e,8),this._embeddedLanguagesMatcher=new sp(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ip(0,0);_getBasicScopeAttributes=new fh(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new ip(t,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){const n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},sp=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>_h(e));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}},op=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function ap(e,t,n,i,r,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,i,r,s){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let t=r;t;t=t.pop()){const n=t.getRule(e);n instanceof Qh&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=cp(l.rule,e,l.stack.endRule,n,i===o),d=a.findNextMatchSync(t,i,c);if(!d){0,r=l.stack.pop();break}if(-2!==d.ruleId){r=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),dp(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>i&&(i=d.captureIndices[0].end,n=!1))}return{stack:r,linePos:i,anchorPosition:o,isFirstLine:n}}(e,t,n,i,r,s);r=o.stack,i=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const u=Date.now();for(;!c;){if(0!==a){if(Date.now()-u>a)return new op(r,!0)}h()}return new op(r,!1);function h(){const o=function(e,t,n,i,r,s){const o=function(e,t,n,i,r,s){const o=r.getRule(e),{ruleScanner:a,findOptions:l}=lp(o,e,r.endRule,n,i===s),c=a.findNextMatchSync(t,i,l);if(c)return{captureIndices:c.captureIndices,matchedRuleId:c.ruleId};return null}(e,t,n,i,r,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,i,r,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const u=s.contentNameScopesList.getScopeNames();for(let s=0,h=e.length;s<h;s++){const h=e[s];if(!h.matcher(u))continue;const p=t.getRule(h.ruleId),{ruleScanner:_,findOptions:f}=lp(p,t,null,i,r===o),m=_.findNextMatchSync(n,r,f);if(!m)continue;0;const g=m.captureIndices[0].start;if(!(g>=l)&&(l=g,c=m.captureIndices,a=m.ruleId,d=h.priority,l===r))break}if(c)return{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a};return null}(a,e,t,n,i,r,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,d=l.captureIndices[0].start;if(d<c||l.priorityMatch&&d===c)return l;return o}(e,t,n,i,r,d);if(!o)return s.produce(r,l),void(c=!0);const a=o.captureIndices,u=o.matchedRuleId,h=!!(a&&a.length>0)&&a[0].end>i;if(-1===u){const o=r.getRule(e);0,s.produce(r,a[0].start),r=r.withContentNameScopesList(r.nameScopesList),dp(e,t,n,r,s,o.endCaptures,a),s.produce(r,a[0].end);const u=r;if(r=r.parent,d=u.getAnchorPos(),!h&&u.getEnterPos()===i)return r=u,s.produce(r,l),void(c=!0)}else{const o=e.getRule(u);s.produce(r,a[0].start);const p=r,_=o.getName(t.content,a),f=r.contentNameScopesList.pushAttributed(_,e);if(r=r.push(u,i,d,a[0].end===l,null,f,f),o instanceof Jh){const i=o;0,dp(e,t,n,r,s,i.beginCaptures,a),s.produce(r,a[0].end),d=a[0].end;const u=i.getContentName(t.content,a),_=f.pushAttributed(u,e);if(r=r.withContentNameScopesList(_),i.endHasBackReferences&&(r=r.withEndRule(i.getEndWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(r))return r=r.pop(),s.produce(r,l),void(c=!0)}else if(o instanceof Qh){const i=o;0,dp(e,t,n,r,s,i.beginCaptures,a),s.produce(r,a[0].end),d=a[0].end;const u=i.getContentName(t.content,a),_=f.pushAttributed(u,e);if(r=r.withContentNameScopesList(_),i.whileHasBackReferences&&(r=r.withEndRule(i.getWhileWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(r))return r=r.pop(),s.produce(r,l),void(c=!0)}else{if(dp(e,t,n,r,s,o.captures,a),s.produce(r,a[0].end),r=r.pop(),!h)return r=r.safePop(),s.produce(r,l),void(c=!0)}}a[0].end>i&&(i=a[0].end,n=!1)}}function lp(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function cp(e,t,n,i,r){return{ruleScanner:e.compileWhileAG(t,n,i,r),findOptions:0}}function dp(e,t,n,i,r,s,o){if(0===s.length)return;const a=t.content,l=Math.min(s.length,o.length),c=[],d=o[0].end;for(let t=0;t<l;t++){const l=s[t];if(null===l)continue;const u=o[t];if(0===u.length)continue;if(u.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=u.start;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?r.produceFromScopes(c[c.length-1].scopes,u.start):r.produce(i,u.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=i.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),h=i.push(l.retokenizeCapturedWithRuleId,u.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,u.end));ap(e,p,n&&0===u.start,u.start,h,r,!1,0),Ph(p);continue}const h=l.getName(a,o);if(null!==h){const t=(c.length>0?c[c.length-1].scopes:i.contentNameScopesList).pushAttributed(h,e);c.push(new up(t,u.end))}}for(;c.length>0;)r.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var up=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function hp(e,t,n,i,r){const s=Th(t,pp),o=Zh.getCompiledRuleId(n,i,r.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:r,priority:n.priority})}function pp(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let i=n;i<t.length;i++)if(_p(t[i],e))return n=i+1,!0;return!1})}function _p(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}var fp=class{constructor(e,t,n,i,r,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new rp(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=mp(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const e of Object.keys(r)){const t=Th(e,pp);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:r[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),t=[],n=this._rootScopeName,i=e(n);if(i){const e=i.injections;if(e)for(let n in e)hp(t,n,e[n],this,i);const r=this._grammarRepository.injections(n);r&&r.forEach(e=>{const n=this.getExternalGrammar(e);if(n){const e=n.injectionSelector;e&&hp(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=mp(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){let r;if(-1===this._rootId&&(this._rootId=Zh.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==bp.NULL)r=!1,t.reset();else{r=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),i=Mh.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);let o;o=s?gp.createRootAndLookUpScopeName(s,i,this):gp.createRoot("unknown",i),t=new bp(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new vp(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=ap(this,s,r,0,t,a,!0,i);return Ph(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function mp(e,t){return(e=oh(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var gp=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(const t of n)r=gh.push(r,t.scopeNames),i=new e(i,r,t.encodedTokenAttributes);return i}static createRoot(t,n){return new e(null,new gh(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const r=i.getMetadataForScope(t),s=new gh(null,t),o=i.themeProvider.themeMatch(s),a=e.mergeAttributes(n,r,o);return new e(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let i=-1,r=0,s=0;return null!==n&&(i=n.fontStyle,r=n.foregroundId,s=n.backgroundId),Mh.set(e,t.languageId,t.tokenType,null,i,r,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const i=t.split(/ /g);let r=this;for(const t of i)r=e._pushAttributed(r,t,n);return r}static _pushAttributed(t,n,i){const r=i.getMetadataForScope(n),s=t.scopePath.push(n),o=i.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,r,o);return new e(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},bp=class e{constructor(e,t,n,i,r,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=r,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&gp.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,s,o,a){return new e(this,t,n,i,r,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=gp.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,gp.fromExtension(i,n.contentNameScopesList))}},yp=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):Th(e,pp).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Th(e,pp).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},vp=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(n=Mh.set(n,0,Ah(e.type),null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}return i&&(n=Mh.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n?void(this._lastTokenEndIndex=t):(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),void(this._lastTokenEndIndex=t))}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},wp=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,i,r,s,o,a){return new fp(e,t,n,i,r,s,o,a)}(e,s,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},xp=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new wp(mh.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(mh.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new yp(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,i,r){const s=new Lh(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,i,r)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,i=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,t=0,n=null,i=null,r=null){return this._syncRegistry.grammarForScopeName(e,t,n,i,r)}},kp=bp.NULL;const Sp=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Cp{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Mp(e,t){const n={},i={};for(const t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new Cp(n,i,t)}function Ap(e){return e.toLowerCase()}Cp.prototype.normal={},Cp.prototype.property={},Cp.prototype.space=void 0;class Tp{constructor(e,t){this.attribute=t,this.property=e}}Tp.prototype.attribute="",Tp.prototype.booleanish=!1,Tp.prototype.boolean=!1,Tp.prototype.commaOrSpaceSeparated=!1,Tp.prototype.commaSeparated=!1,Tp.prototype.defined=!1,Tp.prototype.mustUseProperty=!1,Tp.prototype.number=!1,Tp.prototype.overloadedBoolean=!1,Tp.prototype.property="",Tp.prototype.spaceSeparated=!1,Tp.prototype.space=void 0;let zp=0;const Pp=Dp(),Np=Dp(),Rp=Dp(),Op=Dp(),Lp=Dp(),Ep=Dp(),Ip=Dp();function Dp(){return 2**++zp}const Bp=Object.keys(e);class jp extends Tp{constructor(t,n,i,r){let s=-1;if(super(t,n),qp(this,"space",r),"number"==typeof i)for(;++s<Bp.length;){const t=Bp[s];qp(this,Bp[s],(i&e[t])===e[t])}}}function qp(e,t,n){n&&(e[t]=n)}function Fp(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const s=new jp(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Ap(i)]=i,n[Ap(s.attribute)]=i}return new Cp(t,n,e.space)}jp.prototype.defined=!0;const Hp=Fp({properties:{ariaActiveDescendant:null,ariaAtomic:Np,ariaAutoComplete:null,ariaBusy:Np,ariaChecked:Np,ariaColCount:Op,ariaColIndex:Op,ariaColSpan:Op,ariaControls:Lp,ariaCurrent:null,ariaDescribedBy:Lp,ariaDetails:null,ariaDisabled:Np,ariaDropEffect:Lp,ariaErrorMessage:null,ariaExpanded:Np,ariaFlowTo:Lp,ariaGrabbed:Np,ariaHasPopup:null,ariaHidden:Np,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Lp,ariaLevel:Op,ariaLive:null,ariaModal:Np,ariaMultiLine:Np,ariaMultiSelectable:Np,ariaOrientation:null,ariaOwns:Lp,ariaPlaceholder:null,ariaPosInSet:Op,ariaPressed:Np,ariaReadOnly:Np,ariaRelevant:null,ariaRequired:Np,ariaRoleDescription:Lp,ariaRowCount:Op,ariaRowIndex:Op,ariaRowSpan:Op,ariaSelected:Np,ariaSetSize:Op,ariaSort:null,ariaValueMax:Op,ariaValueMin:Op,ariaValueNow:Op,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function $p(e,t){return t in e?e[t]:t}function Gp(e,t){return $p(e,t.toLowerCase())}const Vp=Fp({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ep,acceptCharset:Lp,accessKey:Lp,action:null,allow:null,allowFullScreen:Pp,allowPaymentRequest:Pp,allowUserMedia:Pp,alt:null,as:null,async:Pp,autoCapitalize:null,autoComplete:Lp,autoFocus:Pp,autoPlay:Pp,blocking:Lp,capture:null,charSet:null,checked:Pp,cite:null,className:Lp,cols:Op,colSpan:null,content:null,contentEditable:Np,controls:Pp,controlsList:Lp,coords:Op|Ep,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pp,defer:Pp,dir:null,dirName:null,disabled:Pp,download:Rp,draggable:Np,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pp,formTarget:null,headers:Lp,height:Op,hidden:Rp,high:Op,href:null,hrefLang:null,htmlFor:Lp,httpEquiv:Lp,id:null,imageSizes:null,imageSrcSet:null,inert:Pp,inputMode:null,integrity:null,is:null,isMap:Pp,itemId:null,itemProp:Lp,itemRef:Lp,itemScope:Pp,itemType:Lp,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pp,low:Op,manifest:null,max:null,maxLength:Op,media:null,method:null,min:null,minLength:Op,multiple:Pp,muted:Pp,name:null,nonce:null,noModule:Pp,noValidate:Pp,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pp,optimum:Op,pattern:null,ping:Lp,placeholder:null,playsInline:Pp,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pp,referrerPolicy:null,rel:Lp,required:Pp,reversed:Pp,rows:Op,rowSpan:Op,sandbox:Lp,scope:null,scoped:Pp,seamless:Pp,selected:Pp,shadowRootClonable:Pp,shadowRootDelegatesFocus:Pp,shadowRootMode:null,shape:null,size:Op,sizes:null,slot:null,span:Op,spellCheck:Np,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Op,step:null,style:null,tabIndex:Op,target:null,title:null,translate:null,type:null,typeMustMatch:Pp,useMap:null,value:Np,width:Op,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Lp,axis:null,background:null,bgColor:null,border:Op,borderColor:null,bottomMargin:Op,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pp,declare:Pp,event:null,face:null,frame:null,frameBorder:null,hSpace:Op,leftMargin:Op,link:null,longDesc:null,lowSrc:null,marginHeight:Op,marginWidth:Op,noResize:Pp,noHref:Pp,noShade:Pp,noWrap:Pp,object:null,profile:null,prompt:null,rev:null,rightMargin:Op,rules:null,scheme:null,scrolling:Np,standby:null,summary:null,text:null,topMargin:Op,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Op,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pp,disableRemotePlayback:Pp,prefix:null,property:null,results:Op,security:null,unselectable:null},space:"html",transform:Gp}),Up=Fp({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ip,accentHeight:Op,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Op,amplitude:Op,arabicForm:null,ascent:Op,attributeName:null,attributeType:null,azimuth:Op,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Op,by:null,calcMode:null,capHeight:Op,className:Lp,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Op,diffuseConstant:Op,direction:null,display:null,dur:null,divisor:Op,dominantBaseline:null,download:Pp,dx:null,dy:null,edgeMode:null,editable:null,elevation:Op,enableBackground:null,end:null,event:null,exponent:Op,externalResourcesRequired:null,fill:null,fillOpacity:Op,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ep,g2:Ep,glyphName:Ep,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Op,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Op,horizOriginX:Op,horizOriginY:Op,id:null,ideographic:Op,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Op,k:Op,k1:Op,k2:Op,k3:Op,k4:Op,kernelMatrix:Ip,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Op,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Op,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Op,overlineThickness:Op,paintOrder:null,panose1:null,path:null,pathLength:Op,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Lp,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Op,pointsAtY:Op,pointsAtZ:Op,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ip,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ip,rev:Ip,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ip,requiredFeatures:Ip,requiredFonts:Ip,requiredFormats:Ip,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Op,specularExponent:Op,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Op,strikethroughThickness:Op,string:null,stroke:null,strokeDashArray:Ip,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Op,strokeOpacity:Op,strokeWidth:null,style:null,surfaceScale:Op,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ip,tabIndex:Op,tableValues:null,target:null,targetX:Op,targetY:Op,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ip,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Op,underlineThickness:Op,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Op,values:null,vAlphabetic:Op,vMathematical:Op,vectorEffect:null,vHanging:Op,vIdeographic:Op,version:null,vertAdvY:Op,vertOriginX:Op,vertOriginY:Op,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Op,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$p}),Wp=Fp({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Yp=Fp({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gp}),Xp=Fp({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Kp=Mp([Hp,Vp,Wp,Yp,Xp],"html"),Jp=Mp([Hp,Up,Wp,Yp,Xp],"svg"),Qp={}.hasOwnProperty;const Zp=/["&'<>`]/g,e_=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,t_=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,n_=/[|\\{}()[\]^$+*?.]/g,i_=new WeakMap;function r_(e,t){return e=e.replace(t.subset?function(e){let t=i_.get(e);t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(n_,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),i_.set(e,t));return t}(t.subset):Zp,n),t.subset||t.escapeOnly?e:e.replace(e_,function(e,n,i){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,i.charCodeAt(n+2),t)}).replace(t_,n);function n(e,n,i){return t.format(e.charCodeAt(0),i.charCodeAt(n+1),t)}}const s_=/[\dA-Fa-f]/;const o_=/\d/;const a_=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],l_={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},c_=["cent","copy","divide","gt","lt","not","para","times"],d_={}.hasOwnProperty,u_={};let h_;for(h_ in l_)d_.call(l_,h_)&&(u_[l_[h_]]=h_);const p_=/[^\dA-Za-z]/;function __(e,t,n){let i,r=function(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!s_.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(i=function(e,t,n,i){const r=String.fromCharCode(e);if(d_.call(u_,r)){const e=u_[r],s="&"+e;return n&&a_.includes(e)&&!c_.includes(e)&&(!i||t&&61!==t&&p_.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const i=function(e,t,n){const i="&#"+String(e);return n&&t&&!o_.test(String.fromCharCode(t))?i:i+";"}(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function f_(e,t){return r_(e,Object.assign({format:__},t))}const m_=/^>|^->|<!--|-->|--!>|<!-$/g,g_=[">"],b_=["<",">"];function y_(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}function v_(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const w_=/[A-Z]/g,x_=/-[a-z]/g,k_=/^data[-\w.:]+$/i;function S_(e){return"-"+e.toLowerCase()}function C_(e){return e.charAt(1).toUpperCase()}function M_(e){return e.join(" ").trim()}const A_=/[ \t\n\f\r]/g;function T_(e){return"object"==typeof e?"text"===e.type&&z_(e.value):z_(e)}function z_(e){return""===e.replace(A_,"")}const P_=O_(1),N_=O_(-1),R_=[];function O_(e){return function(t,n,i){const r=t?t.children:R_;let s=(n||0)+e,o=r[s];if(!i)for(;o&&T_(o);)s+=e,o=r[s];return o}}const L_={}.hasOwnProperty;function E_(e){return function(t,n,i){return L_.call(e,t.tagName)&&e[t.tagName](t,n,i)}}const I_=E_({body:function(e,t,n){const i=P_(n,t);return!i||"comment"!==i.type},caption:D_,colgroup:D_,dd:function(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dt:function(e,t,n){const i=P_(n,t);return Boolean(i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName))},head:D_,html:function(e,t,n){const i=P_(n,t);return!i||"comment"!==i.type},li:function(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&"li"===i.tagName},optgroup:function(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},p:function(e,t,n){const i=P_(n,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:B_,rt:B_,tbody:function(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},td:j_,tfoot:function(e,t,n){return!P_(n,t)},th:j_,thead:function(e,t,n){const i=P_(n,t);return Boolean(i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName))},tr:function(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&"tr"===i.tagName}});function D_(e,t,n){const i=P_(n,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&T_(i.value.charAt(0)))}function B_(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function j_(e,t,n){const i=P_(n,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}const q_=E_({body:function(e){const t=P_(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&T_(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,n){const i=N_(n,t),r=P_(e,-1,!0);if(n&&i&&"element"===i.type&&"colgroup"===i.tagName&&I_(i,n.children.indexOf(i),n))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const n=e.children[0];return!n||"element"===n.type},html:function(e){const t=P_(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const i=N_(n,t),r=P_(e,-1);if(n&&i&&"element"===i.type&&("thead"===i.tagName||"tbody"===i.tagName)&&I_(i,n.children.indexOf(i),n))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const F_={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function H_(e,t,n){const i=function(e,t){const n=Ap(t);let i=t,r=Tp;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&k_.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(x_,C_);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!x_.test(e)){let n=e.replace(w_,S_);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=jp}return new r(i,t)}(e.schema,t),r=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!i.overloadedBoolean||n!==i.attribute&&""!==n?!i.boolean&&!i.overloadedBoolean||"string"==typeof n&&n!==i.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=f_(i.attribute,Object.assign({},e.settings.characterReferences,{subset:F_.name[r][s]}));return!0===n?l:(n=Array.isArray(n)?(i.commaSeparated?v_:M_)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=f_(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:F_.unquoted[r][s]}))),o!==n&&(e.settings.quoteSmart&&y_(n,a)>y_(n,e.alternative)&&(a=e.alternative),o=a+f_(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?F_.single:F_.double)[r][s],attribute:!0}))+a),l+(o?"="+o:o)))}const $_=["<","&"];function G_(e,t,n,i){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?f_(e.value,Object.assign({},i.settings.characterReferences,{subset:$_})):e.value}const V_=function(e,t){const n=t||{};function i(t,...n){let r=i.invalid;const s=i.handlers;if(t&&Qp.call(t,e)){const n=String(t[e]);r=Qp.call(s,n)?s[n]:i.unknown}if(r)return r.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,i){return i.settings.bogusComments?"<?"+f_(e.value,Object.assign({},i.settings.characterReferences,{subset:g_}))+">":"\x3c!--"+e.value.replace(m_,function(e){return f_(e,Object.assign({},i.settings.characterReferences,{subset:b_}))})+"--\x3e"},doctype:function(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,i){const r=i.schema,s="svg"!==r.space&&i.settings.omitOptionalTags;let o="svg"===r.space?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===r.space&&"svg"===e.tagName&&(i.schema=Jp);const c=function(e,t){const n=[];let i,r=-1;if(t)for(i in t)if(null!==t[i]&&void 0!==t[i]){const r=H_(e,i,t[i]);r&&n.push(r)}for(;++r<n.length;){const t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&'"'!==t&&"'"!==t&&(n[r]+=" ")}return n.join("")}(i,e.properties),d=i.all("html"===r.space&&"template"===e.tagName?e.content:e);return i.schema=r,d&&(o=!1),!c&&s&&q_(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===r.space||i.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!i.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&I_(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,i){return i.settings.allowDangerousHtml?e.value:G_(e,0,n,i)},root:function(e,t,n,i){return i.all(e)},text:G_}});const U_={},W_={},Y_=[];function X_(e,t,n){return V_(e,t,n,this)}function K_(e){const t=[],n=e&&e.children||Y_;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function J_(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},i="string"==typeof e?e:e.name;for(const[e,r]of Object.entries(t?.colorReplacements||{}))"string"==typeof r?n[e]=r:e===i&&Object.assign(n,r);return n}function Q_(e,t){return e&&t?.[e?.toLowerCase()]||e}async function Z_(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function ef(e){return!e||["plaintext","txt","text","plain"].includes(e)}function tf(e){return"ansi"===e||ef(e)}function nf(e){return"none"===e}function rf(e){return nf(e)}function sf(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function of(e,t=!1){const n=e.split(/(\r?\n)/g);let i=0;const r=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];r.push([s,i]),i+=n[e].length,i+=n[e+1]?.length||0}return r}const af="light-dark()",lf=["color","background-color"];function cf(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&wh.Italic&&(t["font-style"]="italic"),e.fontStyle&wh.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&wh.Underline&&n.push("underline"),e.fontStyle&wh.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function df(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const uf=new WeakMap;function hf(e,t){uf.set(e,t)}function pf(e){return uf.get(e)}class _f{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new _f(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,kp])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,i]=e;this.lang=n,this._stacks={[i]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;function i(e){if(n.has(e))return;n.add(e);const r=e?.nameScopesList?.scopeName;r&&t.push(r),e.parent&&i(e.parent)}return i(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function ff(){const e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new sh(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...i.indexToPos(e),offset:e}}{const t=i.lines[e.line];if(void 0===t)throw new sh(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new sh(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:i.posToIndex(e.line,n)}}};const i=function(e){const t=of(e,!0).map(([e])=>e);return{lines:t,indexToPos:function(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=n,r=0;for(const e of t){if(i<e.length)break;i-=e.length,r++}return{line:r,character:i}},posToIndex:function(e,n){let i=0;for(let n=0;n<e;n++)i+=t[n].length;return i+=n,i}}}(t.source),r=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));!function(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new sh(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const t=e[i],r=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,s=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,a=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(r||s||o||a){if(r&&s)continue;if(o&&a)continue;if(o&&n.start.offset===n.end.offset)continue;if(s&&t.start.offset===t.end.offset)continue;throw new sh(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(r),e.set(t.meta,{decorations:r,converter:i,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(!this.options.decorations?.length)return;const n=function(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{const t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?function(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}(e,t):e})):e}(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]));return n},code(e){if(!this.options.decorations?.length)return;const n=t(this),i=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(i.length!==n.converter.lines.length)throw new sh(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function r(e,t,n,r){const s=i[e];let a="",l=-1,c=-1;if(0===t&&(l=0),0===n&&(c=0),n===Number.POSITIVE_INFINITY&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)a+=mf(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new sh(`Failed to find start index for decoration ${JSON.stringify(r.start)}`);if(-1===c)throw new sh(`Failed to find end index for decoration ${JSON.stringify(r.end)}`);const d=s.children.slice(l,c);if(r.alwaysWrap||d.length!==s.children.length)if(r.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,r,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],r,"token");else o(s,r,"line")}function s(e,t){i[e]=o(i[e],t,"line")}function o(e,t,n){const i=t.properties||{},r=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...i,class:e.properties.class},t.properties?.class&&sf(e,t.properties.class),e=r(e,n)||e}const a=[],l=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(const e of l){const{start:t,end:n}=e;if(t.line===n.line)r(t.line,t.character,n.character,e);else if(t.line<n.line){r(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let i=t.line+1;i<n.line;i++)a.unshift(()=>s(i,e));r(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function mf(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(mf).join(""):""}const gf=[ff()];function bf(e){const t=function(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...gf]}var yf=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],vf={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function wf(e,t){const n=e.indexOf("",t);if(-1!==n&&"["===e[n+1]){const t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}function xf(e){const t=e.shift();if("2"===t){const t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function kf(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(0===i)t.push({type:"resetAll"});else if(i<=9){vf[i]&&t.push({type:"setDecoration",value:vf[i]})}else if(i<=29){const e=vf[i-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:yf[i-30]}});else if(38===i){const n=xf(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===i)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:yf[i-40]}});else if(48===i){const n=xf(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===i?t.push({type:"resetBackgroundColor"}):53===i?t.push({type:"setDecoration",value:"overline"}):55===i?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:yf[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:yf[i-100+8]}})}return t}var Sf={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Cf(e=Sf){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(e){return function(){if(i)return i;i=[];for(let e=0;e<yf.length;e++)i.push(t(yf[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let r=0;r<6;r++)for(let s=0;s<6;s++)i.push(n([e[t],e[r],e[s]]));let r=8;for(let e=0;e<24;e++,r+=10)i.push(n([r,r,r]));return i}()[e]}return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return r(e.index)}}}}function Mf(e,t,n){const i=J_(e,n),r=of(t),s=Cf(Object.fromEntries(yf.map(t=>[t,e.colors?.[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]]))),o=function(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let s=0;do{const o=wf(i,s),a=o.sequence?i.substring(s,o.startPosition):i.substring(s);if(a.length>0&&r.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const i=kf(o.sequence);for(const r of i)"resetAll"===r.type?(e=null,t=null,n.clear()):"resetForegroundColor"===r.type?e=null:"resetBackgroundColor"===r.type?t=null:"resetDecoration"===r.type&&n.delete(r.value);for(const r of i)"setForegroundColor"===r.type?e=r.value:"setBackgroundColor"===r.type?t=r.value:"setDecoration"===r.type&&n.add(r.value)}s=o.position}while(s<i.length);return r}}}();return r.map(t=>o.parse(t[0]).map(n=>{let r,o;n.decorations.has("reverse")?(r=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(r=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),r=Q_(r,i),o=Q_(o,i),n.decorations.has("dim")&&(r=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(e=>`${e}${e}`).join("")}80`}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(r));let a=wh.None;return n.decorations.has("bold")&&(a|=wh.Bold),n.decorations.has("italic")&&(a|=wh.Italic),n.decorations.has("underline")&&(a|=wh.Underline),n.decorations.has("strikethrough")&&(a|=wh.Strikethrough),{content:n.value,offset:t[1],color:r,bgColor:o,fontStyle:a}}))}function Af(e,t,n={}){const{lang:i="text",theme:r=e.getLoadedThemes()[0]}=n;if(ef(i)||nf(r))return of(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(r);if("ansi"===i)return Mf(s,t,n);const a=e.getLanguage(i);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new sh(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new sh(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,i,r){const s=zf(e,t,n,i,r),o=new _f(zf(e,t,n,i,r).stateStack,t.name,n.name);return hf(s.tokens,o),s.tokens}(t,a,s,o,n)}function Tf(...e){if(2===e.length)return pf(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:s=t.getLoadedThemes()[0]}=i;if(ef(r)||nf(s))throw new sh("Plain language does not have grammar state");if("ansi"===r)throw new sh("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(r);return new _f(zf(n,l,o,a,i).stateStack,l.name,o.name)}function zf(e,t,n,i,r){const s=J_(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,l=of(e);let c=r.grammarState?function(e,t){if(!(e instanceof _f))throw new sh("Invalid grammar state");return e.getInternalStack(t)}(r.grammarState,n.name)??kp:null!=r.grammarContextCode?zf(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:kp,d=[];const u=[];for(let e=0,h=l.length;e<h;e++){const[h,p]=l[e];if(""===h){d=[],u.push([]);continue}if(o>0&&h.length>=o){d=[],u.push([{content:h,offset:p,color:"",fontStyle:0}]);continue}let _,f,m;r.includeExplanation&&(_=t.tokenizeLine(h,c,a),f=_.tokens,m=0);const g=t.tokenizeLine2(h,c,a),b=g.tokens.length/2;for(let e=0;e<b;e++){const t=g.tokens[2*e],o=e+1<b?g.tokens[2*e+2]:h.length;if(t===o)continue;const a=g.tokens[2*e+1],l=Q_(i[Mh.getForeground(a)],s),c=Mh.getFontStyle(a),u={content:h.substring(t,o),offset:p+t,color:l,fontStyle:c};if(r.includeExplanation){const e=[];if("scopeName"!==r.includeExplanation)for(const t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}u.explanation=[];let i=0;for(;t+i<o;){const t=f[m],n=h.substring(t.startIndex,t.endIndex);i+=n.length,u.explanation.push({content:n,scopes:"scopeName"===r.includeExplanation?Pf(t.scopes):Nf(e,t.scopes)}),m+=1}}d.push(u)}u.push(d),d=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function Pf(e){return e.map(e=>({scopeName:e}))}function Nf(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];n[i]={scopeName:r,themeMatches:Lf(e,r,t.slice(0,i))}}return n}function Rf(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function Of(e,t,n){if(!Rf(e[e.length-1],t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)Rf(e[i],n[r])&&(i-=1),r-=1;return-1===i}function Lf(e,t,n){const i=[];for(const{selectors:r,settings:s}of e)for(const e of r)if(Of(e,t,n)){i.push(s);break}return i}function Ef(e,t,n){const i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),r=i.map(i=>{const r=Af(e,t,{...n,theme:i.theme});return{tokens:r,state:pf(r),theme:"string"==typeof i.theme?i.theme:i.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(e=>e[i]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=r.map(()=>0),a=r.map(e=>e[0]);for(;a.every(e=>e);){const e=Math.min(...a.map(e=>e.content.length));for(let t=0;t<n;t++){const n=a[t];n.content.length===e?(s[t].push(n),o[t]+=1,a[t]=r[t][o[t]]):(s[t].push({...n,content:n.content.slice(0,e)}),a[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...r.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,r)=>{const o={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(o.explanation=e.explanation),s.forEach((e,n)=>{const{content:s,explanation:a,offset:l,...c}=e[t][r];o.variants[i[n].color]=c}),o})),a=r[0].state?new _f(Object.fromEntries(r.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),r[0].state.lang):void 0;return a&&hf(o,a),o}function If(e,t,n){let i,r,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:t.color===c?1:0);if(0===h.length)throw new sh("`themes` option must not be empty");const p=Ef(e,t,n);if(l=pf(p),c&&af!==c&&!h.find(e=>e.color===c))throw new sh(`\`themes\` option must contain the defaultColor key \`${c}\``);const _=h.map(t=>e.getTheme(t.theme)),f=h.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,i,r="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>cf(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,i)=>{const r="color"===i?"":"background-color"===i?"-bg":`-${i}`;return n+t[e]+("color"===i?"":r)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&i&&lf.includes(s))if(i===af&&o.length>1){const e=t.findIndex(e=>"light"===e),i=t.findIndex(e=>"dark"===e);if(-1===e||-1===i)throw new sh('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",u=o[i][s]||"inherit";l[s]=`light-dark(${d}, ${u})`,"css-vars"===r&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===r&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,f,d,c,u))),l&&hf(s,l);const m=h.map(e=>J_(e.theme,n));r=Df(h,_,m,d,c,"fg",u),i=Df(h,_,m,d,c,"bg",u),o=`shiki-themes ${_.map(e=>e.name).join(" ")}`,a=c?void 0:[r,i].join(";")}else{if(!("theme"in n))throw new sh("Invalid options, either `theme` or `themes` must be provided");{const a=J_(n.theme,n);s=Af(e,t,n);const c=e.getTheme(n.theme);i=Q_(c.bg,a),r=Q_(c.fg,a),o=c.name,l=pf(s)}}return{tokens:s,fg:r,bg:i,themeName:o,rootStyle:a,grammarState:l}}function Df(e,t,n,i,r,s,o){return e.map((a,l)=>{const c=Q_(t[l][s],n[l])||"inherit",d=`${i+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&r){if(r===af&&e.length>1){const i=e.findIndex(e=>"light"===e.color),r=e.findIndex(e=>"dark"===e.color);if(-1===i||-1===r)throw new sh('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Q_(t[i][s],n[i])||"inherit"}, ${Q_(t[r][s],n[r])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function Bf(e,t,n,i={meta:{},options:n,codeToHast:(t,n)=>Bf(e,t,n),codeToTokens:(t,n)=>If(e,t,n)}){let r=t;for(const e of bf(n))r=e.preprocess?.call(i,r,n)||r;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=If(e,r,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;!0===u?s=function(e){return e.map(e=>{const t=[];let n="",i=0;return e.forEach((r,s)=>{const o=!(r.fontStyle&&(r.fontStyle&wh.Underline||r.fontStyle&wh.Strikethrough));o&&r.content.match(/^\s+$/)&&e[s+1]?(i||(i=r.offset),n+=r.content):n?(o?t.push({...r,offset:i,content:n+r.content}):t.push({content:n,offset:i},r),i=0,n=""):t.push(r)}),t})}(s):"never"===u&&(s=function(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;const t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;const[,n,i,r]=t;if(!n&&!r)return e;const s=[{...e,offset:e.offset+n.length,content:i}];return n&&s.unshift({content:n,offset:e.offset}),r&&s.push({content:r,offset:e.offset+n.length+i.length}),s}))}(s)),h&&(s=function(e){return e.map(e=>{const t=[];for(const n of e){if(0===t.length){t.push({...n});continue}const e=t[t.length-1],i=df(e.htmlStyle||cf(e)),r=df(n.htmlStyle||cf(n)),s=e.fontStyle&&(e.fontStyle&wh.Underline||e.fontStyle&wh.Strikethrough),o=n.fontStyle&&(n.fontStyle&wh.Underline||n.fontStyle&wh.Strikethrough);s||o||i!==r?t.push({...n}):e.content+=n.content}return t})}(s));const p={...i,get source(){return r}};for(const e of bf(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,i=pf(e)){const r=bf(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...!1!==l&&null!=l?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([e])=>!e.startsWith("_")))},children:[]},d={type:"element",tagName:"code",properties:{},children:s};const u=[],h={...n,structure:a,addClassToHast:sf,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return u}};if(e.forEach((e,t)=>{t&&("inline"===a?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===a&&s.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},i=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=df(s.htmlStyle||cf(s));l&&(e.properties.style=l);for(const o of r)e=o?.span?.call(h,e,t+1,i,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),i+=s.content.length}if("classic"===a){for(const e of r)n=e?.line?.call(h,n,t+1)||n;u.push(n),s.push(n)}}),"classic"===a){for(const e of r)d=e?.code?.call(h,d)||d;c.children.push(d);for(const e of r)c=e?.pre?.call(h,c)||c;o.children.push(c)}let p=o;for(const e of r)p=e?.root?.call(h,p)||p;i&&hf(p,i);return p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}const jf=function(e,t){const n=t||U_,i=n.quote||'"',r='"'===i?"'":'"';if('"'!==i&&"'"!==i)throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:X_,all:K_,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Sp,characterReferences:n.characterReferences||W_,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?Jp:Kp,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)};function qf(e,t,n){const i={meta:{},options:n,codeToHast:(t,n)=>Bf(e,t,n),codeToTokens:(t,n)=>If(e,t,n)};let r=jf(Bf(e,t,n,i));for(const e of bf(n))r=e.postprocess?.call(i,r,n)||r;return r}const Ff="#333333",Hf="#bbbbbb",$f="#fffffe",Gf="#1e1e1e",Vf="__shiki_resolved";function Uf(e){if(e?.[Vf])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(i=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i="light"===t.type?Ff:Hf),n||(n="light"===t.type?$f:Gf),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);r+=1;const n=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(s.set(e,n),n)}t.settings=t.settings.map(e=>{const n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),i=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!i)return e;const r={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,r.settings.foreground=n}if(i){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,r.settings.background=n}return r});for(const e of Object.keys(t.colors||{}))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){const n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Vf,{enumerable:!1,writable:!1,value:!0}),t}async function Wf(e){return Array.from(new Set((await Promise.all(e.filter(e=>!tf(e)).map(async e=>await Z_(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function Yf(e){return(await Promise.all(e.map(async e=>rf(e)?null:Uf(await Z_(e))))).filter(e=>!!e)}let Xf=3,Kf=!1;class Jf extends Error{constructor(e){super(e),this.name="ShikiError"}}class Qf extends xp{constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Uf(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=mh.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){if(this._alias[e]){const t=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],t.has(e))throw new Jf(`Circular alias \`${Array.from(t).join(" -> ")} -> ${e}\``);t.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(const e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const t of e)this.resolveEmbeddedLanguages(t);const t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){const e=t.filter(([e,t])=>t&&t.embeddedLangs?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new Jf(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(const[e,n]of t)this._resolver.addLanguage(n);for(const[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap.get(t))}}class Zf{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let e=1;e<=t.length;e++){const i=t.slice(0,e).join(".");n=[...n,...this._injections.get(i)||[]]}return n}}let em=0;function tm(e){em+=1,!1!==e.warnings&&em>=10&&em%10==0&&console.warn(`[Shiki] ${em} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Jf("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(Uf),r=new Zf(e.engine,n),s=new Qf(r,i,n,e.langAlias);let o;function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();const t=s.getTheme(e);if(!t)throw new Jf(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),s.loadLanguages(e.flat(1))}function c(...e){d();for(const t of e.flat(1))s.loadTheme(t)}function d(){if(t)throw new Jf("Shiki instance has been disposed")}function u(){t||(t=!0,s.dispose(),em-=1)}return{setTheme:function(e){d();const t=a(e);return o!==e&&(s.setTheme(t),o=e),{theme:t,colorMap:s.getColorMap()}},getTheme:a,getLanguage:function(e){d();const t=s.getGrammar("string"==typeof e?e:e.name);if(!t)throw new Jf(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),s.getLoadedThemes()},getLoadedLanguages:function(){return d(),s.getLoadedLanguages()},loadLanguage:async function(...e){return l(await Wf(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await Yf(e))},loadThemeSync:c,dispose:u,[Symbol.dispose]:u}}async function nm(e){e.engine||function(e,t=3){if(Xf&&!("number"==typeof Xf&&t>Xf)){if(Kf)throw new Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([Yf(e.themes||[]),Wf(e.langs||[]),e.engine]);return tm({...e,themes:t,langs:n,engine:i})}async function im(e){const t=await nm(e);return{getLastGrammarState:(...e)=>Tf(t,...e),codeToTokensBase:(e,n)=>Af(t,e,n),codeToTokensWithThemes:(e,n)=>Ef(t,e,n),codeToTokens:(e,n)=>If(t,e,n),codeToHast:(e,n)=>Bf(t,e,n),codeToHtml:(e,n)=>qf(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function rm(e){const t=e.langs,n=e.themes,i=e.engine;return async function(e){function r(n){if("string"==typeof n){if(tf(n))return[];n=e.langAlias?.[n]||n;const i=t[n];if(!i)throw new sh(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return i}return n}function s(e){if(rf(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new sh(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}const o=(e.themes??[]).map(e=>s(e)),a=(e.langs??[]).map(e=>r(e)),l=await im({engine:e.engine??i(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(r)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function sm(e,t){const n=function(e){let t;return async function(n={}){if(t){const e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}}(e);async function i(e,i){const r=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,i.lang,r));return s&&await r.loadLanguage(...s),r}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await i(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await i(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await i(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await i(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await i(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class om extends Error{constructor(e){super(e),this.name="ShikiError"}}function am(){return"undefined"!=typeof performance?performance.now():Date.now()}const lm=(e,t)=>e+(t-e%t)%t;async function cm(e){let t,n;const i={};function r(e){n=e,i.HEAPU8=new Uint8Array(e),i.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}const o="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){const i=t+n;let r=t;for(;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&o)return o.decode(e.subarray(t,r));let s="";for(;t<r;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const i=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|i);continue}const r=63&e[t++];if(n=224==(240&n)?(15&n)<<12|i<<6|r:(7&n)<<18|i<<12|r<<6|63&e[t++],n<65536)s+=String.fromCharCode(n);else{const e=n-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(i.HEAPU8,e,t):""}const l={emscripten_get_now:am,emscripten_memcpy_big:function(e,t,n){i.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=i.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let i=1;i<=4;i*=2){let r=t*(1+.2/i);r=Math.min(r,e+100663296);if(s(Math.min(n,lm(Math.max(e,r),65536))))return!0}return!1},fd_write:()=>0};return await async function(){const n={env:l,wasi_snapshot_preview1:l},s=await e(n);t=s.memory,r(t.buffer),Object.assign(i,s),i.UTF8ToString=a}(),i}var dm=Object.defineProperty,um=(e,t,n)=>((e,t,n)=>t in e?dm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let hm=null;class pm{constructor(e){um(this,"utf16Length"),um(this,"utf8Length"),um(this,"utf16Value"),um(this,"utf8Value"),um(this,"utf16OffsetToUtf8"),um(this,"utf8OffsetToUtf16");const t=e.length,n=pm._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;i&&(r[t]=n);const s=i?new Uint32Array(n+1):null;i&&(s[n]=t);const o=new Uint8Array(n);let a=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let c=l,d=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(c=65536+(l-55296<<10)|t-56320,d=!0)}i&&(r[n]=a,d&&(r[n+1]=a),c<=127?s[a+0]=n:c<=2047?(s[a+0]=n,s[a+1]=n):c<=65535?(s[a+0]=n,s[a+1]=n,s[a+2]=n):(s[a+0]=n,s[a+1]=n,s[a+2]=n,s[a+3]=n)),c<=127?o[a++]=c:c<=2047?(o[a++]=192|(1984&c)>>>6,o[a++]=128|(63&c)>>>0):c<=65535?(o[a++]=224|(61440&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0):(o[a++]=240|(1835008&c)>>>18,o[a++]=128|(258048&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0),d&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){const r=e.charCodeAt(n);let s=r,o=!1;if(r>=55296&&r<=56319&&n+1<i){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(r-55296<<10)|t-56320,o=!0)}t+=s<=127?1:s<=2047?2:s<=65535?3:4,o&&n++}return t}createString(e){const t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}const _m=class e{constructor(t){if(um(this,"id",++e.LAST_ID),um(this,"_onigBinding"),um(this,"content"),um(this,"utf16Length"),um(this,"utf8Length"),um(this,"utf16OffsetToUtf8"),um(this,"utf8OffsetToUtf16"),um(this,"ptr"),!hm)throw new om("Must invoke loadWasm first.");this._onigBinding=hm,this.content=t;const n=new pm(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=hm.omalloc(1e4)),e._sharedPtrInUse=!0,hm.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(hm)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};um(_m,"LAST_ID",0),um(_m,"_sharedPtr",0),um(_m,"_sharedPtrInUse",!1);let fm,mm=_m;class gm{constructor(e){if(um(this,"_onigBinding"),um(this,"_ptr"),!hm)throw new om("Must invoke loadWasm first.");const t=[],n=[];for(let i=0,r=e.length;i<r;i++){const r=new pm(e[i]);t[i]=r.createString(hm),n[i]=r.utf8Length}const i=hm.omalloc(4*e.length);hm.HEAPU32.set(t,i/4);const r=hm.omalloc(4*e.length);hm.HEAPU32.set(n,r/4);const s=hm.createOnigScanner(i,r,e.length);for(let n=0,i=e.length;n<i;n++)hm.ofree(t[n]);hm.ofree(r),hm.ofree(i),0===s&&function(e){throw new om(e.UTF8ToString(e.getLastOnigError()))}(hm),this._onigBinding=hm,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if("number"==typeof n&&(i=n),"string"==typeof e){e=new mm(e);const n=this._findNextMatchSync(e,t,!1,i);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){const r=this._onigBinding,s=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(0===s)return null;const o=r.HEAPU32;let a=s/4;const l=o[a++],c=o[a++],d=[];for(let t=0;t<c;t++){const n=e.convertUtf8OffsetToUtf16(o[a++]),i=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:i,length:i-n}}return{index:l,captureIndices:d}}}function bm(e){if(fm)return fm;return fm=async function(){hm=await cm(async t=>{let n=e;var i;return n=await n,"function"==typeof n&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator?n=await n.instantiator(t):!function(e){return"function"==typeof e.default}(n)?(function(e){return void 0!==e.data}(n)&&(n=n.data),!function(e){return"undefined"!=typeof Response&&e instanceof Response}(n)?!function(e){return"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||"undefined"!=typeof Buffer&&Buffer.isBuffer?.(e)||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||"undefined"!=typeof Uint32Array&&e instanceof Uint32Array}(n)?n instanceof WebAssembly.Module?n=await ym(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await ym(n.default)(t)):n=await ym(n)(t):n="function"==typeof WebAssembly.instantiateStreaming?await(i=n,e=>WebAssembly.instantiateStreaming(i,e))(t):await function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(n)(t)):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),fm}function ym(e){return t=>WebAssembly.instantiate(e,t)}const vm=rm({langs:nh,themes:rh,engine:()=>async function(e){return e&&await bm(e),{createScanner:e=>new gm(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new mm(e)}}(r.e(4709).then(r.bind(r,4709)))}),{codeToHtml:wm,codeToHast:xm,codeToTokens:km,codeToTokensBase:Sm,codeToTokensWithThemes:Cm,getSingletonHighlighter:Mm,getLastGrammarState:Am}=sm(vm,{guessEmbeddedLanguages:function(e,t,n){const i=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))i.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))i.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))i.add(t[1]);if(!n)return Array.from(i);const r=n.getBundledLanguages();return Array.from(i).filter(e=>e&&r[e])}}),Tm=["id","data-type"],zm=["data-id","onClick"],Pm=["innerHTML"],Nm=["disabled"],Rm=jn({__name:"cube-code",props:{cube:{}},setup(e){const{root:t,status:n}=e.cube,{stats:i}=t,r=Kt(),s=Kt(),o=Kt(),a=Kt();function l(e){if(!e._draglist)return;const t=e._draglist.init();return e.tabs.length>0&&t<=0?requestAnimationFrame(()=>l(e)):void 0}function c(){const t=e.cube._draglist;if(!t)return;const n=e.cube.get_upstream_sum_scale();t.scale_h=n.sx,t.scale_v=n.sy}function d(){const t=r.value,n=o.value;t&&n&&(e.cube._draglist=new Ws.DragList(t,"horizental","data-id","insert"),c(),e.cube._draglist.register_start(c),l(e.cube))}let u;dr(()=>[n.active_tab_id,n.active_tab?.code],()=>{const t=e.cube.active_tab,n=a.value;t&&n&&(n.value=t.code)},{immediate:!0}),dr(()=>[n.code_html],()=>{const t=e.cube.active_tab,n=a.value,i=n?.previousElementSibling;if(!t||!n||!i)return;const r=n.parentElement;vn(()=>{const t=i.nextElementSibling,n=i.firstElementChild;if(t&&n){if(r){const t=n.style.backgroundColor;if(t.startsWith("rgb")){const n=t.replace("rgb","rgba").replace(")",", 0.85)");e.cube.attrs.codebg=n}else e.cube.attrs.codebg=t;e.cube.attrs.caret=n.style.color}n.style.border="none",n.style.outline="none"}})}),ii(()=>{d(),function(){const t=o.value,n=a.value;if(!t)return;n&&(n.value=e.cube.active_tab?.code||"");const i=s.value;if(!i)return;u=new Ws.DragDiff(i);let r=e.cube.attrs.width,l=e.cube.attrs.height,c=r,d=l;u.register_down(()=>{r=e.cube.attrs.width,l=e.cube.attrs.height}),u.register_move((e,n)=>{c=Math.round(e+r),d=Math.round(n+l),t.style.width=c+"px",t.style.height=d+"px"}),u.register_up((t,n)=>{if(r===c&&l===d)return;const i=e.cube.courier.get_recorder(),s=Math.round(t+r),o=Math.round(n+l);i.tell(e.cube,Ts.resize(e.cube.id,s,o)),e.cube.history.record(i)}),u.register_cancel(()=>{Object.assign(e.cube.data.attrs,{width:r,height:l})})}()}),ai(()=>{u?.off()});const h=ws(()=>({"caret-color":e.cube.attrs.caret}));function p(e){e.stopPropagation()}function _(t){if(!t.previousElementSibling)return;const n=t.value,{id:i,courier:r,history:s}=e.cube,o=e.cube.tabbar_height,a=e.cube.max_height_auto,l=r.get_recorder(),c=Qu.update(i,e.cube.active_tab_id,n);l.tell(e.cube,c),vn(()=>{const n=t.scrollHeight+o,r=Math.min(a,n),c=Ts.set_attr(i,{height:r});l.tell(e.cube,c),s.record(l)})}function f(e){_(e.currentTarget)}function m(e){const{hotkeys:n,clipboard:i,history:r}=t,s=e.key.toLowerCase();if([n.data[T["scope-add"]]].some(t=>n.validate(e,t)))return e.preventDefault();if(t.status.scope_count_normal>0&&["backspace","delete"].includes(s)){e.preventDefault(),e.stopPropagation();const t=i.delete_scope();return void(t&&r.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,i=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(i),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,_(o)}}function g(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function b(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?Ws.DomAnimation.scroll_element(n,t,"horizental"):Ws.DomAnimation.scroll_element(n,-t,"horizental")}function y(e){const t=e.currentTarget,n=t.firstElementChild,i=t.lastElementChild;if(!n||!i)return;const r=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?r?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),Ws.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),Ws.DomAnimation.scroll_element(t,20,"vertical")):r?s>0&&(e.preventDefault(),e.stopPropagation(),Ws.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),Ws.DomAnimation.scroll_element(t,-20,"vertical"))}function v(t){_a(t,e.cube)}return(t,l)=>(Rr(),Dr("div",{class:"cube-code",id:t.cube.id,"data-type":t.cube.type,ref_key:"code",ref:o,style:fe(en(n).css),onPointerdown:p,onBeforeinput:p,onCompositionstart:p,onContextmenu:v},[$r("div",{class:"code-tabbar",onWheel:b},[$r("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[(Rr(!0),Dr(Mr,null,gi(en(n).tabs,n=>(Rr(),Dr("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:i}=e.cube,r=n.get_recorder();r.tell(e.cube,Qu.change_active(e.cube.id,t.id)),i.record(r)}(n)},[$r("div",{class:ve(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},Ce(n.name),3)],8,zm))),128))],512)],32),$r("div",{class:"code-box",onWheel:y},[$r("div",{class:"code-box-inner",style:fe({background:en(n).attrs.codebg})},[$r("span",{class:"code-highlight",onWheel:l[0]||(l[0]=e=>e.preventDefault()),innerHTML:en(n).code_html},null,40,Pm),$r("textarea",{disabled:en(i).is_read_mode,ref_key:"textarea",ref:a,style:fe(h.value),onKeyup:g,onKeydown:m,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:f},null,44,Nm)],4)],32),$r("div",{class:"code-dragger",ref_key:"code_dragger",ref:s},null,512)],44,Tm))}}),Om=(0,io.A)(Rm,[["__scopeId","data-v-2fc371ac"]]),Lm={".py":"python",".java":"java",".c":"c",".cpp":"c++",".js":"javascript",".html":"html",".css":"css",".php":"php",".rb":"ruby",".go":"go",".swift":"swift",".kt":"kotlin",".rs":"rust",".ts":"typescript",".sh":"shell",".pl":"perl",".cs":"c#",".sql":"sql",".r":"r",".m":"matlab",".adb":"ada",".ads":"ada",".lua":"lua",".scala":"scala",".dart":"dart",".hs":"haskell",".erl":"erlang",".ex":"elixir",".jl":"julia",".groovy":"groovy",".fs":"f#",".clj":"clojure",".scm":"scheme",".ml":"ocaml",".pas":"pascal",".d":"d",".nim":"nim",".zig":"zig",".v":"v",".coffee":"coffeescript",".litcoffee":"coffeescript",".vue":"vue",".svelte":"svelte",".elm":"elm",".purs":"purescript",".exs":"elixir",".eex":"elixir",".heex":"elixir",".tcl":"tcl",".tk":"tcl",".awk":"awk",".ps1":"powershell",".psm1":"powershell",".psd1":"powershell",".bat":"batch",".cmd":"batch",".json":"json",".xml":"xml",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".md":"markdown",".markdown":"markdown",".tex":"latex",".sty":"latex",".cls":"latex",".bib":"bibtex",".csv":"csv",".tsv":"tsv",".log":"log"};function Em(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const Im="dracula";class Dm extends ic{static _langs=[...Object.keys(nh)];static _themes=[...Object.keys(rh)];_status=new Bm(this);_code_html="";_draglist;constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get tabbar_height(){return 36}get max_height_auto(){return 600}get langs(){return[...Dm._langs]}get themes(){return[...Dm._themes]}get component(){return Om}get tabs(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}set active_tab_id(e){const t=this.tabs.find(t=>t.id===e);t&&(this.info.active_tab_id=t.id)}get active_tab(){return this.tabs.find(e=>e.id===this.active_tab_id)}get info(){return this.data.info}get css(){const e=this.config.data.line_indent,t=this.attrs.indent,n=this.attrs.width,i=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:i+"px"}}get attrs(){return this.data.attrs}get code_html(){return this._code_html}export(){return this.base_export()}gc(){super.base_gc()}build_child(e){}update_data(e,t){return Dm.update_data(e,t)}code_to_html(e){return wm(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}update_code_html(){if(0===this.tabs.length)this._code_html="",this.status.update_code_html();else{const e=this.active_tab;if(!e)return;this.code_to_html(e).then(e=>{this._code_html=e,this.status.update_code_html()})}}get meta(){return Dm.meta}create_tab(e,t,n=Im){return{id:rc.get_id(),name:t,lang:e,code:"",theme:n||Im}}replace_id(e,t={}){return Dm.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return Ss.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),i=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(i).then(e=>{Ss.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:i,id:r}=this,s=i.get_recorder(),o=this.tabs.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(Qu.change_lang(r,t,a)),this.update_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:i,id:r}=this,s=i.get_recorder(),o=this.tabs.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(Qu.change_theme(r,t,a)),this.update_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:i,id:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.tabs.find(e=>e.id===t);if(!o)return;const a=o.code;return o.code=n,s.add_recover(Qu.update(r,t,a)),this.update_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:i,id:r}=this,s=i.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(Qu.remove(r,t.id)),this.update_code_html(),n&&s.tell(this,Qu.change_active(r,t.id)),vn(()=>{this._draglist?.init()}),this.status.update_tabs(),s}code_remove(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder();r.add_cmd(e);const s=this.tabs.find(e=>e.id===t);if(!s)return;const o=this.tabs.indexOf(s),a=this.tabs[o-1]||this.tabs[o+1];return o>=0&&this.tabs.splice(o,1),r.add_recover(Qu.add(i,s)),a&&(this.active_tab_id=a.id),this.update_code_html(),this.status.update_tabs(),vn(()=>{this._draglist?.init()}),r}code_rename(e){const{tabid:t,filename:n}=e,{courier:i,id:r}=this,s=i.get_recorder();s.add_cmd(e);const o=this.tabs.find(e=>e.id===t);if(!o)return;const a=o.name;return o.name=n,s.add_recover(Qu.rename(r,t,a)),this.status.update_tab_name(t,n),s}change_active(e){const{tabid:t}=e,{courier:n,id:i}=this,r=n.get_recorder(),s=this.tabs.find(e=>e.id===t);if(!s)return s;const o=this.active_tab_id;return this.active_tab_id=t,r.add_recover(Qu.change_active(i,o)),this.update_code_html(),this.status.update_active_tab_id(t),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new ac(t),o=this.dom?.querySelector("textarea");return o?.focus(),s}on_cursor_in_head(e){const{courier:t,prev_cube:n,pcube:i,next_cube:r}=this,s=new ac(t),o=this.dom?.querySelector("textarea");return o?.focus(),s}static get langs(){return[...this._langs]}static get themes(){return[...this._themes]}static get meta(){return{cubename:"代码块",type:n.code,block:!0,version:1,show:!0}}static get_default(){return{id:rc.get_id(),type:n.code,info:{tabs:[],active_tab_id:""},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static get_default_by_string(e="typescript",t=""){const i={name:`code${this.get_format_from_lang(e)}`,id:rc.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:rc.get_id(),type:n.code,info:{tabs:[i],active_tab_id:i.id},attrs:{width:560,height:120,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t}static get_format_from_lang(e){for(let t in Lm)if(Lm[t]===e)return t;return""}static get_lang_from_format(e){return Lm[e]}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Em([Os(p.change_lang)],Dm.prototype,"change_lang",null),Em([Os(p.change_theme)],Dm.prototype,"change_theme",null),Em([Os(p.code_update)],Dm.prototype,"code_update",null),Em([Os(p.code_add)],Dm.prototype,"code_add",null),Em([Os(p.code_remove)],Dm.prototype,"code_remove",null),Em([Os(p.code_rename)],Dm.prototype,"code_rename",null),Em([Os(p.change_active)],Dm.prototype,"change_active",null),Em([Os(x.cursor_in_tail)],Dm.prototype,"on_cursor_in_tail",null),Em([Os(x.cursor_in_head)],Dm.prototype,"on_cursor_in_head",null);class Bm extends Jl{_code_html=Kt("");constructor(e){super(e)}get cube(){return this._cube}get code_html(){return this._code_html.value}get attrs(){return this._data.attrs}get info(){return this._data.info}get tabs(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}get active_tab(){return this.tabs.find(e=>e.id===this.active_tab_id)}init(){super.init(),this.update_code_html()}update_code_html(e){return Promise.resolve().then(()=>{this._code_html.value=e||this.cube.code_html})}update_tabs(e){return Promise.resolve().then(()=>{this.info.tabs=e||this.cube.info.tabs})}update_tab_name(e,t){return Promise.resolve().then(()=>{const n=this.tabs.find(t=>t.id===e);n&&(n.name=t)})}update_active_tab_id(e){return Promise.resolve().then(()=>{this.info.active_tab_id=e})}}const jm=["id","data-type","innerHTML"],qm=jn({__name:"cube-fomula",props:{cube:{}},setup(e){const{event:t,status:n}=e.cube;function i(){t.emit_show_cube_editor(e.cube)}const r=ws(()=>{let t={...n.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>(Rr(),Dr("span",{class:"cube-fomula",onClick:i,id:e.cube.id,"data-type":e.cube.type,style:fe(r.value),innerHTML:en(n).mathml},null,12,jm))}}),Fm=(0,io.A)(qm,[["__scopeId","data-v-9dd6c08e"]]);class Hm{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Hm(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class $m{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new $m(t,Hm.range(this,e))}}class Gm{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,i,r="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,i=s.end,n===o.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var a=o.slice(n,i).replace(/[^]/g,"$&̲");r+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(i+15<o.length?o.slice(i,i+15)+"…":o.slice(i))}var l=new Error(r);return l.name="ParseError",l.__proto__=Gm.prototype,l.position=n,null!=n&&null!=i&&(l.length=i-n),l.rawMessage=e,l}}Gm.prototype.__proto__=Error.prototype;var Vm=/([A-Z])/g,Um={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Wm=/[&><"']/g;var Ym=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Xm={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(Wm,e=>Um[e])},hyphenate:function(e){return e.replace(Vm,"-$1").toLowerCase()},getBaseElem:Ym,isCharacterBox:function(e){var t=Ym(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},Km={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Jm(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Qm{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Km)if(Km.hasOwnProperty(t)){var n=Km[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Jm(n)}}reportNonstrict(e,t,n){var i=this.strict;if("function"==typeof i&&(i=i(e,t,n)),i&&"ignore"!==i){if(!0===i||"error"===i)throw new Gm("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===i?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var i=this.strict;if("function"==typeof i)try{i=i(e,t,n)}catch(e){i="error"}return!(!i||"ignore"===i)&&(!0===i||"error"===i||("warn"===i?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if(e.url&&!e.protocol){var t=Xm.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Zm{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return eg[tg[this.id]]}sub(){return eg[ng[this.id]]}fracNum(){return eg[ig[this.id]]}fracDen(){return eg[rg[this.id]]}cramp(){return eg[sg[this.id]]}text(){return eg[og[this.id]]}isTight(){return this.size>=2}}var eg=[new Zm(0,0,!1),new Zm(1,0,!0),new Zm(2,1,!1),new Zm(3,1,!0),new Zm(4,2,!1),new Zm(5,2,!0),new Zm(6,3,!1),new Zm(7,3,!0)],tg=[4,5,4,5,6,7,6,7],ng=[5,5,5,5,7,7,7,7],ig=[2,3,4,5,6,7,6,7],rg=[3,3,5,5,7,7,7,7],sg=[1,1,3,3,5,5,7,7],og=[0,1,2,3,2,3,2,3],ag={DISPLAY:eg[0],TEXT:eg[2],SCRIPT:eg[4],SCRIPTSCRIPT:eg[6]},lg=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var cg=[];function dg(e){for(var t=0;t<cg.length;t+=2)if(e>=cg[t]&&e<=cg[t+1])return!0;return!1}lg.forEach(e=>e.blocks.forEach(e=>cg.push(...e)));var ug=80,hg={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class pg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Xm.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join("")}}var _g={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},fg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},mg={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function gg(e,t,n){if(!_g[t])throw new Error("Font metrics not found for font: "+t+".");var i=e.charCodeAt(0),r=_g[t][i];if(!r&&e[0]in mg&&(i=mg[e[0]].charCodeAt(0),r=_g[t][i]),r||"text"!==n||dg(i)&&(r=_g[t][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}var bg={};var yg=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],vg=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],wg=function(e,t){return t.size<2?e:yg[e-1][t.size-1]};class xg{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||xg.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=vg[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new xg(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:wg(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:vg[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=wg(xg.BASESIZE,e);return this.size===t&&this.textSize===xg.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==xg.BASESIZE?["sizing","reset-size"+this.size,"size"+xg.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!bg[t=e>=5?0:e>=3?1:2]){var n=bg[t]={cssEmPerMu:fg.quad[t]/18};for(var i in fg)fg.hasOwnProperty(i)&&(n[i]=fg[i][t])}return bg[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}xg.BASESIZE=6;var kg={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},Sg={ex:!0,em:!0,mu:!0},Cg=function(e){return"string"!=typeof e&&(e=e.unit),e in kg||e in Sg||"ex"===e},Mg=function(e,t){var n;if(e.unit in kg)n=kg[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var i;if(i=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=i.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Gm("Invalid unit: '"+e.unit+"'");n=i.fontMetrics().quad}i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Ag=function(e){return+e.toFixed(4)+"em"},Tg=function(e){return e.filter(e=>e).join(" ")},zg=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Pg=function(e){var t=document.createElement(e);for(var n in t.className=Tg(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},Ng=/[\s"'>/=\x00-\x1f]/,Rg=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Xm.escape(Tg(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Xm.hyphenate(i)+":"+this.style[i]+";");for(var r in n&&(t+=' style="'+Xm.escape(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(r)){if(Ng.test(r))throw new Gm("Invalid attribute name '"+r+"'");t+=" "+r+'="'+Xm.escape(this.attributes[r])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">"};class Og{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,zg.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Xm.contains(this.classes,e)}toNode(){return Pg.call(this,"span")}toMarkup(){return Rg.call(this,"span")}}class Lg{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,zg.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Xm.contains(this.classes,e)}toNode(){return Pg.call(this,"a")}toMarkup(){return Rg.call(this,"a")}}class Eg{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Xm.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+Xm.escape(this.src)+'" alt="'+Xm.escape(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Xm.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Xm.escape(t)+'"'),e+="'/>"}}var Ig={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Dg{constructor(e,t,n,i,r,s,o,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=r||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<lg.length;t++)for(var n=lg[t],i=0;i<n.blocks.length;i++){var r=n.blocks[i];if(e>=r[0]&&e<=r[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Ig[this.text])}hasClass(e){return Xm.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=Ag(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Tg(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Xm.escape(Tg(this.classes)),t+='"');var n="";for(var i in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(i)&&(n+=Xm.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+Xm.escape(n)+'"');var r=Xm.escape(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class Bg{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Xm.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class jg{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",hg[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+Xm.escape(this.alternate)+'"/>':'<path d="'+Xm.escape(hg[this.pathName])+'"/>'}}class qg{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Xm.escape(this.attributes[t])+'"');return e+="/>"}}function Fg(e){if(e instanceof Dg)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Hg={bin:1,close:1,inner:1,open:1,punct:1,rel:1},$g={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Gg={math:{},text:{}};function Vg(e,t,n,i,r,s){Gg[e][r]={font:t,group:n,replace:i},s&&i&&(Gg[e][i]=Gg[e][r])}var Ug="math",Wg="text",Yg="main",Xg="ams",Kg="accent-token",Jg="bin",Qg="close",Zg="inner",eb="mathord",tb="op-token",nb="open",ib="punct",rb="rel",sb="spacing",ob="textord";Vg(Ug,Yg,rb,"≡","\\equiv",!0),Vg(Ug,Yg,rb,"≺","\\prec",!0),Vg(Ug,Yg,rb,"≻","\\succ",!0),Vg(Ug,Yg,rb,"∼","\\sim",!0),Vg(Ug,Yg,rb,"⊥","\\perp"),Vg(Ug,Yg,rb,"⪯","\\preceq",!0),Vg(Ug,Yg,rb,"⪰","\\succeq",!0),Vg(Ug,Yg,rb,"≃","\\simeq",!0),Vg(Ug,Yg,rb,"∣","\\mid",!0),Vg(Ug,Yg,rb,"≪","\\ll",!0),Vg(Ug,Yg,rb,"≫","\\gg",!0),Vg(Ug,Yg,rb,"≍","\\asymp",!0),Vg(Ug,Yg,rb,"∥","\\parallel"),Vg(Ug,Yg,rb,"⋈","\\bowtie",!0),Vg(Ug,Yg,rb,"⌣","\\smile",!0),Vg(Ug,Yg,rb,"⊑","\\sqsubseteq",!0),Vg(Ug,Yg,rb,"⊒","\\sqsupseteq",!0),Vg(Ug,Yg,rb,"≐","\\doteq",!0),Vg(Ug,Yg,rb,"⌢","\\frown",!0),Vg(Ug,Yg,rb,"∋","\\ni",!0),Vg(Ug,Yg,rb,"∝","\\propto",!0),Vg(Ug,Yg,rb,"⊢","\\vdash",!0),Vg(Ug,Yg,rb,"⊣","\\dashv",!0),Vg(Ug,Yg,rb,"∋","\\owns"),Vg(Ug,Yg,ib,".","\\ldotp"),Vg(Ug,Yg,ib,"⋅","\\cdotp"),Vg(Ug,Yg,ob,"#","\\#"),Vg(Wg,Yg,ob,"#","\\#"),Vg(Ug,Yg,ob,"&","\\&"),Vg(Wg,Yg,ob,"&","\\&"),Vg(Ug,Yg,ob,"ℵ","\\aleph",!0),Vg(Ug,Yg,ob,"∀","\\forall",!0),Vg(Ug,Yg,ob,"ℏ","\\hbar",!0),Vg(Ug,Yg,ob,"∃","\\exists",!0),Vg(Ug,Yg,ob,"∇","\\nabla",!0),Vg(Ug,Yg,ob,"♭","\\flat",!0),Vg(Ug,Yg,ob,"ℓ","\\ell",!0),Vg(Ug,Yg,ob,"♮","\\natural",!0),Vg(Ug,Yg,ob,"♣","\\clubsuit",!0),Vg(Ug,Yg,ob,"℘","\\wp",!0),Vg(Ug,Yg,ob,"♯","\\sharp",!0),Vg(Ug,Yg,ob,"♢","\\diamondsuit",!0),Vg(Ug,Yg,ob,"ℜ","\\Re",!0),Vg(Ug,Yg,ob,"♡","\\heartsuit",!0),Vg(Ug,Yg,ob,"ℑ","\\Im",!0),Vg(Ug,Yg,ob,"♠","\\spadesuit",!0),Vg(Ug,Yg,ob,"§","\\S",!0),Vg(Wg,Yg,ob,"§","\\S"),Vg(Ug,Yg,ob,"¶","\\P",!0),Vg(Wg,Yg,ob,"¶","\\P"),Vg(Ug,Yg,ob,"†","\\dag"),Vg(Wg,Yg,ob,"†","\\dag"),Vg(Wg,Yg,ob,"†","\\textdagger"),Vg(Ug,Yg,ob,"‡","\\ddag"),Vg(Wg,Yg,ob,"‡","\\ddag"),Vg(Wg,Yg,ob,"‡","\\textdaggerdbl"),Vg(Ug,Yg,Qg,"⎱","\\rmoustache",!0),Vg(Ug,Yg,nb,"⎰","\\lmoustache",!0),Vg(Ug,Yg,Qg,"⟯","\\rgroup",!0),Vg(Ug,Yg,nb,"⟮","\\lgroup",!0),Vg(Ug,Yg,Jg,"∓","\\mp",!0),Vg(Ug,Yg,Jg,"⊖","\\ominus",!0),Vg(Ug,Yg,Jg,"⊎","\\uplus",!0),Vg(Ug,Yg,Jg,"⊓","\\sqcap",!0),Vg(Ug,Yg,Jg,"∗","\\ast"),Vg(Ug,Yg,Jg,"⊔","\\sqcup",!0),Vg(Ug,Yg,Jg,"◯","\\bigcirc",!0),Vg(Ug,Yg,Jg,"∙","\\bullet",!0),Vg(Ug,Yg,Jg,"‡","\\ddagger"),Vg(Ug,Yg,Jg,"≀","\\wr",!0),Vg(Ug,Yg,Jg,"⨿","\\amalg"),Vg(Ug,Yg,Jg,"&","\\And"),Vg(Ug,Yg,rb,"⟵","\\longleftarrow",!0),Vg(Ug,Yg,rb,"⇐","\\Leftarrow",!0),Vg(Ug,Yg,rb,"⟸","\\Longleftarrow",!0),Vg(Ug,Yg,rb,"⟶","\\longrightarrow",!0),Vg(Ug,Yg,rb,"⇒","\\Rightarrow",!0),Vg(Ug,Yg,rb,"⟹","\\Longrightarrow",!0),Vg(Ug,Yg,rb,"↔","\\leftrightarrow",!0),Vg(Ug,Yg,rb,"⟷","\\longleftrightarrow",!0),Vg(Ug,Yg,rb,"⇔","\\Leftrightarrow",!0),Vg(Ug,Yg,rb,"⟺","\\Longleftrightarrow",!0),Vg(Ug,Yg,rb,"↦","\\mapsto",!0),Vg(Ug,Yg,rb,"⟼","\\longmapsto",!0),Vg(Ug,Yg,rb,"↗","\\nearrow",!0),Vg(Ug,Yg,rb,"↩","\\hookleftarrow",!0),Vg(Ug,Yg,rb,"↪","\\hookrightarrow",!0),Vg(Ug,Yg,rb,"↘","\\searrow",!0),Vg(Ug,Yg,rb,"↼","\\leftharpoonup",!0),Vg(Ug,Yg,rb,"⇀","\\rightharpoonup",!0),Vg(Ug,Yg,rb,"↙","\\swarrow",!0),Vg(Ug,Yg,rb,"↽","\\leftharpoondown",!0),Vg(Ug,Yg,rb,"⇁","\\rightharpoondown",!0),Vg(Ug,Yg,rb,"↖","\\nwarrow",!0),Vg(Ug,Yg,rb,"⇌","\\rightleftharpoons",!0),Vg(Ug,Xg,rb,"≮","\\nless",!0),Vg(Ug,Xg,rb,"","\\@nleqslant"),Vg(Ug,Xg,rb,"","\\@nleqq"),Vg(Ug,Xg,rb,"⪇","\\lneq",!0),Vg(Ug,Xg,rb,"≨","\\lneqq",!0),Vg(Ug,Xg,rb,"","\\@lvertneqq"),Vg(Ug,Xg,rb,"⋦","\\lnsim",!0),Vg(Ug,Xg,rb,"⪉","\\lnapprox",!0),Vg(Ug,Xg,rb,"⊀","\\nprec",!0),Vg(Ug,Xg,rb,"⋠","\\npreceq",!0),Vg(Ug,Xg,rb,"⋨","\\precnsim",!0),Vg(Ug,Xg,rb,"⪹","\\precnapprox",!0),Vg(Ug,Xg,rb,"≁","\\nsim",!0),Vg(Ug,Xg,rb,"","\\@nshortmid"),Vg(Ug,Xg,rb,"∤","\\nmid",!0),Vg(Ug,Xg,rb,"⊬","\\nvdash",!0),Vg(Ug,Xg,rb,"⊭","\\nvDash",!0),Vg(Ug,Xg,rb,"⋪","\\ntriangleleft"),Vg(Ug,Xg,rb,"⋬","\\ntrianglelefteq",!0),Vg(Ug,Xg,rb,"⊊","\\subsetneq",!0),Vg(Ug,Xg,rb,"","\\@varsubsetneq"),Vg(Ug,Xg,rb,"⫋","\\subsetneqq",!0),Vg(Ug,Xg,rb,"","\\@varsubsetneqq"),Vg(Ug,Xg,rb,"≯","\\ngtr",!0),Vg(Ug,Xg,rb,"","\\@ngeqslant"),Vg(Ug,Xg,rb,"","\\@ngeqq"),Vg(Ug,Xg,rb,"⪈","\\gneq",!0),Vg(Ug,Xg,rb,"≩","\\gneqq",!0),Vg(Ug,Xg,rb,"","\\@gvertneqq"),Vg(Ug,Xg,rb,"⋧","\\gnsim",!0),Vg(Ug,Xg,rb,"⪊","\\gnapprox",!0),Vg(Ug,Xg,rb,"⊁","\\nsucc",!0),Vg(Ug,Xg,rb,"⋡","\\nsucceq",!0),Vg(Ug,Xg,rb,"⋩","\\succnsim",!0),Vg(Ug,Xg,rb,"⪺","\\succnapprox",!0),Vg(Ug,Xg,rb,"≆","\\ncong",!0),Vg(Ug,Xg,rb,"","\\@nshortparallel"),Vg(Ug,Xg,rb,"∦","\\nparallel",!0),Vg(Ug,Xg,rb,"⊯","\\nVDash",!0),Vg(Ug,Xg,rb,"⋫","\\ntriangleright"),Vg(Ug,Xg,rb,"⋭","\\ntrianglerighteq",!0),Vg(Ug,Xg,rb,"","\\@nsupseteqq"),Vg(Ug,Xg,rb,"⊋","\\supsetneq",!0),Vg(Ug,Xg,rb,"","\\@varsupsetneq"),Vg(Ug,Xg,rb,"⫌","\\supsetneqq",!0),Vg(Ug,Xg,rb,"","\\@varsupsetneqq"),Vg(Ug,Xg,rb,"⊮","\\nVdash",!0),Vg(Ug,Xg,rb,"⪵","\\precneqq",!0),Vg(Ug,Xg,rb,"⪶","\\succneqq",!0),Vg(Ug,Xg,rb,"","\\@nsubseteqq"),Vg(Ug,Xg,Jg,"⊴","\\unlhd"),Vg(Ug,Xg,Jg,"⊵","\\unrhd"),Vg(Ug,Xg,rb,"↚","\\nleftarrow",!0),Vg(Ug,Xg,rb,"↛","\\nrightarrow",!0),Vg(Ug,Xg,rb,"⇍","\\nLeftarrow",!0),Vg(Ug,Xg,rb,"⇏","\\nRightarrow",!0),Vg(Ug,Xg,rb,"↮","\\nleftrightarrow",!0),Vg(Ug,Xg,rb,"⇎","\\nLeftrightarrow",!0),Vg(Ug,Xg,rb,"△","\\vartriangle"),Vg(Ug,Xg,ob,"ℏ","\\hslash"),Vg(Ug,Xg,ob,"▽","\\triangledown"),Vg(Ug,Xg,ob,"◊","\\lozenge"),Vg(Ug,Xg,ob,"Ⓢ","\\circledS"),Vg(Ug,Xg,ob,"®","\\circledR"),Vg(Wg,Xg,ob,"®","\\circledR"),Vg(Ug,Xg,ob,"∡","\\measuredangle",!0),Vg(Ug,Xg,ob,"∄","\\nexists"),Vg(Ug,Xg,ob,"℧","\\mho"),Vg(Ug,Xg,ob,"Ⅎ","\\Finv",!0),Vg(Ug,Xg,ob,"⅁","\\Game",!0),Vg(Ug,Xg,ob,"‵","\\backprime"),Vg(Ug,Xg,ob,"▲","\\blacktriangle"),Vg(Ug,Xg,ob,"▼","\\blacktriangledown"),Vg(Ug,Xg,ob,"■","\\blacksquare"),Vg(Ug,Xg,ob,"⧫","\\blacklozenge"),Vg(Ug,Xg,ob,"★","\\bigstar"),Vg(Ug,Xg,ob,"∢","\\sphericalangle",!0),Vg(Ug,Xg,ob,"∁","\\complement",!0),Vg(Ug,Xg,ob,"ð","\\eth",!0),Vg(Wg,Yg,ob,"ð","ð"),Vg(Ug,Xg,ob,"╱","\\diagup"),Vg(Ug,Xg,ob,"╲","\\diagdown"),Vg(Ug,Xg,ob,"□","\\square"),Vg(Ug,Xg,ob,"□","\\Box"),Vg(Ug,Xg,ob,"◊","\\Diamond"),Vg(Ug,Xg,ob,"¥","\\yen",!0),Vg(Wg,Xg,ob,"¥","\\yen",!0),Vg(Ug,Xg,ob,"✓","\\checkmark",!0),Vg(Wg,Xg,ob,"✓","\\checkmark"),Vg(Ug,Xg,ob,"ℶ","\\beth",!0),Vg(Ug,Xg,ob,"ℸ","\\daleth",!0),Vg(Ug,Xg,ob,"ℷ","\\gimel",!0),Vg(Ug,Xg,ob,"ϝ","\\digamma",!0),Vg(Ug,Xg,ob,"ϰ","\\varkappa"),Vg(Ug,Xg,nb,"┌","\\@ulcorner",!0),Vg(Ug,Xg,Qg,"┐","\\@urcorner",!0),Vg(Ug,Xg,nb,"└","\\@llcorner",!0),Vg(Ug,Xg,Qg,"┘","\\@lrcorner",!0),Vg(Ug,Xg,rb,"≦","\\leqq",!0),Vg(Ug,Xg,rb,"⩽","\\leqslant",!0),Vg(Ug,Xg,rb,"⪕","\\eqslantless",!0),Vg(Ug,Xg,rb,"≲","\\lesssim",!0),Vg(Ug,Xg,rb,"⪅","\\lessapprox",!0),Vg(Ug,Xg,rb,"≊","\\approxeq",!0),Vg(Ug,Xg,Jg,"⋖","\\lessdot"),Vg(Ug,Xg,rb,"⋘","\\lll",!0),Vg(Ug,Xg,rb,"≶","\\lessgtr",!0),Vg(Ug,Xg,rb,"⋚","\\lesseqgtr",!0),Vg(Ug,Xg,rb,"⪋","\\lesseqqgtr",!0),Vg(Ug,Xg,rb,"≑","\\doteqdot"),Vg(Ug,Xg,rb,"≓","\\risingdotseq",!0),Vg(Ug,Xg,rb,"≒","\\fallingdotseq",!0),Vg(Ug,Xg,rb,"∽","\\backsim",!0),Vg(Ug,Xg,rb,"⋍","\\backsimeq",!0),Vg(Ug,Xg,rb,"⫅","\\subseteqq",!0),Vg(Ug,Xg,rb,"⋐","\\Subset",!0),Vg(Ug,Xg,rb,"⊏","\\sqsubset",!0),Vg(Ug,Xg,rb,"≼","\\preccurlyeq",!0),Vg(Ug,Xg,rb,"⋞","\\curlyeqprec",!0),Vg(Ug,Xg,rb,"≾","\\precsim",!0),Vg(Ug,Xg,rb,"⪷","\\precapprox",!0),Vg(Ug,Xg,rb,"⊲","\\vartriangleleft"),Vg(Ug,Xg,rb,"⊴","\\trianglelefteq"),Vg(Ug,Xg,rb,"⊨","\\vDash",!0),Vg(Ug,Xg,rb,"⊪","\\Vvdash",!0),Vg(Ug,Xg,rb,"⌣","\\smallsmile"),Vg(Ug,Xg,rb,"⌢","\\smallfrown"),Vg(Ug,Xg,rb,"≏","\\bumpeq",!0),Vg(Ug,Xg,rb,"≎","\\Bumpeq",!0),Vg(Ug,Xg,rb,"≧","\\geqq",!0),Vg(Ug,Xg,rb,"⩾","\\geqslant",!0),Vg(Ug,Xg,rb,"⪖","\\eqslantgtr",!0),Vg(Ug,Xg,rb,"≳","\\gtrsim",!0),Vg(Ug,Xg,rb,"⪆","\\gtrapprox",!0),Vg(Ug,Xg,Jg,"⋗","\\gtrdot"),Vg(Ug,Xg,rb,"⋙","\\ggg",!0),Vg(Ug,Xg,rb,"≷","\\gtrless",!0),Vg(Ug,Xg,rb,"⋛","\\gtreqless",!0),Vg(Ug,Xg,rb,"⪌","\\gtreqqless",!0),Vg(Ug,Xg,rb,"≖","\\eqcirc",!0),Vg(Ug,Xg,rb,"≗","\\circeq",!0),Vg(Ug,Xg,rb,"≜","\\triangleq",!0),Vg(Ug,Xg,rb,"∼","\\thicksim"),Vg(Ug,Xg,rb,"≈","\\thickapprox"),Vg(Ug,Xg,rb,"⫆","\\supseteqq",!0),Vg(Ug,Xg,rb,"⋑","\\Supset",!0),Vg(Ug,Xg,rb,"⊐","\\sqsupset",!0),Vg(Ug,Xg,rb,"≽","\\succcurlyeq",!0),Vg(Ug,Xg,rb,"⋟","\\curlyeqsucc",!0),Vg(Ug,Xg,rb,"≿","\\succsim",!0),Vg(Ug,Xg,rb,"⪸","\\succapprox",!0),Vg(Ug,Xg,rb,"⊳","\\vartriangleright"),Vg(Ug,Xg,rb,"⊵","\\trianglerighteq"),Vg(Ug,Xg,rb,"⊩","\\Vdash",!0),Vg(Ug,Xg,rb,"∣","\\shortmid"),Vg(Ug,Xg,rb,"∥","\\shortparallel"),Vg(Ug,Xg,rb,"≬","\\between",!0),Vg(Ug,Xg,rb,"⋔","\\pitchfork",!0),Vg(Ug,Xg,rb,"∝","\\varpropto"),Vg(Ug,Xg,rb,"◀","\\blacktriangleleft"),Vg(Ug,Xg,rb,"∴","\\therefore",!0),Vg(Ug,Xg,rb,"∍","\\backepsilon"),Vg(Ug,Xg,rb,"▶","\\blacktriangleright"),Vg(Ug,Xg,rb,"∵","\\because",!0),Vg(Ug,Xg,rb,"⋘","\\llless"),Vg(Ug,Xg,rb,"⋙","\\gggtr"),Vg(Ug,Xg,Jg,"⊲","\\lhd"),Vg(Ug,Xg,Jg,"⊳","\\rhd"),Vg(Ug,Xg,rb,"≂","\\eqsim",!0),Vg(Ug,Yg,rb,"⋈","\\Join"),Vg(Ug,Xg,rb,"≑","\\Doteq",!0),Vg(Ug,Xg,Jg,"∔","\\dotplus",!0),Vg(Ug,Xg,Jg,"∖","\\smallsetminus"),Vg(Ug,Xg,Jg,"⋒","\\Cap",!0),Vg(Ug,Xg,Jg,"⋓","\\Cup",!0),Vg(Ug,Xg,Jg,"⩞","\\doublebarwedge",!0),Vg(Ug,Xg,Jg,"⊟","\\boxminus",!0),Vg(Ug,Xg,Jg,"⊞","\\boxplus",!0),Vg(Ug,Xg,Jg,"⋇","\\divideontimes",!0),Vg(Ug,Xg,Jg,"⋉","\\ltimes",!0),Vg(Ug,Xg,Jg,"⋊","\\rtimes",!0),Vg(Ug,Xg,Jg,"⋋","\\leftthreetimes",!0),Vg(Ug,Xg,Jg,"⋌","\\rightthreetimes",!0),Vg(Ug,Xg,Jg,"⋏","\\curlywedge",!0),Vg(Ug,Xg,Jg,"⋎","\\curlyvee",!0),Vg(Ug,Xg,Jg,"⊝","\\circleddash",!0),Vg(Ug,Xg,Jg,"⊛","\\circledast",!0),Vg(Ug,Xg,Jg,"⋅","\\centerdot"),Vg(Ug,Xg,Jg,"⊺","\\intercal",!0),Vg(Ug,Xg,Jg,"⋒","\\doublecap"),Vg(Ug,Xg,Jg,"⋓","\\doublecup"),Vg(Ug,Xg,Jg,"⊠","\\boxtimes",!0),Vg(Ug,Xg,rb,"⇢","\\dashrightarrow",!0),Vg(Ug,Xg,rb,"⇠","\\dashleftarrow",!0),Vg(Ug,Xg,rb,"⇇","\\leftleftarrows",!0),Vg(Ug,Xg,rb,"⇆","\\leftrightarrows",!0),Vg(Ug,Xg,rb,"⇚","\\Lleftarrow",!0),Vg(Ug,Xg,rb,"↞","\\twoheadleftarrow",!0),Vg(Ug,Xg,rb,"↢","\\leftarrowtail",!0),Vg(Ug,Xg,rb,"↫","\\looparrowleft",!0),Vg(Ug,Xg,rb,"⇋","\\leftrightharpoons",!0),Vg(Ug,Xg,rb,"↶","\\curvearrowleft",!0),Vg(Ug,Xg,rb,"↺","\\circlearrowleft",!0),Vg(Ug,Xg,rb,"↰","\\Lsh",!0),Vg(Ug,Xg,rb,"⇈","\\upuparrows",!0),Vg(Ug,Xg,rb,"↿","\\upharpoonleft",!0),Vg(Ug,Xg,rb,"⇃","\\downharpoonleft",!0),Vg(Ug,Yg,rb,"⊶","\\origof",!0),Vg(Ug,Yg,rb,"⊷","\\imageof",!0),Vg(Ug,Xg,rb,"⊸","\\multimap",!0),Vg(Ug,Xg,rb,"↭","\\leftrightsquigarrow",!0),Vg(Ug,Xg,rb,"⇉","\\rightrightarrows",!0),Vg(Ug,Xg,rb,"⇄","\\rightleftarrows",!0),Vg(Ug,Xg,rb,"↠","\\twoheadrightarrow",!0),Vg(Ug,Xg,rb,"↣","\\rightarrowtail",!0),Vg(Ug,Xg,rb,"↬","\\looparrowright",!0),Vg(Ug,Xg,rb,"↷","\\curvearrowright",!0),Vg(Ug,Xg,rb,"↻","\\circlearrowright",!0),Vg(Ug,Xg,rb,"↱","\\Rsh",!0),Vg(Ug,Xg,rb,"⇊","\\downdownarrows",!0),Vg(Ug,Xg,rb,"↾","\\upharpoonright",!0),Vg(Ug,Xg,rb,"⇂","\\downharpoonright",!0),Vg(Ug,Xg,rb,"⇝","\\rightsquigarrow",!0),Vg(Ug,Xg,rb,"⇝","\\leadsto"),Vg(Ug,Xg,rb,"⇛","\\Rrightarrow",!0),Vg(Ug,Xg,rb,"↾","\\restriction"),Vg(Ug,Yg,ob,"‘","`"),Vg(Ug,Yg,ob,"$","\\$"),Vg(Wg,Yg,ob,"$","\\$"),Vg(Wg,Yg,ob,"$","\\textdollar"),Vg(Ug,Yg,ob,"%","\\%"),Vg(Wg,Yg,ob,"%","\\%"),Vg(Ug,Yg,ob,"_","\\_"),Vg(Wg,Yg,ob,"_","\\_"),Vg(Wg,Yg,ob,"_","\\textunderscore"),Vg(Ug,Yg,ob,"∠","\\angle",!0),Vg(Ug,Yg,ob,"∞","\\infty",!0),Vg(Ug,Yg,ob,"′","\\prime"),Vg(Ug,Yg,ob,"△","\\triangle"),Vg(Ug,Yg,ob,"Γ","\\Gamma",!0),Vg(Ug,Yg,ob,"Δ","\\Delta",!0),Vg(Ug,Yg,ob,"Θ","\\Theta",!0),Vg(Ug,Yg,ob,"Λ","\\Lambda",!0),Vg(Ug,Yg,ob,"Ξ","\\Xi",!0),Vg(Ug,Yg,ob,"Π","\\Pi",!0),Vg(Ug,Yg,ob,"Σ","\\Sigma",!0),Vg(Ug,Yg,ob,"Υ","\\Upsilon",!0),Vg(Ug,Yg,ob,"Φ","\\Phi",!0),Vg(Ug,Yg,ob,"Ψ","\\Psi",!0),Vg(Ug,Yg,ob,"Ω","\\Omega",!0),Vg(Ug,Yg,ob,"A","Α"),Vg(Ug,Yg,ob,"B","Β"),Vg(Ug,Yg,ob,"E","Ε"),Vg(Ug,Yg,ob,"Z","Ζ"),Vg(Ug,Yg,ob,"H","Η"),Vg(Ug,Yg,ob,"I","Ι"),Vg(Ug,Yg,ob,"K","Κ"),Vg(Ug,Yg,ob,"M","Μ"),Vg(Ug,Yg,ob,"N","Ν"),Vg(Ug,Yg,ob,"O","Ο"),Vg(Ug,Yg,ob,"P","Ρ"),Vg(Ug,Yg,ob,"T","Τ"),Vg(Ug,Yg,ob,"X","Χ"),Vg(Ug,Yg,ob,"¬","\\neg",!0),Vg(Ug,Yg,ob,"¬","\\lnot"),Vg(Ug,Yg,ob,"⊤","\\top"),Vg(Ug,Yg,ob,"⊥","\\bot"),Vg(Ug,Yg,ob,"∅","\\emptyset"),Vg(Ug,Xg,ob,"∅","\\varnothing"),Vg(Ug,Yg,eb,"α","\\alpha",!0),Vg(Ug,Yg,eb,"β","\\beta",!0),Vg(Ug,Yg,eb,"γ","\\gamma",!0),Vg(Ug,Yg,eb,"δ","\\delta",!0),Vg(Ug,Yg,eb,"ϵ","\\epsilon",!0),Vg(Ug,Yg,eb,"ζ","\\zeta",!0),Vg(Ug,Yg,eb,"η","\\eta",!0),Vg(Ug,Yg,eb,"θ","\\theta",!0),Vg(Ug,Yg,eb,"ι","\\iota",!0),Vg(Ug,Yg,eb,"κ","\\kappa",!0),Vg(Ug,Yg,eb,"λ","\\lambda",!0),Vg(Ug,Yg,eb,"μ","\\mu",!0),Vg(Ug,Yg,eb,"ν","\\nu",!0),Vg(Ug,Yg,eb,"ξ","\\xi",!0),Vg(Ug,Yg,eb,"ο","\\omicron",!0),Vg(Ug,Yg,eb,"π","\\pi",!0),Vg(Ug,Yg,eb,"ρ","\\rho",!0),Vg(Ug,Yg,eb,"σ","\\sigma",!0),Vg(Ug,Yg,eb,"τ","\\tau",!0),Vg(Ug,Yg,eb,"υ","\\upsilon",!0),Vg(Ug,Yg,eb,"ϕ","\\phi",!0),Vg(Ug,Yg,eb,"χ","\\chi",!0),Vg(Ug,Yg,eb,"ψ","\\psi",!0),Vg(Ug,Yg,eb,"ω","\\omega",!0),Vg(Ug,Yg,eb,"ε","\\varepsilon",!0),Vg(Ug,Yg,eb,"ϑ","\\vartheta",!0),Vg(Ug,Yg,eb,"ϖ","\\varpi",!0),Vg(Ug,Yg,eb,"ϱ","\\varrho",!0),Vg(Ug,Yg,eb,"ς","\\varsigma",!0),Vg(Ug,Yg,eb,"φ","\\varphi",!0),Vg(Ug,Yg,Jg,"∗","*",!0),Vg(Ug,Yg,Jg,"+","+"),Vg(Ug,Yg,Jg,"−","-",!0),Vg(Ug,Yg,Jg,"⋅","\\cdot",!0),Vg(Ug,Yg,Jg,"∘","\\circ",!0),Vg(Ug,Yg,Jg,"÷","\\div",!0),Vg(Ug,Yg,Jg,"±","\\pm",!0),Vg(Ug,Yg,Jg,"×","\\times",!0),Vg(Ug,Yg,Jg,"∩","\\cap",!0),Vg(Ug,Yg,Jg,"∪","\\cup",!0),Vg(Ug,Yg,Jg,"∖","\\setminus",!0),Vg(Ug,Yg,Jg,"∧","\\land"),Vg(Ug,Yg,Jg,"∨","\\lor"),Vg(Ug,Yg,Jg,"∧","\\wedge",!0),Vg(Ug,Yg,Jg,"∨","\\vee",!0),Vg(Ug,Yg,ob,"√","\\surd"),Vg(Ug,Yg,nb,"⟨","\\langle",!0),Vg(Ug,Yg,nb,"∣","\\lvert"),Vg(Ug,Yg,nb,"∥","\\lVert"),Vg(Ug,Yg,Qg,"?","?"),Vg(Ug,Yg,Qg,"!","!"),Vg(Ug,Yg,Qg,"⟩","\\rangle",!0),Vg(Ug,Yg,Qg,"∣","\\rvert"),Vg(Ug,Yg,Qg,"∥","\\rVert"),Vg(Ug,Yg,rb,"=","="),Vg(Ug,Yg,rb,":",":"),Vg(Ug,Yg,rb,"≈","\\approx",!0),Vg(Ug,Yg,rb,"≅","\\cong",!0),Vg(Ug,Yg,rb,"≥","\\ge"),Vg(Ug,Yg,rb,"≥","\\geq",!0),Vg(Ug,Yg,rb,"←","\\gets"),Vg(Ug,Yg,rb,">","\\gt",!0),Vg(Ug,Yg,rb,"∈","\\in",!0),Vg(Ug,Yg,rb,"","\\@not"),Vg(Ug,Yg,rb,"⊂","\\subset",!0),Vg(Ug,Yg,rb,"⊃","\\supset",!0),Vg(Ug,Yg,rb,"⊆","\\subseteq",!0),Vg(Ug,Yg,rb,"⊇","\\supseteq",!0),Vg(Ug,Xg,rb,"⊈","\\nsubseteq",!0),Vg(Ug,Xg,rb,"⊉","\\nsupseteq",!0),Vg(Ug,Yg,rb,"⊨","\\models"),Vg(Ug,Yg,rb,"←","\\leftarrow",!0),Vg(Ug,Yg,rb,"≤","\\le"),Vg(Ug,Yg,rb,"≤","\\leq",!0),Vg(Ug,Yg,rb,"<","\\lt",!0),Vg(Ug,Yg,rb,"→","\\rightarrow",!0),Vg(Ug,Yg,rb,"→","\\to"),Vg(Ug,Xg,rb,"≱","\\ngeq",!0),Vg(Ug,Xg,rb,"≰","\\nleq",!0),Vg(Ug,Yg,sb," ","\\ "),Vg(Ug,Yg,sb," ","\\space"),Vg(Ug,Yg,sb," ","\\nobreakspace"),Vg(Wg,Yg,sb," ","\\ "),Vg(Wg,Yg,sb," "," "),Vg(Wg,Yg,sb," ","\\space"),Vg(Wg,Yg,sb," ","\\nobreakspace"),Vg(Ug,Yg,sb,null,"\\nobreak"),Vg(Ug,Yg,sb,null,"\\allowbreak"),Vg(Ug,Yg,ib,",",","),Vg(Ug,Yg,ib,";",";"),Vg(Ug,Xg,Jg,"⊼","\\barwedge",!0),Vg(Ug,Xg,Jg,"⊻","\\veebar",!0),Vg(Ug,Yg,Jg,"⊙","\\odot",!0),Vg(Ug,Yg,Jg,"⊕","\\oplus",!0),Vg(Ug,Yg,Jg,"⊗","\\otimes",!0),Vg(Ug,Yg,ob,"∂","\\partial",!0),Vg(Ug,Yg,Jg,"⊘","\\oslash",!0),Vg(Ug,Xg,Jg,"⊚","\\circledcirc",!0),Vg(Ug,Xg,Jg,"⊡","\\boxdot",!0),Vg(Ug,Yg,Jg,"△","\\bigtriangleup"),Vg(Ug,Yg,Jg,"▽","\\bigtriangledown"),Vg(Ug,Yg,Jg,"†","\\dagger"),Vg(Ug,Yg,Jg,"⋄","\\diamond"),Vg(Ug,Yg,Jg,"⋆","\\star"),Vg(Ug,Yg,Jg,"◃","\\triangleleft"),Vg(Ug,Yg,Jg,"▹","\\triangleright"),Vg(Ug,Yg,nb,"{","\\{"),Vg(Wg,Yg,ob,"{","\\{"),Vg(Wg,Yg,ob,"{","\\textbraceleft"),Vg(Ug,Yg,Qg,"}","\\}"),Vg(Wg,Yg,ob,"}","\\}"),Vg(Wg,Yg,ob,"}","\\textbraceright"),Vg(Ug,Yg,nb,"{","\\lbrace"),Vg(Ug,Yg,Qg,"}","\\rbrace"),Vg(Ug,Yg,nb,"[","\\lbrack",!0),Vg(Wg,Yg,ob,"[","\\lbrack",!0),Vg(Ug,Yg,Qg,"]","\\rbrack",!0),Vg(Wg,Yg,ob,"]","\\rbrack",!0),Vg(Ug,Yg,nb,"(","\\lparen",!0),Vg(Ug,Yg,Qg,")","\\rparen",!0),Vg(Wg,Yg,ob,"<","\\textless",!0),Vg(Wg,Yg,ob,">","\\textgreater",!0),Vg(Ug,Yg,nb,"⌊","\\lfloor",!0),Vg(Ug,Yg,Qg,"⌋","\\rfloor",!0),Vg(Ug,Yg,nb,"⌈","\\lceil",!0),Vg(Ug,Yg,Qg,"⌉","\\rceil",!0),Vg(Ug,Yg,ob,"\\","\\backslash"),Vg(Ug,Yg,ob,"∣","|"),Vg(Ug,Yg,ob,"∣","\\vert"),Vg(Wg,Yg,ob,"|","\\textbar",!0),Vg(Ug,Yg,ob,"∥","\\|"),Vg(Ug,Yg,ob,"∥","\\Vert"),Vg(Wg,Yg,ob,"∥","\\textbardbl"),Vg(Wg,Yg,ob,"~","\\textasciitilde"),Vg(Wg,Yg,ob,"\\","\\textbackslash"),Vg(Wg,Yg,ob,"^","\\textasciicircum"),Vg(Ug,Yg,rb,"↑","\\uparrow",!0),Vg(Ug,Yg,rb,"⇑","\\Uparrow",!0),Vg(Ug,Yg,rb,"↓","\\downarrow",!0),Vg(Ug,Yg,rb,"⇓","\\Downarrow",!0),Vg(Ug,Yg,rb,"↕","\\updownarrow",!0),Vg(Ug,Yg,rb,"⇕","\\Updownarrow",!0),Vg(Ug,Yg,tb,"∐","\\coprod"),Vg(Ug,Yg,tb,"⋁","\\bigvee"),Vg(Ug,Yg,tb,"⋀","\\bigwedge"),Vg(Ug,Yg,tb,"⨄","\\biguplus"),Vg(Ug,Yg,tb,"⋂","\\bigcap"),Vg(Ug,Yg,tb,"⋃","\\bigcup"),Vg(Ug,Yg,tb,"∫","\\int"),Vg(Ug,Yg,tb,"∫","\\intop"),Vg(Ug,Yg,tb,"∬","\\iint"),Vg(Ug,Yg,tb,"∭","\\iiint"),Vg(Ug,Yg,tb,"∏","\\prod"),Vg(Ug,Yg,tb,"∑","\\sum"),Vg(Ug,Yg,tb,"⨂","\\bigotimes"),Vg(Ug,Yg,tb,"⨁","\\bigoplus"),Vg(Ug,Yg,tb,"⨀","\\bigodot"),Vg(Ug,Yg,tb,"∮","\\oint"),Vg(Ug,Yg,tb,"∯","\\oiint"),Vg(Ug,Yg,tb,"∰","\\oiiint"),Vg(Ug,Yg,tb,"⨆","\\bigsqcup"),Vg(Ug,Yg,tb,"∫","\\smallint"),Vg(Wg,Yg,Zg,"…","\\textellipsis"),Vg(Ug,Yg,Zg,"…","\\mathellipsis"),Vg(Wg,Yg,Zg,"…","\\ldots",!0),Vg(Ug,Yg,Zg,"…","\\ldots",!0),Vg(Ug,Yg,Zg,"⋯","\\@cdots",!0),Vg(Ug,Yg,Zg,"⋱","\\ddots",!0),Vg(Ug,Yg,ob,"⋮","\\varvdots"),Vg(Wg,Yg,ob,"⋮","\\varvdots"),Vg(Ug,Yg,Kg,"ˊ","\\acute"),Vg(Ug,Yg,Kg,"ˋ","\\grave"),Vg(Ug,Yg,Kg,"¨","\\ddot"),Vg(Ug,Yg,Kg,"~","\\tilde"),Vg(Ug,Yg,Kg,"ˉ","\\bar"),Vg(Ug,Yg,Kg,"˘","\\breve"),Vg(Ug,Yg,Kg,"ˇ","\\check"),Vg(Ug,Yg,Kg,"^","\\hat"),Vg(Ug,Yg,Kg,"⃗","\\vec"),Vg(Ug,Yg,Kg,"˙","\\dot"),Vg(Ug,Yg,Kg,"˚","\\mathring"),Vg(Ug,Yg,eb,"","\\@imath"),Vg(Ug,Yg,eb,"","\\@jmath"),Vg(Ug,Yg,ob,"ı","ı"),Vg(Ug,Yg,ob,"ȷ","ȷ"),Vg(Wg,Yg,ob,"ı","\\i",!0),Vg(Wg,Yg,ob,"ȷ","\\j",!0),Vg(Wg,Yg,ob,"ß","\\ss",!0),Vg(Wg,Yg,ob,"æ","\\ae",!0),Vg(Wg,Yg,ob,"œ","\\oe",!0),Vg(Wg,Yg,ob,"ø","\\o",!0),Vg(Wg,Yg,ob,"Æ","\\AE",!0),Vg(Wg,Yg,ob,"Œ","\\OE",!0),Vg(Wg,Yg,ob,"Ø","\\O",!0),Vg(Wg,Yg,Kg,"ˊ","\\'"),Vg(Wg,Yg,Kg,"ˋ","\\`"),Vg(Wg,Yg,Kg,"ˆ","\\^"),Vg(Wg,Yg,Kg,"˜","\\~"),Vg(Wg,Yg,Kg,"ˉ","\\="),Vg(Wg,Yg,Kg,"˘","\\u"),Vg(Wg,Yg,Kg,"˙","\\."),Vg(Wg,Yg,Kg,"¸","\\c"),Vg(Wg,Yg,Kg,"˚","\\r"),Vg(Wg,Yg,Kg,"ˇ","\\v"),Vg(Wg,Yg,Kg,"¨",'\\"'),Vg(Wg,Yg,Kg,"˝","\\H"),Vg(Wg,Yg,Kg,"◯","\\textcircled");var ab={"--":!0,"---":!0,"``":!0,"''":!0};Vg(Wg,Yg,ob,"–","--",!0),Vg(Wg,Yg,ob,"–","\\textendash"),Vg(Wg,Yg,ob,"—","---",!0),Vg(Wg,Yg,ob,"—","\\textemdash"),Vg(Wg,Yg,ob,"‘","`",!0),Vg(Wg,Yg,ob,"‘","\\textquoteleft"),Vg(Wg,Yg,ob,"’","'",!0),Vg(Wg,Yg,ob,"’","\\textquoteright"),Vg(Wg,Yg,ob,"“","``",!0),Vg(Wg,Yg,ob,"“","\\textquotedblleft"),Vg(Wg,Yg,ob,"”","''",!0),Vg(Wg,Yg,ob,"”","\\textquotedblright"),Vg(Ug,Yg,ob,"°","\\degree",!0),Vg(Wg,Yg,ob,"°","\\degree"),Vg(Wg,Yg,ob,"°","\\textdegree",!0),Vg(Ug,Yg,ob,"£","\\pounds"),Vg(Ug,Yg,ob,"£","\\mathsterling",!0),Vg(Wg,Yg,ob,"£","\\pounds"),Vg(Wg,Yg,ob,"£","\\textsterling",!0),Vg(Ug,Xg,ob,"✠","\\maltese"),Vg(Wg,Xg,ob,"✠","\\maltese");for(var lb='0123456789/@."',cb=0;cb<14;cb++){var db=lb.charAt(cb);Vg(Ug,Yg,ob,db,db)}for(var ub='0123456789!@*()-=+";:?/.,',hb=0;hb<25;hb++){var pb=ub.charAt(hb);Vg(Wg,Yg,ob,pb,pb)}for(var _b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",fb=0;fb<52;fb++){var mb=_b.charAt(fb);Vg(Ug,Yg,eb,mb,mb),Vg(Wg,Yg,ob,mb,mb)}Vg(Ug,Xg,ob,"C","ℂ"),Vg(Wg,Xg,ob,"C","ℂ"),Vg(Ug,Xg,ob,"H","ℍ"),Vg(Wg,Xg,ob,"H","ℍ"),Vg(Ug,Xg,ob,"N","ℕ"),Vg(Wg,Xg,ob,"N","ℕ"),Vg(Ug,Xg,ob,"P","ℙ"),Vg(Wg,Xg,ob,"P","ℙ"),Vg(Ug,Xg,ob,"Q","ℚ"),Vg(Wg,Xg,ob,"Q","ℚ"),Vg(Ug,Xg,ob,"R","ℝ"),Vg(Wg,Xg,ob,"R","ℝ"),Vg(Ug,Xg,ob,"Z","ℤ"),Vg(Wg,Xg,ob,"Z","ℤ"),Vg(Ug,Yg,eb,"h","ℎ"),Vg(Wg,Yg,eb,"h","ℎ");for(var gb="",bb=0;bb<52;bb++){var yb=_b.charAt(bb);Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56320+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56372+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56424+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56580+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56684+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56736+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56788+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56840+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56944+bb)),Vg(Wg,Yg,ob,yb,gb),bb<26&&(Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56632+bb)),Vg(Wg,Yg,ob,yb,gb),Vg(Ug,Yg,eb,yb,gb=String.fromCharCode(55349,56476+bb)),Vg(Wg,Yg,ob,yb,gb))}Vg(Ug,Yg,eb,"k",gb=String.fromCharCode(55349,56668)),Vg(Wg,Yg,ob,"k",gb);for(var vb=0;vb<10;vb++){var wb=vb.toString();Vg(Ug,Yg,eb,wb,gb=String.fromCharCode(55349,57294+vb)),Vg(Wg,Yg,ob,wb,gb),Vg(Ug,Yg,eb,wb,gb=String.fromCharCode(55349,57314+vb)),Vg(Wg,Yg,ob,wb,gb),Vg(Ug,Yg,eb,wb,gb=String.fromCharCode(55349,57324+vb)),Vg(Wg,Yg,ob,wb,gb),Vg(Ug,Yg,eb,wb,gb=String.fromCharCode(55349,57334+vb)),Vg(Wg,Yg,ob,wb,gb)}for(var xb="ÐÞþ",kb=0;kb<3;kb++){var Sb=xb.charAt(kb);Vg(Ug,Yg,eb,Sb,Sb),Vg(Wg,Yg,ob,Sb,Sb)}var Cb=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Mb=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ab=function(e,t,n){return Gg[n][e]&&Gg[n][e].replace&&(e=Gg[n][e].replace),{value:e,metrics:gg(e,t,n)}},Tb=function(e,t,n,i,r){var s,o=Ab(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||i&&"mathit"===i.font)&&(l=0),s=new Dg(e,a.height,a.depth,l,a.skew,a.width,r)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new Dg(e,0,0,0,0,0,r);if(i){s.maxFontSize=i.sizeMultiplier,i.style.isTight()&&s.classes.push("mtight");var c=i.getColor();c&&(s.style.color=c)}return s},zb=(e,t)=>{if(Tg(e.classes)!==Tg(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var i in e.style)if(e.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;for(var r in t.style)if(t.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;return!0},Pb=function(e){for(var t=0,n=0,i=0,r=0;r<e.children.length;r++){var s=e.children[r];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},Nb=function(e,t,n,i){var r=new Og(e,t,n,i);return Pb(r),r},Rb=(e,t,n,i)=>new Og(e,t,n,i),Ob=function(e){var t=new pg(e);return Pb(t),t},Lb=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}return i+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Eb={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ib={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Db={fontMap:Eb,makeSymbol:Tb,mathsym:function(e,t,n,i){return void 0===i&&(i=[]),"boldsymbol"===n.font&&Ab(e,"Main-Bold",t).metrics?Tb(e,"Main-Bold",t,n,i.concat(["mathbf"])):"\\"===e||"main"===Gg[t][e].font?Tb(e,"Main-Regular",t,n,i):Tb(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},makeSpan:Nb,makeSvgSpan:Rb,makeLineSpan:function(e,t,n){var i=Nb([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=Ag(i.height),i.maxFontSize=1,i},makeAnchor:function(e,t,n,i){var r=new Lg(e,t,n,i);return Pb(r),r},makeFragment:Ob,wrapFragment:function(e,t){return e instanceof pg?Nb([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:i}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,r=i,s=1;s<t.length;s++){var o=-t[s].shift-r-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);r+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:i}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),r=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;r=Math.max(r,a.maxFontSize,a.height)}}r+=2;var l=Nb(["pstrut"],[]);l.style.height=Ag(r);for(var c=[],d=i,u=i,h=i,p=0;p<n.length;p++){var _=n[p];if("kern"===_.type)h+=_.size;else{var f=_.elem,m=_.wrapperClasses||[],g=_.wrapperStyle||{},b=Nb(m,[l,f],void 0,g);b.style.top=Ag(-r-h-f.depth),_.marginLeft&&(b.style.marginLeft=_.marginLeft),_.marginRight&&(b.style.marginRight=_.marginRight),c.push(b),h+=f.height+f.depth}d=Math.min(d,h),u=Math.max(u,h)}var y,v=Nb(["vlist"],c);if(v.style.height=Ag(u),d<0){var w=Nb([],[]),x=Nb(["vlist"],[w]);x.style.height=Ag(-d);var k=Nb(["vlist-s"],[new Dg("​")]);y=[Nb(["vlist-r"],[v,k]),Nb(["vlist-r"],[x])]}else y=[Nb(["vlist-r"],[v])];var S=Nb(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,n){var i=e.mode,r=e.text,s=["mord"],o="math"===i||"text"===i&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===r.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,i="math"===t?0:1;if(119808<=n&&n<120484){var r=Math.floor((n-119808)/26);return[Cb[r][2],Cb[r][i]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[Mb[s][2],Mb[s][i]]}if(120485===n||120486===n)return[Cb[0][2],Cb[0][i]];if(120486<n&&n<120782)return["",""];throw new Gm("Unsupported character: "+e)}(r,i)),l.length>0)return Tb(r,l,i,t,s.concat(c));if(a){var d,u;if("boldsymbol"===a){var h=function(e,t,n,i,r){return"textord"!==r&&Ab(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(r,i,0,0,n);d=h.fontName,u=[h.fontClass]}else o?(d=Eb[a].fontName,u=[a]):(d=Lb(a,t.fontWeight,t.fontShape),u=[a,t.fontWeight,t.fontShape]);if(Ab(r,d,i).metrics)return Tb(r,d,i,t,s.concat(u));if(ab.hasOwnProperty(r)&&"Typewriter"===d.slice(0,10)){for(var p=[],_=0;_<r.length;_++)p.push(Tb(r[_],d,i,t,s.concat(u)));return Ob(p)}}if("mathord"===n)return Tb(r,"Math-Italic",i,t,s.concat(["mathnormal"]));if("textord"===n){var f=Gg[i][r]&&Gg[i][r].font;if("ams"===f){var m=Lb("amsrm",t.fontWeight,t.fontShape);return Tb(r,m,i,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var g=Lb(f,t.fontWeight,t.fontShape);return Tb(r,g,i,t,s.concat(g,t.fontWeight,t.fontShape))}var b=Lb("textrm",t.fontWeight,t.fontShape);return Tb(r,b,i,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Nb(["mspace"],[],t),i=Mg(e,t);return n.style.marginRight=Ag(i),n},staticSvg:function(e,t){var[n,i,r]=Ib[e],s=new jg(n),o=new Bg([s],{width:Ag(i),height:Ag(r),style:"width:"+Ag(i),viewBox:"0 0 "+1e3*i+" "+1e3*r,preserveAspectRatio:"xMinYMin"}),a=Rb(["overlay"],[o],t);return a.height=r,a.style.height=Ag(r),a.style.width=Ag(i),a},svgData:Ib,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1];n instanceof Dg&&i instanceof Dg&&zb(n,i)&&(n.text+=i.text,n.height=Math.max(n.height,i.height),n.depth=Math.max(n.depth,i.depth),n.italic=i.italic,e.splice(t+1,1),t--)}return e}},Bb={number:3,unit:"mu"},jb={number:4,unit:"mu"},qb={number:5,unit:"mu"},Fb={mord:{mop:Bb,mbin:jb,mrel:qb,minner:Bb},mop:{mord:Bb,mop:Bb,mrel:qb,minner:Bb},mbin:{mord:jb,mop:jb,mopen:jb,minner:jb},mrel:{mord:qb,mop:qb,mopen:qb,minner:qb},mopen:{},mclose:{mop:Bb,mbin:jb,mrel:qb,minner:Bb},mpunct:{mord:Bb,mop:Bb,mrel:qb,mopen:Bb,mclose:Bb,mpunct:Bb,minner:Bb},minner:{mord:Bb,mop:Bb,mbin:jb,mrel:qb,mopen:Bb,mpunct:Bb,minner:Bb}},Hb={mord:{mop:Bb},mop:{mord:Bb,mop:Bb},mbin:{},mrel:{},mopen:{},mclose:{mop:Bb},mpunct:{},minner:{mop:Bb}},$b={},Gb={},Vb={};function Ub(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:i.numArgs,argTypes:i.argTypes,allowedInArgument:!!i.allowedInArgument,allowedInText:!!i.allowedInText,allowedInMath:void 0===i.allowedInMath||i.allowedInMath,numOptionalArgs:i.numOptionalArgs||0,infix:!!i.infix,primitive:!!i.primitive,handler:r},l=0;l<n.length;++l)$b[n[l]]=a;t&&(s&&(Gb[t]=s),o&&(Vb[t]=o))}function Wb(e){var{type:t,htmlBuilder:n,mathmlBuilder:i}=e;Ub({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:i})}var Yb=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},Xb=function(e){return"ordgroup"===e.type?e.body:[e]},Kb=Db.makeSpan,Jb=["leftmost","mbin","mopen","mrel","mop","mpunct"],Qb=["rightmost","mrel","mclose","mpunct"],Zb={display:ag.DISPLAY,text:ag.TEXT,script:ag.SCRIPT,scriptscript:ag.SCRIPTSCRIPT},ey={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ty=function(e,t,n,i){void 0===i&&(i=[null,null]);for(var r=[],s=0;s<e.length;s++){var o=ay(e[s],t);if(o instanceof pg){var a=o.children;r.push(...a)}else r.push(o)}if(Db.tryCombineChars(r),!n)return r;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Zb[c.style]))}var d=Kb([i[0]||"leftmost"],[],t),u=Kb([i[1]||"rightmost"],[],t),h="root"===n;return ny(r,(e,t)=>{var n=t.classes[0],i=e.classes[0];"mbin"===n&&Xm.contains(Qb,i)?t.classes[0]="mord":"mbin"===i&&Xm.contains(Jb,n)&&(e.classes[0]="mord")},{node:d},u,h),ny(r,(e,t)=>{var n=sy(t),i=sy(e),r=n&&i?e.hasClass("mtight")?Hb[n][i]:Fb[n][i]:null;if(r)return Db.makeGlue(r,l)},{node:d},u,h),r},ny=function e(t,n,i,r,s){r&&t.push(r);for(var o=0;o<t.length;o++){var a=t[o],l=iy(a);if(l)e(l.children,n,i,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,i.node);d&&(i.insertAfter?i.insertAfter(d):(t.unshift(d),o++))}c?i.node=a:s&&a.hasClass("newline")&&(i.node=Kb(["leftmost"])),i.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}r&&t.pop()},iy=function(e){return e instanceof pg||e instanceof Lg||e instanceof Og&&e.hasClass("enclosing")?e:null},ry=function e(t,n){var i=iy(t);if(i){var r=i.children;if(r.length){if("right"===n)return e(r[r.length-1],"right");if("left"===n)return e(r[0],"left")}}return t},sy=function(e,t){return e?(t&&(e=ry(e,t)),ey[e.classes[0]]||null):null},oy=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Kb(t.concat(n))},ay=function(e,t,n){if(!e)return Kb();if(Gb[e.type]){var i=Gb[e.type](e,t);if(n&&t.size!==n.size){i=Kb(t.sizingClasses(n),[i],t);var r=t.sizeMultiplier/n.sizeMultiplier;i.height*=r,i.depth*=r}return i}throw new Gm("Got group of unknown type: '"+e.type+"'")};function ly(e,t){var n=Kb(["base"],e,t),i=Kb(["strut"]);return i.style.height=Ag(n.height+n.depth),n.depth&&(i.style.verticalAlign=Ag(-n.depth)),n.children.unshift(i),n}function cy(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var i,r=ty(e,t,"root");2===r.length&&r[1].hasClass("tag")&&(i=r.pop());for(var s,o=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var c=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(c=!0);c||(o.push(ly(a,t)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(ly(a,t)),a=[]),o.push(r[l]));a.length>0&&o.push(ly(a,t)),n?((s=ly(ty(n,t,!0))).classes=["tag"],o.push(s)):i&&o.push(i);var d=Kb(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var u=s.children[0];u.style.height=Ag(d.height+d.depth),d.depth&&(u.style.verticalAlign=Ag(-d.depth))}return d}function dy(e){return new pg(e)}class uy{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Tg(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof hy&&this.children[n+1]instanceof hy){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof hy;)i+=this.children[++n].toText();e.appendChild(new hy(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Xm.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Xm.escape(Tg(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class hy{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Xm.escape(this.toText())}toText(){return this.text}}var py={MathNode:uy,TextNode:hy,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":e>=-.05556&&e<=-.05555?" ⁣":e>=-.1667&&e<=-.1666?" ⁣":e>=-.2223&&e<=-.2222?" ⁣":e>=-.2778&&e<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Ag(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Ag(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:dy},_y=function(e,t,n){return!Gg[t][e]||!Gg[t][e].replace||55349===e.charCodeAt(0)||ab.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=Gg[t][e].replace),new py.TextNode(e)},fy=function(e){return 1===e.length?e[0]:new py.MathNode("mrow",e)},my=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var i=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var r=e.text;return Xm.contains(["\\imath","\\jmath"],r)?null:(Gg[i][r]&&Gg[i][r].replace&&(r=Gg[i][r].replace),gg(r,Db.fontMap[n].fontName,i)?Db.fontMap[n].variant:null)};function gy(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof hy&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof hy&&","===n.text}return!1}var by=function(e,t,n){if(1===e.length){var i=vy(e[0],t);return n&&i instanceof uy&&"mo"===i.type&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var r,s=[],o=0;o<e.length;o++){var a=vy(e[o],t);if(a instanceof uy&&r instanceof uy){if("mtext"===a.type&&"mtext"===r.type&&a.getAttribute("mathvariant")===r.getAttribute("mathvariant")){r.children.push(...a.children);continue}if("mn"===a.type&&"mn"===r.type){r.children.push(...a.children);continue}if(gy(a)&&"mn"===r.type){r.children.push(...a.children);continue}if("mn"===a.type&&gy(r))a.children=[...r.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===r.type||gy(r))){var l=a.children[0];l instanceof uy&&"mn"===l.type&&(l.children=[...r.children,...l.children],s.pop())}else if("mi"===r.type&&1===r.children.length){var c=r.children[0];if(c instanceof hy&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof hy&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),r=a}return s},yy=function(e,t,n){return fy(by(e,t,n))},vy=function(e,t){if(!e)return new py.MathNode("mrow");if(Vb[e.type])return Vb[e.type](e,t);throw new Gm("Got group of unknown type: '"+e.type+"'")};function wy(e,t,n,i,r){var s,o=by(e,n);s=1===o.length&&o[0]instanceof uy&&Xm.contains(["mrow","mtable"],o[0].type)?o[0]:new py.MathNode("mrow",o);var a=new py.MathNode("annotation",[new py.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new py.MathNode("semantics",[s,a]),c=new py.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),i&&c.setAttribute("display","block");var d=r?"katex":"katex-mathml";return Db.makeSpan([d],[c])}var xy=function(e){return new xg({style:e.displayMode?ag.DISPLAY:ag.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},ky=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Db.makeSpan(n,[e])}return e},Sy={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Cy={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},My=function(e,t,n,i,r){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(s=Db.makeSpan(["stretchy",t],[],r),"fbox"===t){var a=r.color&&r.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new qg({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new qg({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Bg(l,{width:"100%",height:Ag(o)});s=Db.makeSvgSpan([],[c],r)}return s.height=o,s.style.height=Ag(o),s},Ay=function(e){var t=new py.MathNode("mo",[new py.TextNode(Sy[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Ty=function(e,t){var{span:n,minWidth:i,height:r}=function(){var n=4e5,i=e.label.slice(1);if(Xm.contains(["widehat","widecheck","widetilde","utilde"],i)){var r,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===i||"widecheck"===i?(r=420,n=2364,o=.42,s=i+"4"):(r=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===i||"widecheck"===i?(n=[0,1062,2364,2364,2364][l],r=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=i+l):(n=[0,600,1033,2339,2340][l],r=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new jg(s),d=new Bg([c],{width:"100%",height:Ag(o),viewBox:"0 0 "+n+" "+r,preserveAspectRatio:"none"});return{span:Db.makeSvgSpan([],[d],t),minWidth:0,height:o}}var u,h,p,_=[],f=Cy[i],[m,g,b]=f,y=b/1e3,v=m.length;if(1===v)u=["hide-tail"],h=[f[3]];else if(2===v)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==v)throw new Error("Correct katexImagesData or update code here to support\n "+v+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<v;w++){var x=new jg(m[w]),k=new Bg([x],{width:"400em",height:Ag(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),S=Db.makeSvgSpan([u[w]],[k],t);if(1===v)return{span:S,minWidth:g,height:y};S.style.height=Ag(y),_.push(S)}return{span:Db.makeSpan(["stretchy"],_,t),minWidth:g,height:y}}();return n.height=r,n.style.height=Ag(r),i>0&&(n.style.minWidth=Ag(i)),n};function zy(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Py(e){var t=Ny(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Ny(e){return e&&("atom"===e.type||$g.hasOwnProperty(e.type))?e:null}var Ry=(e,t)=>{var n,i,r;e&&"supsub"===e.type?(n=(i=zy(e.base,"accent")).base,e.base=n,r=function(e){if(e instanceof Og)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(ay(e,t)),e.base=i):n=(i=zy(e,"accent")).base;var s=ay(n,t.havingCrampedStyle()),o=0;if(i.isShifty&&Xm.isCharacterBox(n)){var a=Xm.getBaseElem(n);o=Fg(ay(a,t.havingCrampedStyle())).skew}var l,c="\\c"===i.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(i.isStretchy)l=Ty(i,t),l=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Ag(2*o)+")",marginLeft:Ag(2*o)}:void 0}]},t);else{var u,h;"\\vec"===i.label?(u=Db.staticSvg("vec",t),h=Db.svgData.vec[1]):((u=Fg(u=Db.makeOrd({mode:i.mode,text:i.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),l=Db.makeSpan(["accent-body"],[u]);var p="\\textcircled"===i.label;p&&(l.classes.push("accent-full"),d=s.height);var _=o;p||(_-=h/2),l.style.left=Ag(_),"\\textcircled"===i.label&&(l.style.top=".2em"),l=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var f=Db.makeSpan(["mord","accent"],[l],t);return r?(r.children[0]=f,r.height=Math.max(f.height,r.height),r.classes[0]="mord",r):f},Oy=(e,t)=>{var n=e.isStretchy?Ay(e.label):new py.MathNode("mo",[_y(e.label,e.mode)]),i=new py.MathNode("mover",[vy(e.base,t),n]);return i.setAttribute("accent","true"),i},Ly=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ub({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Yb(t[0]),i=!Ly.test(e.funcName),r=!i||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:i,isShifty:r,base:n}},htmlBuilder:Ry,mathmlBuilder:Oy}),Ub({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],i=e.parser.mode;return"math"===i&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),i="text"),{type:"accent",mode:i,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Ry,mathmlBuilder:Oy}),Ub({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"accentUnder",mode:n.mode,label:i,base:r}},htmlBuilder:(e,t)=>{var n=ay(e.base,t),i=Ty(e,t),r="\\utilde"===e.label?.12:0,s=Db.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:r},{type:"elem",elem:n}]},t);return Db.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=Ay(e.label),i=new py.MathNode("munder",[vy(e.base,t),n]);return i.setAttribute("accentunder","true"),i}});var Ey=e=>{var t=new py.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ub({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i,funcName:r}=e;return{type:"xArrow",mode:i.mode,label:r,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,i=t.style,r=t.havingStyle(i.sup()),s=Db.wrapFragment(ay(e.body,r,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(r=t.havingStyle(i.sub()),(n=Db.wrapFragment(ay(e.below,r,t),t)).classes.push(o+"-arrow-pad"));var a,l=Ty(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((s.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=s.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else a=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),Db.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,i=Ay(e.label);if(i.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var r=Ey(vy(e.body,t));if(e.below){var s=Ey(vy(e.below,t));n=new py.MathNode("munderover",[i,s,r])}else n=new py.MathNode("mover",[i,r])}else if(e.below){var o=Ey(vy(e.below,t));n=new py.MathNode("munder",[i,o])}else n=Ey(),n=new py.MathNode("mover",[i,n]);return n}});var Iy=Db.makeSpan;function Dy(e,t){var n=ty(e.body,t,!0);return Iy([e.mclass],n,t)}function By(e,t){var n,i=by(e.body,t);return"minner"===e.mclass?n=new py.MathNode("mpadded",i):"mord"===e.mclass?e.isCharacterBox?(n=i[0]).type="mi":n=new py.MathNode("mi",i):(e.isCharacterBox?(n=i[0]).type="mo":n=new py.MathNode("mo",i),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ub({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+i.slice(5),body:Xb(r),isCharacterBox:Xm.isCharacterBox(r)}},htmlBuilder:Dy,mathmlBuilder:By});var jy=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};Ub({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:jy(t[0]),body:Xb(t[1]),isCharacterBox:Xm.isCharacterBox(t[1])}}}),Ub({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:i,funcName:r}=e,s=t[1],o=t[0];n="\\stackrel"!==r?jy(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==r,body:Xb(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===r?null:o,sub:"\\underset"===r?o:null};return{type:"mclass",mode:i.mode,mclass:n,body:[l],isCharacterBox:Xm.isCharacterBox(l)}},htmlBuilder:Dy,mathmlBuilder:By}),Ub({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:jy(t[0]),body:Xb(t[0])}},htmlBuilder(e,t){var n=ty(e.body,t,!0),i=Db.makeSpan([e.mclass],n,t);return i.style.textShadow="0.02em 0.01em 0.04px",i},mathmlBuilder(e,t){var n=by(e.body,t),i=new py.MathNode("mstyle",n);return i.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),i}});var qy={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Fy=()=>({type:"styling",body:[],mode:"math",style:"display"}),Hy=e=>"textord"===e.type&&"@"===e.text,$y=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function Gy(e,t,n){var i=qy[e];switch(i){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(i,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var r={type:"atom",text:i,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[r],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[s],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}Ub({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"cdlabel",mode:n.mode,side:i.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),i=Db.wrapFragment(ay(e.label,n,t),t);return i.classes.push("cd-label-"+e.side),i.style.bottom=Ag(.8-i.depth),i.height=0,i.depth=0,i},mathmlBuilder(e,t){var n=new py.MathNode("mrow",[vy(e.label,t)]);return(n=new py.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new py.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Ub({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Db.wrapFragment(ay(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new py.MathNode("mrow",[vy(e.fragment,t)])}),Ub({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,i=zy(t[0],"ordgroup").body,r="",s=0;s<i.length;s++){r+=zy(i[s],"textord").text}var o,a=parseInt(r);if(isNaN(a))throw new Gm("\\@char has non-numeric argument "+r);if(a<0||a>=1114111)throw new Gm("\\@char with invalid code point "+r);return a<=65535?o=String.fromCharCode(a):(a-=65536,o=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:o}}});var Vy=(e,t)=>{var n=ty(e.body,t.withColor(e.color),!1);return Db.makeFragment(n)},Uy=(e,t)=>{var n=by(e.body,t.withColor(e.color)),i=new py.MathNode("mstyle",n);return i.setAttribute("mathcolor",e.color),i};Ub({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,i=zy(t[0],"color-token").color,r=t[1];return{type:"color",mode:n.mode,color:i,body:Xb(r)}},htmlBuilder:Vy,mathmlBuilder:Uy}),Ub({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:i}=e,r=zy(t[0],"color-token").color;n.gullet.macros.set("\\current@color",r);var s=n.parseExpression(!0,i);return{type:"color",mode:n.mode,color:r,body:s}},htmlBuilder:Vy,mathmlBuilder:Uy}),Ub({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:i}=e,r="["===i.gullet.future().text?i.parseSizeGroup(!0):null,s=!i.settings.displayMode||!i.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:i.mode,newLine:s,size:r&&zy(r,"size").value}},htmlBuilder(e,t){var n=Db.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Ag(Mg(e.size,t)))),n},mathmlBuilder(e,t){var n=new py.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Ag(Mg(e.size,t)))),n}});var Wy={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Yy=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Gm("Expected a control sequence",e);return t},Xy=(e,t,n,i)=>{var r=e.gullet.macros.get(n.text);null==r&&(n.noexpand=!0,r={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,r,i)};Ub({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var i=t.fetch();if(Wy[i.text])return"\\global"!==n&&"\\\\globallong"!==n||(i.text=Wy[i.text]),zy(t.parseFunction(),"internal");throw new Gm("Invalid token after macro prefix",i)}}),Ub({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=t.gullet.popToken(),r=i.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r))throw new Gm("Expected a control sequence",i);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(i=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(i=t.gullet.popToken(),!/^[1-9]$/.test(i.text))throw new Gm('Invalid argument number "'+i.text+'"');if(parseInt(i.text)!==o+1)throw new Gm('Argument number "'+i.text+'" out of order');o++,a.push([])}else{if("EOF"===i.text)throw new Gm("Expected a macro definition");a[o].push(i.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(r,{tokens:l,numArgs:o,delimiters:a},n===Wy[n]),{type:"internal",mode:t.mode}}}),Ub({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=Yy(t.gullet.popToken());t.gullet.consumeSpaces();var r=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return Xy(t,i,r,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Ub({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,i=Yy(t.gullet.popToken()),r=t.gullet.popToken(),s=t.gullet.popToken();return Xy(t,i,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(r),{type:"internal",mode:t.mode}}});var Ky=function(e,t,n){var i=gg(Gg.math[e]&&Gg.math[e].replace||e,t,n);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},Jy=function(e,t,n,i){var r=n.havingBaseStyle(t),s=Db.makeSpan(i.concat(r.sizingClasses(n)),[e],n),o=r.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=r.sizeMultiplier,s},Qy=function(e,t,n){var i=t.havingBaseStyle(n),r=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Ag(r),e.height-=r,e.depth+=r},Zy=function(e,t,n,i,r,s){var o=function(e,t,n,i){return Db.makeSymbol(e,"Size"+t+"-Regular",n,i)}(e,t,r,i),a=Jy(Db.makeSpan(["delimsizing","size"+t],[o],i),ag.TEXT,i,s);return n&&Qy(a,i,ag.TEXT),a},ev=function(e,t,n){var i;return i="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Db.makeSpan(["delimsizinginner",i],[Db.makeSpan([],[Db.makeSymbol(e,t,n)])])}},tv=function(e,t,n){var i=_g["Size4-Regular"][e.charCodeAt(0)]?_g["Size4-Regular"][e.charCodeAt(0)][4]:_g["Size1-Regular"][e.charCodeAt(0)][4],r=new jg("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new Bg([r],{width:Ag(i),height:Ag(t),style:"width:"+Ag(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Db.makeSvgSpan([],[s],n);return o.height=t,o.style.height=Ag(t),o.style.width=Ag(i),{type:"elem",elem:o}},nv={type:"kern",size:-.008},iv=["|","\\lvert","\\rvert","\\vert"],rv=["\\|","\\lVert","\\rVert","\\Vert"],sv=function(e,t,n,i,r,s){var o,a,l,c,d="",u=0;o=l=c=e,a=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):Xm.contains(iv,e)?(l="∣",d="vert",u=333):Xm.contains(rv,e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=Ky(o,h,r),_=p.height+p.depth,f=Ky(l,h,r),m=f.height+f.depth,g=Ky(c,h,r),b=g.height+g.depth,y=0,v=1;if(null!==a){var w=Ky(a,h,r);y=w.height+w.depth,v=2}var x=_+b+y,k=x+Math.max(0,Math.ceil((t-x)/(v*m)))*v*m,S=i.fontMetrics().axisHeight;n&&(S*=i.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var A=k-_-b,T=Math.round(1e3*k),z=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*A)),P=new jg(d,z),N=(u/1e3).toFixed(3)+"em",R=(T/1e3).toFixed(3)+"em",O=new Bg([P],{width:N,height:R,viewBox:"0 0 "+u+" "+T}),L=Db.makeSvgSpan([],[O],i);L.height=T/1e3,L.style.width=N,L.style.height=R,M.push({type:"elem",elem:L})}else{if(M.push(ev(c,h,r)),M.push(nv),null===a){var E=k-_-b+.016;M.push(tv(l,E,i))}else{var I=(k-_-b-y)/2+.016;M.push(tv(l,I,i)),M.push(nv),M.push(ev(a,h,r)),M.push(nv),M.push(tv(l,I,i))}M.push(nv),M.push(ev(o,h,r))}var D=i.havingBaseStyle(ag.TEXT),B=Db.makeVList({positionType:"bottom",positionData:C,children:M},D);return Jy(Db.makeSpan(["delimsizing","mult"],[B],D),ag.TEXT,i,s)},ov=.08,av=function(e,t,n,i,r){var s=function(e,t,n){t*=1e3;var i="";switch(e){case"sqrtMain":i=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,ug);break;case"sqrtSize1":i=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,ug);break;case"sqrtSize2":i=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,ug);break;case"sqrtSize3":i=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,ug);break;case"sqrtSize4":i=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,ug);break;case"sqrtTall":i=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,ug,n)}return i}(e,i,n),o=new jg(e,s),a=new Bg([o],{width:"400em",height:Ag(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Db.makeSvgSpan(["hide-tail"],[a],r)},lv=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],cv=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],dv=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],uv=[0,1.2,1.8,2.4,3],hv=[{type:"small",style:ag.SCRIPTSCRIPT},{type:"small",style:ag.SCRIPT},{type:"small",style:ag.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],pv=[{type:"small",style:ag.SCRIPTSCRIPT},{type:"small",style:ag.SCRIPT},{type:"small",style:ag.TEXT},{type:"stack"}],_v=[{type:"small",style:ag.SCRIPTSCRIPT},{type:"small",style:ag.SCRIPT},{type:"small",style:ag.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],fv=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},mv=function(e,t,n,i){for(var r=Math.min(2,3-i.style.size);r<n.length&&"stack"!==n[r].type;r++){var s=Ky(e,fv(n[r]),"math"),o=s.height+s.depth;if("small"===n[r].type&&(o*=i.havingBaseStyle(n[r].style).sizeMultiplier),o>t)return n[r]}return n[n.length-1]},gv=function(e,t,n,i,r,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=Xm.contains(dv,e)?hv:Xm.contains(lv,e)?_v:pv;var a=mv(e,t,o,i);return"small"===a.type?function(e,t,n,i,r,s){var o=Db.makeSymbol(e,"Main-Regular",r,i),a=Jy(o,t,i,s);return n&&Qy(a,i,t),a}(e,a.style,n,i,r,s):"large"===a.type?Zy(e,a.size,n,i,r,s):sv(e,t,n,i,r,s)},bv={sqrtImage:function(e,t){var n,i,r=t.havingBaseSizing(),s=mv("\\surd",e*r.sizeMultiplier,_v,r),o=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,d=0;return"small"===s.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+a)/o,(n=av("sqrtMain",l=(1+a+ov)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",i=.833/o):"large"===s.type?(d=1080*uv[s.size],c=(uv[s.size]+a)/o,l=(uv[s.size]+a+ov)/o,(n=av("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",i=1/o):(l=e+a+ov,c=e+a,d=Math.floor(1e3*e+a)+80,(n=av("sqrtTall",l,d,a,t)).style.minWidth="0.742em",i=1.056),n.height=c,n.style.height=Ag(l),{span:n,advanceWidth:i,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,i,r){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),Xm.contains(lv,e)||Xm.contains(dv,e))return Zy(e,t,!1,n,i,r);if(Xm.contains(cv,e))return sv(e,uv[t],!1,n,i,r);throw new Gm("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:uv,customSizedDelim:gv,leftRightDelim:function(e,t,n,i,r,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,a=5/i.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return gv(e,c,!0,i,r,s)}},yv={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},vv=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function wv(e,t){var n=Ny(e);if(n&&Xm.contains(vv,n.text))return n;throw new Gm(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function xv(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ub({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=wv(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:yv[e.funcName].size,mclass:yv[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Db.makeSpan([e.mclass]):bv.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(_y(e.delim,e.mode));var n=new py.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var i=Ag(bv.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",i),n.setAttribute("maxsize",i),n}}),Ub({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Gm("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:wv(t[0],e).text,color:n}}}),Ub({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=wv(t[0],e),i=e.parser;++i.leftrightDepth;var r=i.parseExpression(!1);--i.leftrightDepth,i.expect("\\right",!1);var s=zy(i.parseFunction(),"leftright-right");return{type:"leftright",mode:i.mode,body:r,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{xv(e);for(var n,i,r=ty(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<r.length;l++)r[l].isMiddle?a=!0:(s=Math.max(r[l].height,s),o=Math.max(r[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?oy(t,["mopen"]):bv.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),r.unshift(n),a)for(var c=1;c<r.length;c++){var d=r[c].isMiddle;d&&(r[c]=bv.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)i=oy(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;i=bv.leftRightDelim(e.right,s,o,u,e.mode,["mclose"])}return r.push(i),Db.makeSpan(["minner"],r,t)},mathmlBuilder:(e,t)=>{xv(e);var n=by(e.body,t);if("."!==e.left){var i=new py.MathNode("mo",[_y(e.left,e.mode)]);i.setAttribute("fence","true"),n.unshift(i)}if("."!==e.right){var r=new py.MathNode("mo",[_y(e.right,e.mode)]);r.setAttribute("fence","true"),e.rightColor&&r.setAttribute("mathcolor",e.rightColor),n.push(r)}return fy(n)}}),Ub({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=wv(t[0],e);if(!e.parser.leftrightDepth)throw new Gm("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=oy(t,[]);else{n=bv.sizedDelim(e.delim,1,t,e.mode,[]);var i={delim:e.delim,options:t};n.isMiddle=i}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?_y("|","text"):_y(e.delim,e.mode),i=new py.MathNode("mo",[n]);return i.setAttribute("fence","true"),i.setAttribute("lspace","0.05em"),i.setAttribute("rspace","0.05em"),i}});var kv=(e,t)=>{var n,i,r,s=Db.wrapFragment(ay(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=Xm.isCharacterBox(e.body);if("sout"===o)(n=Db.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=Mg({number:.6,unit:"pt"},t),u=Mg({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=s.height+s.depth+d+u;s.style.paddingLeft=Ag(h/2+d);var p=Math.floor(1e3*h*a),_="M400000 "+(i=p)+" H0 L"+i/2+" 0 l65 45 L145 "+(i-80)+" H400000z",f=new Bg([new jg("phase",_)],{width:"400em",height:Ag(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=Db.makeSvgSpan(["hide-tail"],[f],t)).style.height=Ag(h),l=s.depth+d+u}else{/cancel/.test(o)?c||s.classes.push("cancel-pad"):"angl"===o?s.classes.push("anglpad"):s.classes.push("boxpad");var m=0,g=0,b=0;/box/.test(o)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=m=t.fontMetrics().fboxsep+("colorbox"===o?0:b)):"angl"===o?(m=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-s.depth)):g=m=c?.2:0,n=My(s,o,m,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=Ag(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=Ag(b),n.style.borderRightWidth=Ag(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var y=/cancel|phase/.test(o)?["svg-align"]:[];r=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:y}]},t)}return/cancel/.test(o)&&(r.height=s.height,r.depth=s.depth),/cancel/.test(o)&&!c?Db.makeSpan(["mord","cancel-lap"],[r],t):Db.makeSpan(["mord"],[r],t)},Sv=(e,t)=>{var n=0,i=new py.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[vy(e.body,t)]);switch(e.label){case"\\cancel":i.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":i.setAttribute("notation","downdiagonalstrike");break;case"\\phase":i.setAttribute("notation","phasorangle");break;case"\\sout":i.setAttribute("notation","horizontalstrike");break;case"\\fbox":i.setAttribute("notation","box");break;case"\\angl":i.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,i.setAttribute("width","+"+2*n+"pt"),i.setAttribute("height","+"+2*n+"pt"),i.setAttribute("lspace",n+"pt"),i.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);i.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":i.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&i.setAttribute("mathbackground",e.backgroundColor),i};Ub({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,s=zy(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:i.mode,label:r,backgroundColor:s,body:o}},htmlBuilder:kv,mathmlBuilder:Sv}),Ub({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:i,funcName:r}=e,s=zy(t[0],"color-token").color,o=zy(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:i.mode,label:r,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:kv,mathmlBuilder:Sv}),Ub({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),Ub({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"enclose",mode:n.mode,label:i,body:r}},htmlBuilder:kv,mathmlBuilder:Sv}),Ub({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Cv={};function Mv(e){for(var{type:t,names:n,props:i,handler:r,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:i.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:r},l=0;l<n.length;++l)Cv[n[l]]=a;s&&(Gb[t]=s),o&&(Vb[t]=o)}var Av={};function Tv(e,t){Av[e]=t}function zv(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Pv=e=>{if(!e.parser.settings.displayMode)throw new Gm("{"+e.envName+"} can be used only in display mode.")};function Nv(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Rv(e,t,n){var{hskipBeforeAndAfter:i,addJot:r,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new Gm("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var _=[],f=[_],m=[],g=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function v(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new $m("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),g.push(zv(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),_.push(w);var x=e.fetch().text;if("&"===x){if(u&&_.length===u){if(c||a)throw new Gm("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){v(),1===_.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!d)&&f.pop(),g.length<f.length+1&&g.push([]);break}if("\\\\"!==x)throw new Gm("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),m.push(k?k.value:null),v(),g.push(zv(e)),_=[],f.push(_),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:r,arraystretch:o,body:f,cols:s,rowGaps:m,hskipBeforeAndAfter:i,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:h}}function Ov(e){return"d"===e.slice(0,1)?"display":"text"}var Lv=function(e,t){var n,i,r=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(r),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(ag.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?Mg({number:3,unit:"ex"},t):12*d,p=3*d,_=e.arraystretch*h,f=.7*_,m=.3*_,g=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(g+=.25),l.push({pos:g,isDashed:e[t]})}for(b(s[0]),n=0;n<e.body.length;++n){var y=e.body[n],v=f,w=m;o<y.length&&(o=y.length);var x=new Array(y.length);for(i=0;i<y.length;++i){var k=ay(y[i],t);w<k.depth&&(w=k.depth),v<k.height&&(v=k.height),x[i]=k}var S=e.rowGaps[n],C=0;S&&(C=Mg(S,t))>0&&(w<(C+=m)&&(w=C),C=0),e.addJot&&(w+=p),x.height=v,x.depth=w,g+=v,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,A,T=g/2+t.fontMetrics().axisHeight,z=e.cols||[],P=[],N=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<r;++n){var R=a[n],O=R.pos-T,L=e.tags[n],E=void 0;(E=!0===L?Db.makeSpan(["eqn-num"],[],t):!1===L?Db.makeSpan([],[],t):Db.makeSpan([],ty(L,t,!0),t)).depth=R.depth,E.height=R.height,N.push({type:"elem",elem:E,shift:O})}for(i=0,A=0;i<o||A<z.length;++i,++A){for(var I=z[A]||{},D=!0;"separator"===I.type;){if(D||((M=Db.makeSpan(["arraycolsep"],[])).style.width=Ag(t.fontMetrics().doubleRuleSep),P.push(M)),"|"!==I.separator&&":"!==I.separator)throw new Gm("Invalid separator type: "+I.separator);var B="|"===I.separator?"solid":"dashed",j=Db.makeSpan(["vertical-separator"],[],t);j.style.height=Ag(g),j.style.borderRightWidth=Ag(c),j.style.borderRightStyle=B,j.style.margin="0 "+Ag(-c/2);var q=g-T;q&&(j.style.verticalAlign=Ag(-q)),P.push(j),I=z[++A]||{},D=!1}if(!(i>=o)){var F=void 0;(i>0||e.hskipBeforeAndAfter)&&0!==(F=Xm.deflt(I.pregap,u))&&((M=Db.makeSpan(["arraycolsep"],[])).style.width=Ag(F),P.push(M));var H=[];for(n=0;n<r;++n){var $=a[n],G=$[i];if(G){var V=$.pos-T;G.depth=$.depth,G.height=$.height,H.push({type:"elem",elem:G,shift:V})}}H=Db.makeVList({positionType:"individualShift",children:H},t),H=Db.makeSpan(["col-align-"+(I.align||"c")],[H]),P.push(H),(i<o-1||e.hskipBeforeAndAfter)&&0!==(F=Xm.deflt(I.postgap,u))&&((M=Db.makeSpan(["arraycolsep"],[])).style.width=Ag(F),P.push(M))}}if(a=Db.makeSpan(["mtable"],P),l.length>0){for(var U=Db.makeLineSpan("hline",t,c),W=Db.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:a,shift:0}];l.length>0;){var X=l.pop(),K=X.pos-T;X.isDashed?Y.push({type:"elem",elem:W,shift:K}):Y.push({type:"elem",elem:U,shift:K})}a=Db.makeVList({positionType:"individualShift",children:Y},t)}if(0===N.length)return Db.makeSpan(["mord"],[a],t);var J=Db.makeVList({positionType:"individualShift",children:N},t);return J=Db.makeSpan(["tag"],[J],t),Db.makeFragment([a,J])},Ev={c:"center ",l:"left ",r:"right "},Iv=function(e,t){for(var n=[],i=new py.MathNode("mtd",[],["mtr-glue"]),r=new py.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],a=[],l=0;l<o.length;l++)a.push(new py.MathNode("mtd",[vy(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(i),a.push(i),e.leqno?a.unshift(r):a.push(r)),n.push(new py.MathNode("mtr",a))}var c=new py.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Ag(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,_="",f=!1,m=0,g=p.length;"separator"===p[0].type&&(u+="top ",m=1),"separator"===p[p.length-1].type&&(u+="bottom ",g-=1);for(var b=m;b<g;b++)"align"===p[b].type?(h+=Ev[p[b].align],f&&(_+="none "),f=!0):"separator"===p[b].type&&f&&(_+="|"===p[b].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(_)&&c.setAttribute("columnlines",_.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],v="",w=1;w<y.length;w++)v+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",v.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;u+=k[0].length>0?"left ":"",u+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==u&&(c=new py.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new py.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},Dv=function(e,t){-1===e.envName.indexOf("ed")&&Pv(e);var n,i=[],r=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=Rv(e.parser,{cols:i,addJot:!0,autoTag:s?void 0:Nv(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++){c+=zy(t[0].body[d],"textord").text}n=Number(c),a=2*n}var u=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var i=zy(e[t],"styling");zy(i.body[0],"ordgroup").body.unshift(l)}if(u)a<e.length&&(a=e.length);else{var r=e.length/2;if(n<r)throw new Gm("Too many math in a row: expected "+n+", but got "+r,e[0])}});for(var h=0;h<a;++h){var p="r",_=0;h%2==1?p="l":h>0&&u&&(_=1),i[h]={type:"align",align:p,pregap:_,postgap:0}}return o.colSeparationType=u?"align":"alignat",o};Mv({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Ny(t[0])?[t[0]]:zy(t[0],"ordgroup").body).map(function(e){var t=Py(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new Gm("Unknown column alignment: "+t,e)}),i={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Rv(e.parser,i,Ov(e.envName))},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",i={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var r=e.parser;if(r.consumeSpaces(),"["===r.fetch().text){if(r.consume(),r.consumeSpaces(),n=r.fetch().text,-1==="lcr".indexOf(n))throw new Gm("Expected l or c or r",r.nextToken);r.consume(),r.consumeSpaces(),r.expect("]"),r.consume(),i.cols=[{type:"align",align:n}]}}var s=Rv(e.parser,i,Ov(e.envName)),o=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Rv(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Ny(t[0])?[t[0]]:zy(t[0],"ordgroup").body).map(function(e){var t=Py(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new Gm("Unknown column alignment: "+t,e)});if(n.length>1)throw new Gm("{subarray} can contain only one column");var i={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((i=Rv(e.parser,i,"script")).body.length>0&&i.body[0].length>1)throw new Gm("{subarray} can contain only one column");return i},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Rv(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Ov(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Dv,htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Xm.contains(["gather","gather*"],e.envName)&&Pv(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Nv(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Rv(e.parser,t,"display")},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Dv,htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Pv(e);var t={autoTag:Nv(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Rv(e.parser,t,"display")},htmlBuilder:Lv,mathmlBuilder:Iv}),Mv({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Pv(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Gm("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var i=[],r=[i],s=0;s<t.length;s++){for(var o=t[s],a=Fy(),l=0;l<o.length;l++)if(Hy(o[l])){i.push(a);var c=Py(o[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new Gm('Expected one of "<>AV=|." after @',o[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<o.length;p++){if($y(o[p],c)){h=!1,l=p;break}if(Hy(o[p]))throw new Gm("Missing a "+c+" character to complete a CD arrow.",o[p]);d[u].body.push(o[p])}if(h)throw new Gm("Missing a "+c+" character to complete a CD arrow.",o[l])}}var _={type:"styling",body:[Gy(c,d,e)],mode:"math",style:"display"};i.push(_),a=Fy()}else a.body.push(o[l]);s%2==0?i.push(a):i.shift(),i=[],r.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:r,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(r[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(r.length+1).fill([])}}(e.parser)),htmlBuilder:Lv,mathmlBuilder:Iv}),Tv("\\nonumber","\\gdef\\@eqnsw{0}"),Tv("\\notag","\\nonumber"),Ub({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Gm(e.funcName+" valid only within array environment")}});var Bv=Cv;Ub({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];if("ordgroup"!==r.type)throw new Gm("Invalid environment name",r);for(var s="",o=0;o<r.body.length;++o)s+=zy(r.body[o],"textord").text;if("\\begin"===i){if(!Bv.hasOwnProperty(s))throw new Gm("No such environment: "+s,r);var a=Bv[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},u=a.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=zy(n.parseFunction(),"environment");if(p.name!==s)throw new Gm("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:s,nameGroup:r}}});var jv=(e,t)=>{var n=e.font,i=t.withFont(n);return ay(e.body,i)},qv=(e,t)=>{var n=e.font,i=t.withFont(n);return vy(e.body,i)},Fv={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ub({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=Yb(t[0]),s=i;return s in Fv&&(s=Fv[s]),{type:"font",mode:n.mode,font:s.slice(1),body:r}},htmlBuilder:jv,mathmlBuilder:qv}),Ub({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,i=t[0],r=Xm.isCharacterBox(i);return{type:"mclass",mode:n.mode,mclass:jy(i),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:i}],isCharacterBox:r}}}),Ub({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i,breakOnTokenText:r}=e,{mode:s}=n,o=n.parseExpression(!0,r);return{type:"font",mode:s,font:"math"+i.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:jv,mathmlBuilder:qv});var Hv=(e,t)=>{var n=t;return"display"===e?n=n.id>=ag.SCRIPT.id?n.text():ag.DISPLAY:"text"===e&&n.size===ag.DISPLAY.size?n=ag.TEXT:"script"===e?n=ag.SCRIPT:"scriptscript"===e&&(n=ag.SCRIPTSCRIPT),n},$v=(e,t)=>{var n,i=Hv(e.size,t.style),r=i.fracNum(),s=i.fracDen();n=t.havingStyle(r);var o=ay(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}n=t.havingStyle(s);var c,d,u,h,p,_,f,m,g,b,y=ay(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=Mg(e.barSize,t),c=Db.makeLineSpan("frac-line",t,d)):c=Db.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),i.size===ag.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,_=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),_=t.fontMetrics().denom2),c){var v=t.fontMetrics().axisHeight;h-o.depth-(v+.5*d)<p&&(h+=p-(h-o.depth-(v+.5*d))),v-.5*d-(y.height-_)<p&&(_+=p-(v-.5*d-(y.height-_)));var w=-(v-.5*d);f=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:_},{type:"elem",elem:c,shift:w},{type:"elem",elem:o,shift:-h}]},t)}else{var x=h-o.depth-(y.height-_);x<p&&(h+=.5*(p-x),_+=.5*(p-x)),f=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:_},{type:"elem",elem:o,shift:-h}]},t)}return n=t.havingStyle(i),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,m=i.size===ag.DISPLAY.size?t.fontMetrics().delim1:i.size===ag.SCRIPTSCRIPT.size?t.havingStyle(ag.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?oy(t,["mopen"]):bv.customSizedDelim(e.leftDelim,m,!0,t.havingStyle(i),e.mode,["mopen"]),b=e.continued?Db.makeSpan([]):null==e.rightDelim?oy(t,["mclose"]):bv.customSizedDelim(e.rightDelim,m,!0,t.havingStyle(i),e.mode,["mclose"]),Db.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,Db.makeSpan(["mfrac"],[f]),b],t)},Gv=(e,t)=>{var n=new py.MathNode("mfrac",[vy(e.numer,t),vy(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var i=Mg(e.barSize,t);n.setAttribute("linethickness",Ag(i))}}else n.setAttribute("linethickness","0px");var r=Hv(e.size,t.style);if(r.size!==t.style.size){n=new py.MathNode("mstyle",[n]);var s=r.size===ag.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var a=new py.MathNode("mo",[new py.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new py.MathNode("mo",[new py.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return fy(o)}return n};Ub({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:i,funcName:r}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:i.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:$v,mathmlBuilder:Gv}),Ub({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:r,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Ub({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:i,token:r}=e;switch(i){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:r}}});var Vv=["display","text","script","scriptscript"],Uv=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Ub({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:i}=e,r=t[4],s=t[5],o=Yb(t[0]),a="atom"===o.type&&"open"===o.family?Uv(o.text):null,l=Yb(t[1]),c="atom"===l.type&&"close"===l.family?Uv(l.text):null,d=zy(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var _=zy(p.body[0],"textord");h=Vv[Number(_.text)]}}else p=zy(p,"textord"),h=Vv[Number(p.text)];return{type:"genfrac",mode:i.mode,numer:r,denom:s,continued:!1,hasBarLine:n,barSize:u,leftDelim:a,rightDelim:c,size:h}},htmlBuilder:$v,mathmlBuilder:Gv}),Ub({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:i,token:r}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:zy(t[0],"size").value,token:r}}}),Ub({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(zy(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:$v,mathmlBuilder:Gv});var Wv=(e,t)=>{var n,i,r=t.style;"supsub"===e.type?(n=e.sup?ay(e.sup,t.havingStyle(r.sup()),t):ay(e.sub,t.havingStyle(r.sub()),t),i=zy(e.base,"horizBrace")):i=zy(e,"horizBrace");var s,o=ay(i.base,t.havingBaseStyle(ag.DISPLAY)),a=Ty(i,t);if(i.isOver?(s=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=Db.makeVList({positionType:"bottom",positionData:o.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=Db.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t);s=i.isOver?Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Db.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Db.makeSpan(["mord",i.isOver?"mover":"munder"],[s],t)};Ub({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:i}=e;return{type:"horizBrace",mode:n.mode,label:i,isOver:/^\\over/.test(i),base:t[0]}},htmlBuilder:Wv,mathmlBuilder:(e,t)=>{var n=Ay(e.label);return new py.MathNode(e.isOver?"mover":"munder",[vy(e.base,t),n])}}),Ub({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[1],r=zy(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:r})?{type:"href",mode:n.mode,href:r,body:Xb(i)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=ty(e.body,t,!1);return Db.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=yy(e.body,t);return n instanceof uy||(n=new uy("mrow",[n])),n.setAttribute("href",e.href),n}}),Ub({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=zy(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:i}))return n.formatUnsupportedCmd("\\url");for(var r=[],s=0;s<i.length;s++){var o=i[s];"~"===o&&(o="\\textasciitilde"),r.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:r};return{type:"href",mode:n.mode,href:i,body:Xb(a)}}}),Ub({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Xb(t[0])}},htmlBuilder(e,t){var n=ty(e.body,t,!1);return Db.makeFragment(n)},mathmlBuilder:(e,t)=>new py.MathNode("mrow",by(e.body,t))}),Ub({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:i,funcName:r,token:s}=e,o=zy(t[0],"raw").string,a=t[1];i.settings.strict&&i.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(r){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),d=0;d<c.length;d++){var u=c[d].split("=");if(2!==u.length)throw new Gm("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return i.settings.isTrusted(n)?{type:"html",mode:i.mode,attributes:l,body:Xb(a)}:i.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=ty(e.body,t,!1),i=["enclosing"];e.attributes.class&&i.push(...e.attributes.class.trim().split(/\s+/));var r=Db.makeSpan(i,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&r.setAttribute(s,e.attributes[s]);return r},mathmlBuilder:(e,t)=>yy(e.body,t)}),Ub({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Xb(t[0]),mathml:Xb(t[1])}},htmlBuilder:(e,t)=>{var n=ty(e.html,t,!1);return Db.makeFragment(n)},mathmlBuilder:(e,t)=>yy(e.mathml,t)});var Yv=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Gm("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Cg(n))throw new Gm("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Ub({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:i}=e,r={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=zy(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":a=u;break;case"width":r=Yv(u);break;case"height":s=Yv(u);break;case"totalheight":o=Yv(u);break;default:throw new Gm("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=zy(t[0],"url").url;return""===a&&(a=(a=(a=h).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),i.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:i.mode,alt:a,width:r,height:s,totalheight:o,src:h}:i.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Mg(e.height,t),i=0;e.totalheight.number>0&&(i=Mg(e.totalheight,t)-n);var r=0;e.width.number>0&&(r=Mg(e.width,t));var s={height:Ag(n+i)};r>0&&(s.width=Ag(r)),i>0&&(s.verticalAlign=Ag(-i));var o=new Eg(e.src,e.alt,s);return o.height=n,o.depth=i,o},mathmlBuilder:(e,t)=>{var n=new py.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var i=Mg(e.height,t),r=0;if(e.totalheight.number>0&&(r=Mg(e.totalheight,t)-i,n.setAttribute("valign",Ag(-r))),n.setAttribute("height",Ag(i+r)),e.width.number>0){var s=Mg(e.width,t);n.setAttribute("width",Ag(s))}return n.setAttribute("src",e.src),n}}),Ub({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=zy(t[0],"size");if(n.settings.strict){var s="m"===i[1],o="mu"===r.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" supports only mu units, not "+r.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+i+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:r.value}},htmlBuilder:(e,t)=>Db.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=Mg(e.dimension,t);return new py.SpaceNode(n)}}),Ub({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"lap",mode:n.mode,alignment:i.slice(5),body:r}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Db.makeSpan([],[ay(e.body,t)]),n=Db.makeSpan(["inner"],[n],t)):n=Db.makeSpan(["inner"],[ay(e.body,t)]);var i=Db.makeSpan(["fix"],[]),r=Db.makeSpan([e.alignment],[n,i],t),s=Db.makeSpan(["strut"]);return s.style.height=Ag(r.height+r.depth),r.depth&&(s.style.verticalAlign=Ag(-r.depth)),r.children.unshift(s),r=Db.makeSpan(["thinbox"],[r],t),Db.makeSpan(["mord","vbox"],[r],t)},mathmlBuilder:(e,t)=>{var n=new py.MathNode("mpadded",[vy(e.body,t)]);if("rlap"!==e.alignment){var i="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",i+"width")}return n.setAttribute("width","0px"),n}}),Ub({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:i}=e,r=i.mode;i.switchMode("math");var s="\\("===n?"\\)":"$",o=i.parseExpression(!1,s);return i.expect(s),i.switchMode(r),{type:"styling",mode:i.mode,style:"text",body:o}}}),Ub({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Gm("Mismatched "+e.funcName)}});var Xv=(e,t)=>{switch(t.style.size){case ag.DISPLAY.size:return e.display;case ag.TEXT.size:return e.text;case ag.SCRIPT.size:return e.script;case ag.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ub({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Xb(t[0]),text:Xb(t[1]),script:Xb(t[2]),scriptscript:Xb(t[3])}},htmlBuilder:(e,t)=>{var n=Xv(e,t),i=ty(n,t,!1);return Db.makeFragment(i)},mathmlBuilder:(e,t)=>{var n=Xv(e,t);return yy(n,t)}});var Kv=(e,t,n,i,r,s,o)=>{e=Db.makeSpan([],[e]);var a,l,c,d=n&&Xm.isCharacterBox(n);if(t){var u=ay(t,i.havingStyle(r.sup()),i);l={elem:u,kern:Math.max(i.fontMetrics().bigOpSpacing1,i.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=ay(n,i.havingStyle(r.sub()),i);a={elem:h,kern:Math.max(i.fontMetrics().bigOpSpacing2,i.fontMetrics().bigOpSpacing4-h.height)}}if(l&&a){var p=i.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=Db.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Ag(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Ag(s)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}else if(a){var _=e.height-o;c=Db.makeVList({positionType:"top",positionData:_,children:[{type:"kern",size:i.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Ag(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},i)}else{if(!l)return e;var f=e.depth+o;c=Db.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Ag(s)},{type:"kern",size:i.fontMetrics().bigOpSpacing5}]},i)}var m=[c];if(a&&0!==s&&!d){var g=Db.makeSpan(["mspace"],[],i);g.style.marginRight=Ag(s),m.unshift(g)}return Db.makeSpan(["mop","op-limits"],m,i)},Jv=["\\smallint"],Qv=(e,t)=>{var n,i,r,s=!1;"supsub"===e.type?(n=e.sup,i=e.sub,r=zy(e.base,"op"),s=!0):r=zy(e,"op");var o,a=t.style,l=!1;if(a.size===ag.DISPLAY.size&&r.symbol&&!Xm.contains(Jv,r.name)&&(l=!0),r.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==r.name&&"\\oiiint"!==r.name||(d=r.name.slice(1),r.name="oiint"===d?"\\iint":"\\iiint"),o=Db.makeSymbol(r.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var u=o.italic,h=Db.staticSvg(d+"Size"+(l?"2":"1"),t);o=Db.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),r.name="\\"+d,o.classes.unshift("mop"),o.italic=u}}else if(r.body){var p=ty(r.body,t,!0);1===p.length&&p[0]instanceof Dg?(o=p[0]).classes[0]="mop":o=Db.makeSpan(["mop"],p,t)}else{for(var _=[],f=1;f<r.name.length;f++)_.push(Db.mathsym(r.name[f],r.mode,t));o=Db.makeSpan(["mop"],_,t)}var m=0,g=0;return(o instanceof Dg||"\\oiint"===r.name||"\\oiiint"===r.name)&&!r.suppressBaseShift&&(m=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?Kv(o,n,i,t,a,g,m):(m&&(o.style.position="relative",o.style.top=Ag(m)),o)},Zv=(e,t)=>{var n;if(e.symbol)n=new uy("mo",[_y(e.name,e.mode)]),Xm.contains(Jv,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new uy("mo",by(e.body,t));else{n=new uy("mi",[new hy(e.name.slice(1))]);var i=new uy("mo",[_y("⁡","text")]);n=e.parentIsSupSub?new uy("mrow",[n,i]):dy([n,i])}return n},ew={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ub({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=i;return 1===r.length&&(r=ew[r]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Qv,mathmlBuilder:Zv}),Ub({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Xb(i)}},htmlBuilder:Qv,mathmlBuilder:Zv});var tw={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ub({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Qv,mathmlBuilder:Zv}),Ub({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Qv,mathmlBuilder:Zv}),Ub({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,i=n;return 1===i.length&&(i=tw[i]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Qv,mathmlBuilder:Zv});var nw=(e,t)=>{var n,i,r,s,o=!1;if("supsub"===e.type?(n=e.sup,i=e.sub,r=zy(e.base,"operatorname"),o=!0):r=zy(e,"operatorname"),r.body.length>0){for(var a=r.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=ty(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof Dg&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=Db.makeSpan(["mop"],l,t)}else s=Db.makeSpan(["mop"],[],t);return o?Kv(s,n,i,t,t.style,0,0):s};function iw(e,t,n){for(var i=ty(e,t,!1),r=t.sizeMultiplier/n.sizeMultiplier,s=0;s<i.length;s++){var o=i[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(i[s].classes,t.sizingClasses(n)):i[s].classes[o+1]==="reset-size"+t.size&&(i[s].classes[o+1]="reset-size"+n.size),i[s].height*=r,i[s].depth*=r}return Db.makeFragment(i)}Ub({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:i}=e,r=t[0];return{type:"operatorname",mode:n.mode,body:Xb(r),alwaysHandleSupSub:"\\operatornamewithlimits"===i,limits:!1,parentIsSupSub:!1}},htmlBuilder:nw,mathmlBuilder:(e,t)=>{for(var n=by(e.body,t.withFont("mathrm")),i=!0,r=0;r<n.length;r++){var s=n[r];if(s instanceof py.SpaceNode);else if(s instanceof py.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var o=s.children[0];1===s.children.length&&o instanceof py.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):i=!1;break;default:i=!1}else i=!1}if(i){var a=n.map(e=>e.toText()).join("");n=[new py.TextNode(a)]}var l=new py.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new py.MathNode("mo",[_y("⁡","text")]);return e.parentIsSupSub?new py.MathNode("mrow",[l,c]):py.newDocumentFragment([l,c])}}),Tv("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Wb({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Db.makeFragment(ty(e.body,t,!1)):Db.makeSpan(["mord"],ty(e.body,t,!0),t),mathmlBuilder:(e,t)=>yy(e.body,t,!0)}),Ub({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,i=t[0];return{type:"overline",mode:n.mode,body:i}},htmlBuilder(e,t){var n=ay(e.body,t.havingCrampedStyle()),i=Db.makeLineSpan("overline-line",t),r=t.fontMetrics().defaultRuleThickness,s=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:i},{type:"kern",size:r}]},t);return Db.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new py.MathNode("mo",[new py.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new py.MathNode("mover",[vy(e.body,t),n]);return i.setAttribute("accent","true"),i}}),Ub({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"phantom",mode:n.mode,body:Xb(i)}},htmlBuilder:(e,t)=>{var n=ty(e.body,t.withPhantom(),!1);return Db.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=by(e.body,t);return new py.MathNode("mphantom",n)}}),Ub({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"hphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=Db.makeSpan([],[ay(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var i=0;i<n.children.length;i++)n.children[i].height=0,n.children[i].depth=0;return n=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Db.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=by(Xb(e.body),t),i=new py.MathNode("mphantom",n),r=new py.MathNode("mpadded",[i]);return r.setAttribute("height","0px"),r.setAttribute("depth","0px"),r}}),Ub({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,i=t[0];return{type:"vphantom",mode:n.mode,body:i}},htmlBuilder:(e,t)=>{var n=Db.makeSpan(["inner"],[ay(e.body,t.withPhantom())]),i=Db.makeSpan(["fix"],[]);return Db.makeSpan(["mord","rlap"],[n,i],t)},mathmlBuilder:(e,t)=>{var n=by(Xb(e.body),t),i=new py.MathNode("mphantom",n),r=new py.MathNode("mpadded",[i]);return r.setAttribute("width","0px"),r}}),Ub({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,i=zy(t[0],"size").value,r=t[1];return{type:"raisebox",mode:n.mode,dy:i,body:r}},htmlBuilder(e,t){var n=ay(e.body,t),i=Mg(e.dy,t);return Db.makeVList({positionType:"shift",positionData:-i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new py.MathNode("mpadded",[vy(e.body,t)]),i=e.dy.number+e.dy.unit;return n.setAttribute("voffset",i),n}}),Ub({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Ub({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:i}=e,r=n[0],s=zy(t[0],"size"),o=zy(t[1],"size");return{type:"rule",mode:i.mode,shift:r&&zy(r,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=Db.makeSpan(["mord","rule"],[],t),i=Mg(e.width,t),r=Mg(e.height,t),s=e.shift?Mg(e.shift,t):0;return n.style.borderRightWidth=Ag(i),n.style.borderTopWidth=Ag(r),n.style.bottom=Ag(s),n.width=i,n.height=r+s,n.depth=-s,n.maxFontSize=1.125*r*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Mg(e.width,t),i=Mg(e.height,t),r=e.shift?Mg(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new py.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",Ag(n)),o.setAttribute("height",Ag(i));var a=new py.MathNode("mpadded",[o]);return r>=0?a.setAttribute("height",Ag(r)):(a.setAttribute("height",Ag(r)),a.setAttribute("depth",Ag(-r))),a.setAttribute("voffset",Ag(r)),a}});var rw=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Ub({type:"sizing",names:rw,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:i,parser:r}=e,s=r.parseExpression(!1,n);return{type:"sizing",mode:r.mode,size:rw.indexOf(i)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return iw(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),i=by(e.body,n),r=new py.MathNode("mstyle",i);return r.setAttribute("mathsize",Ag(n.sizeMultiplier)),r}}),Ub({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:i}=e,r=!1,s=!1,o=n[0]&&zy(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){if("t"===(a=o.body[l].text))r=!0;else{if("b"!==a){r=!1,s=!1;break}s=!0}}else r=!0,s=!0;var c=t[0];return{type:"smash",mode:i.mode,body:c,smashHeight:r,smashDepth:s}},htmlBuilder:(e,t)=>{var n=Db.makeSpan([],[ay(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].depth=0;var s=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Db.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new py.MathNode("mpadded",[vy(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Ub({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:i}=e,r=n[0],s=t[0];return{type:"sqrt",mode:i.mode,body:s,index:r}},htmlBuilder(e,t){var n=ay(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Db.wrapFragment(n,t);var i=t.fontMetrics().defaultRuleThickness,r=i;t.style.id<ag.TEXT.id&&(r=t.fontMetrics().xHeight);var s=i+r/4,o=n.height+n.depth+s+i,{span:a,ruleWidth:l,advanceWidth:c}=bv.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var u=a.height-n.height-s-l;n.style.paddingLeft=Ag(c);var h=Db.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(ag.SCRIPTSCRIPT),_=ay(e.index,p,t),f=.6*(h.height-h.depth),m=Db.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:_}]},t),g=Db.makeSpan(["root"],[m]);return Db.makeSpan(["mord","sqrt"],[g,h],t)}return Db.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:i}=e;return i?new py.MathNode("mroot",[vy(n,t),vy(i,t)]):new py.MathNode("msqrt",[vy(n,t)])}});var sw={display:ag.DISPLAY,text:ag.TEXT,script:ag.SCRIPT,scriptscript:ag.SCRIPTSCRIPT};Ub({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:i,parser:r}=e,s=r.parseExpression(!0,n),o=i.slice(1,i.length-5);return{type:"styling",mode:r.mode,style:o,body:s}},htmlBuilder(e,t){var n=sw[e.style],i=t.havingStyle(n).withFont("");return iw(e.body,i,t)},mathmlBuilder(e,t){var n=sw[e.style],i=t.havingStyle(n),r=by(e.body,i),s=new py.MathNode("mstyle",r),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});Wb({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===ag.DISPLAY.size||n.alwaysHandleSupSub)?Qv:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===ag.DISPLAY.size||n.limits)?nw:null:"accent"===n.type?Xm.isCharacterBox(n.base)?Ry:null:"horizBrace"===n.type&&!e.sub===n.isOver?Wv:null:null}(e,t);if(n)return n(e,t);var i,r,s,{base:o,sup:a,sub:l}=e,c=ay(o,t),d=t.fontMetrics(),u=0,h=0,p=o&&Xm.isCharacterBox(o);if(a){var _=t.havingStyle(t.style.sup());i=ay(a,_,t),p||(u=c.height-_.fontMetrics().supDrop*_.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());r=ay(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}s=t.style===ag.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var m,g=t.sizeMultiplier,b=Ag(.5/d.ptPerEm/g),y=null;if(r){var v=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Dg||v)&&(y=Ag(-c.italic))}if(i&&r){u=Math.max(u,s,i.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var w=4*d.defaultRuleThickness;if(u-i.depth-(r.height-h)<w){h=w-(u-i.depth)+r.height;var x=.8*d.xHeight-(u-i.depth);x>0&&(u+=x,h-=x)}var k=[{type:"elem",elem:r,shift:h,marginRight:b,marginLeft:y},{type:"elem",elem:i,shift:-u,marginRight:b}];m=Db.makeVList({positionType:"individualShift",children:k},t)}else if(r){h=Math.max(h,d.sub1,r.height-.8*d.xHeight);var S=[{type:"elem",elem:r,marginLeft:y,marginRight:b}];m=Db.makeVList({positionType:"shift",positionData:h,children:S},t)}else{if(!i)throw new Error("supsub must have either sup or sub.");u=Math.max(u,s,i.depth+.25*d.xHeight),m=Db.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:i,marginRight:b}]},t)}var C=sy(c,"right")||"mord";return Db.makeSpan([C],[c,Db.makeSpan(["msupsub"],[m])],t)},mathmlBuilder(e,t){var n,i=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(i=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var r,s=[vy(e.base,t)];if(e.sub&&s.push(vy(e.sub,t)),e.sup&&s.push(vy(e.sup,t)),i)r=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;r=o&&"op"===o.type&&o.limits&&t.style===ag.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===ag.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;r=a&&"op"===a.type&&a.limits&&(t.style===ag.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===ag.DISPLAY)?"munder":"msub"}else{var l=e.base;r=l&&"op"===l.type&&l.limits&&(t.style===ag.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===ag.DISPLAY)?"mover":"msup"}return new py.MathNode(r,s)}}),Wb({type:"atom",htmlBuilder:(e,t)=>Db.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new py.MathNode("mo",[_y(e.text,e.mode)]);if("bin"===e.family){var i=my(e,t);"bold-italic"===i&&n.setAttribute("mathvariant",i)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var ow={mi:"italic",mn:"normal",mtext:"normal"};Wb({type:"mathord",htmlBuilder:(e,t)=>Db.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new py.MathNode("mi",[_y(e.text,e.mode,t)]),i=my(e,t)||"italic";return i!==ow[n.type]&&n.setAttribute("mathvariant",i),n}}),Wb({type:"textord",htmlBuilder:(e,t)=>Db.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,i=_y(e.text,e.mode,t),r=my(e,t)||"normal";return n="text"===e.mode?new py.MathNode("mtext",[i]):/[0-9]/.test(e.text)?new py.MathNode("mn",[i]):"\\prime"===e.text?new py.MathNode("mo",[i]):new py.MathNode("mi",[i]),r!==ow[n.type]&&n.setAttribute("mathvariant",r),n}});var aw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},lw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Wb({type:"spacing",htmlBuilder(e,t){if(lw.hasOwnProperty(e.text)){var n=lw[e.text].className||"";if("text"===e.mode){var i=Db.makeOrd(e,t,"textord");return i.classes.push(n),i}return Db.makeSpan(["mspace",n],[Db.mathsym(e.text,e.mode,t)],t)}if(aw.hasOwnProperty(e.text))return Db.makeSpan(["mspace",aw[e.text]],[],t);throw new Gm('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!lw.hasOwnProperty(e.text)){if(aw.hasOwnProperty(e.text))return new py.MathNode("mspace");throw new Gm('Unknown type of space "'+e.text+'"')}return new py.MathNode("mtext",[new py.TextNode(" ")])}});var cw=()=>{var e=new py.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Wb({type:"tag",mathmlBuilder(e,t){var n=new py.MathNode("mtable",[new py.MathNode("mtr",[cw(),new py.MathNode("mtd",[yy(e.body,t)]),cw(),new py.MathNode("mtd",[yy(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var dw={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},uw={"\\textbf":"textbf","\\textmd":"textmd"},hw={"\\textit":"textit","\\textup":"textup"},pw=(e,t)=>{var n=e.font;return n?dw[n]?t.withTextFontFamily(dw[n]):uw[n]?t.withTextFontWeight(uw[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(hw[n]):t};Ub({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:i}=e,r=t[0];return{type:"text",mode:n.mode,body:Xb(r),font:i}},htmlBuilder(e,t){var n=pw(e,t),i=ty(e.body,n,!0);return Db.makeSpan(["mord","text"],i,n)},mathmlBuilder(e,t){var n=pw(e,t);return yy(e.body,n)}}),Ub({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ay(e.body,t),i=Db.makeLineSpan("underline-line",t),r=t.fontMetrics().defaultRuleThickness,s=Db.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:r},{type:"elem",elem:i},{type:"kern",size:3*r},{type:"elem",elem:n}]},t);return Db.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new py.MathNode("mo",[new py.TextNode("‾")]);n.setAttribute("stretchy","true");var i=new py.MathNode("munder",[vy(e.body,t),n]);return i.setAttribute("accentunder","true"),i}}),Ub({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ay(e.body,t),i=t.fontMetrics().axisHeight,r=.5*(n.height-i-(n.depth+i));return Db.makeVList({positionType:"shift",positionData:r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new py.MathNode("mpadded",[vy(e.body,t)],["vcenter"])}),Ub({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Gm("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=_w(e),i=[],r=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),i.push(Db.makeSymbol(o,"Typewriter-Regular",e.mode,r,["mord","texttt"]))}return Db.makeSpan(["mord","text"].concat(r.sizingClasses(t)),Db.tryCombineChars(i),r)},mathmlBuilder(e,t){var n=new py.TextNode(_w(e)),i=new py.MathNode("mtext",[n]);return i.setAttribute("mathvariant","monospace"),i}});var _w=e=>e.body.replace(/ /g,e.star?"␣":" "),fw=$b,mw="[ \r\n\t]",gw="(\\\\[a-zA-Z@]+)"+mw+"*",bw="[̀-ͯ]",yw=new RegExp(bw+"+$"),vw="("+mw+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]"+bw+"*|[\ud800-\udbff][\udc00-\udfff]"+bw+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+gw+"|\\\\[^\ud800-\udfff])";class ww{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(vw,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new $m("EOF",new Hm(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Gm("Unexpected character: '"+e[t]+"'",new $m(e[t],new Hm(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[i]){var r=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===r?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=r+1,this.lex()}return new $m(i,new Hm(this,t,this.tokenRegex.lastIndex))}}class xw{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Gm("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var r=this.undefStack[this.undefStack.length-1];r&&!r.hasOwnProperty(e)&&(r[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var kw=Av;Tv("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Tv("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Tv("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Tv("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Tv("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Tv("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Tv("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Sw={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Tv("\\char",function(e){var t,n=e.popToken(),i="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])i=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Gm("\\char` missing argument");i=n.text.charCodeAt(0)}else t=10;if(t){if(null==(i=Sw[n.text])||i>=t)throw new Gm("Invalid base-"+t+" digit "+n.text);for(var r;null!=(r=Sw[e.future().text])&&r<t;)i*=t,i+=r,e.popToken()}return"\\@char{"+i+"}"});var Cw=(e,t,n,i)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new Gm("\\newcommand's first argument must be a macro name");var s=r[0].text,o=e.isDefined(s);if(o&&!t)throw new Gm("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new Gm("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Gm("Invalid number of arguments: "+l);a=parseInt(l),r=e.consumeArg().tokens}return o&&i||e.macros.set(s,{tokens:r,numArgs:a}),""};Tv("\\newcommand",e=>Cw(e,!1,!0,!1)),Tv("\\renewcommand",e=>Cw(e,!0,!1,!1)),Tv("\\providecommand",e=>Cw(e,!0,!0,!0)),Tv("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Tv("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Tv("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),fw[n],Gg.math[n],Gg.text[n]),""}),Tv("\\bgroup","{"),Tv("\\egroup","}"),Tv("~","\\nobreakspace"),Tv("\\lq","`"),Tv("\\rq","'"),Tv("\\aa","\\r a"),Tv("\\AA","\\r A"),Tv("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Tv("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Tv("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Tv("ℬ","\\mathscr{B}"),Tv("ℰ","\\mathscr{E}"),Tv("ℱ","\\mathscr{F}"),Tv("ℋ","\\mathscr{H}"),Tv("ℐ","\\mathscr{I}"),Tv("ℒ","\\mathscr{L}"),Tv("ℳ","\\mathscr{M}"),Tv("ℛ","\\mathscr{R}"),Tv("ℭ","\\mathfrak{C}"),Tv("ℌ","\\mathfrak{H}"),Tv("ℨ","\\mathfrak{Z}"),Tv("\\Bbbk","\\Bbb{k}"),Tv("·","\\cdotp"),Tv("\\llap","\\mathllap{\\textrm{#1}}"),Tv("\\rlap","\\mathrlap{\\textrm{#1}}"),Tv("\\clap","\\mathclap{\\textrm{#1}}"),Tv("\\mathstrut","\\vphantom{(}"),Tv("\\underbar","\\underline{\\text{#1}}"),Tv("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Tv("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Tv("\\ne","\\neq"),Tv("≠","\\neq"),Tv("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Tv("∉","\\notin"),Tv("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Tv("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Tv("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Tv("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Tv("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Tv("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Tv("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Tv("⟂","\\perp"),Tv("‼","\\mathclose{!\\mkern-0.8mu!}"),Tv("∌","\\notni"),Tv("⌜","\\ulcorner"),Tv("⌝","\\urcorner"),Tv("⌞","\\llcorner"),Tv("⌟","\\lrcorner"),Tv("©","\\copyright"),Tv("®","\\textregistered"),Tv("️","\\textregistered"),Tv("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Tv("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Tv("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Tv("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Tv("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Tv("⋮","\\vdots"),Tv("\\varGamma","\\mathit{\\Gamma}"),Tv("\\varDelta","\\mathit{\\Delta}"),Tv("\\varTheta","\\mathit{\\Theta}"),Tv("\\varLambda","\\mathit{\\Lambda}"),Tv("\\varXi","\\mathit{\\Xi}"),Tv("\\varPi","\\mathit{\\Pi}"),Tv("\\varSigma","\\mathit{\\Sigma}"),Tv("\\varUpsilon","\\mathit{\\Upsilon}"),Tv("\\varPhi","\\mathit{\\Phi}"),Tv("\\varPsi","\\mathit{\\Psi}"),Tv("\\varOmega","\\mathit{\\Omega}"),Tv("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Tv("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Tv("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Tv("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Tv("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Tv("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Tv("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Tv("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Mw={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Tv("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Mw?t=Mw[n]:("\\not"===n.slice(0,4)||n in Gg.math&&Xm.contains(["bin","rel"],Gg.math[n].group))&&(t="\\dotsb"),t});var Aw={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Tv("\\dotso",function(e){return e.future().text in Aw?"\\ldots\\,":"\\ldots"}),Tv("\\dotsc",function(e){var t=e.future().text;return t in Aw&&","!==t?"\\ldots\\,":"\\ldots"}),Tv("\\cdots",function(e){return e.future().text in Aw?"\\@cdots\\,":"\\@cdots"}),Tv("\\dotsb","\\cdots"),Tv("\\dotsm","\\cdots"),Tv("\\dotsi","\\!\\cdots"),Tv("\\dotsx","\\ldots\\,"),Tv("\\DOTSI","\\relax"),Tv("\\DOTSB","\\relax"),Tv("\\DOTSX","\\relax"),Tv("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Tv("\\,","\\tmspace+{3mu}{.1667em}"),Tv("\\thinspace","\\,"),Tv("\\>","\\mskip{4mu}"),Tv("\\:","\\tmspace+{4mu}{.2222em}"),Tv("\\medspace","\\:"),Tv("\\;","\\tmspace+{5mu}{.2777em}"),Tv("\\thickspace","\\;"),Tv("\\!","\\tmspace-{3mu}{.1667em}"),Tv("\\negthinspace","\\!"),Tv("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Tv("\\negthickspace","\\tmspace-{5mu}{.277em}"),Tv("\\enspace","\\kern.5em "),Tv("\\enskip","\\hskip.5em\\relax"),Tv("\\quad","\\hskip1em\\relax"),Tv("\\qquad","\\hskip2em\\relax"),Tv("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Tv("\\tag@paren","\\tag@literal{({#1})}"),Tv("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Gm("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Tv("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Tv("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Tv("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Tv("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Tv("\\newline","\\\\\\relax"),Tv("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Tw=Ag(_g["Main-Regular"]["T".charCodeAt(0)][1]-.7*_g["Main-Regular"]["A".charCodeAt(0)][1]);Tv("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Tw+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Tv("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Tw+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Tv("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Tv("\\@hspace","\\hskip #1\\relax"),Tv("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Tv("\\ordinarycolon",":"),Tv("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Tv("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Tv("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Tv("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Tv("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Tv("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Tv("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Tv("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Tv("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Tv("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Tv("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Tv("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Tv("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Tv("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Tv("∷","\\dblcolon"),Tv("∹","\\eqcolon"),Tv("≔","\\coloneqq"),Tv("≕","\\eqqcolon"),Tv("⩴","\\Coloneqq"),Tv("\\ratio","\\vcentcolon"),Tv("\\coloncolon","\\dblcolon"),Tv("\\colonequals","\\coloneqq"),Tv("\\coloncolonequals","\\Coloneqq"),Tv("\\equalscolon","\\eqqcolon"),Tv("\\equalscoloncolon","\\Eqqcolon"),Tv("\\colonminus","\\coloneq"),Tv("\\coloncolonminus","\\Coloneq"),Tv("\\minuscolon","\\eqcolon"),Tv("\\minuscoloncolon","\\Eqcolon"),Tv("\\coloncolonapprox","\\Colonapprox"),Tv("\\coloncolonsim","\\Colonsim"),Tv("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Tv("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Tv("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Tv("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Tv("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Tv("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Tv("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Tv("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Tv("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Tv("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Tv("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Tv("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Tv("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Tv("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Tv("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Tv("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Tv("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Tv("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Tv("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Tv("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Tv("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Tv("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Tv("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Tv("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Tv("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Tv("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Tv("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Tv("\\imath","\\html@mathml{\\@imath}{ı}"),Tv("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Tv("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Tv("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Tv("⟦","\\llbracket"),Tv("⟧","\\rrbracket"),Tv("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Tv("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Tv("⦃","\\lBrace"),Tv("⦄","\\rBrace"),Tv("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Tv("⦵","\\minuso"),Tv("\\darr","\\downarrow"),Tv("\\dArr","\\Downarrow"),Tv("\\Darr","\\Downarrow"),Tv("\\lang","\\langle"),Tv("\\rang","\\rangle"),Tv("\\uarr","\\uparrow"),Tv("\\uArr","\\Uparrow"),Tv("\\Uarr","\\Uparrow"),Tv("\\N","\\mathbb{N}"),Tv("\\R","\\mathbb{R}"),Tv("\\Z","\\mathbb{Z}"),Tv("\\alef","\\aleph"),Tv("\\alefsym","\\aleph"),Tv("\\Alpha","\\mathrm{A}"),Tv("\\Beta","\\mathrm{B}"),Tv("\\bull","\\bullet"),Tv("\\Chi","\\mathrm{X}"),Tv("\\clubs","\\clubsuit"),Tv("\\cnums","\\mathbb{C}"),Tv("\\Complex","\\mathbb{C}"),Tv("\\Dagger","\\ddagger"),Tv("\\diamonds","\\diamondsuit"),Tv("\\empty","\\emptyset"),Tv("\\Epsilon","\\mathrm{E}"),Tv("\\Eta","\\mathrm{H}"),Tv("\\exist","\\exists"),Tv("\\harr","\\leftrightarrow"),Tv("\\hArr","\\Leftrightarrow"),Tv("\\Harr","\\Leftrightarrow"),Tv("\\hearts","\\heartsuit"),Tv("\\image","\\Im"),Tv("\\infin","\\infty"),Tv("\\Iota","\\mathrm{I}"),Tv("\\isin","\\in"),Tv("\\Kappa","\\mathrm{K}"),Tv("\\larr","\\leftarrow"),Tv("\\lArr","\\Leftarrow"),Tv("\\Larr","\\Leftarrow"),Tv("\\lrarr","\\leftrightarrow"),Tv("\\lrArr","\\Leftrightarrow"),Tv("\\Lrarr","\\Leftrightarrow"),Tv("\\Mu","\\mathrm{M}"),Tv("\\natnums","\\mathbb{N}"),Tv("\\Nu","\\mathrm{N}"),Tv("\\Omicron","\\mathrm{O}"),Tv("\\plusmn","\\pm"),Tv("\\rarr","\\rightarrow"),Tv("\\rArr","\\Rightarrow"),Tv("\\Rarr","\\Rightarrow"),Tv("\\real","\\Re"),Tv("\\reals","\\mathbb{R}"),Tv("\\Reals","\\mathbb{R}"),Tv("\\Rho","\\mathrm{P}"),Tv("\\sdot","\\cdot"),Tv("\\sect","\\S"),Tv("\\spades","\\spadesuit"),Tv("\\sub","\\subset"),Tv("\\sube","\\subseteq"),Tv("\\supe","\\supseteq"),Tv("\\Tau","\\mathrm{T}"),Tv("\\thetasym","\\vartheta"),Tv("\\weierp","\\wp"),Tv("\\Zeta","\\mathrm{Z}"),Tv("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Tv("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Tv("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Tv("\\bra","\\mathinner{\\langle{#1}|}"),Tv("\\ket","\\mathinner{|{#1}\\rangle}"),Tv("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Tv("\\Bra","\\left\\langle#1\\right|"),Tv("\\Ket","\\left|#1\\right\\rangle");var zw=e=>t=>{var n=t.consumeArg().tokens,i=t.consumeArg().tokens,r=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),r.length&&n.macros.set("\\|",a));var s=t;!t&&r.length&&("|"===n.future().text&&(n.popToken(),s=!0));return{tokens:s?r:i,numArgs:0}};t.macros.set("|",l(!1)),r.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Tv("\\bra@ket",zw(!1)),Tv("\\bra@set",zw(!0)),Tv("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Tv("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Tv("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Tv("\\angln","{\\angl n}"),Tv("\\blue","\\textcolor{##6495ed}{#1}"),Tv("\\orange","\\textcolor{##ffa500}{#1}"),Tv("\\pink","\\textcolor{##ff00af}{#1}"),Tv("\\red","\\textcolor{##df0030}{#1}"),Tv("\\green","\\textcolor{##28ae7b}{#1}"),Tv("\\gray","\\textcolor{gray}{#1}"),Tv("\\purple","\\textcolor{##9d38bd}{#1}"),Tv("\\blueA","\\textcolor{##ccfaff}{#1}"),Tv("\\blueB","\\textcolor{##80f6ff}{#1}"),Tv("\\blueC","\\textcolor{##63d9ea}{#1}"),Tv("\\blueD","\\textcolor{##11accd}{#1}"),Tv("\\blueE","\\textcolor{##0c7f99}{#1}"),Tv("\\tealA","\\textcolor{##94fff5}{#1}"),Tv("\\tealB","\\textcolor{##26edd5}{#1}"),Tv("\\tealC","\\textcolor{##01d1c1}{#1}"),Tv("\\tealD","\\textcolor{##01a995}{#1}"),Tv("\\tealE","\\textcolor{##208170}{#1}"),Tv("\\greenA","\\textcolor{##b6ffb0}{#1}"),Tv("\\greenB","\\textcolor{##8af281}{#1}"),Tv("\\greenC","\\textcolor{##74cf70}{#1}"),Tv("\\greenD","\\textcolor{##1fab54}{#1}"),Tv("\\greenE","\\textcolor{##0d923f}{#1}"),Tv("\\goldA","\\textcolor{##ffd0a9}{#1}"),Tv("\\goldB","\\textcolor{##ffbb71}{#1}"),Tv("\\goldC","\\textcolor{##ff9c39}{#1}"),Tv("\\goldD","\\textcolor{##e07d10}{#1}"),Tv("\\goldE","\\textcolor{##a75a05}{#1}"),Tv("\\redA","\\textcolor{##fca9a9}{#1}"),Tv("\\redB","\\textcolor{##ff8482}{#1}"),Tv("\\redC","\\textcolor{##f9685d}{#1}"),Tv("\\redD","\\textcolor{##e84d39}{#1}"),Tv("\\redE","\\textcolor{##bc2612}{#1}"),Tv("\\maroonA","\\textcolor{##ffbde0}{#1}"),Tv("\\maroonB","\\textcolor{##ff92c6}{#1}"),Tv("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Tv("\\maroonD","\\textcolor{##ca337c}{#1}"),Tv("\\maroonE","\\textcolor{##9e034e}{#1}"),Tv("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Tv("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Tv("\\purpleC","\\textcolor{##aa87ff}{#1}"),Tv("\\purpleD","\\textcolor{##7854ab}{#1}"),Tv("\\purpleE","\\textcolor{##543b78}{#1}"),Tv("\\mintA","\\textcolor{##f5f9e8}{#1}"),Tv("\\mintB","\\textcolor{##edf2df}{#1}"),Tv("\\mintC","\\textcolor{##e0e5cc}{#1}"),Tv("\\grayA","\\textcolor{##f6f7f7}{#1}"),Tv("\\grayB","\\textcolor{##f0f1f2}{#1}"),Tv("\\grayC","\\textcolor{##e3e5e6}{#1}"),Tv("\\grayD","\\textcolor{##d6d8da}{#1}"),Tv("\\grayE","\\textcolor{##babec2}{#1}"),Tv("\\grayF","\\textcolor{##888d93}{#1}"),Tv("\\grayG","\\textcolor{##626569}{#1}"),Tv("\\grayH","\\textcolor{##3b3e40}{#1}"),Tv("\\grayI","\\textcolor{##21242c}{#1}"),Tv("\\kaBlue","\\textcolor{##314453}{#1}"),Tv("\\kaGreen","\\textcolor{##71B307}{#1}");var Pw={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Nw{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new xw(kw,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new ww(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:i,end:n}=this.consumeArg(["]"]))}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new $m("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i,r=this.future(),s=0,o=0;do{if(i=this.popToken(),t.push(i),"{"===i.text)++s;else if("}"===i.text){if(-1===--s)throw new Gm("Extra }",i)}else if("EOF"===i.text)throw new Gm("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",i);if(e&&n)if((0===s||1===s&&"{"===e[o])&&i.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===r.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Gm("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var r=this.popToken();if(n[i]!==r.text)throw new Gm("Use of the macro doesn't match its definition",r)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Gm("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(null==i||e&&i.unexpandable){if(e&&null==i&&"\\"===n[0]&&!this.isDefined(n))throw new Gm("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var r=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs)for(var o=(r=r.slice()).length-1;o>=0;--o){var a=r[o];if("#"===a.text){if(0===o)throw new Gm("Incomplete placeholder at end of macro body",a);if("#"===(a=r[--o]).text)r.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new Gm("Not a valid argument number",a);r.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(r),r.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new $m(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var i="function"==typeof t?t(this):t;if("string"==typeof i){var r=0;if(-1!==i.indexOf("#"))for(var s=i.replace(/##/g,"");-1!==s.indexOf("#"+(r+1));)++r;for(var o=new ww(i,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:r}}return i}isDefined(e){return this.macros.has(e)||fw.hasOwnProperty(e)||Gg.math.hasOwnProperty(e)||Gg.text.hasOwnProperty(e)||Pw.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:fw.hasOwnProperty(e)&&!fw[e].primitive}}var Rw=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ow=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Lw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Ew={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Iw{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Nw(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new Gm("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new $m("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==Iw.endOfExpression.indexOf(i.text))break;if(t&&i.text===t)break;if(e&&fw[i.text]&&fw[i.text].infix)break;var r=this.parseAtom(t);if(!r)break;"internal"!==r.type&&n.push(r)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,i=0;i<e.length;i++)if("infix"===e[i].type){if(-1!==n)throw new Gm("only one infix operator per group",e[i].token);n=i,t=e[i].replaceWith}if(-1!==n&&t){var r,s,o=e.slice(0,n),a=e.slice(n+1);return r=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},s=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[r,e[n],s],[]):this.callFunction(t,[r,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),i=n.text;this.consume(),this.consumeSpaces();do{var r;t=this.parseGroup(e)}while("internal"===(null==(r=t)?void 0:r.type));if(!t)throw new Gm("Expected group after '"+i+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]}}parseAtom(e){var t,n,i=this.parseGroup("atom",e);if("internal"===(null==i?void 0:i.type))return i;if("text"===this.mode)return i;for(;;){this.consumeSpaces();var r=this.fetch();if("\\limits"===r.text||"\\nolimits"===r.text){if(i&&"op"===i.type){var s="\\limits"===r.text;i.limits=s,i.alwaysHandleSupSub=!0}else{if(!i||"operatorname"!==i.type)throw new Gm("Limit controls must follow a math operator",r);i.alwaysHandleSupSub&&(i.limits="\\limits"===r.text)}this.consume()}else if("^"===r.text){if(t)throw new Gm("Double superscript",r);t=this.handleSupSubscript("superscript")}else if("_"===r.text){if(n)throw new Gm("Double subscript",r);n=this.handleSupSubscript("subscript")}else if("'"===r.text){if(t)throw new Gm("Double superscript",r);var o={type:"textord",mode:this.mode,text:"\\prime"},a=[o];for(this.consume();"'"===this.fetch().text;)a.push(o),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Ow[r.text])break;var l=Rw.test(r.text),c=[];for(c.push(new $m(Ow[r.text])),this.consume();;){var d=this.fetch().text;if(!Ow[d])break;if(Rw.test(d)!==l)break;c.unshift(new $m(Ow[d])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||n?{type:"supsub",mode:this.mode,base:i,sup:t,sub:n}:i}parseFunction(e,t){var n=this.fetch(),i=n.text,r=fw[i];if(!r)return null;if(this.consume(),t&&"atom"!==t&&!r.allowedInArgument)throw new Gm("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!r.allowedInText)throw new Gm("Can't use function '"+i+"' in text mode",n);if("math"===this.mode&&!1===r.allowedInMath)throw new Gm("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,r);return this.callFunction(i,s,o,n,e)}callFunction(e,t,n,i,r){var s={funcName:e,parser:this,token:i,breakOnTokenText:r},o=fw[e];if(o&&o.handler)return o.handler(s,t,n);throw new Gm("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var i=[],r=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],a=s<t.numOptionalArgs;(t.primitive&&null==o||"sqrt"===t.type&&1===s&&null==r[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)r.push(l);else{if(null==l)throw new Gm("Null argument, please report this as a bug");i.push(l)}}return{args:i,optArgs:r}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var i=this.parseArgumentGroup(n,"text");return null!=i?{type:"styling",mode:i.mode,body:[i],style:"text"}:null;case"raw":var r=this.parseStringGroup("raw",n);return null!=r?{type:"raw",mode:"text",string:r.text}:null;case"primitive":if(n)throw new Gm("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new Gm("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new Gm("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var i,r="";"EOF"!==(i=this.fetch()).text;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n,i=this.fetch(),r=i,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(r=n).text,this.consume();if(""===s)throw new Gm("Invalid "+t+": '"+i.text+"'",i);return i.range(r,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Gm("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new Gm("Invalid size: '"+t.text+"'",t);var r={number:+(i[1]+i[2]),unit:i[3]};if(!Cg(r))throw new Gm("Invalid unit: '"+r.unit+"'",t);return{type:"size",mode:this.mode,value:r,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var r=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:r};return t&&this.switchMode(i),s}parseGroup(e,t){var n,i=this.fetch(),r=i.text;if("{"===r||"\\begingroup"===r){this.consume();var s="{"===r?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),a=this.fetch();this.expect(s),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Hm.range(i,a),body:o,semisimple:"\\begingroup"===r||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===r[0]&&!Pw.hasOwnProperty(r)){if(this.settings.throwOnError)throw new Gm("Undefined control sequence: "+r,i);n=this.formatUnsupportedCmd(r),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],r=i.text;"-"===r&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:Hm.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Hm.range(i,e[n+1]),text:"--"}),t-=1)),"'"!==r&&"`"!==r||e[n+1].text!==r||(e.splice(n,2,{type:"textord",mode:"text",loc:Hm.range(i,e[n+1]),text:r+r}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i="*"===n.charAt(0);if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Gm("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:i}}Ew.hasOwnProperty(t[0])&&!Gg[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Ew[t[0]]+t.slice(1));var r,s=yw.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),Gg[this.mode][t]){this.settings.strict&&"math"===this.mode&&xb.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,a=Gg[this.mode][t].group,l=Hm.range(e);if(Hg.hasOwnProperty(a)){var c=a;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:a,mode:this.mode,loc:l,text:t};r=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(dg(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),r={type:"textord",mode:"text",loc:Hm.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var u=s[0][d];if(!Lw[u])throw new Gm("Unknown accent ' "+u+"'",e);var h=Lw[u][this.mode]||Lw[u].text;if(!h)throw new Gm("Accent "+u+" unsupported in "+this.mode+" mode",e);r={type:"accent",mode:this.mode,loc:Hm.range(e),label:h,isStretchy:!1,isShifty:!0,base:r}}return r}}Iw.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var Dw=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Iw(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Gm("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new $m("\\df@tag")])}]}return i};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."));var Bw=function(e,t,n){if(n.throwOnError||!(e instanceof Gm))throw e;var i=Db.makeSpan(["katex-error"],[new Dg(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},jw=function(e,t){var n=new Qm(t);try{return function(e,t,n){var i,r=xy(n);if("mathml"===n.output)return wy(e,t,r,n.displayMode,!0);if("html"===n.output){var s=cy(e,r);i=Db.makeSpan(["katex"],[s])}else{var o=wy(e,t,r,n.displayMode,!1),a=cy(e,r);i=Db.makeSpan(["katex"],[o,a])}return ky(i,n)}(Dw(e,n),e,n)}catch(t){return Bw(t,e,n)}},qw=function(e,t){return jw(e,t).toMarkup()};class Fw{static update(e,t,n,i=!1){return{id:e,name:m.update,size:n,latex:t,block:i}}}class Hw extends ic{_status=new $w(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get component(){return Fm}get attrs(){return this.data.attrs}get meta(){return Hw.meta}get mathml(){const e=this.attrs.size+this.info.latex;return Hw.render(e,{displayMode:this.attrs.block})}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e,t){return Hw.update_data(e,t)}replace_id(e,t={}){return Hw.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:i}=e,{courier:r,id:s}=this,o=r.get_recorder();o.add_cmd(e);const a=this.info,l=this.attrs.block,c=this.attrs.size;return this.data.info=t,this.data.attrs.block=n,this.data.attrs.size=i,this.status.update_attrs(),this.status.update_latex(),o.add_recover(Fw.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return qw(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:n.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},i={}){return{id:rc.get_id(),type:n.fomula,info:e,attrs:{block:!1,size:f.h4,...i},css:t}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Os(m.update)],Hw.prototype,"update",null);class $w extends Jl{constructor(e){super(e)}_mathml=ws(()=>{const e=this.attrs.size+this.latex;return Hw.render(e,{displayMode:this.attrs.block})});get cube(){return this._cube}get latex(){return this.info}get mathml(){return this._mathml.value}update_latex(){Promise.resolve().then(()=>{this._data.info=this.cube.info})}}class Gw{static add_title(e,t){return{id:e,name:g.add_title,data:t}}static remove_title(e){return{id:e,name:g.remove_title}}static add_cell(e,t){return{id:e,name:g.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:g.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:g.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:g.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:g.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:g.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:g.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:g.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:g.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:g.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:g.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:g.col_resize,cols:t,step:n}}}function Vw(e,t){const{hotkeys:n,courier:i,id:r,history:s}=t,o=Ss.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const a=e.key.toLowerCase(),l=e.shiftKey,c=t.get_active_cell();if(!c)return o?.tip_info("未发现激活单元格");if(a===P.up)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(kd.get_default());n.tell(t,Gw.add_row(t.id,c.row,r)),s.record(n)}else{if(t.get_cell(c.row-1,c.col))return o?.tip_info("上方已存在单元格");if(c.row-1<0)return o?.tip_info("上方已达边界");{const e=i.get_recorder(),n={row:c.row-1,col:c.col,rowspan:1,colspan:1,data:kd.get_default()};e.tell(t,Gw.add_cell(t.id,n)),s.record(e)}}else if(a===P.down)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[1];e++)r.push(kd.get_default());n.tell(t,Gw.add_row(t.id,c.row+c.rowspan,r)),s.record(n)}else{if(t.get_cell(c.row+1,c.col))return o?.tip_info("下方已存在单元格");if(c.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=i.get_recorder(),n={row:c.row+1,col:c.col,rowspan:1,colspan:1,data:kd.get_default()};e.tell(t,Gw.add_cell(t.id,n)),s.record(e)}}else if(a===P.left)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(kd.get_default());n.tell(t,Gw.add_col(t.id,c.col,r)),s.record(n)}else{if(t.get_cell(c.row,c.col-1))return o?.tip_info("左侧已存在单元格");if(c.col-1<0)return o?.tip_info("左侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col-1,rowspan:1,colspan:1,data:kd.get_default()};e.tell(t,Gw.add_cell(t.id,n)),s.record(e)}}else if(a===P.right)if(l){const e=t.get_cell_area(c);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=i.get_recorder(),r=[];for(let e=0;e<t.size[0];e++)r.push(kd.get_default());n.tell(t,Gw.add_col(t.id,c.col+c.colspan,r)),s.record(n)}else{if(t.get_cell(c.row,c.col+1))return o?.tip_info("右侧已存在单元格");if(c.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=i.get_recorder(),n={row:c.row,col:c.col+1,rowspan:1,colspan:1,data:kd.get_default()};e.tell(t,Gw.add_cell(t.id,n)),s.record(e)}}}const Uw={drag_cell:void 0,hover:void 0};function Ww(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),Uw.drag_cell=t}function Yw(e,t){if(Uw.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),Uw.hover=n}function Xw(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function Kw(e,t){const{drag_cell:n,hover:i}=Uw,{pcube:r,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),i&&i.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(r,Gw.moveto(r.id,t.box.id,[n.box.id])),o.record(l)}const Jw={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function Qw(e,t){const{root:n,cursor:i}=t;if(e.ctrlKey)e.stopPropagation();else{rc.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const i=t.find_dom_cube(n),r=i?.find_upstream_untill(t);if(!r)return;const s=t.cells.find(e=>e.box===r);if(!s)return;Jw.down_point={x:e.clientX,y:e.clientY},Jw.has_down=!0,Jw.anchor=s}}function Zw(e,t){const{cursor:n}=t,{down_point:i,has_down:r,anchor:s,has_move:o}=Jw;if(!i)return;if(Jw.has_move=Math.sqrt((e.clientX-i.x)**2+(e.clientY-i.y)**2)>5,!r||!s||!o||e.buttons<=0)return;const a=e.target;if(!(a instanceof Node))return;const l=t.find_dom_cube(a),c=l?.find_upstream_untill(t),d=t.cells.find(e=>e.box===c);if(!d||d===s)return void t.clear_selection();const u={left:Math.min(s.col,d.col),right:Math.max(s.col+s.colspan-1,d.col+d.colspan-1),top:Math.min(s.row,d.row),bottom:Math.max(s.row+s.rowspan-1,d.row+d.rowspan-1)},h=t.get_rectarea_cell(u);t.clear_selection();for(let e of h.cells)e.selection=!0;h.cells.length>1&&e.stopPropagation()}function ex(e,t){const{cursor:n}=t;Jw.has_down=!1,Jw.anchor=void 0}const tx=["id","data-type"],nx=jn({__name:"cube-table",props:{cube:{}},setup(e){const{status:t}=e.cube,n=Fn("dragger"),i=Fn("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function s(e){return{"cube-cell-selection":e.selection}}const o=ws(()=>({"grid-template-columns":t.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return ii(()=>{const t=n.value,r=i.value;if(!t||!r)return;let s=e.cube.data.attrs.width,o=s;const a=new Ws.DragDiff(t);a.register_down(()=>{s=e.cube.data.attrs.width}),a.register_move((t,n)=>{s+t<e.cube.min_width||(o=s+t,r.style.width=o+"px")}),a.register_up((t,n)=>{if(o===s)return;const{courier:i,history:r}=e.cube,a=i.get_recorder();a.tell(e.cube,Ts.resize(e.cube.id,o)),r.record(a)}),a.register_cancel(()=>{r.style.width=s+"px"})}),(e,a)=>(Rr(),Dr("div",{ref_key:"box",ref:i,class:"cube-table",style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type,onPointerdown:a[0]||(a[0]=t=>en(Qw)(t,e.cube)),onPointermove:a[1]||(a[1]=t=>en(Zw)(t,e.cube)),onPointerup:a[2]||(a[2]=t=>en(ex)(t,e.cube)),onPointercancel:a[3]||(a[3]=t=>en(ex)(t,e.cube)),onKeyup:a[4]||(a[4]=t=>en(Vw)(t,e.cube)),onContextmenu:a[5]||(a[5]=t=>en(_a)(t,e.cube))},[e.cube.title?(Rr(),Br(Zs,{key:0,class:"cube-table-title",cube:Ut(e.cube.title)},null,8,["cube"])):Xr("v-if",!0),$r("div",{class:"cube-table-container",style:fe(o.value)},[(Rr(!0),Dr(Mr,null,gi(en(t).cells,(e,t)=>(Rr(),Br(Zs,{key:e.box.id,cube:Ut(e.box),style:fe(r(e)),class:ve(s(e)),draggable:"true",onDragstart:t=>en(Ww)(t,e),onDragenter:t=>en(Yw)(t,e),onDragleave:t=>en(Xw)(t,e),onDrop:t=>en(Kw)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),$r("div",{class:"cube-table-dragger",ref_key:"dragger",ref:n},null,512)],44,tx))}}),ix=(0,io.A)(nx,[["__scopeId","data-v-4aca7a12"]]);function rx(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class sx extends ic{_status=new ox(this);_cells=[];_title;constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get title(){return this._title}set title(e){this._title=e,this.status.update_title()}get component(){return ix}get cells(){return[...this._cells]}get meta(){return sx.meta}get children(){const e=[],t=this._cells;return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),this.title&&e.unshift(this.title),e.push(...t.map(e=>e.box)),e}get cells_sorted(){const e=[],t=this._cells;return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),e.push(...t),e}get css(){const e=this.attrs;return{...super.css,width:e.width+"px"}}get attrs(){return this.data.attrs}get cols(){return this.data.info.cols}get size(){return this.data.info.size}get selection_cells(){const e=[];for(let t of this.cells_sorted)t.selection&&e.push(t);return e}get min_width(){return 500}build_child(e){e.info.title&&(this.title=Ut(new kd(e.info.title,this)));for(let t of e.info.cells){const e=new kd(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:Ut(e),selection:!1};this._cells.push(n)}}export(){const e=this.base_export();this.title&&(e.info.title=this.title.export()),e.info.cells=[];for(let t of this._cells)e.info.cells.push(this.get_cell_data(t));return e}update_data(e,t){return sx.update_data(e,t)}gc(){this.base_gc()}get_cell_data(e){return{row:e.row,col:e.col,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()}}replace_id(e,t={}){return sx.replace_id(this.root,e,t)}get_rows(e){const t=[];for(let n of this.cells_sorted)e>=n.row&&e<n.row+n.rowspan&&t.push(n);return t}get_cols(e){const t=[];for(let n of this.cells_sorted)e>=n.col&&e<n.col+n.colspan&&t.push(n);return t}check_orderly_col(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.right)).size,r=1===new Set(n.map(e=>e.left)).size;return i&&r}check_orderly_col_left(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.left)).size}check_orderly_col_right(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.right)).size}check_orderly_row(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const i=1===new Set(n.map(e=>e.bottom)).size,r=1===new Set(n.map(e=>e.top)).size;return i&&r}check_orderly_row_top(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));new Set(n.map(e=>e.bottom)).size;return 1===new Set(n.map(e=>e.top)).size}check_orderly_row_bottom(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.bottom)).size}get_cell_area(e){return{left:e.col,right:e.col+e.colspan-1,top:e.row,bottom:e.row+e.rowspan-1}}get_cell(e,t){for(let n of this._cells){const i=e>=n.row&&e<n.row+n.rowspan,r=t>=n.col&&t<n.col+n.colspan;if(i&&r)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:i,top:r,bottom:s}=e;for(let o of this._cells){let{row:a,rowspan:l,col:c,colspan:d}=o,u=a,h=a+l-1,p=c,_=c+d-1;if(n>=p&&n<=_||n<=p&&_<=i||i>=p&&i<=_){if(u<r&&h>=r){e.top=a;break}if(u<=s&&h>s){e.bottom=a+l-1;break}}if(r>=u&&r<=h||r<u&&s>=h||s>=u&&s<=h){if(p<n&&_>=n){e.left=c;break}if(p<=i&&_>i){e.right=c+d-1;break}}o===this._cells[this._cells.length-1]&&(t=!0)}}const n=[];for(let t of this.cells_sorted){let{row:i,col:r,rowspan:s,colspan:o}=t;r>=e.left&&r+o-1<=e.right&&i>=e.top&&i+s-1<=e.bottom&&n.push(t)}return{...e,cells:n}}clear_selection(){for(let e of this._cells)e.selection=!1}get_active_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t?.find_upstream_untill(this);return this._cells.find(e=>e.box===n)}set_selection_area(e){this.get_rectarea_cell(e);for(let e of this._cells)e.selection=!1;for(let e of this._cells)e.selection=!0}get_focus_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t.find_upstream_untill(this);return n?this._cells.find(e=>e.box.id===n.id):void 0}get_selection_area(){let e,t;const n=this.selection_cells;if(0===n.length)return;for(let i of n){const n=this.get_cell_area(i);e||(e=[n.top,n.bottom]),t||(t=[n.left,n.right]),n.top<e[0]&&(e[0]=n.top),n.left<t[0]&&(t[0]=n.left),n.bottom>e[1]&&(e[1]=n.bottom),n.right>t[1]&&(t[1]=n.right)}if(!e||!t)return;return{left:t[0],right:t[1],top:e[0],bottom:e[1]}}get_selection_size(){const e=this.get_selection_area();if(e)return[e.bottom-e.top+1,e.right-e.left+1]}get_selection_text(){const e=this.selection_cells;let t="";if(0===e.length)return t;for(let n of e)t+=n.box.text;return t}copy_selection_table(){const e=this.get_selection_size(),t=this.selection_cells,n=this.get_selection_area();if(!e||!t||!n)return;const i=[];for(let e of t)i.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const r=sx.get_default_by_data(e,i);return r.attrs=structuredClone(Vt(this.attrs)),r}add_title(e){const{data:t}=e,{courier:n,cursor:i,id:r}=this,s=n.get_recorder();s.add_cmd(e);const o=new kd(t,this);return this.title=Ut(o),s.add_recover(Gw.remove_title(r)),s}remove_title(e){const{id:t,courier:n,cursor:i}=this;if(!this.title)return;const r=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(Gw.add_title(t,r)),s}add_cell(e){const{id:t,courier:n,cursor:i}=this,{data:r}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:r.row,col:r.col,rowspan:r.rowspan,colspan:r.colspan,box:Ut(new kd(r.data,this)),selection:!1};return this._cells.push(o),s.add_recover(Gw.remove_cell(t,o.box.id)),this.status.update_cells(),s}remove_cell(e){const{id:t,courier:n,cursor:i}=this,{cid:r}=e,s=n.get_recorder();s.add_cmd(e);const o=this._cells.findIndex(e=>e.box.id===r),a=this._cells[o];if(!a)return;const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan,data:a.box.export()};return o>=0&&(this._cells.splice(o,1),this.status.update_cells()),s.add_recover(Gw.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:i}=this,{index:r,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:r,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this._cells)e.row<r||o.tell(this,Gw.update_cell_area(i,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,Gw.add_cell(i,e));return o}remove_row(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,s=this.get_rows(r),o=n.get_recorder();for(let e of s)o.tell(this,Gw.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:i}=this,{index:r,cols:s}=e,o=i.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:r,rowspan:1,colspan:1,data:t})}o.tell(this,Gw.add_grid_col(t,r,2));for(let e of this._cells)e.col<r||o.tell(this,Gw.update_cell_area(t,e.box.id,{row:e.row,col:e.col+1,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,Gw.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:i}=this,{index:r}=e;if(!this.check_orderly_col(r))return Ss.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,r),!s));e++);if(!s)return;const o=i.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,Gw.remove_grid_col(t,e));const a=this.get_cols(r);for(let e of a)o.tell(this,Gw.remove_cell(t,e.box.id));for(let e of this._cells){if(e.col<r)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,Gw.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:i}=this,{tid:r,cells:s}=e,o=n.get_recorder(),a=this._cells.find(e=>e.box.id===r);if(!a)return;const l=a.box,c=this.cells_sorted.filter(e=>e.box.id!==r&&s.includes(e.box.id));for(let e of c){const n=e.box.export();o.tell(this,Gw.remove_cell(t,e.box.id)),o.tell(l,Ts.insert_child(l.id,n.info,l.child_count))}return o}update_area(e){const{id:t,courier:n,cursor:i}=this,{tid:r,area:s}=e,o=n.get_recorder(),a=this._cells.find(e=>e.box.id===r);if(!a)return;o.add_cmd(e);const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return a.row=s.row,a.col=s.col,a.rowspan=s.rowspan,a.colspan=s.colspan,o.add_recover(Gw.update_cell_area(t,r,l)),o}merge_cell(e){const{id:t,cursor:n,courier:i}=this,{area:r}=e,s=i.get_recorder(),o=this.get_rectarea_cell(r);let a=o.cells[0];if(!a)return;const l={row:r.top,col:r.left,rowspan:r.bottom-r.top+1,colspan:r.right-r.left+1},c=a.box.id;return s.tell(this,Gw.update_cell_area(t,c,l)),s.tell(this,Gw.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(r,0,s),this.size[1]++,o.add_recover(Gw.remove_grid_col(t,r)),o}remove_grid_col(e){const{id:t,courier:n,cursor:i}=this,{index:r}=e,s=n.get_recorder(),o=this.cols.splice(r,1);if(0!==o.length)return this.size[1]--,s.add_recover(Gw.add_grid_col(t,r,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:i}=this,{cols:r,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=r[0];e<=r[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(Gw.col_resize(t,r,-s)),o}delete_child(e){const{dir:t,range:n,reserve:i}=e,{courier:r,cursor:s,history:o}=this,a=r.get_recorder();let[l,c]=this.get_valid_range(n);if(0===l&&c>=this.child_count)if(i){if(this.is_empty)return;const e=this.child_first;a.tell(this,Ts.delete_child(this.id,"backward",[1,this.child_count],i)),a.tell(e,Ts.delete_child(e.id,"backward",[0,e.child_count],i))}else a.merge(this.remove_self());else{let e=[];for(let t=l;t<c;t++){let n=this.children[t];e.push(n.id)}for(let t of e)a.tell(this,Gw.remove_cell(this.id,t))}return a}static get meta(){return{cubename:"表格",type:n.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const i=[],r=[];r.length=t,r.fill(2);for(let n=0;n<e;n++)for(let e=0;e<t;e++){const t={row:n,col:e,rowspan:1,colspan:1,data:kd.get_default()};i.push(t)}return{id:rc.get_id(),type:n.table,info:{size:[e,t],cols:r,cells:i},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[i,r]=e,s=[];return s.length=r,s.fill(2),{id:rc.get_id(),type:n.table,info:{size:[i,r],cols:s,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();n[i]=r,t.id=r,t.info.title&&(t.info.title=kd.replace_id(e,t.info.title,n));for(let i of t.info.cells)i.data=kd.replace_id(e,i.data,n);return t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}rx([Os(g.add_title)],sx.prototype,"add_title",null),rx([Os(g.remove_title)],sx.prototype,"remove_title",null),rx([Os(g.add_cell)],sx.prototype,"add_cell",null),rx([Os(g.remove_cell)],sx.prototype,"remove_cell",null),rx([Os(g.add_row)],sx.prototype,"add_row",null),rx([Os(g.remove_row)],sx.prototype,"remove_row",null),rx([Os(g.add_col)],sx.prototype,"add_col",null),rx([Os(g.remove_col)],sx.prototype,"remove_col",null),rx([Os(g.moveto)],sx.prototype,"moveto",null),rx([Os(g.update_area)],sx.prototype,"update_area",null),rx([Os(g.merge)],sx.prototype,"merge_cell",null),rx([Os(g.add_grid_col)],sx.prototype,"add_grid_col",null),rx([Os(g.remove_grid_col)],sx.prototype,"remove_grid_col",null),rx([Os(g.col_resize)],sx.prototype,"col_resize",null),rx([Os(w.cube_delete_child)],sx.prototype,"delete_child",null);class ox extends Jl{_cells=Dt([]);_title=Jt(void 0);constructor(e){super(e)}get cube(){return this._cube}get title(){return this._title.value}get cells(){return[...this._cells]}get info(){return this._data.info}get cols(){return this.info.cols}init(){super.init(),this.update_cells()}update_cells(){return Promise.resolve().then(()=>{this._cells.splice(0,this._cells.length,...this.cube.cells)})}update_title(){return Promise.resolve().then(()=>{this._title.value=this.cube.title})}}const ax=["id","data-type"],lx=jn({__name:"cube-tip",props:{cube:{}},setup(e){const{status:t}=e.cube;return(e,n)=>(Rr(),Dr("div",{class:"cube-tip",style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type},[Gr(Zs,{cube:e.cube.box},null,8,["cube"])],12,ax))}}),cx=(0,io.A)(lx,[["__scopeId","data-v-6a048f7f"]]);class dx extends Jl{constructor(e){super(e)}}function ux(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class hx extends ic{_status=new dx(this);_box;constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get component(){return cx}get box(){return this._box}set box(e){this._box=e}get children(){return[this.box]}replace_id(e,t={}){return hx.replace_id(this.root,e,t)}build_child(e){this.box=new kd(e.info,this)}update_data(e,t){return hx.update_data(e,t)}export(){const e=this.base_export();return e.info=this.box.export(),e}gc(){super.base_gc()}on_insert_child(e){const{courier:t}=this,{pos:n,data:i}=e,r=t.get_recorder();if(r.add_cmd(e),0===i.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const o=this.create_child_block(i);this.splice(s,0,...o),r.add_recover(Ts.delete_child(this.id,"backward",[s,s+o.length]));const a=this.children[s+1];return a?r.tell(a,zs.in_head(a.id)):r.tell(this.child_last,zs.in_tail(this.child_last.id)),r}on_delete_child(e){const{courier:t,pid:n,index:i,pcube:r}=this,s=t.get_recorder();s.add_cmd(e);const{dir:o,range:a}=e,[l,c]=a;let d=l<0?0:l,u=c>this.child_count?this.child_count:c;if(d>=u)return;if(d<=0&&u>=this.child_count)return this.is_empty?s.tell(r,Ts.delete_child(n,o,[i,i+1])):s.tell(this,Ts.reset(this.id,[])),s;const h=this.children[d-1],p=this.children[u],_=u-d;let f=this.splice(l,_);return s.add_recover(Ts.insert_child(this.id,f.data,l)),"backward"===o?h?s.tell(h,zs.in_tail(h.id)):p&&s.tell(p,zs.in_head(p.id)):"forward"===o&&(p?s.tell(p,zs.in_head(p.id)):h&&s.tell(h,zs.in_tail(h.id))),s}get meta(){return hx.meta}static get meta(){return{cubename:"提示",type:n.tip,block:!0,version:1,show:!0}}static get_default(e,t={},i={}){return{id:rc.get_id(),type:n.tip,info:kd.get_default(e),attrs:i,css:t}}static get_default_by_string(e,t={},i={}){const r=gd.get_default_by_string(e),s=kd.get_default([r]);return{id:rc.get_id(),type:n.tip,info:s,attrs:i,css:t}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,t.info=kd.replace_id(e,t.info,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}ux([Os(w.cube_insert_child)],hx.prototype,"on_insert_child",null),ux([Os(w.cube_delete_child)],hx.prototype,"on_delete_child",null);const px={class:"map-status"},_x=jn({__name:"submap-status",props:{cube:{}},setup(e){const{status:t}=e.cube;function n(t){const n=e.cube.dom_rect,i={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(i,t,t)}return(e,i)=>(Rr(),Dr("div",px,[$r("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>n(-.1))}),$r("span",null,Ce((100*t.matrix2d.a).toFixed(0)+"%"),1),$r("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>n(.1))})]))}}),fx=(0,io.A)(_x,[["__scopeId","data-v-149cf788"]]),mx=["id","data-type"],gx=["transform"],bx=["data-group"],yx=["data-group"],vx=["data-group"],wx=["data-group"],xx=["d"],kx=["d","marker-start","marker-end"],Sx=["d"],Cx=jn({__name:"cube-submap",props:{cube:{}},setup(e){const{status:t}=e.cube,n=Kt(),i=Kt(),r=new ResizeObserver(t=>{e.cube.get_view_rect()}),s=Kt();let o;function l(){e.cube.dom_svg_rect}return ii(()=>{const t=i.value;t&&r.observe(t);const a=n.value;a&&e.cube.interaction.register(a);const l=s.value;if(!l)return;o=new Ws.DragDiff(l);let c=e.cube.attrs.width,d=e.cube.attrs.height,u=c,h=d;o.register_down(()=>{c=e.cube.attrs.width,d=e.cube.attrs.height}),o.register_move((e,t)=>{u=Math.round(e+c),h=Math.round(t+d),a.style.width=u+"px",a.style.height=h+"px"}),o.register_up((t,n)=>{if(c===u&&d===h)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+c),s=Math.round(n+d);i.tell(e.cube,Ts.resize(e.cube.id,r,s)),e.cube.history.record(i),e.cube.check_show()}),o.register_cancel(()=>{e.cube.attrs.width=c,e.cube.attrs.height=d})}),ai(()=>{o?.off()}),(e,r)=>(Rr(),Dr("div",{class:"cube-submap",id:e.cube.id,style:fe(en(t).css),"data-type":e.cube.type,ref_key:"box",ref:n,onClick:l},[(Rr(),Dr("svg",{ref_key:"svg",ref:i},[$r("g",{transform:en(t).matrix2d_dom_string},[$r("g",{"data-group":en(a).markers,class:"group-defs"},[...r[0]||(r[0]=[Yr('<defs data-v-7a176360>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-7a176360><path d="M 0 0 L 6 3 L 0 6 z" data-v-7a176360></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-7a176360><circle cx="3" cy="3" r="3" data-v-7a176360></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-7a176360><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-7a176360></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-7a176360><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-7a176360></rect></marker></defs>',1)])],8,bx),$r("g",{"data-group":en(a).linkers,class:"group-linkers"},[(Rr(!0),Dr(Mr,null,gi(en(t).linkers_view,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],8,yx),$r("g",{"data-group":en(a).nodes,class:"group-nodes"},[(Rr(!0),Dr(Mr,null,gi(en(t).nodes_view,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],8,vx),$r("g",{"data-group":en(a).placeholder,class:"group-placeholder"},[en(t).placeholder_box_selector?(Rr(),Dr("path",{key:0,class:"placeholder-box-selector",d:en(t).placeholder_box_selector},null,8,xx)):Xr("v-if",!0),(Rr(!0),Dr(Mr,null,gi(en(t).placeholder_linkers,e=>(Rr(),Dr(Mr,null,[e?(Rr(),Dr("path",{key:0,class:"placeholder-linker",d:e.path,style:fe({stroke:e.stroke,"stroke-width":e.width}),"marker-start":`url(#${e.anchor_start})`,"marker-end":`url(#${e.anchor_end})`},null,12,kx)):Xr("v-if",!0)],64))),256)),en(t).placeholder_line_delete?(Rr(),Dr("path",{key:1,class:"placeholder-line-delete",d:en(t).placeholder_line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,Sx)):Xr("v-if",!0),Gr(co,{interaction:e.cube.interaction},null,8,["interaction"])],8,wx)],8,gx)],512)),Gr(fx,{cube:e.cube},null,8,["cube"]),$r("div",{class:"submap-dragger",ref_key:"dragger",ref:s},null,512)],12,mx))}}),Mx=(0,io.A)(Cx,[["__scopeId","data-v-7a176360"]]);class Ax extends Jl{_nodes_count=Kt(0);_view_rect=Dt({x:0,y:0,width:0,height:0});_nodes_view=Bt(new Set);_linkers_view=Bt(new Set);_nodes_selected=Bt(new Set);_nodes_editing=Bt(new Set);_line_delete_selected=Bt(new Set);_placeholder_linkers=Dt([]);_placeholder_box_selector=Kt("");_placeholder_line_delete=Kt("");constructor(e){super(e)}get css(){return{...super.css,width:this.attrs.width+"px",height:this.attrs.height+"px"}}get attrs(){return this._data.attrs}get matrix2d(){return{...this.attrs.matrix2d}}get line_delete_selected(){return new Set(this._line_delete_selected)}get view_rect(){return{...this._view_rect}}get view_center(){const e=this._view_rect;return{x:e.x+e.width/2,y:e.y+e.height/2}}get nodes_count(){return this._nodes_count.value}get map(){return this._cube}get matrix2d_dom_string(){return $l.get_dom_string(this.matrix2d)}get placeholder_linkers(){return[...this._placeholder_linkers]}get placeholder_box_selector(){return this._placeholder_box_selector.value}get placeholder_line_delete(){return this._placeholder_line_delete.value}get nodes_view(){return new Set(this._nodes_view)}get linkers_view(){return new Set(this._linkers_view)}get nodes_selected(){return new Set(this._nodes_selected)}get nodes_editing(){return new Set(this._nodes_editing)}reset_nodes_view(e){return Promise.resolve().then(()=>{this._nodes_view.clear();for(let t of e)this._nodes_view.add(t)})}reset_linkers_view(e){return Promise.resolve().then(()=>{this._linkers_view.clear();for(let t of e)this._linkers_view.add(t)})}remove_linker(e){return Promise.resolve().then(()=>{this._linkers_view.delete(e),this._line_delete_selected.delete(e)})}remove_node(e){return Promise.resolve().then(()=>{this._nodes_view.delete(e),this._nodes_selected.delete(e),this._nodes_editing.delete(e),this._line_delete_selected.delete(e),this._nodes_count.value--})}set_node_visible(e,t){return Promise.resolve().then(()=>{t?this._nodes_view.add(e):this._nodes_view.delete(e)})}set_linker_visible(e,t){return Promise.resolve().then(()=>{t?this._linkers_view.add(e):this._linkers_view.delete(e)})}set_node_editing(e,t){return Promise.resolve().then(()=>{t?this._nodes_editing.add(e):this._nodes_editing.delete(e)})}set_node_selected(e,t){return Promise.resolve().then(()=>{t?this._nodes_selected.add(e):this._nodes_selected.delete(e)})}set_line_deleted(e,t){return Promise.resolve().then(()=>{t?this._line_delete_selected.add(e):this._line_delete_selected.delete(e)})}is_node_visible(e){return this._nodes_view.has(e)}is_linker_visible(e){return this._linkers_view.has(e)}is_node_editing(e){return this._nodes_editing.has(e)}is_node_selected(e){return this._nodes_selected.has(e)}is_line_deleted(e){return this._line_delete_selected.has(e)}clear_line_deleted(){this._line_delete_selected.clear()}clear_node_editing(){for(let e of this.nodes_editing)e.editable=!1;this._nodes_editing.clear()}clear_node_selected(){this._nodes_selected.clear()}update_matrix2d(e){return Promise.resolve().then(()=>{Object.assign(this.attrs.matrix2d,e||this.map.matrix2d)})}update_view_rect(e){return Promise.resolve().then(()=>{Object.assign(this._view_rect,e)})}update_placeholder_box_selector(e){this._placeholder_box_selector.value=e}update_placeholder_line_delete(e){this._placeholder_line_delete.value=e}update_placeholder_linkers(e){this._placeholder_linkers.length=0,this._placeholder_linkers.push(...e)}add_placeholder_linker(e){this._placeholder_linkers.push(e)}update_nodes_count(e){return Promise.resolve().then(()=>{this._nodes_count.value=e})}}function Tx(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class zx extends ic{_status=new Ax(this);_interaction=new Yd(this);_has_layout=!1;_display_success=!1;_grider=new cu(this);data;_nodes=new Map;_linkers=new Map;_node_from=this.data.info.node_from;_node_to=this.data.info.node_to;_nodes_editing=new Set;_nodes_selected=new Set;_line_delete_selected=new Set;_view_nodes=new Set;_view_linkers=new Set;_view_rect={x:0,y:0,width:0,height:0};constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get grider(){return this._grider}get nodes(){return new Map(this._nodes)}get linkers(){return new Map(this._linkers)}get nodes_selected(){return new Set(this._nodes_selected)}get nodes_editing(){return new Set(this._nodes_editing)}get nodes_view(){return new Set(this._view_nodes)}get linkers_view(){return new Set(this._view_linkers)}get line_deleted(){return new Set(this._line_delete_selected)}get nodes_count(){return Object.keys(this.nodes).length}get linkers_count(){return Object.keys(this.linkers).length}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get view_rect(){return{...this._view_rect}}get matrix2d(){return{...this.attrs.matrix2d}}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get matrix2d_dom_string(){return $l.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return zx.meta}get component(){return Mx}find_layout_root(e){const t=new Set;for(let n of e){n.is_layout_root&&t.add(n)}return t}wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}find_cube(e){const t=this.linkers.get(e);if(t)return t;for(let t of Object.values(this.nodes)){const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){}check_show(){this.check_show_node(),this.check_show_line()}check_show_node(){const e=this._grider.get_viewport_griders();this._view_nodes.clear();for(let t of e)for(let e of t.nodes)e.env.folded_upstream||this._view_nodes.add(e)}check_show_line(){this._view_linkers.clear();for(let e of this._view_nodes)e.check_show_line()}layout(){for(let e of Object.values(this.nodes))e.is_layout_root&&e.attrs.layout&&e.layout()}layout_throttle=Ws.Notice.throttle(this.layout.bind(this),10);check_show_throttle=Ws.Notice.throttle(this.check_show.bind(this),10);env_flow(){const e=[];for(let t of Object.values(this.nodes))t.is_layout_root&&e.push(t);for(let t of e)t.env.flow()}check_in_view(e){const{innerHeight:t,innerWidth:n}=window;return!(e.y>t||e.y+e.height<0)&&!(e.x>n||e.x+e.width<0)}async build_child(e){const{nodes:t,linkers:n}=e.info,i=rc.build_cubes(t,this);for(let e of i)this._nodes.set(e.id,e),this._view_nodes=Bt(new Set(i));await this.wait_nodes_render(i),this.env_flow(),await this.layout(),this._has_layout=!0;for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const i=new Ld(e,this);this._linkers.set(i.id,i)}}update_data(e,t){return zx.update_data(e,t)}export(){const e=zx.get_default();e.id=this.id,e.css=structuredClone(Vt(this.css)),e.attrs=structuredClone(Vt(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:structuredClone(Vt(this._node_from)),node_to:structuredClone(Vt(this._node_to))};for(let e of this._nodes.values())t.push(e.export());for(let e of this._linkers.values())n.push(e.export());return e}remove_node(e){this._nodes.delete(e.id),this._view_nodes.delete(e),this.status.set_node_visible(e,!1),this.grider.remove_node(e),this.status.remove_node(e),e.gc()}remove_linker(e){const t=this._node_to[e.from_id],n=this._node_from[e.to_id];let i;if(t&&n){const r=t.indexOf(e.to_id),s=n.indexOf(e.from_id);t.splice(r,1),n.splice(s,1),i={linker:e.export(),index_to:r,index_from:s}}return this._linkers.delete(e.id),this._view_linkers.delete(e),this.status.set_linker_visible(e,!1),this.status.remove_linker(e),e.gc(),i}on_node_add(e){const{data:t}=e,{cursor:n,courier:i,history:r}=this,s=i.get_recorder();s.add_cmd(e);const o=rc.build_cubes(t,this);this.pick(...o);const a=t.map(e=>e.id);return s.add_recover(Is.node_remove(this.id,a)),Promise.resolve().then(async()=>{const e=o.map(e=>e.wait_layout_self());await Promise.all(e);const t=new Set;for(let e of o){const n=Gl.find_line_to_layout_root(e);n.has_root&&n.line[1]&&t.add(n.line[1])}for(let e of t)e.env.flow(),e.map2d.flow("self"),e.map2d.flow("upstream")}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set,l=new Set,c=new Set;for(let e of t){const t=this.get_node(e);if(t){a.add(t);for(let e of t.env.downstream_nodes)a.add(e)}}for(let e of a){for(const t of e.linkers_from)c.add(t.id);for(const t of e.linkers_to)c.add(t.id)}for(let e of a){o.push(e.export());const t=e.env.layout_root;t&&t!==e&&l.add(e.env.layout_root),this.remove_node(e)}return s.tell(this,Is.linker_remove(this.id,[...c])),s.add_recover(Is.node_add(this.id,o)),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this,s=n.get_recorder();if(0===t.length)return;s.add_cmd(e);let o=Promise.resolve();const a=[],l=new Set,c=[];for(let e of t){const{index_to:t,index_from:n,linker:i}=e,r=new Ld(i,this),s=r.from_node,o=r.to_node;if(!s||!o)continue;this.pick(r);let d=this._node_from[r.to_id],u=this._node_to[r.from_id];if(d?d.indexOf(r.from_id)<0&&d.splice(n,0,r.from_id):this._node_from[r.to_id]=[r.from_id],u?u.indexOf(r.to_id)<0&&u.splice(t,0,r.to_id):this._node_to[r.from_id]=[r.to_id],c.unshift(r.id),!o.env.is_captive){const{has_root:e,line:t}=Gl.find_line_to_layout_root(o);a.push(o.wait_layout_self()),t[1]&&l.add(t[1])}}const d=new Set;for(let e of l){e.env.flow(),e.map2d.flow("upstream");const t=e.env.layout_root;t&&d.add(t)}return s.add_recover(Is.linker_remove(this.id,c)),o.then(async()=>{await Promise.all(a);for(let e of d)e.layout_throttle()}),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:i,history:r}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const o=[],a=new Set,l=new Set;for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=t.from_node,i=t.to_node;n&&a.add(n),i&&l.add(i);const r=this.remove_linker(t);r&&o.unshift(r)}if(0===o.length)return;for(let e of l){if(!e.env.check_env(!1).has_root){const t=Ds.layout_change(e.id,{root:!0});s.tell(e,t)}}const c=new Set;for(let e of a){e.env.flow(),e.map2d.flow("downstream"),e.map2d.flow("upstream");const t=e.env.layout_root;t&&c.add(t)}for(let e of c)e.layout_throttle();return s.add_recover(Is.linker_add(this.id,o)),s}replace_id(e,t={}){return zx.replace_id(this.root,e,t)}pick(...e){for(let t of e)t instanceof Yl?(this._nodes.set(t.id,t),this._view_nodes.add(t),this.status.set_node_visible(t,!0)):t instanceof Ld&&(this._linkers.set(t.id,t),this._view_linkers.add(t),this.status.set_linker_visible(t,!0));this.status.update_nodes_count(this._nodes.size)}get_nodes_all(){return{...this._nodes}}get_linkers_all(){return{...this._linkers}}get_nodes_selected(){return new Set(this._nodes_selected)}get_nodes_view(){return new Set(this._view_nodes)}get_nodes_intersection(e){let t=[];for(let n of this._nodes.values()){const i=n.map2d.rect;Ws.MathRect.check_intersection(e,i)&&t.push(n)}return t}get_linkers_view(){return new Set(this._view_linkers)}get_line_deleted(){return new Set(this._line_delete_selected)}get_linker_id(e,t){return Gl.get_linker_id(e,t)}get_linker(e){return this._linkers.get(e)}get_node(e){return this._nodes.get(e)}get_node_from(e){return this._node_from[e]}get_node_to(e){return this._node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_svg_rect,i=Math.max(n.left,0),r=Math.min(n.right,t),s={x:i,y:Math.max(0,n.top)},o={x:r,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y,u={x:a.x,y:a.y,width:c,height:d};return Object.assign(this._view_rect,u),u}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.view_rect,t=[],n=this.grider.get_intersection_nodes(e);t.push(...n);for(let e of n)t.push(...e.linkers_from),t.push(...e.linkers_to);return t}set_linker_visible(e,t){t?this._view_linkers.add(e):this._view_linkers.delete(e)}set_node_visible(e,t){t?this._view_nodes.add(e):this._view_nodes.delete(e)}set_node_editing(e,t){t?this._nodes_editing.add(e):this._nodes_editing.delete(e)}set_node_selected(e,t){t?this._nodes_selected.add(e):this._nodes_selected.delete(e)}set_line_deleted(e,t){t?this._line_delete_selected.add(e):this._line_delete_selected.delete(e)}clear_node_editing(){for(let e of this._nodes_editing)e.editable=!1;this._nodes_editing.clear()}clear_node_selected(){this._nodes_selected.clear()}clear_line_deleted(){this._line_delete_selected.clear()}is_node_editing(e){return this._nodes_editing.has(e)}is_node_visible(e){return this._view_nodes.has(e)}is_linker_visible(e){return this._view_linkers.has(e)}is_node_selected(e){return this._nodes_selected.has(e)}is_line_deleted(e){return this._line_delete_selected.has(e)}get_farest_node_selected(e){if(0!==this._nodes_selected.size){if(e===P.left){let e;for(let t of this._nodes_selected){const n=t.map2d.rect;(!e||n.x<e.map2d.pos.x)&&(e=t)}return e}if(e===P.right){let e;for(let t of this._nodes_selected){const n=t.map2d.rect,i=e?.map2d.rect;(!i||n.x+n.width>i.x+i.width)&&(e=t)}return e}if(e===P.down){let e;for(let t of this._nodes_selected){const n=t.map2d.rect,i=e?.map2d.rect;(!i||n.y+n.height>i.y+i.height)&&(e=t)}return e}if(e===P.up){let e;for(let t of this._nodes_selected){const n=t.map2d.rect,i=e?.map2d.rect;(!i||n.y<i.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.map2d.rect;let i=e,r=1/0;if(t===P.left)for(let t of this._nodes.values()){if(!t.show||e===t)continue;const s=t.map2d.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.right)for(let t of this._nodes.values()){if(e===t)continue;let s=t.map2d.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.up)for(let t of this._nodes.values()){if(e===t)continue;let s=t.map2d.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}else if(t===P.down)for(let t of this._nodes.values()){if(e===t)continue;let s=t.map2d.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=Ws.MathRect.distance_with(n,s);o<r&&(i=t,r=o)}return i}move_select(e){if(0===this._nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.set_node_selected(n,!0),n.move_in_fig_view()}reset_matrix(e){Object.assign(this.matrix2d,e),this.status.update_matrix2d(e)}translate(e,t){const n=$l.multiply(this.matrix2d,$l.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:i,map_scale_min:r}=this.config.data,s=this.matrix2d.a+t;if(s>i||s<r)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=$l.multiply(this.matrix2d,$l.get_matrix_translate(o.x-l.x,o.y-l.y));this.reset_matrix(c)}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:i}=this.get_upstream_sum_scale();let{x:r,y:s}=e;return{x:(r-t.x)/n,y:(s-t.y)/i}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+i*l+s,y:n*a+r*l+o}}untransform_point(e){const{a:t,b:n,c:i,d:r,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-i*l)/t,y:(l-o-n*a)/r}}static get meta(){return{type:n.submap,cubename:"子图",version:2,block:!0,show:!0}}static get_default(e=400,t=200){return{id:rc.get_id(),type:n.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:$l.get_default(),width:e,height:t}}}static replace_id(e,t,n={}){const i=t.id,r=rc.get_id();return n[i]=r,t.id=r,rc.replace_id(e,t.info.nodes,n),rc.replace_id(e,t.info.linkers,n),t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:(e<2&&(t.attrs.matrix2d=$l.get_default()),{usable:!0,data:t})}}Tx([Os(k.node_add)],zx.prototype,"on_node_add",null),Tx([Os(k.node_remove)],zx.prototype,"on_node_remove",null),Tx([Os(k.linker_add)],zx.prototype,"on_linker_add",null),Tx([Os(k.linker_remove)],zx.prototype,"on_linker_remove",null);const Px=["id","data-type"],Nx=jn({__name:"cube-box-columns",props:{cube:{}},setup(e){const{status:t}=e.cube,n=Kt(),i=Kt();let r;function s(){const e=t.attrs;return e.column_count?{"column-count":e.column_count}:e.column_width?{"column-width":e.column_width+"px"}:{}}return ii(()=>{const t=n.value;if(!t)return;const s=i.value;if(!s)return;r=new Ws.DragDiff(s);let o=e.cube.attrs.width,a=e.cube.attrs.height,l=o,c=a;r.register_down(()=>{o=e.cube.attrs.width,a=e.cube.attrs.height}),r.register_move((n,i)=>{l=Math.round(n+o),l<e.cube.min_width&&(l=e.cube.min_width),t.style.width=l+"px",t.style.height=c+"px"}),r.register_up((t,n)=>{if(o===l&&a===c)return;const i=e.cube.courier.get_recorder(),r=Math.round(t+o);i.tell(e.cube,Ts.resize(e.cube.id,r)),e.cube.history.record(i)}),r.register_cancel(()=>{e.cube.attrs.width=o,e.cube.attrs.height=a})}),ai(()=>{r?.off()}),(e,r)=>(Rr(),Dr("div",{class:"cube-box-columns",ref_key:"box",ref:n,style:fe(en(t).css),id:e.cube.id,"data-type":e.cube.type,onContextmenu:r[0]||(r[0]=t=>en(_a)(t,e.cube))},[$r("div",{class:"box-columns-content",style:fe(s())},[(Rr(!0),Dr(Mr,null,gi(en(t).children,e=>(Rr(),Br(Zs,{key:e.id,cube:e},null,8,["cube"]))),128))],4),$r("div",{class:"box-columns-dragger",ref_key:"dragger",ref:i},null,512)],44,Px))}}),Rx=(0,io.A)(Nx,[["__scopeId","data-v-563d8528"]]);class Ox extends Jl{constructor(e){super(e)}get css(){const{width:e}=this.attrs;return{...super.css,width:e+"px"}}}function Lx(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Ex extends ic{_status=new Ox(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get component(){return Rx}get attrs(){return this.data.attrs}get meta(){return Ex.meta}get min_width(){return 200}build_child(e){rc.build_cubes(e.info,this,this._children)}update_data(e,t){return Ex.update_data(e,t)}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}gc(){this.base_gc()}replace_id(e,t){return Ex.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:i}=e,r=t.get_recorder();r.add_cmd(e);const s=rc.build_cubes(e.data,this),o=this.child_count;return this.splice(this.child_count,0,...s),r.add_recover(Ts.delete_child(this.id,"backward",[o,this.child_count])),r}on_delete_child(e){const{courier:t,history:n}=this,{dir:i,range:r,reserve:s}=e,o=t.get_recorder(),a=this.get_valid_index(r[0]),l=this.get_valid_index(r[1]),c=[],d=this.splice(a,l-a);for(let e of d.children)c.push(e.export());return o.add_recover(Ts.insert_child(this.id,c,a)),this.status.update_children(),o}static replace_id(e,t,n){const i=t.id,r=n[i]||rc.get_id();return n[i]=r,t.id=r,rc.replace_id(e,t.info,n),t}static get_default(){const e=kd.get_default(),t=kd.get_default(),i=kd.get_default();return{id:rc.get_id(),type:n.box_columns,info:[e,t,i],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:n.box_columns,block:!0,version:1,show:!0}}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{data:t,usable:!0}}}Lx([Os(w.cube_insert_child)],Ex.prototype,"on_insert_child",null),Lx([Os(w.cube_delete_child)],Ex.prototype,"on_delete_child",null);class Ix extends Jl{constructor(e){super(e)}}class Dx{static reset(e,t){return{id:e,name:v.reset_explanation,explanation:t}}}const Bx=["id","data-type"],jx=jn({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t,status:n}=e.cube;function i(){t.emit_show_cube_editor(e.cube)}return(t,r)=>(Rr(),Dr("ruby",{class:"cube-rt",id:t.cube.id,style:fe(en(n).css),"data-type":t.cube.type,onClick:i},[Wr(Ce(en(n).info.text)+" ",1),$r("rt",{style:fe({"font-size":`max(calc(0.6 * ${e.cube.css["font-size"]||"16px"}),${Fx.min_size}px)`})},Ce(en(n).info.explanation),5),r[0]||(r[0]=Wr("​ ",-1))],12,Bx))}}),qx=jx;class Fx extends ic{_status=new Ix(this);constructor(e,t){super(e,t),this.setup(),this.status.init()}get status(){return this._status}get info(){return this.data.info}get component(){return qx}get meta(){return Fx.meta}build_child(e){}update_data(e,t){return Fx.update_data(e,t)}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return Fx.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,i=n.get_recorder();i.add_cmd(e);const r=this.info.explanation;this.info.explanation=t;const s=Dx.reset(this.id,r);return i.add_recover(s),this.status.update_info(),i}static get min_size(){return 12}static get scale(){return.6}static get meta(){return{cubename:"标注文本",type:n.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",i={}){return{id:rc.get_id(),type:n.rt,info:{text:e,explanation:t},attrs:{},css:i}}static replace_id(e,t,n){const i=t.id;return t.id=n[i]||rc.get_id(),n[i]=t.id,t}static update_data(e,t){return e>this.meta.version?{data:t,usable:!1}:{usable:!0,data:t}}}!function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([Os(v.reset_explanation)],Fx.prototype,"reset_explanation",null)})(),s})());