agentengine-sdk-python 0.8.7__py3-none-any.whl → 0.8.9__py3-none-any.whl

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 (285) hide show
  1. {agentengine_sdk_python-0.8.7.dist-info → agentengine_sdk_python-0.8.9.dist-info}/METADATA +22 -20
  2. {agentengine_sdk_python-0.8.7.dist-info → agentengine_sdk_python-0.8.9.dist-info}/RECORD +259 -221
  3. ksadk/__init__.py +2 -1
  4. ksadk/_build_provenance.json +1 -1
  5. ksadk/_mcp_compat.py +305 -0
  6. ksadk/agent.py +29 -0
  7. ksadk/agui/_agent_kernel.py +176 -142
  8. ksadk/agui/agent.py +75 -6
  9. ksadk/agui/hosted.py +343 -0
  10. ksadk/agui/request_identity.py +11 -0
  11. ksadk/agui/routes.py +77 -2
  12. ksadk/builders/code_builder.py +30 -23
  13. ksadk/builders/container_builder.py +5 -5
  14. ksadk/builders/framework_requirements.py +1 -1
  15. ksadk/builders/mcp_builder.py +142 -0
  16. ksadk/builders/project_imports.py +66 -0
  17. ksadk/cli/cmd_mcp.py +1 -1
  18. ksadk/cli/cmd_run.py +6 -4
  19. ksadk/cli/cmd_web.py +12 -0
  20. ksadk/cli/runtime_bootstrap.py +4 -1
  21. ksadk/cli/runtime_logging.py +30 -0
  22. ksadk/common/cloud_headers.py +33 -6
  23. ksadk/compat/adk_compat.py +2 -0
  24. ksadk/compat/adk_stream.py +35 -0
  25. ksadk/configs/env_registry.py +31 -0
  26. ksadk/context_engine/capabilities.py +13 -9
  27. ksadk/conversations/context.py +5 -0
  28. ksadk/conversations/message_projection.py +28 -19
  29. ksadk/conversations/projector.py +6 -0
  30. ksadk/conversations/runtime_compaction.py +6 -2
  31. ksadk/conversations/runtime_input.py +4 -0
  32. ksadk/conversations/runtime_invocation.py +5 -1
  33. ksadk/conversations/runtime_metadata.py +6 -7
  34. ksadk/conversations/runtime_observability.py +1 -0
  35. ksadk/conversations/runtime_payloads.py +5 -1
  36. ksadk/conversations/runtime_persistence.py +23 -0
  37. ksadk/conversations/runtime_preparation.py +128 -5
  38. ksadk/detection/mcp_detector.py +80 -22
  39. ksadk/events/adapters/langgraph.py +53 -1
  40. ksadk/harness/__init__.py +3 -0
  41. ksadk/harness/service_presentation.py +44 -0
  42. ksadk/harness/service_runtime.py +1038 -0
  43. ksadk/interaction/providers/harness.py +9 -4
  44. ksadk/kernel/control.py +16 -22
  45. ksadk/kernel/history_projection.py +191 -58
  46. ksadk/kernel/ingress.py +50 -26
  47. ksadk/kernel/postgres_event_log.py +10 -2
  48. ksadk/kernel/postgres_store.py +81 -2
  49. ksadk/kernel/run_references.py +38 -0
  50. ksadk/kernel/worker.py +2 -2
  51. ksadk/kernel/worker_controls.py +11 -1
  52. ksadk/kernel/worker_identity.py +15 -8
  53. ksadk/knowledge_base/client.py +10 -3
  54. ksadk/mcp_runtime/oauth/_agent.py +77 -9
  55. ksadk/mcp_runtime/oauth/kernel.py +5 -0
  56. ksadk/mcp_runtime/oauth/langgraph.py +47 -15
  57. ksadk/mcp_runtime/oauth/local/broker.py +41 -9
  58. ksadk/mcp_runtime/oauth/local/protocol.py +3 -11
  59. ksadk/mcp_runtime/oauth/local/transport.py +9 -2
  60. ksadk/mcp_runtime/oauth/tools.py +46 -8
  61. ksadk/mcp_runtime/oauth/transport.py +19 -2
  62. ksadk/memory/adk/backends/sdk_ltm_backend.py +21 -12
  63. ksadk/memory/scope_ids.py +49 -0
  64. ksadk/plugins/providers/harness.py +65 -28
  65. ksadk/plugins/providers/harness_service.py +198 -0
  66. ksadk/plugins/providers/harness_service_context.py +175 -0
  67. ksadk/plugins/providers/harness_service_hooks.py +168 -0
  68. ksadk/plugins/providers/harness_service_memory.py +479 -0
  69. ksadk/plugins/providers/platform_resources.py +2 -2
  70. ksadk/resource_runtime/contracts.py +39 -1
  71. ksadk/resource_runtime/langgraph.py +7 -3
  72. ksadk/resource_runtime/managed_projection.py +8 -6
  73. ksadk/resource_runtime/mcp_server.py +3 -3
  74. ksadk/resource_runtime/worker.py +27 -5
  75. ksadk/runners/_adk_canonical_stream.py +53 -24
  76. ksadk/runners/_adk_tunnel_history.py +96 -0
  77. ksadk/runners/_langgraph_answer_contract.py +1 -7
  78. ksadk/runners/_langgraph_canonical_stream.py +29 -6
  79. ksadk/runners/_langgraph_context.py +265 -0
  80. ksadk/runners/_langgraph_factory.py +79 -0
  81. ksadk/runners/_langgraph_model_budget.py +397 -0
  82. ksadk/runners/_langgraph_runner_streams.py +13 -6
  83. ksadk/runners/_session_identity.py +8 -3
  84. ksadk/runners/adk_runner.py +104 -36
  85. ksadk/runners/langgraph_runner.py +145 -29
  86. ksadk/runners/usage_accumulator.py +40 -0
  87. ksadk/runtime/conversation_execution.py +26 -4
  88. ksadk/runtime/factory.py +17 -5
  89. ksadk/runtime/framework_adapters.py +10 -0
  90. ksadk/runtime/langgraph_checkpoint_view.py +28 -7
  91. ksadk/runtime/launch.py +2 -0
  92. ksadk/server/factory.py +58 -1
  93. ksadk/server/routes/common.py +2 -0
  94. ksadk/server/routes/control.py +24 -8
  95. ksadk/server/routes/harness_service_view.py +38 -0
  96. ksadk/server/routes/history_items.py +157 -0
  97. ksadk/server/routes/kernel_ingress.py +51 -12
  98. ksadk/server/routes/local_kernel_control.py +16 -0
  99. ksadk/server/routes/models.py +26 -0
  100. ksadk/server/routes/openai_compat.py +10 -3
  101. ksadk/server/routes/projection.py +4 -0
  102. ksadk/server/routes/run.py +4 -2
  103. ksadk/server/routes/sessions.py +20 -1
  104. ksadk/server/routes/ui_bootstrap.py +16 -2
  105. ksadk/server/static/assets/{ArtifactsPanel-Cdr5C_vM.js → ArtifactsPanel-iZ_6CAQ2.js} +1 -1
  106. ksadk/server/static/assets/{CodeBlock-BWRafud9.js → CodeBlock-D6uglm5n.js} +1 -1
  107. ksadk/server/static/assets/{MathMessageMarkdown-CFKeJIvy.js → MathMessageMarkdown-D6ojdxCG.js} +1 -1
  108. ksadk/server/static/assets/{MermaidBlock-BneAGUOd.js → MermaidBlock-Csk2ivT7.js} +6 -6
  109. ksadk/server/static/assets/{NativeTerminalPanel-BHI85zDO.js → NativeTerminalPanel-CCJA1XSH.js} +1 -1
  110. ksadk/server/static/assets/{OfficialA2uiRenderer-BOmT36lJ.js → OfficialA2uiRenderer-C06jus9N.js} +1 -1
  111. ksadk/server/static/assets/{abnfDiagram-VCTEODGH-DQvlOsBI.js → abnfDiagram-VCTEODGH-BhrF5tmL.js} +1 -1
  112. ksadk/server/static/assets/{arc-CGx0e4pN.js → arc-Btsh3kfy.js} +1 -1
  113. ksadk/server/static/assets/architecture-7GRP2DOG-BSXho3cq.js +1 -0
  114. ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-WyybcNKX.js → architectureDiagram-5GKGNRK7-Cl8MfAmp.js} +1 -1
  115. ksadk/server/static/assets/{blockDiagram-NRAW4CY4-C9Cx_GVs.js → blockDiagram-NRAW4CY4-CeHSr8E_.js} +1 -1
  116. ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-Bh7X3bGr.js → c4Diagram-UCG6FXSJ-BSD7RUKo.js} +1 -1
  117. ksadk/server/static/assets/channel-BpyDVKis.js +1 -0
  118. ksadk/server/static/assets/chunk-2Q5K7J3B-HLcpmPI2.js +1 -0
  119. ksadk/server/static/assets/{chunk-5VM5RSS4-cP9XupZj.js → chunk-5VM5RSS4-wz0pkBjp.js} +1 -1
  120. ksadk/server/static/assets/{chunk-F27PBJKO-Bm77fvR9.js → chunk-F27PBJKO-shjQ7cPM.js} +1 -1
  121. ksadk/server/static/assets/{chunk-G27WJ6UU-DDKNPesQ.js → chunk-G27WJ6UU-DL_MfUsu.js} +1 -1
  122. ksadk/server/static/assets/{chunk-JWPE2WC7-BqiUDB7s.js → chunk-JWPE2WC7-moUdwYpb.js} +1 -1
  123. ksadk/server/static/assets/{chunk-LCL6LL3I-C528mMZy.js → chunk-LCL6LL3I-B3QcDsZM.js} +1 -1
  124. ksadk/server/static/assets/{chunk-POPQ4Y6H-CzZ9g_Uf.js → chunk-POPQ4Y6H-BLBKb48A.js} +1 -1
  125. ksadk/server/static/assets/{chunk-RHFEMEQ7-CXj4tUZ-.js → chunk-RHFEMEQ7-CXR6ZzOx.js} +1 -1
  126. ksadk/server/static/assets/{chunk-SVP7TREG-BHyd85pS.js → chunk-SVP7TREG-DoR8BxkO.js} +1 -1
  127. ksadk/server/static/assets/{chunk-XXDRQBXY-Qe29PHGe.js → chunk-XXDRQBXY-8HJaIq0q.js} +1 -1
  128. ksadk/server/static/assets/classDiagram-DTDB5LWJ-DlNiRtSN.js +1 -0
  129. ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-DlNiRtSN.js +1 -0
  130. ksadk/server/static/assets/{cose-bilkent-JH36ORCC-maRKgeec.js → cose-bilkent-JH36ORCC-DnSSHHqS.js} +1 -1
  131. ksadk/server/static/assets/cynefin-OW5HDTMX-DxNym3qg.js +1 -0
  132. ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-CoD0bEvn.js → cynefinDiagram-5FMLGOSQ-4eCi_Rw5.js} +1 -1
  133. ksadk/server/static/assets/{dagre-3AP2YEHR-BkpgQqyW.js → dagre-3AP2YEHR-DpPk9jsh.js} +1 -1
  134. ksadk/server/static/assets/{dagre-BUaTFrYa.js → dagre-G789Mawt.js} +1 -1
  135. ksadk/server/static/assets/{diagram-S7CK7UJ4-25HdTbjE.js → diagram-S7CK7UJ4-7x2FScRJ.js} +1 -1
  136. ksadk/server/static/assets/{diagram-UQ7AKVKN-KO-WqOIg.js → diagram-UQ7AKVKN-DGvliWDD.js} +1 -1
  137. ksadk/server/static/assets/{diagram-VSXAHHWV-B360BkDQ.js → diagram-VSXAHHWV-C0i4uEyS.js} +1 -1
  138. ksadk/server/static/assets/{diagram-VX7I27RA-COr1Oqsg.js → diagram-VX7I27RA-C7SmgIl5.js} +1 -1
  139. ksadk/server/static/assets/{diagram-Z3DM3KII-CgaKrIwB.js → diagram-Z3DM3KII-Xca7TB4U.js} +1 -1
  140. ksadk/server/static/assets/{dist-By-MVndb.js → dist-B3rsrE8r.js} +1 -1
  141. ksadk/server/static/assets/{dist-Bsuusoi0.js → dist-BM6KIyhr.js} +1 -1
  142. ksadk/server/static/assets/{dist-DzdXSBJb.js → dist-BMZKBrmN.js} +1 -1
  143. ksadk/server/static/assets/{dist-DmWw0IXB.js → dist-BUGNcOx8.js} +1 -1
  144. ksadk/server/static/assets/{dist-DXOlCAay.js → dist-BbIN_x76.js} +1 -1
  145. ksadk/server/static/assets/{dist--HftQyp9.js → dist-CGB89Aru.js} +1 -1
  146. ksadk/server/static/assets/{dist-DKG0OYnk.js → dist-CGIWL8mC.js} +1 -1
  147. ksadk/server/static/assets/{dist-DgJ57sRe.js → dist-CHeuPGXZ.js} +1 -1
  148. ksadk/server/static/assets/{dist-_0Xgu_07.js → dist-CMJq3QL-.js} +1 -1
  149. ksadk/server/static/assets/{dist-CwnkOyDn.js → dist-CiUeIDKz.js} +1 -1
  150. ksadk/server/static/assets/{dist-BoRn8a_t.js → dist-CmaZEf5M.js} +1 -1
  151. ksadk/server/static/assets/{dist-BQ116UdZ.js → dist-Cq4qlsg3.js} +1 -1
  152. ksadk/server/static/assets/{dist-CBo9AHUv.js → dist-DDVDyH7h.js} +1 -1
  153. ksadk/server/static/assets/{dist-DSw5Ju6-.js → dist-DDi9q5bO.js} +1 -1
  154. ksadk/server/static/assets/{dist-CxIl4t92.js → dist-DJ8mj6p4.js} +1 -1
  155. ksadk/server/static/assets/{dist-Brbrdmff.js → dist-DRGym1nc.js} +1 -1
  156. ksadk/server/static/assets/{dist-BEbS8Bag.js → dist-DcrTYAeW.js} +1 -1
  157. ksadk/server/static/assets/{dist-C9BTMVwS.js → dist-DpuxDDLa.js} +1 -1
  158. ksadk/server/static/assets/{dist-B3Jp5r1e.js → dist-EFGQ7G_k.js} +1 -1
  159. ksadk/server/static/assets/{dist-HHvdjADB.js → dist-IyCF0NNA.js} +1 -1
  160. ksadk/server/static/assets/{dist-Bxcu8Ca0.js → dist-Ny95vkRV.js} +1 -1
  161. ksadk/server/static/assets/{dist-CR61WJFC.js → dist-s5cohO5C.js} +1 -1
  162. ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-DogDP2db.js → ebnfDiagram-PWID7BFC-DNwVczAJ.js} +1 -1
  163. ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CeBDnUjR.js → erDiagram-SSCWMZ5O-OxFlhx6v.js} +1 -1
  164. ksadk/server/static/assets/eventmodeling-NTZA5JFV-C-gXDupK.js +1 -0
  165. ksadk/server/static/assets/flowDiagram-A5DVABFB-CkpCYD4e.js +1 -0
  166. ksadk/server/static/assets/{ganttDiagram-EL5Y4UJY-oIQL3MCp.js → ganttDiagram-EL5Y4UJY-D4krNgUz.js} +1 -1
  167. ksadk/server/static/assets/gitGraph-4MIJSDKK-0RSkEgC5.js +1 -0
  168. ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-B7qz0cmZ.js → gitGraphDiagram-WWUBYQGX-BUSVPN1s.js} +1 -1
  169. ksadk/server/static/assets/index-B9UP7He9.css +2 -0
  170. ksadk/server/static/assets/index-COn4kn-G.js +1135 -0
  171. ksadk/server/static/assets/info-A6RAGUB7-C6KX7WO4.js +1 -0
  172. ksadk/server/static/assets/{infoDiagram-RXCK75RN-yQRC41Ya.js → infoDiagram-RXCK75RN-b6w3u3-O.js} +1 -1
  173. ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-BCu4HiwL.js → ishikawaDiagram-5VMMS53U-CsC7gzRt.js} +1 -1
  174. ksadk/server/static/assets/{journeyDiagram-EYS64GPL-JaqmO73K.js → journeyDiagram-EYS64GPL-BATLNoy1.js} +1 -1
  175. ksadk/server/static/assets/{kanban-definition-3QL26DDD-DQo4X8NO.js → kanban-definition-3QL26DDD-C49zL_s0.js} +1 -1
  176. ksadk/server/static/assets/{katex-t_DWylQw.js → katex-CDVgGGy2.js} +1 -1
  177. ksadk/server/static/assets/{linear-DWdnI35B.js → linear-DkyDumSy.js} +1 -1
  178. ksadk/server/static/assets/{mermaid-parser.core-BHrT2Pfe.js → mermaid-parser.core-BDX-LqSy.js} +2 -2
  179. ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-PBVAhZYV.js → mindmap-definition-FBJOCRG2-DRPnzL2n.js} +1 -1
  180. ksadk/server/static/assets/packet-AYTQ26CC-CMMupxPW.js +1 -0
  181. ksadk/server/static/assets/{pegDiagram-XKGWAZYB-CU_cLfow.js → pegDiagram-XKGWAZYB-Zm-xrNrr.js} +1 -1
  182. ksadk/server/static/assets/pie-WAS4IAKB-Bfo0pa9v.js +1 -0
  183. ksadk/server/static/assets/{pieDiagram-E7YTZNPT-B1h0-_pW.js → pieDiagram-E7YTZNPT-a8C1Jxo4.js} +1 -1
  184. ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-DEMoGo5a.js → quadrantDiagram-AXDQQJYC-ihH8znBv.js} +1 -1
  185. ksadk/server/static/assets/radar-RG4KPBEZ-PRBiHoJx.js +1 -0
  186. ksadk/server/static/assets/railroad-74A4TZTK-BCJ-XMRJ.js +1 -0
  187. ksadk/server/static/assets/railroad-abnf-HS5TGJTU-Bbttj0Jz.js +1 -0
  188. ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-Bo18264J.js +1 -0
  189. ksadk/server/static/assets/railroad-peg-WCYAUIDC-xZDJTFLD.js +1 -0
  190. ksadk/server/static/assets/{railroadDiagram-O6MQD6OU-BTAob2wg.js → railroadDiagram-O6MQD6OU-DD9lFfXo.js} +1 -1
  191. ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-Dl0Q2SuO.js → requirementDiagram-EFPCY7ZU-CGn93Iyb.js} +1 -1
  192. ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-DeaTWkur.js → sankeyDiagram-P5KCCOFB-BuyjrHuW.js} +1 -1
  193. ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-gFQYrsOd.js → sequenceDiagram-WJ2MYXX4-D-Iw-30A.js} +1 -1
  194. ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-pGQzddMB.js → sizeCapture-X5ZJPWSS-B0EHLwrD.js} +1 -1
  195. ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-DmpYOZt1.js → stateDiagram-HBIQ2CUA-k9Zyg69R.js} +1 -1
  196. ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-tUEVnq9-.js +1 -0
  197. ksadk/server/static/assets/{swimlanes-XN3QIQJK-BfuSAsrr.js → swimlanes-XN3QIQJK-D2BewKmp.js} +1 -1
  198. ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-CGBmsrCQ.js +8 -0
  199. ksadk/server/static/assets/{timeline-definition-24CTP7MA-CgJwrrxf.js → timeline-definition-24CTP7MA-czSzsYbz.js} +1 -1
  200. ksadk/server/static/assets/treeView-Q6P3EWNA-CrEvfC8M.js +1 -0
  201. ksadk/server/static/assets/treemap-WGGIJYW6-D1TmShtn.js +1 -0
  202. ksadk/server/static/assets/{vennDiagram-4TSXK5OY-CBSAgXDd.js → vennDiagram-4TSXK5OY-BJF_qZLF.js} +1 -1
  203. ksadk/server/static/assets/wardley-WFR3VGLG-0gZiSyL0.js +1 -0
  204. ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-013TZ2JZ.js → wardleyDiagram-VM6X3IG4-BfwUuJpr.js} +1 -1
  205. ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-u6Frp8xp.js → xychartDiagram-S5SC5T6Z-Ci6Nsp4p.js} +1 -1
  206. ksadk/server/static/index.html +2 -2
  207. ksadk/server/static/ui-source.json +6 -6
  208. ksadk/sessions/_postgres_history_backfill.py +80 -0
  209. ksadk/sessions/_postgres_schema.py +117 -0
  210. ksadk/sessions/_postgres_tables.py +6 -0
  211. ksadk/sessions/base.py +24 -0
  212. ksadk/sessions/history_tool_refs.py +244 -0
  213. ksadk/sessions/in_memory.py +42 -0
  214. ksadk/sessions/local_service.py +78 -0
  215. ksadk/sessions/model_history.py +20 -0
  216. ksadk/sessions/postgres_service.py +215 -19
  217. ksadk/sessions/resilient.py +24 -0
  218. ksadk/skills/mcp_server/server.py +239 -217
  219. ksadk/studio/contracts.py +8 -0
  220. ksadk/studio/mcp_runtime.py +23 -8
  221. ksadk/studio/native_mcp_disclosure.py +8 -6
  222. ksadk/studio/native_mcp_tool_port.py +3 -1
  223. ksadk/studio/native_memory_context.py +10 -8
  224. ksadk/studio/native_product.py +3 -4
  225. ksadk/studio/plugin_composition.py +8 -1
  226. ksadk/studio/plugin_native_activation.py +4 -2
  227. ksadk/studio/plugin_runtime.py +9 -0
  228. ksadk/studio/service.py +2 -0
  229. ksadk/studio/static/assets/{ChannelsPage-Do_mRmVu.js → ChannelsPage-Ot9iV_QP.js} +1 -1
  230. ksadk/studio/static/assets/{CodeBlock-DMIf4h33-CsO7rJKv.js → CodeBlock-DMIf4h33-Cfs6se0v.js} +1 -1
  231. ksadk/studio/static/assets/{MathMessageMarkdown-BesSeCYl-CiB60plG.js → MathMessageMarkdown-BesSeCYl-BIBDiQAl.js} +1 -1
  232. ksadk/studio/static/assets/{MessageMarkdown-CwMTvgFj-BzEmQkHH.js → MessageMarkdown-CwMTvgFj-CWM4n-9K.js} +2 -2
  233. ksadk/studio/static/assets/{OfficialA2uiRenderer-DI49Kpxu-BBxfdj3P.js → OfficialA2uiRenderer-DI49Kpxu-BZSumE9D.js} +1 -1
  234. ksadk/studio/static/assets/{TeamsPage-qNVYpcox.js → TeamsPage-CVOpMIMf.js} +2 -2
  235. ksadk/studio/static/assets/index-CW1D-Kqg.css +2 -0
  236. ksadk/studio/static/assets/index-DMexeQ1-.js +1155 -0
  237. ksadk/studio/static/index.html +3 -3
  238. ksadk/studio/static/ui-source.json +6 -6
  239. ksadk/tracing/setup.py +53 -3
  240. ksadk/tunnel/__init__.py +37 -0
  241. ksadk/tunnel/connector.py +384 -0
  242. ksadk/tunnel/discovery.py +107 -0
  243. ksadk/tunnel/failure.py +168 -0
  244. ksadk/tunnel/http_tools.py +100 -0
  245. ksadk/tunnel/langgraph.py +125 -0
  246. ksadk/tunnel/middleware.py +28 -0
  247. ksadk/tunnel/peers.py +872 -0
  248. ksadk/tunnel/protocol.py +97 -0
  249. ksadk/tunnel/registry.py +306 -0
  250. ksadk/tunnel/runtime.py +147 -0
  251. ksadk/tunnel/server.py +201 -0
  252. ksadk/tunnel/services.py +366 -0
  253. ksadk/tunnel/toolset.py +78 -0
  254. ksadk/version.py +1 -1
  255. ksadk_runtime_common/memory_backend/providers/mem0.py +20 -0
  256. ksadk/server/static/assets/architecture-7GRP2DOG-CFWjFkDL.js +0 -1
  257. ksadk/server/static/assets/channel-D6Dp_l74.js +0 -1
  258. ksadk/server/static/assets/chunk-2Q5K7J3B-CwmjhFYK.js +0 -1
  259. ksadk/server/static/assets/classDiagram-DTDB5LWJ-DsbvkCAV.js +0 -1
  260. ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-DsbvkCAV.js +0 -1
  261. ksadk/server/static/assets/cynefin-OW5HDTMX-CBZRVuc4.js +0 -1
  262. ksadk/server/static/assets/eventmodeling-NTZA5JFV-vXZWMkpn.js +0 -1
  263. ksadk/server/static/assets/flowDiagram-A5DVABFB-5LRgzKLv.js +0 -1
  264. ksadk/server/static/assets/gitGraph-4MIJSDKK-BUWSkncI.js +0 -1
  265. ksadk/server/static/assets/index-4g1ndaxW.js +0 -1132
  266. ksadk/server/static/assets/index-DEVfafsU.css +0 -2
  267. ksadk/server/static/assets/info-A6RAGUB7-CzJ_YrOs.js +0 -1
  268. ksadk/server/static/assets/packet-AYTQ26CC-CXoos6fx.js +0 -1
  269. ksadk/server/static/assets/pie-WAS4IAKB-CjF9NoIt.js +0 -1
  270. ksadk/server/static/assets/radar-RG4KPBEZ-BQGWs9nw.js +0 -1
  271. ksadk/server/static/assets/railroad-74A4TZTK-B6znvLUK.js +0 -1
  272. ksadk/server/static/assets/railroad-abnf-HS5TGJTU-Bzquz0As.js +0 -1
  273. ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-1IikGkb5.js +0 -1
  274. ksadk/server/static/assets/railroad-peg-WCYAUIDC-BKKgHzdc.js +0 -1
  275. ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-Dolxgkw3.js +0 -1
  276. ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-BuI1erYj.js +0 -8
  277. ksadk/server/static/assets/treeView-Q6P3EWNA-DtMdDH8N.js +0 -1
  278. ksadk/server/static/assets/treemap-WGGIJYW6-VoU8QtLZ.js +0 -1
  279. ksadk/server/static/assets/wardley-WFR3VGLG-YWSRB0Zm.js +0 -1
  280. ksadk/studio/static/assets/index-Cp9Unfkn.css +0 -2
  281. ksadk/studio/static/assets/index-HepnaEeR.js +0 -1152
  282. {agentengine_sdk_python-0.8.7.dist-info → agentengine_sdk_python-0.8.9.dist-info}/WHEEL +0 -0
  283. {agentengine_sdk_python-0.8.7.dist-info → agentengine_sdk_python-0.8.9.dist-info}/entry_points.txt +0 -0
  284. {agentengine_sdk_python-0.8.7.dist-info → agentengine_sdk_python-0.8.9.dist-info}/licenses/LICENSE +0 -0
  285. {agentengine_sdk_python-0.8.7.dist-info → agentengine_sdk_python-0.8.9.dist-info}/top_level.txt +0 -0
@@ -37,6 +37,13 @@ def _time(value):
37
37
  return parsed if parsed.tzinfo is not None else parsed.replace(tzinfo=timezone.utc)
38
38
 
39
39
 
40
+ def memory_record_expiry(record):
41
+ expires = [
42
+ value for value in (_time(record.expires_at), _time(record.valid_to)) if value is not None
43
+ ]
44
+ return min(expires) if expires else None
45
+
46
+
40
47
  def admitted_memory_records(result, *, principal, scopes, top_k):
41
48
  """One host data admission for recall and explicit search projections."""
42
49
  if not isinstance(result, MemorySearchResult) or result.status not in {"ok", "not_configured"}:
@@ -54,12 +61,12 @@ def admitted_memory_records(result, *, principal, scopes, top_k):
54
61
  raise ValueError("native_memory_record_unbound")
55
62
  if record.content_hash != content_hash(record.content):
56
63
  raise ValueError("native_memory_content_mismatch")
57
- expiry = [_time(value) for value in (record.expires_at, record.valid_to) if value]
64
+ expiry = memory_record_expiry(record)
58
65
  valid_from = _time(record.valid_from)
59
66
  if (
60
67
  record.status != "active"
61
68
  or record.sensitivity == "high"
62
- or any(value <= now for value in expiry)
69
+ or (expiry is not None and expiry <= now)
63
70
  or (valid_from is not None and valid_from > now)
64
71
  ):
65
72
  continue
@@ -142,12 +149,7 @@ class StudioMemoryContextSource:
142
149
  scopes=recall.scopes,
143
150
  top_k=recall.top_k,
144
151
  ):
145
- expires = [
146
- value
147
- for value in (_time(record.expires_at), _time(record.valid_to))
148
- if value is not None
149
- ]
150
- expiry = min(expires) if expires else None
152
+ expiry = memory_record_expiry(record)
151
153
  fragments.append(
152
154
  ContextFragment(
153
155
  fragment_format="ksadk.context-fragment/v1",
@@ -877,10 +877,9 @@ class StudioNativeProductComposer:
877
877
  # Missing only in legacy sealed Builds. New Builds carry an
878
878
  # explicit object even when neither count is bounded.
879
879
  native_limits = execution.native_limits
880
- model_call_budget = (native_limits.max_model_calls if native_limits is not None
881
- else min(100, execution.max_steps))
882
- tool_call_budget = (native_limits.max_tool_calls if native_limits is not None
883
- else min(400, max(4, execution.max_steps * 4)))
880
+ call_limits = execution.native_call_limits()
881
+ model_call_budget = call_limits.max_model_calls
882
+ tool_call_budget = call_limits.max_tool_calls
884
883
  reserve_basis = (model_call_budget if native_limits is not None
885
884
  else execution.max_steps)
886
885
  workspace_port = StudioNativeWorkspacePort(
@@ -14,6 +14,7 @@ from collections.abc import Mapping
14
14
  from copy import deepcopy
15
15
  from dataclasses import replace
16
16
 
17
+ from ksadk.harness.service_runtime import harness_service_configured
17
18
  from ksadk.harness.tools import HARNESS_SANDBOX_TOOL_NAMES
18
19
  from ksadk.plugins.builtins import (
19
20
  BUILTIN_PLUGIN_VERSION,
@@ -181,7 +182,13 @@ class StudioPluginCompositionCompiler:
181
182
  config={"artifactPath": "platform-resources"},
182
183
  ))
183
184
  policy = CompositionPolicy(
184
- runtimes={"harness": RuntimePluginSelection(provider_ref=harness_ref)},
185
+ runtimes={"harness": RuntimePluginSelection(
186
+ provider_ref=harness_ref,
187
+ supported_strategies=(
188
+ frozenset({"direct", "plan-act-observe"})
189
+ if harness_service_configured() else frozenset({"direct"})
190
+ ),
191
+ )},
185
192
  providers=providers,
186
193
  session_store=_selection(
187
194
  SQLITE_SESSION_STORE_PLUGIN_ID,
@@ -8,6 +8,7 @@ from typing import Any
8
8
 
9
9
  from ksadk.harness.native.studio_admission import studio_mapping_digest
10
10
  from ksadk.harness.native_runtime import NativeRuntimeAdapter
11
+ from ksadk.harness.service_runtime import harness_service_configured
11
12
  from ksadk.plugins.host import PluginActivationSession, PluginHostError
12
13
  from ksadk.studio.errors import StudioError
13
14
  from ksadk.studio.run_service import StudioRunSpec
@@ -24,9 +25,10 @@ class StudioNativeActivationMixin:
24
25
  async def _native_activation_claims(
25
26
  self, spec: StudioRunSpec, session_id: str
26
27
  ) -> dict[str, str] | None:
27
- if (
28
+ if spec.request_config.get("provider_runtime_type") != "harness":
29
+ return None
30
+ if not harness_service_configured() and (
28
31
  self._harness_engine_selector is None
29
- or spec.request_config.get("provider_runtime_type") != "harness"
30
32
  or (self._harness_native_session_enabled is not None
31
33
  and not self._harness_native_session_enabled(spec.agent_id, session_id))
32
34
  ):
@@ -10,6 +10,7 @@ from dataclasses import dataclass
10
10
  from pathlib import Path
11
11
  from typing import Any, cast
12
12
 
13
+ from ksadk.harness.native.hook_executor import HookAuthorizer
13
14
  from ksadk.harness.reasoner import (
14
15
  HarnessReasoner,
15
16
  HarnessReasoningTurn,
@@ -818,6 +819,8 @@ class StudioPluginRuntime(StudioNativeActivationMixin):
818
819
  resource_actor_ref: str = "local-user",
819
820
  native_tenant_id: str = "local-studio",
820
821
  native_workspace_id: str | None = None,
822
+ service_hook_authorizer: HookAuthorizer | None = None,
823
+ service_hook_authorization_version: str | None = None,
821
824
  codex_local_launch_resolver: Any = None,
822
825
  runtime_executor: RuntimeExecutor | None = None,
823
826
  ) -> None:
@@ -845,6 +848,8 @@ class StudioPluginRuntime(StudioNativeActivationMixin):
845
848
  self._resource_actor_ref = resource_actor_ref
846
849
  self._native_tenant_id = native_tenant_id
847
850
  self._native_workspace_id = native_workspace_id
851
+ self._service_hook_authorizer = service_hook_authorizer
852
+ self._service_hook_authorization_version = service_hook_authorization_version
848
853
  self._codex_local_launch_resolver = codex_local_launch_resolver
849
854
  self._runtime_executor = runtime_executor
850
855
  self._legacy_bundles = LegacyBundleAdapter(legacy_harness_sources)
@@ -1182,6 +1187,10 @@ class StudioPluginRuntime(StudioNativeActivationMixin):
1182
1187
  services["harness_reasoner"] = (
1183
1188
  self._harness_reasoner or self._bound_harness_reasoner(verified)
1184
1189
  )
1190
+ services["harness_service_hook_authorizer"] = self._service_hook_authorizer
1191
+ services["harness_service_hook_authorization_version"] = (
1192
+ self._service_hook_authorization_version
1193
+ )
1185
1194
  if self._harness_engine_selector is not None:
1186
1195
  services["harness_engine_selector"] = self._harness_engine_selector
1187
1196
  services["harness_native_adapter_builder"] = (
ksadk/studio/service.py CHANGED
@@ -579,6 +579,8 @@ class StudioService(StudioSettingsMixin):
579
579
  resource_connections=self.resource_connections,
580
580
  resource_actor_ref="local-user",
581
581
  native_workspace_id=self.workspace_record.workspace_id,
582
+ service_hook_authorizer=native_harness_hook_authorizer,
583
+ service_hook_authorization_version=native_harness_hook_authorization_version,
582
584
  )
583
585
  self.run_service.plugin_runtime = self.plugin_runs
584
586
  self.scheduler_runtimes = StudioScheduledKernelRegistry(
@@ -1,4 +1,4 @@
1
- import{a as e,t}from"./rolldown-runtime-cO0ylGnt.js";import{i as n,t as r}from"./react-vendor-CTyAWUMQ.js";import{t as i}from"./createLucideIcon-CTD6_IjT.js";import{D as a,E as o,M as s,N as c,O as l,_ as u,b as d,c as f,d as p,f as m,g as h,h as g,j as _,l as v,m as ee,p as y,t as te,u as b,v as x,w as ne,x as re}from"./index-HepnaEeR.js";var ie=i(`arrow-down-left`,[[`path`,{d:`M17 7 7 17`,key:`15tmo1`}],[`path`,{d:`M17 17H7V7`,key:`1org7z`}]]),ae=i(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),oe=i(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),se=i(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ce=i(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),le=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),S=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),C=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ue=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),w=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),de=t((e=>{var t=S().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),T=t((e=>{var t=S().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),fe=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),E=t((e=>{var t=C(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),D=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),O=t((e=>{var t=D();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),pe=t(((e,t)=>{var n=O();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),k=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),me=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
1
+ import{a as e,t}from"./rolldown-runtime-cO0ylGnt.js";import{i as n,t as r}from"./react-vendor-CTyAWUMQ.js";import{t as i}from"./createLucideIcon-CTD6_IjT.js";import{D as a,E as o,M as s,N as c,O as l,_ as u,b as d,c as f,d as p,f as m,g as h,h as g,j as _,l as v,m as ee,p as y,t as te,u as b,v as x,w as ne,x as re}from"./index-DMexeQ1-.js";var ie=i(`arrow-down-left`,[[`path`,{d:`M17 7 7 17`,key:`15tmo1`}],[`path`,{d:`M17 17H7V7`,key:`1org7z`}]]),ae=i(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),oe=i(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),se=i(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ce=i(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),le=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),S=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),C=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ue=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),w=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),de=t((e=>{var t=S().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),T=t((e=>{var t=S().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),fe=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),E=t((e=>{var t=C(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),D=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),O=t((e=>{var t=D();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),pe=t(((e,t)=>{var n=O();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),k=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),me=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
2
  ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),A=t((e=>{var t=k(),n=me();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),he=t((e=>{var t=S(),n=E(),r=C(),i=A(),a=k(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),ge=t((e=>{var t=S(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),_e=t(((e,t)=>{var n=A();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),ve=t(((e,t)=>{var n=A(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),j=t(((e,t)=>{var n=A();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),ye=t(((e,t)=>{var n=A(),r=S();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
3
  Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),be=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),M=t((e=>{var t=A(),n=_e(),r=ve(),i=j(),a=ye(),o=me(),s=S(),c=be();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
4
  Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),xe=t((e=>{var t=S(),n=C(),r=ue(),i=w(),a=de(),o=T(),s=fe(),c=E(),l=pe(),u=he(),d=ge(),f=A(),p=M();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function ee(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function y(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return te(a,e,n)}function te(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,ee=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=ee.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let y=new Uint8Array(i),te=0,b,x;for(b=0;b<v;b++)for(x=0;x<o;x++)b<g[x].length&&(y[te++]=g[x][b]);for(b=0;b<p;b++)for(x=0;x<o;x++)y[te++]=_[x][b];return y}function b(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-cO0ylGnt.js";import{i as t,t as n}from"./react-vendor-CTyAWUMQ.js";import{t as r}from"./createLucideIcon-CTD6_IjT.js";import{a as i,c as a,i as o,n as s,o as c,s as l,t as u}from"./index.dom-DSf_jcX2.js";import{t as d}from"./rolldown-runtime-Dy4uBu1J-CmRlGT1x.js";import{A as f,C as p,L as m,M as h,b as g,j as _,k as v,y}from"./index-HepnaEeR.js";var b=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),x=e(t(),1);function S(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function C(e){let t=e.endsWith(`/`)?e:`${e}/`;if(typeof window>`u`)return`'self'`;try{return new URL(t,window.location.origin).toString()}catch{return`'self'`}}function w(...e){return Array.from(new Set(e.filter(e=>!!e))).join(` `)}function T(e){let t=e?C(e):void 0,n=w(`'unsafe-inline'`,`'unsafe-eval'`,`'self'`,`https:`,t),r=w(`'self'`,`https:`,t);return[`default-src 'none'`,`script-src ${n}`,`style-src 'unsafe-inline' data: ${r}`,`img-src data: blob: ${r}`,`font-src data: ${r}`,`media-src data: blob: ${r}`,`worker-src blob:`,`connect-src 'none'`,`form-action 'none'`,`base-uri 'self'`].join(`; `)}function E(e){try{let t=new URL(e,window.location.href);return[`http:`,`https:`,`mailto:`].includes(t.protocol)}catch{return!1}}function D(e,t={}){let{channelId:n,basePath:r}=typeof t==`string`?{channelId:t}:t,i=T(r),a=`<script>
1
+ import{a as e}from"./rolldown-runtime-cO0ylGnt.js";import{i as t,t as n}from"./react-vendor-CTyAWUMQ.js";import{t as r}from"./createLucideIcon-CTD6_IjT.js";import{a as i,c as a,i as o,n as s,o as c,s as l,t as u}from"./index.dom-DSf_jcX2.js";import{t as d}from"./rolldown-runtime-Dy4uBu1J-CmRlGT1x.js";import{A as f,C as p,L as m,M as h,b as g,j as _,k as v,y}from"./index-DMexeQ1-.js";var b=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),x=e(t(),1);function S(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function C(e){let t=e.endsWith(`/`)?e:`${e}/`;if(typeof window>`u`)return`'self'`;try{return new URL(t,window.location.origin).toString()}catch{return`'self'`}}function w(...e){return Array.from(new Set(e.filter(e=>!!e))).join(` `)}function T(e){let t=e?C(e):void 0,n=w(`'unsafe-inline'`,`'unsafe-eval'`,`'self'`,`https:`,t),r=w(`'self'`,`https:`,t);return[`default-src 'none'`,`script-src ${n}`,`style-src 'unsafe-inline' data: ${r}`,`img-src data: blob: ${r}`,`font-src data: ${r}`,`media-src data: blob: ${r}`,`worker-src blob:`,`connect-src 'none'`,`form-action 'none'`,`base-uri 'self'`].join(`; `)}function E(e){try{let t=new URL(e,window.location.href);return[`http:`,`https:`,`mailto:`].includes(t.protocol)}catch{return!1}}function D(e,t={}){let{channelId:n,basePath:r}=typeof t==`string`?{channelId:t}:t,i=T(r),a=`<script>
2
2
  function ksadkScrollToHash(rawHref) {
3
3
  if (!rawHref || rawHref === '#') return;
4
4
  var rawId = rawHref.slice(1);
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-cO0ylGnt.js";import{i as t,t as n}from"./react-vendor-CTyAWUMQ.js";import{c as r,d as i,f as a,h as o,l as s,m as c,n as l,p as u,r as d,s as f,u as p}from"./MessageMarkdown-CwMTvgFj-BzEmQkHH.js";import{t as m}from"./rolldown-runtime-Dy4uBu1J-CmRlGT1x.js";import{i as h,r as g,t as _}from"./CodeBlock-DMIf4h33-CsO7rJKv.js";import{t as v}from"./MermaidBlock-H_0qzQDf-oRTZUNRr.js";import{t as y}from"./katex-K_8DQ5UN.js";function ee(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function te(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
1
+ import{a as e}from"./rolldown-runtime-cO0ylGnt.js";import{i as t,t as n}from"./react-vendor-CTyAWUMQ.js";import{c as r,d as i,f as a,h as o,l as s,m as c,n as l,p as u,r as d,s as f,u as p}from"./MessageMarkdown-CwMTvgFj-CWM4n-9K.js";import{t as m}from"./rolldown-runtime-Dy4uBu1J-CmRlGT1x.js";import{i as h,r as g,t as _}from"./CodeBlock-DMIf4h33-Cfs6se0v.js";import{t as v}from"./MermaidBlock-H_0qzQDf-oRTZUNRr.js";import{t as y}from"./katex-K_8DQ5UN.js";function ee(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function te(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
2
2
  `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(s(i,`$`)+1,2)),c=n.enter(`mathFlow`),l=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);l+=a.move(n.safe(e.meta,{after:`
3
3
  `,before:l,encode:[`$`],...a.current()})),t()}return l+=a.move(`
4
4
  `),i&&(l+=a.move(i+`
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeBlock-DMIf4h33-CsO7rJKv.js","assets/rolldown-runtime-cO0ylGnt.js","assets/react-vendor-CTyAWUMQ.js","assets/createLucideIcon-CTD6_IjT.js","assets/index.dom-DSf_jcX2.js","assets/rolldown-runtime-Dy4uBu1J-CmRlGT1x.js","assets/index-HepnaEeR.js","assets/preload-helper-2TpOpXko.js","assets/clsx-BE-4uLAX.js","assets/index-Cp9Unfkn.css","assets/MermaidBlock-H_0qzQDf-oRTZUNRr.js","assets/chunk-Y2CYZVJY-C72YQVBQ.js","assets/src-DSHesKRm.js","assets/chunk-DU6HZSFF-HbWKkMwX.js","assets/chunk-75Z2AOVW-DpzsVI3p.js","assets/dist-Brlz61T5.js","assets/chunk-CLGD4ZFX-BiEFihjn.js","assets/chunk-P2QGCYS3-C3nH7MEr.js","assets/chunk-PWAF6VOD-BmVQq92D.js","assets/chunk-GMAD6QVW-C-Lw1ag9.js","assets/chunk-4HAMMTFA--k1euiK8.js","assets/rough.esm-BF6Sy8cM.js","assets/chunk-GVQU2GXP-CCUMaVF8.js","assets/chunk-L3NEJ4N5-C8A22muD.js","assets/chunk-OSK3NFVY-DFHvKoNt.js","assets/line-C4h80pWP.js","assets/path-BfzAkHoX.js","assets/array-mTkv7xdZ.js","assets/chunk-2E4U76K2-CfUBZPB8.js","assets/graphlib-CYZB3_li.js","assets/chunk-LNGE3PJU-D_NJe87O.js","assets/chunk-TLUHSLCS-7mZ4xr0q.js","assets/MathMessageMarkdown-BesSeCYl-CiB60plG.js","assets/katex-K_8DQ5UN.js","assets/MathMessageMarkdown-BesSeCYl-BEOyPC3w.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeBlock-DMIf4h33-Cfs6se0v.js","assets/rolldown-runtime-cO0ylGnt.js","assets/react-vendor-CTyAWUMQ.js","assets/createLucideIcon-CTD6_IjT.js","assets/index.dom-DSf_jcX2.js","assets/rolldown-runtime-Dy4uBu1J-CmRlGT1x.js","assets/index-DMexeQ1-.js","assets/preload-helper-2TpOpXko.js","assets/clsx-BE-4uLAX.js","assets/index-CW1D-Kqg.css","assets/MermaidBlock-H_0qzQDf-oRTZUNRr.js","assets/chunk-Y2CYZVJY-C72YQVBQ.js","assets/src-DSHesKRm.js","assets/chunk-DU6HZSFF-HbWKkMwX.js","assets/chunk-75Z2AOVW-DpzsVI3p.js","assets/dist-Brlz61T5.js","assets/chunk-CLGD4ZFX-BiEFihjn.js","assets/chunk-P2QGCYS3-C3nH7MEr.js","assets/chunk-PWAF6VOD-BmVQq92D.js","assets/chunk-GMAD6QVW-C-Lw1ag9.js","assets/chunk-4HAMMTFA--k1euiK8.js","assets/rough.esm-BF6Sy8cM.js","assets/chunk-GVQU2GXP-CCUMaVF8.js","assets/chunk-L3NEJ4N5-C8A22muD.js","assets/chunk-OSK3NFVY-DFHvKoNt.js","assets/line-C4h80pWP.js","assets/path-BfzAkHoX.js","assets/array-mTkv7xdZ.js","assets/chunk-2E4U76K2-CfUBZPB8.js","assets/graphlib-CYZB3_li.js","assets/chunk-LNGE3PJU-D_NJe87O.js","assets/chunk-TLUHSLCS-7mZ4xr0q.js","assets/MathMessageMarkdown-BesSeCYl-BIBDiQAl.js","assets/katex-K_8DQ5UN.js","assets/MathMessageMarkdown-BesSeCYl-BEOyPC3w.css"])))=>i.map(i=>d[i]);
2
2
  import{a as e,r as t,t as n}from"./rolldown-runtime-cO0ylGnt.js";import{i as r,t as i}from"./react-vendor-CTyAWUMQ.js";import{t as a}from"./preload-helper-2TpOpXko.js";import{a as o,i as s,l as c,o as l,r as u,t as d}from"./index.dom-DSf_jcX2.js";function f(){}var p=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h={};function g(e,t){return((t||h).jsx?m:p).test(e)}var _=/[ \t\n\f\r]/g;function v(e){return typeof e==`object`?e.type===`text`&&y(e.value):y(e)}function y(e){return e.replace(_,``)===``}var b={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},x=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
3
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),S=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(x());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),C=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),w=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(S()),r=C();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),T=D(`end`),E=D(`start`);function D(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function O(e){let t=E(e),n=T(e);if(t&&n)return{start:t,end:n}}function k(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ee(e.position):`start`in e||`end`in e?ee(e):`line`in e||`column`in e?A(e):``}function A(e){return j(e&&e.line)+`:`+j(e&&e.column)}function ee(e){return A(e&&e.start)+`-`+A(e&&e.end)}function j(e){return e&&typeof e==`number`?e:1}var M=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=k(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};M.prototype.file=``,M.prototype.name=``,M.prototype.reason=``,M.prototype.message=``,M.prototype.stack=``,M.prototype.column=void 0,M.prototype.line=void 0,M.prototype.ancestors=void 0,M.prototype.cause=void 0,M.prototype.fatal=void 0,M.prototype.place=void 0,M.prototype.ruleId=void 0,M.prototype.source=void 0;var te=e(w(),1),ne={}.hasOwnProperty,N=new Map,re=/[A-Z]/g,ie=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ae=new Set([`td`,`th`]);function oe(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=_e(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ge(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?o:s,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=se(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function se(e,t,n){if(t.type===`element`)return ce(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return le(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return de(e,t,n);if(t.type===`mdxjsEsm`)return ue(e,t);if(t.type===`root`)return fe(e,t,n);if(t.type===`text`)return pe(e,t)}function ce(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=o,e.schema=i),e.ancestors.push(t);let a=Ce(e,t.tagName,!1),s=ve(e,t),c=be(e,t);return ie.has(t.tagName)&&(c=c.filter(function(e){return typeof e!=`string`||!v(e)})),me(e,s,a,t),he(s,c),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function le(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}we(e,t.position)}function ue(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);we(e,t.position)}function de(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=o,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ce(e,t.name,!0),s=ye(e,t),c=be(e,t);return me(e,s,a,t),he(s,c),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function fe(e,t,n){let r={};return he(r,be(e,t)),e.create(t,e.Fragment,r,n)}function pe(e,t){return t.value}function me(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function he(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ge(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function _e(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=E(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ve(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ne.call(t.properties,i)){let a=xe(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ae.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ye(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else we(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else we(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function be(e,t){let n=[],r=-1,i=e.passKeys?new Map:N;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=se(e,a,o);s!==void 0&&n.push(s)}return n}function xe(e,t,n){let r=l(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?c(n):u(n)),r.property===`style`){let t=typeof n==`object`?n:Se(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Te(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?b[r.property]||r.property:r.attribute,n]}}function Se(e,t){try{return(0,te.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new M("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Ce(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=g(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=g(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ne.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);we(e)}function we(e,t){let n=new M("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Te(e){let t={},n;for(n in e)ne.call(e,n)&&(t[Ee(n)]=e[n]);return t}function Ee(e){let t=e.replace(re,De);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function De(e){return`-`+e.toLowerCase()}var Oe={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ke={};function Ae(e,t){let n=t||ke;return je(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function je(e,t,n){if(Ne(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Me(e.children,t,n)}return Array.isArray(e)?Me(e,t,n):``}function Me(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=je(e[i],t,n);return r.join(``)}function Ne(e){return!!(e&&typeof e==`object`)}function P(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function F(e,t){return e.length>0?(P(e,e.length,0,t),e):t}var Pe={}.hasOwnProperty;function Fe(e){let t={},n=-1;for(;++n<e.length;)Ie(t,e[n]);return t}function Ie(e,t){let n;for(n in t){let r=(Pe.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Pe.call(r,a)||(r[a]=[]);let e=i[a];Le(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Le(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);P(e,0,0,r)}function Re(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function I(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var L=H(/[A-Za-z]/),R=H(/[\dA-Za-z]/),ze=H(/[#-'*+\--9=?A-Z^-~]/);function Be(e){return e!==null&&(e<32||e===127)}var Ve=H(/\d/),He=H(/[\dA-Fa-f]/),Ue=H(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function B(e){return e!==null&&(e<0||e===32)}function V(e){return e===-2||e===-1||e===32}var We=H(/\p{P}|\p{S}/u),Ge=H(/\s/);function H(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ke(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&R(e.charCodeAt(n+1))&&R(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function U(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return V(r)?(e.enter(n),s(r)):t(r)}function s(r){return V(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var qe={tokenize:Je};function Je(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ye={tokenize:Ze},Xe={tokenize:Qe};function Ze(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return P(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xe,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Xe,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;P(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Qe(e,t,n){return U(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function $e(e){if(e===null||B(e)||Ge(e))return 1;if(We(e))return 2}function et(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var tt={name:`attention`,resolveAll:nt,tokenize:rt};function nt(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};it(d,-c),it(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=F(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=F(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=F(l,et(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=F(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=F(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,P(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function rt(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=$e(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=$e(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function it(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var at={name:`autolink`,tokenize:ot};function ot(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return L(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||R(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||R(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Be(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ze(t)?(e.consume(t),l):n(t)}function u(e){return R(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||R(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var st={partial:!0,tokenize:ct};function ct(e,t,n){return r;function r(t){return V(t)?U(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||z(e)?t(e):n(e)}}var lt={continuation:{tokenize:dt},exit:ft,name:`blockQuote`,tokenize:ut};function ut(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return V(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function dt(e,t,n){let r=this;return i;function i(t){return V(t)?U(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(lt,t,n)(r)}}function ft(e){e.exit(`blockQuote`)}var pt={name:`characterEscape`,tokenize:mt};function mt(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ue(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ht={name:`characterReference`,tokenize:gt};function gt(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=R,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=He,u):(e.enter(`characterReferenceValue`),a=7,o=Ve,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===R&&!d(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var _t={partial:!0,tokenize:bt},vt={concrete:!0,name:`codeFenced`,tokenize:yt};function yt(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),V(t)?U(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(_t,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),U(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&V(t)?U(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||z(t)?e.check(_t,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),V(t)?U(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),V(t)?U(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function bt(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var xt={name:`codeIndented`,tokenize:Ct},St={partial:!0,tokenize:wt};function Ct(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),U(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):z(t)?e.attempt(St,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||z(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function wt(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):U(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):z(e)?i(e):n(e)}}var Tt={name:`codeText`,previous:Dt,resolve:Et,tokenize:Ot};function Et(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Dt(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ot(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var kt=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&At(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),At(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),At(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);At(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);At(this.left,t.reverse())}}}};function At(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function jt(e){let t={},n=-1,r,i,a,o,s,c,l,u=new kt(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Mt(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return P(e,0,1/0,u.slice(0)),!l}function Mt(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Nt={resolve:Ft,tokenize:It},Pt={partial:!0,tokenize:Lt};function Ft(e){return jt(e),e}function It(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):z(t)?e.check(Pt,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Lt(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,a,`linePrefix`)}function a(i){if(i===null||z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Rt(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Be(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||B(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Be(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function zt(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!V(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Bt(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Vt(e,t){let n;return r;function r(i){return z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):V(i)?U(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ht={name:`definition`,tokenize:Wt},Ut={partial:!0,tokenize:Gt};function Wt(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return zt.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=I(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return B(t)?Vt(e,l)(t):l(t)}function l(t){return Rt(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ut,d,d)(t)}function d(t){return V(t)?U(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Gt(e,t,n){return r;function r(t){return B(t)?Vt(e,i)(t):n(t)}function i(t){return Bt(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return V(t)?U(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||z(e)?t(e):n(e)}}var Kt={name:`hardBreakEscape`,tokenize:qt};function qt(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Jt={name:`headingAtx`,resolve:Yt,tokenize:Xt};function Yt(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},P(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Xt(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||B(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||z(n)?(e.exit(`atxHeading`),t(n)):V(n)?U(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||B(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Zt=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Qt=[`pre`,`script`,`style`,`textarea`],$t={concrete:!0,name:`htmlFlow`,resolveTo:nn,tokenize:rn},en={partial:!0,tokenize:on},tn={partial:!0,tokenize:an};function nn(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rn(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:N):L(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):L(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return L(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||B(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Qt.includes(l)?(i=1,r.interrupt?t(s):O(s)):Zt.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||R(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return V(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||L(t)?(e.consume(t),b):V(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||R(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):V(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):V(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||B(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||V(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||z(t)?O(t):V(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(en,ie,k)(t)):t===null||z(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(tn,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||z(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),N):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return Qt.includes(n)?(e.consume(t),re):O(t)}return L(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||z(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function an(e,t,n){let r=this;return i;function i(t){return z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function on(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(st,t,n)}}var sn={name:`htmlText`,tokenize:cn};function cn(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):L(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):L(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):z(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):z(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):z(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):z(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return L(t)?(e.consume(t),S):n(t)}function S(t){return t===45||R(t)?(e.consume(t),S):C(t)}function C(t){return z(t)?(o=C,M(t)):V(t)?(e.consume(t),C):j(t)}function w(t){return t===45||R(t)?(e.consume(t),w):t===47||t===62||B(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||L(t)?(e.consume(t),E):z(t)?(o=T,M(t)):V(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||R(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):z(t)?(o=D,M(t)):V(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):z(t)?(o=O,M(t)):V(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):z(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||B(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||B(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return V(t)?U(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var ln={name:`labelEnd`,resolveAll:pn,resolveTo:mn,tokenize:hn},un={tokenize:gn},dn={tokenize:_n},fn={tokenize:vn};function pn(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&P(e,0,e.length,n),e}function mn(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=F(s,e.slice(a+1,a+r+3)),s=F(s,[[`enter`,u,t]]),s=F(s,et(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=F(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=F(s,e.slice(o+1)),s=F(s,[[`exit`,c,t]]),P(e,a,e.length,s),e}function hn(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(I(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(un,u,o?u:d)(t):t===91?e.attempt(dn,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(fn,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function gn(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return B(t)?Vt(e,a)(t):a(t)}function a(t){return t===41?u(t):Rt(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return B(t)?Vt(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Bt(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return B(t)?Vt(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function _n(e,t,n){let r=this;return i;function i(t){return zt.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(I(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function vn(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var yn={name:`labelStartImage`,resolveAll:ln.resolveAll,tokenize:bn};function bn(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var xn={name:`labelStartLink`,resolveAll:ln.resolveAll,tokenize:Sn};function Sn(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Cn={name:`lineEnding`,tokenize:wn};function wn(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}}var Tn={name:`thematicBreak`,tokenize:En};function En(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),V(t)?U(e,s,`whitespace`)(t):s(t))}}var W={continuation:{tokenize:An},exit:Mn,name:`list`,tokenize:kn},Dn={partial:!0,tokenize:Nn},On={partial:!0,tokenize:jn};function kn(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ve(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Tn,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ve(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(st,r.interrupt?n:u,e.attempt(Dn,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return V(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function An(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(st,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!V(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(On,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(W,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function jn(e,t,n){let r=this;return U(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Mn(e){e.exit(this.containerState.type)}function Nn(e,t,n){let r=this;return U(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!V(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Pn={name:`setextUnderline`,resolveTo:Fn,tokenize:In};function Fn(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function In(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),V(t)?U(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Ln={tokenize:Rn};function Rn(e){let t=this,n=e.attempt(st,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Nt,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var zn={resolveAll:Un()},Bn=Hn(`string`),Vn=Hn(`text`);function Hn(e){return{resolveAll:Un(e===`text`?Wn:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Un(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Wn(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Gn=t({attentionMarkers:()=>$n,contentInitial:()=>qn,disable:()=>er,document:()=>Kn,flow:()=>Yn,flowInitial:()=>Jn,insideSpan:()=>Qn,string:()=>Xn,text:()=>Zn}),Kn={42:W,43:W,45:W,48:W,49:W,50:W,51:W,52:W,53:W,54:W,55:W,56:W,57:W,62:lt},qn={91:Ht},Jn={[-2]:xt,[-1]:xt,32:xt},Yn={35:Jt,42:Tn,45:[Pn,Tn],60:$t,61:Pn,95:Tn,96:vt,126:vt},Xn={38:ht,92:pt},Zn={[-5]:Cn,[-4]:Cn,[-3]:Cn,33:yn,38:ht,42:tt,60:[at,sn],91:xn,92:[Kt,pt],93:ln,95:tt,96:Tt},Qn={null:[tt,zn]},$n={null:[42,95]},er={null:[]};function tr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=F(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=et(a,l.events,l),l.events):[]}function f(e,t){return rr(p(e),t)}function p(e){return nr(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&P(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function nr(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function rr(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
4
  `;break;case-3:o=`\r
@@ -55,5 +55,5 @@ $2`),t=t.replace(/([。;;::\.])\s*-(?!-)\s*/g,`$1
55
55
  `:i||a?`
56
56
  `:r})}function Rc(e){if(!e)return e;let t=String(e).replace(/\r\n/g,`
57
57
  `).replace(/\r/g,`
58
- `).trim();return t=wc(t),t=Oc(t),(t.match(/```/g)||[]).length%2==1&&(t=`${t}\n\`\`\``),Lc(t.split("```")).join("```").trim()}var zc=new RegExp([`/(?:[^\\s\`'"()\\[\\]{}<>,。;!?、:·…]+/)+[^\\s\`'"()\\[\\]{}<>,。;!?、:·…]+\\.(?:md|markdown|txt|json|csv|tsv|log|py|js|ts|tsx|jsx|html|css|yaml|yml|toml|xml|sh|sql|go|rs|java|c|cpp|h|diff|ini|png|jpg|jpeg|gif|webp|svg|bmp|ico)`,`\\.{1,2}/[^\\s\`'"()\\[\\]{}<>,。;!?、:·…]+\\.(?:md|markdown|txt|json|csv|tsv|log|py|js|ts|tsx|jsx|html|css|yaml|yml|toml|xml|sh|sql|png|jpg|jpeg|gif|webp|svg)`].join(`|`),`g`),Bc=new Set([`a`,`script`,`style`,`head`]);function Vc(e){let t=[],n=0;zc.lastIndex=0;let r;for(;r=zc.exec(e);)r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)}),t.push({type:`element`,tagName:`a`,properties:{href:`#`,dataWorkspaceFile:r[0]},children:[{type:`text`,value:r[0]}]}),n=r.index+r[0].length;return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t.length?t:[{type:`text`,value:e}]}function Hc(){return e=>{let t=(e,n)=>{if(!e.children)return;let r=n||Bc.has(e.tagName||``),i=[];for(let n of e.children){if(!r&&n.type===`text`&&typeof n.value==`string`&&(zc.lastIndex=0,zc.test(n.value))){i.push(...Vc(n.value));continue}t(n,r),i.push(n)}e.children=i};t(e,!1)}}function Uc(e){let t=[],n=0;zc.lastIndex=0;let r;for(;r=zc.exec(e);)r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)}),t.push({type:`file`,value:r[0]}),n=r.index+r[0].length;return n===0?[{type:`text`,value:e}]:(n<e.length&&t.push({type:`text`,value:e.slice(n)}),t)}var Wc=`ksadk-workspace-file-preview`;function Gc(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(Wc,{detail:{path:e}}))}function Kc(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n?.path?n.path:null)};return window.addEventListener(Wc,t),()=>window.removeEventListener(Wc,t)}var qc=Y.lazy(()=>a(()=>import(`./CodeBlock-DMIf4h33-CsO7rJKv.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.CodeBlock}))),Jc=Y.lazy(()=>a(()=>import(`./MermaidBlock-H_0qzQDf-oRTZUNRr.js`).then(e=>e.n),__vite__mapDeps([10,1,2,7,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])).then(e=>({default:e.MermaidBlock}))),Yc=Y.lazy(()=>a(()=>import(`./MathMessageMarkdown-BesSeCYl-CiB60plG.js`).then(e=>e.n),__vite__mapDeps([32,1,2,5,0,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34])).then(e=>({default:e.MathMessageMarkdown})));function Xc(e){return/\$[^$]+\$|\$\$[^$]+\$\$/.test(e)}function Zc(e){if(e)try{let t=new URL(e,typeof window>`u`?`http://localhost/`:window.location.href).protocol.toLowerCase();return[`http:`,`https:`,`mailto:`].includes(t)?e:void 0}catch{return}}function Qc(e){if(e)try{let t=new URL(e,typeof window>`u`?`http://localhost/`:window.location.href).protocol.toLowerCase();return[`http:`,`https:`].includes(t)?e:void 0}catch{return}}function $c({src:e,alt:t,...n}){let r=Qc(e),[i,a]=(0,Y.useState)(r?`loading`:`error`),[o,s]=(0,Y.useState)(null);return!r||i===`error`?(0,J.jsx)(`span`,{role:`img`,"aria-label":t||`图片无法加载`,className:`my-2 inline-flex rounded-md border border-border bg-muted px-3 py-2 text-xs text-text-secondary`,children:t||`图片无法加载`}):(0,J.jsxs)(`figure`,{className:`my-3 max-w-full`,children:[(0,J.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,title:`查看原图`,children:(0,J.jsx)(`img`,{...n,src:r,alt:t||`图片`,loading:`lazy`,decoding:`async`,onLoad:e=>{a(`loaded`),s({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight})},onError:()=>a(`error`),className:`max-h-[28rem] max-w-full cursor-zoom-in rounded-lg border border-border object-contain shadow-sm`})}),(0,J.jsxs)(`figcaption`,{className:`mt-1 flex items-center gap-2 text-xs text-text-secondary`,children:[(0,J.jsx)(`span`,{children:i===`loading`?`图片加载中…`:`点击查看原图`}),o?(0,J.jsxs)(`span`,{"aria-label":`图片尺寸`,children:[`· `,o.width,` × `,o.height]}):null,(0,J.jsx)(`a`,{href:r,download:!0,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary hover:underline`,children:`下载`})]})]})}var el={h1({children:e}){return(0,J.jsx)(`h1`,{className:`mb-3.5 mt-5 text-[17px] font-semibold text-foreground`,children:e})},h2({children:e}){return(0,J.jsx)(`h2`,{className:`mb-2.5 mt-4.5 text-[15px] font-semibold text-foreground`,children:e})},h3({children:e}){return(0,J.jsx)(`h3`,{className:`mb-2 mt-3.5 text-[14px] font-semibold text-foreground`,children:e})},p({children:e}){return(0,J.jsx)(`p`,{className:`mb-2.5 min-w-0 break-words leading-[1.65] text-foreground`,children:e})},ul({children:e}){return(0,J.jsx)(`ul`,{className:`mb-3 list-disc space-y-1.5 pl-5 text-foreground`,children:e})},ol({children:e}){return(0,J.jsx)(`ol`,{className:`mb-3 list-decimal space-y-1.5 pl-8 text-foreground`,children:e})},li({children:e}){return(0,J.jsx)(`li`,{className:`min-w-0 break-words pl-1 leading-6 text-foreground`,children:e})},strong({children:e}){return(0,J.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e})},blockquote({children:e}){return(0,J.jsx)(`blockquote`,{className:`mb-3 border-l-2 border-border pl-4 text-text-secondary`,children:e})},code({className:e,children:t,...n}){let r=/language-(\w+)/.exec(e||``),i=String(t??``);if(!r&&!i.includes(`
58
+ `).trim();return t=wc(t),t=Oc(t),(t.match(/```/g)||[]).length%2==1&&(t=`${t}\n\`\`\``),Lc(t.split("```")).join("```").trim()}var zc=new RegExp([`/(?:[^\\s\`'"()\\[\\]{}<>,。;!?、:·…]+/)+[^\\s\`'"()\\[\\]{}<>,。;!?、:·…]+\\.(?:md|markdown|txt|json|csv|tsv|log|py|js|ts|tsx|jsx|html|css|yaml|yml|toml|xml|sh|sql|go|rs|java|c|cpp|h|diff|ini|png|jpg|jpeg|gif|webp|svg|bmp|ico)`,`\\.{1,2}/[^\\s\`'"()\\[\\]{}<>,。;!?、:·…]+\\.(?:md|markdown|txt|json|csv|tsv|log|py|js|ts|tsx|jsx|html|css|yaml|yml|toml|xml|sh|sql|png|jpg|jpeg|gif|webp|svg)`].join(`|`),`g`),Bc=new Set([`a`,`script`,`style`,`head`]);function Vc(e){let t=[],n=0;zc.lastIndex=0;let r;for(;r=zc.exec(e);)r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)}),t.push({type:`element`,tagName:`a`,properties:{href:`#`,dataWorkspaceFile:r[0]},children:[{type:`text`,value:r[0]}]}),n=r.index+r[0].length;return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t.length?t:[{type:`text`,value:e}]}function Hc(){return e=>{let t=(e,n)=>{if(!e.children)return;let r=n||Bc.has(e.tagName||``),i=[];for(let n of e.children){if(!r&&n.type===`text`&&typeof n.value==`string`&&(zc.lastIndex=0,zc.test(n.value))){i.push(...Vc(n.value));continue}t(n,r),i.push(n)}e.children=i};t(e,!1)}}function Uc(e){let t=[],n=0;zc.lastIndex=0;let r;for(;r=zc.exec(e);)r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)}),t.push({type:`file`,value:r[0]}),n=r.index+r[0].length;return n===0?[{type:`text`,value:e}]:(n<e.length&&t.push({type:`text`,value:e.slice(n)}),t)}var Wc=`ksadk-workspace-file-preview`;function Gc(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(Wc,{detail:{path:e}}))}function Kc(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n?.path?n.path:null)};return window.addEventListener(Wc,t),()=>window.removeEventListener(Wc,t)}var qc=Y.lazy(()=>a(()=>import(`./CodeBlock-DMIf4h33-Cfs6se0v.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.CodeBlock}))),Jc=Y.lazy(()=>a(()=>import(`./MermaidBlock-H_0qzQDf-oRTZUNRr.js`).then(e=>e.n),__vite__mapDeps([10,1,2,7,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])).then(e=>({default:e.MermaidBlock}))),Yc=Y.lazy(()=>a(()=>import(`./MathMessageMarkdown-BesSeCYl-BIBDiQAl.js`).then(e=>e.n),__vite__mapDeps([32,1,2,5,0,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34])).then(e=>({default:e.MathMessageMarkdown})));function Xc(e){return/\$[^$]+\$|\$\$[^$]+\$\$/.test(e)}function Zc(e){if(e)try{let t=new URL(e,typeof window>`u`?`http://localhost/`:window.location.href).protocol.toLowerCase();return[`http:`,`https:`,`mailto:`].includes(t)?e:void 0}catch{return}}function Qc(e){if(e)try{let t=new URL(e,typeof window>`u`?`http://localhost/`:window.location.href).protocol.toLowerCase();return[`http:`,`https:`].includes(t)?e:void 0}catch{return}}function $c({src:e,alt:t,...n}){let r=Qc(e),[i,a]=(0,Y.useState)(r?`loading`:`error`),[o,s]=(0,Y.useState)(null);return!r||i===`error`?(0,J.jsx)(`span`,{role:`img`,"aria-label":t||`图片无法加载`,className:`my-2 inline-flex rounded-md border border-border bg-muted px-3 py-2 text-xs text-text-secondary`,children:t||`图片无法加载`}):(0,J.jsxs)(`figure`,{className:`my-3 max-w-full`,children:[(0,J.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,title:`查看原图`,children:(0,J.jsx)(`img`,{...n,src:r,alt:t||`图片`,loading:`lazy`,decoding:`async`,onLoad:e=>{a(`loaded`),s({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight})},onError:()=>a(`error`),className:`max-h-[28rem] max-w-full cursor-zoom-in rounded-lg border border-border object-contain shadow-sm`})}),(0,J.jsxs)(`figcaption`,{className:`mt-1 flex items-center gap-2 text-xs text-text-secondary`,children:[(0,J.jsx)(`span`,{children:i===`loading`?`图片加载中…`:`点击查看原图`}),o?(0,J.jsxs)(`span`,{"aria-label":`图片尺寸`,children:[`· `,o.width,` × `,o.height]}):null,(0,J.jsx)(`a`,{href:r,download:!0,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary hover:underline`,children:`下载`})]})]})}var el={h1({children:e}){return(0,J.jsx)(`h1`,{className:`mb-3.5 mt-5 text-[17px] font-semibold text-foreground`,children:e})},h2({children:e}){return(0,J.jsx)(`h2`,{className:`mb-2.5 mt-4.5 text-[15px] font-semibold text-foreground`,children:e})},h3({children:e}){return(0,J.jsx)(`h3`,{className:`mb-2 mt-3.5 text-[14px] font-semibold text-foreground`,children:e})},p({children:e}){return(0,J.jsx)(`p`,{className:`mb-2.5 min-w-0 break-words leading-[1.65] text-foreground`,children:e})},ul({children:e}){return(0,J.jsx)(`ul`,{className:`mb-3 list-disc space-y-1.5 pl-5 text-foreground`,children:e})},ol({children:e}){return(0,J.jsx)(`ol`,{className:`mb-3 list-decimal space-y-1.5 pl-8 text-foreground`,children:e})},li({children:e}){return(0,J.jsx)(`li`,{className:`min-w-0 break-words pl-1 leading-6 text-foreground`,children:e})},strong({children:e}){return(0,J.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e})},blockquote({children:e}){return(0,J.jsx)(`blockquote`,{className:`mb-3 border-l-2 border-border pl-4 text-text-secondary`,children:e})},code({className:e,children:t,...n}){let r=/language-(\w+)/.exec(e||``),i=String(t??``);if(!r&&!i.includes(`
59
59
  `))return(0,J.jsx)(`code`,{className:`break-all font-mono text-[0.92em] text-text-primary before:content-none after:content-none`,...n,children:t});let a=r?r[1]:``;return a===`mermaid`?(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(`div`,{className:`h-32 animate-pulse rounded bg-muted`}),children:(0,J.jsx)(Jc,{chart:i})}):(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(`pre`,{className:`p-4 text-sm`,children:i}),children:(0,J.jsx)(qc,{language:a,value:i})})},table({children:e,...t}){return(0,J.jsx)(`div`,{className:`mb-3 max-w-full overflow-x-auto rounded-lg border border-border`,children:(0,J.jsx)(`table`,{className:`w-full min-w-[36rem] table-auto border-collapse text-sm text-foreground`,...t,children:e})})},th({children:e,...t}){return(0,J.jsx)(`th`,{className:`break-words border-b border-border bg-muted/40 px-3 py-2 text-left align-top font-semibold text-foreground`,...t,children:e})},td({children:e,...t}){return(0,J.jsx)(`td`,{className:`break-words border-b border-border px-3 py-2 align-top text-text-secondary`,...t,children:e})},a({children:e,href:t,...n}){let r=n[`data-workspace-file`];if(typeof r==`string`&&r)return(0,J.jsx)(`a`,{href:`#`,className:`text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,title:`预览 ${r}`,onClick:e=>{e.preventDefault(),Gc(r)},...n,children:e});let i=Zc(t);return i?(0,J.jsx)(`a`,{href:i,className:`text-primary hover:underline`,target:`_blank`,rel:`noopener noreferrer`,...n,children:e}):(0,J.jsx)(`span`,{className:`text-text-secondary`,children:e})},img({src:e,alt:t,...n}){return(0,J.jsx)($c,{src:e,alt:t,...n})}},tl=Y.memo(({content:e})=>{let t=Rc(e);return(0,J.jsx)(`div`,{className:`max-w-none break-words text-[14px] leading-[1.65] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,children:(0,J.jsx)(va,{remarkPlugins:[bc,Cc],rehypePlugins:[Hc],components:el,children:t})})}),nl=Y.memo(({content:e})=>Xc(e)?(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(tl,{content:e}),children:(0,J.jsx)(Yc,{content:e})}):(0,J.jsx)(tl,{content:e}));export{nl as a,bc as c,yi as d,bi as f,f as g,z as h,Uc as i,So as l,U as m,Rc as n,Kc as o,ui as p,Hc as r,Cc as s,Gc as t,va as u};