@ensocode/server 0.3.13 → 0.3.14

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 (199) hide show
  1. package/out/phone/assets/{EditDiff-B3HxLrbF.js → EditDiff-7At9BpWJ.js} +1 -1
  2. package/out/phone/assets/{ReadFileView-BFpGH-kK.js → ReadFileView-CFkjh0Xx.js} +1 -1
  3. package/out/phone/assets/{abnfDiagram-VCTEODGH-BNvyPGoF.js → abnfDiagram-VCTEODGH-D4384sfe.js} +1 -1
  4. package/out/phone/assets/architecture-7GRP2DOG-vDamN_Vr.js +1 -0
  5. package/out/phone/assets/{architectureDiagram-5GKGNRK7-1bhpTEFA.js → architectureDiagram-5GKGNRK7-CjzMXFHb.js} +1 -1
  6. package/out/phone/assets/{blockDiagram-I7D4REHJ-Bo9UMudu.js → blockDiagram-I7D4REHJ-COX4_2NT.js} +1 -1
  7. package/out/phone/assets/{c4Diagram-7LVT6UL2-YS11cig2.js → c4Diagram-7LVT6UL2-C0PHCrzg.js} +1 -1
  8. package/out/phone/assets/channel-TsMJYH0f.js +1 -0
  9. package/out/phone/assets/{chunk-4HAMMTFA-gA-CzNGD.js → chunk-4HAMMTFA-BSqiGn28.js} +1 -1
  10. package/out/phone/assets/{chunk-75Z2AOVW-BL_5b1Dw.js → chunk-75Z2AOVW-7eocu_Pa.js} +1 -1
  11. package/out/phone/assets/{chunk-DU6HZSFF-BpNlAs9R.js → chunk-DU6HZSFF-DMttOQUE.js} +1 -1
  12. package/out/phone/assets/{chunk-F27PBJKO-lsKx96Nt.js → chunk-F27PBJKO-BFNRrOvq.js} +1 -1
  13. package/out/phone/assets/{chunk-GMAD6QVW-CxbljbtE.js → chunk-GMAD6QVW-DPVV1Shj.js} +1 -1
  14. package/out/phone/assets/{chunk-GVQU2GXP-CTO3kTOF.js → chunk-GVQU2GXP-YataTcA_.js} +1 -1
  15. package/out/phone/assets/{chunk-IMKFNOWR-Cq8XlkcB.js → chunk-IMKFNOWR-DBQKd74U.js} +1 -1
  16. package/out/phone/assets/{chunk-L3NEJ4N5-CvIm0JX7.js → chunk-L3NEJ4N5-DXfrfXkv.js} +1 -1
  17. package/out/phone/assets/{chunk-OSK3NFVY-Cj3ilTL-.js → chunk-OSK3NFVY-DWr7pP6Q.js} +1 -1
  18. package/out/phone/assets/{chunk-P2QGCYS3-B-twI_Fz.js → chunk-P2QGCYS3-C_qNKS0g.js} +1 -1
  19. package/out/phone/assets/{chunk-POPQ4Y6H-lPQttJ5s.js → chunk-POPQ4Y6H-BhJK3UtM.js} +1 -1
  20. package/out/phone/assets/{chunk-PWAF6VOD-DjwqZuIR.js → chunk-PWAF6VOD-MmcwGVgC.js} +1 -1
  21. package/out/phone/assets/{chunk-SHT3W25Y-BWRVin1H.js → chunk-SHT3W25Y-BQHA3p2Q.js} +1 -1
  22. package/out/phone/assets/{chunk-SVP7TREG-CGLhvnsS.js → chunk-SVP7TREG-DbQH56Ci.js} +1 -1
  23. package/out/phone/assets/{chunk-TICWLB2K-DkFUa03q.js → chunk-TICWLB2K-pixKba1z.js} +1 -1
  24. package/out/phone/assets/classDiagram-ZZMXUADV-Bhtnzu97.js +1 -0
  25. package/out/phone/assets/classDiagram-v2-VYDZK3BY-Bhtnzu97.js +1 -0
  26. package/out/phone/assets/{codeHighlighter-jQti-W31.js → codeHighlighter-CrZcFhK_.js} +1 -1
  27. package/out/phone/assets/{cynefin-OW5HDTMX-L8oWVu5S.js → cynefin-OW5HDTMX-67ETi-0P.js} +1 -1
  28. package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-DH8-4p4N.js → cynefinDiagram-5FMLGOSQ-C3wqlm_-.js} +1 -1
  29. package/out/phone/assets/{dagre-GXQ25YYZ-HhLDmcu9.js → dagre-GXQ25YYZ-DTC1fZsc.js} +1 -1
  30. package/out/phone/assets/desk-B382G0e_.js +52 -0
  31. package/out/phone/assets/{diagram-S7CK7UJ4-CeIbR3Ir.js → diagram-S7CK7UJ4-uqcU7OpS.js} +1 -1
  32. package/out/phone/assets/{diagram-UQ7AKVKN-BQ84Qnq6.js → diagram-UQ7AKVKN-BQ6K9f6g.js} +1 -1
  33. package/out/phone/assets/{diagram-VSXAHHWV-aF_J57fD.js → diagram-VSXAHHWV-CDzRWkI9.js} +1 -1
  34. package/out/phone/assets/{diagram-VX7I27RA-Bg1ZqM4Y.js → diagram-VX7I27RA-CvI10CG1.js} +1 -1
  35. package/out/phone/assets/{diagram-Z3DM3KII-DjTkPAqa.js → diagram-Z3DM3KII-DM8G_CIZ.js} +1 -1
  36. package/out/phone/assets/{ebnfDiagram-PWID7BFC-DPsH5Eky.js → ebnfDiagram-PWID7BFC-BBbLoaIE.js} +1 -1
  37. package/out/phone/assets/{erDiagram-RLTQ6QDP-ExvY7e6T.js → erDiagram-RLTQ6QDP-Dz98FGLq.js} +1 -1
  38. package/out/phone/assets/eventmodeling-NTZA5JFV-BGT2L4_J.js +1 -0
  39. package/out/phone/assets/flowDiagram-HODETNUW-CpTX9nm5.js +1 -0
  40. package/out/phone/assets/{ganttDiagram-EL5Y4UJY-hCe06ucl.js → ganttDiagram-EL5Y4UJY-BADRjlHl.js} +1 -1
  41. package/out/phone/assets/{gitGraph-4MIJSDKK-BuZ6lDat.js → gitGraph-4MIJSDKK-DQGKRsA2.js} +1 -1
  42. package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-D-8aVxvj.js → gitGraphDiagram-WWUBYQGX-DrLRujhH.js} +1 -1
  43. package/out/phone/assets/{info-A6RAGUB7-CrZtdoYs.js → info-A6RAGUB7-b7IbwKqs.js} +1 -1
  44. package/out/phone/assets/{infoDiagram-27XIBGKW-BLRFHxtO.js → infoDiagram-27XIBGKW-BNbXaMmR.js} +1 -1
  45. package/out/phone/assets/{ishikawaDiagram-5VMMS53U-D7SYWKoj.js → ishikawaDiagram-5VMMS53U-B3SG131F.js} +1 -1
  46. package/out/phone/assets/{journeyDiagram-3NMN7TZE-BPsg7CQD.js → journeyDiagram-3NMN7TZE-BoRfNykb.js} +1 -1
  47. package/out/phone/assets/{kanban-definition-UXKFOSKX-CbPuNr-E.js → kanban-definition-UXKFOSKX-D0tKrJ8_.js} +1 -1
  48. package/out/phone/assets/{line-CkpKMiqK.js → line-W1HWn4B7.js} +1 -1
  49. package/out/phone/assets/main-Bc8DQVa6.css +2 -0
  50. package/out/phone/assets/main-Bez4gfKe.js +281 -0
  51. package/out/phone/assets/{mermaid-parser.core-RTq_mEm1.js → mermaid-parser.core-CpGE7UgS.js} +3 -3
  52. package/out/phone/assets/{mermaid.core-D9LtIKua.js → mermaid.core-wueTI3u_.js} +4 -4
  53. package/out/phone/assets/{mindmap-definition-YA3MSWOX-8cGgRiRD.js → mindmap-definition-YA3MSWOX-BDctzErY.js} +1 -1
  54. package/out/phone/assets/{packet-AYTQ26CC-D9-eSn0v.js → packet-AYTQ26CC-C0YWsXol.js} +1 -1
  55. package/out/phone/assets/{pegDiagram-XKGWAZYB-DztU_rIE.js → pegDiagram-XKGWAZYB-C97XjNI7.js} +1 -1
  56. package/out/phone/assets/{pie-WAS4IAKB-Bk2Tqaq_.js → pie-WAS4IAKB-BxuJ1GKP.js} +1 -1
  57. package/out/phone/assets/{pieDiagram-E7YTZNPT-Dm_3mJ9_.js → pieDiagram-E7YTZNPT-SP4DeWDw.js} +1 -1
  58. package/out/phone/assets/{quadrantDiagram-AXDQQJYC-lKskzjzu.js → quadrantDiagram-AXDQQJYC-DDHL4rrG.js} +1 -1
  59. package/out/phone/assets/{radar-RG4KPBEZ-B2z8Txd8.js → radar-RG4KPBEZ-AzVB8zoH.js} +1 -1
  60. package/out/phone/assets/{railroad-74A4TZTK-11VmdALq.js → railroad-74A4TZTK-CA2_A72l.js} +1 -1
  61. package/out/phone/assets/railroad-abnf-HS5TGJTU-CTHhRGvc.js +1 -0
  62. package/out/phone/assets/railroad-ebnf-LZEXJU2U-CS68P4fL.js +1 -0
  63. package/out/phone/assets/railroad-peg-WCYAUIDC-BqCcrVdf.js +1 -0
  64. package/out/phone/assets/{railroadDiagram-O6MQD6OU-Dr0NTIA6.js → railroadDiagram-O6MQD6OU-D5zpQ5kq.js} +1 -1
  65. package/out/phone/assets/{requirementDiagram-BXWQKSXE-C0W6h_5I.js → requirementDiagram-BXWQKSXE-DkQKt5hJ.js} +1 -1
  66. package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CVJDathY.js → sankeyDiagram-P5KCCOFB-xeXrVMVr.js} +1 -1
  67. package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BxHQTG6x.js → sequenceDiagram-WJ2MYXX4-BOiNtyS8.js} +1 -1
  68. package/out/phone/assets/shellUpdate-C4yk9AaU.js +1 -0
  69. package/out/phone/assets/{stateDiagram-D77RDMKH-BO5MAjhs.js → stateDiagram-D77RDMKH-Bs8LX9-n.js} +1 -1
  70. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-nBP_YibA.js +1 -0
  71. package/out/phone/assets/{swimlanes-42K2YHIH-DnhDPyy6.js → swimlanes-42K2YHIH-DQVYfgSI.js} +1 -1
  72. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-BkfzXxS-.js +8 -0
  73. package/out/phone/assets/{timeline-definition-24CTP7MA-bLEjS7re.js → timeline-definition-24CTP7MA-BlpgdxeN.js} +1 -1
  74. package/out/phone/assets/{treeView-Q6P3EWNA-Ci-sA9wK.js → treeView-Q6P3EWNA-D0PiggHr.js} +1 -1
  75. package/out/phone/assets/{treemap-WGGIJYW6-BXCjzK65.js → treemap-WGGIJYW6-DA07Kvo0.js} +1 -1
  76. package/out/phone/assets/{vennDiagram-4TSXK5OY-DHsj5dRx.js → vennDiagram-4TSXK5OY-BtvfF1a4.js} +1 -1
  77. package/out/phone/assets/{wardley-WFR3VGLG-d8TdCu-H.js → wardley-WFR3VGLG-Db-UrSZJ.js} +1 -1
  78. package/out/phone/assets/{wardleyDiagram-VM6X3IG4-DQFVP9qu.js → wardleyDiagram-VM6X3IG4-CaBnqFYM.js} +1 -1
  79. package/out/phone/assets/{xychartDiagram-S5SC5T6Z-Dni2Y0ov.js → xychartDiagram-S5SC5T6Z-Bbzz9YwS.js} +1 -1
  80. package/out/phone/desk.html +3 -3
  81. package/out/phone/index.html +4 -4
  82. package/out/phone/sw.js +2 -2
  83. package/out/renderer/assets/{EditDiff-DxxLuCEI.js → EditDiff-C9JBUR0o.js} +1 -1
  84. package/out/renderer/assets/{File-Tz3MUtN6.js → File-BIf-onMm.js} +1 -1
  85. package/out/renderer/assets/{ReadFileView-DFoLPU04.js → ReadFileView-C5AKNlFU.js} +1 -1
  86. package/out/renderer/assets/{SidePanel-D0m4IYxS.css → SidePanel-DN2RL6QD.css} +1 -1
  87. package/out/renderer/assets/SidePanel-DkSc3og9.js +48 -0
  88. package/out/renderer/assets/{Virtualizer-B0uwx_XV.js → Virtualizer-tZu4hGtC.js} +1 -1
  89. package/out/renderer/assets/{abnfDiagram-VCTEODGH-CJ9nn9eH.js → abnfDiagram-VCTEODGH-DxBBUZxF.js} +1 -1
  90. package/out/renderer/assets/{arc-B8im8n0O.js → arc-DXzwxP4j.js} +1 -1
  91. package/out/renderer/assets/{architectureDiagram-5GKGNRK7-BRSi5FBk.js → architectureDiagram-5GKGNRK7-Bcykp-Fb.js} +1 -1
  92. package/out/renderer/assets/{blockDiagram-I7D4REHJ-CQ1wirIl.js → blockDiagram-I7D4REHJ-P7zMiiL3.js} +1 -1
  93. package/out/renderer/assets/{c4Diagram-7LVT6UL2-9HyLIioe.js → c4Diagram-7LVT6UL2-BVD9zEE8.js} +1 -1
  94. package/out/renderer/assets/channel-7bWV5QTy.js +1 -0
  95. package/out/renderer/assets/{chunk-2Q5K7J3B-BwC9g3bx.js → chunk-2Q5K7J3B-BXj05DaP.js} +1 -1
  96. package/out/renderer/assets/{chunk-5VM5RSS4-DMtgxPBL.js → chunk-5VM5RSS4-D-SpodcG.js} +1 -1
  97. package/out/renderer/assets/{chunk-F27PBJKO-DSi_XV5v.js → chunk-F27PBJKO-ORLEQ9sv.js} +1 -1
  98. package/out/renderer/assets/{chunk-IMKFNOWR-Dctc6Apj.js → chunk-IMKFNOWR-1lhHjr20.js} +1 -1
  99. package/out/renderer/assets/{chunk-JWPE2WC7-I2BD5qM7.js → chunk-JWPE2WC7-BgmlC9Vl.js} +1 -1
  100. package/out/renderer/assets/{chunk-POPQ4Y6H-k60pc4eT.js → chunk-POPQ4Y6H-DPEfkZnH.js} +1 -1
  101. package/out/renderer/assets/{chunk-SVP7TREG-zCGemfqm.js → chunk-SVP7TREG-7_S5Geoi.js} +1 -1
  102. package/out/renderer/assets/{chunk-TICWLB2K-CdDiHIq-.js → chunk-TICWLB2K-BKi8yvLf.js} +1 -1
  103. package/out/renderer/assets/{chunk-XXDRQBXY-GYVDxVfN.js → chunk-XXDRQBXY-PfB25f1D.js} +1 -1
  104. package/out/renderer/assets/classDiagram-ZZMXUADV-mgQwYiWM.js +1 -0
  105. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-mgQwYiWM.js +1 -0
  106. package/out/renderer/assets/{cose-bilkent-JH36ORCC-BnSAtUh-.js → cose-bilkent-JH36ORCC-C246yayw.js} +1 -1
  107. package/out/renderer/assets/{cynefin-OW5HDTMX-DnQaS9VN.js → cynefin-OW5HDTMX-Dr9W26Pe.js} +1 -1
  108. package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-BNQdw0PV.js → cynefinDiagram-5FMLGOSQ-B3Jtuns2.js} +1 -1
  109. package/out/renderer/assets/{cytoscape-fcose-CzkrRInm.js → cytoscape-fcose-CJat50hU.js} +1 -1
  110. package/out/renderer/assets/{dagre-GXQ25YYZ-fG1vMsyn.js → dagre-GXQ25YYZ-Dt2pulYx.js} +1 -1
  111. package/out/renderer/assets/{diagram-S7CK7UJ4-BcfAFVc2.js → diagram-S7CK7UJ4-Bx-0FuVR.js} +1 -1
  112. package/out/renderer/assets/{diagram-UQ7AKVKN-D8f3Tsx9.js → diagram-UQ7AKVKN-D-8o1p4p.js} +1 -1
  113. package/out/renderer/assets/{diagram-VSXAHHWV-B-U9CIWt.js → diagram-VSXAHHWV-CI0jUOHM.js} +1 -1
  114. package/out/renderer/assets/{diagram-VX7I27RA-CX6ifTkJ.js → diagram-VX7I27RA-Byl54mOd.js} +1 -1
  115. package/out/renderer/assets/{diagram-Z3DM3KII-49dS9s3L.js → diagram-Z3DM3KII-Kf_GIJ7p.js} +1 -1
  116. package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CraGJRI7.js → ebnfDiagram-PWID7BFC-BbOdw7R1.js} +1 -1
  117. package/out/renderer/assets/{erDiagram-RLTQ6QDP-CfMNvEoW.js → erDiagram-RLTQ6QDP-UjxTTQ7M.js} +1 -1
  118. package/out/renderer/assets/{flowDiagram-HODETNUW-C8XM3p4T.js → flowDiagram-HODETNUW-BVuwOxKp.js} +1 -1
  119. package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-DlJBMKFX.js → ganttDiagram-EL5Y4UJY-BpBSO-4X.js} +1 -1
  120. package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-DvEzDsKF.js → gitGraphDiagram-WWUBYQGX-b72vZ1j2.js} +1 -1
  121. package/out/renderer/assets/globals-2G408HiJ.css +1 -0
  122. package/out/renderer/assets/globals-BqVjlAT_.js +673 -0
  123. package/out/renderer/assets/index-AHhNcASr.js +113 -0
  124. package/out/renderer/assets/{infoDiagram-27XIBGKW-CckfBO-R.js → infoDiagram-27XIBGKW-CtnN4sif.js} +1 -1
  125. package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-mUoXchkB.js → ishikawaDiagram-5VMMS53U-B2YfGNEH.js} +1 -1
  126. package/out/renderer/assets/{journeyDiagram-3NMN7TZE-zzLL0HFW.js → journeyDiagram-3NMN7TZE-fUfanA7T.js} +1 -1
  127. package/out/renderer/assets/{kanban-definition-UXKFOSKX-BJ_9aIhB.js → kanban-definition-UXKFOSKX-DU0d3NVH.js} +1 -1
  128. package/out/renderer/assets/{layout-3SRMHY7n.js → layout-C0hE7llw.js} +1 -1
  129. package/out/renderer/assets/{linear-CWpclK_R.js → linear-BXPh0BlC.js} +1 -1
  130. package/out/renderer/assets/{manifest-DOzTaB8J.js → manifest-DoBt8euy.js} +1 -1
  131. package/out/renderer/assets/{mermaid.core-DORpmVi3.js → mermaid.core-DlBAsGZ7.js} +5 -5
  132. package/out/renderer/assets/{mindmap-definition-YA3MSWOX-CYBlCqIB.js → mindmap-definition-YA3MSWOX-DUIiyta9.js} +1 -1
  133. package/out/renderer/assets/{pegDiagram-XKGWAZYB-DhWwLs4v.js → pegDiagram-XKGWAZYB-yP15oXPx.js} +1 -1
  134. package/out/renderer/assets/{pieDiagram-E7YTZNPT-Bzpc57-A.js → pieDiagram-E7YTZNPT-DsaSjWfA.js} +1 -1
  135. package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-spKXEbds.js → quadrantDiagram-AXDQQJYC-BpWn5xT_.js} +1 -1
  136. package/out/renderer/assets/{railroadDiagram-O6MQD6OU-Br553px3.js → railroadDiagram-O6MQD6OU-BnXhwCom.js} +1 -1
  137. package/out/renderer/assets/{requirementDiagram-BXWQKSXE-CX-Dqij_.js → requirementDiagram-BXWQKSXE-CMIMPMzx.js} +1 -1
  138. package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-Bgx1W6B9.js → sankeyDiagram-P5KCCOFB-CKqneOc7.js} +1 -1
  139. package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-CKQv6pcU.js → sequenceDiagram-WJ2MYXX4-azbHkcGk.js} +1 -1
  140. package/out/renderer/assets/{sessionChanges-BLzNhRuv.js → sessionChanges--o0RBCJW.js} +1 -1
  141. package/out/renderer/assets/settings-D5R80op8.js +28 -0
  142. package/out/renderer/assets/{sizeCapture-INFHLROL-DtRedfRe.js → sizeCapture-INFHLROL-C3uhIZ1e.js} +1 -1
  143. package/out/renderer/assets/{stateDiagram-D77RDMKH-CMP5owem.js → stateDiagram-D77RDMKH-CrGab2Ck.js} +1 -1
  144. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-k_H7O8MU.js +1 -0
  145. package/out/renderer/assets/{swimlanes-42K2YHIH-D30AvvmW.js → swimlanes-42K2YHIH-6aX1l7C2.js} +1 -1
  146. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-D2XerlPy.js +8 -0
  147. package/out/renderer/assets/{timeline-definition-24CTP7MA-CsZAMmMZ.js → timeline-definition-24CTP7MA-DdVDUmce.js} +1 -1
  148. package/out/renderer/assets/{vennDiagram-4TSXK5OY-COQ7L1f7.js → vennDiagram-4TSXK5OY-DP6DTjdX.js} +1 -1
  149. package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-dqMWLTCs.js → wardleyDiagram-VM6X3IG4-DYJsuZCs.js} +1 -1
  150. package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DX4clIYP.js → xychartDiagram-S5SC5T6Z-CloAJCw-.js} +1 -1
  151. package/out/renderer/index.html +3 -3
  152. package/out/renderer/settings.html +7 -7
  153. package/out/renderer/web-preload.js +1 -51
  154. package/out/server/agent.js +1172 -242
  155. package/out/server/chunks/agentConstants-D4t7d6iS.js +9 -0
  156. package/out/server/chunks/builtinOccupancy-Ci-Szozb.js +93 -0
  157. package/out/server/chunks/dispatchModel-DJxnHup9.js +75 -0
  158. package/out/server/chunks/{gpuBackendInstall-jAzoFq7U.js → gpuBackendInstall-snisWLXN.js} +2 -2
  159. package/out/server/chunks/killTree-T-p6Lr3w.js +787 -0
  160. package/out/server/chunks/{loadProvider-NdOVbsHi.js → loadProvider-Uq3i7kKZ.js} +2 -2
  161. package/out/server/chunks/{manifest-BPXFscqI.js → manifest-CmnE8RBt.js} +4 -2
  162. package/out/server/chunks/menuSkills-BEtW-Is6.js +53 -0
  163. package/out/server/chunks/projectCode-D9lgShsp.js +112 -0
  164. package/out/server/chunks/{registry-BhoHPSKn.js → registry-R2KRdU8n.js} +97 -115
  165. package/out/server/chunks/sendImage-CCjNsa-D.js +499 -0
  166. package/out/server/chunks/{sendImage-BCNW9JRV.js → toolParams-DVs5d3F9.js} +25 -234
  167. package/out/server/chunks/web-BIJOMDlz.js +7773 -0
  168. package/out/server/chunks/{workflowPresets-C2T1BzA2.js → workflowPresets-DVbQh2el.js} +13603 -15626
  169. package/out/server/index.js +8778 -3210
  170. package/out/server/memory-service.js +197 -147
  171. package/out/server/plugin-host.js +44 -18
  172. package/package.json +1 -1
  173. package/out/phone/assets/architecture-7GRP2DOG-Duql1LsL.js +0 -1
  174. package/out/phone/assets/channel-BPoIHov1.js +0 -1
  175. package/out/phone/assets/classDiagram-ZZMXUADV-CIR76lHP.js +0 -1
  176. package/out/phone/assets/classDiagram-v2-VYDZK3BY-CIR76lHP.js +0 -1
  177. package/out/phone/assets/desk-CixRGdTk.js +0 -52
  178. package/out/phone/assets/eventmodeling-NTZA5JFV-DYp-zWcL.js +0 -1
  179. package/out/phone/assets/flowDiagram-HODETNUW-CIU32By5.js +0 -1
  180. package/out/phone/assets/main-BCnf7dVM.js +0 -264
  181. package/out/phone/assets/main-nqB-uD3v.css +0 -2
  182. package/out/phone/assets/railroad-abnf-HS5TGJTU-BkSycwye.js +0 -1
  183. package/out/phone/assets/railroad-ebnf-LZEXJU2U-BsPIU3iV.js +0 -1
  184. package/out/phone/assets/railroad-peg-WCYAUIDC-Cy8G7u5C.js +0 -1
  185. package/out/phone/assets/shellUpdate-DPSfgHG3.js +0 -36
  186. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-B8IHc2bm.js +0 -1
  187. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-dmSDAN2F.js +0 -8
  188. package/out/renderer/assets/SidePanel-CL40W2RY.js +0 -47
  189. package/out/renderer/assets/channel-DjB0ww6b.js +0 -1
  190. package/out/renderer/assets/classDiagram-ZZMXUADV-6SiAw1np.js +0 -1
  191. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-6SiAw1np.js +0 -1
  192. package/out/renderer/assets/globals-BFf1P-Y5.js +0 -715
  193. package/out/renderer/assets/globals-DUBhAVpU.css +0 -1
  194. package/out/renderer/assets/index-L4TTIP10.js +0 -89
  195. package/out/renderer/assets/settings-Bsrw4ERp.js +0 -25
  196. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-6-731AqJ.js +0 -1
  197. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-B8KijqIT.js +0 -8
  198. package/out/server/chunks/agent-BbNq8i9j.js +0 -4241
  199. package/out/server/chunks/dispatchModel-CsfmL396.js +0 -20
@@ -0,0 +1,281 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-aPuBvESs.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/html-BsvMqTlf.js","assets/javascript-DcMHgNcu.js","assets/css-DlBQoFxe.js","assets/angular-ts-ocjSXnvf.js","assets/scss-BaZL6t2Y.js","assets/apl-D8Zaj6f9.js","assets/xml-C01ajBW7.js","assets/java-D7h0NA_A.js","assets/json-DePJdKYk.js","assets/astro-CbVusc_k.js","assets/typescript-BTGs5etX.js","assets/postcss-BXeXVLqQ.js","assets/tsx-DvWhG4dC.js","assets/blade-BuKMbjJR.js","assets/html-derivative-D9FvRNj4.js","assets/sql-DvarVTMJ.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/c-BNQJhXlP.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-CFMD-Djs.js","assets/cobol-qSrRm_BU.js","assets/coffee-BP03ytLP.js","assets/cpp-CUBNVKxn.js","assets/regexp-I2jnduhj.js","assets/glsl-CyFpZtQv.js","assets/crystal-CCpd0BXH.js","assets/shellscript-B51zB43X.js","assets/edge-k_uo0VIr.js","assets/elixir-CJS91GrO.js","assets/elm-Bmx6Fs0i.js","assets/erb-yi0ZozmI.js","assets/ruby-D1ky9XZ0.js","assets/haml-Dds4VdNJ.js","assets/graphql-BIyAKkG2.js","assets/jsx-BUUYi3qs.js","assets/lua-Z49wBRLR.js","assets/yaml-BWCS3NLV.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-C-RR1FSc.js","assets/glimmer-js-Di6EiJvU.js","assets/glimmer-ts-C2P-EwIP.js","assets/hack-DDi4pUY-.js","assets/handlebars-C81KA5yo.js","assets/http-c4_vT9ST.js","assets/hurl-BqZA9I9Q.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-CixBDh_U.js","assets/jison-Ru_S5AEn.js","assets/julia-CaY0JZD0.js","assets/r-CvCSiWB_.js","assets/just-Q4EdCjF5.js","assets/perl-BtArmf81.js","assets/latex-t1iljvl0.js","assets/tex-JPaUWOrn.js","assets/liquid-DEL4RHa9.js","assets/marko-DYWPPmCl.js","assets/less-DVTAwKKz.js","assets/mdc-CsAWFGA9.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-BrbrEdla.js","assets/nim-BjwzhXka.js","assets/org-TFl3N09_.js","assets/clojure-DqKBuwfJ.js","assets/csharp-oqKa8noW.js","assets/dart-CnvKMtbv.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-Cx25uSIP.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-CCLNyvR3.js","assets/pug-B4bk2kWf.js","assets/qml-g4UDed-8.js","assets/razor-BSt2ayLr.js","assets/rst-BucurtmO.js","assets/cmake-Bj61d0ZC.js","assets/sas-CUQt684o.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-B-KBpmJs.js","assets/soy-D5xCHD_M.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-8TbiBYrm.js","assets/surrealql-DalIYx4r.js","assets/svelte-D4FIy7cP.js","assets/templ-DP4lTcEq.js","assets/ts-tags-CNUq3so9.js","assets/twig-Chu5fnNS.js","assets/typst--WwEKe8X.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-CCSX75yM.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-DjCn01CB.js","assets/vue-html-BXjKVtKk.js","assets/vue-vine-By_xyXdL.js","assets/stylus-B6D30XZt.js","assets/mermaid.core-wueTI3u_.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-oBChb5qS.js","assets/chunk-DU6HZSFF-DMttOQUE.js","assets/chunk-75Z2AOVW-7eocu_Pa.js","assets/dist-B_J_HbC0.js","assets/chunk-PWAF6VOD-MmcwGVgC.js","assets/chunk-GMAD6QVW-DPVV1Shj.js","assets/chunk-P2QGCYS3-C_qNKS0g.js","assets/chunk-4HAMMTFA-BSqiGn28.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-YataTcA_.js","assets/chunk-OSK3NFVY-DWr7pP6Q.js","assets/line-W1HWn4B7.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-DXfrfXkv.js","assets/EditDiff-7At9BpWJ.js","assets/shellUpdate-C4yk9AaU.js","assets/codeHighlighter-CrZcFhK_.js","assets/ReadFileView-CFkjh0Xx.js","assets/jsQR-B1eQcpQl.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";import{A as r,At as i,B as a,Bt as o,C as s,Ct as c,D as l,Dt as u,E as d,Et as f,F as p,Ft as m,G as h,H as g,Ht as _,I as v,It as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,O as E,Ot as D,P as O,Pt as k,R as A,Rt as j,S as M,St as N,T as P,Tt as F,U as I,Ut as ee,V as L,Vt as te,W as R,_ as z,a as ne,at as re,b as B,c as ie,ct as ae,d as oe,dt as se,f as V,ft as ce,g as le,h as ue,ht as de,it as fe,j as pe,jt as me,k as he,kt as ge,l as _e,lt as ve,m as ye,mt as be,n as xe,o as Se,ot as Ce,p as we,rt as Te,s as Ee,t as De,tt as Oe,ut as ke,vt as Ae,w as je,wt as Me,y as Ne,z as Pe,zt as Fe}from"./shellUpdate-C4yk9AaU.js";function Ie(){window.electronAPI||Object.defineProperty(window,"electronAPI",{value:{git:{diffHead:async()=>({ok:!1,error:`unavailable`})},changes:{readSnapshots:async()=>({}),writeSnapshots:async()=>!1},workspaceFiles:{listDir:async()=>({ok:!1,error:`unavailable`}),read:async()=>({ok:!1,error:`unavailable`}),write:async()=>({ok:!1,error:`unavailable`}),watchStart:async()=>({ok:!1,error:`unavailable`}),watchStop:async()=>({ok:!1,error:`unavailable`}),onChange:()=>()=>void 0,search:async()=>({ok:!1,error:`unavailable`})},files:{read:async()=>null,search:async()=>[],pathForFile:()=>null},agentRegistry:{list:async()=>null},agent:{stopTask:async()=>({ok:!1,error:`not supported on phone`}),stopSubagent:async()=>({ok:!1,error:`not supported on phone`})},providers:{listOauth:async()=>[],getOauthUsage:async()=>null}},writable:!1})}function Le(e){let t=window.electronAPI?.agent;t&&(t.stopTask=async(t,n)=>(e.stopTask(t,n),{ok:!0}),t.stopSubagent=async(t,n)=>(e.stopSubagent(t,n),{ok:!0}))}Ie();var Re=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ze=n(((e,t)=>{t.exports=Re()})),Be=n((e=>{var t=ee();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),Ve=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Be()})),He=n((e=>{var t=ze(),n=ee(),r=Ve();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],L=-1;function te(e){return{current:e}}function R(e){0>L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var ne=te(null),re=te(null),B=te(null),ie=te(null);function ae(e,t){switch(z(B,t),z(re,e),z(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ne),z(ne,e)}function oe(){R(ne),R(re),R(B)}function se(e){e.memoizedState!==null&&z(ie,e);var t=ne.current,n=qd(t,e.type);t!==n&&(z(re,e),z(ne,n))}function V(e){re.current===e&&(R(ne),R(re)),ie.current===e&&(R(ie),rp._currentValue=F)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function Be(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function H(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=P.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function et(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var tt=Math.random().toString(36).slice(2),U=`__reactFiber$`+tt,nt=`__reactProps$`+tt,rt=`__reactContainer$`+tt,it=`__reactEvents$`+tt,at=`__reactListeners$`+tt,ot=`__reactHandles$`+tt,st=`__reactResources$`+tt,ct=`__reactMarker$`+tt;function lt(e){delete e[U],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[U];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[U]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[U])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[U]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),bt={},xt={};function St(e){return he.call(xt,e)?!0:he.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Ft(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ht(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Gt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Kt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(Cu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,"passive",{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return ln=i.slice(e,1<r?1-r:void 0)}function dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=f({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=f({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(f({},Sn,{dataTransfer:0})),Tn=mn(f({},_n,{relatedTarget:0})),En=mn(f({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(f({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(f({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(f({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(f({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(f({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(f({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(f({},Sn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),zn=mn(f({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Ad(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){Sd(e,0)}function ir(e){if(At(ft(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!he.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=jt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=rn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==jt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Ad(Er,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};rn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),_t(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,ne.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ri(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ci(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ri(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ri(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ri(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Me(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,Ai=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[U]=e,t[nt]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Oi=Oi.return}}function Li(e){if(e!==Oi)return!1;if(!Ai)return Ii(e),Ai=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Jd(e.type,e.memoizedProps)),n=!n),n&&ki&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=hf(e)}else t===27?(t=ki,nf(e.type)?(e=mf,mf=null,ki=e):ki=t):ki=Oi?pf(e.stateNode.nextSibling):null;return!0}function Ri(){ki=Oi=null,Ai=!1}function zi(){var e=ji;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=te(null),Hi=null,Ui=null;function Wi(e,t,n){z(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,R(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ie.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=md(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=N.S;N.S=function(e,t){ru=be(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=te(null);function ha(){var e=ma.current;return e===null?Rl.pooledCache:e}function ga(e,t){t===null?z(ma,ma.current):z(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e}throw W=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(W=e,va):e}}var W=null;function Ta(){if(W===null)throw Error(i(459));var e=W;return W=null,e}function Ea(e){if(e===va||e===ba)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Ca(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&wa(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),Aa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=si(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case h:return t=di(t,e.mode,n),t.return=e,t;case T:return t=wa(t),f(e,t,n)}if(M(t)||k(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===b)return f(e,Qi(e,t),n);ja(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=wa(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===b)return p(e,t,Qi(e,n),r);ja(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=wa(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,ka(r),i);if(r.$$typeof===b)return _(e,t,n,Qi(t,r),i);ja(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ai&&Ci(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ai&&Ci(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ai&&Ci(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ai&&Ci(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ai&&Ci(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ai&&Ci(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=wa(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,ka(o),c);if(o.$$typeof===b)return x(e,r,Qi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=x(e,t,n,r);return Da=null,i}catch(t){if(t===va||t===ba)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=la;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Bl&p)===p:(r&p)===p){p!==0&&p===ca&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Fa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function G(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)G(n[e],t)}var Ka=te(null),qa=te(0);function Ja(e,t){e=Kl,z(qa,e),z(Ka,t),Kl=e|t.baseLanes}function Ya(){z(qa,Kl),z(Ka,Ka.current)}function Xa(){Kl=qa.current,R(Ka),R(qa)}var Za=te(null),Qa=null;function $a(e){var t=e.alternate;z(io,io.current&1),z(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){z(io,io.current),z(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(z(io,io.current),z(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){z(io,io.current),z(Za,Za.current)}function ro(e){R(Za),Qa===e&&(Qa=null),R(io)}var io=te(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,so=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return oo=a,so=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Is:Ls,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){N.H=Fs;var t=co!==null&&co.next!==null;if(oo=0,lo=co=so=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Yi(e)&&($s=!0))}function So(e,t,n,r){so=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Rs,o=t(n,r)}while(fo);return o}function Co(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(so.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}oo=0,lo=co=so=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?so.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=so.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?so.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw so.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?so.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ca(go,e,t),t=so,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Is:Ls),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===b)return Zi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=so.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=so.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),so.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((oo&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,so.lanes|=p,Jl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,so.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&($s=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=so,a=Oo(),o=Ai;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((co||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||oo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=so.updateQueue,t===null?(t=ko(),so.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ho(e){var t=Qr(e,2);t!==null&&vu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(Ai){var n=Rl.formState;if(n!==null){a:{var r=so;if(Ai){if(ki){b:{for(var i=ki,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=pf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,so,r),r.dispatch=n,r=Uo(!1),a=K.bind(null,so,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,so,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(so.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=so.updateQueue,t===null&&(t=ko(),so.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();so.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(so.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){so.flags|=4;var t=so.updateQueue;if(t===null)t=ko(),so.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||oo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),so.lanes|=e,Jl|=e,n)}function ys(e,t,n,r){return _r(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Bl&261930)?($s=!0,e.memoizedState=n):(e=_u(),so.lanes|=e,Jl|=e,t):(e=vs(e,n,r),_r(e,t)||($s=!0),e)}function bs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,K(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),gu(e)):js(e,t,r,gu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,F,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},gu())}function Ts(){return Zi(rp)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Ra(n);var r=za(t,e,n);r!==null&&(vu(r,t,n),Ba(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Zr(e,t,n,r),n!==null&&(vu(n,e,r),Ps(n,t,r)))}function As(e,t,n){js(e,t,n,gu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Rl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return vu(n,e,r),Ps(n,t,r),!0}return!1}function K(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&vu(t,e,2)}function Ms(e){var t=e.alternate;return e===so||t!==null&&t===so}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Fs={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Fs.useEffectEvent=vo;var Is={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,so,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,so,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,so,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=so,a=Do();if(Ai){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Rl.identifierPrefix;if(Ai){var n=Si,r=xi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=K.bind(null,so,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,so)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Ls.useEffectEvent=us;var Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(vu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(vu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(vu(t,e,n),Ba(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Gr(e)}function Gs(e){console.error(e)}function Ks(e){Gr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ra(e),e.tag=3,e}function q(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Ai)return t=Za.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Ys(e.stateNode,r,a),Va(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),q(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!$s?(To(e,t,i),Tc(e,t,i)):(Ai&&s&&Ti(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Ya(),no(t)):(ga(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Ya(),to(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Na(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ai){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=ki)?(e=lf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if($s||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),vu(r,e,s),Qs;Au(),t=cc(e,t,n)}else e=o.treeContext,ki=pf(s.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!$s?(To(e,t,i),Tc(e,t,i)):(Ai&&r&&Ti(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!$s?(To(e,t,a),Tc(e,t,a)):(Ai&&r&&Ti(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Fa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,La(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Fa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ri(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:_a()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Ai){if(a?$a(t):no(t),(e=ki)?(e=lf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),vu(s,e,r),Qs;uf(c)||Au(),t=xc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=pf(c.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Na(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,z(io,o),ec(e,t,r,n),r=Ai?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Yi(e)))}function Dc(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:se(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,Ai&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Us(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=tc(null,t,e,r,n);break a}if(a===w){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Ua(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=pi(Error(i(424)),t),Bi(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=pf(e.firstChild),Oi=t,Ai=!0,ji=null,Mi=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ai||(n=t.type,e=t.pendingProps,r=Gd(B.current).createElement(n),r[U]=t,r[nt]=e,zd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Ai&&(r=t.stateNode=_f(t.type,t.pendingProps,B.current),Oi=t,Mi=!0,a=ki,nf(t.type)?(mf=a,ki=pf(r.firstChild)):ki=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ai&&((a=r=ki)&&(r=sf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Oi=t,ki=pf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),rp._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&Ai&&((e=n=ki)&&(n=cf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Pi(t)),null;case 13:return vc(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Rl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw W=xa,ya}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t)){if(Du())e.flags|=8192;else throw W=xa,ya}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,Ql|=t)}function Nc(e,t){if(!Ai)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(V(t),n=B.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=ne.current,Li(t)?Fi(t,e):(e=_f(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(V(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=ne.current,Li(t))Fi(t,o);else{var s=Gd(B.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[U]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=B.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[U]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Pi(t,!0)}else e=Gd(e).createTextNode(r),e[U]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[U]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[U]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return oe(),e===null&&Ed(t.stateNode.containerInfo),Pc(t),null;case 10:return Gi(t.type),Pc(t),null;case 19:if(R(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return z(io,io.current&1|2),Ai&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>iu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ai)return Pc(t),null}else 2*be()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=io.current,z(io,a?n&1|2:n&1),Ai&&Ci(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return V(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(io),null;case 4:return oe(),null;case 10:return Gi(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&R(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ei(t),t.tag){case 3:Gi(ra),oe();break;case 26:case 27:case 5:V(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:R(io);break;case 10:Gi(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&R(ma);break;case 24:Gi(ra)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ju(e,e.return,t)}}}function Vc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[nt]=t}catch(t){Ju(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[U]=e,t[nt]=n}catch(t){Ju(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Ud=fp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},fp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;nf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),vf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null){if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}}break;case 18:al!==null&&(ol?(e=al,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):rf(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){Ju(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){Ju(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[U]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[U]=e,mt(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[U]=e,mt(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode)}else e.stateNode=Vf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Gf=null,a=ml,ml=xf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){Ju(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=xf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:vf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)G(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Xf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=xf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:N.T===null?$e():md()}function _u(){if(Zl===0){if(!(Bl&536870912)||Ai){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),Zl=e}else Zl=536870912}return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Ke(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ue(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-be(),10<a)){if(Su(r,t,Zl,!Ul),He(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Zd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},kl(t,a,d);var m=(a&62914560)===a?nu-be():(a&4194048)===a?ru-be():0;if(m=Qf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function Cu(){return Ll&6?!0:(cd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,Ui=Hi=null,Eo(e),Da=null,Oa=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=ai(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Ue(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Yr(),n}function Eu(e,t){so=null,N.H=Fs,t===va||t===ba?(t=Ta(),Vl=3):t===ya?(t=Ta(),Vl=4):Vl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,qs(e,pi(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=N.H;return N.H=Fs,e===null?Fs:e}function ku(){var e=N.A;return N.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,Ll=r,N.H=i,N.A=a,zl===null&&(Rl=null,Bl=0,Yr()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=be()+500,Tu(e,t)):Wl=Ue(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:Sa(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Yf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Ui=Hi=null,N.H=r,N.A=a,Ll=n,zl===null?(Rl=null,Bl=0,Yr(),ql):0}function Pu(){for(;zl!==null&&!ve();)Fu(zl)}function Fu(e){var t=Oc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:Eo(t);default:Lc(n,t),t=zl=oi(t,Kl),t=Oc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){Ui=Hi=null,Eo(t),Da=null,Oa=0;var i=t.return;try{if(Zs(e,i,t,n,Bl)){ql=1,qs(e,pi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,qs(e,pi(n,e.current)),zl=null;return}t.flags&32768?(Ai||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Fc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,qe(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(we,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,P.p=a,N.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Wd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Ud,Wd=Ud=null}finally{Ll=i,P.p=r,N.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,P.p=r,N.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,ye();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),Qe(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=Qe(uu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,cd(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{P.p=a,N.T=r,Wu(e,t)}}function qu(e,t,n){t=pi(n,t),t=Ys(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Ke(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=pi(n,e),n=Xs(2),r=za(t,n,2),r!==null&&(q(n,r,t,e),Ke(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>be()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=We()),e=Qr(e,t),e!==null&&(Ke(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return ge(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,pd())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=Bl,a=He(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,fd(r,a))}r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Xd()&&(e=od);for(var t=be(),n=null,r=td;r!==null;){var i=r.next,a=J(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function J(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=H(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Qe(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=dd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=He(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),J(e,be()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Gu())return null;yu(e,t,!0)}function pd(){ef(function(){Ll&6?ge(Se,ld):ud()})}function md(){if(od===0){var e=ca;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),od=e}return od}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?gd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Ur.length;vd++){var yd=Ur[vd];Wr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,ht.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!an||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case Vr:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Ad(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=nn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=nn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=nn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
10
+ `).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Pt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Rt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e!==Yd&&(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body)}n=i}while(n);Rp(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=P.d;P.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Cu();return e||t}function wf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),zd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=pt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);mt(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=pt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),mt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=pt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),mt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=B.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Nt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),mt(t),e.head.appendChild(t))}function zf(e){return`[src="`+Nt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),zd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,mt(a),a):(r=n,(a=yf.get(o))&&(r=f({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[U]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function op(e){return e?(e=ti,e):ti}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(vu(n,e,t),Ba(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&vu(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=gu();t=Ze(t);var n=Qr(e,t);n!==null&&vu(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,hp(e,t,n,r)}finally{P.p=a,N.T=i}}function mp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,hp(e,t,n,r)}finally{P.p=a,N.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)Od(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Ll&6)&&(iu=be()+500,cd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&vu(s,a,2),Cu(),lp(a,2)}if(a=gp(r),a===null&&Od(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function gp(e){return e=Xt(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,gu(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),Cu(),t[rt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.8`)throw Error(i(527,Hp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{ke=Wp.inject(Up),Ae=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,o,s,c,zp),e[rt]=t.current,Ed(e),new Bp(t)}})),Ue=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=He()})),H=e(ee(),1),We=Ue(),Ge=/^\/compact(?:\s+([\s\S]+))?$/i;function Ke(e){let t=Ge.exec(e.trim());if(!t)return null;let n=t[1]?.trim();return n?{instructions:n}:{}}var qe=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Je=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ye=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Xe=e=>{let t=Ye(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ze={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Qe=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},$e=(0,H.createContext)({}),et=()=>(0,H.useContext)($e),tt=(0,H.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=et()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,H.createElement)(`svg`,{ref:c,...Ze,width:t??l??Ze.width,height:t??l??Ze.height,stroke:e??f,strokeWidth:m,className:qe(`lucide`,p,i),...!a&&!Qe(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,H.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),U=(e,t)=>{let n=(0,H.forwardRef)(({className:n,...r},i)=>(0,H.createElement)(tt,{ref:i,iconNode:t,className:qe(`lucide-${Je(Xe(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Xe(e),n},nt=U(`alarm-clock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),rt=U(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),it=U(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),at=U(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ot=U(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),st=U(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ct=U(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),lt=U(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),ut=U(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),dt=U(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),ft=U(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),pt=U(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),mt=U(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),ht=U(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),gt=U(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),_t=U(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),vt=U(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),yt=U(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),bt=U(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),xt=U(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),St=U(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ct=U(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),wt=U(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Tt=U(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Et=U(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Dt=U(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ot=U(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),kt=U(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),At=U(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),jt=U(`coins`,[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]),Mt=U(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Nt=U(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Pt=U(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Ft=U(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),It=U(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Lt=U(`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`}]]),Rt=U(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),zt=U(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),Bt=U(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Vt=U(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Ht=U(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Ut=U(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Wt=U(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Gt=U(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Kt=U(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),qt=U(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Jt=U(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),Yt=U(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),Xt=U(`image-down`,[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Zt=U(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),Qt=U(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),$t=U(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),en=U(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),tn=U(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),nn=U(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),rn=U(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),an=U(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),on=U(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),sn=U(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),cn=U(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ln=U(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),un=U(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),dn=U(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),fn=U(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),pn=U(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),mn=U(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),hn=U(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),gn=U(`package-minus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M21 13V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`zu9avd`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),_n=U(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),vn=U(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),yn=U(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),bn=U(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),xn=U(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Sn=U(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Cn=U(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),wn=U(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Tn=U(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),En=U(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Dn=U(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),On=U(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),kn=U(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),An=U(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),jn=U(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Mn=U(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Nn=U(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Pn=U(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Fn=U(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),In=U(`shield-x`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),Ln=U(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Rn=U(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),zn=U(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),Bn=U(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Vn=U(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Hn=U(`square-dashed`,[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]]),Un=U(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Wn=U(`square-slash`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Gn=U(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Kn=U(`square-x`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),qn=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Jn=U(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Yn=U(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Xn=U(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Zn=U(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Qn=U(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),$n=U(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),er=U(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),tr=U(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),nr=U(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),rr=U(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function ir(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var ar={};function or(e,t,n,r,i){if(!n&&!r&&!i&&!e)return cr(t);let a=cr(e);return t&&(a=lr(a,t)),n&&(a=lr(a,n)),r&&(a=lr(a,r)),i&&(a=lr(a,i)),a}function sr(e){if(e.length===0)return ar;if(e.length===1)return cr(e[0]);let t=cr(e[0]);for(let n=1;n<e.length;n+=1)t=lr(t,e[n]);return t}function cr(e){return pr(e)?{...mr(e,ar)}:ur(e)}function lr(e,t){return pr(t)?mr(t,e):dr(e,t)}function ur(e){let t={...e};for(let e in t){let n=t[e];fr(e,n)&&(t[e]=gr(n))}return t}function dr(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ir(e.style,r);break;case`className`:e[n]=vr(e.className,r);break;default:e[n]=fr(n,r)?hr(e[n],r):r}}return e}function fr(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function pr(e){return typeof e==`function`}function mr(e,t){return pr(e)?e(t):e??ar}function hr(e,t){return t?e?(...n)=>{let r=n[0];if(yr(r)){let i=r;_r(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:gr(t):e}function gr(e){return e&&((...t)=>{let n=t[0];return yr(n)&&_r(n),e(...t)})}function _r(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function vr(e,t){return t?e?t+` `+e:t:e}function yr(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function br(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var xr=br(`https://base-ui.com/production-error`,`Base UI`),Sr={};function Cr(e,t){let n=H.useRef(Sr);return n.current===Sr&&(n.current=e(t)),n}function wr(e,t,n,r){let i=Cr(Er).current;return Dr(i,e,t,n,r)&&kr(i,[e,t,n,r]),i.callback}function Tr(e){let t=Cr(Er).current;return Or(t,e)&&kr(t,e),t.callback}function Er(){return{callback:null,cleanup:null,refs:[]}}function Dr(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Or(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function kr(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Ar=19;function jr(e){return Ar>=e}function Mr(e){if(!H.isValidElement(e))return null;let t=e,n=t.props;return(jr(19)?n?.ref:t.ref)??null}function Nr(){}var Pr=Object.freeze([]),Fr=Object.freeze({});function Ir(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Lr(e,t){return typeof e==`function`?e(t):e}function Rr(e,t){return typeof e==`function`?e(t):e}function zr(e,t,n={}){let r=t.render,i=Br(t,n);return n.enabled===!1?null:Ur(e,r,i,n.state??Fr)}function Br(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Fr,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Lr(n,a):void 0,d=l?Rr(r,a):void 0,f=l?Ir(a,c):Fr,p=l&&s?Vr(s):void 0,m=l?ir(f,p)??{}:Fr;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Tr([m.ref,Mr(i),...o]):wr(m.ref,Mr(i),o):wr(null,null)),l?(u!==void 0&&(m.className=vr(m.className,u)),d!==void 0&&(m.style=ir(m.style,d)),m):Fr}function Vr(e){return Array.isArray(e)?sr(e):or(void 0,e)}var Hr=Symbol.for(`react.lazy`);function Ur(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=or(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Hr&&(i=H.Children.toArray(t)[0]),H.cloneElement(i,e)}if(e&&typeof e==`string`)return Wr(e,n);throw Error(xr(8))}function Wr(e,t){return e===`button`?(0,H.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,H.createElement)(`img`,{alt:``,...t,key:t.key}):H.createElement(e,t)}function Gr(e){return zr(e.defaultTagName??`div`,e,e)}function Kr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Kr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function qr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Kr(e))&&(r&&(r+=` `),r+=t);return r}var Jr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Yr=qr,Xr=(e,t)=>n=>{if(t?.variants==null)return Yr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Jr(t)||Jr(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Yr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Zr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Qr=(e,t)=>({classGroupId:e,validator:t}),$r=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ei=`-`,ti=[],ni=`arbitrary..`,ri=e=>{let t=oi(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ai(e);let n=e.split(ei);return ii(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Zr(i,t):t:i||ti}return n[e]||ti}}},ii=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ii(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ei):e.slice(t).join(ei),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ai=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ni+r:void 0})(),oi=e=>{let{theme:t,classGroups:n}=e;return si(n,t)},si=(e,t)=>{let n=$r();for(let r in e){let i=e[r];ci(i,n,r,t)}return n},ci=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];li(i,t,n,r)}},li=(e,t,n,r)=>{if(typeof e==`string`){ui(e,t,n);return}if(typeof e==`function`){di(e,t,n,r);return}fi(e,t,n,r)},ui=(e,t,n)=>{let r=e===``?t:pi(t,e);r.classGroupId=n},di=(e,t,n,r)=>{if(mi(e)){ci(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Qr(n,e))},fi=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ci(o,pi(t,a),n,r)}},pi=(e,t)=>{let n=e,r=t.split(ei),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=$r(),n.nextPart.set(t,i)),n=i}return n},mi=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,hi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},gi=`!`,_i=`:`,vi=[],yi=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===_i){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(gi)?(c=s.slice(0,-1),l=!0):s.startsWith(gi)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return yi(t,l,c,u)};if(t){let e=t+_i,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yi(vi,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xi=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Si=e=>({cache:hi(e.cacheSize),parseClassName:bi(e),sortModifiers:xi(e),postfixLookupClassGroupIds:Ci(e),...ri(e)}),Ci=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},wi=/\s+/,Ti=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(wi),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+gi:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ei=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Di(n))&&(i&&(i+=` `),i+=r);return i},Di=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Di(e[r]))&&(n&&(n+=` `),n+=t);return n},Oi=(e,...t)=>{let n,r,i,a,o=o=>(n=Si(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ti(e,n);return i(e,a),a};return a=o,(...e)=>a(Ei(...e))},ki=[],Ai=e=>{let t=t=>t[e]||ki;return t.isThemeGetter=!0,t},ji=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ni=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Pi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ii=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Li=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ri=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=e=>Ni.test(e),Bi=e=>!!e&&!Number.isNaN(Number(e)),Vi=e=>!!e&&Number.isInteger(Number(e)),Hi=e=>e.endsWith(`%`)&&Bi(e.slice(0,-1)),Ui=e=>Pi.test(e),Wi=()=>!0,Gi=e=>Fi.test(e)&&!Ii.test(e),Ki=()=>!1,qi=e=>Li.test(e),Ji=e=>Ri.test(e),Yi=e=>!Qi(e)&&!oa(e),Xi=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Zi=e=>ma(e,va,Ki),Qi=e=>ji.test(e),$i=e=>ma(e,ya,Gi),ea=e=>ma(e,ba,Bi),ta=e=>ma(e,Sa,Wi),na=e=>ma(e,xa,Ki),ra=e=>ma(e,ga,Ki),ia=e=>ma(e,_a,Ji),aa=e=>ma(e,Ca,qi),oa=e=>Mi.test(e),sa=e=>ha(e,ya),ca=e=>ha(e,xa),la=e=>ha(e,ga),ua=e=>ha(e,va),da=e=>ha(e,_a),fa=e=>ha(e,Ca,!0),pa=e=>ha(e,Sa,!0),ma=(e,t,n)=>{let r=ji.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ha=(e,t,n=!1)=>{let r=Mi.exec(e);return r?r[1]?t(r[1]):n:!1},ga=e=>e===`position`||e===`percentage`,_a=e=>e===`image`||e===`url`,va=e=>e===`length`||e===`size`||e===`bg-size`,ya=e=>e===`length`,ba=e=>e===`number`,xa=e=>e===`family-name`,Sa=e=>e===`number`||e===`weight`,Ca=e=>e===`shadow`,wa=Oi(()=>{let e=Ai(`color`),t=Ai(`font`),n=Ai(`text`),r=Ai(`font-weight`),i=Ai(`tracking`),a=Ai(`leading`),o=Ai(`breakpoint`),s=Ai(`container`),c=Ai(`spacing`),l=Ai(`radius`),u=Ai(`shadow`),d=Ai(`inset-shadow`),f=Ai(`text-shadow`),p=Ai(`drop-shadow`),m=Ai(`blur`),h=Ai(`perspective`),g=Ai(`aspect`),_=Ai(`ease`),v=Ai(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),oa,Qi],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[oa,Qi,c],T=()=>[zi,`full`,`auto`,...w()],E=()=>[Vi,`none`,`subgrid`,oa,Qi],D=()=>[`auto`,{span:[`full`,Vi,oa,Qi]},Vi,oa,Qi],O=()=>[Vi,`auto`,oa,Qi],k=()=>[`auto`,`min`,`max`,`fr`,oa,Qi],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[zi,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[zi,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[zi,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,oa,Qi],ee=()=>[...b(),la,ra,{position:[oa,Qi]}],L=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,ua,Zi,{size:[oa,Qi]}],R=()=>[Hi,sa,$i],z=()=>[``,`none`,`full`,l,oa,Qi],ne=()=>[``,Bi,sa,$i],re=()=>[`solid`,`dashed`,`dotted`,`double`],B=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[Bi,Hi,la,ra],ae=()=>[``,`none`,m,oa,Qi],oe=()=>[`none`,Bi,oa,Qi],se=()=>[`none`,Bi,oa,Qi],V=()=>[Bi,oa,Qi],ce=()=>[zi,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ui],breakpoint:[Ui],color:[Wi],container:[Ui],"drop-shadow":[Ui],ease:[`in`,`out`,`in-out`],font:[Yi],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ui],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ui],shadow:[Ui],spacing:[`px`,Bi],text:[Ui],"text-shadow":[Ui],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,zi,Qi,oa,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,oa,Qi]}],"container-named":[Xi],columns:[{columns:[Bi,Qi,oa,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Vi,`auto`,oa,Qi]}],basis:[{basis:[zi,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Bi,zi,`auto`,`initial`,`none`,Qi]}],grow:[{grow:[``,Bi,oa,Qi]}],shrink:[{shrink:[``,Bi,oa,Qi]}],order:[{order:[Vi,`first`,`last`,`none`,oa,Qi]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,sa,$i]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,pa,ta]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Hi,Qi]}],"font-family":[{font:[ca,na,t]}],"font-features":[{"font-features":[Qi]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,oa,Qi]}],"line-clamp":[{"line-clamp":[Bi,`none`,oa,ea]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,oa,Qi]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,oa,Qi]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...re(),`wavy`]}],"text-decoration-thickness":[{decoration:[Bi,`from-font`,`auto`,oa,$i]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Bi,`auto`,oa,Qi]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Vi,oa,Qi]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,oa,Qi]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,oa,Qi]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Vi,oa,Qi],radial:[``,oa,Qi],conic:[Vi,oa,Qi]},da,ia]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...re(),`hidden`,`none`]}],"divide-style":[{divide:[...re(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...re(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Bi,oa,Qi]}],"outline-w":[{outline:[``,Bi,sa,$i]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,fa,aa]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,fa,aa]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Bi,$i]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,fa,aa]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Bi,oa,Qi]}],"mix-blend":[{"mix-blend":[...B(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":B()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Bi]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[oa,Qi]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Bi]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,oa,Qi]}],filter:[{filter:[``,`none`,oa,Qi]}],blur:[{blur:ae()}],brightness:[{brightness:[Bi,oa,Qi]}],contrast:[{contrast:[Bi,oa,Qi]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,fa,aa]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Bi,oa,Qi]}],"hue-rotate":[{"hue-rotate":[Bi,oa,Qi]}],invert:[{invert:[``,Bi,oa,Qi]}],saturate:[{saturate:[Bi,oa,Qi]}],sepia:[{sepia:[``,Bi,oa,Qi]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,oa,Qi]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Bi,oa,Qi]}],"backdrop-contrast":[{"backdrop-contrast":[Bi,oa,Qi]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Bi,oa,Qi]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Bi,oa,Qi]}],"backdrop-invert":[{"backdrop-invert":[``,Bi,oa,Qi]}],"backdrop-opacity":[{"backdrop-opacity":[Bi,oa,Qi]}],"backdrop-saturate":[{"backdrop-saturate":[Bi,oa,Qi]}],"backdrop-sepia":[{"backdrop-sepia":[``,Bi,oa,Qi]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,oa,Qi]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Bi,`initial`,oa,Qi]}],ease:[{ease:[`linear`,`initial`,_,oa,Qi]}],delay:[{delay:[Bi,oa,Qi]}],animate:[{animate:[`none`,v,oa,Qi]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,oa,Qi]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[oa,Qi,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ce()}],"translate-x":[{"translate-x":ce()}],"translate-y":[{"translate-y":ce()}],"translate-z":[{"translate-z":ce()}],"translate-none":[`translate-none`],zoom:[{zoom:[Vi,oa,Qi]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,oa,Qi]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,oa,Qi]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Bi,sa,$i,ea]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function W(...e){return wa(qr(e))}var Ta=Xr(`[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-[box-shadow,transform] duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 active:scale-[0.97] sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-9 px-[calc(--spacing(3)-1px)] sm:h-8`,icon:`size-9 sm:size-8`,"icon-lg":`size-10 sm:size-9`,"icon-sm":`size-8 sm:size-7`,"icon-xl":`size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,"icon-xs":`size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9`,sm:`h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7`,xl:`h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,xs:`h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5`},variant:{default:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none`,destructive:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none`,"destructive-outline":`border-border bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/32 [:hover,[data-pressed]]:bg-destructive/4`,ghost:`border-transparent hover:bg-accent data-pressed:bg-accent`,link:`border-transparent underline-offset-4 hover:underline`,outline:`border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80`}}});function Ea({className:e,variant:t,size:n,render:r,...i}){let a=r?void 0:`button`;return Gr({defaultTagName:`button`,props:or({className:W(Ta({className:e,size:n,variant:t})),"data-slot":`button`,type:a},i),render:r})}function Da(e){let t=0;for(let n of e)n.muted!==!0&&(t+=Oa(n.pendingAskCount),t+=Oa(n.pendingApprovalCount));return t}function Oa(e){return typeof e!=`number`||!Number.isFinite(e)||e<=0?0:Math.floor(e)}function ka(e,t=typeof navigator>`u`?{}:navigator){let n=Oa(e);try{n>0?t.setAppBadge?.(n):t.clearAppBadge?.()}catch{}}function Aa(e){switch(e){case`image-quota`:return`Chat image storage is full (200MiB). Message not sent.`;case`image-too-large`:return`An image is still over 10MiB after compression. Message not sent.`;case`image-not-image`:return`An attachment is not a supported image. Message not sent.`;case`image-storage`:return`Could not save the images. Message not sent. Please try again.`;default:return}}var ja=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,Ma=e=>typeof e==`string`&&ja.test(e),Na=new Set([`image`,`markdown`,`html`,`pdf`,`text`,`other`]),Pa=new Set([`file`,`web`,`desktop`,`upload`]),Fa=3e4,Ia=e=>`entryId`in e?`${e.chatId}|e|${e.entryId}`:`${e.chatId}|c|${e.conversationId}|${e.messageIndex}`,La=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ra=e=>typeof e==`string`&&e?e:void 0,za=e=>typeof e==`string`&&/^data:image\/(?:png|jpeg|gif|webp|svg\+xml|bmp|avif|x-icon);base64,/.test(e);function Ba(e){if(!La(e))return null;let{rel:t,name:n,size:r,kind:i}=e;return typeof t==`string`&&typeof n==`string`&&typeof r==`number`&&typeof i==`string`&&Na.has(i)?{rel:t,name:n,size:r,kind:i}:null}function Va(e){if(!La(e)||typeof e.source!=`string`||!Pa.has(e.source))return null;let t=e.source,n=Ra(e.name),r=Ra(e.caption),i={source:t,...n?{name:n}:{},...r?{caption:r}:{}};return e.ok===!0&&Ma(e.mediaId)?{ok:!0,mediaId:e.mediaId,...za(e.thumb)?{thumb:e.thumb}:{},...i}:e.ok===!1&&(e.error===`too-large`||e.error===`quota`)?{ok:!1,error:e.error,...i}:null}var Ha=class{send;cache=new Map;inflight=new Set;listeners=new Set;images=new Map;seq=0;constructor(e){this.send=e}get(e){return this.cache.get(Ia(e))}request(e){let t=Ia(e),n=this.cache.get(t);this.inflight.has(t)||n&&(n.artifacts.length>0||n.media.length>0)||(this.inflight.add(t),this.send({type:`bot-artifacts`,target:e}))}receive(e){if(!La(e.target))return;let t=Ia(e.target);this.inflight.delete(t);let n=(Array.isArray(e.artifacts)?e.artifacts:[]).map(Ba).filter(e=>e!==null),r=new Set,i=(Array.isArray(e.media)?e.media:[]).map(Va).filter(e=>e?.ok?!r.has(e.mediaId)&&(r.add(e.mediaId),!0):e!==null).slice(0,4);this.cache.set(t,{artifacts:n,media:i});for(let e of this.listeners)e()}image(e,t){let n=`img-${Date.now().toString(36)}-${++this.seq}`;return new Promise(r=>{let i=setTimeout(()=>this.settle(n,{error:`timeout`}),Fa);this.images.set(n,e=>{clearTimeout(i),r(e)}),this.send({type:`bot-artifact-image`,requestId:n,target:e,...t})})}receiveImage(e){this.settle(e.requestId,za(e.dataUrl)?{dataUrl:e.dataUrl}:{error:e.error??`invalid`})}reset(){this.inflight.clear();for(let e of[...this.images.keys()])this.settle(e,{error:`offline`})}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}settle(e,t){let n=this.images.get(e);n&&(this.images.delete(e),n(t))}},Ua=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Wa=n(((e,t)=>{t.exports=Ua()})),G=Wa(),Ga=(0,H.createContext)(null),Ka={web:`网页截图`,desktop:`桌面截图`,file:`工作区`,upload:``},qa=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function Ja({target:e}){let t=(0,H.useContext)(Ga),n=Ia(e),r=t?.port,i=(0,H.useSyncExternalStore)(e=>r?.subscribe(e)??(()=>{}),()=>r?.get(e)),a=t?.online??!1;(0,H.useEffect)(()=>{a&&r?.request(e)},[r,n,a]);let[o,s]=(0,H.useState)(null);if(!r||!i||i.media.length===0&&i.artifacts.length===0)return null;let c=i.media.some(e=>e.ok&&e.source===`desktop`);return(0,G.jsxs)(`div`,{className:`mt-1.5`,children:[i.media.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.media.map((e,t)=>e.ok?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s({ref:{mediaId:e.mediaId},title:e.caption??e.name??Ka[e.source],source:e.source,thumb:e.thumb}),className:`relative h-20 w-28 overflow-hidden rounded-lg border bg-muted`,children:[e.thumb?(0,G.jsx)(`img`,{src:e.thumb,alt:``,className:`h-full w-full object-cover`}):(0,G.jsx)(Zt,{className:`m-auto h-4 w-4 text-muted-foreground`}),Ka[e.source]&&(0,G.jsx)(`span`,{className:W(`absolute top-1 left-1 rounded px-1 text-[10px] leading-4`,e.source===`desktop`?`bg-warning text-warning-foreground`:`bg-black/60 text-white`),children:Ka[e.source]}),(e.caption||e.name)&&(0,G.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/70 to-transparent px-1.5 pt-3 pb-0.5 text-left text-[10px] text-white`,children:e.caption??e.name})]},e.mediaId):(0,G.jsxs)(`div`,{className:`flex w-32 flex-col gap-0.5 rounded-lg border border-destructive/60 border-dashed p-2 text-destructive text-xs`,children:[(0,G.jsx)(`span`,{className:`truncate font-medium`,children:e.name??Ka[e.source]}),(0,G.jsx)(`span`,{children:e.error===`quota`?`群图片空间已满,没收下`:`压缩后仍超过 10MiB,没发出去`})]},`failed-${t}`))}),c&&(0,G.jsx)(`p`,{className:`mt-1 text-warning text-xs`,children:`桌面截图可能拍到别的窗口里的敏感内容。`}),i.artifacts.length>0&&(0,G.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:i.artifacts.map(e=>(0,G.jsx)(Ya,{artifact:e,onOpen:()=>s({ref:{rel:e.rel},title:e.name})},e.rel))}),o&&(0,G.jsx)(Xa,{preview:o,load:()=>r.image(e,o.ref),onClose:()=>s(null)})]})}function Ya({artifact:e,onOpen:t}){let n=e.kind===`image`;return(0,G.jsxs)(`button`,{type:`button`,disabled:!n,onClick:t,title:e.rel,className:`flex max-w-60 items-center gap-1.5 rounded-lg border bg-card px-2 py-1 text-left text-xs disabled:cursor-default`,children:[(0,G.jsx)(Vt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`truncate`,children:e.name}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:qa(e.size)})]})}function Xa({preview:e,load:t,onClose:n}){let[r,i]=(0,H.useState)(null);(0,H.useEffect)(()=>{let e=!0;return t().then(t=>e&&i(t)),()=>{e=!1}},[]);let a=r&&`dataUrl`in r?r.dataUrl:e.thumb;return(0,G.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-black/90 text-white`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-[max(env(safe-area-inset-top),0.75rem)] pb-2 text-sm`,children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.source&&(0,G.jsx)(`span`,{className:`shrink-0 text-white/70 text-xs`,children:Ka[e.source]}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`关闭`,className:`rounded p-1.5`,children:(0,G.jsx)(nr,{className:`h-5 w-5`})})]}),e.source===`desktop`&&(0,G.jsx)(`p`,{className:`px-3 text-warning text-xs`,children:`这是整桌面截图,可能拍到其他窗口里的敏感内容。`}),(0,G.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 items-center justify-center p-3`,children:[a&&(0,G.jsx)(`img`,{src:a,alt:e.title,className:`max-h-full max-w-full object-contain`}),!r&&(0,G.jsx)(on,{className:`absolute h-5 w-5 animate-spin`}),r&&`error`in r&&(0,G.jsx)(`p`,{className:`absolute bottom-4 rounded bg-black/70 px-2 py-1 text-xs`,children:r.error===`too-large`?`图片太大,手机上看不了`:`大图没拉下来`})]})]})}var Za=`#64748b`,Qa=/^#[0-9a-f]{6}$/i;function $a(e){let[t,n,r]=[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16)/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return[0,0,o];let c=s/(1-Math.abs(2*o-1));return[((i===t?(n-r)/s%6:i===n?(r-t)/s+2:(t-n)/s+4)*60+360)%360,c,o]}function eo(e,t,n){let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,[o,s,c]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i];return`#${[o,s,c].map(e=>Math.round((e+a)*255).toString(16).padStart(2,`0`)).join(``)}`}function to(e){let t=typeof e==`string`&&Qa.test(e)?e.toLowerCase():Za,[n,r]=$a(t),i=Math.max(r,.35),a=(e,t)=>eo((n+e+360)%360,i,t);return[t,a(35,.78),a(-35,.32),a(180,.62),a(90,.9)]}var no=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t)},ro=(e,t)=>Math.floor(e/10**t%10),io=(e,t)=>!(ro(e,t)%2),ao=(e,t,n)=>{let r=e%t;return n&&ro(e,n)%2==0?-r:r},oo=(e,t,n)=>t[e%n],so=e=>{e.slice(0,1)===`#`&&(e=e.slice(1));let t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2,2),16),r=parseInt(e.substr(4,2),16);return(t*299+n*587+r*114)/1e3>=128?`#000000`:`#FFFFFF`},co=4,lo=80;function uo(e,t){let n=no(e),r=t&&t.length;return Array.from({length:co},(e,i)=>({color:oo(n+i,t,r),translateX:ao(n*(i+1),lo/2-(i+17),1),translateY:ao(n*(i+1),lo/2-(i+17),2),rotate:ao(n*(i+1),360),isSquare:io(n,2)}))}var fo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=uo(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:lo,height:lo,children:(0,G.jsx)(`rect`,{width:lo,height:lo,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:lo,height:lo,fill:o[0].color}),(0,G.jsx)(`rect`,{x:10,y:30,width:lo,height:o[1].isSquare?lo:lo/8,fill:o[1].color,transform:`translate(`+o[1].translateX+` `+o[1].translateY+`) rotate(`+o[1].rotate+` 40 40)`}),(0,G.jsx)(`circle`,{cx:lo/2,cy:lo/2,fill:o[2].color,r:lo/5,transform:`translate(`+o[2].translateX+` `+o[2].translateY+`)`}),(0,G.jsx)(`line`,{x1:0,y1:lo/2,x2:lo,y2:lo/2,strokeWidth:2,stroke:o[3].color,transform:`translate(`+o[3].translateX+` `+o[3].translateY+`) rotate(`+o[3].rotate+` 40 40)`})]})]})},po=90,mo=5;function ho(e,t){let n=no(e),r=t&&t.length,i=Array.from({length:mo},(e,i)=>oo(n+i,t,r)),a=[];return a[0]=i[0],a[1]=i[1],a[2]=i[1],a[3]=i[2],a[4]=i[2],a[5]=i[3],a[6]=i[3],a[7]=i[0],a[8]=i[4],a}var go=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=ho(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 90 90`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:po,height:po,children:(0,G.jsx)(`rect`,{width:po,height:po,rx:r?void 0:180,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`path`,{d:`M0 0h90v45H0z`,fill:o[0]}),(0,G.jsx)(`path`,{d:`M0 45h90v45H0z`,fill:o[1]}),(0,G.jsx)(`path`,{d:`M83 45a38 38 0 00-76 0h76z`,fill:o[2]}),(0,G.jsx)(`path`,{d:`M83 45a38 38 0 01-76 0h76z`,fill:o[3]}),(0,G.jsx)(`path`,{d:`M77 45a32 32 0 10-64 0h64z`,fill:o[4]}),(0,G.jsx)(`path`,{d:`M77 45a32 32 0 11-64 0h64z`,fill:o[5]}),(0,G.jsx)(`path`,{d:`M71 45a26 26 0 00-52 0h52z`,fill:o[6]}),(0,G.jsx)(`path`,{d:`M71 45a26 26 0 01-52 0h52z`,fill:o[7]}),(0,G.jsx)(`circle`,{cx:45,cy:45,r:23,fill:o[8]})]})]})},_o=64,vo=80;function yo(e,t){let n=no(e),r=t&&t.length;return Array.from({length:_o},(e,i)=>oo(n%(i+1),t,r))}var bo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=yo(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,"mask-type":`alpha`,maskUnits:`userSpaceOnUse`,x:0,y:0,width:vo,height:vo,children:(0,G.jsx)(`rect`,{width:vo,height:vo,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:10,height:10,fill:o[0]}),(0,G.jsx)(`rect`,{x:20,width:10,height:10,fill:o[1]}),(0,G.jsx)(`rect`,{x:40,width:10,height:10,fill:o[2]}),(0,G.jsx)(`rect`,{x:60,width:10,height:10,fill:o[3]}),(0,G.jsx)(`rect`,{x:10,width:10,height:10,fill:o[4]}),(0,G.jsx)(`rect`,{x:30,width:10,height:10,fill:o[5]}),(0,G.jsx)(`rect`,{x:50,width:10,height:10,fill:o[6]}),(0,G.jsx)(`rect`,{x:70,width:10,height:10,fill:o[7]}),(0,G.jsx)(`rect`,{y:10,width:10,height:10,fill:o[8]}),(0,G.jsx)(`rect`,{y:20,width:10,height:10,fill:o[9]}),(0,G.jsx)(`rect`,{y:30,width:10,height:10,fill:o[10]}),(0,G.jsx)(`rect`,{y:40,width:10,height:10,fill:o[11]}),(0,G.jsx)(`rect`,{y:50,width:10,height:10,fill:o[12]}),(0,G.jsx)(`rect`,{y:60,width:10,height:10,fill:o[13]}),(0,G.jsx)(`rect`,{y:70,width:10,height:10,fill:o[14]}),(0,G.jsx)(`rect`,{x:20,y:10,width:10,height:10,fill:o[15]}),(0,G.jsx)(`rect`,{x:20,y:20,width:10,height:10,fill:o[16]}),(0,G.jsx)(`rect`,{x:20,y:30,width:10,height:10,fill:o[17]}),(0,G.jsx)(`rect`,{x:20,y:40,width:10,height:10,fill:o[18]}),(0,G.jsx)(`rect`,{x:20,y:50,width:10,height:10,fill:o[19]}),(0,G.jsx)(`rect`,{x:20,y:60,width:10,height:10,fill:o[20]}),(0,G.jsx)(`rect`,{x:20,y:70,width:10,height:10,fill:o[21]}),(0,G.jsx)(`rect`,{x:40,y:10,width:10,height:10,fill:o[22]}),(0,G.jsx)(`rect`,{x:40,y:20,width:10,height:10,fill:o[23]}),(0,G.jsx)(`rect`,{x:40,y:30,width:10,height:10,fill:o[24]}),(0,G.jsx)(`rect`,{x:40,y:40,width:10,height:10,fill:o[25]}),(0,G.jsx)(`rect`,{x:40,y:50,width:10,height:10,fill:o[26]}),(0,G.jsx)(`rect`,{x:40,y:60,width:10,height:10,fill:o[27]}),(0,G.jsx)(`rect`,{x:40,y:70,width:10,height:10,fill:o[28]}),(0,G.jsx)(`rect`,{x:60,y:10,width:10,height:10,fill:o[29]}),(0,G.jsx)(`rect`,{x:60,y:20,width:10,height:10,fill:o[30]}),(0,G.jsx)(`rect`,{x:60,y:30,width:10,height:10,fill:o[31]}),(0,G.jsx)(`rect`,{x:60,y:40,width:10,height:10,fill:o[32]}),(0,G.jsx)(`rect`,{x:60,y:50,width:10,height:10,fill:o[33]}),(0,G.jsx)(`rect`,{x:60,y:60,width:10,height:10,fill:o[34]}),(0,G.jsx)(`rect`,{x:60,y:70,width:10,height:10,fill:o[35]}),(0,G.jsx)(`rect`,{x:10,y:10,width:10,height:10,fill:o[36]}),(0,G.jsx)(`rect`,{x:10,y:20,width:10,height:10,fill:o[37]}),(0,G.jsx)(`rect`,{x:10,y:30,width:10,height:10,fill:o[38]}),(0,G.jsx)(`rect`,{x:10,y:40,width:10,height:10,fill:o[39]}),(0,G.jsx)(`rect`,{x:10,y:50,width:10,height:10,fill:o[40]}),(0,G.jsx)(`rect`,{x:10,y:60,width:10,height:10,fill:o[41]}),(0,G.jsx)(`rect`,{x:10,y:70,width:10,height:10,fill:o[42]}),(0,G.jsx)(`rect`,{x:30,y:10,width:10,height:10,fill:o[43]}),(0,G.jsx)(`rect`,{x:30,y:20,width:10,height:10,fill:o[44]}),(0,G.jsx)(`rect`,{x:30,y:30,width:10,height:10,fill:o[45]}),(0,G.jsx)(`rect`,{x:30,y:40,width:10,height:10,fill:o[46]}),(0,G.jsx)(`rect`,{x:30,y:50,width:10,height:10,fill:o[47]}),(0,G.jsx)(`rect`,{x:30,y:60,width:10,height:10,fill:o[48]}),(0,G.jsx)(`rect`,{x:30,y:70,width:10,height:10,fill:o[49]}),(0,G.jsx)(`rect`,{x:50,y:10,width:10,height:10,fill:o[50]}),(0,G.jsx)(`rect`,{x:50,y:20,width:10,height:10,fill:o[51]}),(0,G.jsx)(`rect`,{x:50,y:30,width:10,height:10,fill:o[52]}),(0,G.jsx)(`rect`,{x:50,y:40,width:10,height:10,fill:o[53]}),(0,G.jsx)(`rect`,{x:50,y:50,width:10,height:10,fill:o[54]}),(0,G.jsx)(`rect`,{x:50,y:60,width:10,height:10,fill:o[55]}),(0,G.jsx)(`rect`,{x:50,y:70,width:10,height:10,fill:o[56]}),(0,G.jsx)(`rect`,{x:70,y:10,width:10,height:10,fill:o[57]}),(0,G.jsx)(`rect`,{x:70,y:20,width:10,height:10,fill:o[58]}),(0,G.jsx)(`rect`,{x:70,y:30,width:10,height:10,fill:o[59]}),(0,G.jsx)(`rect`,{x:70,y:40,width:10,height:10,fill:o[60]}),(0,G.jsx)(`rect`,{x:70,y:50,width:10,height:10,fill:o[61]}),(0,G.jsx)(`rect`,{x:70,y:60,width:10,height:10,fill:o[62]}),(0,G.jsx)(`rect`,{x:70,y:70,width:10,height:10,fill:o[63]})]})]})},xo=36;function So(e,t){let n=no(e),r=t&&t.length,i=oo(n,t,r),a=ao(n,10,1),o=a<5?a+xo/9:a,s=ao(n,10,2),c=s<5?s+xo/9:s;return{wrapperColor:i,faceColor:so(i),backgroundColor:oo(n+13,t,r),wrapperTranslateX:o,wrapperTranslateY:c,wrapperRotate:ao(n,360),wrapperScale:1+ao(n,xo/12)/10,isMouthOpen:io(n,2),isCircle:io(n,1),eyeSpread:ao(n,5),mouthSpread:ao(n,3),faceRotate:ao(n,10,3),faceTranslateX:o>xo/6?o/2:ao(n,8,1),faceTranslateY:c>xo/6?c/2:ao(n,7,2)}}var Co=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=So(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 36 36`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:xo,height:xo,children:(0,G.jsx)(`rect`,{width:xo,height:xo,rx:r?void 0:72,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:xo,height:xo,fill:o.backgroundColor}),(0,G.jsx)(`rect`,{x:`0`,y:`0`,width:xo,height:xo,transform:`translate(`+o.wrapperTranslateX+` `+o.wrapperTranslateY+`) rotate(`+o.wrapperRotate+` 18 18) scale(`+o.wrapperScale+`)`,fill:o.wrapperColor,rx:o.isCircle?xo:xo/6}),(0,G.jsxs)(`g`,{transform:`translate(`+o.faceTranslateX+` `+o.faceTranslateY+`) rotate(`+o.faceRotate+` 18 18)`,children:[o.isMouthOpen?(0,G.jsx)(`path`,{d:`M15 `+(19+o.mouthSpread)+`c2 1 4 1 6 0`,stroke:o.faceColor,fill:`none`,strokeLinecap:`round`}):(0,G.jsx)(`path`,{d:`M13,`+(19+o.mouthSpread)+` a1,0.75 0 0,0 10,0`,fill:o.faceColor}),(0,G.jsx)(`rect`,{x:14-o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:`none`,fill:o.faceColor}),(0,G.jsx)(`rect`,{x:20+o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:`none`,fill:o.faceColor})]})]})]})},wo=4,To=80;function Eo(e,t){let n=no(e),r=t&&t.length;return Array.from({length:wo},(e,i)=>oo(n+i,t,r))}var Do=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=Eo(e,t),s=e.replace(/\s/g,``),c=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:c,maskUnits:`userSpaceOnUse`,x:0,y:0,width:To,height:To,children:(0,G.jsx)(`rect`,{width:To,height:To,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${c})`,children:[(0,G.jsx)(`path`,{fill:`url(#gradient_paint0_linear_`+s+`)`,d:`M0 0h80v40H0z`}),(0,G.jsx)(`path`,{fill:`url(#gradient_paint1_linear_`+s+`)`,d:`M0 40h80v40H0z`})]}),(0,G.jsxs)(`defs`,{children:[(0,G.jsxs)(`linearGradient`,{id:`gradient_paint0_linear_`+s,x1:To/2,y1:0,x2:To/2,y2:To/2,gradientUnits:`userSpaceOnUse`,children:[(0,G.jsx)(`stop`,{stopColor:o[0]}),(0,G.jsx)(`stop`,{offset:1,stopColor:o[1]})]}),(0,G.jsxs)(`linearGradient`,{id:`gradient_paint1_linear_`+s,x1:To/2,y1:To/2,x2:To/2,y2:To,gradientUnits:`userSpaceOnUse`,children:[(0,G.jsx)(`stop`,{stopColor:o[2]}),(0,G.jsx)(`stop`,{offset:1,stopColor:o[3]})]})]})]})},Oo=3,ko=80;function Ao(e,t){let n=no(e),r=t&&t.length;return Array.from({length:Oo},(e,i)=>({color:oo(n+i,t,r),translateX:ao(n*(i+1),ko/10,1),translateY:ao(n*(i+1),ko/10,2),scale:1.2+ao(n*(i+1),ko/20)/10,rotate:ao(n*(i+1),360,1)}))}var jo=({name:e,colors:t,title:n,square:r,size:i,...a})=>{let o=Ao(e,t),s=H.useId();return(0,G.jsxs)(`svg`,{viewBox:`0 0 80 80`,fill:`none`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,...a,children:[n&&(0,G.jsx)(`title`,{children:e}),(0,G.jsx)(`mask`,{id:s,maskUnits:`userSpaceOnUse`,x:0,y:0,width:ko,height:ko,children:(0,G.jsx)(`rect`,{width:ko,height:ko,rx:r?void 0:160,fill:`#FFFFFF`})}),(0,G.jsxs)(`g`,{mask:`url(#${s})`,children:[(0,G.jsx)(`rect`,{width:ko,height:ko,fill:o[0].color}),(0,G.jsx)(`path`,{filter:`url(#filter_${s})`,d:`M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z`,fill:o[1].color,transform:`translate(`+o[1].translateX+` `+o[1].translateY+`) rotate(`+o[1].rotate+` 40 40) scale(`+o[2].scale+`)`}),(0,G.jsx)(`path`,{filter:`url(#filter_${s})`,style:{mixBlendMode:`overlay`},d:`M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z`,fill:o[2].color,transform:`translate(`+o[2].translateX+` `+o[2].translateY+`) rotate(`+o[2].rotate+` 40 40) scale(`+o[2].scale+`)`})]}),(0,G.jsx)(`defs`,{children:(0,G.jsxs)(`filter`,{id:`filter_${s}`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,G.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,G.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,G.jsx)(`feGaussianBlur`,{stdDeviation:7,result:`effect1_foregroundBlur`})]})})]})},Mo={pixel:bo,bauhaus:fo,ring:go,beam:Co,sunset:Do,marble:jo,geometric:Co,abstract:fo},No=({variant:e=`marble`,colors:t=[`#92A1C6`,`#146A7C`,`#F0AB3D`,`#C271B4`,`#C20D90`],name:n=`Clara Barton`,title:r=!1,size:i=`40px`,square:a=!1,...o})=>{let s=Mo[e]||jo;return(0,G.jsx)(s,{colors:t,name:n,title:r,size:i,square:a,...o})};function Po({bot:e,size:t=`md`,busy:n}){return(0,G.jsx)(`span`,{"aria-hidden":!0,className:W(`flex shrink-0 overflow-hidden rounded-full bg-muted`,t===`sm`?`h-7 w-7`:`h-9 w-9`,n&&`ring-2 ring-brand/60 ring-offset-1 ring-offset-background animate-pulse`),children:e&&(0,G.jsx)(No,{name:e.name,variant:`beam`,colors:to(e.avatarColor),size:`100%`})})}var Fo=[[0,59],[0,23],[1,31],[1,12],[0,7]];function Io(e,t,n){if(!/^\d+$/u.test(e))return;let r=Number(e);return r>=t&&r<=n?r:void 0}function Lo(e,t,n){let r=new Set;for(let i of e.split(`,`)){let[e,a,o]=i.split(`/`);if(o!==void 0)return;let s=a===void 0?1:Io(a,1,n);if(s===void 0)return;let c,l;if(e===`*`)c=t,l=n;else{let[r,i,o]=e.split(`-`);if(o!==void 0)return;c=Io(r,t,n),l=i===void 0?a===void 0?c:n:Io(i,t,n)}if(c===void 0||l===void 0||c>l)return;for(let e=c;e<=l;e+=s)r.add(e)}return[...r].sort((e,t)=>e-t)}function Ro(e){let t=e.trim().split(/\s+/u);if(t.length!==5)return;let n=t.map((e,t)=>Lo(e,...Fo[t]));if(n.some(e=>e===void 0))return;let[r,i,a,o,s]=n;return{source:t.join(` `),minute:r,hour:i,dayOfMonth:a,month:o,dayOfWeek:[...new Set(s.map(e=>e%7))].sort((e,t)=>e-t),domStar:t[2].startsWith(`*`),dowStar:t[4].startsWith(`*`)}}var zo=[`所有人`,`everyone`,`all`],Bo=e=>e.normalize(`NFC`).toLowerCase();function Vo(e){return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`string`&&typeof e.name==`string`&&e.name.length>0):[]}function Ho(e,t){let n=Bo(typeof e==`string`?e.replace(/^@/,``):``);return Vo(t).filter(e=>Bo(e.name).startsWith(n))}var Uo=(e,t)=>Number(!!t.pinned)-Number(!!e.pinned)||t.updatedAt-e.updatedAt;function Wo(e,t){let n=new Set(t.filter(e=>!e.archived).map(e=>e.id));return{groups:e.filter(e=>e.kind===`group`).sort(Uo),directs:e.filter(e=>e.kind===`direct`&&n.has(e.members[0])).sort(Uo)}}function Go(e,t){let n=[e,...t.filter(t=>t.parentId===e.id)];return{current:n.find(t=>t.id===e.activeThreadId)??e,entries:n.map(e=>({id:e.id,title:e.threadTitle??(e.parentId?`新话题`:`主话题`),...e.last?.text?{preview:e.last.text}:{},activityAt:e.last?.at??e.updatedAt,unread:!1,running:e.status!==`idle`}))}}var Ko=400;function qo(e,t=!1){return e.entries.length<=Ko?e:{...e,entries:t?e.entries.slice(0,Ko):e.entries.slice(-400),hasOlder:!t||e.hasOlder,...t?{history:!0}:{}}}function Jo(e,t,n){return n||t===0?e:e.filter(e=>e.seq>=t)}function Yo(e,t){let n={entries:[...t.entries].sort((e,t)=>e.seq-t.seq),lastSeq:t.lastSeq,hasOlder:t.hasOlder,...t.epochSeq===void 0?{}:{epochSeq:t.epochSeq}};if(e&&t.epochSeq!==void 0){if(t.epochSeq<(e.epochSeq??0))return e;if(t.epochSeq>(e.epochSeq??0)&&t.beforeSeq===void 0)return qo(n)}if(!e||e.entries.length===0)return qo(n,t.beforeSeq!==void 0);if(t.beforeSeq===void 0&&e.history)return{...e,lastSeq:Math.max(e.lastSeq,t.lastSeq)};if(t.beforeSeq===void 0&&t.lastSeq<e.lastSeq)return e;let r=e.entries[0].seq;if(t.beforeSeq!==void 0){if(t.beforeSeq!==r)return e}else{let t=e.entries.at(-1)?.seq??0;if((n.entries[0]?.seq??t+1)>t+1)return qo(n)}let i=new Map(e.entries.map(e=>[e.seq,e]));for(let e of n.entries){let t=i.get(e.seq);e.truncated&&t&&!t.truncated||i.set(e.seq,e)}let a=[...i.values()].sort((e,t)=>e.seq-t.seq),o=(n.entries[0]?.seq??1/0)<r;return qo({entries:a,lastSeq:Math.max(e.lastSeq,n.lastSeq),hasOlder:t.beforeSeq!==void 0||o?n.hasOlder:e.hasOlder,...e.history?{history:!0}:{},...n.epochSeq===void 0?e.epochSeq===void 0?{}:{epochSeq:e.epochSeq}:{epochSeq:n.epochSeq}},t.beforeSeq!==void 0)}var Xo=/[A-Za-z0-9._%+-]/;function Zo(e,t){let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0||r>0&&Xo.test(n[r-1]))return null;let i=n.slice(r+1);return/\s/.test(i)?null:{start:r,query:i}}var Qo=`__all__`;function $o(e,t){let n=zo[0],r=Bo(e.replace(/^@/,``));return[...Bo(n).startsWith(r)?[{id:Qo,name:n}]:[],...Ho(e,t).map(({id:e,name:t})=>({id:e,name:t}))]}function es(e,t,n,r){let i=`@${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}var ts={approval:`需要审批`,ask:`等你回答`,"delegation-interrupted":`委派中断`,budget:`今日预算已用完`,"routine-draft":`例行任务待批准`,"routine-blocked":`例行任务被阻塞`,"task-blocked":`任务卡住`};function ns(e,t){return e.kind===`silence`?`已安静 ${Math.max(0,Math.floor((t-(e.since??t))/1e3))} 秒`:ts[e.kind]}var rs={thinking:`思考中`,typing:`输出中`,tool:`调用工具`,retrying:`重试中`},is={turn:`排队 · 等上一轮结束`,capacity:`排队 · 并发已满`,"member-check":`排队 · 正在判断是否可并行`,"member-serial":`排队 · 等待成员当前任务完成`,"member-fifo":`排队 · 等待成员前序任务`,"member-stopping":`排队 · 等待成员停止完成`};function as(e){return e.state===`queued`?e.reason&&Object.hasOwn(is,e.reason)?is[e.reason]:`排队中`:rs[e.state]}function os(e){let t=e.steps.findLast(e=>e.status===`running`);return t?`${t.name} ${t.detail}`.trim():as(e)}function ss(e,t){return e.filter(e=>e.chatId===t).sort((e,t)=>Number(e.state===`queued`)-Number(t.state===`queued`))}function cs(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}var ls={running:`工作中`,queued:`排队中`};function us(e,t,n){if(n){let r=os(n),i=t.get(n.botId)?.name;return e.kind===`group`&&i?`${i}:${r}`:r}if(e.status!==`idle`)return ls[e.status];let r=e.last;if(!r)return e.kind===`group`?`${e.members.length} 位成员`:``;let i=r.kind===`human`?`我`:r.botId?t.get(r.botId)?.name:void 0;return i&&e.kind===`group`?`${i}:${r.text}`:r.text}function ds({bots:e,chats:t,activeChatId:n,onSelect:r,inbox:i=[],onDismiss:a,activities:o=[]}){let s=new Map(e.map(e=>[e.id,e])),{groups:c,directs:l}=Wo(t,e),u=e=>{let t=e.kind===`direct`?s.get(e.members[0]):void 0,i=ss(o,e.id)[0],a=i?i.state!==`queued`:e.status===`running`,c=!i&&e.status===`idle`;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:W(`flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60`,e.id===n&&`bg-muted`),children:[t?(0,G.jsx)(Po,{bot:t,busy:a}):(0,G.jsx)(`span`,{className:`flex shrink-0 -space-x-2`,children:e.members.slice(0,3).map(e=>(0,G.jsx)(Po,{bot:s.get(e),size:`sm`},e))}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate font-medium text-sm`,children:t?.name??(e.title||`群聊`)}),(0,G.jsx)(`span`,{className:W(`block truncate text-xs`,c?`text-muted-foreground`:`text-brand`),children:us(e,s,i)||t?.title||`\xA0`})]})]},e.id)};return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:[c.length===0&&l.length===0&&(0,G.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-6 text-center text-muted-foreground text-sm`,children:`桌面端还没有 Bot 聊天`}),i.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`p`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:[`收件箱 · `,i.length]}),i.map(e=>{let t=e.botId?s.get(e.botId):void 0,n=e.ownerBotId?s.get(e.ownerBotId):void 0;return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-2 py-2`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!e.chatId,onClick:()=>e.chatId&&r(e.chatId),className:`flex min-w-0 flex-1 items-center gap-2.5 text-left`,children:[(0,G.jsx)(Po,{bot:t}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`span`,{className:`block truncate font-medium text-sm`,children:[t?.name??`成员`,n?` 替 ${n.name}`:``,(0,G.jsx)(`span`,{className:`ml-1.5 font-normal text-brand text-xs`,children:ns(e,Date.now())})]}),(0,G.jsx)(`span`,{className:`block truncate text-muted-foreground text-xs`,children:e.text||`\xA0`})]})]}),e.dismissible&&a&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e.key),className:`shrink-0 rounded px-2 py-1 text-muted-foreground text-xs hover:bg-muted`,children:`忽略`})]},e.key)})]}),c.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`群聊`}),c.map(u)]}),l.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`成员`}),l.map(u)]})]}),(0,G.jsx)(`p`,{className:`shrink-0 px-3 py-2 text-center text-[11px] text-muted-foreground`,children:`新建成员 / 群聊、例行任务请在桌面端管理`})]})}var fs=class{send;generation=0;active=null;pending=null;constructor(e){this.send=e}start(e,t){if(this.active)return this.active;let n=this.generation,r=(async()=>{let r=await this.request(e);return n===this.generation?r.needsConfirmation===!0?t()?this.request(e,!0):null:r:{...r,ok:!1,error:`offline`}})().finally(()=>{this.active===r&&(this.active=null)});return this.active=r,r}receive(e){e.requestId===this.pending?.requestId&&e.chatId===this.pending.chatId&&this.pending.settle(e)}reset(){this.generation++;let e=this.pending;e&&e.settle({type:`bot-new-session-result`,chatId:e.chatId,requestId:e.requestId,ok:!1,error:`offline`}),this.active=null}request(e,t=!1){let n=crypto.randomUUID();return new Promise(r=>{let i=setTimeout(()=>this.receive({type:`bot-new-session-result`,chatId:e,requestId:n,ok:!1,error:`timeout`}),6e4);this.pending={chatId:e,requestId:n,settle:e=>{clearTimeout(i),this.pending=null,r(e)}};try{this.send({type:`bot-new-session`,chatId:e,requestId:n,...t?{confirmed:!0}:{}})}catch{this.receive({type:`bot-new-session-result`,chatId:e,requestId:n,ok:!1,error:`offline`})}})}},ps=15e3,ms=class{send;pending=null;constructor(e){this.send=e}request(e){let t=crypto.randomUUID(),n=n=>({type:`bot-thread-result`,chatId:e.chatId,requestId:t,ok:!1,error:n});return this.pending?Promise.resolve(n(`busy`)):new Promise(r=>{let i=setTimeout(()=>this.receive(n(`timeout`)),ps);this.pending={chatId:e.chatId,requestId:t,settle:e=>{clearTimeout(i),this.pending=null,r(e)}};try{this.send({...e,requestId:t})}catch{this.receive(n(`offline`))}})}receive(e){e.requestId===this.pending?.requestId&&e.chatId===this.pending.chatId&&this.pending.settle(e)}reset(){let e=this.pending;e&&e.settle({type:`bot-thread-result`,chatId:e.chatId,requestId:e.requestId,ok:!1,error:`offline`})}},hs=`git stash`,gs=`git push --force-with-lease`,_s={"core.filesystem:rm-rf-root-home":{zh:`递归强制删除根目录或用户主目录`,why:`会删掉系统文件或全部个人数据,不进废纸篓,无法恢复。`},"core.filesystem:rm-r-f-separate-root-home":{zh:`用分开的 -r -f 参数递归强制删除根目录或用户主目录`,why:`与 rm -rf / 等价,会删掉系统文件或全部个人数据,无法恢复。`},"core.filesystem:rm-recursive-force-root-home":{zh:`用 --recursive --force 递归强制删除根目录或用户主目录`,why:`与 rm -rf / 等价,会删掉系统文件或全部个人数据,无法恢复。`},"core.filesystem:rm-rf-general":{zh:`递归强制删除目录(rm -rf)`,why:`不经确认直接删除,不进废纸篓;路径写错或通配符展开过宽会误删。`},"core.filesystem:rm-r-f-separate":{zh:`用分开的 -r -f 参数递归强制删除`,why:`与 rm -rf 等价,不经确认直接删除,无法恢复。`},"core.filesystem:rm-recursive-force-long":{zh:`用 --recursive --force 递归强制删除`,why:`与 rm -rf 等价,不经确认直接删除,无法恢复。`},"core.filesystem:rm-recursive-general":{zh:`递归删除目录(rm -r)`,why:`会删掉整棵目录树,可写文件不会逐个确认,删除后无法恢复。`},"core.filesystem:rm-glob-home":{zh:`在用户主目录下用通配符删除文件`,why:`通配符由 shell 展开,实际删除范围事先看不到,可能远超预期。`},"core.filesystem:find-delete-general":{zh:`用 find … -delete 批量删除匹配文件`,why:`效果等同递归删除匹配到的整棵树,条件写宽就会误删。`},"core.filesystem:find-delete-root-home":{zh:`对根目录、主目录或系统目录执行 find … -delete`,why:`可能批量删掉系统文件或个人数据,无法恢复。`},"core.filesystem:unlink-general":{zh:`用 unlink 删除文件`,why:`等同 rm 删除单个文件,不进废纸篓。`},"core.filesystem:truncate-zero-general":{zh:`用 truncate 截断或清空文件`,why:`文件内容会被直接截掉,无法恢复。`},"core.filesystem:shred-general":{zh:`用 shred 粉碎文件内容`,why:`多次覆写文件,连取证工具都无法恢复。`},"core.filesystem:dd-overwrite-general":{zh:`用 dd of=<文件> 覆写文件内容`,why:`目标文件原内容会被就地覆盖,无法恢复。`},"core.filesystem:mv-dynamic-path":{zh:`对含变量展开或转义路径的文件执行 mv`,why:`实际路径要到运行时才确定,可能把重要文件移走或覆盖同名文件。`},"core.filesystem:credential-file-write":{zh:`写入凭据、私钥或登录 shell 启动文件(如 ~/.ssh、~/.aws/credentials、~/.zshrc)`,why:`可能覆盖密钥、泄露凭据或植入每次登录都会执行的代码。`},"core.filesystem:git-internals-write":{zh:`直接改写 .git 目录内部文件`,why:`可能损坏仓库,或写入 git 会自动执行的 hook / 配置。`},"core.filesystem:redirect-truncate-dynamic-path":{zh:`用 > 重定向写入一个含变量展开的路径`,why:`实际目标要到运行时才确定,可能清空某个重要文件。`},"core.filesystem:fork-bomb":{zh:`fork 炸弹:无限递归创建进程`,why:`会耗尽系统资源导致机器卡死,只能强制重启。`},"core.filesystem:powershell-remove-item-recursive":{zh:`用 PowerShell Remove-Item -Recurse 递归删除`,why:`与 rm -rf 等价,不进回收站,无法恢复。`},"core.git:reset-hard":{zh:`丢弃工作区和暂存区的全部未提交改动(git reset --hard)`,why:`从未提交过的改动会彻底丢失,git 也找不回来。`,alt:hs},"core.git:reset-merge":{zh:`用 git reset --merge 回退`,why:`可能丢失未提交的改动。`,alt:hs},"core.git:clean-force":{zh:`强制删除所有未跟踪文件(git clean -f)`,why:`未跟踪文件从未进过 git,删掉就无法恢复。`,alt:`git clean -n`},"core.git:push-force-long":{zh:`强制推送(git push --force)覆盖远端分支`,why:`会覆盖远端历史,别人已推送的提交可能被抹掉。`,alt:gs},"core.git:push-force-short":{zh:`强制推送(git push -f)覆盖远端分支`,why:`会覆盖远端历史,别人已推送的提交可能被抹掉。`,alt:gs},"core.git:push-force-refspec":{zh:`用 + 前缀 refspec 强制推送`,why:`等同对该分支强制推送,会覆盖远端历史。`},"core.git:checkout-discard":{zh:`用 git checkout -- 丢弃文件的未提交改动`,why:`被丢弃的改动从未提交过,无法恢复。`,alt:hs},"core.git:checkout-discard-cwd":{zh:`用 git checkout . 丢弃当前路径下全部未提交改动`,why:`被丢弃的改动从未提交过,无法恢复。`,alt:hs},"core.git:checkout-ref-discard":{zh:`用 git checkout <ref> -- <路径> 覆盖工作区文件`,why:`工作区里这些文件的未提交改动会被覆盖,无法恢复。`,alt:hs},"core.git:checkout-force":{zh:`强制切换分支(git checkout -f)`,why:`会丢弃已跟踪文件的全部未提交改动。`,alt:hs},"core.git:switch-discard":{zh:`丢弃改动并切换分支(git switch --discard-changes / -f)`,why:`会丢弃已跟踪文件的全部未提交改动。`,alt:hs},"core.git:restore-worktree":{zh:`用 git restore 还原工作区文件`,why:`会丢弃这些文件的未提交改动,无法恢复。`,alt:hs},"core.git:restore-worktree-explicit":{zh:`用 git restore --worktree 还原工作区文件`,why:`会丢弃这些文件的未提交改动,无法恢复。`,alt:hs},"core.git:branch-delete":{zh:`删除本地分支`,why:`分支上未合并、未推送的提交会失去引用,之后难以找回。`},"core.git:branch-force-delete":{zh:`强制删除分支或强制改写分支指向(git branch -D / -f)`,why:`即使有未合并的提交也会删掉,提交失去引用后难以找回。`},"core.git:stash-clear":{zh:`清空全部 stash(git stash clear)`,why:`所有暂存的改动会一次性删除。`,alt:`git stash list`},"core.git:filter-branch":{zh:`用 git filter-branch 改写仓库历史`,why:`会改写大量提交,操作不当会永久丢失提交。`},"core.git:reflog-expire-now":{zh:`立即清空 reflog`,why:`reflog 是找回误删提交的最后手段,清空后就找不回了。`},"core.git:rm-force":{zh:`强制删除文件(git rm -f)`,why:`即使文件有未提交改动也会删掉,改动无法恢复。`},"heredoc.posix:pipeline-consumer":{zh:`把下载或其它程序的输出直接管道给 shell 执行(如 curl … | sh)`,why:`执行的内容事先看不到,可能运行任意代码。`},"system.disk:dd-device":{zh:`用 dd 写入块设备`,why:`会覆盖整个磁盘或分区上的全部数据。`},"system.disk:mkfs":{zh:`格式化分区(mkfs)`,why:`会清除该分区上的全部数据。`},"system.disk:diskutil-erase":{zh:`用 diskutil 抹掉磁盘或宗卷`,why:`会清除目标磁盘或宗卷上的全部数据。`}};function vs(e){let t=Object.hasOwn(_s,e.ruleId)?_s[e.ruleId]:null;return t?{what:t.zh,why:t.why,...t.alt?{alt:t.alt}:{}}:{what:e.reason}}var ys=new Set([`core.filesystem:rm-rf-root-home`,`core.filesystem:rm-r-f-separate-root-home`,`core.filesystem:rm-recursive-force-root-home`,`core.filesystem:find-delete-root-home`,`core.filesystem:credential-file-write`,`core.filesystem:fork-bomb`,`heredoc.posix:pipeline-consumer`,`system.disk:dd-device`,`system.disk:mkfs`,`system.disk:diskutil-erase`]),bs=/^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+$/,xs=e=>typeof e==`string`&&e.length<=128&&bs.test(e),Ss=e=>xs(e)&&!e.startsWith(`enso.`)&&!ys.has(e);function Cs(e){return/^(.+)\/\d+$/.exec(e)?.[1]}var ws=e=>Cs(e)!==void 0,Ts={Contacts:`联系方式`,"From Telegram":`来自 Telegram`,"From {{name}}":`来自 {{name}}`,"Not set up":`未配置`,"Waiting to bind":`等待绑定`,"Enable {{name}}":`启用{{name}}`,"Push to this channel":`主动推送`,"Pushes paused":`已暂停推送`,"Send failed":`发送失败`,"Pushes paused: {{count}} sends failed in a row":`已暂停推送:连续 {{count}} 次发送失败`,"The last send failed ({{count}} in a row)":`最近一次发送失败(连续 {{count}} 次)`,"Last failure: {{time}}":`最近一次失败:{{time}}`,"Next try at {{time}}. A message from this channel or Retry now resumes pushes right away.":`{{time}} 再试一次。从这个渠道发来任意一条消息,或点「立即重试」,会马上恢复推送。`,"The next push will try again.":`下一条推送会再试一次。`,"{{count}} pushes held back.":`已有 {{count}} 条推送没发出去。`,"Sends a test message to this channel.":`会往这个渠道发一条测试消息。`,"Pushes to this channel are paused after repeated failures":`这个渠道连续发送失败,推送已暂停`,"Milestones, questions from the secretary, cards and approval notices go out here.":`里程碑、秘书的提问、确认卡与审批提示会推到这里。`,"Confirm cards from the phone":`手机确认卡`,"Off by default. Approvals are never handled from the phone.":`默认关闭。审批永远不能在手机上处理。`,'Off by default. Reply "confirm 1" to confirm a card. Approvals are never handled from the phone.':`默认关闭。回复「确认 1」确认对应的卡;审批永远不能在手机上处理。`,"Mirror every reply":`同步镜像`,"Off by default. Every reply in the secretary conversation is sent here, not just milestones.":`默认关闭。秘书会话里每一轮回复都发到这里,不只是里程碑。`,"Allow viewing memory titles":`允许查看记忆标题`,"No buttons: questions and cards arrive as numbered text.":`没有按钮:提问和确认卡会变成编号文本。`,"Cannot edit sent messages: answered questions are not marked there.":`不能改已发出的消息:答过的提问不会在这里标记。`,"No typing indicator.":`不显示「正在输入」。`,"The Telegram remote plugin (enso.telegram) is enabled. Do not give both the same bot token: only one place can poll a bot, so they would steal each other's messages.":`已启用 Telegram 远程插件(enso.telegram)。两边不要用同一个 bot token:一个 bot 只能有一处在轮询,会互相抢消息。`,"Enable contacts":`启用联系方式`,"Contacts are off: nothing is sent or received on any channel.":`联系方式已关闭:所有渠道都不收不发。`,"Find more contact channels in the plugin market":`从插件市场找更多联系方式`,"Reach the secretary from your phone. Milestones go out; your replies come back.":`不在电脑前也能找到秘书:里程碑推到手机,你在手机上回话就是跟秘书说话。`,"Telegram returned an error":`Telegram 返回了一个错误`,"Cannot reach api.telegram.org. Check the proxy.":`连不上 api.telegram.org,检查代理。`,"Bound to @{{username}}":`已绑定 @{{username}}`,"Bot @{{bot}}":`机器人 @{{bot}}`,"Send a test message":`发一条测试消息`,"Test message sent":`测试消息已发出`,Unbind:`解绑`,"Change bot":`更换 bot`,"Allow confirming cards from Telegram":`允许从 Telegram 确认卡片`,"On by default. A tap on your phone can confirm settings, skill, tool, takeover and cleanup cards. Those cards change which projects the secretary sees, what it may take over, which skills and tools it installs and what it cleans up. Approvals are never handled from Telegram.":`默认打开:手机上的一个按钮就能确认设置、技能、工具、接管与清理卡片——这些卡片能改秘书的可见项目、接管范围,装 skill 和工具,也能清理分支与会话。审批无论如何都不能从 Telegram 处理。`,"No system keychain available: the bot token is stored unencrypted on this machine.":`系统钥匙串不可用:bot token 会以明文存在这台机器上。`,"Bot verified":`bot 已校验`,"Open the bot and press Start":`打开 bot 点 Start`,"Binding QR code":`绑定二维码`,"Binding code":`绑定码`,"Valid for {{minutes}} more minutes":`还有 {{minutes}} 分钟有效`,"Open @{{bot}}":`打开 @{{bot}}`,"Copy link":`复制链接`,"Link copied":`链接已复制`,"New code":`重新生成`,"The code works once, in a private chat with this bot only.":`这个码只能用一次,且只在这个 bot 的私聊里有效。`,"Create a bot with @BotFather":`找 @BotFather 建一个 bot`,"Send /newbot, pick a name, and copy the token it gives you.":`发 /newbot,起个名字,把它给的 token 复制过来。`,"Open @BotFather":`打开 @BotFather`,"Paste the bot token":`粘贴 bot token`,"Verify and continue":`校验并继续`,"Bind again with @{{bot}}":`用 @{{bot}} 重新绑定`,"The token is stored with the system keychain and never written to logs.":`token 存在系统钥匙串里,不会写进日志。`,"That does not look like a bot token":`这不像一个 bot token`,"Telegram rejected this token":`Telegram 拒绝了这个 token`,"Paste a bot token first":`先粘贴 bot token`,"Not bound yet":`还没绑定`,"No secretary conversation is available":`没有可用的秘书会话`,"Could not reach the secretary session":`没能把消息送到秘书会话`,"Not allowed from this window":`这个窗口没有权限`,Privacy:`隐私`,"Privacy masking":`隐私脱敏`,"Replace API keys and personal data with placeholders before requests leave this device, and restore them in replies. Original values stay in memory on this device only.":`请求离开本机前把 API Key 和个人信息换成占位符,回复中自动还原。原值只保存在本机内存里。`,"Applies to chats, compaction, bot members and helper requests.":`作用于会话、压缩、Bot 成员和各类辅助请求。`,Secrets:`密钥`,"API keys, tokens, private keys, passwords in URLs and config files.":`API Key、令牌、私钥、URL 和配置文件里的密码。`,"Detect secrets":`识别密钥`,"Recommended. Covers common vendor key formats.":`建议开启,覆盖常见厂商的 key 格式。`,"Send look-alike keys":`发送形似的假 key`,"Replace keys with fake keys of the same format instead of placeholders, so the model treats them as real keys.":`用格式相同的假 key 代替占位符,模型会把它当成真 key 处理。`,"Personal data":`个人信息`,"Detect personal data":`识别个人信息`,"Matches are validated (checksums, real domains) to limit false hits.":`命中会做校验(校验位、真实域名),减少误伤。`,Mask:`脱敏`,"Warn only":`只提醒`,Block:`拦截`,Email:`邮箱`,"Phone number":`手机号`,"ID card number":`身份证号`,"Bank card number":`银行卡号`,"IP address":`IP 地址`,"Custom rules":`自定义规则`,Words:`词语`,"One per line, case-insensitive. Project codenames, customer names…":`每行一个,不区分大小写。项目代号、客户名称等。`,"Prefixes or patterns":`前缀或正则`,"One per line. A prefix like corp_ or a regex like /INC-\\d{4}/i.":`每行一个。可以是前缀如 corp_,或正则如 /INC-\\d{4}/i。`,"Allow list":`允许名单`,"Never mask":`从不脱敏`,"Exact values, one per line. Team emails, test keys…":`完整值,每行一个。团队邮箱、测试 key 等。`,"Try it":`试一试`,"Runs locally. Nothing is remembered or sent anywhere.":`只在本地运行,不记住也不发送任何内容。`,"Paste some text, e.g. an .env file":`粘贴一段文本,例如 .env 文件`,"Nothing matched":`没有命中`,Records:`记录`,"Requested at":`请求时间`,"Auxiliary request":`辅助请求`,Compaction:`压缩`,Hits:`命中`,"Request blocked":`请求已拦截`,"No records yet":`暂无记录`,"Your message":`你的消息`,"Tool output":`工具输出`,"Tool arguments":`工具参数`,"Earlier replies":`之前的回复`,"Tool descriptions":`工具说明`,"Restored {{count}} in the reply":`回复中已还原 {{count}} 处`,"{{count}} values":`{{count}} 个值`,"Privacy masking blocks {{kinds}}. Remove it, or change the action or allow list in Settings → Privacy.":`隐私脱敏拦截了 {{kinds}}。请删掉它,或到「设置 → 隐私」调整动作或允许名单。`,"Will be blocked: {{kinds}}":`将被拦截:{{kinds}}`,"Emails, phone numbers, ID and bank card numbers, IP addresses.":`邮箱、手机号、身份证号、银行卡号、IP 地址。`,"Words and patterns specific to your work.":`与你的工作相关的词语和格式。`,"{{count}} will be masked":`发送时将脱敏 {{count}} 项`,"Classification only, not for chat":`仅用于分类,不能聊天`,"ChatGPT account selected":`已选择 ChatGPT 账号`,"ChatGPT account switched":`ChatGPT 账号已接替`,"ChatGPT account selected: {{account}}":`已选择 ChatGPT 账号:{{account}}`,"ChatGPT account switched: {{previous}} → {{current}}":`ChatGPT 账号已接替:{{previous}} → {{current}}`,"ChatGPT (automatic failover)":`ChatGPT(自动接替)`,"Create ChatGPT account pool":`创建 ChatGPT 自动接替池`,"Pool members":`接替账号`,"Use enabled, signed-in accounts in the listed order. Model and reasoning stay unchanged. Main agents and subagents share this pool.":`按列表顺序使用已启用且已登录的账号。模型和推理设置保持不变,主代理与子代理共用此池。`,"Account disabled":`账号已停用`,"Account signed out":`账号未登录`,"Pool entries do not show a single account quota. Fixed-account entries remain unchanged.":`自动接替池不显示单个账号额度,固定账号条目保持不变。`,"This reply can no longer be retried. Please send your request again.":`这条回复已无法重试,请重新发送需求。`,"Chat image storage is full (200MiB). Message not sent.":`群图片空间已满(200MiB),这条消息未发送。`,"An image is still over 10MiB after compression. Message not sent.":`图片压缩后仍超过 10MiB,这条消息未发送。`,"An attachment is not a supported image. Message not sent.":`附件不是支持的图片格式,这条消息未发送。`,"Could not save the images. Message not sent. Please try again.":`图片保存失败,这条消息未发送,请重试。`,"Add to favorites":`添加收藏`,Appearance:`外观`,"Bold font weight":`粗体字重`,"Terminal shell":`终端 Shell`,"System default":`系统默认`,"Applies to new side panel terminals. SSH projects keep the remote login shell.":`仅对新开的侧边栏终端生效。SSH 项目仍用远端登录 shell。`,"Worktree root directory":`Worktree 根目录`,"Where isolated session worktrees are created. Leave empty to use the app data directory. Existing worktrees stay where they are.":`隔离会话的 worktree 建在此目录下。留空则用应用数据目录。已有 worktree 不迁移。`,"Default location":`默认位置`,"Enter an absolute path":`请输入绝对路径`,"Choose interface theme":`选择界面主题`,"Accent color":`强调色`,"Highlight color used across the interface":`界面高亮使用的颜色`,"Follow theme":`跟随主题`,Theme:`主题`,"Built-in and plugin themes; each one is a set of color tokens":`内置与插件主题,每个主题是一组颜色 token`,"Plugin · {{name}}":`插件 · {{name}}`,"Get more themes":`获取更多主题`,Personalization:`个性化`,"Applied on top of any theme":`在任意主题之上覆盖`,"Used for running state, checkmarks and plan mode":`用于运行状态、勾选与计划模式`,"Custom CSS":`自定义 CSS`,"Inject user.css into every window; saved changes apply immediately":`把 user.css 注入所有窗口,保存即生效`,"Open user.css":`打开 user.css`,"Cannot open user.css":`无法打开 user.css`,Violet:`紫罗兰`,Indigo:`靛蓝`,Teal:`青绿`,Amber:`琥珀`,Graphite:`石墨`,"Color scheme":`配色方案`,Dark:`深色`,Font:`字体`,"Font size":`字号`,"Font weight":`字重`,General:`通用`,"General application settings":`应用通用设置`,"File opening":`文件打开`,"Context menu opening":`右键打开方式`,"File manager":`文件管理器`,"VS Code":`VS Code`,"Change application":`更换应用`,"Configure list":`配置列表`,"Add application":`添加应用`,"Open in {{app}}":`在 {{app}} 中打开`,"No opening methods enabled":`未启用打开方式`,"You can configure up to 32 opening methods.":`最多可配置 32 项打开方式。`,"Select the opening methods shown in file link context menus. You can add multiple applications.":`勾选文件链接右键菜单中显示的打开方式,可添加多个应用。`,"Configure how local workspace file links open by extension.":`按扩展名配置本地工作区文件链接的打开方式。`,"By default, supported files open inside EnsoCode; other files are revealed in the file manager.":`默认在 EnsoCode 内打开支持的文件,其他文件在文件管理器中显示。`,"Executable and installer files are always revealed in the file manager.":`可执行文件和安装包始终在文件管理器中显示。`,"File extension":`文件扩展名`,"Open inside EnsoCode":`在 EnsoCode 内打开`,"Reveal in file manager":`在文件管理器中显示`,"System default application":`系统默认应用`,"Selected application":`指定应用`,"Choose application":`选择应用`,"The selected application path is invalid.":`所选应用路径无效。`,"VS Code is unavailable. Install it or select another application.":`未找到 VS Code,请安装或选择其他应用。`,"Enter a valid file extension, for example .md.":`请输入有效的文件扩展名,例如 .md。`,"This extension does not support internal preview.":`此扩展名不支持内部预览。`,"Choose an application before saving this rule.":`保存此规则前请选择应用。`,"This extension already has an opening rule.":`此扩展名已有打开规则。`,"Image preview":`图片预览`,"Unable to preview this image.":`无法预览此图片。`,"Open in code editor":`用代码编辑器打开`,"Image is too large. Click to load.":`图片过大,点击加载`,"Actual size":`原始尺寸`,"Fit to window":`适应窗口`,"This file format cannot be previewed inside EnsoCode.":`此文件格式无法在 EnsoCode 内预览。`,"The image is too large to preview.":`图片过大,无法预览。`,Updates:`更新`,"Application update settings":`应用更新设置`,"Current version":`当前版本`,"Check for updates":`检查更新`,"Checking for updates…":`正在检查更新…`,"New version {{version}} found":`发现新版本 {{version}}`,"You are on the latest version":`已是最新版本`,"Downloading update… {{percent}}%":`正在下载更新… {{percent}}%`,"New version {{version}} is downloaded. Restarting waits for the current tool to finish; background commands keep running.":`新版本 {{version}} 已下载。重启会在当前工具结束后进行,转到后台的命令会接着跑。`,"Update check failed":`检查更新失败`,"Restart to update":`重启更新`,"Restart to update is already in progress. Please wait.":`正在重启更新,请稍候`,"No downloaded update to install. Check for updates again.":`没有已下载的更新可安装,请重新检查更新`,"Restart to update failed: {{error}}. Try Restart to update again in a moment; if it still fails, quit EnsoCode completely and reopen it.":`重启更新失败:{{error}}。请稍后再点一次「重启更新」;仍不行就完全退出 EnsoCode 再重新打开`,"{{count}} conversation(s) interrupted by app exit":`{{count}} 个会话因应用退出被中断,已在会话里说明原因`,"Update failed: {{error}}":`更新失败:{{error}}`,"Download update":`下载更新`,"New version {{version}} found. This local build can't install it automatically.":`发现新版本 {{version}},本地构建无法自动安装,请手动下载。`,"This local build is signed differently from the release and can't install updates automatically. Download it manually.":`本地构建与正式版签名不一致,无法自动安装更新,请手动下载。`,"Open release page":`打开 Release 页面`,"Download DMG":`下载 DMG`,"Release notes":`更新日志`,"What's new in {{version}}":`{{version}} 更新内容`,"No release notes provided.":`此版本未提供更新日志。`,Restart:`重启`,"Restarting…":`正在重启…`,"Waiting for running commands to restart…":`等命令跑完再重启…`,"Waiting for the current command to finish":`正在等当前命令结束`,"Waiting for the current reply to finish":`正在等这一轮回复写完`,"Running {{tool}}":`正在执行 {{tool}}`,"A subagent is running {{tool}}":`子代理正在执行 {{tool}}`,"Writing a reply":`正在写回复`,"A subagent is writing a reply":`子代理正在写回复`,"Opening the session":`正在打开会话`,"A subagent is opening the session":`子代理正在打开会话`,"A background command is still running":`转到后台的命令还在跑`,"A subagent still has a background command running":`子代理转到后台的命令还在跑`,"Finishing the turn":`正在收尾这一回合`,"A subagent is finishing the turn":`子代理正在收尾这一回合`,"{{count}} more sessions":`还有 {{count}} 个会话`," · waiting for {{count}} sessions":` · 等 {{count}} 个会话`,"Interrupted by a restart, continued below":`因重启中断,已在下方接着写`,"Show the interrupted part":`展开查看`,"Hide the interrupted part":`收起`,"A session is still writing its reply. EnsoCode waits up to {{minutes}} minutes; if it stops producing output for more than {{idle}} seconds, it is stopped first and continues automatically after the restart.":`有会话的回复还在写,最多等 {{minutes}} 分钟;停止输出超过 {{idle}} 秒就先停下,重启后自动接着写。`,"Restarting EnsoCode…":`正在重启 EnsoCode…`,"Restoring sessions…":`正在恢复会话…`,"EnsoCode will restart once the current command finishes.":`当前命令结束后再重启 EnsoCode。`,"EnsoCode will install the update once the current command finishes.":`当前命令结束后再安装更新。`,"EnsoCode will quit once the current command finishes.":`当前命令结束后再退出 EnsoCode。`,"A command moved to the background cannot keep running without EnsoCode (for example a remote or Windows command), so EnsoCode waits for it.":`有转到后台的命令没法脱离 EnsoCode 继续跑(如远程会话或 Windows 上的命令),所以要等它结束。`,"Force quit":`强制退出`,"Restarting once the current command finishes":`等当前命令结束后重启`,"Installing the update once the current command finishes":`等当前命令结束后安装更新`,"Quitting once the current command finishes":`等当前命令结束后退出`,"Restart failed: {{error}}":`重启失败:{{error}}`,"Restart server":`重启服务端`,"Restart server?":`重启服务端?`,"Running tasks are interrupted; this page reconnects after the server is back.":`正在运行的任务会被中断,服务端起来后本页会自动重连。`,"Server updates install the new version with npm and restart.":`服务端(npm 全局安装):用 npm 安装新版本后重启。`,"This server must be updated on the machine itself.":`这台服务端无法远程更新,请在服务器上执行 npm i -g @ensocode/server。`,"Automatic updates":`自动更新`,"Download and install updates automatically":`自动下载并安装更新`,"Restart automatically to apply updates":`自动重启以应用更新`,"When idle":`空闲时`,"Don't wait for idle":`不等空闲`,"Only notify when an update is ready; never restart automatically.":`更新下载完成后只提示,不自动重启。`,"Restart as soon as the update is downloaded, even while agents are running or messages are queued. The restart happens after the current tool finishes, and running sessions keep going afterwards. It still waits while you're using the window (input in the last 2 minutes), while an input box has an unsent draft, or while a question or approval is pending.":`更新下载完成后就重启,有 agent 在跑、有排队消息也不等。重启会在当前工具结束后进行,在跑的会话重启后接着跑。你正在用窗口(2 分钟内有键盘或鼠标输入)、输入框里有未发送的草稿、或者有待回答/待审批时先等。`,"Update channel":`更新渠道`,Stable:`稳定版`,Beta:`内测版`,"Only stable releases.":`只接收正式发布的稳定版。`,"Beta builds come from the latest main branch and may be unstable. You get whichever of beta and stable is newer.":`内测版由 main 分支最新代码自动构建,可能不稳定;内测版和稳定版里哪个更新就更新到哪个。`,"You're on a beta build. Switching to stable doesn't downgrade; you'll move to the next stable release once it's out.":`当前装的是内测版。切回稳定版不会降级,等下一个稳定版发布后自动更新过去。`,"After the update is downloaded, restart automatically if no agent is running, nothing is queued, and there are no pending questions or approvals. The idle state must last 5 minutes, and a focused window also blocks it.":`更新下载完成后,没有 agent 在跑、没有排队消息、也没有待回答/待审批时自动重启。该状态需连续保持 5 分钟;窗口在前台时也会拦住。`,"Network proxy":`网络代理`,"Used by model requests, the built-in browser, and agent tools":`作用于模型请求、内嵌浏览器和 agent 工具`,"Proxy mode":`代理模式`,"Follow system proxy":`跟随系统代理`,"No proxy":`不使用代理`,"Custom proxy":`自定义代理`,"Proxy URL":`代理地址`,"Enter an http(s) proxy URL":`请输入 http(s) 代理地址`,"Custom CA certificate":`自定义 CA 证书`,"Trust an extra CA (PEM file) for model endpoints signed by a private CA. TLS verification stays on.":`为私有 CA 签发的模型接口额外信任一个 CA(PEM 文件),TLS 校验保持开启。`,"Choose certificate file":`选择证书文件`,"Set: {{path}}":`已设置:{{path}}`,"Using NODE_EXTRA_CA_CERTS from the launch environment: {{path}}":`已使用启动环境中的 NODE_EXTRA_CA_CERTS(优先于此设置):{{path}}`,"Not set; using NODE_EXTRA_CA_CERTS from the login shell: {{path}}":`未设置,使用登录 shell 中的 NODE_EXTRA_CA_CERTS:{{path}}`,"Certificate file unavailable ({{reason}}): {{path}}":`证书文件不可用({{reason}}):{{path}}`,"Path must be absolute":`须为绝对路径`,"File not found":`文件不存在`,"Not a file":`不是文件`,"File is not readable":`文件不可读`,"Changes restart the agent process right away (running turns are interrupted). Requests made by the app main process take effect after restarting the app.":`修改后会立即重启 Agent 进程(进行中的回合会中断);主进程侧需重启应用生效。`,Shortcuts:`快捷键`,"Click a shortcut to rebind it. Backspace removes it; Esc cancels.":`点击键位改绑。Backspace 删除;Esc 取消。`,"Remove shortcut":`删除快捷键`,"No shortcut":`无快捷键`,"Toggle sidebar":`折叠/展开侧栏`,"Open settings":`打开设置`,"Switch model":`切换模型`,"Focus chat input":`聚焦输入框`,"Find in conversation":`在对话中查找`,"Search workspace":`搜索工作区`,"Search anything":`搜索任意内容`,"Search conversations...":`搜索会话...`,"Search conversations, browser tabs, settings…":`搜索对话、浏览器标签、设置…`,"Search all projects":`搜索全部项目`,"Switch scope":`切换范围`,Navigate:`选择`,Open:`打开`,"No matching results":`没有匹配结果`,Conversations:`对话`,"This project":`当前项目`,"All projects":`全部项目`,"Include archived":`含归档`,Current:`当前`,Recent:`最近`,"No projects active in the last {{n}} days":`最近 {{n}} 天没有活跃项目`,"No projects in this group yet":`这个分组还没有项目`,Actions:`动作`,"No matching conversations":`没有匹配的会话`,"Search messages...":`搜索消息...`,"Only when the chat input is focused":`仅在输入框聚焦时生效`,"Send message":`发送消息`,"Next coworker tab":`下一个 coworker 标签`,"Previous coworker tab":`上一个 coworker 标签`,"Press shortcut…":`按下新快捷键…`,'Already used by "{{label}}"':`已被「{{label}}」占用`,"Reset to default":`恢复默认`,Language:`语言`,"Windows local command shell":`Windows 本地命令壳`,"Only the Windows local agent command tool. SSH and other platforms stay on bash. Takes effect on the next session.":`只影响 Windows 本机 agent 命令工具。SSH 与其它平台仍用 bash。下次开会话生效。`,"Windows default (PowerShell)":`Windows 默认(PowerShell)`,PowerShell:`PowerShell`,"Git Bash":`Git Bash`,Light:`浅色`,"No favorite themes yet. Click the heart icon to add favorites.":`暂无收藏主题。点击爱心图标添加收藏。`,"No themes found":`未找到主题`,Preview:`预览`,"Remove from favorites":`取消收藏`,"Search themes...":`搜索主题...`,Settings:`设置`,"Search settings":`搜索设置`,Application:`应用`,"Models & agents":`模型与智能体`,"Tools & extensions":`工具与扩展`,Connections:`连接`,"Show favorites only":`只显示收藏`,"Sync terminal theme":`同步终端主题`,System:`系统`,Terminal:`终端`,"Conversation display":`对话显示`,"Conversation typography":`会话排版`,"Headings, tables and inline code scale with the body text":`标题、表格与行内代码按正文比例缩放`,Body:`正文`,"Heading 1":`一级标题`,"Heading 2":`二级标题`,"Heading 3":`三级标题`,"Heading 4–6":`四到六级标题`,Table:`表格`,"Inline code":`行内代码`,"Code block":`代码块`,"Reset to defaults":`恢复默认`,"Agent runtime":`Agent 运行`,"Sessions & worktrees":`会话与 Worktree`,"Collaboration & planning":`协作与规划`,Web:`联网`,Execution:`执行`,"Context & memory":`上下文与记忆`,Safety:`安全`,Changes:`改动`,Session:`会话`,Git:`Git`,"Git views":`Git 视图`,"Staged changes":`已暂存`,"Unstaged changes":`未暂存`,"Untracked changes":`未跟踪`,"Changed files":`改动文件`,"List view":`列表视图`,"Tree view":`树状视图`,"Collapse list":`收起列表`,"Expand list":`展开列表`,"No matching files.":`没有匹配的文件。`,Stage:`暂存`,Unstage:`取消暂存`,"Stage all":`暂存全部`,"Unstage all":`取消全部暂存`,"Discard changes":`丢弃修改`,"Delete untracked file":`删除未跟踪文件`,"Delete untracked file {{path}} permanently?":`永久删除未跟踪文件 {{path}}?`,"Restore {{path}} to its staged version? Unstaged changes will be lost.":`将 {{path}} 恢复为暂存版本?未暂存的修改将丢失。`,"Discard…":`放弃…`,"Discard all":`放弃所有`,"Discard untracked":`放弃跟踪`,"Discard {{tracked}} tracked changes, delete {{untracked}} untracked files":`丢弃 {{tracked}} 个已跟踪文件的修改,删除 {{untracked}} 个未跟踪文件`,"Permanently delete {{count}} untracked files":`永久删除 {{count}} 个未跟踪文件`,"Unstaged changes in {{count}} tracked files will be lost; the files are restored to their staged version.":`{{count}} 个已跟踪文件的未暂存修改将丢失,文件本身保留并恢复为暂存版本。`,"{{count}} untracked files will be permanently deleted and cannot be recovered.":`{{count}} 个未跟踪文件将被永久删除,删除后无法恢复。`,"Tracked files are not changed.":`已跟踪文件不受影响。`,"Resolve conflicts first.":`请先解决冲突。`,"{{count}} conflicted":`{{count}} 个冲突`,"Discard and delete {{count}} untracked files":`放弃修改并删除 {{count}} 个未跟踪文件`,"Delete {{count}} untracked files":`删除 {{count}} 个未跟踪文件`,"Commit message":`提交信息`,"Enter commit message…":`输入提交信息…`,"{{count}} staged files":`已暂存 {{count}} 个文件`,Commit:`提交`,Fetch:`获取远程更新`,Pull:`拉取`,Push:`推送`,"No upstream":`未关联上游`,"No upstream branch configured.":`当前分支未关联上游分支。`,"Working tree clean.":`工作区没有改动。`,"Filter changed files…":`筛选改动文件…`,"Workspace is changing. Please wait.":`工作区正在切换,请稍候。`,"Could not read Git status.":`读取 Git 状态失败。`,"Could not complete the Git operation.":`Git 操作失败。`,"Could not load Git history.":`加载提交历史失败。`,"Could not load the changed files.":`加载改动文件失败。`,"Could not load the diff.":`加载差异失败。`,"Could not load the diff viewer.":`加载差异查看器失败。`,"Select a file to view its diff.":`选择文件查看差异。`,"No text changes to display.":`没有可显示的文本差异。`,"Only line endings changed.":`仅换行符发生变化。`,"No commits yet.":`暂无提交。`,"No file changes in this commit.":`该提交没有文件改动。`,"Load more commits":`加载更多提交`,added:`新增`,modified:`修改`,deleted:`删除`,untracked:`未跟踪`,conflicted:`冲突`,Browser:`浏览器`,"New tab":`新建标签页`,"Pin as default tab":`固定为默认标签页`,"Show in all sessions":`在所有会话中显示`,"Unpin default tab":`取消固定默认标签页`,Soon:`即将支持`,Forward:`前进`,"Enter a URL":`输入网址`,"Navigation failed":`导航失败`,"Agent is browsing":`Agent 正在操作`,"Take control":`接管`,"Enso is in control":`Enso 正在接管`,"Toggle Developer Tools":`开关开发者工具`,"Toggle Design Mode":`开关圈选模式`,"Selected UI element":`圈选的界面元素`,"No Composer for this selection":`没有可接收圈选的输入框`,"Add to conversation":`添加到对话`,"Browser data":`浏览器数据`,"RTK command compression":`RTK 命令压缩`,"Compress supported command output before it enters the model context. Takes effect on new conversations.":`在受支持的命令输出进入模型上下文前进行压缩。新会话生效。`,"Protected action confirmation":`受保护操作确认`,"Even in full-access mode, ask before external sends, deletions, payments, deployments and secret-file access. Always on for Bot members not set to Full access. Takes effect on new conversations.":`即使在完全放行模式下,对外发送、删除、付款、部署和访问密钥文件前也要求确认。非完全放行的 Bot 成员始终开启。新会话生效。`,"Protected actions will not ask for confirmation either.":`受保护操作也不再询问。`,"Protected: external send":`受保护:对外发送`,"Protected: delete":`受保护:删除`,"Protected: payment":`受保护:付款`,"Protected: deploy / production":`受保护:部署 / 生产`,"Protected: secrets":`受保护:密钥`,"Protected: destructive command":`受保护:破坏性命令`,"dcg: {{reason}}":`dcg:{{reason}}`,"dcg notice: {{reason}}":`dcg 提醒(不拦截):{{reason}}`,"dcg notice":`dcg 提醒`,"dcg explanation":`dcg 详细说明`,Matched:`命中片段`,Critical:`严重`,"dcg returned invalid output; confirmation required.":`dcg 返回了无法解析的输出,请人工确认。`,"dcg exited abnormally despite allow decision; confirmation required.":`dcg 退出状态异常(即使标记放行),请人工确认。`,"dcg returned malformed warning; confirmation required.":`dcg 返回了格式异常的警告,请人工确认。`,"dcg returned an unknown decision; confirmation required.":`dcg 返回了未知决策类型,请人工确认。`,"dcg required confirmation without details.":`dcg 要求人工确认(未提供规则详情)。`,"Deletes in the shared system Temp folder root, which holds files of other apps; delete only inside the session temp folder.":`在系统共用的 Temp 根目录里删除,那里有其他程序的文件;只应在会话专属临时目录内删除。`,"Safety floor rule — still requires confirmation in full-access mode. Click Adjust to target a specific subdirectory or session temp folder, or Allow once.":`属于安全底线规则,即使在完全放行模式下也会拦截。可点「调整」改用具体子目录或会话专属临时目录,或确认无误后单次放行。`,"Blocked by built-in guard — still requires confirmation in full-access mode. Review the command, click Adjust, or Allow once.":`由内置守卫拦截,即使在完全放行模式下也会确认。请核对命令内容,可点「调整」或确认无误后单次放行。`,"Command guard could not finish rechecking the remaining command; confirm before running.":`命令守卫未能完成其余语句的复检,执行前请人工确认。`,"High-risk safety floor (cannot be exempted) — still requires confirmation in full-access mode. Click Adjust for a safer command or path, or Allow once.":`属于高危安全底线(不可豁免),即使在完全放行模式下也会拦截。可点「调整」更换更安全的命令或路径,或确认无误后单次放行。`,"Guard rule requires confirmation each time — still prompts in full-access mode. Click Adjust for a safer command, or Allow once.":`该守卫规则要求每次确认,即使在完全放行模式下也会拦截。可点「调整」换用更安全的命令,或确认无误后单次放行。`,"Triggered by command guard — still prompts in full-access mode. Click Adjust to change the command or path, or manage exemptions in Settings (auto-suggested after 5 allows).":`由命令守卫拦截,即使在完全放行模式下也会确认。可点「调整」更换命令或路径,或在设置中管理豁免(单次放行 5 次后也可在此直接豁免)。`,"Destructive command guard (dcg)":`破坏性命令守卫(dcg)`,"Check bash and PowerShell commands with dcg before running. Matches such as git reset --hard or recursive deletes always require your confirmation, even in full-access mode. Takes effect on new conversations.":`执行 bash 和 PowerShell 命令前先用 dcg 检查。命中 git reset --hard、递归删除等危险命令时,即使在完全放行模式下也必须由你确认。新会话生效。`,"Not available on this platform":`当前平台不可用`,"Installed v{{version}}":`已安装 v{{version}}`,"Not installed":`未安装`,Install:`安装`,Uninstall:`卸载`,OK:`好`,Integrations:`集成`,"Install 'enso' Command in PATH":`在 PATH 中安装 enso 命令`,"Install Finder Quick Action":`安装访达快速操作`,"'enso' terminal command":`enso 终端命令`,"Finder Quick Action":`访达快速操作`,Troubleshooting:`故障排查`,"Developer tools":`开发者工具`,"Open the console of the main window to see errors and logs.":`打开主窗口的控制台,查看报错和日志。`,"Could not open developer tools":`无法打开开发者工具`,"The main window is closed. Open it and try again.":`主窗口已关闭,请先打开主窗口再试。`,"Couldn't install the 'enso' command":`无法安装 enso 命令`,"Shell command 'enso' installed in {{dir}}.":`已在 {{dir}} 安装 enso 命令。`,"Run `enso .` in a terminal to open the current folder in EnsoCode.":"在终端运行 `enso .` 即可用 EnsoCode 打开当前目录。","Run `enso .` in a terminal to open the current folder in EnsoCode. Links the command into /usr/local/bin and may ask for your password.":"在终端运行 `enso .` 即可用 EnsoCode 打开当前目录。会把命令链接到 /usr/local/bin,可能需要输入密码。","Couldn't install the Finder Quick Action":`无法安装访达快速操作`,"Finder Quick Action installed.":`访达快速操作已安装。`,"Right-click a folder in Finder and choose Services > Open with EnsoCode.":`在访达中右键文件夹,选择「服务」>「用 EnsoCode 打开」。`,"Installing…":`安装中…`,"Operation failed":`操作失败`,"Install dcg":`安装 dcg`,"Downloads dcg v{{version}} from its GitHub release and verifies the checksum. dcg is a third-party tool, not part of EnsoCode.":`从 GitHub Release 下载 dcg v{{version}} 并校验 sha256。dcg 是第三方工具,不属于 EnsoCode。`,"dcg is licensed under MIT with an additional rider: no rights are granted to OpenAI, Anthropic, their affiliates, or anyone acting on their behalf. Install only if this restriction does not apply to you.":`dcg 使用附加限制条款的 MIT 许可证:不授予 OpenAI、Anthropic 及其关联方或代表它们行事的任何人任何权利。仅在该限制不适用于你时安装。`,"Agree and install":`同意并安装`,"Up to date (latest v{{latest}})":`已是最新(最新版 v{{latest}})`,"dcg v{{latest}} is available (built-in v{{current}}). It can be installed after an EnsoCode update ships its checksum.":`发现 dcg 新版 v{{latest}}(内置 v{{current}})。需等 EnsoCode 更新内置校验值后才能安装。`,"GitHub rate limit reached. Try again in an hour.":`GitHub 接口请求已达上限,请一小时后再试。`,"Could not read the latest dcg release.":`无法读取 dcg 最新版本信息。`,"Could not reach GitHub. Check your network.":`无法连接 GitHub,请检查网络。`,"Clear rule exemptions":`清除规则豁免`,"Rule exemptions cleared.":`已清除规则豁免与放过记录。`,"Why it is dangerous":`为什么危险`,"Safer alternative":`安全替代`,"You have allowed this rule {{count}} times. Allow it automatically from now on?":`这条规则你已经放过 {{count}} 次,要不要以后直接通过?`,"Always allow this rule":`以后直接通过`,"Confirm exemption":`确认豁免`,'Allow "{{rule}}" automatically in new conversations? You can revoke this anytime in Settings.':`确认在新会话中自动放行「{{rule}}」?随时可在设置中撤销。`,"Exempted rules":`已豁免规则`,"No rule exemptions.":`暂无规则豁免。`,"This rule is allowed automatically in new conversations until dcg is updated.":`新会话中这条规则将直接通过,dcg 版本更新后失效。`,"Memory write":`记忆写入`,"Secrets redacted":`已脱敏密钥`,"Memory writes awaiting approval":`待批准的记忆写入`,"Bot members need your approval before writing to project or global memory.":`Bot 成员写入项目或全局记忆前需要你批准。`,Compressed:`已压缩`,Unchanged:`未改变`,"Background task started":`后台任务已启动`,Bypassed:`已绕过`,Unavailable:`不可用`,"This is the startup receipt; see the task_output result for final statistics.":`此处为启动回执,最终统计见 task_output 的结果。`,"~{{count}} tokens saved":`约节省 {{count}} tokens`,"Input estimate":`输入估算`,"Output estimate":`输出估算`,"{{count}} tokens":`{{count}} tokens`,Reason:`原因`,"Cookies and site storage of the built-in browser, separate from the app itself.":`内嵌浏览器的 Cookie 与站点存储,与应用本身隔离。`,"Open chat links in the built-in browser":`对话链接在内嵌浏览器打开`,"Clicking a web link in chat opens it in the side panel browser. {{key}}+Click opens it in the external browser.":`点击对话里的网页链接会在侧栏内嵌浏览器打开;{{key}}+点击在外部浏览器打开。`,"{{key}}+Click to open in external browser":`{{key}}+点击在外部浏览器打开`,Cleared:`已清除`,"Clear cookies":`清除 Cookie`,"Clear cache":`清除缓存`,"Clear all browsing data":`清除全部浏览数据`,"Enter a URL above, or let the agent open a page with browser_navigate.":`在上方输入网址,或让 agent 用 browser_navigate 打开页面。`,"Search...":`搜索…`,"Case sensitive":`区分大小写`,"Whole word":`全词匹配`,"Regular expression":`正则`,"Previous match":`上一个`,"Next match":`下一个`,"Use full chat width":`铺满两侧`,"Use reading width":`恢复两侧留白`,"Toggle side panel":`折叠/展开右侧面板`,"Toggle side panel fullscreen":`右侧面板全屏`,"Toggle minimize to tray":`切换最小化到托盘`,"Works while the app is in the tray":`应用在托盘时也能切换`,"Expand side panel":`全屏右侧面板`,"Exit side panel fullscreen":`退出右侧面板全屏`,"New terminal tab":`新建终端标签`,"New terminal when the side panel is focused; otherwise new conversation":`焦点在右侧边栏时新建终端,否则新建会话`,"Close terminal tab":`关闭终端标签`,"Collapse side panel":`折叠右侧面板`,"Select a conversation to use the side panel.":`选择一个会话后使用右侧面板。`,"No tabs yet. Create one to get started.":`还没有标签页,新建一个开始使用。`,"Open Changes when files are edited":`有文件改动时打开 Changes`,"Automatically show the side panel Changes tab after the agent edits a file":`Agent 改文件后自动打开右侧 Changes`,"Open in side panel":`在侧栏打开`,"Compact read-only tool calls":`精简只读工具调用`,"Expand file edits while running":`运行中自动展开文件改动`,"Automatically unfold diffs or written content from file modification tools while the agent is still running":`agent 运行中,文件修改工具的 diff 或写入内容自动展开`,"Expand reasoning while streaming":`流式推理时自动展开`,"Quote button on text selection":`选中文字时显示「引用」按钮`,"Show a floating Quote button when you select text in the conversation; click it to put the selection into the input box as a quote":`在会话里选中文字时浮出「引用」按钮,点击把选中内容作为引用块放进输入框`,Quote:`引用`,"Quote into the input box":`引用到输入框继续对话`,"Quote · {{count}} lines":`引用 · {{count}} 行`,"Truncated · original {{count}} lines":`已截断,原文 {{count}} 行`,"Click to expand":`点击展开`,"Remove quote":`移除引用`,"Automatically unfold the thinking block while the model is still reasoning. It collapses again when reasoning ends.":`模型思考时自动展开推理内容;思考结束后仍自动收起`,"Context compaction strategy":`上下文压缩策略`,"Standard uses default compact. Smart compaction uses Enso verified summary at compact time. Codex native compaction additionally stores an official Codex checkpoint on Codex models and uses smart compaction otherwise. Continuous memory records observations in the background so compact keeps more context; all fall back to default compact on failure. Switching strategy takes effect on the next session. The summary model and compaction mode apply to open conversations on the next compaction.":`标准使用默认压缩。智能压缩在压缩时用 Enso 验证式摘要。Codex 原生压缩在 Codex 模型上额外保存官方 Codex checkpoint,其他模型按智能压缩处理。持续记忆在后台持续记录观察,压缩时保留更多上下文;失败都回退默认压缩。切换策略从下一个会话生效。摘要模型和压缩档位对已打开的对话在下一次压缩时用最新设置。`,Standard:`标准`,"Smart compaction":`智能压缩`,"Codex native compaction":`Codex 原生压缩`,"Continuous memory (experimental)":`持续记忆(实验性)`,"Summary model":`摘要模型`,"Background memory model":`后台记忆模型`,"Compaction mode":`压缩档位`,"Auto (by usage)":`自动(按占用)`,Fast:`快速`,Balanced:`均衡`,Thorough:`详尽`,"Mode changes summary budget and how much recent tail to keep. It does not decide whether compact runs.":`档位只影响摘要细致和留多长尾巴,不决定是否压缩。`,"Follows the session model":`跟随当前会话模型`,"Follow session model":`改跟会话模型`,"Selected model is unavailable — falls back to the session model.":`所选模型已不可用——将回退到当前会话模型。`,"Show read/grep/find/ls as one-line rows and fold consecutive tool calls while the agent is still running":`read/grep/find/ls 显示为单行,agent 运行中也折叠连续的工具调用`,"Auto-collapse previous turns":`自动折叠历史轮次`,"Collapse activity after reply":`回答完成后折叠过程`,"Collapse finished activity while replying":`过程中折叠已完成的调用`,"Wait before folding":`折叠前等待`,"Seconds to wait after tools and thinking finish":`工具和思考都结束后再等这么多秒`,sec:`秒`,"Pin unfinished todos":`固定显示未完成待办`,"Show active sessions in the title bar":`在顶栏显示活跃会话`,"Show active conversations as tabs above the conversation. Hold ⌘/Ctrl to see number shortcuts. Hidden while Bot mode is enabled.":`在对话区上方以标签显示活跃中的会话,按住 ⌘/Ctrl 显示数字快捷键。开启 Bot 模式时不显示。`,"Also show recent conversations":`同时显示最近会话`,"Remove from title bar":`移出顶栏`,"Conversations with messages within this window. Off shows only Active ones.":`这段时间内有过消息的会话;关闭则只显示活跃中的会话。`,"Turn marks":`轮次刻度`,"Marks along the conversation for each turn. Hover to preview, click to jump. Hidden when the chat uses the full width.":`对话旁边的轮次刻度。悬停预览,点击跳转。聊天铺满宽度时不显示。`,Left:`左`,Right:`右`,"Keep the latest todo list above the input while it has unfinished items, so it does not scroll away with the timeline":`最新任务清单还有未完成项时,固定显示在输入框上方,不随时间线滚走`,"Hide until the todo list updates":`隐藏,清单更新后再显示`,"When a reply finishes, fold consecutive thinking and tool calls (including edits and commands) into one summary row; failed calls stay visible":`回答结束后,把连续的思考和工具调用(包括编辑、命令)折成一行摘要;失败的调用仍单独显示`,"While a reply is still running, wait a moment after tools and thinking finish, then fold that stretch into one row. Calls still running stay visible, and failed calls stay visible":`回答还在进行时,工具和思考都结束后稍等片刻,把这一段折成一行。正在跑的调用不收,失败的调用仍单独显示`,"Worked for {{duration}}":`已工作 {{duration}}`,"Patrol clear":`巡检正常`,"Update seen":`已查看`,"Continue goal: {{summary}}":`继续目标:{{summary}}`,"Scheduled: {{summary}}":`定时:{{summary}}`,"Session updates":`会话更新`,"Session updates: {{summary}}":`会话更新:{{summary}}`,"{{count}} thinking steps":`{{count}} 段思考`,Activity:`过程`,"After you send a new message, fold earlier turns down to the question, timestamp and duration; the latest turn stays expanded":`发送新消息后,之前的轮次只保留提问、时间与用时;最后一轮保持展开`,"Notify only for the main agent":`仅主 agent 发送完成通知`,"Skip coworker completion and failure notifications on this computer and the paired phone. Questions and approvals still notify.":`coworker 的回合完成和失败不弹桌面或手机通知。提问和审批仍会提醒。`,"Stop if no output":`无输出则停止`,"Abort and retry the run when no tokens or tool results arrive for this long. Thinking counts as output.":`超过此时长没有 token 或工具结果就中止并重试。思考输出也算有输出。`,Never:`永不`,"{{count}} min":`{{count}} 分钟`,"Compaction reserve tokens":`压缩预留 token`,"Decision models only allow or block when highly confident. Everything else asks you.":`决策模型只在把握很高时才自动放行或拦截,其余都交给你审批。`,"The assistant approval classifier is unavailable.":`助手代审的决策模型不可用。`,"Auto-manage approvals":`全自动托管`,"Auto-allow threshold":`自动放行阈值`,"0.85 (looser)":`0.85(偏松)`,"0.9 (default)":`0.9(默认)`,"0.95 (stricter)":`0.95(偏严)`,"Only runs automatically when the allow probability reaches this value. Operations near the threshold may be allowed one time and not the next.":`放行概率达到该值才自动执行。概率在阈值附近的操作,可能这次放行、下次不放行。`,"Auto-managed: runs only when the decision model is highly confident it is safe. Everything else is denied and the agent tries another way. Protected actions still ask you.":`托管中:只有决策模型高度确信安全的操作才会执行,其余直接拒绝,由 AI 换一种做法继续。受保护操作仍会问你。`,"Auto-managed · allowed":`托管 · 已放行`,"Auto-managed · denied":`托管 · 已拒绝`,"Read-only":`只读`,"Regenerable output":`可再生成`,"Reversible workspace change":`工作区内可回退的改动`,"Possible data loss":`可能丢失数据`,"Changes system state":`改动系统状态`,"Sends data externally":`向外发送数据`,"Unclear target or intent":`目标或意图不明`,"Auto-managed review timed out. Please decide.":`托管判定超时,请你来决定。`,"Auto-managed review failed. Please decide.":`托管判定出错,请你来决定。`,"Auto-managed review returned no valid decision. Please decide.":`托管判定结果无效,请你来决定。`,"Compaction runs when context exceeds the model window minus this value. Larger values compact earlier. Do not set it close to the window of small-context models, or every request compacts first. Leave empty for the default.":`上下文超过「模型窗口 − 此值」时触发压缩,值越大压缩越早。小窗口模型请勿设得过大,接近窗口会导致每次请求前都先压缩。留空使用默认值。`,"Enter a whole number between {{min}} and {{max}}, or leave it empty.":`请输入 {{min}} 到 {{max}} 之间的整数,或留空。`,"Could not save. Check that pi-agent/settings.json is valid JSON.":`保存失败,请检查 pi-agent/settings.json 是否为合法 JSON。`,"Keep in Active after last message":`活跃中留存时长`,"Stays in Active for about {{count}} more min":`活跃中还会保留约 {{count}} 分钟`,"Viewed conversations stay in Active for this long after their last message or your last open while still in Active, then leave. Unviewed ones stay until you open them.":`从最后一条消息或在「活跃中」时最后一次点开算起,此时长内即使已查看也保留,超时后移出;未查看的仍保留到你点开。`,"Auto-retry on transient errors":`瞬态错误自动重试`,"Retry with backoff (up to 60s apart) after 429, 5xx or network errors. Quota and billing errors are never retried. Unlimited keeps retrying until you cancel.":`遇到 429、5xx 或网络错误时退避重试(间隔最长 60 秒)。额度与计费错误不重试。选「无限」会一直重试,直到手动取消。`,"Retry count after 429, 5xx or network errors; off, fixed count or unlimited":`429、5xx 或网络错误后的重试次数:关闭、固定次数或无限`,"Long prompt cache (1 hour)":`长缓存(1 小时)`,"Keep the prompt cache for 1 hour instead of 5 minutes. Saves a lot when turns are more than 5 minutes apart, since the cache no longer expires and gets rewritten every turn, but cache writes cost 2× instead of 1.25×, so rapid follow-ups tens of seconds apart cost more. Anthropic models only. Applies from the next request.":`把 prompt 缓存有效期从 5 分钟延长到 1 小时。轮次间隔超过 5 分钟时能省很多(缓存不再每轮过期重写),但缓存写入单价从 1.25× 涨到 2×,间隔几十秒的快速连续追问反而更贵。仅对 Anthropic 系模型生效,从下一次请求起生效。`,Unlimited:`无限`,"{{count}} times":`{{count}} 次`,"{{count}} day":`{{count}} 天`,"{{count}} days":`{{count}} 天`,"Archive idle conversations":`归档闲置会话`,"Move conversations that have been idle this long into Archived. Does not delete them.":`将闲置超过此天数的会话移入已归档,不会删除。`,"Clean up merged worktrees":`清理已合并 worktree`,"When archiving idle conversations, also remove isolated worktrees that are merged and clean.":`归档闲置会话时,一并清理已合并且干净的隔离 worktree。`,"Delete archived conversations after":`归档超过此天数后删除`,"Permanently delete conversations that have been archived longer than this. This cannot be undone. Choosing a positive value deletes already-overdue archived conversations immediately.":`永久删除归档超过此天数的会话,不可恢复。改成正数会立即删除已超期的归档。`,"No output for {{minutes}} minutes — retrying":`{{minutes}} 分钟没有输出,正在重试`,"Stopped after repeated stalls":`多次卡住后已停止`,"No file changes in this conversation yet.":`本会话还没有文件改动。`,"No changes relative to HEAD.":`相对 HEAD 没有改动。`,"Collapse all":`全部折叠`,"Expand all":`全部展开`,"Not a git repository.":`不是 git 仓库。`,"Git diff is not available for this workspace.":`当前工作区不支持 Git diff。`,"Terminal appearance":`终端外观`,"Theme mode":`主题模式`,"Background image":`背景图`,"Show a custom image behind the interface":`在界面背后显示自定义背景图`,"The current theme has its own background. Turn this on to replace it with your image.":`当前主题自带背景,开启后用你的图片替换`,"Source type":`来源类型`,"Single image":`单张图片`,"Folder (random)":`文件夹(随机)`,"Remote URL":`网络图片`,"Image path":`图片路径`,"Folder path":`文件夹路径`,"Image URL":`图片地址`,"Auto switch":`自动切换`,seconds:`秒`,"Refresh now":`立即刷新`,"Background visibility":`背景可见度`,"Composer opacity":`输入框不透明度`,"Border opacity":`边框不透明度`,"Code block opacity":`代码块不透明度`,Blur:`模糊`,Brightness:`亮度`,Saturation:`饱和度`,Overlay:`遮罩`,"Size mode":`填充方式`,Cover:`覆盖`,Contain:`完整显示`,Repeat:`平铺`,Center:`居中原图`,Search:`搜索`,"No results":`无匹配结果`,"Semantic similarity":`语义相似度`,"Preset is locked after the conversation starts":`对话开始后预设已锁定,不能中途替换`,Path:`路径`,"Welcome to EnsoCode":`欢迎使用 EnsoCode`,"Import your providers and assets from local AI apps to get started. You can skip any step.":`从本地 AI 应用导入模型服务与资源即可开始,每一步都可跳过。`,"Sign in with a provider subscription, or import API providers from local AI apps":`使用订阅账号登录,或从本地 AI 应用导入 API 服务`,"Import skills from Claude Code, Codex or Cursor":`从 Claude Code、Codex 或 Cursor 导入技能`,"Scan and import":`扫描并导入`,"{{count}} imported":`已导入 {{count}} 个`,"All set":`全部就绪`,"You can always import more from Settings later.":`之后随时可在设置里导入更多。`,Back:`上一步`,Skip:`跳过`,Next:`下一步`,"Get started":`开始`,Close:`关闭`,Minimize:`最小化`,Maximize:`最大化`,Restore:`还原`,"No new providers imported":`没有新导入的模型服务`,"Fetch models for each provider, then enable the ones you want.":`为每个模型服务拉取模型,再启用你需要的。`,"Fetch failed":`拉取失败`,"No models yet":`暂无模型,点击拉取`,"Bundle skills, MCP servers and an instruction file into a preset (optional)":`把技能、MCP 服务和一份指令组合成预设(可选)`,"Give subagents their own model, skills and MCP servers (optional)":`为子代理配置专属模型、技能与 MCP 服务(可选)`,"{{count}} presets":`已有 {{count}} 个预设`,"Model Providers":`模型中心`,"Automatically fetch models":`自动拉取模型`,"Model fetch interval":`拉取间隔`,"This interval applies when automatic fetching is enabled for this provider.":`开启此供应商的自动拉取后,按此间隔拉取模型。`,"Enter a whole number from {{min}} to {{max}} hours.":`请输入 {{min}}–{{max}} 小时之间的整数。`,hours:`小时`,"Last fetched {{time}}":`上次拉取成功:{{time}}`,"Last fetch failed {{time}}":`上次拉取失败:{{time}}`,"Manage model API providers for this app":`管理应用的模型 API 服务`,"Import from local apps":`从本地应用导入`,"Scan providers configured in local AI apps and import them.":`扫描本机 AI 应用中已配置的模型服务并导入。`,"Scanning local apps...":`正在扫描本地应用...`,"Scan failed":`扫描失败`,Rescan:`重新扫描`,"No local apps detected":`未检测到本地应用`,"Supported: Claude Code, Codex, CC Switch, Alma, Cherry Studio, Hermes, OpenClaw, Grok CLI, Cursor":`支持:Claude Code、Codex、CC Switch、Alma、Cherry Studio、Hermes、OpenClaw、Grok CLI、Cursor`,"No importable providers found":`未发现可导入的模型服务`,"Already exists":`已存在`,"{{count}} models":`{{count}} 个模型`,"{{count}} selected":`已选 {{count}} 项`,"Import selected":`导入所选`,Done:`完成`,"No providers yet":`暂无模型服务`,"Import providers from local apps or add one manually to get started":`从本地应用导入或手动添加模型服务以开始使用`,"Add provider":`添加服务`,"Add Provider":`添加模型服务`,"Subscription login":`订阅登录`,"Sign in with provider subscriptions (SuperGrok, Claude Pro, ChatGPT, etc.)":`使用订阅账号登录(SuperGrok、Claude Pro、ChatGPT 等)`,"Add account":`添加账号`,"{{count}} accounts":`{{count}} 个账号`,"Log out":`退出登录`,"Starting login...":`正在启动登录…`,"Complete authorization in your browser":`请在浏览器中完成授权`,"Open authorization page":`打开授权页面`,"Enter code":`输入代码`,"Verifying...":`正在验证…`,"resets {{time}}":`{{time}} 重置`,Submit:`提交`,"Edit Provider":`编辑模型服务`,Name:`名称`,"API Type":`API 类型`,"Base URL":`Base URL`,"API Key":`API Key`,Models:`模型`,"Add a model id":`添加模型 ID`,"Filter models...":`筛选模型...`,"Filter skills...":`筛选技能...`,"Filter MCP servers...":`筛选 MCP...`,"Filter projects...":`筛选项目...`,"No models match":`没有匹配的模型`,"Enable all":`全部启用`,"Disable all":`全部禁用`,Enable:`启用`,Disable:`禁用`,"Select all":`全选`,"Deselect all":`全不选`,"{{enabled}}/{{total}} enabled":`已启用 {{enabled}}/{{total}}`,"Fetch models":`拉取模型`,"Fetch all models":`拉取全部模型`,"Refresh model info":`刷新模型信息`,"Refresh all models and info":`拉取全部模型与模型信息`,"Model info updated":`模型信息已更新`,"Model info refresh failed, using cache":`模型信息刷新失败,仍使用缓存`,"Model info refresh failed":`模型信息刷新失败`,"Fetched {{count}} providers":`已拉取 {{count}} 个模型服务`,"{{ok}} succeeded, {{failed}} failed":`{{ok}} 个成功,{{failed}} 个失败`,"Sync failed ({{failed}})":`同步失败({{failed}} 个)`,"Skipped {{count}} disabled providers":`已跳过 {{count}} 个未启用的模型服务`,"No enabled providers to sync":`没有已启用的模型服务可同步`,"Test connection":`测试连接`,Authorize:`授权`,Authorizing:`授权中...`,"Revoke authorization":`取消授权`,Connecting:`连接中`,"Not authorized":`未授权`,"Authorized, pending connection":`已授权,待连接`,"Authorized. Conversations that already include this server can use it on the next message.":`已授权。已包含该服务器的对话,下一条消息即可使用。`,"New sessions only":`新会话生效`,"Open sessions keep the previous setting; it applies once you start a new session.":`已打开的会话保持原设置,新建会话后生效。`,"Settings without this tag take effect immediately.":`没有此标签的设置修改后立即生效。`,"Isolated sandbox switches between script and tool-search mode, so open sessions keep the mode they started with.":`隔离沙箱决定会话用脚本模式还是工具检索模式,已打开的会话保持启动时的模式。`,"The / menu updates right away, but open sessions keep the skills they loaded. Start a new session to load the change.":`输入框的 / 菜单会立即更新,但已打开的会话仍使用原来加载的技能,新建会话后才会加载改动。`,"The file panel and terminal use the change right away. Agents in open sessions keep the previous connection settings.":`文件面板和终端立即使用新配置;已打开会话里的代理仍使用原来的连接配置。`,"Newly enabled models can be picked right away. After changing a key or address, an open session uses it once you switch its model or start a new session.":`新启用的模型可以立即选用;修改 API Key 或地址后,已打开的会话需切换一次模型或新建会话才会使用。`,"Always loaded":`常驻`,"On demand":`按需`,"Load mode":`加载方式`,"On demand: tool descriptions are not preloaded into context; the model connects through the mcp tool when needed. Suits servers with many or rarely used tools. Takes effect in new conversations.":`按需:不预先把工具说明放进上下文,模型用到时经 mcp 工具连接;适合工具多、不常用的 server。新会话生效。`,"{{count}} tools":`{{count}} 个工具`,Fetching:`拉取中...`,Testing:`测试中...`,"Fetched {{count}} models":`拉取到 {{count}} 个模型`,"Connected ({{ms}}ms)":`连接成功({{ms}}ms)`,"Connection failed":`连接失败`,Cancel:`取消`,"Confirm exit":`确认退出`,"Exit closes the app completely, so your phone can no longer connect. Minimize to tray keeps the app running in the background so your phone can still connect.":`退出会完全关闭应用,手机将无法连接。最小化到托盘后应用会在后台继续运行,手机仍可连接。`,"Minimize to tray":`最小化到托盘`,Exit:`退出`,"Add a provider subscription or API Key, or import providers from local AI apps":`添加提供商订阅或 API Key,也可从本地 AI 应用导入模型服务`,"Add model or provider":`添加模型 / 提供商`,"Import providers from local apps or use the unified setup to get started":`从本地应用导入模型服务,或使用统一向导开始配置`,"Choose a provider first. You will select subscription or API Key next.":`请先选择提供商,下一步再选择订阅或 API Key。`,"Choose how to connect":`选择连接方式`,Subscription:`订阅`,"Provider subscription":`提供商订阅`,"ChatGPT (PI login)":`ChatGPT(PI 登录)`,"Sign in in your browser and use your subscription account.":`在浏览器中登录并使用订阅账号。`,"Configure an endpoint and key, then fetch or test its models.":`配置端点和密钥后,再拉取或测试模型。`,"Authorization failed":`授权失败`,"Authorizing {{provider}}":`正在授权 {{provider}}`,"Enter this code in your browser":`请在浏览器中输入此代码`,"Enter the code in your browser":`请在浏览器中输入代码`,"Open authorization page again":`重新打开授权页面`,"Cancel authorization":`取消授权`,"Subscription authorization":`订阅授权`,"No subscription account connected":`尚未连接订阅账号`,"Authorize this provider to add its available models.":`授权此提供商,以添加其可用模型。`,"Connect subscription":`连接订阅`,"Add another account":`添加其他账号`,"Import from Codex":`从 Codex 导入`,"Codex login not found. Sign in to Codex Desktop or CLI first.":`未找到 Codex 登录态,请先在 Codex Desktop 或 CLI 中登录。`,"Codex is not signed in with a ChatGPT account.":`Codex 未使用 ChatGPT 账号登录。`,"This ChatGPT account is already connected.":`该 ChatGPT 账号已连接。`,"Resets {{time}}":`{{time}} 后重置`,Local:`本地`,"Default model":`默认模型`,"Used for new conversations.":`用于普通新对话。`,"Follow last selection":`跟随最后一次选择`,"New conversations use the last model you picked.":`新对话使用你上次选择的模型。`,"Used for new conversations in this project.":`用于本项目的新对话。`,"Used for new conversations in this group.":`用于本组的新对话。`,"Project settings":`项目设置`,"Default model for {{name}}":`{{name}} 的默认模型`,"Follows group, then global default":`跟随分组默认,再跟随全局默认`,"Follows the global default":`跟随全局默认`,"Follow global built-in tools":`跟随全局内置工具`,"When off, configure built-in tools for this project. They override the global setting on the next session.":`关闭后可为本项目单独配置内置工具,优先级高于全局,下次会话生效。`,"Session choice overrides the project default.":`会话里手动选的模型优先于项目默认。`,"Conversation title summary":`会话标题总结`,"Generate a short AI title from the first message of a new conversation.":`新会话发出首条消息后,用 AI 自动生成简短标题。`,"Follows the default model":`跟随默认模型`,"Follow default model":`改跟默认模型`,"Use the default model":`使用默认模型`,"Summarizing title":`标题总结中`,"Title summary failed":`标题总结失败`,"Click to retry":`点击重试`,"Selected model is unavailable — falls back to the default model.":`所选模型已不可用——将回退到默认模型。`,"No default model":`未设置默认模型`,"No usable models":`没有可用模型`,"Image generation":`生图模型`,"Default image generation model":`默认生图模型`,"Selected image generation model is unavailable":`所选生图模型不可用,请检查模型标记、启用状态和 API Key。`,"Generate images with the configured image model and save them to the session scratch directory":`使用默认生图模型生成图片,并保存到会话专属目录。`,"No image generation models available":`没有可用的图像生成模型`,"Enable a model and configure valid provider credentials first.":`请先启用模型并配置有效的提供商凭证。`,"Default model changed: {{previous}} → {{next}}":`默认模型已更改:{{previous}} → {{next}}`,"Subscription credentials are loading. API-key models remain available.":`正在加载订阅凭证,API Key 模型仍可使用。`,"Subscription credentials could not be loaded: {{error}}":`无法加载订阅凭证:{{error}}`,"Subscription credentials are loading. Choose an API-key model or wait, then retry.":`正在加载订阅凭证。请选择 API Key 模型,或等待加载完成后重试。`,"Subscription credentials could not be loaded. Choose an API-key model or retry the credential refresh.":`无法加载订阅凭证。请选择 API Key 模型,或重新加载凭证。`,"Choose a model for this conversation or set a global default before sending.":`发送前请为此对话选择模型,或设置全局默认模型。`,"Choose a model for this conversation or set a project, group, or global default before sending.":`发送前请为此对话选择模型,或设置项目、分组或全局默认模型。`,"No usable model is available. Configure provider credentials and enable a model first.":`没有可用模型。请先配置提供商凭证并启用模型。`,Agent:`Agent`,Agents:`Agent`,File:`文件`,Files:`文件`,Folder:`文件夹`,"Open a file from the tree.":`从左侧树打开文件。`,"This file is too large to open in the editor.":`文件太大,无法在编辑器中打开。`,"This file changed on disk.":`磁盘上的文件已更改。`,Reload:`重新加载`,"Send to conversation":`发送到对话`,"New File":`新文件`,"New Folder":`新建文件夹`,"Copy Path":`复制路径`,"Copy Relative Path":`复制相对路径`,"View File":`查看文件`,"Open in Browser":`在浏览器中打开`,"Open Markdown Preview":`打开 Markdown 预览`,"View Source":`查看源码`,"Reveal in Finder":`在访达中显示`,"Open in Finder":`在访达中打开`,"Open in File Explorer":`在资源管理器中打开`,"Open in File Manager":`在文件管理器中打开`,Editors:`编辑器`,Terminals:`终端`,"Open Containing Folder":`打开所在文件夹`,"Reveal in File Explorer":`在资源管理器中显示`,"This file is outside the workspace and was not written by this conversation. Show it anyway?":`该文件在工作区外,且不是本会话写入的。仍要在文件管理器中显示吗?`,"A file or folder with that name already exists.":`已存在同名文件或文件夹。`,"Invalid name.":`名称无效。`,"Could not complete the file action.":`无法完成该文件操作。`,"Search needs ripgrep (rg). Install it and make sure it is on PATH.":`搜索依赖 ripgrep(rg):请安装并确保它在 PATH 里。`,"Search timed out. Try a more specific query or a smaller folder.":`搜索超时,请换更具体的关键词或缩小目录范围。`,"Could not open local file link":`无法打开本地文件链接`,"The link is outside the current workspace.":`链接位于当前工作区之外。`,"This link is not available on the local computer.":`此链接不在本机工作区中,无法打开。`,"The linked file or folder is unavailable.":`链接的文件或文件夹不可用。`,"Delete {{name}} permanently?":`永久删除 {{name}}?`,"Close others":`关闭其他`,"Close tabs to the right":`关闭右侧标签页`,"Close saved":`关闭已保存`,"Close all":`关闭所有`,"Force close others":`强制关闭其他`,"Force close all":`强制关闭所有`,"Unsaved changes":`未保存的更改`,"This file has unsaved changes. Close anyway?":`此文件有未保存的更改,仍要关闭吗?`,"Some files have unsaved changes. Close anyway?":`有文件未保存,仍要关闭吗?`,Chat:`会话`,Chats:`过去会话`,"Remove chat reference":`移除会话引用`,"Mention suggestions":`提及建议`,"Command suggestions":`命令建议`,"Plugin suggestions":`插件建议`,"Plugin is not enabled":`插件未启用`,Configure:`配置`,"Set (leave blank to keep)":`已设置(留空保持不变)`,"Not set":`未设置`,"Clear value":`清除`,"Saved. New calls use it right away.":`已保存,新的调用立即生效。`,"Host MCP tools it may call":`可调用的宿主 MCP 工具`,"Type @ to choose a file or Agent":`输入 @ 选择文件或 Agent`,Recipient:`接收者`,"Remove Agent recipient":`移除 Agent 接收者`,"Message the selected Agent…":`向所选 Agent 发送消息…`,"Send only to the selected Agent":`仅发送给所选 Agent`,Send:`发送`,"Create or select a project to start a conversation":`创建或选择一个项目以开始对话`,"Compact view":`精简版`,"The built-in browser is not available in full view. Check it on the computer.":`完整版暂不支持内置浏览器,请在电脑上查看。`,Locked:`已锁定`,"This Agent name is reserved":`此 Agent 名称为系统保留名称`,"Fast read-only recon; returns compressed findings":`快速只读调研,返回精简结论`,"Implements a self-contained coding subtask end to end":`端到端实现自包含编码子任务`,"Reviews code or diffs; read-only, returns prioritized issues":`只读审查代码或差异,并按优先级返回问题`,"Dispatched to":`已派发给`,"From plugin {{name}}":`来自插件 {{name}}`,Completed:`已完成`,Failed:`失败`,succeeded:`已成功`,denied:`已拒绝`,running:`进行中`,done:`已完成`,failed:`失败`,unavailable:`不可用`,cancelled:`已取消`,"The conversation binding expired. Retry.":`对话绑定已过期,请重试。`,"The selected Agent type is no longer available.":`所选 Agent 类型已不可用。`,"Model credentials could not be verified.":`无法验证模型凭证。`,"The parent model is unavailable.":`父会话模型不可用。`,"The Agent type is unavailable.":`Agent 类型不可用。`,"Coworker limit reached (active or reserved).":`已达到容量上限(正在运行或已预留的 coworker)。`,"Failed to spawn parent container.":`无法启动父会话容器。`,"Failed to spawn child Agent.":`无法启动子 Agent。`,"Agent worker exited before ready.":`Agent worker 在就绪前退出。`,"Agent session was rejected before ready.":`Agent 会话在就绪前被拒绝。`,"Agent session ready handshake timed out.":`Agent 会话就绪握手超时。`,"Parent ready model did not match the bound model.":`父会话就绪模型与绑定模型不匹配。`,"Child ready identity mismatch.":`子 Agent 就绪身份不匹配。`,"Child ready profile or model mismatch.":`子 Agent 就绪配置或模型不匹配。`,"Failed to prompt child Agent.":`无法向子 Agent 发送任务。`,"Failed to record dispatch.":`无法记录派发结果。`,Target:`目标`,Provider:`提供商`,Account:`账号`,Coworker:`队员`,"Could not load subscription providers":`无法加载订阅提供商`,Save:`保存`,Skills:`技能`,Skill:`技能`,"Skills registered by reference; files stay in their original location":`以引用方式登记,文件仍留在原应用目录`,"No skills yet":`暂无技能`,"Import skills from Claude Code, Codex or Cursor to get started":`从 Claude Code、Codex 或 Cursor 导入技能以开始使用`,"Import skills from local apps":`从本地应用导入技能`,"MCP Servers":`MCP 服务器`,"Model Context Protocol servers available to this app":`应用可用的 MCP 服务器`,"No MCP servers yet":`暂无 MCP 服务器`,"Import MCP servers configured in local AI apps":`导入本机 AI 应用中已配置的 MCP 服务器`,"Import MCP servers from local apps or add one manually to get started":`从本地应用导入或手动添加 MCP 服务器以开始使用`,"Add MCP server":`添加 MCP`,"Add MCP Server":`添加 MCP 服务器`,"Edit MCP Server":`编辑 MCP 服务器`,Transport:`传输方式`,Command:`命令`,"Arguments (one per line)":`参数(每行一条)`,"Environment variables (KEY=VALUE, one per line)":`环境变量(KEY=VALUE,每行一条)`,"Headers (Name: value, one per line)":`请求头(Name: value,每行一条)`,URL:`URL`,"Connection timeout (seconds)":`连接超时(秒)`,"Tool call timeout (seconds)":`工具调用超时(秒)`,"Description (optional)":`描述(可选)`,"One line telling the model what this server is for":`一句话告诉模型这个服务器的用途`,"OAuth client name (optional)":`OAuth 客户端名称(可选)`,"For servers that only accept known OAuth clients":`用于只接受已知 OAuth 客户端的服务器`,"OAuth authorization server metadata URL (optional)":`OAuth 授权服务器元数据地址(可选)`,"Use when the server advertises a wrong authorization server or none":`服务器声明的授权服务器不对或没有声明时填写`,"This MCP server already exists":`该 MCP 服务器已存在`,"Import MCP servers":`导入 MCP 服务器`,Form:`表单`,JSON:`JSON`,"JSON configuration":`JSON 配置`,Format:`格式化`,"Format failed: {{error}}":`格式化失败:{{error}}`,"Generated code is already formatted":`设计器生成的代码已是规范格式`,"Invalid JSON":`JSON 格式错误`,"No MCP servers found in JSON":`JSON 中没有有效的 MCP 服务器`,"JSON must describe a single MCP server":`JSON 只能描述一台 MCP 服务器`,"JSON must describe a single MCP server to switch to the form":`切回表单时 JSON 只能描述一台 MCP 服务器`,"Paste a server object or mcpServers JSON from Cursor / Claude Desktop":`可粘贴单台配置,或 Cursor / Claude Desktop 的 mcpServers JSON`,"Scan local AI apps and register the entries you want to reuse.":`扫描本机 AI 应用,登记你想复用的条目。`,"Nothing importable found":`未发现可导入的条目`,"{{count}} env vars":`{{count}} 个环境变量`,"Imported {{count}} entries":`已导入 {{count}} 项`,"Instruction Files":`指令文件`,Phone:`手机`,"Use your phone as a second screen. Keep this app running.":`把手机当作第二块屏幕。需保持本应用运行。`,"Pair a phone":`配对手机`,"Cancel pairing":`取消配对`,"Failed to start pairing":`发起配对失败`,"Scan with your phone camera":`用手机相机扫码`,"The code expires in 60 seconds and can only be used once.":`配对码 60 秒后失效,且只能使用一次。`,"Pairing QR code":`配对二维码`,"Expires in {{seconds}}s · single use":`{{seconds}} 秒后失效 · 仅可用一次`,"Code expired":`配对码已失效`,"Scanning opens the app and pairs it. To keep it handy, add it to your home screen.":`扫码即可打开并完成配对。想常用的话,打开后添加到主屏幕。`,"Paired devices":`已配对设备`,"No paired devices":`暂无已配对设备`,"Pair a phone to view sessions and reply on the go.":`配对手机后即可随时查看会话并回复。`,"Secure storage is unavailable on this system, so pairing keys are stored unencrypted.":`当前系统不支持安全存储,配对密钥将以未加密方式保存。`,"Waiting for phone":`等待手机`,Online:`在线`,Offline:`离线`,"Relay server":`中继服务器`,"The relay only forwards encrypted frames and cannot read your messages.":`中继只转发密文,无法读取你的消息内容。`,"Global CLAUDE.md / AGENTS.md style files from local AI tools":`本机 AI 工具的全局 CLAUDE.md / AGENTS.md 类文件`,"No instruction files yet":`暂无指令文件`,"Only one file is active at a time; enabling one disables the others":`同一时间仅一份生效(注入会话);启用一份会自动关闭其余`,"Import global instruction files configured in local AI tools":`导入本机 AI 工具中已配置的全局指令文件`,"Import instruction files from local apps or add one manually to get started":`从本地应用导入或手动添加指令文件以开始使用`,"Add instruction":`添加指令`,"Add Instruction":`添加指令文件`,"An instruction with this name already exists":`已有同名指令文件`,"Import instruction files":`导入指令文件`,"Same content":`内容相同`,"Same name":`同名`,"Edit Instruction":`编辑指令文件`,Content:`内容`,"Loading...":`加载中...`,Linked:`链接`,"Local copy":`本地副本`,"Local copy — edits stay in this app.":`本地副本 —— 修改只保存在应用内。`,"Write back to original file":`直接修改原文件`,"Saving creates a local copy — {{path}} is left untouched, and this entry stops following its updates.":`保存后会复制一份到应用内 —— {{path}} 不会被改动,此条目也将不再跟随其更新。`,"Saving overwrites {{path}} directly — {{source}} will pick up the change.":`保存会直接覆盖 {{path}} —— {{source}} 会随之生效。`,"Overwrite original":`覆盖原文件`,"Save as local copy":`保存为本地副本`,"Failed to read content":`读取内容失败`,"Failed to save":`保存失败`,Model:`模型`,"Working directory":`工作目录`,"Ask the agent…":`想让 agent 做什么…`,"Thinking…":`思考中…`,"Thought process":`思考过程`,"Collapse thinking":`收起思考过程`,"Thought for {{duration}}":`思考了 {{duration}}`,"Working…":`生成中…`,"Map the project":`梳理项目结构`,"Entry points, modules and key dependencies":`入口、模块划分与关键依赖`,"Walk me through this project's structure: entry points, module layout and key dependencies.":`梳理一下这个项目的结构:入口、模块划分和关键依赖。`,"Find potential issues":`排查潜在问题`,"Suspicious logic and unhandled edge cases":`找出可疑逻辑与未处理的边界情况`,"Review this project for potential bugs, suspicious logic and unhandled edge cases, and list them by severity.":`检查这个项目里的潜在 bug、可疑逻辑和未处理的边界情况,按严重程度列出来。`,"Add unit tests":`补充单元测试`,"Cover the core modules with tests":`为核心模块补上测试`,"Find the core modules that lack tests and add unit tests for them.":`找出缺少测试的核心模块,并为它们补充单元测试。`,"Summarize recent changes":`总结最近改动`,"A digest based on git log":`基于 git log 生成变更摘要`,"Summarize the recent changes in this repository based on git log.":`根据 git log 总结这个仓库最近的改动。`,"Loading Mermaid diagram...":`加载 Mermaid 图表...`,"Mermaid render error":`Mermaid 渲染错误`,"Mermaid render failed":`Mermaid 渲染失败`,"Mermaid preview":`Mermaid 预览`,"Zoom in":`放大`,"Zoom out":`缩小`,"Reset zoom":`重置缩放`,"Fit to original size":`适应初始大小`,"View fullscreen":`全屏查看`,"Exit fullscreen":`退出全屏`,"Export SVG":`导出 SVG`,"Export PNG":`导出 PNG`,"Diagram is too large for PNG, exported SVG instead":`图太大,无法导出 PNG,已改为导出 SVG`,"PNG export failed, exported SVG instead":`PNG 导出失败,已改为导出 SVG`,Projects:`项目`,All:`全部`,Ungrouped:`未分组`,"New group":`新建分组`,"Edit group":`编辑分组`,"All groups":`全部分组`,"Search in {{group}}...":`在「{{group}}」中搜索...`,"Delete group":`删除分组`,"No color":`无颜色`,"Project group":`项目组`,Alias:`别名`,"Shown in the sidebar instead of the folder name. Leave blank to reset.":`在侧边栏代替目录名显示,留空则恢复默认。`,"Groups organize projects in the sidebar.":`用分组整理侧栏里的项目。`,"Move projects into this group":`选择要移入的项目`,"Move to group":`移动到分组`,"Open folder":`打开文件夹`,Emoji:`表情符号`,"Add project":`添加项目`,"Adding...":`正在添加...`,"Add a project to start":`添加一个项目开始`,"Temporary chats":`临时会话`,"Drop shelf":`拖放浮窗`,Secretary:`秘书`,"A global agent that watches your projects and sessions, creates sessions to do the work, and reports results back to you.":`一个全局 Agent:替你查看各项目与会话的进展,创建普通会话派活,并把结果回报给你。`,"When you drag files in Finder, a small panel appears at the top right of the screen. Drop them on it to reference them in the current conversation, or drop folders to open them as projects, even when EnsoCode is minimized or in the tray.":`在访达中拖动文件时,屏幕右上角会出现一个小浮窗:把文件拖到上面即可引用到当前会话,拖文件夹还可选择作为项目打开;EnsoCode 最小化或在托盘时同样可用。`,"Drop here to add to the conversation":`拖到这里,添加到会话`,"Reference files in the current conversation":`松手即可引用到当前会话`,"Reference as files":`作为文件引用`,"Opening project":`正在打开项目`,"Opening {{count}} projects":`正在打开 {{count}} 个项目`,"Added 1 file":`已添加 1 个文件`,"Added {{count}} files":`已添加 {{count}} 个文件`,"{{name}} and more":`{{name}} 等`,"Start a temporary chat":`开始临时会话`,"Chats that are not tied to a project. Tools follow your global settings.":`不挂项目的会话。工具跟随全局设置。`,"Add a local directory as the conversation working folder.":`把本地目录加为对话的工作目录。`,"Type a path or select from recent projects...":`输入路径或从最近项目中选择...`,"Local directory":`本地目录`,"Remote (SSH)":`远程(SSH)`,"SSH host":`SSH 主机`,"user@host or an alias from ~/.ssh/config":`user@host 或 ~/.ssh/config 里的别名`,"Remote directory":`远端目录`,Up:`上级`,"Use this directory":`选择此目录`,"No subdirectories":`没有子目录`,"Invalid folder name.":`文件夹名称无效。`,"Folder name":`文件夹名称`,"Failed to list remote directory.":`远程目录列取失败。`,"Requires key-based SSH access. Tools run on the remote host; chat history stays local.":`需要免密钥 SSH 访问。工具在远端主机执行,聊天记录保存在本地。`,"Tools run on the remote host; chat history stays local.":`工具在远端主机执行,聊天记录保存在本地。`,"SSH connection":`SSH 连接`,"Select an SSH connection":`选择 SSH 连接`,"Add an SSH connection in Settings first.":`请先在设置里添加 SSH 连接。`,SSH:`SSH`,Usage:`用量`,"Token usage across all local sessions; cost is estimated from catalog prices.":`统计本机全部会话的 Token 用量;费用按目录单价估算,可在下方覆盖。`,Today:`今天`,"7D":`7 天`,"30D":`30 天`,"90D":`90 天`,"Estimated cost":`预估费用`,"Total tokens":`总 Token`,"Input tokens":`输入 Token`,"Output tokens":`输出 Token`,"Cache tokens":`缓存 Token`,"Active time":`活跃时长`,Sessions:`会话数`,Messages:`消息数`,"Daily trend":`每日趋势`,Input:`输入`,Cache:`缓存`,Token:`Token`,Cost:`费用`,"Activity by hour":`分时活跃`,Less:`少`,More:`多`,Sun:`周日`,Mon:`周一`,Tue:`周二`,Wed:`周三`,Thu:`周四`,Fri:`周五`,Sat:`周六`,"By model":`按模型`,"By project":`按项目`,"By member":`按成员`,"Last 7 days":`近 7 天`,"Last 30 days":`近 30 天`,"Daily budget":`每日预算`,"Cost (USD), empty = unlimited":`成本(美元),留空不限`,"Daily cost limit (USD)":`每日成本上限(美元)`,"Tokens, empty = unlimited":`Token 数,留空不限`,"Daily token limit":`每日 Token 上限`,"Resets at local midnight. Once reached, new messages to this member are refused and a running reply is stopped.":`按本地时间零点重置。用完后新消息会被拒绝,正在进行的回复会被停止。`,"Today's budget is used up":`今日预算已用完`,"Budget must be a positive number":`预算必须是正数`,"Delegation time limit (minutes)":`委派时限(分钟)`,"Empty = 240":`留空 = 240`,"When other members delegate to this one, the task fails with a timeout after this long. A delegator can ask for less, not more.":`其他成员委派给该成员时,超过这个时长未完成即判超时失败。发起方只能要求更短,不能更长。`,"Check the per-turn token limit and delegation time limit":`请检查单回合 Token 上限(正整数)与委派时限(1–1440 的整数分钟)`,"Per-turn token limit":`单回合 Token 上限`,"A single reply that uses more tokens than this (counted while streaming) is stopped.":`单次回复(流式累计)用量超过该值即被停止。`,"Stopped: the member's per-turn token limit was exceeded.":`已停止:超出成员的单回合 Token 上限。`,"This member's daily budget is used up. Try again tomorrow or raise the budget.":`该成员今日预算已用完,请明天再试或调高预算。`,"Over budget":`超出预算`,"The member's daily budget is used up.":`成员今日预算已用完。`,Budget:`预算`,"{{name}}'s budget for today is used up":`{{name}} 今日预算已用完`,"Daily cost limit reached. New messages are refused until local midnight.":`已达每日成本上限,本地时间零点前新消息会被拒绝。`,"Daily token limit reached. New messages are refused until local midnight.":`已达每日 Token 上限,本地时间零点前新消息会被拒绝。`,"No usage in this period":`该周期内没有用量`,"Top {{count}} of {{total}}":`共 {{total}} 项,显示前 {{count}} 项`,"{{total}} items":`共 {{total}} 项`,"(no project)":`(无项目)`,"No catalog price for: {{models}}. Their cost is not included.":`以下模型无目录单价:{{models}},其费用未计入。`,"Unit prices":`单价`,"Rates used for cost estimates ($/M tokens).":`费用估算用的单价($/百万 tokens)。`,"Show all":`显示所有`,"Show all {{count}} lines":`显示全部 {{count}} 行`,"Raw text":`原文`,"Search table":`搜索表格`,"No matching models":`没有匹配的模型`,"Model id":`模型 id`,"Enter a model id and non-negative rates.":`请填写模型 id 和非负单价。`,Reset:`重置`,Refresh:`刷新`,"Saved hosts for remote projects. Passwords stay in the system keychain.":`远程项目用的主机。密码保存在系统钥匙串。`,"Add connection":`添加连接`,"No SSH connections yet":`还没有 SSH 连接`,"SSH timeout":`SSH 超时`,"Time limit for connection tests, loading remote AGENTS.md, remote folder browsing and file panel actions. Agent tool commands are not affected.":`连接测试、读取远端 AGENTS.md、浏览远程目录和文件面板操作的超时时间。不影响 Agent 工具执行的命令。`,"Add SSH connection":`添加 SSH 连接`,"Edit SSH connection":`编辑 SSH 连接`,"Key / agent":`密钥 / agent`,Password:`密码`,Authentication:`认证方式`,"User (optional)":`用户(可选)`,"Port (optional)":`端口(可选)`,Host:`主机`,Test:`测试`,"SSH connection succeeded":`SSH 连接成功`,"Unknown SSH host":`未知 SSH 主机`,"Trust this host and add its key to known_hosts?":`信任此主机并把密钥写入 known_hosts?`,Trust:`信任`,"Could not save host key.":`无法保存主机密钥。`,"Password (leave blank to keep)":`密码(留空则保持原密码)`,"Failed to add project":`添加项目失败`,"Failed to add project.":`添加项目失败。`,"New project":`新建项目`,"Only folders can be added as projects":`只能将文件夹添加为项目`,"At most {{count}} folders can be added at once":`一次最多添加 {{count}} 个文件夹`,"Release to add":`松开以添加`,"Open as project":`作为项目打开`,"Add {{count}} projects":`将添加 {{count}} 个项目`,"Add all":`全部添加`,"Add to current conversation":`添加到当前会话`,"Open a conversation to add files":`请先打开一个会话再添加文件`,Browse:`浏览`,"No matching projects found":`没有匹配的项目`,Add:`添加`,"New conversation":`新对话`,"Local workspace":`本地工作区`,"Workspace moved to an isolated worktree":`工作区已迁移到隔离 worktree`,"Workspace fell back to the main working tree":`工作区已回退到主工作树`,"Work directly in the main working tree":`直接在主工作树里工作`,"Run this session on its own git worktree":`让这个会话在独立的 git worktree 里运行`,"Move to worktree":`切到隔离 worktree`,"Failed to move to worktree":`切到隔离 worktree 失败`,"Move to project…":`移动到项目…`,"Add to project…":`添加到项目…`,"Failed to move conversation":`移动会话失败`,"Cannot move a running conversation":`运行中的会话不能移动`,"Cannot move while its worktree is in use":`会话的 worktree 正在使用,暂不能移动`,"Secretary conversations cannot be moved":`秘书会话不能移出秘书`,"Import conversations from another project…":`导入其他项目的会话…`,"Import conversations from another project":`导入其他项目的会话`,"Pick a project. All of its conversations, archived ones included, are brought into {{name}}.":`选择一个项目,它的全部会话(含已归档)将导入到 {{name}}。`,"Move to this project":`移动到此项目`,"Copy to this project":`复制到此项目`,"The conversations leave the original project and show up only here. Session files stay as they are; nothing is copied or deleted.":`会话从原项目移到这里,原项目中不再显示。会话记录文件原样保留,不复制也不删除。`,"The original project keeps its conversations unchanged; this project gets an independent copy.":`原项目中的会话原样保留,此项目得到一份独立的副本。`,"The source project folder no longer exists, so moving is preselected.":`源项目的目录已不存在,默认选择移动。`,"Already copied here {{count}} times. Copying again adds another independent copy.":`已复制到此项目 {{count}} 次,再次复制会再生成一份独立副本。`,"Copy here":`复制到此项目`,"Moving…":`正在移动…`,"Copying…":`正在复制…`,"Copied {{count}} conversations":`已复制 {{count}} 个会话`,"Copied {{moved}} conversations; {{count}} running ones were not copied":`已复制 {{moved}} 个会话,{{count}} 个运行中的会话未复制`,"Failed to remove project":`移除项目失败`,"The old project has no conversations left. Remove it from the list?":`旧项目已经没有会话了,要从列表中移除吗?`,'"{{name}}" is only removed from the EnsoCode list. Its folder and files on disk are not deleted.':`只会把「{{name}}」从 EnsoCode 列表中移除,磁盘上的目录和文件不会被删除。`,"Move here":`移动到此项目`,"No other projects":`没有其他项目`,"{{count}} conversations":`{{count}} 个会话`,"Failed to import conversations":`导入会话失败`,"Imported {{count}} conversations":`已导入 {{count}} 个会话`,"No conversations to import":`没有可导入的会话`,"Imported {{moved}} conversations; {{count}} running or busy ones stay in the original project":`已导入 {{moved}} 个会话,{{count}} 个运行中或占用中的会话留在原项目`,"Main working tree has uncommitted changes":`主工作树有未提交改动`,"The new worktree branches off HEAD, so those changes stay in the main working tree and will not follow this session.":`新 worktree 从 HEAD 切出,这些改动会留在主工作树,不会跟随本会话。`,"Move anyway":`仍然切换`,"Clean up worktree":`清理 worktree`,"Clean up worktree?":`清理 worktree?`,"Failed to clean up worktree":`清理 worktree 失败`,"Reload conversation":`重新读取会话`,"Failed to reload conversation":`重新读取会话失败`,"Restart conversation (reload settings)":`重启会话(重新加载配置)`,"Failed to restart conversation":`重启会话失败`,"Clean up":`清理`,"Archive session and clean up worktree?":`归档会话并清理 worktree?`,"Pending work: {{warning}}. This session returns to the main working tree. The worktree directory and uncommitted changes are removed only when no other sessions use it. The branch is kept.":`待处理工作:{{warning}}。本会话将回退主工作树。仅在没有其他会话使用此 worktree 时,才删除目录及未提交改动;分支会保留。`,"uncommitted changes will be lost":`未提交改动将丢失`,"{{n}} unmerged commits (branch is kept)":`{{n}} 个未合并提交(分支会保留)`,"Pending work: {{warning}}. This conversation will be removed. Its worktree directory and uncommitted changes are removed only when no other sessions use it. The branch is kept.":`待处理工作:{{warning}}。本会话将被移除。仅在没有其他会话使用此 worktree 时,才删除目录及未提交改动;分支会保留。`,"Isolated worktree":`隔离 worktree`,"New isolated worktree":`新建隔离 worktree`,"Existing worktrees":`已有 worktree`,"New conversation in this worktree":`在此 worktree 新建会话`,"Rename worktree":`重命名 worktree`,"Worktree name":`Worktree 名称`,"Only the display name changes, for all sessions in this worktree. Leave empty to use the branch name.":`仅修改此 worktree 所有会话的显示名称,不改变分支或目录。留空恢复分支名。`,"Failed to rename worktree":`重命名 worktree 失败`,"Failed to use worktree":`使用 worktree 失败`,"Failed to create conversation":`新建会话失败`,"Switch branch":`切换分支`,"Back to workspaces":`返回工作区`,"Local branches":`本地分支`,"Search local branches":`搜索本地分支`,"Switching branches affects all conversations in this workspace.":`切换分支会影响此工作区的所有会话。`,"Create branch from HEAD…":`从当前 HEAD 新建分支…`,"Create branch":`新建分支`,"Create and switch":`新建并切换`,"Branch name":`分支名称`,"Detached HEAD":`分离 HEAD`,"No matching local branches.":`没有匹配的本地分支。`,"Failed to load branches":`读取分支失败`,"Failed to switch branch":`切换分支失败`,"Creates a branch from the current HEAD and switches every conversation in this workspace to it.":`从当前 HEAD 新建分支,并将此工作区的所有会话切换到该分支。`,"Create a commit before creating a branch from HEAD.":`请先创建一个提交,再从 HEAD 新建分支。`,"Stop running conversations and coworkers in this workspace before switching branches.":`请先停止此工作区中运行的会话和协作者,再切换分支。`,"Commit or stash uncommitted changes before switching branches.":`请先提交或暂存(stash)未提交改动,再切换分支。`,"This workspace is busy. Try again when its conversations are ready.":`此工作区正忙,请等待会话就绪后重试。`,"Branch is checked out in another worktree.":`此分支已被其他 worktree 占用。`,"Enter a valid Git branch name.":`请输入有效的 Git 分支名称。`,"A branch with this name already exists.":`同名分支已存在。`,"This branch no longer exists. Refresh the branch list.":`此分支已不存在,请刷新分支列表。`,"This workspace is already on that branch.":`此工作区已在该分支上。`,"Branches are not available for this workspace.":`此工作区无法使用 Git 分支。`,"Git could not switch branches.":`Git 无法切换分支。`,"Wait for the workspace operation to finish before saving.":`请等待工作区操作完成后再保存文件。`,"Worktree missing":`Worktree 已丢失`,"Worktree status unknown":`Worktree 状态未知`,"Uncommitted changes":`有未提交改动`,"Working tree clean":`工作区干净`,"{{n}} unmerged commits":`{{n}} 个未合并提交`,"Isolated worktree · uncommitted changes":`隔离 worktree · 有未提交改动`,"{{n}} browsers":`{{n}} 个浏览器`,"{{n}} terminals":`{{n}} 个终端`,"Isolated worktree · {{n}} unmerged commits":`隔离 worktree · {{n}} 个未合并提交`,"Isolated worktree is missing":`隔离 worktree 已丢失`,'The worktree of this session was deleted. Rebuild it from branch "{{branch}}" (committed work is preserved), or fall back to the main working tree.':`该会话的 worktree 已被删除。可从分支「{{branch}}」重建(已提交的工作会保留),或回退到主工作树继续。`,"Fall back to main working tree":`回退主工作树`,"Rebuild worktree":`重建 worktree`,"Failed to rebuild worktree":`重建 worktree 失败`,"Remove project":`移除项目`,"Archive project":`归档项目`,"Unarchive project":`恢复项目`,"Pin project":`置顶项目`,"Unpin project":`取消置顶项目`,"Pinned projects":`置顶项目`,"Select or create a conversation":`选择或新建一个对话`,"Collapse sidebar":`折叠侧边栏`,"Show {{n}} more":`展开其余 {{n}} 条`,"Archive {{n}} conversations":`归档 {{n}} 条会话`,Collapse:`收起`,Expand:`展开`,"Expand sidebar":`展开侧边栏`,"Show or hide sidebar":`显示/隐藏侧边栏`,"Approval required":`需要审批`,"Timed out · denied":`已超时拒绝`,"Timed out · no answer":`已超时未回答`,"{{time}} left":`剩余 {{time}}`,"Waiting for your answer":`等待你回答`,"Custom answer":`自定义回答`,"No answer in time; the default was selected":`超时未回答,已自动选择默认项`,Selected:`已选`,"Type an answer…":`输入回答…`,Later:`稍后`,Recommended:`推荐`,"Files read":`读入的文件`,"Tool results":`工具输出`,"About {{tokens}} left":`大约还剩 {{tokens}}`,"{{count}} more":`其余 {{count}} 项`,"Earlier {{count}} turns":`更早的 {{count}} 轮`,"Turn {{count}}":`第 {{count}} 轮`,"Compacted summary":`压缩摘要`,"System reminders":`系统提醒`,"Message will queue until this round finishes…":`消息将排队,本轮结束后发送…`,"Press {{key}} to steer the next queued message into this round…":`按 {{key}} 将下一条排队消息插入本轮…`,Queued:`排队`,"Withdraw message":`撤回`,"Not sent":`未发送`,"Not sent: the previous turn is stuck and could not be interrupted. Restart the conversation, then resend.":`未发送:上一轮卡住了,停不下来。请先重启会话再重发`,"Restart conversation":`重启会话`,Resend:`重发`,"Delivery unconfirmed":`送达待确认`,attachments:`个附件`,Edit:`编辑`,"Send now":`立即发送`,"Interrupt and send now":`打断并立即发送`,Remove:`移除`,"Agent types":`子代理类型`,"Max active coworkers":`同时在编 coworker 上限`,"How many coworkers one conversation can keep at once. Existing ones stay if you lower the limit; hire more only after dismissing. Subagents are not counted.":`单个会话最多同时保留多少个 coworker。调低上限不会解散现有成员,雇新的前需先解雇。subagent 不计入。`,"Built-in tools":`内置工具`,"Toggle the built-in tools available to agents.":`开关 agent 可用的内置工具。`,"Try these models' built-in search in order. Credentials resolve at call time; if all fail, the keyless Exa service is the permanent fallback.":`按顺序尝试这些模型的原生搜索。凭证在调用时现取;全部失败时由免 key 的 Exa 服务永久兜底。`,"Default: use the current session model's built-in search when available, otherwise Exa.":`默认:优先使用当前会话模型的原生搜索能力,不支持时回退 Exa。`,"Add candidate":`添加候选`,"Final fallback: Exa (keyless hosted search). Not a chain entry; always last.":`最终兜底:Exa(免 key 托管搜索)。不是链条目,永远在最后。`,"Isolated sandbox":`隔离沙箱`,Memory:`记忆`,"Durable knowledge the agent can search and write across sessions. Stored locally in a SQLite database.":`可跨会话检索与写入的持久知识,本地存放在一个 SQLite 库里。`,"Enable memory tools":`启用记忆工具`,"Gives the agent memory_search, memory_capture, memory_crystallize and memory_delete. The database is only created after you enable this.":`给 agent 提供 memory_search、memory_capture、memory_crystallize 与 memory_delete。开启后才会创建数据库。`,"Memory is off. The settings below take effect once you enable it.":`记忆已关闭。开启后下面的设置才会生效。`,"Embedding model":`嵌入模型`,"Used for semantic search and near-duplicate detection. Without it search still works using full-text only.":`用于语义检索与近重复识别。没有它检索仍可用,只是退化为纯全文。`,"Remote (OpenAI-compatible)":`远程(OpenAI 兼容)`,"Unknown model; the default is used instead.":`未知模型,实际使用默认模型。`,"Model downloaded":`模型已下载`,"Model not downloaded":`模型未下载`,"Downloading…":`下载中…`,"Semantic search stays off until the model is on disk.":`模型落盘前语义检索不会生效。`,"Remote (API model)":`远程(API 模型)`,Experimental:`实验功能`,"Bot mode":`Bot 模式`,"Chat with AI members that have personas, form groups and delegate work. Off by default.":`与有人设的 AI 成员私聊、拉群并互相委派工作。默认关闭。`,"Bot mode is turned off.":`Bot 模式已关闭。`,Download:`下载`,"Remote model":`远程模型`,"Credentials stay in the main process and are never sent to the renderer.":`凭证只留在主进程,不会下发到渲染层。`,"Unload automatically when idle":`空闲自动卸载`,"Release local model memory after this idle period. Models load automatically the next time they are needed.":`空闲达到此时长后释放本地模型内存,下次需要时会自动加载。`,"Download models automatically":`自动下载模型`,"Off by default, so a model is only fetched when you press Download. While a model is missing, search degrades to full-text; existing memories are re-embedded once it arrives.":`默认关闭,模型只在你点「下载」时才获取。模型缺失期间检索降级为纯全文,模型就绪后已有记忆会自动补向量。`,Distillation:`提炼`,"Distillation model":`提炼模型`,"Reads finished sessions and writes the memories.":`读已结束的会话并写出记忆。`,"Follows the title-summary model":`跟随标题模型`,"Memory language":`记忆语言`,"English keeps retrieval and near-duplicate detection stable across languages. Choose Follow conversation if your team only works in one language.":`英文能让跨语言的检索与近重复识别更稳。团队只用一种语言时可选「跟随对话」。`,English:`英文`,"Simplified Chinese":`简体中文`,"Background processing":`后台处理`,"Distill sessions automatically":`自动提炼会话`,"When a session ends, or goes idle for 30 minutes and is reclaimed, extract 1-3 durable memories from it in the background.":`会话结束、或空闲 30 分钟被回收时,在后台从中提炼 1-3 条值得长期保留的记忆。`,"Merge sessions in the same project":`合并同项目会话`,"Wait this long after a session ends, then distill every session of the same project that ended meanwhile in one run. Immediately distills each session on its own.":`会话结束后等待这段时间,再把期间结束的同项目会话合并成一次提炼。选「立即」则每个会话单独提炼。`,Immediately:`立即`,"{{done}}/{{total}} done":`已完成 {{done}}/{{total}}`,"about {{time}} left":`约剩 {{time}}`,"Extract entities":`抽取实体`,"Build an entity graph so a memory can be recalled by a name it does not literally contain.":`建立实体图谱,让正文里没出现该词的记忆也能被这个名字召回。`,"Review conflicting memories":`复核矛盾记忆`,"After new memories are written, ask the model whether they contradict older ones. Conflicts are only flagged for your review; nothing is hidden or deleted. Up to 20 model calls per run.":`写入新记忆后,让模型判断它是否推翻了已有记忆。发现的矛盾只标记待你审阅,不隐藏也不删除任何记忆。每轮最多调用模型 20 次。`,"Review now runs even when the switch above is off.":`「立即复核」在上面的开关关闭时也能运行。`,"No model is available for memory tasks.":`没有可用于记忆任务的模型。`,"Checked {{pairs}} pairs, flagged {{count}} conflicts.":`已复核 {{pairs}} 对,标出 {{count}} 处矛盾。`,"Review now":`立即复核`,Forgetting:`遗忘`,"Decay only changes how search ranks a memory. Archiving keeps it and can be undone; nothing on this page ever deletes a memory.":`衰减只影响检索排序。归档会保留记忆、可随时还原;这一页的任何操作都不会删除记忆。`,"Rank lower when never retrieved":`久未命中则降权`,"Memories that have not been retrieved for a long time rank lower. This changes ranking only — nothing is archived or deleted.":`很久没被检索到的记忆排序靠后。只改排序,不归档也不删除。`,"Mark archive candidates":`标记归档候选`,"Mark cold, low-importance memories as candidates and show them in the library. Marking alone changes nothing.":`把「冷且不重要」的记忆标成候选,并在记忆库里显示。只标记,不改变任何状态。`,"Archive candidates automatically":`自动归档候选`,"Archive candidates at the end of each run. Archived memories are hidden from search but kept and can be restored.":`每轮巡检结束时把候选归档。归档后不参与检索,但记忆仍在,可随时还原。`,"Not retrieved for":`未命中超过`,"Counted from the last retrieval; a memory that was never retrieved counts from creation.":`从最后一次被检索命中算起;从未命中的按创建时间算。`,"Importance at most":`重要度不高于`,"Only memories at or below this importance can become candidates. 0.5 is the lowest tier distillation writes.":`只有重要度不高于这个值的记忆才可能成为候选。0.5 是提炼允许写库的最低档。`,"Run every":`巡检间隔`,"Checked when the library opens; there is no separate background timer.":`开库时检查是否到期,不另起后台定时器。`,"Archive candidates: {{count}}":`归档候选:{{count}} 条`,"Archive candidates: marking is off":`归档候选:未开启标记`,"Running…":`运行中…`,"Review candidates":`查看候选`,"Never run yet":`还没有运行过`,"Last run {{date}}: {{scored}} scored, {{candidates}} candidates, {{archived}} archived":`上次运行 {{date}}:计算 {{scored}} 条,候选 {{candidates}} 条,归档 {{archived}} 条`,"Last retrieved {{date}}":`最后命中 {{date}}`,"No archive candidates right now.":`当前没有归档候选。`,"Archiving…":`归档中…`,"Archive candidate":`建议归档`,"Marked by the forgetting pass: cold and low importance":`遗忘巡检标记:久未命中且重要度低`,"Archive candidates only":`只看归档候选`,"Archive candidates":`归档候选`,"Showing the first {{shown}} of {{total}}.":`只显示前 {{shown}} 条,共 {{total}} 条。`,"{{selected}} of {{total}} selected":`已选 {{selected}}/{{total}}`,"Cold and low-importance memories. Archiving keeps them, hides them from search, and can be undone from the library.":`久未命中且重要度低的记忆。归档会保留它们、从检索里隐藏,随时能在记忆库还原。`,Library:`记忆库`,"No memories stored yet.":`还没有存下任何记忆。`,"Memory is not enabled.":`记忆未启用。`,Memories:`记忆数`,Crystals:`结晶数`,Entities:`实体数`,"With vectors":`已向量化`,Backfill:`补齐`,"Backfilling…":`补齐中…`,"Vectors unavailable: {{reason}}":`无法生成向量:{{reason}}`,"No remote embedding provider is selected. Choose a provider with an API key, or switch to a local embedding model.":`还没有选择远程向量服务商:请选择一个填了 API Key 的服务商,或改用本地向量模型。`,"The selected embedding provider no longer exists. Choose another provider, or switch to a local embedding model.":`所选的向量服务商已被删除:请重新选择服务商,或改用本地向量模型。`,'Provider "{{provider}}" has no Base URL. Fill it in, or choose another provider.':`服务商「{{provider}}」没有填写 Base URL:请补全,或换一个服务商。`,'Provider "{{provider}}" has no API key. Subscription sign-in cannot be used for embeddings; choose a provider with an API key, or switch to a local embedding model.':`服务商「{{provider}}」没有 API Key:订阅登录不能用于向量化,请换一个填了 API Key 的服务商,或改用本地向量模型。`,"No remote embedding model is selected. Choose a model that supports /embeddings.":`还没有选择远程向量模型:请选择支持 /embeddings 的模型。`,'"{{model}}" is a chat model and cannot be used for embeddings. Choose a model that supports /embeddings, or switch to a local embedding model.':`「{{model}}」是对话模型,不能用于向量化:请选择支持 /embeddings 的模型,或改用本地向量模型。`,'Provider "{{provider}}" has no embedding model ("{{model}}" is a chat model). Add one that supports /embeddings (e.g. text-embedding-3-small), or switch to a local embedding model.':`服务商「{{provider}}」下没有向量模型(「{{model}}」是对话模型):请在该服务商里添加支持 /embeddings 的模型(如 text-embedding-3-small),或改用本地向量模型。`,"No model can be used for embeddings: it needs a provider with an API key and an embedding model (e.g. text-embedding-3-small). Subscription sign-in cannot be used for embeddings.":`没有可用于向量化的模型:需要填了 API Key 的服务商,且其中有向量模型(如 text-embedding-3-small)。订阅登录不能用于向量化。`,"{{name}}: missing API key":`{{name}}:没有 API Key`,"{{name}}: missing Base URL":`{{name}}:没有 Base URL`,"{{name}}: no matching embedding model (model names must contain keywords like embed/voyage/bge)":`{{name}}:没有匹配的向量模型(模型名需包含 embed/voyage/bge 等关键词)`,"Database size":`库体积`,Spaces:`空间数`,"Never retrieved":`从未命中`,"{{percent}}% of library":`占 {{percent}}%`,"Added in 7 days":`近 7 天新增`,"Distill past sessions":`提炼历史会话`,"The automatic switch only covers sessions that end from now on. Distill earlier sessions here to fill the library.":`自动开关只对从现在开始结束或被回收的会话生效。早于此的会话在这里手动提炼,否则记忆库一直是空的。`,"No recorded sessions found.":`没有找到已记录的会话。`,"No project":`无项目`,"Already distilled":`已提炼`,"Distill all ({{count}})":`全部提炼({{count}})`,"All sessions":`全部会话`,"View sessions":`会话`,"Some sessions were already distilled":`部分会话已经提炼过`,"{{label}}: {{total}} sessions, {{done}} already distilled. Re-distilling runs the model again and may add new memories alongside the existing ones.":`{{label}}:共 {{total}} 个会话,其中 {{done}} 个已提炼。重新提炼会再跑一次模型,可能在现有记忆之外新增几条。`,"Only the {{count}} remaining":`只提炼剩下的 {{count}} 个`,"Re-distill all {{count}}":`重新提炼全部 {{count}} 个`,"Distill project":`提炼本项目`,"{{total}} sessions · {{pending}} not distilled":`{{total}} 个会话 · {{pending}} 个未提炼`,Distill:`提炼`,"Distill again":`重新提炼`,"Distilling…":`提炼中…`,"Background tasks":`后台任务`,"Background tasks started by this subagent":`这个子代理起的后台任务(归它所有,结束时不通知主会话)`,"Clear finished tasks":`清空历史任务`,"Retry failed extractions ({{count}})":`重试失败项({{count}})`,"Removes completed and cancelled jobs. Running tasks are kept. Sessions will show as not distilled again, since that flag is derived from job history — re-distilling is deduplicated, so it will not create duplicate memories.":`清除已完成和已作废的任务,进行中的保留。清除后会话会重新显示为「未提炼」——该标记是由任务历史推导的;重新提炼有去重,不会产生重复记忆。`,"Removes completed and cancelled jobs. Running tasks are kept.":`只删除已完成和已作废的记录,不影响进行中的任务。`,"Re-embedding memories":`正在重建向量`,"Nothing running.":`没有正在运行的任务。`,"Turn memory off in Built-in tools.":`如需关闭,请到「内置工具」中操作。`,critical:`关键`,important:`重要`,useful:`有用`,low:`次要`,"Importance {{value}}":`重要度 {{value}}`,"(legacy)":`(旧版)`,"superseded by the GGUF build":`已被 GGUF 版取代`,"job:distill":`提炼`,"job:entities":`实体`,"job:vectors":`向量`,queued:`排队中`,"retry {{count}}":`第 {{count}} 次重试`,superseded:`已替代`,"{{count}} stored":`已存 {{count}} 条`,extracting:`抽取中`,"memory changed":`记忆已变更`,"{{entities}} entities · {{links}} links":`{{entities}} 个实体 · {{links}} 条关系`,"{{done}} vectorized":`已向量化 {{done}} 条`,"{{done}} vectorized · {{failed}} failed":`已向量化 {{done}} 条 · {{failed}} 条失败`,"importance too low":`重要度过低`,"similar memory already exists":`已有相似记忆`,"identical to an existing memory":`与已有记忆完全一致`,rejected:`已拒绝`,"Show less":`收起`,"Show full text":`展开全文`,"Dispatch instructions":`派发指令`,Message:`消息`,"Show all {{count}}":`查看全部 {{count}} 条`,"{{count}} task(s) in progress":`{{count}} 个任务进行中`,"Exact match":`精确匹配`,"Semantic search":`语义检索`,"Fast retrieval":`快速检索`,"Deep retrieval":`深入检索`,"Same path the agent uses: full-text, vectors and entities merged by relevance. Shows the top matches only — no exact count, and archived memories are excluded.":`与 agent 同一条检索路径:全文、向量、实体与一跳相关实体按相关度融合。只给最相关的几条,没有精确总数,也不包含已归档的记忆。`,"Same recall as Fast, plus intent-weighted fusion and an optional short-timeout LLM rerank. Failures fall back; archived memories are excluded.":`召回与快速检索相同,再按意图加权融合,并可选短超时 LLM 重排。失败则回退;不含已归档记忆。`,"Embedding model is not ready, so vectors are skipped.":`嵌入模型未就绪,本次跳过了向量通道。`,Knowledge:`知识`,"Browse what the agent knows as a graph or a tree, ask for an interpretation, and consolidate related memories into a crystal.":`用图谱或树浏览 agent 已知的知识,让它解读,并把相关记忆合成结晶。`,Graph:`图谱`,Tree:`知识树`,"By type":`按类型`,"By entity":`按实体`,"By month":`按月份`,"Knowledge graph":`知识图谱`,"No entities yet. Turn on entity extraction and store a few memories first.":`还没有实体。先打开「抽取实体」并存下几条记忆。`,"Colour = entity type · size = how many memories mention it":`颜色 = 实体类型 · 大小 = 被多少条记忆提及`,"{{shown}} of {{total}} entities":`{{total}} 个实体中的 {{shown}} 个`,Fit:`适应窗口`,"Fit to view":`缩放到全图`,Relayout:`重新布局`,"Re-run layout":`重新计算布局`,"{{count}} memories · {{space}}":`{{count}} 条记忆 · {{space}}`,Interpret:`解读`,"Interpreting…":`解读中…`,Interpretation:`解读`,"Based on {{count}} memories":`基于 {{count}} 条记忆`,"Crystallize ({{min}}+)":`结晶({{min}} 条起)`,"Synthesizing…":`合成中…`,"Crystal created":`已生成结晶`,"Nothing was written":`没有写入任何内容`,"Similar memories already exist, nothing was written":`已有相似记忆,没有写入`,"Identical memory already exists, nothing new was written":`已有完全相同的记忆,没有重复写入`,"Showing {{shown}} of {{total}}":`显示 {{shown}} / {{total}}`,"No memories yet.":`还没有记忆。`,"Stored memories":`已存记忆`,"Everything the agent has saved. Archiving hides a memory from search but keeps it.":`agent 存下的全部记忆。归档只是让它不再出现在检索里,内容仍保留。`,"Clear selection":`取消选择`,"Archive selected":`归档所选`,"Select memory":`选中记忆`,"Delete {{count}} memories permanently?":`永久删除这 {{count}} 条记忆?`,"Search memories":`搜索记忆`,"All spaces":`全部空间`,"All types":`全部类型`,"Show archived":`显示已归档`,"No memories yet. They appear here once the agent stores something.":`还没有记忆。agent 存下第一条后会出现在这里。`,"No memories match these filters.":`没有符合当前筛选条件的记忆。`,"Type a query to search by meaning.":`输入关键词后按语义检索。`,Crystal:`结晶`,"Retrieved {{count}} times":`被检索 {{count}} 次`,Previous:`上一页`,"Needs review":`待审阅`,"Reviewing only records your judgement. Nothing is deleted and no memory is superseded.":`审阅只记录你的判断,不会删除任何记忆,也不会让任何一条被取代。`,"Accept: recorded as a confirmed contradiction. Both memories stay and stay searchable — you just stop being asked.":`接受:记为「确认矛盾」。两条记忆都保留、都还能被检索,只是不再提示你。`,"Dismiss: recorded as not a contradiction. Both memories stay unchanged and you stop being asked.":`忽略:记为「不算矛盾」。两条记忆都保持原样,也不再提示你。`,"Nothing to review. When a new memory contradicts an existing one, the pair shows up here.":`没有待审阅的矛盾。新记忆与已有记忆冲突时,这一对会出现在这里。`,"{{count}} contradictions are waiting for review. Clear them in bulk so real conflicts do not get buried.":`已有 {{count}} 条矛盾待审阅,建议批量处理,别让真正的冲突被埋掉。`,"Accept selected":`批量接受`,"Dismiss selected":`批量忽略`,"Earlier memory":`旧记忆`,"Newer memory":`新记忆`,"Why they conflict":`矛盾理由`,"No reason recorded for this pair.":`这一对没有记录矛盾理由。`,Accept:`接受`,Dismiss:`忽略`,Type:`类型`,Space:`空间`,Importance:`重要度`,Created:`创建于`,"Event date":`事件日期`,Embedding:`向量模型`,"Synthesized from":`合成自`,"Related versions":`相关版本`,"Delete permanently":`永久删除`,"Deleting…":`删除中…`,"Delete this memory permanently?":`永久删除这条记忆?`,"All space types":`全部空间类型`,"Recorded {{date}}":`记录于 {{date}}`,"Recorded at":`记录时间`,"Updated at":`更新时间`,"Edit memory":`编辑记忆`,"Search indexes are rebuilt from the new text right away.":`保存后全文、向量和实体索引会立即按新内容重建,旧内容不再能被搜到。`,"Importance (0–1)":`重要度(0–1)`,"Content cannot be empty.":`内容不能为空。`,"Importance must be between 0 and 1.":`重要度需在 0 到 1 之间。`,"Could not save the memory.":`记忆保存失败。`,"Checking what this affects…":`正在检查删除会影响哪些记忆…`,"Memory not found.":`记忆不存在或已被删除。`,"Also deletes {{count}} older versions it replaced: {{titles}}":`会一并删除被它替换掉的 {{count}} 个历史版本:{{titles}}`,"The older and newer versions around it are linked directly, so the history stays continuous.":`它前后的版本会直接相连,版本历史保持连续。`,"Removes the relation links to {{titles}}; those memories are kept.":`会解除与 {{titles}} 的关联,这些记忆本身保留。`,"Crystal {{title}} loses this source and keeps {{count}} sources.":`结晶 {{title}} 会失去这条来源,剩余 {{count}} 条来源。`,"Crystal {{title}} would be left with {{count}} sources, so it becomes a normal memory. Its content is kept.":`结晶 {{title}} 只剩 {{count}} 条来源,不再构成结晶,将转为普通记忆,正文保留。`,"This is a crystal: its {{count}} source memories are kept, only the links are removed.":`这是一条结晶:它的 {{count}} 条来源记忆会保留,只解除结晶关系。`,"No other memories are affected.":`不影响其他记忆。`,"This cannot be undone. Archiving keeps the memory out of search while preserving it.":`此操作不可撤销。归档可以让它不再出现在检索里,同时保留内容。`,"Long-term memory: the agent can search, capture and consolidate durable decisions, preferences and lessons across sessions":`长期记忆:agent 可跨会话检索、记录与归纳持久的决策、偏好与经验`,"Let the agent drop an irrelevant automatic delivery or throwaway exchange from its context; the timeline keeps it and turn_recall can read it back":`让 agent 把无关的自动投递或一次性问答从上下文里丢掉;时间线保留原文,turn_recall 可取回`,"Plan mode: research read-only, submit a plan for approval, then carry it out after approval":`Plan 模式:只读调研并提交计划,审批通过后再执行`,"Run JavaScript in an isolated sandbox that can call session tools. Intermediate reads and edits stay out of the chat; only the returned value is added to the conversation.":`在隔离沙箱里跑 JavaScript,并可调用会话工具。中间的读取和修改不会进对话,只有返回值会留下。`,Workflow:`工作流`,"Run a JavaScript workflow that fans work out across subagents.":`运行一段扇出子代理的 JavaScript 工作流。`,"Run a JavaScript workflow that fans work out across subagents. Live status appears in the side panel.":`运行一段扇出子代理的 JavaScript 工作流。实时状态显示在右侧栏。`,"No workflow runs":`还没有工作流`,"Clear finished runs":`清除已结束`,Run:`运行`,"Workflow preset":`预设工作流`,"Manage workflow presets":`管理工作流预设`,Workflows:`工作流`,"Preset workflows you can run from the Workflow side panel":`可在侧边栏「工作流」面板中运行的预设`,"Project .agents/workflows files take precedence over these; ~/.agents/workflows and built-in presets come after.":`同名时项目 .agents/workflows 下的文件优先于这里,其次是 ~/.agents/workflows 和内置预设。`,"Add workflow preset":`新增工作流预设`,"Edit workflow preset":`编辑工作流预设`,"No custom workflow presets yet":`还没有自定义工作流预设`,"Custom presets":`自定义预设`,"Built-in presets":`内置预设`,Label:`显示名`,"Default value":`默认值`,Required:`必填`,"Add argument":`添加参数`,Script:`脚本`,Steps:`步骤`,Design:`设计`,Code:`代码`,"Default (worker)":`默认(worker)`,"Phase {{n}}":`阶段 {{n}}`,"Phase title":`阶段名称`,Prompt:`提示词`,"Click a node to edit it. Steps in a column run in parallel; columns run from left to right.":`点击节点即可编辑。同一列的步骤并行执行,各列从左到右依次执行。`,Start:`开始`,"No arguments":`无参数`,"Last phase output":`末阶段输出`,"Untitled phase":`未命名阶段`,"Untitled step":`未命名步骤`,"No prompt yet":`尚未填写提示词`,"Parallel step":`并行步骤`,"Insert phase here":`在此插入阶段`,"Phase {{n}} · Step {{m}}":`阶段 {{n}} · 步骤 {{m}}`,"Move left":`左移`,"Move right":`右移`,"Insert argument":`插入参数`,"Previous phase output":`上一阶段输出`,"This preset is plain code and cannot be shown in the designer. Using the designer replaces the current script.":`该预设是纯代码,无法在设计器中显示。改用设计器会替换当前脚本。`,"Use the designer":`改用设计器`,"Every phase needs a title and every step needs a label and a prompt.":`每个阶段需要名称,每个步骤需要显示名和提示词。`,"Generated from the design. Editing the code detaches it from the designer.":`由设计生成。手动修改代码后将脱离设计器,变为纯代码预设。`,"Plain JavaScript with top-level await; end with return. Available: agent(prompt, opts), parallel, pipeline, phase, log, args.":`纯 JavaScript,支持顶层 await,以 return 结束。可用:agent(prompt, opts)、parallel、pipeline、phase、log、args。`,"Workflow preset not found":`工作流预设不存在`,"Workflow preset is larger than 64 KB":`工作流预设超过 64 KB`,"Invalid workflow preset":`工作流预设无效:检查参数名(字母、数字、下划线),且各字段不能包含 */`,"Parallel review":`并行审查`,"Review a change set in parallel along several dimensions with read-only reviewers.":`用只读审查代理按多个维度并行审查一组改动。`,"Review scope":`审查范围`,"Dimensions (comma separated)":`审查维度(逗号分隔)`,"Multi-angle investigation":`多角度调研`,"Investigate one question from implementation, tests and docs in parallel with read-only scouts.":`用只读侦察代理从实现、测试、文档三个角度并行调研同一个问题。`,Question:`问题`,Parallel:`并行`,"{{count}} agents":`{{count}} 个子代理`,"One-shot subagent: delegate a self-contained task and return a final report (parallel or async)":`一次性子代理:委派自包含子任务,返回最终报告(可并行、可异步)`,"Persistent subagent: hire for multi-turn dialogue; you can watch and intervene from a tab":`持久子代理:雇佣后多轮对话,用户可在 tab 旁观介入`,"Task list: track progress on multi-step work":`任务清单:跟踪多步骤工作的进度`,"Ask the user a question and wait for an answer (options / timeout)":`向用户提问并等待回答(带选项/超时)`,"Background shell task: run long commands in the background and notify on completion":`后台 shell 任务:长命令挂后台跑,完成时通知`,"Built-in browser: open pages in Enso's own Chromium, read snapshots, click and type by ref":`内嵌浏览器:在 Enso 自带 Chromium 里打开页面,读快照,按 ref 点击与输入`,"Web search and fetch: search with the session model's built-in search (falls back to a keyless service) and read public pages as markdown":`联网搜索与抓取:优先用会话模型自带的搜索(不支持时降级到免 key 服务),并把公开网页读成 markdown`,"This project ships pi extension code that runs with your permissions. It was not loaded. Trust it only if you trust this repository.":`此项目带有 pi 扩展代码,会以你的权限运行,已阻止加载。只有信任这个仓库时才加载。`,"Trust and load":`信任并加载`,Plugin:`插件`,"Enso plugins":`Enso 插件`,"No Enso plugins installed":`还没有安装 Enso 插件`,"Browse the marketplace or install from a GitHub URL, folder or zip.":`可以从插件市场浏览,或通过 GitHub 地址、文件夹、zip 安装。`,"Or install from":`或从本地安装`,"Installing a plugin lets it run code on this machine. Review what it asks for before confirming.":`安装插件会让它在这台电脑上运行代码。确认前请先查看它申请的权限。`,"Install from folder":`从文件夹安装`,"Install from zip":`从压缩包安装`,"Install from URL":`从链接安装`,Marketplace:`插件市场`,"Search plugins":`搜索插件`,"China mirror":`国内镜像`,"Usage guide":`使用说明`,Homepage:`主页`,"Update plugins automatically":`自动更新插件`,"Marketplace updates that do not ask for new permissions install on their own.":`权限不变的市场更新会自动装上。需要新权限的仍等你同意。`,"Record plugin logs":`记录插件日志`,"Off by default. Record plugin console output and runtime logs to disk. Startup failures and crashes are still shown.":`默认关闭。开启后将插件控制台输出与运行日志写入磁盘;关闭时启动失败和崩溃等错误状态仍会显示。`,"Plugin logging is off":`插件日志未开启`,"New plugin logs are not recorded while off. Existing log files are kept.":`当前不会记录新的插件日志,已有日志文件不会删除。`,"Enable plugin logging":`开启插件日志`,"Record app logs":`记录应用日志`,"Off by default. Write main process and agent logs to disk. Files needed for restart recovery are always kept.":`默认关闭。开启后将主进程与 Agent 日志写入磁盘;重启恢复等功能需要的文件始终照常保存。`,"App logging is off":`应用日志未开启`,"New app logs are not recorded while off. Existing logs are kept below.":`当前不会记录新的应用日志,已有日志不会删除,仍在下方显示。`,"Enable app logging":`开启应用日志`,"App logging is off. The export only includes logs recorded earlier.":`应用日志未开启,导出只包含之前已记录的日志。`,"{{name}} tried to message another session and was blocked":`插件 {{name}} 想向其他会话发消息,已拦截`,"Turn on":`去开启`,"{{name}} {{version}} needs new permissions":`插件 {{name}} 新版本 {{version}} 需要新权限`,"Review permissions":`去授权`,"{{name}} updated to {{version}}":`插件 {{name}} 已更新到 {{version}}`,View:`查看`,"Could not reach the marketplace; showing the last saved list.":`无法连接插件市场,显示的是上次保存的列表。`,"No matching plugins":`没有匹配的插件`,Official:`官方`,Community:`社区`,Installed:`已安装`,"https://github.com/owner/repo":`https://github.com/owner/repo`,"Install failed":`安装失败`,"{{name}} installed":`已安装 {{name}}`,"Turn it on in the list below to use it.":`在下面的列表里打开开关即可使用。`,"updating from {{version}}":`从 {{version}} 更新`,"This update asks for more than {{version}}. {{version}} keeps running until you allow the update in the plugin list.":`这次更新申请的权限比 {{version}} 多。确认后 {{version}} 继续运行,在插件列表里点「允许」才会切到新版。`,"Awaiting approval":`待授权`,"Keep current":`保持现状`,"Stopped after crashes":`多次崩溃后已停止`,"Plugin command failed":`插件命令执行失败`,"Plugin logs":`插件日志`,"No logs yet":`暂无日志`,"Log too large, showing plain text":`日志过大,已切换为纯文本`,"Reinstall from source":`从来源重新安装`,"No plugins installed from GitHub to check":`没有从 GitHub 安装的插件可以检查`,"{{count}} update(s) available":`{{count}} 个插件有新版本`,"All plugins are up to date":`插件都是最新版本`,"Version {{version}} is available":`有新版本 {{version}}`,Update:`更新`,"Update check failed: {{reason}}":`检查更新失败:{{reason}}`,Commands:`命令`,"Project extensions trusted. They load in new sessions and after this one restarts.":`已信任项目扩展,新会话和本会话重新启动后加载。`,"Trusted project extensions":`已信任的项目扩展`,"Revoke trust":`撤销信任`,"No longer loaded after saving, starting with the next session.":`保存后不再加载,从下一个会话开始生效。`,"Web search":`联网搜索`,"Web fetch":`网页抓取`,Computer:`电脑操控`,"Host desktop: list windows, screenshot, accessibility tree, and input. Default off. Not the built-in browser.":`宿主桌面:列窗口、截图、无障碍树与键鼠。默认关闭。不是内嵌浏览器。`,"Operate the host desktop with screenshots, accessibility, and input.":`用截图、无障碍树和键鼠操作宿主桌面。`,"Enso never receives host-desktop computer tools.":`Enso 不会拿到宿主桌面 computer 工具。`,"Ask the coding agent to use the computer tool.":`请让编程 agent 使用 computer 工具。`,"Screen Recording":`屏幕录制`,Accessibility:`辅助功能`,"Open Screen Recording settings":`打开屏幕录制设置`,"Open Accessibility settings":`打开辅助功能设置`,"Computer needs Screen Recording to capture windows and Accessibility to inspect or click them. Grant both to EnsoCode, then restart the app.":`电脑操控需要屏幕录制才能截窗,需要辅助功能才能读无障碍树或点击。请把这两项授权给 EnsoCode,然后重启应用。`,"Grant Computer permissions":`授权电脑操控权限`,"Show permission guide":`打开权限引导`,"Apps the AI may control":`AI 可操作的应用`,"Allow all apps":`允许所有应用`,"The AI can click, type and read in any app without asking. It can see everything in their windows, including chats and passwords.":`AI 操作任何应用都不再询问,可点击、输入并读取所有应用窗口里的内容,包括聊天记录和密码等。`,"Show the app being operated":`显示正在操作的应用`,"While the AI works in an app in the background, a small floating window shows that app live. Close it any time.":`AI 在后台操作某个应用时,用一个小浮窗实时显示这个应用的画面,可随时关掉。`,"The first time the AI clicks or types in an app, EnsoCode asks you. Apps you always allow are listed here; it can then read everything in their windows.":`AI 第一次在某个应用里点击或输入时,EnsoCode 会先询问你。你选择「始终允许」的应用会列在这里,AI 之后可以读取这些应用窗口里的全部内容。`,"No apps are always allowed yet.":`还没有始终允许的应用。`,Revoke:`撤销`,"The agent can screenshot windows and control the mouse and keyboard. Grant Screen Recording and Accessibility to EnsoCode, then restart.":`Agent 可以截取窗口并控制键鼠。请把屏幕录制和辅助功能授权给 EnsoCode,然后重启。`,"Computer is ready. Open sessions can use it from their next step.":`电脑操控已就绪。已打开的会话从下一步起即可使用。`,"Capture: granted":`截屏:已授权`,"Capture: denied":`截屏:未授权`,"Input/AX: granted":`键鼠/AX:已授权`,"Input/AX: denied":`键鼠/AX:未授权`,"This platform cannot operate the desktop yet.":`当前系统还不能操作桌面。`,"QuickJS sandbox: write JavaScript that calls session tools (including edits) in one cell":`QuickJS 沙箱:用 JavaScript 在一个 cell 里调用会话工具(含编辑)`,"(log unavailable)":`(日志不可用)`,"Loading…":`加载中…`,"(no log available)":`(暂无日志)`,"Context compacted":`上下文已压缩`,"{{kind}} · {{before}} → {{after}} · freed {{percent}}%":`{{kind}} · {{before}} → {{after}} · 释放 {{percent}}%`,"Context compacted ({{tokens}} tokens before)":`上下文已压缩(压缩前 {{tokens}} tokens)`,"Verified context compacted":`验证式压缩完成`,"Verified context compacted ({{tokens}} tokens before)":`验证式压缩完成(压缩前 {{tokens}} tokens)`,"Verified summary from smart compaction. Messages above are no longer in the model context.":`这次用了验证式摘要。此线之上的历史已不在模型上下文中。`,"Memory context compacted":`持续记忆压缩完成`,"Memory context compacted ({{tokens}} tokens before)":`持续记忆压缩完成(压缩前 {{tokens}} tokens)`,"Summary rendered from continuous memory. Messages above are no longer in the model context; use recall for sources.":`这次由持续记忆直接渲染摘要。此线之上的历史已不在模型上下文中,可用 recall 查看来源。`,"Messages above are no longer in the model context; only this summary is.":`以上消息已不在模型上下文中,模型只看到这份摘要。`,"Latest compaction summary — expand to read what the model kept.":`最近一次压缩摘要,点开可查看模型保留的内容。`,"(summary unavailable)":`(摘要不可用)`,Note:`注意`,Tip:`提示`,Important:`重要`,Warning:`警告`,Caution:`小心`,"Let the agent pick subagent models":`允许子代理指定模型`,"The main agent can pick one of these models when dispatching subagents or coworkers. The description tells it when to use each model.":`主 agent 派发 subagent/coworker 时可从这些模型里挑选;描述用于告诉它每个模型适合什么任务。`,"When to use it, e.g. cheap and fast for simple subtasks":`什么时候用它,例如:便宜快,适合简单子任务`,"Add model":`添加模型`,Delete:`删除`,Archived:`已归档`,"Clean up archived":`清理已归档`,"Older than {{days}} days":`{{days}} 天前`,"Delete all archived":`全部删除`,"All {{count}} archived conversations will be removed from the list.":`全部 {{count}} 个已归档对话将从列表移除。`,'All {{count}} archived conversations in "{{name}}" will be removed from the list.':`「{{name}}」中全部 {{count}} 个已归档对话将从列表移除。`,"Delete archived conversations?":`删除已归档对话?`,"{{count}} conversations archived more than {{days}} days ago will be removed from the list.":`{{count}} 个归档超过 {{days}} 天的对话将从列表移除。`,'{{count}} conversations in "{{name}}" archived more than {{days}} days ago will be removed from the list.':`「{{name}}」中 {{count}} 个归档超过 {{days}} 天的对话将从列表移除。`,Other:`其他`,Archive:`归档`,Unarchive:`取消归档`,Active:`活跃中`,Pinned:`已置顶`,"Drop here to pin":`拖到此处置顶`,Pin:`置顶`,Unpin:`取消置顶`,Rename:`重命名`,"Model selection":`模型选择`,"Must be picked by main agent":`必须由主 Agent 选择`,"Picked by main agent":`由主 Agent 选择`,"Fixed model":`自选固定模型`,"Subagent models not configured warning":`未在【模型服务】中配置【允许子代理指定模型】。设为【必须由主 Agent 选择】的子代理类型将暂时回退为跟随会话。`,"Custom subagent presets: system prompt, model and toolset. The agent picks one via the agent_type parameter.":`自定义子代理预设:系统提示、模型与工具集,主 agent 经 agent_type 参数选用。`,"New agent type":`新建类型`,"Built-in":`内置`,"Follows the conversation model, full toolset":`跟随会话模型,全部工具`,"Follows the conversation model":`跟随会话模型`,"Overrides built-in":`覆盖内置`,"Edit agent type":`编辑类型`,"Name (slug)":`名称(slug)`,"Description (helps the agent pick this type)":`描述(帮助主 agent 选型)`,"Fast read-only recon, returns compressed findings":`快速只读调研,返回压缩结论`,"System prompt":`系统提示`,"You are a fast recon agent. Explore, never modify…":`你是快速调研代理,只探索不修改…`,"Provider (optional)":`模型服务(可选)`,"Follow conversation":`跟随会话`,"Enable subagent model":`启用子代理模型`,"Make this model available to subagents":`允许子代理选择此模型`,"Applies to newly started conversations.":`对新启动的会话生效。`,"Follow parent":`跟随父会话`,"Depth: {{level}}":`深度:{{level}}`,Disabled:`已停用`,"Select model":`选择模型`,Toolset:`工具集`,"All tools (bash/edit/write)":`全部工具(bash/edit/write)`,"Read-only (read/grep/find/ls + bound MCP)":`只读(read/grep/find/ls + 绑定的 MCP)`,Stop:`停止`,"Attach image":`添加图片`,"Stop task":`停止任务`,"Move to background":`转为后台`,"Moving to background…":`正在转后台…`,"Moved to background":`已转后台`,"Moves to background in {{seconds}}s":`{{seconds}} 秒后转后台`,"No output for {{seconds}}s":`{{seconds}} 秒无输出`,"Exit {{code}}":`退出码 {{code}}`,"Killed at timeout":`超时被终止`,"Stopped by you":`已被你停止`,"Needs terminal":`需要终端`,"Needs login":`需要登录`,"Command not found":`找不到命令`,"Not executable":`不可执行`,"Binary output":`二进制输出`,"Log truncated":`日志已截断`,"Killed when its timeout was reached. Raise the timeout or run it in the background.":`到达 timeout 被终止。可提高 timeout 或改为后台运行。`,"Needs an interactive terminal. Use a non-interactive flag (such as --yes) or run it in your own terminal.":`需要交互式终端。改用非交互参数(如 --yes),或在你自己的终端里运行。`,"Needs credentials. Sign in from your own terminal, then retry.":`需要凭证。请先在你自己的终端里登录,再重试。`,"The program is not installed or not on PATH.":`程序未安装或不在 PATH 中。`,"Copy command":`复制命令`,"Rerun in background":`转后台重跑`,"Rerun with {{seconds}}s timeout":`以 {{seconds}}s timeout 重跑`,"Rerun this command with background: true:\n\n{{command}}":`用 background: true 重新运行这条命令:
11
+
12
+ {{command}}`,"Rerun this command with timeout: {{seconds}}:\n\n{{command}}":`用 timeout: {{seconds}} 重新运行这条命令:
13
+
14
+ {{command}}`,"Stop waiting":`不等了`,"Stopping wait…":`正在结束等待…`,"Writing reply…":`正在写回复…`,"No running subagents":`没有在跑的子代理`,"Stopping the wait does not stop subagents; the assistant is notified when they finish.":`不等了也不会停下子代理,它们做完会自动通知助手。`,"Stop subagent":`停止子代理`,"Dismiss coworker":`解雇 coworker`,"Hire coworker":`雇佣 coworker`,"Subagent history":`子代理记录`,"Set a session goal (/goal <objective> · pause · resume · clear)":`设定会话目标(/goal <目标> · pause · resume · clear)`,"Pause the current session goal":`暂停当前会话目标`,"Resume a paused session goal":`继续已暂停的会话目标`,"Clear the session goal":`清除会话目标`,working:`推进中`,paused:`已暂停`,waiting:`等待中`,blocked:`受阻`,completed:`已完成`,aborted:`已中止`,"Goal completed":`目标完成`,"Goal blocked":`目标受阻`,"Goal waiting":`目标等待中`,"Pause goal":`暂停目标`,"Resume goal":`继续目标`,"Clear goal":`清除目标`,"Waiting for upstream recovery":`等待上游恢复`,"Waiting for upstream recovery · next {{time}}":`等待上游恢复 · 下次 {{time}}`,"Quota exhausted":`额度用完`,"Quota exhausted · next {{time}}":`额度用完 · 下次 {{time}}`,"Stop auto-retry":`停止自动重试`,"Upstream unavailable ({{provider}}), retrying automatically":`上游不可用({{provider}}),自动重试中`,Plan:`计划`,"Plan mode is on: read-only research, then a plan for your approval":`Plan 模式已开启:只读调研,产出计划交你审批`,"Plan first: research read-only and submit a plan for approval":`先出计划:只读调研,提交计划审批后再执行`,"Plan response failed":`计划审批未送达`,"Plan awaiting approval":`计划待审批`,"What should change in this plan?":`这份计划需要怎么改?`,"Discard and exit plan mode":`放弃并退出 Plan`,"Send feedback":`发送修改意见`,"Request changes":`修改意见`,"Approve and execute":`批准并执行`,"Choose the approval mode for execution":`选择执行时的审批档位`,"Approve and execute with":`批准后按以下审批档位执行`,"Executing plan":`执行计划`,"Finish plan":`结束计划`,"Plan mode: research read-only, then approve a plan (/plan [task] · off)":`Plan 模式:只读调研后审批计划(/plan [任务] · off)`,"Describe the task — a plan comes first":`描述任务,先产出计划`,"Plan mode on: read-only research, then a plan for your approval":`已进入 Plan 模式:只读调研,产出计划交你审批`,"Plan mode off":`已退出 Plan 模式`,"Unattended mode on: no one is watching, so it decides and keeps going":`已开启无人值守:没人在看,它会自己决定并继续`,"Unattended mode off: a person is available again":`已关闭无人值守:可以再问你了`,"Context compacted: the approved plan was attached again":`上下文已压缩,已重新附上执行中的计划`,"Plan approved, executing":`已批准计划,开始执行`,"Plan feedback":`计划修改意见`,"From main agent":`来自主 agent`,Role:`角色`,"Agent type":`类型`,Hire:`雇佣`,"Dismiss this coworker? Its session will be closed.":`解雇这个 coworker?其会话将被关闭。`,Output:`输出`,Assistant:`助手输出`,Arguments:`参数`,Result:`结果`,"Final report":`最终报告`,"{{count}} chars":`{{count}} 字符`,"Earlier activity details were cleared; the final report is still available.":`较早的过程详情已清理,最终报告仍然保留。`,"(no output yet)":`(暂无输出)`,"Output written ({{size}}), not loaded yet":`已输出 {{size}},面板尚未加载`,"The process has not written anything. Without a terminal, some programs buffer output and only write it in blocks or on exit.":`进程还没有写出任何内容。不在终端里运行时,有些程序会把输出攒成一块或等退出时才写出。`,Deny:`拒绝`,Allow:`允许`,"Run as administrator":`以管理员权限运行`,"Login password":`本机登录密码`,"A command is waiting for the administrator password":`有命令在等待管理员密码`,"Incorrect password. Try again.":`密码不正确,请重试。`,"Applies to this command only. The password is never shown to the AI.":`仅对这一条命令生效,密码不会交给 AI。`,Adjust:`调整`,"Send back for a safer command":`打回去,让模型换一个更安全的命令`,"Assistant review":`代审`,"Let the assistant decide":`交给助手代审`,"Always allow this session":`本会话总是允许`,"Resolve the pending approval to continue":`请先处理待审批的操作`,Supervised:`全程审批`,"Approve every command and file change":`每条命令与文件改动都需确认`,"Auto-accept edits":`自动接受编辑`,"Edits run freely; commands and MCP still ask":`文件编辑直接执行,命令与 MCP 仍需确认`,"Full access":`完全放行`,"Run everything without asking":`所有操作不经确认直接执行`,"Assistant approval":`助手代审`,Unattended:`无人值守`,"Rejects actions that need approval instead of waiting for you":`需要确认的动作直接拒绝,不再弹卡片等人`,"Assistant reviewing…":`代审中…`,"A configured model reviews each action first":`由设置中的模型先审每一步操作`,"Select an assistant approval model in Settings first":`请先在设置里选择助手代审模型`,"Assistant approval model":`助手代审模型`,"Required before Assistant approval can be selected. Does not fall back to the chat model.":`选好后新会话默认走助手代审;未选则该档不可用,不会回退到当前会话模型。`,"No assistant approval model selected":`尚未选择助手代审模型`,"Selected model is unavailable":`所选模型不可用`,Clear:`清除`,"No conversations yet":`暂无对话`,"Preparing session…":`正在读取历史…`,"Loading earlier messages…":`加载更早的消息…`,"Load earlier messages":`加载更早的消息`,"Beginning of conversation":`已到对话开头`,"Retry resume":`重新恢复`,"Session is not ready yet — no history to show.":`会话准备超时,暂无可显示的历史。`,"Retry sync":`重新同步`,Todos:`任务清单`,"Todo list cleared":`已清空`,"{{count}} tool calls":`{{count}} 个工具调用`,"ran {{count}} commands":`跑了 {{count}} 条命令`,"total {{duration}}":`总计 {{duration}}`,"took {{duration}}":`用时 {{duration}}`,"read {{count}} files":`读了 {{count}} 个文件`,"searched {{count}} times":`搜索 {{count}} 次`,"{{count}} other calls":`其他 {{count}} 次调用`,Explored:`探索了`,Exploring:`探索中`,"{{count}} files":`{{count}} 个文件`,"{{count}} searches":`{{count}} 次搜索`,"{{turns}} turns · {{steps}} steps":`{{turns}} 轮 · {{steps}} 步`,"LLM {{duration}}":`LLM {{duration}}`,"Tool calls {{duration}}":`工具调用 {{duration}}`,"First token avg {{duration}}":`首 token 平均 {{duration}}`,"Cache hit {{percent}}%":`缓存命中 {{percent}}%`,"Input {{input}} tok · Output {{output}} tok":`输入 {{input}} · 输出 {{output}} tok`,"{{speed}} tok/s":`{{speed}} tok/s`,"Search models":`搜索模型`,"Virtual models":`虚拟模型`,"Starred & virtual":`星标与虚拟`,"Recently used":`最近使用`,"Remove from recently used":`从最近使用中移除`,"Enable virtual model":`启用虚拟模型`,"Primary model":`主模型`,"Default for each new turn":`每轮默认使用`,"Fast model":`快模型`,"Summaries and simple turns":`摘要与简单问题`,"Fallback models":`备用模型`,"Used in order when a model is rate limited or down":`限流或故障时按顺序切换`,"Add fallback":`添加备用`,"Not used":`不使用`,"Difficulty routing":`按难度分档`,"Set a fast model first":`先设置快模型`,"Fast model judges":`快模型判断`,"Classifier model":`分类器模型`,"No classifier models available":`该服务商暂无可用的分类器模型`,"Classifies each new turn: simple turns use the fast model, complex ones the primary model. Adds a short delay before the reply.":`每轮新输入先分类:简单问题用快模型,复杂任务用主模型。回复前会多一点延迟。`,"New virtual model":`新建虚拟模型`,"A virtual model appears as one model in the picker and routes each request to a real model: fallbacks on rate limits or outages, image-capable or larger-context members when needed, and the fast model for summaries.":`虚拟模型在选择器里显示为一个模型,每次请求由路由挑选真实模型:限流或故障时切到备用,需要时换成支持图片或上下文更大的成员,摘要使用快模型。`,"No models found":`没有匹配的模型`,"Import session":`导入会话`,"More actions":`更多操作`,"Pick a conversation from a local AI app under {{name}}.":`从本地 AI 应用导入 {{name}} 项目下的对话历史。`,"No sessions found for this project":`没有找到该项目的会话`,"Select a session to preview":`选择一个会话预览`,"The session list is out of date. Please rescan.":`会话列表已过期,请重新扫描。`,"This session is outside the allowed folders and cannot be read.":`该会话已不在允许的目录内,无法读取。`,"This session has no messages to import.":`该会话没有可导入的消息。`,Untitled:`未命名`,"{{count}} messages":`{{count}} 条消息`,Import:`导入`,"Scroll to bottom":`回到底部`,Rewind:`回退`,"Rewinding…":`正在回退…`,"Restoring files…":`正在还原文件…`,"Rewinding conversation and files…":`正在回退对话并还原文件…`,"Rewind to this message":`回退到这条消息(其后的消息移出当前分支,文本回填输入框)`,"Conversation only":`仅回退对话`,"Conversation + files":`对话+还原文件`,"Rewind and restore files to before this turn":`回退对话并把工作树还原到这一轮之前(git 项目有效)`,"Rewind to this message?":`回退到这条消息?`,"Later messages leave the current branch; the text returns to the input box.":`其后的消息将移出当前分支,该消息文本回填输入框。`,"Later messages leave the current branch and working-tree files are restored to before this turn.":`其后的消息将移出当前分支,并把工作树文件还原到这一轮开始之前。`,"Remove project?":`移除项目?`,"Delete conversation?":`删除对话?`,'"{{name}}" and its {{count}} conversations will be removed from the list.':`将从列表移除「{{name}}」及其 {{count}} 个对话。`,"This conversation will be removed from the list.":`该对话将从列表移除。`,Reasoning:`推理`,"Load local skills":`加载本机 skill`,Presets:`预设`,"New preset":`新建预设`,"Edit preset":`编辑预设`,"Role descriptions, skills, MCP servers and instruction files, chosen per conversation":`角色描述 / 技能 / MCP / 指令文件的组合,按对话选用`,"View default role description":`查看默认角色描述`,"Custom role":`自定义角色`,"Role description":`角色描述`,"Replace pi opening role description":`替换 pi 开头的角色描述`,"Built-in default (read-only)":`内置默认(只读)`,"System prompt cannot be empty":`系统提示词不能为空`,"Failed to save system prompt":`系统提示词保存失败`,"Failed to read system prompt":`系统提示词读取失败`,"Only replaces the opening role paragraph. Available tools and everything after it stay unchanged. Applies to new and cold-restored sessions.":`仅替换开头的角色段落,Available tools 及之后的全部内容保持不变。新建及冷恢复的会话生效。`,"This is the pi opening role paragraph. Custom presets replace only this paragraph; tools, guidelines and project context stay unchanged.":`这是 pi 开头的角色段落。自定义预设只替换这段,工具、使用准则和项目上下文均保持不变。`,Global:`全局`,"Set as default":`设为默认`,"Plugin preset unavailable":`插件预设不可用`,"Bundled by {{plugin}}":`由插件 {{plugin}} 提供`,"Overlay plugin preset":`叠加插件预设`,"No overlay":`不叠加`,"Unavailable plugin preset":`插件预设不可用`,"Also loads the plugin preset's prompts, skills and overrides. Tails are joined (this preset first); the plugin's role, boost and refusal retry win. Ignored while the plugin is disabled.":`额外加载插件预设的提示词、skill 和覆盖项。两边的尾段依次拼接(本预设在前),角色、加强段和推脱补发以插件为准。插件停用时忽略。`,Default:`默认`,None:`不注入`,"Injection bundles of skills, MCP servers and instruction files, chosen per conversation":`skill / MCP / 指令文件的注入组合,按对话选用`,"Follows the enabled switches on the Skills / MCP / Instructions pages":`跟随技能 / MCP / 指令文件页的启用开关`,"{{skills}} skills · {{mcp}} MCP · {{instruction}} instruction":`{{skills}} 个技能 · {{mcp}} 个 MCP · {{instruction}} 份指令`,Tail:`真尾`,Boost:`Boost`,"Refusal retry":`拒答补发`,"Refusal retry prompt":`拒答补发正文`,Advanced:`高级`,"Request headers":`请求头`,"Add header":`添加请求头`,"Remove header":`移除请求头`,"Header values can only contain tab and single-byte characters (no Chinese, newlines, or NUL).":`请求头的值只能包含制表符和单字节字符(不能有中文、换行或空字符)。`,"Rewrites the role paragraph or appends text to the system prompt.":`改写角色段落,或往系统提示词末尾追加内容。`,"Import URL":`从 URL 导入`,"https://example.com/preset.json":`https://example.com/preset.json`,"Pinned after skills and working directory. Child sessions inherit this text.":`钉在 skills 和工作目录之后。子会话会继承这段文字。`,"Short override block after the tail. Child sessions inherit this text.":`接在真尾之后的短覆盖块。子会话会继承这段文字。`,"If the model refuses, send this once per turn as an internal follow-up. Child sessions inherit it.":`模型推脱时,每轮内部补发一次。子会话会继承。`,"Import hints (not selected): {{skills}} / {{mcp}}":`导入提示(未勾选):{{skills}} / {{mcp}}`,"Let the agent auto-discover skills under .agents/skills and .pi/skills":`让 agent 自动发现 .agents/skills、.pi/skills 下的 skill`,"Explore fold":`探后折叠`,"Explore mark":`开始探索`,"Turn discard":`丢弃本轮`,"Turn recall":`取回已丢弃`,Goal:`目标`,"Show process":`展开过程`,"Hide process":`收起过程`,Subagent:`子代理`,"Read report":`查看报告`,Wait:`等待`,"Dismiss agent":`解雇`,"List agents":`列出全部`,"Resume agent":`续跑`,"awaiting input":`等待输入`,validating:`校验中`,interrupted:`已中断`,"Run info":`运行信息`,"Timed out; unfinished agents keep running":`等待超时,未结束的子代理仍在运行`,"Wait was interrupted":`等待被打断`,creating:`创建中`,idle:`空闲`,parked:`已休眠`,closed:`已关闭`,"No agents":`没有子代理`,"Ask user":`询问用户`,"Task output":`查看后台任务`,"Task stop":`停止后台任务`,"Message coworker":`联系队员`,"Message main agent":`联系主 agent`,"Enso app":`Enso 应用`,"Recall memory":`回溯记忆`,"Memory search":`搜索记忆`,"Memory capture":`记录记忆`,"Memory crystallize":`提炼记忆`,"Memory delete":`删除记忆`,"Browser navigate":`浏览器 · 打开`,"Browser snapshot":`浏览器 · 快照`,"Browser click":`浏览器 · 点击`,"Browser type":`浏览器 · 输入`,"Browser tabs":`浏览器 · 标签页`,"Browser lock":`浏览器 · 锁定`,"Browser fill":`浏览器 · 填写`,"Browser press key":`浏览器 · 按键`,"Browser scroll":`浏览器 · 滚动`,"Browser select option":`浏览器 · 选择选项`,"Browser click xy":`浏览器 · 坐标点击`,"Browser drag":`浏览器 · 拖拽`,"Browser highlight":`浏览器 · 高亮`,"Browser bounding box":`浏览器 · 元素位置`,"Browser screenshot":`浏览器 · 截图`,"Browser CDP":`浏览器 · CDP`,"Let the agent mark exploratory reads and keep only a short report in later model context. Timeline stays intact.":`让模型在探仓库前打点,探完只把报告留在后续模型上下文里;时间线仍完整。`,"File edit mode":`文件编辑模式`,"Choose how files are modified. Apply patch is the default. New and cold-restored sessions use this mode; already warm sessions keep their current mode.":`选择文件修改方式。默认为应用补丁。新建和冷恢复的会话使用此模式;已在内存中的会话保持原模式。`,"Text replacement":`文本替换`,"Apply patch":`应用补丁`,"Tool search":`工具检索`,"Apply patch (default)":`应用补丁(默认)`,"Truncated preview":`截断预览`,"Diff unavailable because the original snapshot was truncated.":`原始快照已截断,无法显示完整差异。`,"Load project harness assets":`加载项目内其它工具目录`,"Also load skills from .claude/.codex/.cursor and rule files (.cursorrules, .cursor/rules, .claude/rules) in the project":`同时加载项目内 .claude/.codex/.cursor 下的 skills,以及规则文件(.cursorrules、.cursor/rules、.claude/rules)`,Custom:`自定义`,"Remove provider?":`删除该配置?`,"Removing this also signs out {{name}}. Other accounts for the same vendor stay signed in.":`删除会同时退登「{{name}}」。同一厂商下的其他账号仍保持登录。`,'This permanently deletes the "{{name}}" provider configuration.':`将永久删除「{{name}}」这项配置。`,"Sign-out failed: {{message}}":`退登失败:{{message}}`,Retry:`重试`,"This panel crashed":`面板出错了`,"Copy error":`复制错误`,"Loading secretary…":`正在读取秘书状态…`,"Auto-retrying ({{attempt}}/{{max}})":`自动重试中 ({{attempt}}/{{max}})`,"Auto-retrying ({{attempt}})":`自动重试中(第 {{attempt}} 次)`,"retrying in {{seconds}}s":`{{seconds}}s 后重试`,"retrying…":`正在重试…`,"Cancel auto-retry":`取消自动重试`,"Delete anyway":`仍要删除`,Overridden:`已覆盖`,Catalog:`catalog`,Inherit:`跟随`,On:`开`,Off:`关`,"Thinking level":`思考档位`,Context:`上下文`,"Max tokens":`最大输出`,"Context window":`上下文窗口`,Estimate:`估算`,"Enabled instructions":`已启用指令`,"Enabled skills":`已启用 Skill`,"Tool definitions":`工具定义`,Conversation:`对话正文`,"Compaction summary":`压缩摘要`,Reminders:`续跑提示`,"{{count}} older messages are folded into the summary":`{{count}} 条旧消息已不在窗口,只留摘要`,"Current summary was produced by another model family":`当前摘要由另一模型生成`,"Context occupancy unavailable until the session starts":`会话启动后才能查看拆账`,"Conversation branch":`对话分支`,"Compact context":`压缩上下文`,"Compaction failed":`压缩失败`,"Compacting…":`正在压缩…`,"Compacts after this turn":`本轮结束后压缩`,"Compaction already in progress":`正在压缩中,请等待完成`,"Compaction is queued and runs after this turn":`压缩已排队,本轮结束后自动执行`,"Session not started yet — nothing to compact":`会话尚未启动,暂无可压缩的上下文`,"Workspace operation in progress — compact again when it finishes":`工作区操作进行中(切换分支、worktree 等),完成后再压缩`,"Workspace operation in progress":`工作区操作进行中`,"Compact the context now (/compact [summary focus])":`立即压缩上下文(/compact [摘要侧重])`,"Keep this session and start a parallel one from here":`保留源线,从这里开对话分支`,"Branched from {{title}}":`分支自 {{title}}`,"Estimated context window (catalog fallback)":`上下文窗口为估算值(取自模型目录回退)`,"{{model}} does not support reasoning":`{{model}} 不支持推理`,"Filter models in this entry":`在此配置内筛选模型`,"Showing {{shown}} of {{total}} models":`显示 {{shown}} / 共 {{total}} 个模型`,"Status line settings":`状态栏设置`,"Session stats":`会话统计`,"Recent request body":`最近请求体`,"Serialized payload":`已序列化`,"Before send":`发送前`,"Blocked before send":`超限,未发送`,"No data yet":`暂无数据`,"{{count}} coworkers":`{{count}} 名队员`,"Drag to reorder":`拖动排序`,Turns:`轮次`,Duration:`耗时`,Speed:`速度`,Tokens:`Token 用量`,"Cache hit rate":`缓存命中率`,"Session name":`会话名称`,"Approval mode":`审批档位`,Coworkers:`队员`,"Session time":`会话时长`,"Subscription usage":`订阅额度`,"resets in {{remaining}}":`{{remaining}} 后重置`,Minimal:`简洁`,Full:`完整`,Min:`极低`,Low:`低`,Medium:`中`,Med:`中`,High:`高`,Extra:`极高`,"Extra High":`极高`,Max:`最高`,"Loading diff…":`加载 diff…`,Copy:`复制`,Description:`描述`,Source:`来源`,"This computer":`本机`,"Switch node":`切换节点`,"{{n}} remote":`{{n}} 个远程`,"Connect to a node":`连接到节点`,"Connect to a node…":`连接到节点…`,Connect:`连接`,Create:`创建`,Project:`项目`,"No conversations":`没有会话`,"Connecting…":`连接中…`,"Remote desktop is offline":`对方桌面离线`,"Directory not found.":`目录不存在。`,"Project path is not a directory.":`项目路径不是目录。`,"On the other computer open Settings → Devices, generate a pairing code and copy the link. Paste it here.":`在对方电脑打开「设置 → 设备」,生成配对码并复制链接,粘到这里。`,"That is not an EnsoCode pairing link.":`这不是 EnsoCode 配对链接。`,"This pairing link has expired or was already used. Generate a new one.":`配对链接已过期或已被使用,请重新生成。`,"Could not reach the relay. Check your network and try again.":`无法连接中继,请检查网络后重试。`,Devices:`设备`,"Allow connections":`允许连入`,"Let your phone or another EnsoCode desktop connect to this computer. Keep this app running.":`让手机或另一台 EnsoCode 桌面连到这台电脑。需保持本应用运行。`,"Generate pairing code":`生成配对码`,"On another EnsoCode desktop, paste the link below into Settings → Devices → Connect to a node.":`在另一台 EnsoCode 桌面,把下方链接粘到「设置 → 设备 → 连接到节点」。`,"Generate a pairing code to let a phone or another desktop connect.":`生成配对码,让手机或另一台桌面连入。`,"Waiting for device":`等待设备`,"Direct link":`直连`,"Via relay":`中继`,Connected:`已连接`,"Desktop is offline":`桌面端离线`,"Pairing expired":`配对已失效`,"Reconnecting…":`重连中…`,"Turn on notifications":`开启推送通知`,"Turn off notifications":`关闭推送通知`,"Push notifications":`推送通知`,"Computers and notifications":`电脑与通知`,"Turning on notifications…":`正在开启推送…`,"Notifications need a newer desktop app.":`需先升级桌面端才能开启推送。`,"Add this app to the Home Screen before notifications can be turned on.":`iOS 需先用分享菜单「添加到主屏幕」,从主屏幕打开后才能开启。`,"This browser cannot show notifications.":`当前浏览器不支持推送。`,"Notification permission was denied. Allow notifications for this site and try again.":`通知权限被拒绝,请在浏览器站点设置中允许后重试。`,"Cannot reach the push service. Check the network or proxy and try again.":`无法连接推送服务,请检查网络或代理后重试。`,"Could not turn on notifications.":`无法开启推送。`,"View only":`只读`,"Can operate":`可操作`,"Click to switch: view-only devices cannot send, approve or stop.":`点击切换:只读设备不能发送、审批或停止。`,Copied:`已复制`,"Copy image":`复制图片`,"Image copied":`图片已复制`,"Image {{n}}":`图片 {{n}}`,"Image {{n}} not accepted: {{reason}}":`图片 {{n}} 未收下:{{reason}}`,"over 10 MB, not saved":`超过 10MB,没有保存`,"not a png / jpeg / webp / gif image, not saved":`不是 png / jpeg / webp / gif 图片,没有保存`,"could not be saved":`没能保存`,"Could not copy image":`复制图片失败`,"Copy failed":`复制失败`,"Browse and drive conversations on another EnsoCode desktop. Its agent, keys and history stay there.":`浏览并操控另一台 EnsoCode 桌面上的会话。agent、密钥与历史都留在对方机器上。`,"Connected nodes":`已连接的节点`,"No connected nodes":`还没有连接节点`,"Each connecting computer needs its own pairing code from the other desktop.":`每台要连入的电脑都需要对方桌面单独生成一个配对码。`,Disconnect:`断开`,"Configuration transfer":`配置迁移`,"Move models, presets, agent types, skills, MCP servers and instruction files between devices.":`在设备之间迁移模型、预设、子代理类型、技能、MCP 服务和指令文件。`,"Portable Enso configuration":`可移植 Enso 配置`,"Export a package or preview one before importing it.":`导出配置包,或在导入前预览配置包。`,"Import configuration":`导入配置`,"Export configuration":`导出配置`,Export:`导出`,"OAuth login sessions are never transferred. Skill, instruction, and system prompt contents require an encrypted export.":`OAuth 登录态不会迁移。技能、指令和系统提示词正文需要使用加密导出。`,"Create a portable .enso-config package for another device.":`创建可在另一台设备使用的 .enso-config 配置包。`,"File contents can be private":`文件内容可能包含私密信息`,"Skill and instruction file contents may contain private data, so configurations containing them can only be exported with encryption.":`技能和指令文件内容可能包含私密信息,因此包含这些文件的配置只能使用加密导出。`,"Include sensitive configuration":`包含敏感配置`,"Encrypt the entire package with a password. OAuth login sessions are still excluded.":`使用密码加密整个配置包。OAuth 登录态仍不会包含在内。`,"API keys, provider account links, MCP arguments and environment values, plus credentials and private URL parts in MCP endpoints, will be omitted. Configurations containing skill or instruction files require encryption.":`API Key、模型服务账号关联、MCP 参数和环境变量,以及 MCP 地址中的凭据和私密 URL 部分都会被省略。包含技能或指令文件的配置需要加密导出。`,"Encryption password":`加密密码`,"Confirm password":`确认密码`,"Use at least 8 characters. This password cannot be recovered.":`请使用至少 8 个字符。此密码无法恢复。`,"Password must be at least 8 characters.":`密码至少需要 8 个字符。`,"Passwords do not match.":`两次输入的密码不一致。`,"Configuration exported":`配置已导出`,"Saved package:":`配置包已保存至:`,"Export cancelled.":`导出已取消。`,"Exporting…":`正在导出…`,"Could not export configuration.":`无法导出配置。`,"Encrypted configuration package":`加密配置包`,"Enter the export password to decrypt and preview this package.":`请输入导出时设置的密码,以解密并预览此配置包。`,"Review {{fileName}} before changing this device.":`修改此设备前,请预览 {{fileName}}。`,"Import mode":`导入模式`,Merge:`合并`,"Add and update matching items while keeping items only on this device.":`新增并更新匹配条目,同时保留此设备独有的条目。`,Replace:`替换`,"Replace transferred item categories, removing local-only items in them.":`替换迁移的条目类别,并删除其中此设备独有的条目。`,"Preparing preview…":`正在准备预览…`,Category:`类别`,Added:`新增`,"Subagent Models":`子代理模型`,"Scalar settings":`标量设置`,"Portable settings changed:":`变更的可移植设置:`,Updated:`更新`,Skipped:`跳过`,Removed:`删除`,"Local-only configuration will be deleted":`此设备独有的配置将被删除`,"Items in transferred collections that exist only on this device will be removed. Removed counts are shown above. Included portable preferences are overwritten. A complete backup is created first.":`迁移集合中仅存在于此设备的条目将被删除。上方会显示删除数量。包含的可移植偏好会被覆盖,并会先创建完整备份。`,"Only import packages you trust":`只导入你信任的配置包`,"An imported package can change portable preferences and configuration. Skills and MCP servers may also run commands later when you use them. Previewing does not execute them; continue only if you trust the package.":`导入的配置包可以修改可移植偏好和配置。技能和 MCP 服务在之后使用时也可能运行命令。预览过程不会执行它们;请仅在信任配置包时继续。`,"Confirm configuration import":`确认导入配置`,"This package can change portable preferences and configuration. Continue only if you trust this package.":`此配置包可以修改可移植偏好和配置。请仅在信任此配置包时继续。`,"It includes skills or MCP servers that may execute commands when you use them.":`它包含在使用时可能执行命令的技能或 MCP 服务。`,"Replace mode removes local-only items from transferred collections and overwrites included portable preferences. A complete backup will be created first.":`替换模式会删除迁移集合中此设备独有的条目,并覆盖包中包含的可移植偏好。替换前会先创建完整备份。`,"Do you want to continue with this import?":`要继续导入吗?`,"Confirm import":`确认导入`,"Sensitive provider or MCP values were omitted; existing local values were preserved when available.":`敏感的模型服务或 MCP 配置值已省略;如本机已有对应值,则会保留。`,"OAuth login state is not included; sign in again after import.":`配置包不包含 OAuth 登录态;导入后请重新登录。`,"Imported MCP servers may require external commands, packages, or paths.":`导入的 MCP 服务可能依赖外部命令、软件包或本机路径。`,"Refresh preview":`刷新预览`,"Importing…":`正在导入…`,"Could not open configuration package.":`无法打开配置包。`,"Could not preview configuration package.":`无法预览配置包。`,"Could not import configuration.":`无法导入配置。`,"Invalid export options":`导出选项无效。`,"Invalid export request.":`导出请求无效。`,"Export password is too short.":`导出密码太短。`,"Configuration package is too large.":`配置包过大。`,"Unable to export configuration.":`无法导出配置。`,"A preset uses a system prompt that is missing or empty.":`有预设引用的系统提示词不存在或为空。`,"Could not write the export file. Check that the folder is writable.":`无法写入导出文件,请确认所选文件夹可写。`,"The selected file is a symbolic link. Choose a different location.":`所选文件是符号链接,请换一个位置保存。`,"These instructions were skipped because their source files are missing or unreadable:":`以下指令的源文件已丢失或无法读取,未包含在配置包中:`,"Skill, instruction, and system prompt contents require an encrypted export.":`技能、指令和系统提示词正文需要使用加密导出。`,"Invalid import request.":`导入请求无效。`,"Invalid configuration package.":`配置包无效。`,"Unable to read configuration package.":`无法读取配置包。`,"Invalid import preview request.":`导入预览请求无效。`,"Import session expired.":`导入会话已过期。`,"Import password is required.":`请输入导入密码。`,"Invalid import commit request.":`导入提交请求无效。`,"Import must be previewed before commit.":`提交导入前必须先预览。`,"Unable to commit configuration.":`无法提交配置。`,"Settings changed since preview; preview again.":`预览后设置发生了变化,请重新预览。`,"Unable to flush pending settings writes.":`无法刷新待写入的设置。`,"Unable to create settings backup.":`无法创建设置备份。`,"Unable to write settings.":`无法写入设置。`,"Import cancelled.":`导入已取消。`,"Configuration imported":`配置已导入`,"This window has been refreshed with the imported settings.":`此窗口已刷新为导入后的设置。`,"Configuration was imported, but this window could not refresh automatically.":`配置已导入,但此窗口无法自动刷新。`,"Reopen Settings to load the imported configuration in this window.":`请重新打开设置,以在此窗口载入导入后的配置。`,"Import complete":`导入完成`,"Backup of previous settings:":`之前设置的备份位置:`,Btw:`旁路`,Contextual:`带上下文`,Tangent:`独立旁路`,"Insert into chat":`填入主输入框`,"Ask aside…":`旁路提问…`,"Ask a side question without sending it to the main agent.":`旁路提问,不会发给主 agent。`,"New Btw tab":`新建旁路标签`,"Open a Btw tab in the side panel":`在右侧栏打开旁路对话`,"Unified agents: delegate one-shot tasks or keep persistent coworkers under Main control":`统一 Agent:委派一次性任务,或在 Main 控制下保留持久 coworker`,"Unified agent modes":`统一 Agent 模式`,"Choose which Agent modes the unified subagent tool may create in new sessions.":`选择统一 subagent 工具可在新会话中创建哪些 Agent 模式。`,"One-shot task agents":`一次性任务 Agent`,"Persistent coworkers":`持久 coworker`,"The unified subagent tool is off. Re-enabling it keeps this mode selection.":`统一 subagent 工具已关闭。重新开启时会保留此模式选择。`,"Follow global unified agent modes":`跟随全局统一 Agent 模式`,"When off, this project uses its own explicit Agent mode permission mask.":`关闭后,此项目使用自己明确配置的 Agent 模式权限掩码。`,Resources:`资源`,"Recent errors and log export. API keys, tokens and passwords are masked.":`最近的错误与日志导出。API Key、Token、密码等已脱敏。`,"Recent errors":`最近错误`,"Errors only":`仅错误`,"Warnings and errors":`警告及以上`,"No errors recorded.":`暂无错误记录。`,"Agent worker":`Agent 进程`,"Export logs":`导出日志`,"Pack logs from the selected period into a zip file for troubleshooting.":`把所选时间段内的日志打包成 zip,便于排查问题。`,"Time range":`时间范围`,"Last hour":`最近 1 小时`,"Last 6 hours":`最近 6 小时`,"Last 24 hours":`最近 24 小时`,"Last 3 days":`最近 3 天`,"Exporting...":`导出中...`,"Logs exported":`日志已导出`,"Log export failed":`日志导出失败`,"CPU, memory and disk usage of EnsoCode and the processes it started.":`EnsoCode 及其启动的进程占用的 CPU、内存和磁盘。`,RAM:`内存`,Storage:`存储`,"App processes":`应用进程`,"Agent and tools":`Agent 与工具`,"Other child processes":`其他子进程`,"Scanning...":`扫描中...`,Clean:`清理`,"Cleaning...":`清理中...`,"Clean {{name}}?":`清理{{name}}?`,"You will be signed out of sites opened in the built-in browser.":`内置浏览器中打开过的网站将退出登录。`,"Deleted files cannot be restored.":`删除的文件无法恢复。`,"Show in folder":`在文件夹中显示`,"Conversation history":`对话记录`,"Conversation transcripts and usage ledger.":`对话记录文件与用量账本。`,"Coworker transcripts":`Coworker 记录`,"Secretary images":`秘书图片`,"Images sent to the secretary. Cleaning removes only images no message references any more and older than 7 days; referenced images are kept.":`发给秘书的图片。清理只删已不被任何消息引用、且超过 7 天的图片,仍被引用的保留。`,"Coworker journals; only those of deleted conversations are cleaned.":`Coworker 的对话记录;只清理已删除会话留下的。`,"Tool outputs":`工具输出`,"Saved long tool outputs; only those of deleted conversations are cleaned.":`落盘的超长工具输出;只清理已删除会话留下的。`,"Memory database and working memory.":`记忆数据库与工作记忆。`,"Local models":`本地模型`,"Downloaded embedding and chat models.":`已下载的嵌入与对话模型。`,Runtimes:`运行时`,"Bundled tools and GPU backends.":`内置工具与 GPU 后端。`,Worktrees:`Worktree`,"Isolated worktrees created for conversations.":`为会话创建的隔离 worktree。`,"Change snapshots":`变更快照`,"Baselines for the Changes panel.":`Changes 面板的编辑前基线。`,"Cookies, storage and cache of the built-in browser.":`内置浏览器的 Cookie、存储与缓存。`,"Rebuildable caches; cleaning is safe.":`可重建的缓存,清理是安全的。`,Logs:`日志`,"Task and memory logs; files written in the last 24 hours are kept.":`任务与记忆日志;保留最近 24 小时写入的文件。`,Backups:`备份`,"Configuration backup files; files from the last 24 hours are kept.":`配置备份文件;保留最近 24 小时内的文件。`,Configuration:`配置`,"Settings, instructions, prompts and credentials.":`设置、指令、提示词与凭证。`,"Chromium profile data and other files.":`Chromium 配置数据及其他文件。`,"Main process":`主进程`,"Main window":`主窗口`,Window:`窗口`,"Built-in browser":`内置浏览器`,Service:`服务`,Tool:`工具`,"Child process":`子进程`,"App data":`应用数据`,"Worktree directory":`Worktree 目录`,"Freed {{size}}":`释放 {{size}}`,"{{count}} files removed":`删除 {{count}} 个文件`,"{{count}} kept":`保留 {{count}} 个`,"{{count}} failed":`{{count}} 个失败`,"{{name}} cleaned":`已清理{{name}}`,"{{count}} conversations deleted":`已删除 {{count}} 个会话`,"Scanning {{count}} files · {{size}}":`正在扫描 {{count}} 个文件 · {{size}}`,"Scanned at {{time}} · took {{seconds}}s":`扫描于 {{time}} · 用时 {{seconds}} 秒`,"{{count}} paths could not be read and are not counted.":`{{count}} 个路径无法读取,未计入。`,"Include unarchived":`包含未归档会话`,'Delete "{{title}}"?':`删除「{{title}}」?`,"Delete {{count}} conversations?":`删除 {{count}} 个会话?`,"Delete {{count}} conversations in {{project}}?":`删除「{{project}}」下的 {{count}} 个会话?`,"About {{size}} of history, tool output and isolated worktrees will be removed and cannot be restored.":`将删除约 {{size}} 的对话记录、工具输出和隔离 worktree,无法恢复。`,"Open, running and waiting conversations are skipped.":`当前打开、运行中和等待处理的会话会跳过。`,"This chat is archived. Restore it before sending.":`该聊天已归档,恢复后才能发送。`,"Without @, the group owner replies":`不 @ 时由群主回复`,"{{name}} is replying; new messages are routed after they finish":`{{name}}回复中,新消息会在他说完后重新分配`,"Queued until a session slot frees up":`排队中,等有空闲会话名额后开始`,"Queued and has not started yet":`排队中,还没开始`,"{{name}} is working; your message joins the current turn":`{{name}}正在工作,新消息会插入当前这一轮`,"Message not sent":`消息未发送`,"{{n}} members · Owner {{name}}":`{{n}} 名成员 · 群主 {{name}}`,"Group info":`群信息`,"Member profile":`成员资料`,"Message {{name}}…":`给 {{name}} 发消息…`,"@ a member, or just say it…":`@ 成员,或直接说…`,Working:`工作中`,Idle:`空闲`,"Say hi to {{name}}":`和 {{name}} 打个招呼`,"{{name}} needs you":`{{name}} 需要你处理`,"Deleted member":`已删除成员`,everyone:`所有人`,"Mention a member":`提及成员`,"Reference a chat":`引用聊天`,"Unavailable chat":`不可用的聊天`,"Direct chat":`私聊`,"Referenced chat":`引用的聊天`,"Dispatch hint: {{note}}":`分派提示:{{note}}`,"The referenced chat no longer exists.":`引用的聊天已不存在。`,"A chat cannot reference itself.":`不能引用当前聊天本身。`,"The file is not inside this chat's workspace.":`文件不在该聊天的工作区内。`,"This skill is not available to the member.":`该成员没有这个技能。`,"{{names}} cannot use this skill; they will be told it is unavailable":`{{names}} 没有这个技能,投递时会告知其不可用`,"The member is busy. Try again after the current turn.":`成员正忙,请等这一轮结束后再试。`,"That message is no longer on the current branch.":`这条消息已不在当前分支上。`,"Custom color":`自定义颜色`,Inbox:`收件箱`,"Everything members are waiting on you for":`所有成员待你处理的事`,"Nothing needs your attention":`暂无待处理事项`,Approval:`审批`,"Go to chat":`去聊天`,"Always allow in this session":`本会话总是允许`,"Custom answer…":`自定义回答…`,Reply:`回复`,"{{name}} owns group chats":`{{name}} 是群主`,"Choose another owner in {{groups}} first.":`请先在「{{groups}}」中更换群主。`,"Export character card":`导出人物卡`,'Exports a SillyTavern V2 PNG: the avatar as image, persona embedded. Restore it in a new member via "Import character card".':`导出 SillyTavern V2 PNG:图片是头像,人设已嵌在其中。可在新建成员时用「导入人物卡」还原。`,'Persona embedded in the PNG. Restore it in a new member via "Import character card".':`人设已嵌在图片里,可在新建成员时用「导入人物卡」还原。`,Profile:`资料`,Abilities:`能力`,Routines:`例行`,History:`历史`,"Used for @ in groups; must be unique":`群内 @ 用,必须唯一`,Title:`头衔`,"Used for routing and the delegation directory":`用于路由和委派目录`,Responsibilities:`职责`,Persona:`人设`,"Avatar color":`头像颜色`,"Archive member":`归档成员`,Tools:`工具`,"All tools":`全部工具`,"Can delegate to":`可委派给`,"Accepts delegation from":`接受来自`,"Long-term memory":`长期记忆`,"No memories yet":`还没有记忆`,Discard:`放弃修改`,"Delete {{name}}?":`彻底删除 {{name}}?`,"Archive {{name}}?":`归档 {{name}}?`,"The member, their private chats, persona, memories and workspace are deleted. This cannot be undone.":`成员本身、与其的私聊、人设、记忆和工作区都会被删除,无法恢复。`,"Archived members stop replying and are hidden from the list. You can restore them later.":`归档后成员不再回复,并从列表隐藏,之后可以恢复。`,"All members":`所有成员`,"Selected members":`指定成员`,"No other members":`没有其他成员`,"Routines are coming soon.":`例行任务即将推出。`,"No routines yet":`还没有例行任务`,"Posts to {{chat}}":`投递到「{{chat}}」`,Paused:`已暂停`,"Conversation {{n}}":`会话 {{n}}`,"Group chats":`群聊`,"New group chat":`新建群聊`,"No group chats yet":`还没有群聊`,Members:`成员`,Member:`成员`,"New member":`新建成员`,"No members yet":`还没有成员`,"Nothing archived":`没有已归档的内容`,"Switch between Code and Bot":`切换 Code / Bot 模式`,"Only when Bot mode is enabled in Experimental settings":`需先在实验设置中开启 Bot 模式`,"Search Code projects or recent folders...":`搜索 Code 项目或最近打开的目录...`,"Chat threads":`聊天`,"Delete group chat?":`删除群聊?`,"The group timeline and its standalone workspace are deleted. Member sessions stay readable in their history.":`群聊记录及其独立工作区会被删除;成员的会话仍可在其历史中只读查看。`,"Archive chat":`归档聊天`,"Delete group chat":`删除群聊`,"Clone group chat":`克隆群聊`,Clone:`克隆`,"{{title}} copy":`{{title}} 的副本`,"Copies the setup of “{{title}}”. The original stays as is; replies in progress are not stopped.":`从「{{title}}」复制配置。原群保持原样,正在跑的回复也不会停。`,"Will copy":`会复制`,"Not copied":`不复制`,Routing:`分派`,"Relay {{hops}} · {{turns}} replies each":`接力 {{hops}} · 每人 {{turns}} 条`,"Same project: {{name}}":`沿用同一项目:{{name}}`,"A new empty folder, separate from the original":`新建空目录,和原群互不影响`,"Chat history, group notes, routines, task board and group memory":`聊天记录(新群是空的)、群笔记、例行任务、任务板、群记忆`,"Cloned. The chat history is empty.":`已克隆。聊天记录是空的。`,Topics:`话题`,"New topic":`新话题`,"Main topic":`主话题`,"Rename topic":`重命名话题`,"Delete topic":`删除话题`,"Delete this topic?":`删除这个话题?`,"Its messages and member sessions are removed; replies in progress are stopped. Group notes, memory and the task board stay.":`话题里的消息和成员会话会被删除,正在进行的回复会停止。群笔记、群记忆和任务看板保留。`,"Could not create topic":`无法新建话题`,"All topics ({{n}})":`全部话题({{n}})`,"Search topics...":`搜索话题...`,"No matching topics":`没有匹配的话题`,"All conversations ({{n}})":`全部对话({{n}})`,"Untitled conversation":`未命名对话`,"Workspace changed; view only":`工作目录已更换,只能查看`,"Switch conversation?":`切换对话?`,"The reply in progress will be stopped.":`正在进行的回复会停止。`,Switch:`切换`,Unread:`未读`,"Earlier conversation · {{n}} messages":`上一段对话 · {{n}} 条`,"Collapse earlier conversation":`收起上一段对话`,"Create members with their own persona, model and tools, then chat with them alone or in groups.":`创建拥有各自人设、模型和工具的成员,然后与他们私聊或拉群协作。`,"Pick a member or a group chat on the left.":`在左侧选择成员或群聊。`,"Group name":`群名`,Owner:`群主`,"Make owner":`设为群主`,"Remove from group":`移出群聊`,"Add member":`添加成员`,"Reply queue":`回复队列`,"relay {{n}}/{{max}}":`@ 接力 {{n}}/{{max}}`,Waiting:`排队`,"Per-member limit":`每人上限`,"{{n}} replies":`{{n}} 次`,Workspace:`工作区`,"Shared by all members":`所有成员共享`,"Routing limits":`路由上限`,"@ relay limit":`@ 接力上限`,"Replies per member":`每人回复次数`,"Group memory":`群记忆`,"No group memories yet":`还没有群记忆`,"Core notes":`核心笔记`,"Group notes":`群笔记`,"Injected into every new conversation":`每次新对话自动带上`,"Edit notes":`编辑笔记`,"Save failed":`保存失败`,"Notes were updated elsewhere; reloaded the latest version":`笔记已被更新,已加载最新版本`,"No notes yet. Key preferences and facts are summarized here automatically after memories are organized.":`还没有笔记。整理记忆后,重要的偏好和事实会自动汇总到这里。`,"No group notes yet. Group conventions and decisions are summarized here automatically after memories are organized.":`还没有群笔记。整理记忆后,群里的约定和决定会自动汇总到这里。`,"Beginning of the chat":`已经到顶了`,"Back to latest":`回到最新`,"Back to latest · {{n}} new":`回到最新 · {{n}} 条新消息`,"Say something. Mention a member with @, or the group owner replies.":`说点什么吧。@ 某个成员,或由群主来回复。`,Replying:`正在回复`,"View live":`实时查看`,Thinking:`思考中`,"Writing reply":`输出中`,"Calling tools":`调用工具`,Retrying:`重试中`,Denied:`已拒绝`,"Queued · concurrency limit reached":`排队中 · 并发已满`,"Queued · waiting for the current turn to finish":`排队中 · 等上一轮结束`,"Queued · checking whether tasks can run in parallel":`排队中 · 正在判断是否可并行`,"Queued · waiting for the member's current task to finish":`排队中 · 等待成员当前任务完成`,"Queued · waiting for the member's earlier tasks":`排队中 · 等待成员前序任务`,"Queued · waiting for the member to stop":`排队中 · 等待成员停止完成`,"Insert into {{name}}’s current task":`插到 {{name}} 当前任务`,Free:`空闲`,Planning:`思考`,Busy:`执行`,"Needs you":`等待`,"Demand threads":`需求线程`,"Thread owner":`绑定主人`,"Thread external":`外部`,"Handled by {{session}}":`负责会话 {{session}}`,Stuck:`异常`,Finished:`完成`,"In line":`排队中`,Task:`任务`,From:`谁派的`,Time:`用时`,"Waiting on":`在等`,"Nothing in progress":`没有进行中的事`,"Go handle it":`去处理`,"Your approval: {{title}}":`你批准:{{title}}`,"Your answer: {{title}}":`你回答:{{title}}`,"{{holder}} is editing {{file}}":`{{holder}} 改完 {{file}}`,"{{holder}} is running a workspace-wide command":`{{holder}} 跑完整个仓库的命令`,"A free slot (concurrency limit, not a person)":`空位(并发已满,不是在等某个人)`,"Its previous turn to finish":`上一轮结束`,"Still running, no output for {{time}}":`还在跑,但已经 {{time}} 没有输出`,"{{name}} is using this tab":`{{name}} 正在用这个标签页`,Delegation:`委派`,"In progress":`进行中`,"Running sessions and what needs you":`进行中的会话,以及需要你处理的`,"Today's board; optional date":`今天的看板;可带日期,如 /board 2026-05-20`,"Recent activity, with an older button":`最近的动态,底部可翻更早`,"Open todos":`未完成的待办`,"Scheduled tasks and next run":`定时任务与下次运行时间`,"Memory titles (off by default)":`秘书记得的标题(默认关闭)`,"Replay the last round; /last 3 for three":`回看秘书会话最近一轮;/last 3 看最近三轮`,"Mirror every reply here; /sync off stops it":`把所有回复同步到手机;/sync off 关掉`,"List every command":`列出所有命令`,"Commands you can send":`可以发的命令`,"Only groups on this list reach the secretary, and only messages from the bound account count. Messages from anyone else in the group are not received.":`只有名单里的群会进秘书,而且只认绑定的那个账号。群里其他人的话不会收。`,"No groups yet: group messages are not received.":`名单为空:群消息一律不收。`,"Group chat ID, e.g. -1001234567890":`群 chatId,例如 -1001234567890`,"Add group":`添加`,"Remove {{name}}":`删除 {{name}}`,"Group chat IDs are numbers, e.g. -1001234567890":`群 chatId 是数字,例如 -1001234567890`,"General (default topic)":`General(默认话题)`,"Topic #{{id}}":`话题 #{{id}}`,"Make sure the bot is in this group.":`确认 bot 已经在这个群里。`,"This chat is not a group":`这不是群聊`,"Pick at least one topic":`至少勾选一个话题`,"Another secretary already has this group or one of these topics":`这个群或其中某个话题已经交给别的秘书了`,"Whole group":`整群`,"Groups and topics":`群和话题`,"Pick topics":`选话题`,"Bind another group or topic":`再绑一个群或话题`,"Change topics":`改话题`,"What {{name}} hands to this secretary":`{{name}} 交给这个秘书的范围`,"Add the bot to the group: tap the button, or add @{{bot}} as a member in Telegram. For a forum group, turn on Topics first.":`把 bot 拉进群:点下面的按钮,或在 Telegram 里把 @{{bot}} 加为群成员。论坛群要先开启话题。`,"Send this in the group to hand the whole group to this secretary, or inside a forum topic to hand over only that topic:":`在群里发下面这条,整个群归这个秘书;在论坛话题里发,只把这个话题交给它:`,"<code>":`<绑定码>`,"Verify a bot above first; the binding code shows up here.":`先在上面验证 bot,绑定码会显示在这里。`,"Binding code of this secretary: {{code}}":`这个秘书的绑定码:{{code}}`,"Get a binding code":`生成绑定码`,"Bound groups show up in the list of this section, where you can switch between the whole group and picked topics.":`绑好的群会出现在这一块的群列表里,可以切换「整群」或「选话题」。`,"Claimed by other secretaries on this bot (read only):":`同一个 bot 上其他秘书认领的(只读):`,"belongs to {{owner}}":`归「{{owner}}」`,"Groups and topics: {{count}}":`群和话题:{{count}} 个`,"Or add a group by its chat ID:":`也可以直接填群的 chat ID 添加:`,"Topics: {{names}}":`话题:{{names}}`,"Loading topics…":`正在拉取话题…`,"Could not load topics: {{reason}}":`拉取话题失败:{{reason}}`,"Only topics the bot has seen are listed. If one is missing, send a message in that topic, then refresh. Topics you leave unchecked are ignored.":`列表里只有 bot 见过的话题。缺哪个,就在那个话题里发一句话再点刷新。没勾的话题一律忽略。`,"This group has no topics, so it can only be bound as a whole.":`这个群没开话题,只能整群交给秘书。`,"Allow viewing memory titles on Telegram":`允许在 Telegram 查看记忆标题`,"Off by default. /memory lists titles only, never the memory text.":`默认关闭。/memory 只列标题,不显示记忆正文。`,"Mirroring every conversation to Telegram":`正在把所有对话同步到 Telegram`,"Every reply in the secretary conversation is sent to your phone, not just milestones. Silent turns arrive as a one-line summary. Telegram messages are not end-to-end encrypted and stay on Telegram servers. Send /sync off in Telegram to stop.":`秘书会话里每一轮回复都会发到手机,不再只发里程碑;静默回合只发一行摘要。Telegram 消息不是端到端加密的,会存在 Telegram 的服务器上。在 Telegram 发 /sync off 可以关掉。`,"Only milestones go to Telegram. Send /sync in Telegram to mirror every reply; /last replays the latest round.":`目前只把里程碑发到 Telegram。在 Telegram 发 /sync 可以把每一轮回复都同步过去;/last 回看最近一轮。`,"Followed from the phone: {{count}}":`手机关注的 {{count}} 个任务`,"Clear all":`全部清空`,"What you dispatch or schedule from the phone keeps reporting here until it finishes or fails once, even with /sync off.":`从手机派出的会话或加的定时会一直把结果推到这里,直到完成或失败推过一次,/sync 关着也一样。`,Drop:`取消`,"Telegram messages are not end-to-end encrypted and stay on Telegram servers. /status, /board and /feed show titles and short summaries; /last and /sync send conversation text. Memory text and tool output never leave the app.":`Telegram 消息不是端到端加密的,会存在 Telegram 的服务器上。/status、/board、/feed 只显示标题与简短摘要;/last 与 /sync 会发会话正文。记忆正文与工具输出不会离开应用。`,"Waiting on a background task":`等后台任务`,"Waiting for reminder":`等提醒`,"Waiting for reminder · {{time}}":`等提醒 · {{time}}`,"due now":`即将到点`,"<1m":`不足 1 分钟`,"in {{minutes}}m":`{{minutes}} 分钟后`,"in {{hours}}h":`{{hours}} 小时后`,"in {{hours}}h {{minutes}}m":`{{hours}} 小时 {{minutes}} 分钟后`,"{{count}} reminders":`共 {{count}} 条提醒`,"Waiting on subagent":`等子代理`,"Waiting on subagent {{title}} ({{minutes}}m)":`正在等子代理 {{title}}(已运行 {{minutes}} 分钟)`,"Waiting on subagent {{title}} (<1m)":`正在等子代理 {{title}}(不足 1 分钟)`,"Waiting on {{n}} subagents ({{title}} · {{minutes}}m)":`正在等 {{n}} 个子代理({{title}} · 已运行 {{minutes}} 分钟)`,"Waiting on {{n}} subagents ({{title}} · <1m)":`正在等 {{n}} 个子代理({{title}} · 不足 1 分钟)`,"Service running":`有常驻服务`,"Done ({{count}} leftover tasks)":`已完成({{count}} 个遗留任务)`,"Stop leftover tasks":`停止遗留任务`,"Stop background task {{task}}":`停止后台任务 {{task}}`,"Stopped {{count}} background tasks":`停止了 {{count}} 个后台任务`,"Stopping…":`正在停止…`,"Persistent service":`常驻服务`,Leftover:`疑似遗留`,Continuing:`续跑中`,"Taken over":`已接管`,"Started {{time}}":`派出于 {{time}}`,Canceled:`已取消`,"No process recorded.":`没有记录到过程。`,"View process":`查看过程`,"Run history":`历次执行`,"+{{n}} appended":`+{{n}} 追加`,Processing:`处理中`,Delivered:`已送达`,"Not delivered":`未送达`,"Merged into the current run":`已并入当前执行`,"Open task card #{{n}}":`打开任务卡 #{{n}}`,"Expand delegation result":`展开委派结果`,"Collapse delegation result":`收起委派结果`,"Merged into the current run of #{{n}}":`已并入 #{{n}} 当前执行`,Delegated:`派活`,Appended:`追加`,"Resumed after reply":`回复后继续`,Rework:`返工`,"Sub-delegation":`转派`,"Run {{n}} · {{source}}":`第 {{n}} 次执行 · {{source}}`,"Queued {{time}}":`排队 {{time}}`,Continue:`继续`,"Start over":`重新开始`,"Will retry automatically":`将自动重试`,"Retrying automatically at {{time}} (attempt {{n}})":`将于 {{time}} 自动重试(第 {{n}} 次)`,"Retrying automatically · attempt {{n}}":`自动重试中 · 第 {{n}} 次`,"Retry #{{n}} · {{source}}":`第 {{n}} 次重试 · {{source}}`,Automatic:`自动`,"By delegator":`委派人`,"Delegator note: {{note}}":`委派人补充:{{note}}`,"Retry now":`立即重试`,"Skip the wait and retry now. The scheduled automatic retry is canceled.":`不再等待,立即重试;已排定的自动重试会取消。`,"Result posted to the group · View":`结果已发到群里 · 查看`,"Delegation result":`委派结果`,"Locate the delegation card":`定位到对应的委派卡片`,"The delegation card is posted after the delegator receives the result.":`委派人收到结果后,委派卡片才会发到群里。`,"The delegation card is not in the loaded messages.":`委派卡片不在已加载的消息里。`,"{{n}} steps":`{{n}} 步`,"Could not locate this reply; showing the latest turn.":`未定位到这条回复,显示最近一轮。`,"No tool calls in this turn.":`这一轮没有工具调用。`,"Open full conversation":`打开完整会话`,"Delete failed":`删除失败`,"Memory not found":`记忆不存在`,"Memory title":`记忆标题`,"Memory content":`记忆内容`,"Switch mode":`切换模式`,"This file is not valid JSON.":`该文件不是有效的 JSON。`,"This file is not a SillyTavern character card.":`该文件不是 SillyTavern 人物卡。`,"Members have their own persona, model, tools and memory. Their name is how you @ them in groups.":`成员拥有各自的人设、模型、工具和记忆;名字用于在群里 @ 他。`,"From template":`从模板`,Blank:`空白`,"Import character card":`导入人物卡(PNG / JSON)`,"Upload avatar":`上传头像`,"Remove avatar":`移除头像`,"Crop avatar":`裁切头像`,Zoom:`缩放`,"Use this avatar":`使用此头像`,"Drag to move, scroll to zoom.":`拖动调整位置,滚轮缩放。`,"This image cannot be used as an avatar.":`该图片无法用作头像。`,"Avatar update failed":`头像更新失败`,"Blank member":`空白成员`,"Create and start chatting":`创建并开始私聊`,"One member replies at a time. Without @, the best-fit member is picked to reply.":`一次只有一位成员回复;没人被 @ 时智能选出最合适的成员回复。`,"Pick at least two, and one owner":`至少选两位,并指定一位群主`,"Create at least two members first.":`请先创建至少两名成员。`,"Shared workspace":`共享工作区`,"Based on a Code project":`基于 Code 项目`,"Members read and write directly in the project folder":`成员直接在项目目录里读写`,"Standalone workspace":`独立工作区`,"A new empty folder for this group, removed with the group":`为这个群新建一个空目录,删除群时一并清理`,"All members share this folder: anyone who can talk to a member can reach its contents through them. You can change it later in group info (members start new conversations).":`群内成员共享这个目录,能和任一成员对话的人,都能经由他触达目录里的内容。创建后可在群信息里改选(成员会各开新会话)。`,"@ relay limit (per message of yours)":`@ 接力上限(你的每条消息之后)`,"Max replies per member":`每个成员最多回复几次`,"This conversation has no history yet.":`这个会话还没有记录。`,"Member's own workspace":`成员自己的工作区`,"Change workspace":`更换工作区`,"Change workspace?":`更换工作区?`,"Members start new conversations in the new workspace. Earlier conversations stay readable in history.":`成员会在新工作区里各开新会话,旧会话保留在历史中只读查看。`,Change:`更换`,"Names can use up to 24 letters, digits, _ or -, without spaces.":`名字最多 24 个字符,只能包含文字、数字、_ 或 -,不能有空格。`,"This name is reserved. Choose another one.":`这个名字是保留名,请换一个。`,"Another member already uses this name.":`已有成员使用这个名字。`,"Another secretary already uses this name.":`已有别的秘书叫这个名字。`,"This member was changed elsewhere. Refresh and try again.":`该成员已在别处被修改,请刷新后重试。`,"This member no longer exists.":`该成员已不存在。`,"Group chat is not available right now.":`群聊暂不可用。`,"This chat was changed elsewhere. Refresh and try again.":`该聊天已在别处被修改,请刷新后重试。`,"Untitled group":`未命名群聊`,"{{name}}'s workspace":`{{name}}的工作区`,"Group workspace":`群工作区`,"Missing project":`项目已不存在`,"Group reply picker model":`群聊选人模型`,"Bot assistant model":`Bot 助理模型`,"Used for helper tasks such as auto-configuring member abilities.":`用于自动设置成员能力等辅助任务。`,"Features still being tested. They may change or be removed.":`仍在测试中的功能,之后可能调整或移除。`,"Bot mode settings":`Bot 模式设置`,"Settings shared by all members and group chats.":`所有成员和群聊共用的设置。`,"Bot concurrency limit":`Bot 并发上限`,"Shared by private chats, group chats, delegations and routines. Lowering it never interrupts running work; raising it may hit model rate limits.":`私聊、群聊、委派和例行任务共用一个上限。调低不会打断进行中的回复;调高可能触发模型限流。`,Apply:`应用`,"None selected":`未选择`,"Suggested changes":`建议的修改`,"Auto-configure abilities":`自动设置能力`,"Let a model suggest abilities from the name, title, responsibilities and persona.":`让模型根据名称、头衔、职责和人设推荐能力配置。`,"Current abilities already match the suggestion.":`当前能力已与推荐一致。`,"No model is available. Set a default model or a Bot assistant model first.":`没有可用的模型,请先设置默认模型或 Bot 助理模型。`,"Generate with AI":`AI 生成`,"Start from a goal":`从目标开始`,"Tell us in one sentence what you want done; we will recommend a member or a team and draft your first message.":`用一句话说说你想做什么,我们推荐一位成员或一个团队,并帮你起草第一条消息。`,"e.g. Track competitor news every week and send me a summary":`例如:每周跟踪竞品动态,给我发一份摘要`,Recommend:`推荐`,"Recommended: one member":`推荐:单个成员`,"Recommended: a team":`推荐:一个团队`,"First message (put into the input box, not sent)":`第一条消息(放进输入框,不会自动发送)`,"Create this member":`创建这位成员`,"Use this member":`用这个成员`,"Create new instead":`还是新建`,"Could not open chat. Try again.":`无法打开私聊,请重试。`,"Create this team":`创建这个团队`,"Fill in a name and title first.":`请先填写名称和头衔。`,"Persona generated":`人设已生成`,"Persona and responsibilities generated":`人设和职责已生成`,Undo:`撤销`,"The model did not answer in time. Try again.":`模型未及时响应,请重试。`,"The model reply could not be understood. Try again.":`无法理解模型的回复,请重试。`,"Fill in a name, title or responsibilities first.":`请先填写名称、头衔或职责。`,"Could not get suggestions":`获取推荐失败`,"Tools, approval, skills, MCP, delegation and memory":`工具、审批、技能、MCP、委派与记忆`,"When nobody is @-mentioned in a smart-routing group, this model picks which member replies.":`在「智能选人」的群里没人被 @ 时,用这个模型选出回复的成员。`,"Default (title model)":`默认(跟随标题总结模型)`,"Fast chat model":`快速聊天模型`,"Falls back to the group owner on timeout, error or an unclear answer.":`超时、出错或回答不明确时由群主回复。`,"Handed to the group owner on timeout.":`超时就交给群主处理。`,"Discussion mode":`讨论模式`,"Experimental feature":`实验性`,"Off: group chats work the same as the stable release. On: in smart-routing groups, discussion-style messages let the judge model pick who speaks next.":`关闭时,群聊流程与正式版一致。打开后,智能选人的群里遇到讨论类消息,会由判断模型挑选下一位发言人。`,"First pick: the group owner replies on timeout, error or an unclear answer. During a discussion, picking the next speaker ends the discussion in these cases.":`首轮选人遇到超时、出错或回答不明确时由群主回复;讨论中判断下一位遇到这些情况时,结束本轮讨论。`,"First pick: handed to the group owner on timeout. Next speaker in a discussion: the discussion ends on timeout.":`首轮选人超时交给群主回复;讨论中判断下一位超时则结束本轮讨论。`,"Uses the primary model on timeout.":`超时就用主模型。`,Timeout:`超时`,"Without @":`不 @ 时`,"Group owner replies":`群主回复`,"Smart pick":`智能选人`,"Search messages":`搜索消息`,"Search group and direct messages…":`搜索群聊与私聊消息…`,"No matching messages":`没有匹配的消息`,"Deleted chat":`已删除的聊天`,"Showing the latest {{n}} matches":`仅显示最近 {{n}} 条匹配`,"Show in Finder":`在访达中显示`,"Open with default app":`用默认应用打开`,"This file type is only shown in Finder":`该类型文件只能在访达中显示`,"Could not open the file":`无法打开文件`,"The file is too large to preview":`文件过大,无法预览`,"Web screenshot":`网页截图`,"Desktop screenshot":`桌面截图`,"Workspace image":`工作区`,"Not sent: still over 10 MiB after compression":`没发出去:压缩后仍超过 10MiB`,"Chat image storage is full (200 MiB); not saved":`群图片空间已满(200 MiB),没收下`,"Desktop screenshots may capture sensitive content from other windows.":`桌面截图可能拍到别的窗口里的敏感内容。`,"Copied into this chat: later edits or deletion of the original do not change it. Deleted together with the chat.":`已复制到聊天目录:原文件后来被改或删,这张不变;删聊天时一起删。`,"Choosing who replies…":`正在选择回复人…`,"Picked automatically because nobody was @-mentioned":`没人被 @,由智能选人选出`,"Smart pick · build":`智能选人 · 执行`,"Smart pick · answer":`智能选人 · 解答`,"Smart pick · discuss":`智能选人 · 讨论`,"Owner summary":`群主汇总`,"Asked to sum up after the assigned members replied":`派出的成员都回复后,提醒群主汇总`,Mute:`静音`,Unmute:`取消静音`,Muted:`静音`,"Replies only when @-mentioned by name":`只有被点名 @ 时才回复`,"Without @, the best-fit member is picked to reply":`不 @ 时智能选出最合适的成员回复`,"Adds a Code | Bot switch to the sidebar. Create members with their own persona, model and tools, and chat with them alone or in groups.":`在侧栏顶部加入 Code | Bot 切换。创建拥有各自人设、模型和工具的成员,与他们私聊或拉群协作。`,Interrupted:`中断`,"The app restarted before this task finished. It was stopped and will not rerun.":`应用重启时任务未完成,已停止,不会自动重做。`,"Timed out after {{n}} minutes.":`超过 {{n}} 分钟未完成,已超时。`,"Denied.":`已被拒绝。`,"Cancel failed":`取消失败`,"Retry failed":`重试失败`,"{{from}} → {{to}} · Delegation":`{{from}} → {{to}} · 委派`,"Check the title, prompt and schedule, and that the member is still in the target chat.":`请检查标题、提示词和时间表,并确认成员仍在目标聊天中。`,"This routine no longer exists.":`该例行任务已不存在。`,"The member or target chat is archived or unavailable.":`成员或目标聊天已归档或不可用。`,"Bot mode is off.":`Bot 模式已关闭。`,"Enter a title.":`请填写标题。`,"Enter what the member should do.":`请填写成员要做的事。`,"Invalid cron expression (minute hour day month weekday).":`cron 表达式无效(分 时 日 月 周)。`,"Choose a target chat.":`请选择目标聊天。`,"Routine not saved":`例行任务未保存`,"Routine started":`例行任务已开始运行`,"Routine task":`例行任务`,"Group messages":`群消息`,"Task from {{name}}":`来自 {{name}} 的委派任务`,"Result from {{name}}":`{{name}} 的结果`,"Delegation results":`委派结果`,"Continue delegated task":`继续委派任务`,"Acceptance check not passed":`验收未通过`,"Routine did not run":`例行任务未能运行`,"Routine not deleted":`例行任务未删除`,"New routine":`新建例行任务`,Enabled:`已启用`,"Target chat missing":`目标聊天已不存在`,"Last run {{time}} · {{result}}":`上次 {{time}} · {{result}}`,Error:`出错`,"Never run":`尚未运行`,"Missed {{n}} times":`错过 {{n}} 次`,"Run now":`立即运行`,'Delete routine "{{title}}"?':`删除例行任务「{{title}}」?`,"It will no longer run. This cannot be undone.":`删除后不再运行,且无法恢复。`,"Group chat":`群聊`,"Private chat":`私聊`,"Edit routine":`编辑例行任务`,"Routine title":`标题`,"Sent to the member as the task each time it runs":`每次运行时作为任务发给成员`,"cron: minute hour day month weekday, local time":`cron:分 时 日 月 周,本地时间`,Schedule:`时间表`,"Next run {{time}}":`下次运行 {{time}}`,"Never runs":`不会触发`,"Approve this routine before running it. You can still do a dry run.":`请先批准该例行任务再运行;仍可以先试运行。`,"This routine is already running.":`该例行任务正在运行。`,"This routine is blocked. Fix the problem and enable it again.":`该例行任务已被阻塞,处理问题后重新启用。`,"The member who runs it was deleted.":`执行成员已被删除。`,"The member who runs it is archived.":`执行成员已归档。`,"The target chat no longer exists.":`目标聊天已不存在。`,"The target chat is archived.":`目标聊天已归档。`,"The member who runs it is no longer in the target chat.":`执行成员已不在目标聊天中。`,"Delegation permissions do not allow that member to run it.":`委派权限不允许由该成员执行。`,"Skipped (still running)":`跳过(上次仍在运行)`,Blocked:`已阻塞`,Running:`运行中`,"Dry run started":`试运行已开始`,"Done by {{name}}":`由 {{name}} 执行`,"Dry run":`试运行`,Reject:`拒绝`,Approve:`批准`,"Enable again":`重新启用`,"Pending approval":`待批准`,"Routine removed":`已删除`,Scheduled:`定时`,Manual:`手动`,"Catch-up":`补跑`,"Routine blocked":`例行任务已阻塞`,"Proposed by {{name}}, waiting for your approval":`{{name}} 提议,等待你批准`,"No catch-up":`不补跑`,"Run once without affecting the schedule":`运行一次,不影响调度`,"No runs yet":`还没有运行记录`,"Open chat":`打开聊天`,"Every day":`每天`,Weekdays:`工作日`,"Every week on":`每周`,Simple:`简单`,"Advanced (cron)":`高级(cron)`,"The member itself":`成员自己`,"Another member of the target chat runs it, as a delegation":`由目标聊天里的另一位成员执行,受委派权限约束`,"Done by":`执行者`,"If the app was closed at the scheduled time, run the latest missed one once on startup":`到点时应用未运行,启动后补跑最近错过的一次`,"Catch up missed runs":`补跑错过的运行`,"Routine dry run":`例行任务试运行`,"Target chat":`目标聊天`,"This member is not in any chat yet. Start a private chat first.":`该成员还不在任何聊天中,请先发起私聊。`,"Daily at 9:00":`每天 9:00`,"Weekdays at 9:00":`工作日 9:00`,"Mondays at 9:00":`每周一 9:00`,Hourly:`每小时`,"Interrupted delegations":`中断的委派`,"Quiet for {{n}}s":`已安静 {{n}} 秒`,Settled:`已搁置`,Settle:`搁置`,"Back to in progress":`回到进行中`,"Remind me later":`稍后提醒`,"In 1 hour":`1 小时后`,"In 3 hours":`3 小时后`,"Tomorrow 9:00":`明天 9:00`,"Remind {{time}}":`{{time}}提醒`,"Mark as unread":`标为未读`,"Move up":`上移`,"Move down":`下移`,"{{name}} is still running but has produced no output for a while":`{{name}} 仍在运行,但已有一段时间没有任何输出`,"View conversation":`查看会话`,"{{name}} on behalf of {{owner}}":`{{name}} 替 {{owner}} 执行`,"Delegations in progress · {{n}}":`进行中的委派 · {{n}}`,"{{name}} (on behalf of {{owner}}) needs you":`{{name}} 替 {{owner}} 执行 · 需要你处理`,"Task board":`看板`,Delegations:`委派`,"New task":`新建任务`,"Edit task #{{n}}":`编辑任务 #{{n}}`,"Task title":`任务标题`,Details:`详情`,"Check the title and details.":`请检查标题和详情。`,"No tasks yet. Members can also add and claim tasks with the board tool.":`还没有任务。成员也可以用看板工具新建和认领任务。`,"To do":`待办`,Doing:`进行中`,"Awaiting review":`待验收`,"Accept result":`验收通过`,Return:`退回`,"Return task #{{n}}":`退回任务 #{{n}}`,"Return task #{{n}} for rework":`退回返工 #{{n}}`,"Return for rework":`退回返工`,"{{name}} continues in the same conversation with this reason, and the result comes back for review.":`{{name}} 会带着退回原因在原会话里接着改,改完回到待验收。`,"Reason for returning":`退回原因`,"Enter a reason.":`请填写原因。`,"The task goes back to To do with this reason and can be reassigned.":`任务会带着原因回到待办,可以重新指派或委派。`,"Returned: {{reason}}":`退回原因:{{reason}}`,"Show all ({{n}})":`显示全部({{n}})`,"Assign to":`指派给`,"Reassign to":`改派给`,"Stuck tasks":`卡住`,"Stuck run":`卡住了`,"Stuck delegated tasks":`卡住的任务`,"Blocked · needs: {{need}}":`卡住·缺:{{need}}`,"Blocked · run failed: {{reason}}":`卡住·执行失败:{{reason}}`,"Answer {{name}}; they continue after your reply…":`回复 {{name}},回复后接着做…`,"Stuck for {{time}}":`已卡 {{time}}`,"Waiting for your reply":`等你回复`,"Waiting for {{name}} to reply":`等 {{name}} 回复`,"Waiting for you to handle it":`等你处理`,"Stuck several times in a row; only you can answer now.":`已连续卡住多次,只能由你回复。`,"Answered; the work continues":`已回复,接着做`,"Open task card":`打开任务卡`,Reassign:`改派`,"Add to the current run…":`补充给当前执行…`,"Comment…":`评论…`,"Send reply":`发送回复`,"Reply not sent":`回复未发送`,"Mark done":`标记完成`,"Move off the board":`移出`,"Model: {{model}}":`模型:{{model}}`,"Undo mark done":`撤销标记`,"Cancel task":`取消任务`,"Acceptance check":`验收条件`,"Acceptance check (optional)":`验收条件(可选)`,"Done only when the member's tool output contains this text, e.g. a command printing ALL_TESTS_PASS.":`成员的工具输出包含这段文字才算完成,例如命令打印 ALL_TESTS_PASS。`,Passed:`通过`,"Not passed":`未通过`,'Acceptance check failed: "{{text}}" not found in tool outputs.':`验收未通过:未在工具输出中看到「{{text}}」`,Unassigned:`未指派`,You:`你`,"Created by {{name}}":`由 {{name}} 创建`,"Task not assigned":`任务未指派`,"Task not updated":`任务未更新`,"Task not deleted":`任务未删除`,"Delete task #{{n}}?":`删除任务 #{{n}}?`,"The task is removed from the board. This cannot be undone.":`任务将从看板移除,且无法恢复。`,"No delegations in this group yet":`本群还没有委派`,"Failed · interrupted · canceled":`失败 · 中断 · 取消`,"Choose a member.":`请选择成员。`,"Create team from template":`从模板创建团队`,"Creates the members and their group chat in one go. Members follow the default model; expand a member to set tools, approval, delegation, skills and MCP, or let AI set them.":`一次性创建成员和群聊。成员跟随默认模型;展开成员可设置工具、审批、委派、技能和 MCP,也可让 AI 自动设置。`,"AI auto-configure":`AI 自动设置`,"No skills or MCP":`未选技能和 MCP`,"{{n}} skills · {{m}} MCP":`{{n}} 个技能 · {{m}} 个 MCP`,"Configured abilities for {{n}} members":`已为 {{n}} 位成员设置能力`,"Suggestions failed for {{n}} members":`{{n}} 位成员的推荐失败`,"Import team (JSON)":`导入团队(JSON)`,"This team file is too large.":`团队文件过大。`,"This team file comes from an unsupported version.":`团队文件版本不受支持。`,"This file is not a valid EnsoCode team file.":`该文件不是有效的 EnsoCode 团队文件。`,"Uncheck members you do not need; the owner stays":`可取消不需要的成员,群主保留`,"Delegates to {{names}}":`可委派给 {{names}}`,'"{{from}}" is taken, renamed to "{{to}}"':`「{{from}}」已被占用,已改名为「{{to}}」`,"Keep the owner and at least one other member.":`至少保留群主和另一名成员。`,"Without @, the best-fit member replies; @ relay limit {{n}}.":`不 @ 时由最合适的成员回复;@ 接力上限 {{n}} 次。`,"Without @, the owner replies; @ relay limit {{n}}.":`不 @ 时由群主回复;@ 接力上限 {{n}} 次。`,"Create team":`创建团队`,Team:`团队`,"Export team":`导出团队`,"Export failed":`导出失败`,"Save as team template":`存为团队模板`,"Saved as team template":`已存为团队模板`,"Could not save as team template":`无法存为团队模板`,"Bot templates":`Bot 模板`,"Templates used when creating members and teams. Built-in templates can be edited, hidden or restored.":`新建成员和团队时使用的模板。内置模板可以修改、隐藏或恢复默认。`,"Member templates":`成员模板`,"Team templates":`团队模板`,"Member template":`成员模板`,"Team template":`团队模板`,"New member template":`新建成员模板`,"New team template":`新建团队模板`,"Could not save templates":`模板保存失败`,"Imported as a custom team template":`已导入为自定义团队模板`,"Duplicate as custom":`复制为自定义`,Show:`显示`,Hide:`隐藏`,"Restore default":`恢复默认`,"{{n}} members":`{{n}} 名成员`,"Export JSON":`导出 JSON`,Modified:`已修改`,Hidden:`已隐藏`,Summary:`摘要`,"Shown on the template card":`显示在模板卡片上`,"Check the template fields":`请检查模板内容`,"Enter a team title":`请填写团队标题`,"A team needs 2–12 members":`团队需要 2–12 名成员`,"Every member needs a valid name":`每个成员都需要合法的名字`,Unnamed:`未命名`,"Group settings and member personas only. Memory, sessions, timeline, tasks, routines, models, skills and MCP are not included.":`只含群配置和成员人设,不含记忆、会话、时间线、看板、例行任务、模型、技能和 MCP。`,"Interface is zoomed to {{percent}}% · {{shortcut}}":`界面已缩放至 {{percent}}% · {{shortcut}}`,"Restore 100%":`恢复 100%`,"Uninstall 'enso' Command from PATH":`卸载 enso 命令`,"Uninstall Finder Quick Action":`卸载访达快速操作`,"Couldn't uninstall the 'enso' command":`无法卸载 enso 命令`,"Shell command 'enso' uninstalled.":`已卸载 enso 命令。`,"Couldn't uninstall the Finder Quick Action":`无法卸载访达快速操作`,"Finder Quick Action uninstalled.":`访达快速操作已卸载。`,"In progress…":`处理中…`,Dispatch:`派活`,"Confirm dispatch":`确认派活`,"Project checkout":`项目目录`,"Waiting for your confirmation":`等待你确认`,"Creating the session…":`正在创建会话…`,"Session created":`已创建会话`,Rejected:`已拒绝`,Expired:`已过期`,"Secretary settings":`秘书设置`,"Re-run setup":`重新设置秘书`,Secretaries:`秘书`,"New secretary":`新建秘书`,"Delete secretary":`删除秘书`,"Delete this secretary?":`删除这个秘书?`,"This cannot be undone. The sessions it manages stay, but nobody manages them afterwards; its contact bindings are released and its private memory is deleted.":`删除后无法恢复。它管的会话会保留,但之后无人管理;它的联系方式绑定会释放,私有记忆会删除。`,"Sessions it manages ({{n}})":`它在管的会话({{n}})`,"Open todos ({{n}})":`未完成的待办({{n}})`,"Schedules ({{n}})":`定时({{n}})`,"Contact bindings ({{n}})":`联系方式绑定({{n}})`,"Private memories: {{n}}":`私有记忆:{{n}} 条`,"Nothing is managed by this secretary.":`这个秘书没有在管的东西。`,"Next: confirm again":`下一步:再确认一次`,"Transfer to…":`转交给…`,"Transferred to {{name}}":`已转交给 {{name}}`,"Transfer to {{name}}":`转交给 {{name}}`,"Transfer failed":`转交失败`,"The other secretary cannot see this project.":`对方秘书看不到这个项目。`,"The other secretary has no conversation yet: open it once first.":`对方秘书还没有会话,先打开它一次。`,"No secretary manages this session.":`这个会话没有秘书在管。`,"This secretary":`本秘书`,"All secretaries":`全部秘书`,"Filter by secretary":`按秘书筛选`,"Bound to groups and topics":`已绑定群与话题`,"Groups and topics bound to this secretary":`绑定到这个秘书的群与话题`,"Messages there go to this secretary only, and its updates are posted there. One bot can serve several secretaries: each chat or forum topic belongs to one of them.":`那里的消息只交给这个秘书,它的提醒也发到那里。一个 bot 可以给多个秘书用:每个 chat 或 forum 话题只归其中一个。`,"Topic {{id}}":`话题 {{id}}`,"Add the bot to a group":`把 bot 拉进群`,"The code works once. Press Start in a private chat with the bot, or send it in a group or forum topic to bind that place to this secretary instead.":`绑定码只能用一次。在与 bot 的私聊里点 Start,或在群、forum 话题里发送它,把那里绑定到这个秘书。`,'Your private chat with this bot already belongs to secretary "{{owner}}". One person has only one private chat with a bot, so bind this secretary to a group or forum topic below, or give it a different bot.':`你和这个 bot 的私聊已经归秘书「{{owner}}」。同一个人和同一个 bot 只有一个私聊,所以请把这个秘书绑到下面的群或论坛话题,或者给它换一个 bot。`,'That group or topic already belongs to secretary "{{owner}}". Send the code in another group or topic.':`那个群或话题已经归秘书「{{owner}}」。换一个群或话题发送绑定码。`,"The code expired. Generate a new one.":`绑定码已过期,请重新生成。`,"The bot got /start without the code. Open the bot with the button or QR code (the link carries the code), or send /start {{code}} yourself.":`bot 收到了不带绑定码的 /start。请用按钮或二维码打开 bot(链接里带着码),或者手动发送 /start {{code}}。`,'Your private chat with this bot already belongs to secretary "{{owner}}". Bind this secretary to a group or forum topic instead.':`你和这个 bot 的私聊已经归秘书「{{owner}}」:这个秘书请绑到群或论坛话题。`,"This code has expired":`绑定码已过期`,"@{{bot}} is shared by {{count}} secretaries":`@{{bot}} 由 {{count}} 个秘书共用`,"Each private chat, group or forum topic belongs to one secretary. A topic bound on its own wins over the whole group. Places nobody bound get no reply.":`每个私聊、群或论坛话题只归一个秘书;单独绑定的话题优先于整群;没人绑定的地方不回话。`,"Private chat with @{{name}}":`与 @{{name}} 的私聊`,"this secretary":`本秘书`,"Telegram off":`Telegram 已关`,"Nothing bound yet":`还没有绑定任何地方`,"taken by {{owner}}":`已归 {{owner}}`,"Waiting for you":`等你回答`,"Waiting on you":`需要你处理`,"Open session":`打开会话`,Verified:`已核验`,Mismatch:`不一致`,"Could not verify":`未能核验`,"{{count}} screenshots":`{{count}} 张截图`,"Follow-up":`后续`,"Needs the user":`需要你`,Deploy:`部署`,Tests:`测试`,"Got it":`知道了`,Ignore:`忽略`,"Show details":`展开详情`,"Hide details":`收起详情`,"Not started":`未开始`,"Add a to-do":`添加待办`,"Back to to-do":`放回待办`,Problem:`出问题`,"The session failed":`会话失败了`,"The session was stopped":`会话已停止`,"The session was deleted":`会话已删除`,"{{n}} waiting":`{{n}} 件等你`,"{{n}} running":`{{n}} 件在跑`,"{{n}} queued":`{{n}} 件排队`,"{{n}} dispatched tasks running":`派出的 {{n}} 件活在跑`,"Unknown source":`未知来源`,"Nothing running":`没有在跑的活`,"Waiting for dependencies":`等依赖`,"After {{ids}}":`等这些会话结束:{{ids}}`,"Waited for {{ids}}":`等过这些会话:{{ids}}`,"from {{ref}}":`基于 {{ref}}`,"Dispatch problem":`派发出问题`,"A dependency failed":`依赖的会话失败了`,"A dependency was stopped":`依赖的会话被停止了`,"A dependency was deleted":`依赖的会话被删除了`,"The dispatch could not start":`依赖都结束了,但派发没建起来`,"The dispatch was cancelled":`这条派发被取消了`,"Cancel waiting dispatch":`取消等依赖的派发`,Cancelled:`已取消`,"Still running":`还在跑`,Checkout:`检出`,Base:`基线`,"New branch":`新分支`,After:`依赖`,"{{n}} min":`{{n}} 分钟`,"Click to finish setup":`点我完成设置`,"Good morning":`早上好`,"Good afternoon":`下午好`,"Good evening":`晚上好`,"Today {{dispatched}} dispatched, {{completed}} completed, {{failed}} failed":`今天派出 {{dispatched}} 件,完成 {{completed}} 件,{{failed}} 件失败`,"Nothing dispatched today":`今天还没派活`,Started:`开始执行`,"Goal complete":`目标完成`,"Done · needs you":`完成 · 需要你`,"Needs you: {{item}}":`需要你:{{item}}`,"Turn ended":`这一轮结束`,Stalled:`停滞`,"Stalled, no activity":`已停住`,"Update the secretary profile":`修改秘书档案`,"Recent activity":`动态`,"No earlier activity":`没有更早的动态了`,"{{count}} new updates":`有 {{count}} 条新动态`,"Nothing on your plate":`手上没活`,"Ask {{name}} for work in the chat, or note a to-do first":`在聊天里让{{name}}派活,或者先记一条待办`,"{{name}} remembers":`{{name}}记得的`,"From your projects":`来自你的项目`,"{{name}} can read these but not change them":`{{name}}能查到但不能改`,Schedules:`定时`,"Scheduled by {{name}}":`{{name}}帮你定的`,"To add a schedule, just tell {{name}}":`想加定时,直接跟{{name}}说`,"Every day at {{time}}":`每天 {{time}}`,"Next: {{time}}":`下次:{{time}}`,"Last run {{time}}":`上次:{{time}}`,"From a to-do":`来自待办`,"One-off":`一次性`,Workbench:`工作台`,"Daily board":`看板`,"Previous day":`前一天`,"Next day":`后一天`,Dispatched:`派出`,"With secretary":`秘书处理中`,"Needed you":`需要你`,"To-dos done":`待办完成`,Merged:`合并`,"What got done":`完成了什么`,"Failed or interrupted":`失败或中断`,"Newly dispatched":`新派出`,"To-dos":`待办`,"Settings and capabilities":`设置和能力变更`,"No cards yet":`暂无卡片`,"Nothing happened this day":`这天没有动静`,"Look back to {{day}}":`可回看至 {{day}}`,Branch:`分支`,"Secretary profile updated":`秘书档案已更新`,"Secretary profile reset":`秘书档案已重置`,"Skill deleted":`技能已删除`,"Tool saved":`工具已保存`,"Tool deleted":`工具已删除`,"Takeover granted":`已授权接管`,"Takeover revoked":`已撤销接管`,"The secretary has not saved anything yet.":`秘书还没有保存任何记忆。`,"Dispatched by {{name}}":`由 {{name}} 派出`,"All archived":`全部归档`,"Archived in group “{{name}}”":`范围:分组「{{name}}」的归档`,"Archived in ungrouped projects":`范围:未分组项目的归档`,"Archived sessions dispatched by {{name}}":`范围:{{name}} 派出的已归档会话`,"“Recent” has no archive scope; showing all archived":`范围:全部归档(「最近」不按项目划分)`,"Showing all archived":`范围:全部归档`,"Dispatched by a deleted secretary":`由已删除的秘书派出`,"{{label}} · muted":`{{label}} · 已静音`,"Set up your secretary":`设置你的秘书`,"Open secretary":`打开秘书`,"Only when the secretary agent is enabled in Experimental settings":`仅在实验设置里开启秘书后生效`,"The secretary is not part of any project. It watches your projects, dispatches sessions and reports results back. It never reads or writes code itself.":`秘书不属于任何项目。它替你看各项目进展、派活给新会话、把结果转告你。它自己不读写代码。`,"Set up with a form":`用表单设置`,"Set up by chatting":`和秘书聊着设置`,"The secretary asks a few questions and hands you a profile card to confirm.":`秘书会问你几个问题,最后给你一张配置卡片确认。`,"Use all defaults and start":`全部用默认,直接开始`,"Could not start the secretary. Try again.":`没能启动秘书,请再试一次。`,Autonomy:`自主度`,"Visible projects":`可见项目`,"Selected projects":`勾选的项目`,"Dispatch model":`派出会话模型`,"Dispatch worktree":`派出会话 worktree`,"Running dispatches at most":`进行中派出会话上限`,"Watch running sessions automatically":`自动巡检进行中的会话`,"While anything is running the secretary checks it and only reports an anomaly: a goal session idle for 3 minutes with an unfinished goal and no live background task, idle for 20 minutes with a background task that never woke it, or running for 30 minutes without any event. Every hour it also reports background tasks left running in finished sessions; nothing is killed. Nothing is sent when all is well.":`只要有会话在跑,秘书就定期检查,只在发现异常时推一条:goal 会话空闲 3 分钟、目标没完成且没有在跑的后台任务;空闲 20 分钟、后台任务一直没叫醒它;或运行 30 分钟没有任何事件。每小时还会汇报已完成会话里遗留的后台任务,不杀进程。一切正常时什么都不推。`,"Patrol on":`巡检开`,"Patrol off":`巡检关`,"Clean up without asking":`清理不用确认`,"Off by default. When on, this secretary's cleanup deletes immediately, with no confirmation card: merged local branches and their worktrees. Sessions are only archived, never deleted. Unmerged branches, branches in use, feat/secretary-agent, main, the current branch and worktrees with uncommitted changes are still refused or skipped.":`默认关。打开后,这个秘书的清理直接删除,不再弹确认卡:已合并的本地分支,以及对应的 worktree。会话只是归档,不会删除。没合并的分支、正在使用的分支、feat/secretary-agent、main、当前分支,以及有未提交改动的 worktree,照旧拒绝或跳过。`,"Cleanup without confirmation":`清理不用确认`,"Cleanup asks first":`清理先确认`,"One page: name, avatar, visible projects and patrol. Every field has a default.":`一页填完:名字、头像、可见项目与巡检。每一项都有默认值。`,"Name, avatar, visible projects and patrol.":`名字、头像、可见项目与巡检。`,"Up to {{n}} at a time":`最多同时 {{n}} 个`,"Concurrent dispatch limit":`同时运行的派发会话上限`,"The most dispatched sessions the secretary may run at the same time. Once the limit is reached, new dispatches are refused.":`秘书最多同时运行几个派发会话,超过上限时新派发会被拒绝。`,Confirm:`确认`,"Edit here":`就地修改`,"Profile saved":`配置已保存`,"Saving the profile…":`正在保存配置…`,"Check a plugin to give the secretary its agent tools and skills. Tools that are not read-only ask for your approval on every call.":`勾选插件,秘书就能用它的 Agent 工具与技能。不是只读的工具每次调用都要你确认。`,"No plugins enabled":`没有已启用的插件`,"{{n}} tools":`{{n}} 个工具`,"Sends messages":`会投递消息`,"Skills the secretary may use. It proposes new ones in the chat; you confirm before anything is written.":`秘书可以用的技能。新技能由它在聊天里提案,你确认后才写盘。`,"Secretary skills":`秘书自有技能`,"Global skills":`全局技能`,"Own skills":`秘书专属`,"Shared global skills":`全局共享`,"Nothing here yet":`这里还没有`,"The secretary has no skills yet. Ask it to propose one.":`还没有技能,可以让秘书提议一个。`,"Shown for you only: this content is not an instruction to the secretary.":`这段正文只给你看,不会当成秘书的指令。`,"Delete this skill?":`删除这个技能?`,"Show the content":`查看内容`,"Show the current version":`查看现有版本`,"Skill saved":`技能已保存`,"Saving the skill…":`正在保存技能…`,New:`新建`,"Secretary profile":`秘书档案`,"Upload image":`上传图片`,"Remove image":`移除图片`,"Avatar images must be PNG, JPEG, WebP or GIF, and at most 2 MB.":`头像只接受 PNG、JPEG、WebP、GIF,且不超过 2 MB。`,"The secretary has not been set up yet.":`秘书还没完成初次设置。`,"Style and interruptions":`风格与打扰`,"What it calls you, reply language, style and system notifications.":`对你的称呼、回复语言、沟通风格与系统通知。`,"What to call you":`对你的称呼`,Optional:`可选`,"Reply language":`回复语言`,"Follow the interface language":`跟随界面语言`,Chinese:`中文`,"Communication style":`沟通风格`,Concise:`简洁`,Detailed:`详细`,"System notifications":`系统通知`,"Only what needs you":`仅需要你处理`,"Include finished work":`含完成`,"Daily brief time":`每日简报时间`,"Scheduled tasks":`定时任务`,"Nothing scheduled":`还没有定时`,"Daily brief, to-do reminders and one-off or recurring prompts.":`每日简报、待办提醒,以及一次性或重复的提示。`,"Reset the secretary and start over":`重新设置秘书`,"Sessions and dispatch history are kept either way.":`无论是否清空,会话与派活记录都会保留。`,"Also delete the secretary private memory":`同时清空秘书的私有记忆`,Saved:`已保存`,"Could not save the secretary profile. Try again.":`没能保存秘书档案,请再试一次。`,"Could not reset the secretary. Try again.":`没能重新设置秘书,请再试一次。`,"Look at {{name}}":`查看 {{name}}`,Dimensions:`尺寸`,"File size":`文件大小`,"Image unavailable":`图片无法显示`,"Cleanup candidates · {{count}}":`可清理项 · {{count}}`,"Clean up {{count}} items":`清理 {{count}} 项`,"{{count}} items":`{{count}} 项`,"Cleanup card":`清理卡片`,"Cleaning up…":`正在清理…`,"Cleanup done":`清理完成`,"Confirm cleanup":`确认清理`,"and {{count}} more":`还有 {{count}} 条`,"merged into {{refs}}":`已合入 {{refs}}`,"Not merged yet":`还没合入`,"Currently checked out":`当前检出`,"Used by a worktree":`有 worktree 在用`,"Has uncommitted changes":`有未提交改动`,"Take over":`接管`,"The secretary asks to manage this session: it may message and stop it like its own.":`秘书申请接管这个会话:同意后,它能像对自己派出的会话一样给它发消息、停止它。`,"Handing it over…":`正在交给秘书…`,"Handed over to the secretary":`已交给秘书接管`,"Allow takeover":`同意接管`,"Managed by {{name}}":`{{name}}接管中`,"{{name}} is managing this session: it may message and stop it.":`{{name}}正在接管这个会话,可以给它发消息、停止它。`,"Take back from {{name}}":`取消{{name}}接管`,"Takeover failed":`接管操作失败`,"Sessions it may take over":`可接管的会话`,"Which sessions the secretary may message and stop without asking you first. Everything else still needs a confirmation card from the secretary.":`秘书可以直接给哪些会话发消息、停止它们,不用逐个确认。范围外的会话仍然要秘书提确认卡。`,"One by one":`逐个授权`,"All visible projects":`所有可见项目`,"Pick the projects it may take over":`勾选它可以接管的项目`,"No project in the takeover scope":`还没有项目在接管范围内`,"Sessions handed over":`交给秘书接管的会话`,"Sessions you started and handed to the secretary. It may message and stop them like the ones it dispatched; take one back to remove that right.":`你自己开的、交给秘书接管的会话。秘书可以像对派出的会话一样给它们发消息、停止它们;取消接管就收回这项权限。`,"No sessions handed over":`还没有交给秘书接管的会话`,"Take back":`取消接管`,"Not tracked: the takeover scope no longer covers these sessions. Removing one lets the scope cover it again.":`不再跟踪:接管范围不再覆盖这些会话。移除后范围权限恢复。`,"Track again":`恢复跟踪`,"Send message {{title}}":`发送消息 {{title}}`,"Stop session {{title}}":`停止会话 {{title}}`,"Create session {{title}}":`创建会话 {{title}}`,"Dispatch session {{title}}":`派出会话 {{title}}`,"Update to-do {{text}}":`更新待办 {{text}}`,"Add to-do {{text}}":`添加待办 {{text}}`,"Add schedule {{name}}":`添加定时 {{name}}`,"Remove schedule {{name}}":`删除定时 {{name}}`,"Updated {{count}} to-dos":`更新了 {{count}} 条待办`,"Added {{count}} to-dos":`添加了 {{count}} 条待办`,"Sent {{count}} messages":`发了 {{count}} 条消息`,"Stopped {{count}} sessions":`停止了 {{count}} 个会话`,"Added {{count}} schedules":`添加了 {{count}} 个定时`,"Removed {{count}} schedules":`删除了 {{count}} 个定时`,"Created {{count}} sessions":`创建了 {{count}} 个会话`,"Dispatched {{count}} to-dos":`派出了 {{count}} 条待办`,"{{count}} × {{tool}}":`{{count}} 次 {{tool}}`,"Queued until the current turn ends":`已排队(等对方这一轮结束)`,"Steered into the current turn":`已插话(不等这一轮结束)`,"Delivered as a new turn (the session was idle)":`已作为新一轮发出(会话空闲)`,"Steering…":`插话中`,"Sending…":`发送中`,Refused:`被拒绝`,Stopped:`已停止`,"Waiting on {{card}} {{id}}":`等待确认({{card}} {{id}})`,Confirmed:`已确认`,"Confirmation failed":`确认失败`,"Confirmation expired":`确认已过期`,"Confirming…":`正在确认…`,"Confirmation card":`确认卡`,"Dispatch card":`派活卡`,"Profile card":`档案卡`,"Skill card":`技能卡`,"Tool card":`工具卡`,"Takeover card":`接管卡`,"View raw data":`查看原始数据`,"Show more":`展开`,"Marked done":`标记为完成 ✓`,"Marked not done":`标为未完成`,"Due time":`截止时间`,"To-do text":`待办文字`,"Once at {{time}}":`一次,{{time}}`,"List sessions in {{project}}":`列出 {{project}} 的会话`,"List sessions":`列出会话`,"List to-dos":`列出待办`,"List projects":`列出项目`,"Project {{name}}":`项目 {{name}}`,"Session running":`运行中`,"Session idle":`空闲`,"Session needs you":`需要你`,"Session error":`出错`,"Session not started":`未开始`,"{{count}} pending":`{{count}} 项待处理`,"Pending approvals":`待处理审批`,"Pending questions":`待处理提问`,"Read session {{title}}":`读取会话 {{title}}`,"Read message {{index}} in {{title}}":`读取 {{title}} 的第 {{index}} 条消息`,"More text from character {{next}}":`还有正文,从第 {{next}} 字继续`,"Truncated messages {{indexes}}: read them by index":`被截断的消息 {{indexes}},可用 index 读全文`,Read:`已读取`,"Repository status {{project}}":`仓库状态 {{project}}`,HEAD:`HEAD`,"Working tree":`工作区`,"{{count}} changed files":`{{count}} 个文件有改动`,"Against {{ref}}":`对比 {{ref}}`,"{{ahead}} ahead, {{behind}} behind":`领先 {{ahead}},落后 {{behind}}`,"Contains {{sha}}":`是否包含 {{sha}}`,Yes:`是`,No:`否`,Rebase:`变基`,"Background tasks in {{title}}":`{{title}} 的后台任务`,"{{count}} running":`{{count}} 个在跑`,"{{count}} tasks":`{{count}} 个任务`,"{{count}} calls":`{{count}} 次调用`,"Recent tool calls in {{title}}":`{{title}} 最近的工具调用`,Exited:`已退出`,Killed:`已终止`,Succeeded:`成功`,"ran {{duration}}":`已跑 {{duration}}`,"exit {{code}}":`退出码 {{code}}`,"Process gone":`进程已不在`,"Past its deadline":`已过看门狗截止`,"Unknown task":`未知任务`,"Clean tree":`工作区干净`,"No local branch":`没有本机分支`,"Search memory {{query}} · {{count}}":`搜索记忆 {{query}} · {{count}} 条`,"Delete memory {{title}}":`删除记忆 {{title}}`,"Save memory {{title}}":`记住 {{title}}`,"Memory not written":`没有写入记忆`,"Web search {{query}}":`搜索 {{query}}`,"Fetch {{domain}}":`打开 {{domain}}`,"Custom tool {{name}}":`自造工具 {{name}}`,"Propose profile changes":`提议修改档案`,"Propose skill {{name}}":`提议技能 {{name}}`,"Propose tool {{name}}":`提议工具 {{name}}`,"Ask to take over {{title}}":`申请接管 {{title}}`,Worktree:`工作区`,"Unknown session":`未知会话`,"New session":`新会话`,"Tool failed":`工具失败`,"Not found":`找不到`,"This subagent was started before EnsoCode restarted, and its record was lost in the restart":`这个子代理在 EnsoCode 重启前启动,记录已随重启丢失`,"This subagent belongs to another conversation and cannot be controlled here":`这个子代理属于别的会话,不能在这里操作`,"This conversation has no subagent with this id (mistyped, or agentId and runId mixed up)":`本会话没有这个 id 的子代理(可能抄错,或把 agentId 和 runId 弄混了)`,"Dispatch limit reached":`已达到同时派发上限`,"Project is not visible":`项目不在秘书可见范围内`,"The message changed (the session was rewound or switched branches). List the session again and read it with the new id.":`消息已变化(会话回退或换了分支),请重新分页后用新的 id 读取`,"Only user and assistant messages can be read; tool calls and tool output are not shown.":`只能读取用户和助手的消息,工具调用与工具输出不会显示`,"A project is required":`需要指定项目`,"Invalid schedule":`定时表达式不合法`,"Auto-approved projects":`免确认的项目`,"Dispatch limit":`同时派发上限`,"Run in a worktree":`使用隔离工作区`,"Run in the project checkout":`在项目目录里`,"Created the session":`已创建`,"Queued · #{{n}}":`排队中 · 第 {{n}} 位`,"Queued · #{{n}}, starts automatically when a slot opens":`排队中 · 第 {{n}} 位,有空位后自动开始`,"Queued at #{{n}}":`已排队 · 第 {{n}} 位`,"Start now":`立即开始`,"Cancel queue":`取消排队`,"Cancel this queued session? It has not run and will be deleted.":`取消这个排队会话?它还没运行,会被删除。`,"Starting…":`正在开始…`,"Queued start is unavailable":`暂时不能开始排队会话`,"Handed to {{name}}":`已转给 {{name}}`,"No answer in time":`超时未答`,"{{name}} answered: {{answer}}":`{{name}} 已回答:{{answer}}`,"Answered: {{answer}}":`已回答:{{answer}}`,"Answer {{title}}":`回答 {{title}}`,Answered:`已回答`,"Answering…":`回答中…`,"Answered {{count}} questions":`回答了 {{count}} 个提问`,"Background task wrap-up":`后台任务收尾`,"Remind me":`定提醒`,"Reminder list":`提醒列表`,"Cancel reminder":`取消提醒`,"Stop {{stopped}} · Keep {{kept}}":`停 {{stopped}} · 留 {{kept}}`,"Settling…":`收尾中…`,"Not running":`未在运行`,Kept:`已保留`,"Interrupted by restart":`因重启中断`,Keep:`保留`,Unkeep:`取消保留`,"Idle {{duration}}":`疑似闲置 {{duration}}`,"{{n}} h":`{{n}} 小时`,"{{h}} h {{m}} min":`{{h}} 小时 {{m}} 分钟`,"Kept by you · {{detail}}":`你手动保留 · {{detail}}`,"Kept: {{reason}}":`保留:{{reason}}`,"No new output":`无新输出`,"Port {{ports}}":`端口 {{ports}}`,Ports:`端口`,"No connections":`无连接`,"Not listening":`未监听`,"Running for {{duration}} · Suspected idle tasks are never stopped automatically":`已跑 {{duration}} · 疑似闲置不会自动停止`,"Running for {{duration}}":`已跑 {{duration}}`,"Add a reason (optional)":`补一句保留理由(可选)`,"Kept by the agent at {{time}} when wrapping up":`agent 在 {{time}} 回合收尾时保留`,"Kept by you at {{time}}":`你在 {{time}} 手动保留`,"Recent output":`最近输出`,"{{count}} background tasks are still undeclared; the next message asks the agent to stop each one or state why it keeps running":`还有 {{count}} 个后台任务没表态,下一条消息会要求 agent 逐个停止或写明保留理由`,"{{count}} background tasks to wrap up: stop them or say why they keep running":`有 {{count}} 个后台任务待收尾:停掉或说明保留原因`,"Show in task bar":`在任务条中查看`,"Workspace switched to branch {{branch}}":`工作区已切换到分支 {{branch}}`,"Workspace switched branch":`工作区已切换分支`,"{{count}} suspected idle":`{{count}} 个疑似闲置`,"from {{count}} sessions":`来自 {{count}} 个会话`,"Stop selected":`停止所选`,"No background tasks are running":`没有在跑的后台任务`,"Running for":`已运行`,"Rule: no new output for 30 minutes, no active connections on listening ports, CPU near 0, all at once. Kept tasks are excluded for an hour.":`判定:30 分钟无新输出、监听端口无活跃连接、CPU 近 0,三条同时满足。已保留的任务 1 小时内不计入。`,"Suspected idle only":`只看疑似闲置`,"Select all tasks of this session":`选中这个会话的全部任务`,"Session not open":`会话未打开`,"Select task":`选中任务`,"Stop {{count}} background tasks?":`停止 {{count}} 个后台任务?`,"{{title}} (not open)":`{{title}}(未打开)`,"Stop {{count}}":`停止 {{count}} 个`,"{{count}} background tasks":`{{count}} 个后台任务`,"longest running {{duration}}":`最久的已跑 {{duration}}`,"Stop all":`全部停止`,"{{n}} background tasks running":`{{n}} 个后台任务在跑`,"{{n}} suspected idle":`{{n}} 个疑似闲置`,"Background tasks of {{title}}":`{{title}} 的后台任务`,"Port {{ports}} has no connections · CPU 0%":`端口 {{ports}} 无连接 · CPU 0%`,"All tasks":`全部任务`,"Stop suspected idle leftover tasks":`停止疑似闲置的遗留任务`,Status:`状态`,"Done ({{count}} kept tasks)":`已完成(保留 {{count}} 个任务)`,"This session no longer exists, or you do not have access to it":`这条会话已不存在,或你没有权限查看`,"Archived · read-only":`已归档 · 只读`,"Restore and open":`恢复并打开`,"Needs your approval or answer":`等你审批或回答`,"Back to secretary":`返回秘书`,"PR open":`未合并`,"PR merged":`已合并`,"PR closed":`已关闭`,"No report was saved":`没有存下完成报告`,Screenshots:`截图`,"{{count}} screenshots expired":`{{count}} 张截图已过期`,"{{count}} screenshots were cleaned up":`{{count}} 张截图已在资源页清理`,"Completed {{done}}":`完成于 {{done}}`,"Completed {{done}}, kept for {{days}} days, cleaned up on {{gone}}":`完成于 {{done}},保留 {{days}} 天,已于 {{gone}} 清理`,"Completed {{done}}, cleaned up on {{gone}}":`完成于 {{done}},已于 {{gone}} 清理`,"Cleaned up":`已清理`,"Changed files ({{count}})":`改动文件({{count}})`,Binary:`二进制`,"{{count}} more files":`还有 {{count}} 个文件`,"Report screenshots":`报告截图`,"Copies of screenshots in finished reports, kept for 7 days after completion. Cleaning removes all of them; report text is kept.":`已完成报告里截图的副本,完成后保留 7 天。清理会删掉全部截图,报告文字保留。`};function Es(e){return e&&e.toLowerCase().startsWith(`zh`)?`zh`:`en`}function Ds(e,t){return e===`zh`?Ts[t]??t:t}function Os(e,t,n){let r=Ds(e,t);return n?r.replace(/\{\{(\w+)\}\}/g,(e,t)=>{let r=n[t];return r===void 0?e:String(r)}):r}var ks=typeof navigator<`u`&&navigator.language.startsWith(`zh`)?`zh`:`en`;function As(e,t){return Os(ks,e,t)}function js(e,t){let n=Os(ks,e);return t?n.split(/(\{\{\w+\}\})/g).map(e=>{let n=/^\{\{(\w+)\}\}$/.exec(e);if(!n)return e;let r=t[n[1]];return r===void 0?e:(0,G.jsx)(`span`,{children:r},n[1])}):n}function K(){return{locale:ks,t:As,tNode:js}}var Ms={"external-send":`Protected: external send`,delete:`Protected: delete`,payment:`Protected: payment`,deploy:`Protected: deploy / production`,secret:`Protected: secrets`,destructive:`Protected: destructive command`};function Ns(e,t){return t(Ms[e])}var Ps={exec:`Isolated sandbox`,codemode:`Isolated sandbox`,tool_search:`Tool search`,apply_patch:`Apply patch`,explore_mark:`Explore mark`,explore_fold:`Explore fold`,turn_discard:`Turn discard`,turn_recall:`Turn recall`,subagent:`Subagent`,workflow:`Workflow`,ask_user:`Ask user`,task_output:`Task output`,task_stop:`Task stop`,task_settle:`Background task wrap-up`,remind_me:`Remind me`,reminder_list:`Reminder list`,reminder_cancel:`Cancel reminder`,message_coworker:`Message coworker`,message_main_agent:`Message main agent`,recall:`Recall memory`,memory_search:`Memory search`,memory_capture:`Memory capture`,memory_crystallize:`Memory crystallize`,memory_delete:`Memory delete`,browser_navigate:`Browser navigate`,browser_snapshot:`Browser snapshot`,browser_click:`Browser click`,browser_type:`Browser type`,browser_tabs:`Browser tabs`,browser_lock:`Browser lock`,browser_fill:`Browser fill`,browser_press_key:`Browser press key`,browser_scroll:`Browser scroll`,browser_select_option:`Browser select option`,browser_mouse_click_xy:`Browser click xy`,browser_drag:`Browser drag`,browser_highlight:`Browser highlight`,browser_get_bounding_box:`Browser bounding box`,browser_screenshot:`Browser screenshot`,browser_cdp:`Browser CDP`,web_search:`Web search`,web_fetch:`Web fetch`,todo:`Todos`};function Fs(e,t){let n=Ps[e];return n?t(n):e}var Is={report:`Read report`,wait:`Wait`,stop:`Stop`,dismiss:`Dismiss agent`,list:`List agents`,resume:`Resume agent`};function Ls({text:e,className:t,label:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{let t=typeof e==`function`?e():e;navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),1e3)})},className:W(`flex items-center gap-1 transition-colors hover:text-foreground`,t),title:r(`Copy`),children:[(0,G.jsxs)(`span`,{className:`t-icon-swap`,"data-state":i?`b`:`a`,children:[(0,G.jsx)(`span`,{className:`t-icon inline-flex`,"data-icon":`a`,children:(0,G.jsx)(Nt,{className:`h-3 w-3`})}),(0,G.jsx)(`span`,{className:`t-icon inline-flex`,"data-icon":`b`,children:(0,G.jsx)(ht,{className:`h-3 w-3`})})]}),n]})}function Rs(e,t=0){let[n,r]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{if(e===void 0)return;r(Date.now());let t=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e===void 0?void 0:e+t-n}function zs({remainingMs:e,expiredLabel:t}){let{t:n}=K();if(e===void 0)return null;if(e<=0)return(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-warning`,children:n(t)});let r=Math.ceil(e/1e3),i=`${Math.floor(r/60)}:${String(r%60).padStart(2,`0`)}`;return(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:n(`{{time}} left`,{time:i})})}var Bs=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,Hs=Object.getOwnPropertyNames,Us=Object.prototype.hasOwnProperty,Ws=(e,t)=>{let n={};for(var r in e)Bs(n,r,{get:e[r],enumerable:!0});return t||Bs(n,Symbol.toStringTag,{value:`Module`}),n},Gs=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Hs(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Us.call(e,s)&&s!==n&&Bs(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Vs(t,s))||r.enumerable});return e},Ks=(e,t,n)=>(Gs(e,t,`default`),n&&Gs(n,t,`default`)),qs=e(Ve()),Js=`modulepreload`,Ys=function(e){return`/`+e},Xs={},q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ys(t,n),t=s(t),t in Xs)return;Xs[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Js,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Zs=[{id:`abap`,name:`ABAP`,import:(()=>q(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>q(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>q(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>q(()=>import(`./ahk-CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>q(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>q(()=>import(`./angular-html-aPuBvESs.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>q(()=>import(`./angular-ts-ocjSXnvf.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>q(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>q(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>q(()=>import(`./apl-D8Zaj6f9.js`),__vite__mapDeps([7,3,1,4,2,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>q(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>q(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>q(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>q(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>q(()=>import(`./astro-CbVusc_k.js`),__vite__mapDeps([11,3,1,4,10,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>q(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>q(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>q(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>q(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>q(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>q(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>q(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>q(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>q(()=>import(`./blade-BuKMbjJR.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>q(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>q(()=>import(`./c-BNQJhXlP.js`).then(e=>e.n),__vite__mapDeps([20,1])))},{id:`c3`,name:`C3`,import:(()=>q(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>q(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>q(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>q(()=>import(`./chapel-CFMD-Djs.js`),__vite__mapDeps([23,20,1])))},{id:`clarity`,name:`Clarity`,import:(()=>q(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>q(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>q(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>q(()=>import(`./cobol-qSrRm_BU.js`),__vite__mapDeps([24,2,1,3,4,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>q(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>q(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>q(()=>import(`./coffee-BP03ytLP.js`),__vite__mapDeps([25,3,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>q(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>q(()=>import(`./coq-DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>q(()=>import(`./cpp-CUBNVKxn.js`).then(e=>e.n),__vite__mapDeps([26,1,27,28,20])))},{id:`crystal`,name:`Crystal`,import:(()=>q(()=>import(`./crystal-CCpd0BXH.js`),__vite__mapDeps([29,3,1,4,2,17,20,30])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>q(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>q(()=>import(`./css-DlBQoFxe.js`).then(e=>e.n),__vite__mapDeps([4,1])))},{id:`csv`,name:`CSV`,import:(()=>q(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>q(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>q(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>q(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>q(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>q(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>q(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>q(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>q(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>q(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>q(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>q(()=>import(`./edge-k_uo0VIr.js`),__vite__mapDeps([31,2,1,3,4,12,16])))},{id:`elixir`,name:`Elixir`,import:(()=>q(()=>import(`./elixir-CJS91GrO.js`),__vite__mapDeps([32,2,1,3,4])))},{id:`elm`,name:`Elm`,import:(()=>q(()=>import(`./elm-Bmx6Fs0i.js`),__vite__mapDeps([33,28,1,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>q(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>q(()=>import(`./erb-yi0ZozmI.js`),__vite__mapDeps([34,2,1,3,4,35,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>q(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([41,42])))},{id:`fennel`,name:`Fennel`,import:(()=>q(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>q(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>q(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>q(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([43,44])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>q(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>q(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([45,42])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>q(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([46,47,48])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>q(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>q(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>q(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>q(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>q(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([49,50])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>q(()=>import(`./git-rebase-C-RR1FSc.js`),__vite__mapDeps([51,30,1])))},{id:`gleam`,name:`Gleam`,import:(()=>q(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>q(()=>import(`./glimmer-js-Di6EiJvU.js`),__vite__mapDeps([52,3,1,4,2,12])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>q(()=>import(`./glimmer-ts-C2P-EwIP.js`),__vite__mapDeps([53,3,1,4,2,12])))},{id:`glsl`,name:`GLSL`,import:(()=>q(()=>import(`./glsl-CyFpZtQv.js`).then(e=>e.n),__vite__mapDeps([28,1,20])))},{id:`gn`,name:`GN`,import:(()=>q(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>q(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>q(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>q(()=>import(`./graphql-BIyAKkG2.js`).then(e=>e.n),__vite__mapDeps([37,1,3,12,14,38])))},{id:`groovy`,name:`Groovy`,import:(()=>q(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>q(()=>import(`./hack-DDi4pUY-.js`),__vite__mapDeps([54,2,1,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>q(()=>import(`./haml-Dds4VdNJ.js`).then(e=>e.n),__vite__mapDeps([36,1,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>q(()=>import(`./handlebars-C81KA5yo.js`),__vite__mapDeps([55,3,1,4,2,40])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>q(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>q(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>q(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>q(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>q(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>q(()=>import(`./html-BsvMqTlf.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>q(()=>import(`./html-derivative-D9FvRNj4.js`),__vite__mapDeps([16,2,1,3,4])))},{id:`http`,name:`HTTP`,import:(()=>q(()=>import(`./http-c4_vT9ST.js`),__vite__mapDeps([56,8,1,9,10,30,37,3,12,14,38])))},{id:`hurl`,name:`Hurl`,import:(()=>q(()=>import(`./hurl-BqZA9I9Q.js`),__vite__mapDeps([57,8,1,9,58,37,3,12,14,38])))},{id:`hxml`,name:`HXML`,import:(()=>q(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([59,60])))},{id:`hy`,name:`Hy`,import:(()=>q(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>q(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>q(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>q(()=>import(`./java-D7h0NA_A.js`).then(e=>e.n),__vite__mapDeps([9,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>q(()=>import(`./javascript-DcMHgNcu.js`).then(e=>e.n),__vite__mapDeps([3,1])))},{id:`jinja`,name:`Jinja`,import:(()=>q(()=>import(`./jinja-CixBDh_U.js`),__vite__mapDeps([61,2,1,3,4])))},{id:`jison`,name:`Jison`,import:(()=>q(()=>import(`./jison-Ru_S5AEn.js`),__vite__mapDeps([62,3,1])))},{id:`json`,name:`JSON`,import:(()=>q(()=>import(`./json-DePJdKYk.js`).then(e=>e.n),__vite__mapDeps([10,1])))},{id:`json5`,name:`JSON5`,import:(()=>q(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>q(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>q(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>q(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>q(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>q(()=>import(`./jsx-BUUYi3qs.js`).then(e=>e.n),__vite__mapDeps([38,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>q(()=>import(`./julia-CaY0JZD0.js`),__vite__mapDeps([63,3,1,17,22,26,27,28,20,64])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>q(()=>import(`./just-Q4EdCjF5.js`),__vite__mapDeps([65,3,1,12,22,30,35,4,2,8,9,17,20,26,27,28,36,37,14,38,39,40,66])))},{id:`kdl`,name:`KDL`,import:(()=>q(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>q(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>q(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>q(()=>import(`./latex-t1iljvl0.js`),__vite__mapDeps([67,68,1,64])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>q(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>q(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>q(()=>import(`./liquid-DEL4RHa9.js`),__vite__mapDeps([69,3,1,4,2,10])))},{id:`llvm`,name:`LLVM IR`,import:(()=>q(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>q(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>q(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>q(()=>import(`./lua-Z49wBRLR.js`).then(e=>e.n),__vite__mapDeps([39,1,20])))},{id:`luau`,name:`Luau`,import:(()=>q(()=>import(`./luau-C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>q(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>q(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>q(()=>import(`./marko-DYWPPmCl.js`),__vite__mapDeps([70,4,1,6,12,71])))},{id:`matlab`,name:`MATLAB`,import:(()=>q(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>q(()=>import(`./mdc-CsAWFGA9.js`),__vite__mapDeps([72,16,2,1,3,4,40,42])))},{id:`mdx`,name:`MDX`,import:(()=>q(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>q(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>q(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>q(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>q(()=>import(`./moonbit-DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>q(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>q(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>q(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([73,74])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>q(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>q(()=>import(`./nginx-BrbrEdla.js`),__vite__mapDeps([75,39,1,20])))},{id:`nim`,name:`Nim`,import:(()=>q(()=>import(`./nim-BjwzhXka.js`),__vite__mapDeps([76,3,1,4,2,8,9,20,28,42])))},{id:`nix`,name:`Nix`,import:(()=>q(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>q(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>q(()=>import(`./nushell-DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>q(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>q(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>q(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>q(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>q(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>q(()=>import(`./org-TFl3N09_.js`),__vite__mapDeps([77,3,1,4,2,6,9,8,10,12,14,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,49,51,82,83,84,64,66,67,68,71,85,76,86,87,88,89,90,91,92,93,94])))},{id:`pascal`,name:`Pascal`,import:(()=>q(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>q(()=>import(`./perl-BtArmf81.js`),__vite__mapDeps([66,3,1,4,2,8,9,17])))},{id:`php`,name:`PHP`,import:(()=>q(()=>import(`./php-Cx25uSIP.js`),__vite__mapDeps([88,3,1,4,2,8,9,10,17])))},{id:`pkl`,name:`Pkl`,import:(()=>q(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>q(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>q(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>q(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>q(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>q(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>q(()=>import(`./powershell-CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>q(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>q(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>q(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>q(()=>import(`./pug-B4bk2kWf.js`),__vite__mapDeps([95,3,1,4,2])))},{id:`puppet`,name:`Puppet`,import:(()=>q(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>q(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>q(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>q(()=>import(`./qml-g4UDed-8.js`),__vite__mapDeps([96,3,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>q(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>q(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>q(()=>import(`./r-CvCSiWB_.js`).then(e=>e.n),__vite__mapDeps([64,1])))},{id:`racket`,name:`Racket`,import:(()=>q(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>q(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>q(()=>import(`./razor-BSt2ayLr.js`),__vite__mapDeps([97,2,1,3,4,79])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>q(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>q(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>q(()=>import(`./regexp-I2jnduhj.js`).then(e=>e.n),__vite__mapDeps([27,1])))},{id:`rel`,name:`Rel`,import:(()=>q(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>q(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>q(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>q(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>q(()=>import(`./rst-BucurtmO.js`),__vite__mapDeps([98,3,1,16,2,4,22,99,26,27,28,20,30,40,35,8,9,17,36,37,12,14,38,39])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>q(()=>import(`./ruby-D1ky9XZ0.js`),__vite__mapDeps([35,3,1,4,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>q(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>q(()=>import(`./sas-CUQt684o.js`),__vite__mapDeps([100,17,1])))},{id:`sass`,name:`Sass`,import:(()=>q(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>q(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>q(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>q(()=>import(`./scss-BaZL6t2Y.js`).then(e=>e.n),__vite__mapDeps([6,1,4])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>q(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>q(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([101,102])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>q(()=>import(`./shellscript-B51zB43X.js`).then(e=>e.n),__vite__mapDeps([30,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>q(()=>import(`./shellsession-B-KBpmJs.js`),__vite__mapDeps([103,30,1])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>q(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>q(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>q(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>q(()=>import(`./soy-D5xCHD_M.js`),__vite__mapDeps([104,2,1,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>q(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([105,106])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>q(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>q(()=>import(`./sql-DvarVTMJ.js`).then(e=>e.n),__vite__mapDeps([17,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>q(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>q(()=>import(`./stata-8TbiBYrm.js`),__vite__mapDeps([107,17,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>q(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>q(()=>import(`./surrealql-DalIYx4r.js`),__vite__mapDeps([108,3,1])))},{id:`svelte`,name:`Svelte`,import:(()=>q(()=>import(`./svelte-D4FIy7cP.js`),__vite__mapDeps([109,3,1,4,12,13])))},{id:`swift`,name:`Swift`,import:(()=>q(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>q(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>q(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>q(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>q(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>q(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>q(()=>import(`./templ-DP4lTcEq.js`),__vite__mapDeps([110,3,1,4,82])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>q(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>q(()=>import(`./tex-JPaUWOrn.js`).then(e=>e.n),__vite__mapDeps([68,1,64])))},{id:`toml`,name:`TOML`,import:(()=>q(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>q(()=>import(`./ts-tags-CNUq3so9.js`),__vite__mapDeps([111,3,1,4,2,8,9,12,17,28,20])))},{id:`tsv`,name:`TSV`,import:(()=>q(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>q(()=>import(`./tsx-DvWhG4dC.js`).then(e=>e.n),__vite__mapDeps([14,1])))},{id:`turtle`,name:`Turtle`,import:(()=>q(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>q(()=>import(`./twig-Chu5fnNS.js`),__vite__mapDeps([112,3,1,4,6,22,35,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40,88,10])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>q(()=>import(`./typescript-BTGs5etX.js`).then(e=>e.n),__vite__mapDeps([12,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>q(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>q(()=>import(`./typst--WwEKe8X.js`),__vite__mapDeps([113,3,1,4,2,6,9,8,10,12,14,114,115,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,45,49,51,82,83,55,84,116,64,63,66,67,68,71,117,85,86,88,89,90,91,92,94,118,95,119,120,112,121])))},{id:`v`,name:`V`,import:(()=>q(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>q(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>q(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>q(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>q(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>q(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>q(()=>import(`./vue-DjCn01CB.js`),__vite__mapDeps([122,3,1,4,2,10,12,16])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>q(()=>import(`./vue-html-BXjKVtKk.js`),__vite__mapDeps([123,3,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>q(()=>import(`./vue-vine-By_xyXdL.js`),__vite__mapDeps([124,3,1,4,6,13,71,125])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>q(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>q(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>q(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>q(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>q(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>q(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>q(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>q(()=>import(`./xml-C01ajBW7.js`).then(e=>e.n),__vite__mapDeps([8,1,9])))},{id:`xsl`,name:`XSL`,import:(()=>q(()=>import(`./xsl-CCLNyvR3.js`),__vite__mapDeps([94,8,1,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>q(()=>import(`./yaml-BWCS3NLV.js`).then(e=>e.n),__vite__mapDeps([40,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>q(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>q(()=>import(`./zig-CMLA9XwU.js`),[]))}],Qs=Object.fromEntries(Zs.map(e=>[e.id,e.import])),$s=Object.fromEntries(Zs.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ec={...Qs,...$s},tc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>q(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>q(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>q(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>q(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>q(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>q(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>q(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>q(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>q(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>q(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>q(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>q(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>q(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>q(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>q(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>q(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>q(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>q(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>q(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>q(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>q(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>q(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>q(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>q(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>q(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>q(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>q(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>q(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>q(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>q(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>q(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>q(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>q(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>q(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>q(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>q(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>q(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>q(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>q(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>q(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>q(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>q(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>q(()=>import(`./monokai-B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>q(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>q(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>q(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>q(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>q(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>q(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>q(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>q(()=>import(`./red-DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>q(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>q(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>q(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>q(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>q(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>q(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>q(()=>import(`./solarized-dark-UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>q(()=>import(`./solarized-light-C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>q(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>q(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>q(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>q(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>q(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>q(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),nc=t({createOnigurumaEngine:()=>Ac,getDefaultWasmLoader:()=>kc,loadWasm:()=>Cc,setDefaultWasmLoader:()=>Oc}),rc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ic(){return 2147483648}function ac(){return typeof performance<`u`?performance.now():Date.now()}var oc=(e,t)=>e+(t-e%t)%t;async function sc(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=ic();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,oc(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:ac,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var cc=Object.defineProperty,lc=(e,t,n)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uc=(e,t,n)=>lc(e,typeof t==`symbol`?t:t+``,n),dc=null;function fc(e){throw new rc(e.UTF8ToString(e.getLastOnigError()))}var pc=class e{constructor(t){uc(this,`utf16Length`),uc(this,`utf8Length`),uc(this,`utf16Value`),uc(this,`utf8Value`),uc(this,`utf16OffsetToUtf8`),uc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},mc=class e{constructor(t){if(uc(this,`id`,++e.LAST_ID),uc(this,`_onigBinding`),uc(this,`content`),uc(this,`utf16Length`),uc(this,`utf8Length`),uc(this,`utf16OffsetToUtf8`),uc(this,`utf8OffsetToUtf16`),uc(this,`ptr`),!dc)throw new rc(`Must invoke loadWasm first.`);this._onigBinding=dc,this.content=t;let n=new pc(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=dc.omalloc(1e4),e._sharedPtrInUse=!0,dc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(dc)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};uc(mc,`LAST_ID`,0),uc(mc,`_sharedPtr`,0),uc(mc,`_sharedPtrInUse`,!1);var hc=mc,gc=class{constructor(e){if(uc(this,`_onigBinding`),uc(this,`_ptr`),!dc)throw new rc(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new pc(e[r]);t[r]=i.createString(dc),n[r]=i.utf8Length}let r=dc.omalloc(4*e.length);dc.HEAPU32.set(t,r/4);let i=dc.omalloc(4*e.length);dc.HEAPU32.set(n,i/4);let a=dc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)dc.ofree(t[n]);dc.ofree(i),dc.ofree(r),a===0&&fc(dc),this._onigBinding=dc,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new hc(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function _c(e){return typeof e.instantiator==`function`}function vc(e){return typeof e.default==`function`}function yc(e){return e.data!==void 0}function bc(e){return typeof Response<`u`&&e instanceof Response}function xc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Sc;function Cc(e){if(Sc)return Sc;async function t(){dc=await sc(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),_c(n)?n=await n.instantiator(t):vc(n)?n=await n.default(t):(yc(n)&&(n=n.data),bc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Tc(n)(t):await Ec(n)(t):xc(n)||n instanceof WebAssembly.Module?n=await wc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await wc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Sc=t(),Sc}function wc(e){return t=>WebAssembly.instantiate(e,t)}function Tc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ec(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Dc;function Oc(e){Dc=e}function kc(){return Dc}async function Ac(e){return e&&await Cc(e),{createScanner(e){return new gc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new hc(e)}}}var jc=Ws({});Ks(jc,nc);var Mc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Nc(e){return Pc(e)}function Pc(e){return Array.isArray(e)?Fc(e):e instanceof RegExp?e:typeof e==`object`?Ic(e):e}function Fc(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Pc(e[n]);return t}function Ic(e){let t={};for(let n in e)t[n]=Pc(e[n]);return t}function Lc(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Rc(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Rc(e.substring(0,e.length-1)):e.substr(~t+1)}var zc=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Bc=class{static hasCaptures(e){return e!==null&&(zc.lastIndex=0,zc.test(e))}static replaceCaptures(e,t,n){return e.replace(zc,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Vc(e,t){return e<t?-1:+(e>t)}function Hc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Vc(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Uc(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Wc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Gc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Kc=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Zc(e),t)}static createFromParsedTheme(e,t){return el(e,t)}_cachedMatchRoot=new Gc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Jc(e.parent,t.parentScopes));return n?new Xc(n.fontStyle,n.foreground,n.background):null}},qc=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Jc(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Yc(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Yc(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Xc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Zc(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Uc(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Uc(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Qc(l,u,e,o,s,c)}}return n}var Qc=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},$c=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))($c||{});function el(e,t){e.sort((e,t)=>{let n=Vc(e.scope,t.scope);return n!==0||(n=Hc(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new tl(t),o=new Xc(n,a.getId(r),a.getId(i)),s=new il(new rl(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Kc(a,o,s)}var tl=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},nl=Object.freeze([]),rl=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||nl,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},il=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),rl.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Hc(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new rl(e,t,n,r,i))}},al=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=sl(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ol(e){return e}function sl(e){return e}function cl(e,t){let n=[],r=ul(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(ll(i)){let e=[];do e.push(i),i=r.next();while(ll(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function ll(e){return!!e&&!!e.match(/[\w\.:]+/)}function ul(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function dl(e){typeof e.dispose==`function`&&e.dispose()}var fl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},pl=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ml=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},hl=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ml;for(let n of e)gl(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof fl){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function gl(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof fl?vl({baseGrammar:a,selfGrammar:i},r):_l(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new fl(e))}function _l(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];yl([r],t,n)}}function vl(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&yl(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&yl(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function yl(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Lc({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&yl(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Tl(i);switch(a.kind){case 0:vl({...t,selfGrammar:t.baseGrammar},n);break;case 1:vl(t,n);break;case 2:_l(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?_l(a.ruleName,i,n):vl(i,n)}else a.kind===4?n.add(new pl(a.scopeName,a.ruleName)):n.add(new fl(a.scopeName))}}}var bl=class{kind=0},xl=class{kind=1},Sl=class{constructor(e){this.ruleName=e}kind=2},Cl=class{constructor(e){this.scopeName=e}kind=3},wl=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Tl(e){if(e===`$base`)return new bl;if(e===`$self`)return new xl;let t=e.indexOf(`#`);return t===-1?new Cl(e):t===0?new Sl(e.substring(1)):new wl(e.substring(0,t),e.substring(t+1))}var El=/\\(\d+)/,Dl=/\\(\d+)/g,Ol=-1,kl=-2;function Al(e){return e}function jl(e){return e}var Ml=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Bc.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Bc.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Rc(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Bc.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Bc.replaceCaptures(this._contentName,e,t)}},Nl=class extends Ml{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Pl=class extends Ml{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new zl(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fl=class extends Ml{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Bl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Il=class extends Ml{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new zl(i,this.id),this.beginCaptures=a,this._end=new zl(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ll=class extends Ml{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new zl(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new zl(o,kl),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Bl;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Bl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Rl=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Nl(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Pl(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Lc({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Fl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ll(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Il(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Tl(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Fl||e instanceof Il||e instanceof Ll)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},zl=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&El.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Dl.lastIndex=0,this.source.replace(Dl,(e,t)=>Wc(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Bl=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Vl(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Vl(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Vl=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
15
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Hl=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ul=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Hl(e,8),this._embeddedLanguagesMatcher=new Wl(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Hl(0,0);_getBasicScopeAttributes=new Gc(e=>new Hl(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Wl=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Wc(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Gl=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Kl(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=ql(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Gl(i,!0);f()}return new Gl(i,!1);function f(){let o=Jl(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ol){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),$l(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Il){let r=o;$l(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Ll){let r=o;$l(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if($l(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function ql(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Ll&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ql(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==kl){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),$l(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Jl(e,t,n,r,i,a){let o=Yl(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Xl(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Yl(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Zl(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Xl(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Zl(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Zl(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ql(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function $l(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Kl(e,p,n&&d.start===0,d.start,f,i,!1,0),dl(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new eu(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var eu=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function tu(e,t,n,r,i,a,o,s){return new au(e,t,n,r,i,a,o,s)}function nu(e,t,n,r,i){let a=cl(t,ru),o=Rl.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function ru(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(iu(t[r],e))return n=r+1,!0;return!1})}function iu(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var au=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ul(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ou(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=cl(e,ru);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)nu(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&nu(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Al(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[jl(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ou(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Rl.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===cu.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=al.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?su.createRootAndLookUpScopeName(a,r,this):su.createRoot(`unknown`,r),t=new cu(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
16
+ `;let a=this.createOnigString(e),o=a.content.length,s=new uu(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Kl(this,a,i,0,t,s,!0,r);return dl(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ou(e,t){return e=Nc(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var su=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=qc.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new qc(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new qc(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),al.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},cu=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?su.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:jl(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=su.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Al(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,su.fromExtension(r,n.contentNameScopesList))}},lu=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):cl(e,ru).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>cl(e,ru).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},uu=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=al.set(n,0,ol(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=al.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},du=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,tu(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},fu=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new du(Kc.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Kc.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new lu(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new hl(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},pu=cu.NULL;function mu(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function hu(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function gu(e){return Array.isArray(e)?e:[e]}async function _u(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function vu(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function yu(e){return e===`ansi`||vu(e)}function bu(e){return e===`none`}function xu(e){return bu(e)}var Su=/(\r?\n)/g;function Cu(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Su),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var wu={light:`#333333`,dark:`#bbbbbb`},Tu={light:`#fffffe`,dark:`#1e1e1e`},Eu=`__shiki_resolved`;function Du(e){if(e?.[Eu])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?wu.light:wu.dark,n||=t.type===`light`?Tu.light:Tu.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Eu,{enumerable:!1,writable:!1,value:!0}),t}async function Ou(e){return[...new Set((await Promise.all(e.filter(e=>!yu(e)).map(async e=>await _u(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function ku(e){return(await Promise.all(e.map(async e=>xu(e)?null:Du(await _u(e))))).filter(e=>!!e)}function Au(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Mc(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var ju=class extends fu{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Du(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Kc.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Au(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Mc(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Mu=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Nu=0;function Pu(e){Nu+=1,e.warnings!==!1&&Nu>=10&&Nu%10==0&&console.warn(`[Shiki] ${Nu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Mc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Du),i=new ju(new Mu(e.engine,n),r,n,e.langAlias),a;function o(t){return Au(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Mc(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Mc(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Ou(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await ku(e))}function g(){if(t)throw new Mc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Nu)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Fu(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([ku(e.themes||[]),Ou(e.langs||[]),e.engine]);return Pu({...e,themes:t,langs:n,engine:r})}var Iu=new WeakMap;function Lu(e,t){Iu.set(e,t)}function Ru(e){return Iu.get(e)}var zu=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(gu(n).map(e=>[e,pu])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Bu(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Bu(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Vu(e,t){if(!(e instanceof zu))throw new Mc(`Invalid grammar state`);return e.getInternalStack(t)}var Hu=/,/,Uu=/ /;function Wu(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(vu(e.resolveLangAlias(n.lang||`text`))||bu(r))return Cu(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Mc(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Mc(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Ku(t,o,i,a,n)}function Gu(...e){if(e.length===2)return Ru(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(vu(i)||bu(a))throw new Mc(`Plain language does not have grammar state`);if(i===`ansi`)throw new Mc(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new zu(qu(n,c,o,s,r).stateStack,c.name,o.name)}function Ku(e,t,n,r,i){let a=qu(e,t,n,r,i),o=new zu(a.stateStack,t.name,n.name);return Lu(a.tokens,o),a.tokens}function qu(e,t,n,r,i){let a=mu(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Cu(e),u=i.grammarState?Vu(i.grammarState,n.name)??pu:i.grammarContextCode==null?pu:qu(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=hu(r[al.getForeground(s)],a),u=al.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=al.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Hu).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Uu))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Ju(t.scopes):Yu(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Ju(e){return e.map(e=>({scopeName:e}))}function Yu(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Qu(e,i,t.slice(0,r))}}return n}function Xu(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Zu(e,t,n){if(!Xu(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Xu(e[r],n[i])&&--r,--i;return r===-1}function Qu(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Zu(e,t,n)){r.push(a);break}return r}function $u(e,t,n,r=Wu){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Ru(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=ed(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new zu(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Lu(s,c),s}function ed(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var td=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],nd=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};nd.prototype.normal={},nd.prototype.property={},nd.prototype.space=void 0;function rd(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new nd(n,r,t)}function id(e){return e.toLowerCase()}var ad=class{constructor(e,t){this.attribute=t,this.property=e}};ad.prototype.attribute=``,ad.prototype.booleanish=!1,ad.prototype.boolean=!1,ad.prototype.commaOrSpaceSeparated=!1,ad.prototype.commaSeparated=!1,ad.prototype.defined=!1,ad.prototype.mustUseProperty=!1,ad.prototype.number=!1,ad.prototype.overloadedBoolean=!1,ad.prototype.property=``,ad.prototype.spaceSeparated=!1,ad.prototype.space=void 0;var od=t({boolean:()=>cd,booleanish:()=>ld,commaOrSpaceSeparated:()=>pd,commaSeparated:()=>fd,number:()=>J,overloadedBoolean:()=>ud,spaceSeparated:()=>dd}),sd=0,cd=md(),ld=md(),ud=md(),J=md(),dd=md(),fd=md(),pd=md();function md(){return 2**++sd}var hd=Object.keys(od),gd=class extends ad{constructor(e,t,n,r){let i=-1;if(super(e,t),_d(this,`space`,r),typeof n==`number`)for(;++i<hd.length;){let e=hd[i];_d(this,hd[i],(n&od[e])===od[e])}}};gd.prototype.defined=!0;function _d(e,t,n){n&&(e[t]=n)}function vd(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new gd(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[id(r)]=r,n[id(a.attribute)]=r}return new nd(t,n,e.space)}var yd=vd({properties:{ariaActiveDescendant:null,ariaAtomic:ld,ariaAutoComplete:null,ariaBusy:ld,ariaChecked:ld,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:dd,ariaCurrent:null,ariaDescribedBy:dd,ariaDetails:null,ariaDisabled:ld,ariaDropEffect:dd,ariaErrorMessage:null,ariaExpanded:ld,ariaFlowTo:dd,ariaGrabbed:ld,ariaHasPopup:null,ariaHidden:ld,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dd,ariaLevel:J,ariaLive:null,ariaModal:ld,ariaMultiLine:ld,ariaMultiSelectable:ld,ariaOrientation:null,ariaOwns:dd,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:ld,ariaReadOnly:ld,ariaRelevant:null,ariaRequired:ld,ariaRoleDescription:dd,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:ld,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function bd(e,t){return t in e?e[t]:t}function xd(e,t){return bd(e,t.toLowerCase())}var Sd=vd({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:fd,acceptCharset:dd,accessKey:dd,action:null,allow:null,allowFullScreen:cd,allowPaymentRequest:cd,allowUserMedia:cd,alpha:cd,alt:null,as:null,async:cd,autoCapitalize:null,autoComplete:dd,autoFocus:cd,autoPlay:cd,blocking:dd,capture:null,charSet:null,checked:cd,cite:null,className:dd,closedBy:null,colorSpace:null,cols:J,colSpan:J,command:null,commandFor:null,content:null,contentEditable:ld,controls:cd,controlsList:dd,coords:J|fd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:cd,defer:cd,dir:null,dirName:null,disabled:cd,download:ud,draggable:ld,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:cd,formTarget:null,headers:dd,height:J,hidden:ud,high:J,href:null,hrefLang:null,htmlFor:dd,httpEquiv:dd,id:null,imageSizes:null,imageSrcSet:null,inert:cd,inputMode:null,integrity:null,is:null,isMap:cd,itemId:null,itemProp:dd,itemRef:dd,itemScope:cd,itemType:dd,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:cd,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:cd,muted:cd,name:null,nonce:null,noModule:cd,noValidate:cd,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:cd,optimum:J,pattern:null,ping:dd,placeholder:null,playsInline:cd,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:cd,referrerPolicy:null,rel:dd,required:cd,reversed:cd,rows:J,rowSpan:J,sandbox:dd,scope:null,scoped:cd,seamless:cd,selected:cd,shadowRootClonable:cd,shadowRootCustomElementRegistry:cd,shadowRootDelegatesFocus:cd,shadowRootMode:null,shadowRootSerializable:cd,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:ld,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:cd,useMap:null,value:ld,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dd,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:cd,declare:cd,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:cd,noHref:cd,noShade:cd,noWrap:cd,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:ld,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:cd,disablePictureInPicture:cd,disableRemotePlayback:cd,exportParts:fd,part:dd,prefix:null,property:null,results:J,security:null,unselectable:null},space:`html`,transform:xd}),Cd=vd({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:pd,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:dd,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:cd,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fd,g2:fd,glyphName:fd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:pd,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dd,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pd,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pd,rev:pd,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pd,requiredFeatures:pd,requiredFonts:pd,requiredFormats:pd,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:pd,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pd,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pd,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:bd}),wd=vd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Td=vd({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:xd}),Ed=vd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Dd={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`},Od=/[A-Z]/g,kd=/-[a-z]/g,Ad=/^data[-\w.:]+$/i;function jd(e,t){let n=id(t),r=t,i=ad;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ad.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(kd,Nd);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!kd.test(e)){let n=e.replace(Od,Md);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=gd}return new i(r,t)}function Md(e){return`-`+e.toLowerCase()}function Nd(e){return e.charAt(1).toUpperCase()}var Pd=rd([yd,Sd,wd,Td,Ed],`html`),Fd=rd([yd,Cd,wd,Td,Ed],`svg`),Id={}.hasOwnProperty;function Ld(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Id.call(t,e)){let n=String(t[e]);i=Id.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Rd=/["&'<>`]/g,zd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Bd=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Vd=/[|\\{}()[\]^$+*?.]/g,Hd=new WeakMap;function Ud(e,t){if(e=e.replace(t.subset?Wd(t.subset):Rd,r),t.subset||t.escapeOnly)return e;return e.replace(zd,n).replace(Bd,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Wd(e){let t=Hd.get(e);return t||(t=Gd(e),Hd.set(e,t)),t}function Gd(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Vd,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Kd=/[\dA-Fa-f]/;function qd(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Kd.test(String.fromCharCode(t))?r:r+`;`}var Jd=/\d/;function Yd(e,t,n){let r=`&#`+String(e);return n&&t&&!Jd.test(String.fromCharCode(t))?r:r+`;`}var Xd=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Zd={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Qd=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],$d={}.hasOwnProperty,ef={},tf;for(tf in Zd)$d.call(Zd,tf)&&(ef[Zd[tf]]=tf);var nf=/[^\dA-Za-z]/;function rf(e,t,n,r){let i=String.fromCharCode(e);if($d.call(ef,i)){let e=ef[i],a=`&`+e;return n&&Xd.includes(e)&&!Qd.includes(e)&&(!r||t&&t!==61&&nf.test(String.fromCharCode(t)))?a:a+`;`}return``}function af(e,t,n){let r=qd(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=rf(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Yd(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function of(e,t){return Ud(e,Object.assign({format:af},t))}var sf=/^>|^->|<!--|-->|--!>|<!-$/g,cf=[`>`],lf=[`<`,`>`];function uf(e,t,n,r){return r.settings.bogusComments?`<?`+of(e.value,Object.assign({},r.settings.characterReferences,{subset:cf}))+`>`:`<!--`+e.value.replace(sf,i)+`-->`;function i(e){return of(e,Object.assign({},r.settings.characterReferences,{subset:lf}))}}function df(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function ff(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function pf(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function mf(e){return e.join(` `).trim()}var hf=/[ \t\n\f\r]/g;function gf(e){return typeof e==`object`?e.type===`text`&&_f(e.value):_f(e)}function _f(e){return e.replace(hf,``)===``}var vf=xf(1),yf=xf(-1),bf=[];function xf(e){return t;function t(t,n,r){let i=t?t.children:bf,a=(n||0)+e,o=i[a];if(!r)for(;o&&gf(o);)a+=e,o=i[a];return o}}var Sf={}.hasOwnProperty;function Cf(e){return t;function t(t,n,r){return Sf.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var wf=Cf({body:Df,caption:Tf,colgroup:Tf,dd:jf,dt:Af,head:Tf,html:Ef,li:kf,optgroup:Nf,option:Pf,p:Of,rp:Mf,rt:Mf,tbody:If,td:zf,tfoot:Lf,th:zf,thead:Ff,tr:Rf});function Tf(e,t,n){let r=vf(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&gf(r.value.charAt(0)))}function Ef(e,t,n){let r=vf(n,t);return!r||r.type!==`comment`}function Df(e,t,n){let r=vf(n,t);return!r||r.type!==`comment`}function Of(e,t,n){let r=vf(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function kf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Af(e,t,n){let r=vf(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function jf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Mf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Nf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Pf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Ff(e,t,n){let r=vf(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function If(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Lf(e,t,n){return!vf(n,t)}function Rf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function zf(e,t,n){let r=vf(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Bf=Cf({body:Uf,colgroup:Wf,head:Hf,html:Vf,tbody:Gf});function Vf(e){let t=vf(e,-1);return!t||t.type!==`comment`}function Hf(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Uf(e){let t=vf(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&gf(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Wf(e,t,n){let r=yf(n,t),i=vf(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&wf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Gf(e,t,n){let r=yf(n,t),i=vf(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&wf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Kf={name:[[`
17
+ \f\r &/=>`.split(``),`
18
+ \f\r "&'/=>\``.split(``)],[`\0
19
+ \f\r "&'/<=>`.split(``),`\0
20
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
21
+ \f\r &>`.split(``),`\0
22
+ \f\r "&'<=>\``.split(``)],[`\0
23
+ \f\r "&'<=>\``.split(``),`\0
24
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function qf(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Fd);let l=Jf(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Bf(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!wf(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Jf(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Yf(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Yf(e,t,n){let r=jd(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=of(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Kf.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?pf:mf)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=of(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Kf.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&ff(n,o)>ff(n,e.alternative)&&(o=e.alternative),s=o+of(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Kf.single:Kf.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Xf=[`<`,`&`];function Zf(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:of(e.value,Object.assign({},r.settings.characterReferences,{subset:Xf}))}function Qf(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Zf(e,t,n,r)}function $f(e,t,n,r){return r.all(e)}var ep=Ld(`type`,{invalid:tp,unknown:np,handlers:{comment:uf,doctype:df,element:qf,raw:Qf,root:$f,text:Zf}});function tp(e){throw Error("Expected node, not `"+e+"`")}function np(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var rp={},ip={},ap=[];function op(e,t){let n=t||rp,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:sp,all:cp,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||td,characterReferences:n.characterReferences||ip,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Fd:Pd,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function sp(e,t,n){return ep(e,t,n,this)}function cp(e){let t=[],n=e&&e.children||ap,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var lp=/\s+/g;function up(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(lp)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(lp);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var dp=/:?lang=["']([^"']+)["']/g,fp=/(?:```|~~~)([\w-]+)/g,pp=/\\begin\{([\w-]+)\}/g,mp=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,hp=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function gp(e){let t=Cu(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function _p(e,t,n){let r=new Set;for(let t of e.matchAll(dp)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(fp)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(pp)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(mp)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(hp.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var vp=[`color`,`background-color`];function yp(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function bp(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function xp(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=bp(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return yp(e,a)})):e}function Sp(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Cp(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&vp.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Mc('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Cp(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&$c.Italic&&(t[`font-style`]=`italic`),e.fontStyle&$c.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&$c.Underline&&n.push(`underline`),e.fontStyle&$c.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function wp(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Tp(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=gp(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Mc(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new Mc(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Mc(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Ep(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return xp(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Mc(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Dp(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Mc(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Mc(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&up(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Ep(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Mc(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Mc(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Dp(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Dp).join(``):``}var Op=[Tp()];function kp(e){let t=Ap(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Op]}function Ap(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var jp=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Mp={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Np(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Pp(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Fp(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Mp[r]&&t.push({type:`setDecoration`,value:Mp[r]});else if(r<=29){let e=Mp[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:jp[r-30]}});else if(r===38){let n=Pp(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:jp[r-40]}});else if(r===48){let n=Pp(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:jp[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:jp[r-100+8]}})}}return t}function Ip(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Np(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Fp(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Lp={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Rp(e=Lp){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<jp.length;e++)r.push(t(jp[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var zp=/#([0-9a-f]{3,8})/i,Bp=/var\((--[\w-]+-ansi-[\w-]+)\)/,Vp={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Hp(e,t,n){let r=mu(e,n),i=Cu(t),a=Rp(Object.fromEntries(jp.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Vp[t]]}))),o=Ip();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=hu(i,r),o=hu(o,r),n.decorations.has(`dim`)&&(i=Up(i));let s=$c.None;return n.decorations.has(`bold`)&&(s|=$c.Bold),n.decorations.has(`italic`)&&(s|=$c.Italic),n.decorations.has(`underline`)&&(s|=$c.Underline),n.decorations.has(`strikethrough`)&&(s|=$c.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Up(e){let t=e.match(zp);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Bp);return n?`var(${n[1]}-dim)`:e}function Wp(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!vu(r)&&!bu(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Hp(r,t,n)}return Wu(e,t,n)}function Gp(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new Mc("`themes` option must not be empty");let p=$u(e,t,n,Wp);if(c=Ru(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new Mc(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Sp(e,h,u,l,d))),c&&Lu(a,c);let g=f.map(e=>mu(e.theme,n));i=Kp(f,m,g,u,l,`fg`,d),r=Kp(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=mu(n.theme,n);a=Wp(e,t,n);let l=e.getTheme(n.theme);r=hu(l.bg,s),i=hu(l.fg,s),o=l.name,c=Ru(a)}else throw new Mc("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Kp(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=hu(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Mc('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${hu(t[r][a],n[r])||`inherit`}, ${hu(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var qp=/^\s+$/,eee=/^(\s*)(.*?)(\s*)$/;function Jp(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Jp(e,t,n),codeToTokens:(t,n)=>Gp(e,t,n)}){let i=t;for(let e of kp(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Gp(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Xp(a):d===`never`&&(a=tee(a)),f&&(a=Zp(a));let p={...r,get source(){return i}};for(let e of kp(n))a=e.tokens?.call(p,a)||a;return Yp(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Yp(e,t,n,r=Ru(e)){let i=kp(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:up,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
25
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=wp(a.htmlStyle||Cp(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Lu(m,r),m}function Xp(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&$c.Underline||i.fontStyle&$c.Strikethrough));o&&qp.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function tee(e){return e.map(e=>e.flatMap(e=>{if(qp.test(e.content))return e;let t=e.content.match(eee);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Zp(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=wp(e.htmlStyle||Cp(e)),i=wp(n.htmlStyle||Cp(n)),a=e.fontStyle&&(e.fontStyle&$c.Underline||e.fontStyle&$c.Strikethrough),o=n.fontStyle&&(n.fontStyle&$c.Underline||n.fontStyle&$c.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Qp=op;function $p(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Jp(e,t,n),codeToTokens:(t,n)=>Gp(e,t,n)},i=Qp(Jp(e,t,n,r));for(let e of kp(n))i=e.postprocess?.call(r,i,n)||i;return i}async function em(e){let t=await Fu(e);return{getLastGrammarState:(...e)=>Gu(t,...e),codeToTokensBase:(e,n)=>Wp(t,e,n),codeToTokensWithThemes:(e,n)=>$u(t,e,n),codeToTokens:(e,n)=>Gp(t,e,n),codeToHast:(e,n)=>Jp(t,e,n),codeToHtml:(e,n)=>$p(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function tm(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,yu(n))return[];let r=t[n];if(!r)throw new Mc(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(xu(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Mc(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await em({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function nm(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function nee(e,t){let n=nm(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var rm=tm({langs:ec,themes:tc,engine:()=>(0,jc.createOnigurumaEngine)(q(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:ree,codeToHast:iee,codeToTokens:aee,codeToTokensBase:oee,codeToTokensWithThemes:see,getSingletonHighlighter:cee,getLastGrammarState:lee}=nee(rm,{guessEmbeddedLanguages:_p}),im=4294967295,am=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:im,end:im,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function om(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function sm(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var cm=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),lm=String.raw;function um(e,t){if(e==null)throw Error(t??`Value expected`);return e}var dm=lm`\[\^?`,fm=`c.? | C(?:-.?)?|${lm`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${lm`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${lm`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${lm`o\{[^\}]*\}?`}|${lm`\d{1,3}`}`,pm=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,mm=new RegExp(lm`
26
+ \\ (?:
27
+ ${fm}
28
+ | [gk]<[^>]*>?
29
+ | [gk]'[^']*'?
30
+ | .
31
+ )
32
+ | \( (?:
33
+ \? (?:
34
+ [:=!>({]
35
+ | <[=!]
36
+ | <[^>]*>
37
+ | '[^']*'
38
+ | ~\|?
39
+ | #(?:[^)\\]|\\.?)*
40
+ | [^:)]*[:)]
41
+ )?
42
+ | \*[^\)]*\)?
43
+ )?
44
+ | (?:${pm.source})+
45
+ | ${dm}
46
+ | .
47
+ `.replace(/\s+/g,``),`gsu`),hm=new RegExp(lm`
48
+ \\ (?:
49
+ ${fm}
50
+ | .
51
+ )
52
+ | \[:(?:\^?\p{Alpha}+|\^):\]
53
+ | ${dm}
54
+ | &&
55
+ | .
56
+ `.replace(/\s+/g,``),`gsu`);function gm(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=yee(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(mm.lastIndex=0;s=mm.exec(e);){let t=_m(a,e,s[0],mm.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(mm.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?xee(e,u):e).flat(),flags:r}}function _m(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=vm(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Sm(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:fee(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Cm(n)}}if(a===`K`)return{token:Am(`keep`,n)};if(a===`N`||a===`R`)return{token:km(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:km(`any`,n)};if(a===`X`)return{token:km(`text_segment`,n)};let e=bm(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:gee(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:hee(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Nm(`group`,n)};if(n===`(?>`)return{token:Nm(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Nm(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Nm(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Nm(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Mm(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
57
+ `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:km(`dot`,n)}:n===`^`||n===`$`?{token:Sm(e.singleline?{"^":lm`\A`,$:lm`\Z`}[n]:n,n)}:n===`|`?{token:xm(n)}:pm.test(n)?{tokens:See(n)}:{token:wm(om(n),n)}}function vm(e,t,n){let r=[Om(t[1]===`^`,t)],i=1,a;for(hm.lastIndex=n;a=hm.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Om(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(wm(93,e));else if(i--,r.push(Tm(e)),!i)break}else{let t=ym(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:hm.lastIndex||e.length}}function ym(e){if(e[0]===`\\`)return bm(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!cm.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return km(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Em(e):e===`&&`?Dm(e):wm(om(e),e)}function bm(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return mee(e);if(`dDhHsSwW`.includes(n))return _ee(e);if(e.startsWith(lm`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return vee(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return wm(om(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return wm(bee(e),e);if(Pm.has(n))return wm(Pm.get(n),e);if(/\d/.test(n))return jm(t,e);if(e===`\\`)throw Error(lm`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return wm(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function xm(e){return{type:`Alternator`,raw:e}}function Sm(e,t){return{type:`Assertion`,kind:e,raw:t}}function Cm(e){return{type:`Backreference`,raw:e}}function wm(e,t){return{type:`Character`,value:e,raw:t}}function Tm(e){return{type:`CharacterClassClose`,raw:e}}function Em(e){return{type:`CharacterClassHyphen`,raw:e}}function Dm(e){return{type:`CharacterClassIntersector`,raw:e}}function Om(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function km(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Am(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:um(n.flags),raw:t}}function jm(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Mm(e){return{type:`GroupClose`,raw:e}}function Nm(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function uee(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function dee(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function fee(e){return{type:`Subroutine`,raw:e}}var pee=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Pm=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function mee(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return wm(om(t.toUpperCase())-64,e)}function hee(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Im(n),o=Im(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Am(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Nm(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function gee(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=pee.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return uee(l,r??null,i?.split(`,`)??null,e)}function Fm(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return dee(t,n,r,e)}function _ee(e){let t=e[1].toLowerCase();return km({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function vee(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return km(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function Im(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function yee(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function bee(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function xee(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Cm(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(lm`Octal encoded byte above 177 unsupported "${n}"`)}else r=om(t);a.push(wm(r,(e===0?`\\`:``)+t))}return a}function See(e){let t=[],n=new RegExp(pm,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Fm(e.slice(0,-1)));continue}}}t.push(Fm(e))}return t}function Lm(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Cee(e){return wee.has(e.type)}var wee=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Rm(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=gm(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return qm();case`Assertion`:return Tee(n);case`Backreference`:return zm(n,a);case`Character`:return Zm(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Bm(n,a,t);case`CharacterClassOpen`:return Vm(n,a,t);case`CharacterSet`:return Hm(n,a);case`Directive`:return th(n.kind,{flags:n.flags});case`GroupOpen`:return Um(n,a,t);case`NamedCallout`:return ah(n.kind,n.tag,n.arguments);case`Quantifier`:return Wm(n,a);case`Subroutine`:return Gm(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=ch(nh(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(lm`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(lm`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Tee({kind:e}){return Jm(um({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===lm`\B`||e===lm`\Y`})}function zm({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,Ym(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return Ym(r)}return i(+r)}function Bm(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),$m(o,e);throw Error(`Invalid character class range`)}return Zm(om(`-`))}function Vm({negate:e},t,n){let{tokens:r,walk:i}=t,a=[Qm()],o=r[t.nextIndex],s=yh(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(Qm()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=yh(r[t.nextIndex],o)}let c=Qm({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Hm({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=vh(n);if(cm.has(r)&&!o?.has(r))e=`posix`,n=r;else return uh(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?oh(n,{negate:t}):eh(e,{negate:t})}function Um(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=dh(e),l=c.type===`AbsenceFunction`,u=hh(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&sm(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=bh(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(qm()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(mh(t)||t.type===`CapturingGroup`)throw Error(e)}else if(mh(t)||hh(t)&&t.negate)throw Error(e)}}f=bh(r[t.nextIndex])}return t.nextIndex++,c}function Wm({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Cee(a))throw Error(`Quantifier requires a repeatable token`);let o=sh(e,t,n,a);return i.body.pop(),o}function Gm({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=lh(i);return r.push(o),o}function Km(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:fh(t?.body)}}function qm(e){return{type:`Alternative`,body:ph(e?.body)}}function Jm(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function Ym(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function Xm(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!gh(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:fh(t?.body)}}function Zm(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Qm(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:ph(e?.body)}}function $m(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function eh(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function th(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:um(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function nh(e){return{type:`Flags`,...e}}function rh(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:fh(e?.body)}}function ih(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:fh(e?.body)}}function ah(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function oh(e,t){let n=!!t?.negate;if(!cm.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function sh(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function ch(e,t){return{type:`Regex`,body:fh(t?.body),flags:e}}function lh(e){return{type:`Subroutine`,ref:e}}function uh(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(vh(e));if(!r){if(n.normalizeUnknownPropertyNames)r=_h(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(lm`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function dh({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Km(`repeater`);case`atomic`:return rh({atomic:!0});case`capturing`:return Xm(i,{name:n});case`group`:return rh({flags:e});case`lookahead`:case`lookbehind`:return ih({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function fh(e){if(e===void 0)e=[qm()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function ph(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function mh(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function hh(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function gh(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function _h(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function vh(e){return e.replace(/[- _]+/g,``).toLowerCase()}function yh(e,t){let n=t;return um(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function bh(e){return um(e,`Unclosed group`)}function xh(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Sh(c).splice(Math.max(0,Ch(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Sh(c).splice(Ch(s)+1)},removeAllPrevSiblings(){let e=Ch(s)+l;return l-=e,Sh(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Ch(s)+l)]=e:um(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Sh(c).splice(Math.max(0,Ch(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,Ch(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Sh(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Ch(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var wh=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Th(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Eh(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Dh=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Oh(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Dh.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Dh.CHAR_CLASS:Dh.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function kh(e,t,n,r){Oh(e,t,n,r)}function Ah(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Dh.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function jh(e,t,n){return!!Ah(e,t,0,n)}function Mh(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var Nh=new RegExp(String.raw`(?<noncapturingStart>${wh})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Ph(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Nh.lastIndex=Number.isNaN(c)?0:c+7;f=Nh.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Th(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=Oh(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Dh.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Fh=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Ih=new RegExp(String.raw`
58
+ \\(?: \d+
59
+ | c[A-Za-z]
60
+ | [gk]<[^>]+>
61
+ | [pPu]\{[^\}]+\}
62
+ | u[A-Fa-f\d]{4}
63
+ | x[A-Fa-f\d]{2}
64
+ )
65
+ | \((?: \? (?: [:=!>]
66
+ | <(?:[=!]|[^>]+>)
67
+ | [A-Za-z\-]+:
68
+ | \(DEFINE\)
69
+ ))?
70
+ | (?<qBase>${Fh})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
71
+ | \\?.
72
+ `.replace(/\s+/g,``),`gsu`);function Lh(e){if(!RegExp(`${Fh}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Ih.lastIndex=0;o=Ih.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=Eh(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}Ih.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Rh=String.raw,zh=Rh`\(\?R=(?<rDepth>[^\)]+)\)|${Rh`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Bh=Rh`\(\?<(?![=!])(?<captureName>[^>]+)>`,Vh=Rh`${Bh}|(?<unnamed>\()(?!\?)`,Hh=new RegExp(Rh`${Bh}|${zh}|\(\?|\\?.`,`gsu`),Uh=`Cannot use multiple overlapping recursions`;function Wh(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(zh,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&jh(e,Rh`\(\?\(DEFINE\)`,Dh.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=jh(e,Rh`\\[1-9]`,Dh.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Hh.lastIndex=0;f=Hh.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Gh(m),l)throw Error(Uh);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(Hh.lastIndex);if(jh(s,zh,Dh.DEFAULT))throw Error(Uh);let c=m-1;e=Kh(t,s,c,!1,n,a,d),i=Yh(i,t,c,a.length,0,d);break}if(h){Gh(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Uh);break}if(!u)throw Error(Rh`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Rh`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Mh(e,p);if(o&&jh(m,Rh`${Bh}|\((?!\?)`,Dh.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Kh(_,v,b,!0,n,a,d);i=Yh(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Hh.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Hh.lastIndex),s.set(p,Hh.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Hh.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Gh(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Kh(e,t,n,r,i,a,o){let s=new Set;r&&kh(e+t,Bh,({groups:{captureName:e}})=>{s.add(e)},Dh.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${qh(`(?:${e}`,`forward`,...c)}(?:)${qh(`${t})`,`backward`,...c)}${t}`}function qh(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=Oh(e,Rh`${Vh}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),Jh(i,n),s?e:`(?<${t}${l}>`}return Rh`\k<${c}${l}>`},Dh.DEFAULT)}return c}function Jh(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Yh(e,t,n,r,i,a){if(e.size&&r){let o=0;kh(t,Vh,()=>o++,Dh.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var Xh=String.fromCodePoint,Zh=String.raw,Qh={},$h=globalThis.RegExp;Qh.flagGroups=(()=>{try{new $h(`(?i:)`)}catch{return!1}return!0})(),Qh.unicodeSets=(()=>{try{new $h(`[[]]`,`v`)}catch{return!1}return!0})(),Qh.bugFlagVLiteralHyphenIsRange=Qh.unicodeSets?(()=>{try{new $h(Zh`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,Qh.bugNestedClassIgnoresNegation=Qh.unicodeSets&&new $h(`[[^a]]`,`v`).test(`a`);function eg(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function tg(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function ng(e,t){return ig[e]>=ig[t]}function rg(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ig={ES2025:2025,ES2024:2024,ES2018:2018},ag={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function og(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!ag[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=Qh.flagGroups?`ES2025`:Qh.unicodeSets?`ES2024`:`ES2018`),t}var sg=`[ -\r ]`,cg=new Set([Xh(304),Xh(305)]),lg=Zh`[\p{L}\p{M}\p{N}\p{Pc}]`;function ug(e){if(cg.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=mg.get(n),a=fg.get(n),o=pg.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var dg=new Map(`C Other
73
+ Cc Control cntrl
74
+ Cf Format
75
+ Cn Unassigned
76
+ Co Private_Use
77
+ Cs Surrogate
78
+ L Letter
79
+ LC Cased_Letter
80
+ Ll Lowercase_Letter
81
+ Lm Modifier_Letter
82
+ Lo Other_Letter
83
+ Lt Titlecase_Letter
84
+ Lu Uppercase_Letter
85
+ M Mark Combining_Mark
86
+ Mc Spacing_Mark
87
+ Me Enclosing_Mark
88
+ Mn Nonspacing_Mark
89
+ N Number
90
+ Nd Decimal_Number digit
91
+ Nl Letter_Number
92
+ No Other_Number
93
+ P Punctuation punct
94
+ Pc Connector_Punctuation
95
+ Pd Dash_Punctuation
96
+ Pe Close_Punctuation
97
+ Pf Final_Punctuation
98
+ Pi Initial_Punctuation
99
+ Po Other_Punctuation
100
+ Ps Open_Punctuation
101
+ S Symbol
102
+ Sc Currency_Symbol
103
+ Sk Modifier_Symbol
104
+ Sm Math_Symbol
105
+ So Other_Symbol
106
+ Z Separator
107
+ Zl Line_Separator
108
+ Zp Paragraph_Separator
109
+ Zs Space_Separator
110
+ ASCII
111
+ ASCII_Hex_Digit AHex
112
+ Alphabetic Alpha
113
+ Any
114
+ Assigned
115
+ Bidi_Control Bidi_C
116
+ Bidi_Mirrored Bidi_M
117
+ Case_Ignorable CI
118
+ Cased
119
+ Changes_When_Casefolded CWCF
120
+ Changes_When_Casemapped CWCM
121
+ Changes_When_Lowercased CWL
122
+ Changes_When_NFKC_Casefolded CWKCF
123
+ Changes_When_Titlecased CWT
124
+ Changes_When_Uppercased CWU
125
+ Dash
126
+ Default_Ignorable_Code_Point DI
127
+ Deprecated Dep
128
+ Diacritic Dia
129
+ Emoji
130
+ Emoji_Component EComp
131
+ Emoji_Modifier EMod
132
+ Emoji_Modifier_Base EBase
133
+ Emoji_Presentation EPres
134
+ Extended_Pictographic ExtPict
135
+ Extender Ext
136
+ Grapheme_Base Gr_Base
137
+ Grapheme_Extend Gr_Ext
138
+ Hex_Digit Hex
139
+ IDS_Binary_Operator IDSB
140
+ IDS_Trinary_Operator IDST
141
+ ID_Continue IDC
142
+ ID_Start IDS
143
+ Ideographic Ideo
144
+ Join_Control Join_C
145
+ Logical_Order_Exception LOE
146
+ Lowercase Lower
147
+ Math
148
+ Noncharacter_Code_Point NChar
149
+ Pattern_Syntax Pat_Syn
150
+ Pattern_White_Space Pat_WS
151
+ Quotation_Mark QMark
152
+ Radical
153
+ Regional_Indicator RI
154
+ Sentence_Terminal STerm
155
+ Soft_Dotted SD
156
+ Terminal_Punctuation Term
157
+ Unified_Ideograph UIdeo
158
+ Uppercase Upper
159
+ Variation_Selector VS
160
+ White_Space space
161
+ XID_Continue XIDC
162
+ XID_Start XIDS`.split(/\s/).map(e=>[vh(e),e])),fg=new Map([[`s`,Xh(383)],[Xh(383),`s`]]),pg=new Map([[Xh(223),Xh(7838)],[Xh(107),Xh(8490)],[Xh(229),Xh(8491)],[Xh(969),Xh(8486)]]),mg=new Map([_g(453),_g(456),_g(459),_g(498),...vg(8072,8079),...vg(8088,8095),...vg(8104,8111),_g(8124),_g(8140),_g(8188)]),hg=new Map([[`alnum`,Zh`[\p{Alpha}\p{Nd}]`],[`alpha`,Zh`\p{Alpha}`],[`ascii`,Zh`\p{ASCII}`],[`blank`,Zh`[\p{Zs}\t]`],[`cntrl`,Zh`\p{Cc}`],[`digit`,Zh`\p{Nd}`],[`graph`,Zh`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Zh`\p{Lower}`],[`print`,Zh`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Zh`[\p{P}\p{S}]`],[`space`,Zh`\p{space}`],[`upper`,Zh`\p{Upper}`],[`word`,Zh`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Zh`\p{AHex}`]]);function gg(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function _g(e){let t=Xh(e);return[t.toLowerCase(),t]}function vg(e,t){return gg(e,t).map(e=>_g(e))}var yg=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function bg(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};xg(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:ng(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};xh(e,Eee,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return xh(e,Dee,a),xh(e,Oee,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Eee={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=rh();e.body[0].body.push(ih({negate:!0,body:r}),uh(`Any`));let i=rh();i.body[0].body.push(sh(`greedy`,0,1/0,e)),n(Ng(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];tg(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Tg(t.get(e));if(n){let t=rh({flags:n});t.body[0].body=e.body,e.body=[Ng(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Ng(ih({body:[qm({body:[Jm(`string_end`)]}),qm({body:[Zm(10)]})]}),t));else if(c===`line_start`)o(Ng(Ag(Zh`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&Pee(e))o(Ng(ih({negate:!0}),t));else if(d)throw Error(Zh`Uses "\G" in a way that requires a subclass`);else o(Mg(Jm(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Ng(Ag(Zh`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${lg})(?!${lg})|(?<!${lg})(?=${lg}))`,n=`(?:(?<=${lg})(?=${lg})|(?<!${lg})(?!${lg}))`;o(Ng(Ag(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!kg(n)&&(n=wg(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!kg(r)&&(r=wg(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Ng(Qm({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(Mg(eh(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Ng(jg(Ag(sg),l),t));return}if(s&&(c===`word`||u===`word`)){n(Mg(eh(`word`,{negate:l}),t));return}if(c===`any`)n(Mg(uh(`Any`),t));else if(c===`digit`)n(Mg(uh(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Zh`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Zh`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Ng(Ag(Zh`(?>\r\n|${i?Zh`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Mg(uh(`AHex`,{negate:l}),t));else if(c===`newline`)n(Ng(Ag(l?`[^
163
+ ]`:`(?>\r
164
+ ?|[
165
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Xh(e.codePointAt(0)-1)}${Xh(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Ng(Ag(`[${e}]`),t))}else n(Ng(jg(Ag(hg.get(u)),l),t))}else if(c===`property`)dg.has(vh(u))||(e.key=`sc`);else if(c===`space`)n(Mg(uh(`space`,{negate:l}),t));else if(c===`word`)n(Ng(jg(Ag(lg),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=rh({flags:c});e.body[0].body=o(),i(Ng(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Lm(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Zh`Uses "\K" in a way that's unsupported`);let o=ih({behind:!0});o.body[0].body=a(),i(Ng(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Ng(ih({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=rh();t.body[0].body.push(e.body),e.body=Ng(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Dg(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Zh`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!kg(n)&&(n=wg(n,t),e.ref=n)}},Dee={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Mg(Cg(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&tg(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=tg(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=eg(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Cg(0):Sg(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Tg(jee(o,e=>e.type===`Group`&&!!e.flags)),t=e?eg(r.globalFlags,e):r.globalFlags;kee(t,r.currentFlags)||(l=rh({flags:Mee(t)}),l.body[0].body.push(c))}n(Ng(l,t),{traverse:!s})}},Oee={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Aee(t,e));i.length?i.length>1?n(Ng(rh({atomic:!0,body:i.reverse().map(e=>qm({body:[Ym(e.number)]}))}),t)):e.ref=i[0].number:n(Ng(ih({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Xm();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function xg(e){xh(e,{"*"({node:e,parent:t}){e.parent=t}})}function kee(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Aee(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Eg(n.parent);for(let r of t){if(r===n)break;if(r===e||Og(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Sg(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Sg(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Cg(e){let t=lh(e);return t.isRecursive=!0,t}function jee(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function wg(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Tg(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Mee({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Eg(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Dg(e){let t=e.find(e=>e.kind===`search_start`||Fee(e,{negate:!1})||!Nee(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=Dg(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Og(e,t){let n=Eg(e)??[];for(let e of n)if(e===t||Og(e,t))return!0;return!1}function Nee({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Pee(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Fee(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Lm(e.body[0],{type:`Assertion`,kind:`search_start`})}function kg(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ag(e,t){let n=Rm(e,{...t,unicodePropertyMap:dg}).body;return n.length>1||n[0].body.length>1?rh({body:n}):n[0].body[0]}function jg(e,t){return e.negate=t,e}function Mg(e,t){return e.parent=t,e}function Ng(e,t){return xg(e),e.parent=t,e}function Iee(e,t){let n=og(t),r=ng(n.target,`ES2024`),i=ng(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];xh(e,Lee,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,rg(Ree[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&tg(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Lee={"*":{enter({node:e},t){if(Wg(e)){let n=t.getCurrentModI();t.pushModI(e.flags?eg({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Wg(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Rg(Xh(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),zg(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&yg.has(e.value)&&t.setHasCasedChar()}},Ree={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Zh`\B`:Zh`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Xh(e),r=Bg(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Rg(n)){let e=ug(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Qh.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(Gg)&&(o=[Zm(45),...o.filter(e=>!Gg(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Qh.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=rh(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=qm({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Qh.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Bg(n,i),o=Bg(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Vg(zg(e)).forEach(e=>{s.add(Array.isArray(e)?`${Bg(e[0],i)}-${Bg(e[1],i)}`:Bg(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Zh`[^\n]`;if(e===`digit`)return t?Zh`\D`:Zh`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&yg.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Zh`\P`:Zh`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Zh`\W`:Zh`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=eg(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Hg(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Ug(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Zh`\g<${t}&R=${r}>`}},Pg=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Fg=new Set([`-`,`\\`,`]`,`^`,`[`]),Ig=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Lg=new Map([[9,Zh`\t`],[10,Zh`\n`],[11,Zh`\v`],[12,Zh`\f`],[13,Zh`\r`],[8232,Zh`\u2028`],[8233,Zh`\u2029`],[65279,Zh`\uFEFF`]]),zee=/^\p{Cased}$/u;function Rg(e){return zee.test(e)}function zg(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Xh(e);if(!Rg(t))continue;let o=ug(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Bg(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Lg.has(e))return Lg.get(e);if(e<32||e>126&&e<160||e>262143||t&&Bee(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Ig:Fg:Pg,a=Xh(e);return(i.has(a)?`\\`:``)+a}function Vg(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Hg(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Ug({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Wg({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Bee(e){return e>47&&e<58}function Gg({type:e,value:t}){return e===`Character`&&t===45}var Kg=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Jg(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(qg(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Yg(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function qg(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Jg(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)tg(n,t,{}).transferTo=e;return n}function Yg(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Xg(e,t){let n=Zg(e,t);return n.options?new Kg(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Zg(e,t){let n=og(t),r=bg(Rm(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:dg}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Iee(r,n),a=Wh(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Ph(Lh(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Qg(e,t){return Xg(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function $g(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Qg(e,{target:t.target}),{createScanner(e){return new am(e,t)},createString(e){return{content:e}}}}var e_=[`markdown`,`typescript`,`tsx`,`javascript`,`jsx`,`json`,`css`,`html`,`html-derivative`,`python`,`rust`,`go`,`shellscript`,`yaml`],t_=null;function Vee(){return t_??=rm({themes:[`github-dark`,`github-light`],langs:[...e_],engine:$g()}),t_}var Hee=200,Uee=20971520,n_=new Map,r_=0;function i_(e){let t=n_.get(e);return t!==void 0&&(n_.delete(e),n_.set(e,t)),t}function a_(e,t){if(!n_.has(e))for(n_.set(e,t),r_+=t.length*2;(n_.size>Hee||r_>Uee)&&n_.size>0;){let e=n_.keys().next().value;r_-=(n_.get(e)?.length??0)*2,n_.delete(e)}}async function o_(e,t,n=!0){let r=`${t}${e}`;if(n){let e=i_(r);if(e!==void 0)return e}try{let i=await Vee(),a=i.getLoadedLanguages().includes(t)?t:`text`,o=i.codeToHtml(e,{lang:a,themes:{light:`github-light`,dark:`github-dark`},defaultColor:`light`});return n&&a_(r,o),o}catch(e){return console.error(`snippet highlight failed:`,e),null}}var s_={command:Gn,"file-edit":zt,"file-write":Bt,mcp:Tn};function c_({kind:e,summary:t}){let[n,r]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(e!==`command`)return;let n=!0;return o_(t,`shellscript`).then(e=>{n&&r({summary:t,html:e})}),()=>{n=!1}},[e,t]);let i=n?.summary===t?n.html:null,a=(0,G.jsx)(Ls,{text:t,className:`absolute top-1 right-1 z-10 rounded-md bg-background/80 p-1 text-muted-foreground backdrop-blur`});return e===`command`&&i!=null?(0,G.jsxs)(`div`,{className:`relative mt-1.5`,children:[(0,G.jsx)(`div`,{className:`max-h-24 overflow-auto rounded-md text-xs leading-relaxed [&_pre]:m-0 [&_pre]:py-1.5 [&_pre]:pr-7 [&_pre]:pl-2 [&_pre]:font-mono [&_pre]:whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:i}}),a]}):(0,G.jsxs)(`div`,{className:`relative mt-1.5`,children:[(0,G.jsx)(`pre`,{className:`max-h-24 overflow-auto rounded-md bg-muted/50 py-1.5 pr-7 pl-2 font-mono text-xs whitespace-pre-wrap`,children:t}),a]})}var l_={timeout:`Auto-managed review timed out. Please decide.`,error:`Auto-managed review failed. Please decide.`,invalid:`Auto-managed review returned no valid decision. Please decide.`},u_=()=>typeof window>`u`||window.electronAPI?.remote?void 0:window.electronAPI?.dcg,d_={critical:`Critical`,high:`High`,medium:`Medium`,low:`Low`};function f_({guard:e}){let{t}=K(),n=e.ruleId===j;return(0,G.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-[11px]`,children:[(0,G.jsxs)(`p`,{className:`text-destructive`,children:[t(e.reason),` `,(0,G.jsx)(`code`,{className:`rounded bg-muted/60 px-1 font-mono text-[10px] text-muted-foreground`,children:e.ruleId})]}),(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:t(n?`Safety floor rule — still requires confirmation in full-access mode. Click Adjust to target a specific subdirectory or session temp folder, or Allow once.`:`Blocked by built-in guard — still requires confirmation in full-access mode. Review the command, click Adjust, or Allow once.`)})]})}function p_({guard:e}){let{t,locale:n}=K(),[r,i]=(0,H.useState)(null),a=e.decision===`warn`,o=e.decision===void 0||e.decision===`deny`,s=Ss(e.ruleId),[c,l]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!o)return;let t=!0;return l(!1),u_()?.ruleState(e.ruleId).then(n=>{t&&n&&i({ruleId:e.ruleId,state:n})}).catch(()=>{}),()=>{t=!1}},[e.ruleId,o]);let u=r?.ruleId===e.ruleId?r.state:null,d=n===`zh`?vs(e):{what:e.reason};return(0,G.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-[11px]`,children:[(0,G.jsxs)(`p`,{className:a?`text-muted-foreground`:`text-destructive`,title:e.ruleId,children:[e.severity&&(0,G.jsx)(`span`,{className:`mr-1 rounded bg-muted px-1 text-[10px]`,children:t(d_[e.severity])}),t(a?`dcg notice: {{reason}}`:`dcg: {{reason}}`,{reason:d.what}),(0,G.jsx)(`code`,{className:`ml-1 rounded bg-muted/60 px-1 font-mono text-[10px] text-muted-foreground`,children:e.ruleId})]}),!a&&(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:s?e.decision===`ask`?t(`Guard rule requires confirmation each time — still prompts in full-access mode. Click Adjust for a safer command, or Allow once.`):t(`Triggered by command guard — still prompts in full-access mode. Click Adjust to change the command or path, or manage exemptions in Settings (auto-suggested after 5 allows).`):t(`High-risk safety floor (cannot be exempted) — still requires confirmation in full-access mode. Click Adjust for a safer command or path, or Allow once.`)}),e.matched&&(0,G.jsxs)(`p`,{className:`text-muted-foreground`,children:[t(`Matched`),`:`,` `,(0,G.jsx)(`code`,{className:`rounded bg-muted/60 px-1 font-mono`,children:e.matched})]}),d.why&&(0,G.jsxs)(`p`,{className:`text-muted-foreground`,children:[t(`Why it is dangerous`),`: `,d.why]}),d.alt&&(0,G.jsxs)(`div`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,G.jsxs)(`span`,{children:[t(`Safer alternative`),`:`]}),(0,G.jsx)(`code`,{className:`rounded bg-muted/60 px-1 font-mono`,children:d.alt}),(0,G.jsx)(Ls,{text:d.alt,className:`p-0.5`})]}),e.explanation&&(0,G.jsxs)(`details`,{className:`text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:t(`dcg explanation`)}),(0,G.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.explanation})]}),u?.suggestExempt&&(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 text-amber-600 dark:text-amber-400`,children:c?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:t(`Allow "{{rule}}" automatically in new conversations? You can revoke this anytime in Settings.`,{rule:e.ruleId})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{l(!1),u_()?.ruleExempt(e.ruleId).then(t=>{t&&i({ruleId:e.ruleId,state:t})}).catch(()=>{})},className:`font-medium underline underline-offset-2`,children:t(`Confirm exemption`)}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(!1),className:`text-muted-foreground underline underline-offset-2`,children:t(`Cancel`)})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:t(`You have allowed this rule {{count}} times. Allow it automatically from now on?`,{count:u.allowCount})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`underline underline-offset-2`,children:t(`Always allow this rule`)})]})}),u?.exempt&&(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:t(`This rule is allowed automatically in new conversations until dcg is updated.`)})]})}var m_=400;function h_({approvals:e,onRespond:t,allowSession:n=!0,handoff:r=!0,clockOffset:i}){let{t:a}=K(),[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(null),u=e[0],d=u?.requestId,f=Rs(u?.phase===`reviewing`?void 0:u?.expiresAt,i);if((0,H.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>l(d),m_);return()=>clearTimeout(e)},[d]),!u)return null;let p=s_[u.kind]??Fn,m=u.phase===`reviewing`,h=c!==u.requestId||o===u.requestId||f!==void 0&&f<=0,g=e=>{e!==`review`&&s(u.requestId),e===`allow`&&u.guard&&(u.guard.decision===void 0||u.guard.decision===`deny`)&&!u.guard.ruleId.startsWith(`enso.`)&&u_()?.ruleAllowed(u.guard.ruleId).catch(()=>{}),t(u.requestId,e)};return(0,G.jsxs)(`div`,{"data-enso":`approval`,className:`mb-1 rounded-lg border border-border/60 bg-muted/20 px-2.5 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Fn,{className:`h-3.5 w-3.5 shrink-0 text-amber-500`}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:a(m?`Assistant reviewing…`:`Approval required`)}),(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-muted-foreground`,children:[(0,G.jsx)(p,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate font-mono`,children:u.toolCallId&&ws(u.toolCallId)?`${a(`Isolated sandbox`)} › ${Fs(u.tool,a)}`:Fs(u.tool,a)})]}),u.protected&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-destructive/15 px-1.5 text-[10px] text-destructive`,children:Ns(u.protected,a)}),(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,G.jsx)(zs,{remainingMs:f,expiredLabel:`Timed out · denied`}),e.length>1&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[`1/`,e.length]})]})]}),u.reviewFallback&&(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-amber-600 dark:text-amber-400`,children:a(l_[u.reviewFallback])}),u.guard&&(u.guard.ruleId.startsWith(`enso.`)?(0,G.jsx)(f_,{guard:u.guard}):(0,G.jsx)(p_,{guard:u.guard})),u.summary&&(0,G.jsx)(c_,{kind:u.kind,summary:u.summary}),!m&&(0,G.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1.5`,children:[r&&u.kind===`command`&&(0,G.jsx)(`button`,{type:`button`,disabled:h,title:a(`Send back for a safer command`),onClick:()=>g(`revise`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:a(`Adjust`)}),r&&(0,G.jsx)(`button`,{type:`button`,disabled:h,title:a(`Let the assistant decide`),onClick:()=>g(`review`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:a(`Assistant review`)}),(0,G.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>g(`deny`),className:`rounded-md px-2.5 py-1 text-xs text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-50`,children:a(`Deny`)}),n&&!u.protected&&!u.mandatory&&(0,G.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>g(`allowSession`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:a(`Always allow this session`)}),(0,G.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>g(`allow`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:a(`Allow`)})]})]})}function g_(e){return e>=0&&e<9?String(e+1):null}function __(e,t){let n=t===void 0?-1:e?.indexOf(t)??-1;return n>=0?n:0}function v_(e,t,n){return n===`ArrowDown`?Math.min(e+1,t-1):n===`ArrowUp`?Math.max(e-1,0):null}function y_({asks:e,onAnswer:t,clockOffset:n,autoFocus:r=!0}){let{t:i}=K(),a=(0,H.useRef)(null),o=(0,H.useRef)(null),s=(0,H.useRef)([]),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(()=>new Set),g=e.filter(e=>e.answered),_=e.find(e=>!e.answered),v=_?.requestId,y=Rs(_?.expiresAt,n),b=v!==void 0&&m.has(v),x=_?.options,S=_?.recommended,C=e=>{let t=s.current[e];x&&e<x.length&&t?t.focus():a.current?.focus()};if((0,H.useEffect)(()=>{if(!r||!v||b)return;let e=__(x,S),t=s.current[e];x&&e<x.length&&t?t.focus():a.current?.focus()},[r,v,b]),(0,H.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=()=>d(e.scrollHeight-e.scrollTop-e.clientHeight>1);t();let n=new ResizeObserver(t);return n.observe(e),e.addEventListener(`scroll`,t,{passive:!0}),()=>{n.disconnect(),e.removeEventListener(`scroll`,t)}},[v,b]),!_)return g.length>0?(0,G.jsx)(b_,{asks:g}):null;let w=f===_.requestId||y!==void 0&&y<=0,T=e=>{e.trim()&&(p(_.requestId),l(``),t(_.requestId,e.trim()))},E=()=>h(e=>e.has(_.requestId)?e:new Set(e).add(_.requestId));return b?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(b_,{asks:g}),(0,G.jsxs)(`button`,{type:`button`,"data-enso":`ask-later`,onClick:()=>h(e=>{let t=new Set(e);return t.delete(_.requestId),t}),className:`mb-1 flex w-full items-center gap-2 rounded-lg border border-dashed border-border/60 px-2.5 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground`,children:[(0,G.jsx)(cn,{className:`h-3.5 w-3.5 shrink-0 text-blue-500`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:_.question}),e.length>1&&(0,G.jsxs)(`span`,{className:`shrink-0 text-[10px] tabular-nums`,children:[`1/`,e.length]}),(0,G.jsx)(_t,{className:`h-3 w-3 shrink-0`})]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(b_,{asks:g}),(0,G.jsxs)(`div`,{"data-enso":`ask`,className:`mb-1 flex max-h-[60dvh] min-h-0 flex-col rounded-lg border border-border/60 bg-muted/20 px-2.5 py-2`,onKeyDown:e=>{if(e.nativeEvent.isComposing||w)return;if(e.key===`Escape`){e.preventDefault(),E();return}let t=e.target,n=(x?.length??0)+1,r=t===a.current?n-1:s.current.indexOf(t),i=r>=0?v_(r,n,e.key):null;if(i!==null){e.preventDefault(),C(i);return}if(t instanceof HTMLInputElement&&(t.value.length>0||e.key===`Enter`))return;let o=Number(e.key)-1,c=x?.[o];if(g_(o)&&c){e.preventDefault(),T(c);return}t instanceof HTMLButtonElement&&r>=0&&(e.key===`Process`?a.current?.focus():e.key.length===1&&e.key!==` `&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),l(t=>t+e.key),a.current?.focus()))},children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,G.jsx)(cn,{className:`h-3.5 w-3.5 shrink-0 text-blue-500`}),_.relay&&(0,G.jsx)(`span`,{"data-enso":`ask-relay`,className:`min-w-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground [overflow-wrap:anywhere]`,children:i(`Handed to {{name}}`,{name:_.relay.name})}),(0,G.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:E,className:`rounded-md px-1.5 py-0.5 text-[10px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:i(`Later`)}),(0,G.jsx)(zs,{remainingMs:y,expiredLabel:`Timed out · no answer`}),e.length>1&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[`1/`,e.length]})]})]}),(0,G.jsx)(`div`,{ref:o,"data-enso":`ask-question`,className:W(`mt-1.5 min-h-5 min-w-0 overflow-y-auto overscroll-contain text-xs leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,u&&`[mask-image:linear-gradient(to_bottom,#000_calc(100%_-_1.5rem),transparent)]`),children:_.question}),x&&x.length>0&&(0,G.jsx)(`div`,{"data-enso":`ask-options`,className:`mt-2 flex max-h-[30dvh] shrink-0 flex-col gap-1.5 overflow-y-auto overscroll-contain`,children:x.map((e,t)=>{let n=g_(t);return(0,G.jsxs)(`button`,{ref:e=>{s.current[t]=e},type:`button`,disabled:w,onClick:()=>T(e),className:`flex items-center gap-2 rounded-md border border-border/60 px-2 py-1 text-left text-xs text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus:border-ring focus:bg-muted focus:text-foreground disabled:opacity-50`,children:[n&&(0,G.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded bg-muted font-mono text-[10px] text-muted-foreground`,children:n}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e}),e===S&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-success/15 px-1.5 text-[10px] text-success`,children:i(`Recommended`)})]},e)})}),(0,G.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`input`,{ref:a,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&T(c)},disabled:w,placeholder:i(`Type an answer…`),className:`h-7 min-w-0 flex-1 rounded-md border bg-transparent px-2 text-xs outline-none focus:ring-1 focus:ring-ring disabled:opacity-50`}),(0,G.jsx)(`button`,{type:`button`,disabled:w||!c.trim(),onClick:()=>T(c),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Pn,{className:`h-3.5 w-3.5`})})]})]})]})}function b_({asks:e}){let{t}=K();return e.length===0?null:(0,G.jsx)(`div`,{"data-enso":`ask-settled`,className:`mb-1 space-y-1`,children:e.map(e=>{let n=e.answered;if(!n)return null;let r=n.by===`timeout`?t(`No answer in time`):n.by===`relay`?t(`{{name}} answered: {{answer}}`,{name:n.name??t(`Secretary`),answer:n.answer??``}):t(`Answered: {{answer}}`,{answer:n.answer??``});return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-dashed border-border/60 px-2.5 py-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(cn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.question}),(0,G.jsx)(`span`,{className:`shrink-0`,children:r})]},e.requestId)})})}var x_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function S_(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function C_(e){return`nodeType`in e}function w_(e){return e?S_(e)?e:C_(e)?e.ownerDocument?.defaultView??window:window:window}function T_(e){let{Document:t}=w_(e);return e instanceof t}function E_(e){return!S_(e)&&e instanceof w_(e).HTMLElement}function D_(e){return e instanceof w_(e).SVGElement}function O_(e){return e?S_(e)?e.document:C_(e)?T_(e)?e:E_(e)||D_(e)?e.ownerDocument:document:document:document}var k_=x_?H.useLayoutEffect:H.useEffect;function A_(e){let t=(0,H.useRef)(e);return k_(()=>{t.current=e}),(0,H.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function j_(e,t){t===void 0&&(t=[e]);let n=(0,H.useRef)(e);return k_(()=>{n.current!==e&&(n.current=e)},t),n}function M_(e){let t=A_(e),n=(0,H.useRef)(null);return[n,(0,H.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}var N_={};function Wee(e,t){return(0,H.useMemo)(()=>{if(t)return t;let n=N_[e]==null?0:N_[e]+1;return N_[e]=n,e+`-`+n},[e,t])}function Gee(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var P_=Gee(-1);function F_(e){return`clientX`in e&&`clientY`in e}function I_(e){if(!e)return!1;let{TouchEvent:t}=w_(e.target);return t&&e instanceof t}function L_(e){if(I_(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return F_(e)?{x:e.clientX,y:e.clientY}:null}var R_;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(R_||={});function z_(){}var B_=Object.freeze({x:0,y:0}),V_;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(V_||={});var H_=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function U_(e){let{EventTarget:t}=w_(e);return e instanceof t?e:O_(e)}function W_(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var G_;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(G_||={});function K_(e){e.preventDefault()}function q_(e){e.stopPropagation()}var J_;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(J_||={}),J_.Space,J_.Enter,J_.Esc,J_.Space,J_.Enter,J_.Tab;function Y_(e){return!!(e&&`distance`in e)}function X_(e){return!!(e&&`delay`in e)}var Z_=class{constructor(e,t,n){n===void 0&&(n=U_(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=O_(i),this.documentListeners=new H_(this.document),this.listeners=new H_(n),this.windowListeners=new H_(w_(i)),this.initialCoordinates=L_(r)??B_,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(G_.Resize,this.handleCancel),this.windowListeners.add(G_.DragStart,K_),this.windowListeners.add(G_.VisibilityChange,this.handleCancel),this.windowListeners.add(G_.ContextMenu,K_),this.documentListeners.add(G_.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(X_(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Y_(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(G_.Click,q_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(G_.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=L_(e)??B_,s=P_(n,o);if(!t&&a){if(Y_(a)){if(a.tolerance!=null&&W_(s,a.tolerance))return this.handleCancel();if(W_(s,a.distance))return this.handleStart()}if(X_(a)&&W_(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===J_.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Q_={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},$_=class extends Z_{constructor(e){let{event:t}=e,n=O_(t.target);super(e,Q_,n)}};$_.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var ev={move:{name:`mousemove`},end:{name:`mouseup`}},tv;(function(e){e[e.RightClick=2]=`RightClick`})(tv||={});var nv=class extends Z_{constructor(e){super(e,ev,O_(e.event.target))}};nv.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==tv.RightClick&&(r?.({event:n}),!0)}}];var rv={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},iv=class extends Z_{constructor(e){super(e,rv)}static setup(){return window.addEventListener(rv.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(rv.move.name,e)};function e(){}}};iv.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var av;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(av||={});var ov;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(ov||={}),V_.Backward,V_.Forward,V_.Backward,V_.Forward;var sv;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(sv||={});var cv;(function(e){e.Optimized=`optimized`})(cv||={});function lv(e){let{callback:t,disabled:n}=e,r=A_(t),i=(0,H.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,H.useEffect)(()=>()=>i?.disconnect(),[i]),i}sv.WhileDragging,cv.Optimized;var uv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:z_,draggableNodes:new Map,over:null,measureDroppableContainers:z_},dv=(0,H.createContext)(uv);({...B_});var fv;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(fv||={});var pv=`Droppable`,mv={timeout:25};function hv(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Wee(pv),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,H.useContext)(dv),u=(0,H.useRef)({disabled:n}),d=(0,H.useRef)(!1),f=(0,H.useRef)(null),p=(0,H.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...mv,...i},_=j_(h??r),v=lv({callback:(0,H.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=M_((0,H.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=j_(t);return(0,H.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,H.useEffect)(()=>(s({type:R_.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:R_.UnregisterDroppable,key:a,id:r})),[r]),(0,H.useEffect)(()=>{n!==u.current.disabled&&(s({type:R_.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}var gv=/["[\]\n]/g;function _v(e,t){return typeof e==`string`?e.replace(gv,` `).replace(/\s+/g,` `).trim().slice(0,t):``}function vv(e){return`[Selected UI element "${_v(e.label,80)}" — path: ${_v(e.path,300)}; text: ${_v(e.text,200)}]`}var yv=/^\[Selected UI element "([^"]*)" — path: (.*); text: (.*)\]$/;function bv(e){let t=yv.exec(e);return t?{label:t[1],path:t[2],text:t[3]}:null}function xv(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!e.id||!n.has(e.id))}var Sv=`pasted-text.txt`;function Cv(e){let t=e.replace(/\r\n?/g,`
166
+ `).trim();return t.length>=5e4&&t.length<=2e7?t:null}var wv=/@((?:\/|[A-Za-z]:\\)[^\n@]*?[\\/]pasted-text[\\/](?:bot-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\\/][0-9a-f]{8}[\\/]pasted-text\.txt)/g;function Tv(e){let t=[],n=0;for(let r of e.matchAll(wv))r.index>n&&t.push({type:`text`,text:e.slice(n,r.index)}),t.push({type:`file`,path:r[1]}),n=r.index+r[0].length;return(n<e.length||t.length===0)&&t.push({type:`text`,text:e.slice(n)}),t}var Ev=`(?<![A-Za-z0-9_])`,Dv=`(?![A-Za-z0-9_])`,Ov=(e,t,n)=>({kind:`API_KEY`,rule:e,re:RegExp(`${Ev}${t}${Dv}`,`g`),keep:n}),kv=/^\{\{[A-Z][A-Z_]*_[a-z2-7]{8}\}\}$/,Av=/^(?:\$\{.*\}|\$[A-Za-z_]\w*|<[^>]*>|%[\w]+%|process\.env\..*|null|nil|none|true|false|undefined|x{3,}|\*{3,}|changeme|password|secret|your[_-].*)$/i,jv=e=>e.length>=6&&!Av.test(e)&&!kv.test(e),Mv=([e=``])=>/pass|pwd|密码|口令/i.test(e)?`PASSWORD`:/token|令牌/i.test(e)?`TOKEN`:`SECRET`,Nv=[{kind:`PRIVATE_KEY`,rule:`pem`,re:/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,keep:0},Ov(`openai`,`sk-[A-Za-z0-9_-]{16,}`,/^sk-(?:ant-(?:api\d+-)?|proj-)?/),Ov(`stripe`,`[sr]k_(?:live|test)_[A-Za-z0-9]{10,}`,/^[sr]k_(?:live|test)_/),Ov(`github`,`gh[opusr]_[A-Za-z0-9]{20,}`,/^gh[opusr]_/),Ov(`github`,`github_pat_[A-Za-z0-9_]{20,}`,/^github_pat_/),Ov(`gitlab`,`glpat-[A-Za-z0-9_-]{20,}`,/^glpat-/),Ov(`google`,`AIza[0-9A-Za-z_-]{35}`,/^AIza/),Ov(`slack`,`xox[abprs]-[A-Za-z0-9-]{10,}`,/^xox[abprs]-/),Ov(`aws`,`(?:AKIA|ASIA)[0-9A-Z]{16}`,/^(?:AKIA|ASIA)/),Ov(`huggingface`,`hf_[A-Za-z0-9]{20,}`,/^hf_/),Ov(`groq`,`gsk_[A-Za-z0-9]{20,}`,/^gsk_/),Ov(`xai`,`xai-[A-Za-z0-9]{20,}`,/^xai-/),Ov(`npm`,`npm_[A-Za-z0-9]{36}`,/^npm_/),Ov(`pypi`,`pypi-[A-Za-z0-9_-]{50,}`,/^pypi-/),Ov(`digitalocean`,`do[opr]_v1_[a-f0-9]{64}`,/^do[opr]_v1_/),Ov(`sendgrid`,`SG\\.[A-Za-z0-9_-]{22}\\.[A-Za-z0-9_-]{43}`,/^SG\./),{kind:`TOKEN`,rule:`jwt`,re:/(?<![A-Za-z0-9_-])eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,keep:3},{kind:`TOKEN`,rule:`bearer`,re:/\bBearer\s+([A-Za-z0-9._~+/=-]{16,})/dg,group:1,keep:0},{kind:`PASSWORD`,rule:`url`,re:/:(?<=\b[a-z][a-z0-9+.-]*:)\/\/[^\s/:@]+:([^\s/@]+)@/dgi,group:1,keep:0,validate:e=>!Av.test(e)&&!kv.test(e)},{kind:Mv,rule:`kv`,re:/\b(?<!(?:^|[^A-Za-z0-9_])(?:[A-Za-z0-9]+[_-])+?)(?:[A-Za-z0-9]+[_-])*(api[_-]?key|secret(?:[_-]?key)?|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|passwd|password|pwd|client[_-]?secret|private[_-]?key)["']?\s*[:=]\s*(?:"((?:\\.|[^"\\\n])*)"|'((?:\\.|[^'\\\n])*)'|([^\s"',;{}[\]]+))/dgi,group:-1,keep:0,validate:jv},{kind:Mv,rule:`cjk`,re:/(密码|口令|密钥|秘钥|令牌)\s*(?:[::=]|为|是)\s*([^\s,。、,;;"'“”‘’]{6,})/dg,group:2,keep:0,validate:jv}],Pv=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];function Fv(e){let t=Number(e.slice(10,12)),n=Number(e.slice(12,14));return t<1||t>12||n<1||n>31?!1:`10X98765432`[Pv.reduce((t,n,r)=>t+n*Number(e[r]),0)%11]===e[17].toUpperCase()}function Iv(e){let t=0;for(let n=0;n<e.length;n++){let r=Number(e[e.length-1-n]);n%2==1&&(r*=2,r>9&&(r-=9)),t+=r}return t%10==0}var Lv=/(?:^|\.)(?:example\.(?:com|org|net)|example|test|invalid|local|localhost)$/i,Rv={email:{kind:`EMAIL`,rule:`email`,re:/(?<![\w.%+-])[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}(?![\w-])/g,keep:0,validate:e=>!/no-?reply/i.test(e)&&!Lv.test(e.slice(e.indexOf(`@`)+1))},phone:{kind:`PHONE`,rule:`cn-mobile`,re:/(?<![\d+])(?:\+?86[- ]?)?1[3-9]\d{9}(?!\d)/g,keep:0},idCard:{kind:`ID_CARD`,rule:`cn-id`,re:/(?<![\dA-Za-z])\d{17}[\dXx](?![\dA-Za-z])/g,keep:0,validate:Fv},bankCard:{kind:`BANK_CARD`,rule:`luhn`,re:/(?<![\d-])\d(?:[ -]?\d){14,18}(?!\d)/g,keep:0,validate:e=>{let t=e.replace(/[ -]/g,``);return!/^(\d)\1+$/.test(t)&&Iv(t)}},ip:{kind:`IP`,rule:`ipv4`,re:/(?<![\d.])(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)(?![\d.])/g,keep:0,validate:e=>!/^(?:127\.|0\.0\.0\.0$|255\.255\.255\.255$)/.test(e)}},zv=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Bv=e=>`${/^\w/.test(e)?Ev:``}${zv(e)}${/\w$/.test(e)?Dv:``}`;function Vv(e,t){let n=e.map(e=>({kind:`CUSTOM`,rule:`word`,re:new RegExp(Bv(e),`gi`),keep:0}));for(let e of t){let t=/^\/(.+)\/([a-z]*)$/s.exec(e);try{n.push(t?{kind:`CUSTOM`,rule:`regex`,re:new RegExp(t[1],`${t[2].replace(/[gyd]/g,``)}g`),keep:0}:{kind:`CUSTOM`,rule:`prefix`,re:RegExp(`${/^\w/.test(e)?Ev:``}${zv(e)}[A-Za-z0-9._-]+`,`g`),keep:e.length})}catch{}}return n}function Hv(e){let t=[];if(e.enabled){if(e.secrets.enabled)for(let n of Nv)t.push({...n,action:e.secrets.action,category:`secret`});if(e.personal.enabled)for(let n of e.personal.kinds)t.push({...Rv[n],action:e.personal.action,category:`personal`});for(let n of Vv(e.custom.words,e.custom.rules))t.push({...n,action:e.custom.action,category:`custom`})}return{active:t.length>0,rules:t,allow:new Set(e.allow.map(e=>e.toLowerCase()))}}var Uv=/\{\{[A-Z][A-Z_]*_[a-z2-7]{8}\}\}/g;function Wv(e,t){let n=t.indices;if(!e.group)return[t.index,t.index+t[0].length];if(n){if(e.group>0)return n[e.group];for(let e=2;e<n.length;e++)if(n[e])return n[e]}}function Gv(e,t){if(!t.active||!e)return[];let n=[];for(let t of e.matchAll(Uv))n.push([t.index,t.index+t[0].length]);let r=[];for(let i of t.rules){i.re.lastIndex=0;for(let a=i.re.exec(e);a;a=i.re.exec(e)){if(a[0].length===0){i.re.lastIndex++;continue}let o=Wv(i,a);if(!o||o[1]<=o[0])continue;let[s,c]=o,l=e.slice(s,c);if(i.validate&&!i.validate(l)||t.allow.has(l.toLowerCase())||n.some(([e,t])=>s<t&&c>e))continue;let u=typeof i.keep==`number`?i.keep:i.keep?.exec(l)?.[0].length??0;r.push({start:s,end:c,kind:typeof i.kind==`string`?i.kind:i.kind([a[1]??``]),rule:i.rule,action:i.action,category:i.category,keep:Math.min(u,l.length)})}}r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[];for(let e of r)(!i.length||e.start>=i[i.length-1].end)&&i.push(e);return i}function Kv(e,t){let n=Gv(e,Hv(t));return{masked:n.filter(e=>e.action===`mask`).length,blocked:[...new Set(n.filter(e=>e.action===`block`).map(e=>e.kind))]}}var qv={"/goal":[{name:`pause`,aliases:[],description:`Pause the current session goal`},{name:`resume`,aliases:[],description:`Resume a paused session goal`},{name:`clear`,aliases:[],description:`Clear the session goal`}]};function Jv(e,t){if(!e)return null;let n=t.trimStart();return n?n.search(/\s/)>=0?null:n:``}function Yv(e,t){if(!e)return[];let n=qv[e]??[],r=t.trim().toLowerCase();return r?n.filter(e=>e.name.toLowerCase().startsWith(r)||e.aliases.some(e=>e.toLowerCase().startsWith(r))):n}var Xv=H.createContext(void 0);function Zv(e){let t=H.useContext(Xv);if(!e&&t===void 0)throw Error(xr(27));return t}var Qv=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),$v={"data-starting-style":``},ey={"data-ending-style":``},ty={transitionStatus(e){return e===`starting`?$v:e===`ending`?ey:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Qv.startingStyle]=`startingStyle`,e[e.endingStyle=Qv.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var ny={"data-popup-open":``},ry={"data-popup-open":``,"data-pressed":``},iy={"data-open":``},ay={"data-closed":``},oy={"data-anchor-hidden":``},sy={open(e){return e?ny:null}},cy={open(e){return e?ry:null}},ly={open(e){return e?iy:ay},anchorHidden(e){return e?oy:null}},uy={...ly,...ty},dy=H.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Zv(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return zr(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:uy,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});function fy(){return typeof window<`u`}function py(e){return gy(e)?(e.nodeName||``).toLowerCase():`#document`}function my(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hy(e){return((gy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function gy(e){return fy()?e instanceof Node||e instanceof my(e).Node:!1}function _y(e){return fy()?e instanceof Element||e instanceof my(e).Element:!1}function vy(e){return fy()?e instanceof HTMLElement||e instanceof my(e).HTMLElement:!1}function yy(e){return!fy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof my(e).ShadowRoot}function by(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=jy(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xy(e){return/^(table|td|th)$/.test(py(e))}function Sy(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Cy=/transform|translate|scale|rotate|perspective|filter/,wy=/paint|layout|strict|content/,Ty=e=>!!e&&e!==`none`,Ey;function Dy(e){let t=_y(e)?jy(e):e;return Ty(t.transform)||Ty(t.translate)||Ty(t.scale)||Ty(t.rotate)||Ty(t.perspective)||!ky()&&(Ty(t.backdropFilter)||Ty(t.filter))||Cy.test(t.willChange||``)||wy.test(t.contain||``)}function Oy(e){let t=Ny(e);for(;vy(t)&&!Ay(t);){if(Dy(t))return t;if(Sy(t))return null;t=Ny(t)}return null}function ky(){return Ey??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ey}function Ay(e){return/^(html|body|#document)$/.test(py(e))}function jy(e){return my(e).getComputedStyle(e)}function My(e){return _y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ny(e){if(py(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yy(e)&&e.host||hy(e);return yy(t)?t.host:t}function Py(e){let t=Ny(e);return Ay(t)?(e.ownerDocument||e).body:vy(t)&&by(t)?t:Py(t)}function Fy(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Py(e),i=r===e.ownerDocument?.body,a=my(r);if(i){let e=Iy(a);return t.concat(a,a.visualViewport||[],by(r)?r:[],e&&n?Fy(e):[])}return t.concat(r,Fy(r,[],n))}function Iy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ly={...H},Ry=Ly.useInsertionEffect,Kee=Ry&&Ry!==Ly.useLayoutEffect?Ry:e=>e();function zy(e){let t=Cr(qee).current;return t.next=e,Kee(t.effect),t.trampoline}function qee(){let e={next:void 0,callback:Jee,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Jee(){}var Y=typeof document<`u`?H.useLayoutEffect:()=>{},Yee=H.createContext(void 0);function By(e=!1){let t=H.useContext(Yee);if(t===void 0&&!e)throw Error(xr(16));return t}function Xee(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:H.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Vy(e){return e?.ownerDocument||document}function Hy(e,t,{detail:n=0}={}){e.dispatchEvent(new(my(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Uy(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=H.useRef(null),s=By(!0),c=a??s!==void 0,{props:l}=Xee({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=H.useCallback(()=>{let e=o.current;Wy(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:H.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return or({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(_r(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Wy(r),s=!i&&Zee(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Hy(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Hy(r,e)))},onKeyUp(e){if(!t){if(_r(e),a?.(e),e.target===e.currentTarget&&i&&c&&Wy(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Hy(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:zy(e=>{o.current=e,u()})}}function Wy(e){return vy(e)&&e.tagName===`BUTTON`}function Zee(e){return vy(e)&&e.tagName===`A`&&!!e.href}var Gy=`none`,Ky=`trigger-press`,qy=`trigger-hover`,Jy=`trigger-focus`,Qee=`outside-press`,Yy=`item-press`,$ee=`close-press`,Xy=`focus-out`,ete=`escape-key`,Zy=`list-navigation`,Qy=`cancel-open`,$y=`sibling-open`,eb=`imperative-action`,tte=`window-resize`;function tb(e,t,n,r){let i=!1,a=!1,o=r??Fr;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var nb=H.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Zv(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Uy({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,tb($ee,e.nativeEvent))}return zr(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),rb=0;function nte(e,t=`mui`){let[n,r]=H.useState(e),i=e||n;return H.useEffect(()=>{n??(rb+=1,r(`${t}-${rb}`))},[n,t]),i}var ib=Ly.useId;function ab(e,t){if(ib!==void 0){let n=ib();return e??(t?`${t}-${n}`:n)}return nte(e,t)}function ob(e){return ab(e,`base-ui`)}var sb=H.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Zv(),c=ob(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),zr(`p`,e,{ref:t,props:[{id:c},o]})});function cb(e){H.useEffect(e,Pr)}var lb=0,ub=class e{static create(){return new e}currentId=lb;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=lb,t()},e)}isStarted(){return this.currentId!==lb}clear=()=>{this.currentId!==lb&&(clearTimeout(this.currentId),this.currentId=lb)};disposeEffect=()=>this.clear};function db(){let e=Cr(ub.create).current;return cb(e.disposeEffect),e}function fb(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:pb,platform:mb,maxTouchPoints:hb}=fb(),gb=pb.toLowerCase(),_b=mb.toLowerCase(),vb=/^i(os$|p)/.test(_b)||_b===`macintel`&&hb>1,yb=`android`,bb=_b===yb||gb.includes(yb),xb=!vb&&_b.startsWith(`mac`);_b.startsWith(`win`),!bb&&/^(linux|chrome os)/.test(_b);var Sb=xb||vb,Cb=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Cb&&gb.includes(`firefox`),!Cb&&gb.includes(`chrom`);var wb=Sb,Tb=/jsdom|happydom/.test(gb);function Eb(e){e.preventDefault(),e.stopPropagation()}function Db(e){return`nativeEvent`in e}function Ob(e){return e.pointerType===``&&e.isTrusted?!0:bb&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function kb(e){return Tb?!1:!bb&&e.width===0&&e.height===0||bb&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ab(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function jb(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Mb=`data-base-ui-focusable`,Nb=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Pb=`ArrowLeft`,Fb=`ArrowRight`,Ib=`ArrowUp`,Lb=`ArrowDown`;function Rb(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function zb(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&yy(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Bb(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Vb(e,t){if(!_y(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(zb(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Hb(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ub(e){return e.matches(`html,body`)}function Wb(e){return vy(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Gb(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Nb}`)!=null}function Kb(e){return e?e.getAttribute(`role`)===`combobox`&&Wb(e):!1}function qb(e){if(!e||Tb)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Jb(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Yb(e,t){return t!=null&&!Ab(t)?0:typeof e==`function`?e():e}function Xb(e,t,n){let r=Yb(e,n);return typeof r==`number`?r:r?.[t]}function Zb(e){return typeof e==`function`?e():e}function Qb(e,t){return t||e===`click`||e===`mousedown`}function $b(e){return e?.includes(`mouse`)&&e!==`mousedown`}function ex(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function tx(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function nx(e){let t=Cr(rx,e).current;return t.next=e,Y(t.effect),t}function rx(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ix=null;globalThis.requestAnimationFrame;var ax=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ox=class e{static create(){return new e}static request(e){return ax.request(e)}static cancel(e){return ax.cancel(e)}currentId=ix;request(e){this.cancel(),this.currentId=ax.request(()=>{this.currentId=ix,e()})}cancel=()=>{this.currentId!==ix&&(ax.cancel(this.currentId),this.currentId=ix)};disposeEffect=()=>this.cancel};function sx(){let e=Cr(ox.create).current;return cb(e.disposeEffect),e}var cx={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},lx={...cx,position:`fixed`,top:0,left:0},ux={...cx,position:`absolute`},dx=H.forwardRef(function(e,t){let[n,r]=H.useState();Y(()=>{wb&&Cb&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:lx,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),fx=Math.min,px=Math.max,mx=Math.round,hx=Math.floor,gx=e=>({x:e,y:e}),_x={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vx(e,t,n){return px(e,fx(t,n))}function yx(e,t){return typeof e==`function`?e(t):e}function bx(e){return e.split(`-`)[0]}function xx(e){return e.split(`-`)[1]}function Sx(e){return e===`x`?`y`:`x`}function Cx(e){return e===`y`?`height`:`width`}function wx(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Tx(e){return Sx(wx(e))}function Ex(e,t,n){n===void 0&&(n=!1);let r=xx(e),i=Tx(e),a=Cx(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fx(o)),[o,Fx(o)]}function Dx(e){let t=Fx(e);return[Ox(e),t,Ox(t)]}function Ox(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var kx=[`left`,`right`],Ax=[`right`,`left`],jx=[`top`,`bottom`],Mx=[`bottom`,`top`];function Nx(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ax:kx:t?kx:Ax;case`left`:case`right`:return t?jx:Mx;default:return[]}}function Px(e,t,n,r){let i=xx(e),a=Nx(bx(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ox)))),a}function Fx(e){let t=bx(e);return _x[t]+e.slice(t.length)}function Ix(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Lx(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ix(e)}function Rx(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zx(e,t){return t<0||t>=e.length}function Bx(e,t){return Hx(e.current,{disabledIndices:t})}function Vx(e,t){return Hx(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Hx(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ux(e,a,r));return a}function Ux(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Gx(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Wx(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Gx(e,t=e?jy(e):null){return!e||!e.isConnected||!t||Wx(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Kx=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function qx(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return yy(n)?n.host:null}function Jx(e){for(let t of Array.from(e.children))if(py(t)===`summary`)return t;return null}function Yx(e,t){let n=Jx(t);return!!n&&(e===n||zb(n,e))}function Xx(e){let t=e?py(e):``;return e!=null&&e.matches(Kx)&&(t!==`summary`||e.parentElement!=null&&py(e.parentElement)===`details`&&Jx(e.parentElement)===e)&&(t!==`details`||Jx(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Zx(e){if(!Xx(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=qx(t)){let n=t!==e,r=py(t)===`slot`;if(t.hasAttribute(`inert`)||n&&py(t)===`details`&&!t.open&&!Yx(e,t)||t.hasAttribute(`hidden`)||!r&&!Qx(t,n))return!1}return!0}function Qx(e,t){let n=jy(e);return t?n.display!==`none`:Gx(e,n)}function $x(e){let t=e.tabIndex;if(t<0){let t=py(e);if(t===`details`||t===`audio`||t===`video`||vy(e)&&e.isContentEditable)return 0}return t}function eS(e){if(py(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function tS(e,t){let n=eS(e);if(!n)return!0;let r=t.find(e=>{let t=eS(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=eS(e);return t?.name===n.name&&t.form===n.form})===n}function nS(e){if(vy(e)&&py(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return vy(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function rS(e,t){nS(e).forEach(e=>{Xx(e)&&t.push(e),rS(e,t)})}function iS(e,t,n){nS(e).forEach(e=>{vy(e)&&e.matches(t)&&n.push(e),iS(e,t,n)})}function aS(e){return Zx(e)&&$x(e)>=0}function oS(e){let t=[];return rS(e,t),t.filter(Zx)}function sS(e){let t=oS(e);return t.filter(e=>$x(e)>=0&&tS(e,t))}function cS(e,t){let n=sS(e),r=n.length;if(r===0)return;let i=Rb(Vy(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function lS(e){return cS(Vy(e).body,1)||e}function uS(e){return cS(Vy(e).body,-1)||e}function dS(e,t){if(!e)return null;let n=sS(Vy(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function fS(e){return dS(e,1)}function pS(e){return dS(e,-1)}function mS(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!zb(n,r)}function hS(e){sS(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function gS(e){let t=[];iS(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function _S(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],..._S(e,t.id,n)])}function vS(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function yS(e){return`data-base-ui-${e}`}var bS=0;function xS(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(bS);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Nr;let o=requestAnimationFrame(a);return bS=o,()=>{bS===o&&(cancelAnimationFrame(o),bS=0)}}var SS={inert:new WeakMap,"aria-hidden":new WeakMap},CS=`data-base-ui-inert`,wS={inert:new WeakSet,"aria-hidden":new WeakSet},TS=new WeakMap,ES=0;function DS(e){return wS[e]}function OS(e){return e?yy(e)?e.host:OS(e.parentNode):null}var kS=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=OS(t);return e.contains(n)?n:null}).filter(e=>e!=null),AS=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},jS=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{py(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function MS(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=kS(t,e),l=i?jS(t,AS(c),new Set(c)):[],u=[],d=[];if(a){let e=SS[a],n=DS(a);s=n,o=e;let r=kS(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);jS(t,AS(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(TS.get(e)||0)+1;TS.set(e,t),d.push(e),t===1&&e.setAttribute(CS,``)}),ES+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(TS.get(e)||0)-1;TS.set(e,t),t||e.removeAttribute(CS)}),--ES,ES||(SS.inert=new WeakMap,SS[`aria-hidden`]=new WeakMap,wS.inert=new WeakSet,wS[`aria-hidden`]=new WeakSet,TS=new WeakMap)}}function NS(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Vy(e[0]).body;return MS(e,a,n,r,{mark:i})}var PS={style:{transition:`none`}},FS=`data-base-ui-click-trigger`,IS={fallbackAxisSide:`none`},LS={fallbackAxisSide:`end`},RS={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zS=H.createContext(null),BS=()=>H.useContext(zS),VS=yS(`portal`);function HS(e={}){let{ref:t,container:n,componentProps:r=Fr,elementProps:i}=e,a=ab(),o=BS()?.portalNode,[s,c]=H.useState(null),[l,u]=H.useState(null),d=zy(e=>{e!==null&&u(e)}),f=H.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(gy(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=zr(`div`,r,{ref:[t,d],props:[{id:a,[VS]:``},i]}),m=s&&p?qs.createPortal(p,s):null;return{node:l,nodeId:H.isValidElement(p)?p.props.id:void 0,subtree:m}}var US=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=HS({container:o,ref:t,componentProps:e,elementProps:s}),d=H.useRef(null),f=H.useRef(null),p=H.useRef(null),m=H.useRef(null),[h,g]=H.useState(null),_=H.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;H.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&mS(e)&&(e.type===`focusin`?_.current&&=(gS(c),!1):(hS(c),_.current=!0))}return tx(ex(c,`focusin`,e,!0),ex(c,`focusout`,e,!0))},[c,v]),Y(()=>{!c||y!==!0||!_.current||(gS(c),_.current=!1)},[y,c]);let x=H.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,G.jsxs)(H.Fragment,{children:[u,(0,G.jsxs)(zS.Provider,{value:x,children:[b&&c&&(0,G.jsx)(dx,{"data-type":`outside`,ref:d,onFocus:e=>{mS(e,c)?p.current?.focus():uS(h?h.domReference:null)?.focus()}}),b&&c&&(0,G.jsx)(`span`,{"aria-owns":l,style:RS}),c&&qs.createPortal(a,c),b&&c&&(0,G.jsx)(dx,{"data-type":`outside`,ref:f,onFocus:e=>{mS(e,c)?m.current?.focus():(lS(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,tb(`focus-out`,e.nativeEvent)))}})]})]})});function WS(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var GS=class{nodesRef={current:[]};events=WS();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},KS=H.createContext(null),qS=H.createContext(null),JS=()=>H.useContext(KS)?.id||null,YS=e=>{let t=H.useContext(qS);return e??t};function XS(e){let t=ab(),n=YS(e),r=JS();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ZS(e){let{children:t,id:n}=e,r=JS();return(0,G.jsx)(KS.Provider,{value:H.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function QS(e){let{children:t,externalTree:n}=e,r=Cr(()=>n??new GS).current;return(0,G.jsx)(qS.Provider,{value:r,children:t})}function $S(e){return e==null?e:`current`in e?e.current:e}function eC(e,t){let n=my(Bb(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var tC=20,nC=[];function rC(){nC=nC.filter(e=>e.deref()?.isConnected)}function iC(e){rC(),e&&py(e)!==`body`&&(nC.push(new WeakRef(e)),nC.length>tC&&(nC=nC.slice(-20)))}function aC(){return rC(),nC[nC.length-1]?.deref()}function oC(e){return e?aS(e)?e:sS(e)[0]||e:null}function sC(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=oS(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return aS(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function cC(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=zy(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Kb(_)&&S,w=nx(i),T=nx(a),E=nx(l),D=nx(g),O=YS(p),k=BS(),A=H.useRef(!1),j=H.useRef(!1),M=H.useRef(!1),N=H.useRef(null),P=H.useRef(``),F=H.useRef(``),I=H.useRef(null),ee=H.useRef(null),L=wr(I,f,k?.beforeInsideRef),te=wr(ee,k?.afterInsideRef),R=db(),z=db(),ne=sx(),re=k!=null,B=Jb(v),ie=zy((e=B)=>e?sS(e):[]),ae=zy(()=>m?.().filter(e=>e!=null)??[]);H.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&zb(B,Rb(Vy(B)))&&ie().length===0&&!C&&Eb(e)}return ex(Vy(B),`keydown`,e)},[r,B,s,C,ie]),H.useEffect(()=>{if(r||!g)return;let e=Vy(B);function t(){M.current=!1}function n(e){let t=Bb(e),n=ae(),r=zb(v,t)||zb(_,t)||zb(k?.portalNode,t)||n.some(e=>e===t||zb(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,z.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return tx(ex(e,`pointerdown`,n,!0),ex(e,`pointerup`,t,!0),ex(e,`pointercancel`,t,!0),ex(e,`keydown`,i,!0),t)},[r,v,_,B,g,k,z,ae]),H.useEffect(()=>{if(r||!c)return;let e=Vy(B);function t(){j.current=!0,z.start(0,()=>{j.current=!1})}function n(e){let t=Bb(e);aS(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Bb(t);s&&n==null&&i!=null&&zb(v,i)&&iC(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ae(),f=n?.hasAttribute(yS(`focus-guard`))&&[I.current,ee.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,$S(d),$S(u)].includes(n),p=!(zb(_,n)||zb(v,n)||zb(n,v)||zb(k?.portalNode,n)||l.some(e=>e===n||zb(e,n))||c.hasMatchingElement(e=>zb(e,n))||f||O&&(_S(O.nodesRef.current,a).find(e=>zb(e.context?.elements.floating,n)||zb(e.context?.elements.domReference,n))||vS(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Jb(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&B&&sC(B),o&&r!==_&&!Gx(i)&&Rb(e)===e.body){if(vy(B)&&(B.focus(),o===`popup`)){ne.request(()=>{B.focus()});return}let e=ie(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;vy(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==aC())&&(A.current=!0,h.setOpen(!1,tb(Xy,t)))})}function a(){M.current||(b.current.insideReactTree=!0,R.start(0,()=>{b.current.insideReactTree=!1}))}let l=vy(_)?_:null;if(!(!v&&!l))return tx(l&&ex(l,`focusout`,i),l&&ex(l,`pointerdown`,t),v&&ex(v,`focusin`,n),v&&ex(v,`focusout`,i),v&&k&&ex(v,`focusout`,a,!0))},[r,_,v,B,s,O,k,h,c,o,ie,C,x,b,R,z,ne,u,d,ae]),H.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${yS(`portal`)}]`)||[]),t=(O?vS(O.nodesRef.current,x()):[]).find(e=>Kb(e.context?.elements.domReference||null))?.context?.elements.domReference,n=NS([v,...e,I.current,ee.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...ae(),t,$S(d),$S(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=NS([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,ae]),Y(()=>{if(!g||r||!vy(B))return;P.current=``,F.current=``;let e=Vy(B),t=Rb(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||zb(B,t))return;let i=null,a=()=>(i??=ie(B),i[0]||B),o;o=r===!0||r===null?a():$S(r),o||=a();let s=zb(B,Rb(e));xS(o,{preventScroll:o===B,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=Rb(e);return!(t!==o&&zb(B,t))}})})},[r,g,B,ie,w,E,D]),Y(()=>{if(r||!B)return;let e=Vy(B),t=Rb(e),n=E.current==null;iC(t);function i(e){if(e.open||(P.current=eC(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(Ob(e.nativeEvent)||kb(e.nativeEvent))A.current=!1;else{let e=!1;Vy(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&py(t)!==`body`?t:null,s=n?o||a:a||o;return s||=aC()||null,typeof i==`boolean`?s:$S(i)||s||null}return()=>{y.off(`openchange`,i);let t=Rb(e),n=ae(),r=zb(v,t)||n.some(e=>e===t||zb(e,t))||O&&_S(O.nodesRef.current,x(),!1).some(e=>zb(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=oC(c),i=typeof o!=`boolean`;if(o&&!A.current&&vy(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,B,T,E,y,O,_,x,ae]),Y(()=>{if(!Cb||g||!v)return;let e=Rb(Vy(v));!vy(e)||!Wb(e)||zb(v,e)&&e.blur()},[g,v]),Y(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Y(()=>{if(!(r||!B))return sC(B),()=>{queueMicrotask(rC)}},[r,B]);let oe=!r&&(!s||!C)&&(re||s);return(0,G.jsxs)(H.Fragment,{children:[oe&&(0,G.jsx)(dx,{"data-type":`inside`,ref:L,onFocus:e=>{if(s){let e=ie();xS(e[e.length-1])}else k?.portalNode&&(A.current=!1,mS(e,k.portalNode)?lS(_)?.focus():$S(d??k.beforeOutsideRef)?.focus())}}),n,oe&&(0,G.jsx)(dx,{"data-type":`inside`,ref:te,onFocus:e=>{s?xS(ie()[0]):k?.portalNode&&(c&&(A.current=!0),mS(e,k.portalNode)?uS(_)?.focus():$S(u??k.afterOutsideRef)?.focus())}})]})}function lC(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ky}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=H.useRef(void 0),f=sx(),p=db(),m=H.useMemo(()=>{function e(e,t,n,r){let i=tb(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=Ab(e.pointerType,!0)&&kb(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Ab(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Bb(o);if(Wb(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Ab(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return H.useMemo(()=>n?{reference:m}:Fr,[n,m])}function uC(){return!1}function dC(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function fC(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=uC,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=YS(c),m=zy(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=zy(()=>a),{escapeKey:v,outsidePress:y}=dC(s),b=H.useRef(!1),x=H.useRef(!1),S=H.useRef(!1),C=H.useRef(!1),w=H.useRef(``),T=H.useRef(null),E=db(),D=db(),O=zy(()=>{D.clear(),f.current.insideReactTree=!1}),k=zy(e=>{let t=f.current.floatingContext?.nodeId;return(p?_S(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=zy(e=>Hb(e,l.select(`floatingElement`))||Hb(e,l.select(`domReferenceElement`))),j=zy(e=>{o()&&l.setOpen(!1,tb(Ky,e.nativeEvent))}),M=zy(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=tb(ete,Db(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),N=zy(()=>{f.current.insideReactTree=!0,D.start(0,O)}),P=zy(e=>{if(!u||!n||e.button!==0)return;let t=Bb(e.nativeEvent);zb(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),F=zy(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});H.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new ub,t=new ub;function i(){e.clear(),C.current=!0}function a(){e.start(Cb?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&_S(p.nodesRef.current,t).some(t=>Hb(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=Bb(e),r=`[${yS(`inert`)}]`,i=_y(n)?n.getRootNode():null,a=Array.from((yy(i)?i:Vy(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>zb(e,n))))return;let s=_y(n)?n:null;for(;s&&!Ay(s);){let e=Ny(s);if(Ay(e)||!_y(e))break;s=e}if(!(a.length&&_y(n)&&!Ub(n)&&!zb(n,l.select(`floatingElement`))&&a.every(e=>!zb(s,e)))){if(vy(n)&&!(`touches`in e)){let t=Ay(n),r=jy(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,tb(Qee,e)),O())}}}function N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Bb(e);if(!n)return;let r=ex(n,e.type,()=>{t(e),r()})}function I(e){w.current=`touch`,F(e,P)}function ee(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?N(e):j(e)})}function L(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function te(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function R(e){F(e,te)}function z(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function ne(e){F(e,z)}let re=Vy(d),B=tx(r&&tx(ex(re,`keydown`,M),ex(re,`compositionstart`,i),ex(re,`compositionend`,a)),g&&tx(ex(re,`click`,ee,!0),ex(re,`pointerdown`,ee,!0),ex(re,`pointerup`,L,!0),ex(re,`pointercancel`,L,!0),ex(re,`mousedown`,ee,!0),ex(re,`mouseup`,L,!0),ex(re,`touchstart`,I,!0),ex(re,`touchmove`,R,!0),ex(re,`touchend`,ne,!0)));return()=>{B(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]);let I=H.useMemo(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),ee=H.useMemo(()=>({onKeyDown:M,onPointerDown:F,onMouseDown:F,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,P,F]);return H.useMemo(()=>n?{reference:I,floating:ee,trigger:I}:{},[n,I,ee])}function pC(e,t,n){let{reference:r,floating:i}=e,a=wx(t),o=Tx(t),s=Cx(o),c=bx(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=xx(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function mC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=yx(t,e),p=Lx(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Rx(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Rx(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var hC=50,gC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pC(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<hC&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=pC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_C=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=yx(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bx(r),_=wx(o),v=bx(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fx(o)]:Dx(o)),x=p!==`none`;!d&&x&&b.push(...Px(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ex(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===wx(t)||T.every(e=>wx(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=wx(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},vC=new Set([`left`,`top`]);async function yC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=bx(n),s=xx(n),c=wx(n)===`y`,l=vC.has(o)?-1:1,u=a&&c?-1:1,d=yx(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var bC=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await yC(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},xC=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=yx(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wx(i),p=Sx(f),m=u[p],h=u[f],g=(e,t)=>vx(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},SC=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=yx(e,t),u={x:n,y:r},d=wx(i),f=Sx(d),p=u[f],m=u[d],h=yx(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=vC.has(bx(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},CC=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=yx(e,t),c=await i.detectOverflow(t,s),l=bx(n),u=xx(n),d=wx(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=fx(p-c[m],g),y=fx(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*px(c.left,c.right):S=p-2*px(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function wC(e){let t=jy(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=vy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mx(n)!==a||mx(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function TC(e){return _y(e)?e:e.contextElement}function EC(e){let t=TC(e);if(!vy(t))return gx(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wC(t),o=(a?mx(n.width):n.width)/r,s=(a?mx(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var DC=gx(0);function OC(e){let t=my(e);return!ky()||!t.visualViewport?DC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kC(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===my(e)}function AC(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=TC(e),o=gx(1);t&&(r?_y(r)&&(o=EC(r)):o=EC(e));let s=kC(a,n,r)?OC(a):gx(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=my(a),t=_y(r)?my(r):r,n=e,i=Iy(n);for(;i&&t!==n;){let e=EC(i),t=i.getBoundingClientRect(),r=jy(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=my(i),i=Iy(n)}}return Rx({width:u,height:d,x:c,y:l})}function jC(e,t){let n=My(e).scrollLeft;return t?t.left+n:AC(hy(e)).left+n}function MC(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jC(e,n),y:n.top+t.scrollTop}}function NC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=hy(r),s=t?Sy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gx(1),u=gx(0),d=vy(r);if((d||!a)&&((py(r)!==`body`||by(o))&&(c=My(r)),d)){let e=AC(r);l=EC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?MC(o,c):gx(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function PC(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function FC(e){let t=My(e),n=e.ownerDocument.body,r=px(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=px(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jC(e),o=-t.scrollTop;return jy(n).direction===`rtl`&&(a+=px(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var IC=25;function LC(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=my(e),a=hy(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ky()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jC(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=IC&&(s-=o)}return{width:s,height:c,x:l,y:u}}function RC(e,t){let n=AC(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=EC(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zC(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=LC(e,n,t);else if(t===`document`)r=FC(hy(e));else if(_y(t))r=RC(t,n);else{let n=OC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rx(r)}function BC(e,t){let n=t.get(e);if(n)return n;let r=Fy(e,[],!1).filter(e=>_y(e)&&py(e)!==`body`),i=null,a=jy(e).position===`fixed`,o=a?Ny(e):e;for(;_y(o)&&!Ay(o);){let e=jy(o),t=Dy(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ny(o)}return t.set(e,r),r}function VC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Sy(t)?[]:BC(t,this._c):[].concat(n),r],o=zC(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zC(t,a[e],i);s=px(n.top,s),c=fx(n.right,c),l=fx(n.bottom,l),u=px(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function HC(e){let{width:t,height:n}=wC(e);return{width:t,height:n}}function UC(e,t,n){let r=vy(t),i=hy(t),a=n===`fixed`,o=AC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gx(0);if((r||!a)&&((py(t)!==`body`||by(i))&&(s=My(t)),r)){let e=AC(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jC(i));let l=i&&!r&&!a?MC(i,s):gx(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function WC(e){return jy(e).position===`static`}function GC(e,t){if(!vy(e)||jy(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return hy(e)===n&&(n=n.ownerDocument.body),n}function KC(e,t){let n=my(e);if(Sy(e))return n;if(!vy(e)){let t=Ny(e);for(;t&&!Ay(t);){if(_y(t)&&!WC(t))return t;t=Ny(t)}return n}let r=GC(e,t);for(;r&&xy(r)&&WC(r);)r=GC(r,t);return r&&Ay(r)&&WC(r)&&!Dy(r)?n:r||Oy(e)||n}var qC=async function(e){let t=this.getOffsetParent||KC,n=this.getDimensions,r=await n(e.floating);return{reference:UC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JC(e){return jy(e).direction===`rtl`}var YC={convertOffsetParentRelativeRectToViewportRelativeRect:NC,getDocumentElement:hy,getClippingRect:VC,getOffsetParent:KC,getElementRects:qC,getClientRects:PC,getDimensions:HC,getScale:EC,isElement:_y,isRTL:JC};function XC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ZC(e,t,n){let r=null,i,a=hy(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=hx(d),h=hx(a.clientWidth-(u+f)),g=hx(a.clientHeight-(d+p)),_=hx(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:px(0,fx(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!XC(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=my(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function QC(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=TC(e),u=i||a?[...l?Fy(l):[],...t?Fy(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ZC(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?AC(e):null;c&&g();function g(){let t=AC(e);h&&!XC(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $C=bC,ew=xC,tw=_C,nw=CC,rw=SC,iw=(e,t,n)=>{let r=new Map,i=n??{},a={...YC,...i.platform,_c:r};return gC(e,t,{...i,platform:a})},aw=typeof document<`u`?H.useLayoutEffect:function(){};function ow(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ow(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ow(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function sw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cw(e,t){let n=sw(e);return Math.round(t*n)/n}function lw(e){let t=H.useRef(e);return aw(()=>{t.current=e}),t}function uw(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);ow(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=lw(c),D=lw(i),O=lw(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),iw(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!ow(w.current,t)&&(w.current=t,qs.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);aw(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);aw(()=>(A.current=!0,()=>{A.current=!1}),[]),aw(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=cw(M.floating,u.x),r=cw(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...sw(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var dw=(e,t)=>{let n=$C(e);return{name:n.name,fn:n.fn,options:[e,t]}},fw=(e,t)=>{let n=ew(e);return{name:n.name,fn:n.fn,options:[e,t]}},pw=(e,t)=>({fn:rw(e).fn,options:[e,t]}),mw=(e,t)=>{let n=tw(e);return{name:n.name,fn:n.fn,options:[e,t]}},hw=(e,t)=>{let n=nw(e);return{name:n.name,fn:n.fn,options:[e,t]}};function gw(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function _w(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function vw(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(_w(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:gw(r,i,a,o)}}function yw(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function bw(e){return gw(e.left,e.top,e.right,e.bottom)}function xw(e,t,n){let{lines:r}=vw(e.getClientRects());if(r.length<2)return;let i=yw(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function rte(e,t,n){let{lines:r,fallback:i}=vw(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return bw(r[n.lineIndex]);if(a!=null&&o!=null){let e=yw(r,a,o);if(e!==-1)return bw(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return gw(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return gw(l,f.top,u,p.bottom)}function ite(e){return`contextElement`in e&&e.contextElement?e.contextElement:_y(e)?e:void 0}function ate(e,t){function n(t){Sw(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function Sw(e,t,n,r){let i=xw(t,n,r);return e.current=i,i}function ote(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=ite(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=rte(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var ste=n((e=>{var t=ee();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Cw=n(((e,t)=>{t.exports=ste()})),cte=n((e=>{var t=ee(),n=Cw();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),lte=n(((e,t)=>{t.exports=cte()})),ww=[],Tw=void 0;function ute(){return Tw}function dte(e){ww.push(e)}function Ew(e){let t=(t,n)=>{let r=Cr(fte).current,i;try{Tw=r;for(let e of ww)e.before(r);i=e(t,n);for(let e of ww)e.after(r);r.didInitialize=!0}finally{Tw=void 0}return i};return t.displayName=e.displayName||e.name,t}function Dw(e){return H.forwardRef(Ew(e))}function fte(){return{didInitialize:!1}}var Ow=Cw(),pte=lte(),mte=jr(19)?gte:_te;function kw(e,t,n,r,i){return mte(e,t,n,r,i)}function hte(e,t,n,r,i){let a=H.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Ow.useSyncExternalStore)(e.subscribe,a,a)}dte({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Ow.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function gte(e,t,n,r,i){let a=ute();if(!a)return hte(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function _te(e,t,n,r,i){return(0,pte.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var vte=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return kw(this,e,t,n,r)}},Aw=class extends vte{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){H.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){H.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return H.useDebugValue(e),kw(this,this.selectors[e],t,n,r)}useContextCallback(e,t){H.useDebugValue(e);let n=zy(t??Nr);this.context[e]=n}useStateSetter(e){let t=H.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},yte={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},jw=class extends Aw{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:WS(),nested:n,triggerElements:i},yte),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&jb(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Mw(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=H.useRef(null);r===void 0&&f.current===null&&(f.current=new jw({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};_y(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Nw(e,t=!1,n=!1){let[r,i]=H.useState(e&&t?`idle`:void 0),[a,o]=H.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Y(()=>{if(!e&&a&&r!==`ending`&&n){let e=ox.request(()=>{i(`ending`)});return()=>{ox.cancel(e)}}},[e,a,r,n]),Y(()=>{if(!e||t)return;let n=ox.request(()=>{i(void 0)});return()=>{ox.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ox.request(()=>{i(`idle`)});return()=>{ox.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Pw(e,t=!1){let n=sx();return zy((r,i=null)=>{n.cancel();let a=$S(e);if(a==null)return;let o=a,s=()=>{qs.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function Fw(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=zy(i),o=Pw(r,n);H.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Iw={tabIndex:-1,[Mb]:``};function Lw(e){return t=>t!==`touch`||e.current}function Rw(e,t=!1){let n=ab(),r=JS()!=null,i=Cr(()=>e(n,r)).current;return Mw({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function zw({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function bte(e,t){let n=H.useRef(null),r=H.useRef(null);return H.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Bw(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Vw(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function xte(e,t,n,r={}){let i=n.reason,a=i===qy,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Vw(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),Bw(i,t,n.trigger,c()),e.update(i)};a?qs.flushSync(l):l()}function Hw(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=bte(e,n),o=zy(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=H.useCallback(e=>{a(e),e&&o(e)},[a,o]);return Y(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Uw(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=H.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=tb(Gy);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Ww(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Nw(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=zy(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Fw({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Gw(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:Fr,inactiveTriggerProps:Fr,popupProps:Fr})},[e])}function Kw(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var qw=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Ste(){return new jw({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new qw,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Jw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ste(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Fr,inactiveTriggerProps:Fr,popupProps:Fr}}function Yw(e,t,n=!1){return new jw({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Xw=e=>e.triggerIdProp??e.activeTriggerId,Zw=e=>e.openProp??e.open,Qw=e=>(e.popupElement?.id??e.floatingId)||void 0;function $w(e,t){return t!==void 0&&Zw(e)&&Xw(e)===t}function Cte(e,t){return $w(e,t)?!0:t!==void 0&&Zw(e)&&Xw(e)==null&&e.triggerCount===1}var eT={open:Zw,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Xw,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Qw,isTriggerActive:(e,t)=>t!==void 0&&Xw(e)===t,isOpenedByTrigger:(e,t)=>$w(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Xw(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Cte(e,t)?Qw(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function tT(e){let t=H.useCallback(t=>e===void 0?Nr:e.subscribeStore(t),[e]),n=H.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Ow.useSyncExternalStore)(t,n,()=>e?.serverStore)}function wte(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ab(),a=JS()!=null,o=Cr(()=>new jw({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new qw,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=_y(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function nT(e){return rT(e,e.rootContext)}function rT(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=H.useState(null),[d,f]=H.useState(void 0),[p,m]=H.useState(void 0),h=H.useRef(null),g=YS(r),_=H.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=uw({...e,elements:{..._,...l&&{reference:l}}}),y=_y(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=H.useCallback(e=>{let t=_y(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=H.useCallback(e=>{(_y(e)||e===null)&&(h.current=e,f(e)),(_y(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!_y(e))&&v.refs.setReference(e)},[v.refs,f]),C=H.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=H.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=H.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=H.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),H.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var iT=xb&&Cb;function aT(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=H.useRef(!1),c=H.useRef(null),l=H.useRef(!0),u=db();H.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=my(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&vy(e)&&e===Rb(Vy(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return tx(ex(t,`blur`,r),iT&&ex(t,`keydown`,a,!0),iT&&ex(t,`pointerdown`,o,!0))},[i,n]),H.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);_y(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=H.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Bb(t.nativeEvent);if(_y(a)){if(iT&&!t.relatedTarget){if(!l.current&&!Wb(a))return}else if(!qb(a))return}let o=Vb(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,tb(Jy,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,tb(Jy,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=_y(n)&&n.hasAttribute(yS(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Rb(Vy(e));!n&&t===e||zb(o.current.floatingContext?.refs.floating.current,t)||zb(e,t)||a||Vb(n??t,i.context.triggerElements)||i.setOpen(!1,tb(Jy,r))})}}},[o,r,i,u]);return H.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var oT=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ub,this.restTimeout=new ub,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},sT=new WeakMap;function cT(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&sT.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),sT.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function lT(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=sT.get(n);a&&a!==e&&cT(a),cT(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,sT.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function uT(e){let t=e.context.dataRef.current,n=Cr(()=>t.hoverInteractionState??oT.create()).current;return t.hoverInteractionState||=n,cb(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function dT(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=YS(),d=JS(),f=uT(a),p=db(),m=zy(()=>Qb(l.current.openEvent?.type,f.interactedInside)),h=zy(()=>$b(l.current.openEvent?.type)),g=zy(()=>{cT(f)});Y(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),H.useEffect(()=>g,[g]),Y(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&_y(c)&&s){let e=c,t=s,n=Vy(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return lT(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),H.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&_S(u.nodesRef.current,d).length>0)}function t(e){let t=Xb(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,tb(qy,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Bb(e);if(!Gb(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Vb(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&_y(o)&&_S(u.nodesRef.current,r,!1).some(e=>zb(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,tb(qy,t)),u.events.emit(`floating.closed`,t)})}let y=s;return tx(y&&ex(y,`mouseenter`,c),y&&ex(y,`mouseleave`,_),y&&ex(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var fT={current:null};function pT(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=fT,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=YS(l),y=uT(h),b=H.useRef(!1),x=nx(i),S=nx(r),C=nx(o),w=nx(n),T=nx(p),E=nx(f),D=zy(()=>Qb(g.current.openEvent?.type,y.interactedInside)),O=zy(()=>T.current?.()!==!1),k=zy((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!zb(e,t);if(!_y(n))return!1;let i=n;return r.hasMatchingElement(e=>zb(e,i))&&(!e||!zb(e,i))}),A=zy(()=>{y.handler&&=(Vy(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=zy(()=>{cT(y)});return u&&(y.handleCloseOptions=x.current?.__options),H.useEffect(()=>A,[A]),H.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===qy,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),H.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Xb(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,tb(qy,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,tb(qy,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!_y(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Ab(y.pointerType))return;let t=Zb(C.current),n=Xb(S.current,`open`,y.pointerType),r=Bb(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(_y(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(zb(e,r)){s=e;break}}_y(i)&&_y(o)&&!h.context.triggerElements.hasElement(i)&&zb(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&_y(s)&&_y(o)&&zb(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){O()&&h.setOpen(!0,tb(qy,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,tb(qy,e,s))}):g&&O()&&h.setOpen(!0,tb(qy,e,s)))}function i(t){if(D()){j();return}A();let n=Vy(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Vb(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!zb(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){zb(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?ex(t,`mouseout`,o):void 0;return s?tx(ex(t,`mousemove`,r,{once:!0}),ex(t,`mouseenter`,r),ex(t,`mouseleave`,i),l):tx(ex(t,`mouseenter`,r),ex(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),H.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!Ab(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;lT(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Zb(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,tb(qy,t,n))}y.pointerType===`touch`?qs.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var mT=`Escape`;function hT(e){return Cb&&e.movementX===0&&e.movementY===0}function gT(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function _T(e,t){return gT(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function vT(e,t,n){return gT(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function yT(e,t,n){return gT(t,n?e===Pb:e===Fb,e===Lb)}function bT(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===mT:gT(t,n?e===Fb:e===Pb,e===Ib)}function xT(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=Jb(T),k=Kb(E),A=nx(O),j=JS(),M=YS(b),N=H.useRef(f),P=H.useRef(o??-1),F=H.useRef(null),I=H.useRef(!0),ee=zy(e=>{i(P.current===-1?null:P.current,e)}),L=H.useRef(!!T),te=H.useRef(w),R=H.useRef(!1),z=H.useRef(!1),ne=H.useRef(null),re=nx(h),B=nx(w),ie=nx(o),ae=nx(y),oe=sx(),se=sx(),V=zy(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):ne.current=xS(e,{sync:R.current,preventScroll:!0})}let t=n.current[P.current],r=z.current;t&&e(t),(R.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),pe&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{D.current.orientation=g},[D,g]),Y(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(z.current=!0,ee())):L.current&&(P.current=-1,ee()))},[a,w,T,o,ee]),Y(()=>{if(a){if(!w){R.current=!1;return}if(T){if(r==null){if(R.current=!1,ie.current!=null)return;if(L.current&&(P.current=-1,V()),(!te.current||!L.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>se.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||vT(F.current,g,u)||l?Bx(n):Vx(n),F.current=null,ee())};t()}}else zx(n.current,r)||(P.current=r,V(),z.current=!1)}}},[a,w,T,r,ie,l,n,g,u,ee,V,se]),Y(()=>{if(!a||T||!M||d||!L.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=Rb(Vy(E??t??null)),r=e.some(e=>e.context&&zb(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Y(()=>{te.current=w,L.current=!!T}),Y(()=>{w||(F.current=null,N.current=f)},[w,f]);let ce=r!=null,le=zy(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,ee(e))}),ue=zy(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),de=zy(()=>Bx(n,re.current)),fe=zy(e=>{if(I.current=!1,R.current=!0,e.which===229||!B.current&&e.currentTarget===A.current)return;if(l&&bT(e.key,g,u,S)){_T(e.key,ue())||Eb(e),C.setOpen(!1,tb(Zy,e.nativeEvent)),vy(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=Bx(n,h),i=Vx(n,h);if(k||(e.key===`Home`&&(Eb(e),P.current=r,ee(e)),e.key===`End`&&(Eb(e),P.current=i,ee(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,ee(e)),g===`both`)return}if(_T(e.key,g)){if(Eb(e),w&&!d&&Rb(e.currentTarget.ownerDocument)===e.currentTarget){P.current=vT(e.key,g,u)?r:i,ee(e);return}vT(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(R.current=!1,P.current=r):P.current=Hx(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,Hx(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(R.current=!1,P.current=i):P.current=Hx(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,Hx(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),zx(n.current,P.current)&&(P.current=-1),ee(e)}}),pe=H.useMemo(()=>({onFocus(e){R.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){hT(e)||(R.current=!0,z.current=!1,p&&le(e))},onPointerLeave(e){if(!B.current||!I.current||e.pointerType===`touch`)return;R.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&ae.current&&(ne.current?.(),ne.current=null,P.current=-1,ee(e),!d)){let e=A.current,t=Rb(Vy(e));e&&zb(e,t)&&e.focus({preventScroll:!0})}}}),[le,B,A,p,n,ee,ae,d]),me=H.useMemo(()=>d&&w&&ce&&{"aria-activedescendant":`${v}-${r}`},[d,w,ce,v,r]),he=H.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...k?{}:me,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=Bb(e.nativeEvent);if(t&&!zb(A.current,t))return;Eb(e),C.setOpen(!1,tb(Xy,e.nativeEvent)),vy(E)&&E.focus();return}fe(e)},onPointerMove(e){hT(e)||(I.current=!0)}}),[me,fe,A,g,k,C,w,d,E]),ge=H.useMemo(()=>{function e(e){C.setOpen(!0,tb(Zy,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Ob(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&kb(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=yT(t.key,ue(),u),a=_T(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return fe(t);if(!(!n&&!m&&r)){if(o){let e=_T(t.key,ue());F.current=l&&e?null:t.key}if(l){i&&(Eb(t),n?(P.current=de(),ee(t)):e(t));return}a&&(ie.current!=null&&(P.current=ie.current),Eb(t),!n&&m?e(t):fe(t),n&&ee(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,ee(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,f,de,l,ee,C,m,g,ue,u,ie,d]),_e=H.useMemo(()=>({...me,...ge}),[me,ge]);return H.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function ST(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=db(),m=H.useRef(``),h=H.useRef(u??i??-1),g=H.useRef(null),_=zy(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!Gx(n)||n?.matches(`:disabled`)?!1:o==null||!Ux(Pr,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Eb(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Eb(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=zy(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);zb(n,t)||zb(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Y(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=H.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return H.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var CT=.1,wT=CT*CT,TT=.5;function ET(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function DT(e,t,n,r,i,a,o,s,c,l){let u=!1;return ET(e,t,n,r,i,a)&&(u=!u),ET(e,t,i,a,o,s)&&(u=!u),ET(e,t,o,s,c,l)&&(u=!u),ET(e,t,c,l,n,r)&&(u=!u),u}function OT(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function kT(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function AT(e={}){let{blockPointerEvents:t=!1}=e,n=new ub,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*wT;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Bb(r),g=r.type===`mouseleave`,_=zb(u,h),v=zb(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&_y(r.relatedTarget)&&zb(u,r.relatedTarget))return;function y(){return!!(s&&_S(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=kT(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=kT(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=kT(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=kT(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!OT(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?TT/2:TT*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+TT+1,o=C||T?S.bottom-TT:S.top,s=C?T?S.bottom-TT:S.top:S.bottom-TT;M=DT(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?TT/2:TT*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-TT,o=C||T?S.top+TT:S.bottom,s=C?T?S.top+TT:S.bottom:S.top+TT;M=DT(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?TT/2:TT*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+TT+1,o=w||E?S.right-TT:S.left,s=w?E?S.right-TT:S.left:S.right-TT;M=DT(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?TT/2:TT*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-TT,o=w||E?S.left+TT:S.right,s=w?E?S.left+TT:S.right:S.left+TT;M=DT(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var jT=H.createContext(void 0);function MT(){let e=H.useContext(jT);if(e===void 0)throw Error(xr(26));return e}var NT=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),PT={...ly,...ty,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},FT=H.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Zv(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);MT(),Fw({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Lw(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=zr(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Iw,hidden:!m,onKeyDown(e){NT.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:PT});return(0,G.jsx)(cC,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function IT(e){return jr(19)?e:e?`true`:void 0}var LT=H.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),RT=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Zv(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,G.jsx)(jT.Provider,{value:n,children:(0,G.jsxs)(US,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(LT,{ref:i.context.internalBackdropRef,inert:IT(!s)}),e.children]})}):null}),zT={},BT={},VT=``;function HT(e,t){return by(e)?e:t}function UT(e,t,n){return/hidden|clip/.test(e.getComputedStyle(HT(t,n)).overflowY)}function WT(e){if(typeof document>`u`)return!1;let t=Vy(e);return my(t).innerWidth-t.documentElement.clientWidth>0}function GT(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Vy(e),n=t.documentElement,r=t.body,i=HT(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function KT(e){let t=Vy(e),n=t.documentElement,r=t.body,i=HT(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function qT(e){let t=Vy(e),n=t.documentElement,r=t.body,i=my(n),a=0,o=0,s=!1,c=ox.create();if(Cb&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,zT={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},VT=n.style.scrollBehavior,BT={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=HT(n,r);if(s=GT(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,zT),Object.assign(r.style,BT),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=VT)}function d(){u(),c.request(l)}l();let f=ex(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var JT=new class{lockCount=0;restore=null;timeoutLock=ub.create();timeoutUnlock=ub.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Vy(e),n=t.documentElement,r=t.body,i=my(n);if(UT(i,n,r)){let t=new i.MutationObserver(()=>{UT(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=vb||!WT(e);this.restore=a?KT(e):qT(e)}};function YT(e=!0,t=null){Y(()=>{if(e)return JT.acquire(t)},[e,t])}function XT({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=H.useState(0),[u,d]=H.useState(0),f=c===0,p=fC(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Bb(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||zb(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return YT(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Y(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),Gw(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var ZT={...eT,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},QT=class extends Aw{constructor(e,t,n){let r=new qw,i=$T(e,r,t,n);super(i,eE(r),ZT)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};Bw(n,e,t.trigger),this.update(n)}};function $T(e,t,n,r=!1){let i={...Jw(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=Yw(t,n,r),i}function eE(e){return{popupRef:H.createRef(),backdropRef:H.createRef(),internalBackdropRef:H.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function tE(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Zv(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=Rw((e,t)=>new QT({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);Kw(b,x),Uw(b);let{forceUnmount:w}=Ww(x,b);H.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,tb(eb))}),[w,b]);let T=x||S;return(0,G.jsxs)(Xv.Provider,{value:b,children:[u&&(0,G.jsx)(zw,{handle:u,store:b}),T&&(0,G.jsx)(XT,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}function nE(e){return tE(`dialog`,e)}var rE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=MT(),c=Zv(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return zr(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:PT,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),iE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Zv(),c=ob(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),zr(`h2`,e,{ref:t,props:[{id:c},o]})});function aE(e){let t=H.useRef(``),n=H.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:H.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function oE(e,t){let n=H.useRef(e),r=zy(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function sE(e,t){let{onClick:n,onPointerDown:r}=aE(zy((n,r)=>{(typeof e==`function`?e():e)||t(r||(vb?`touch`:``))}));return H.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function cE(e){let[t,n]=H.useState(null),r=sE(e,n);return oE(e,t=>{t&&!e&&n(null)}),H.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var lE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Zv(!0),f=tT(l)??d;if(!f)throw Error(xr(79));let p=ob(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=H.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=Hw(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=Uy({disabled:a,native:o}),S=lC(m),C=sE(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return zr(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[FS]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:sy})}),uE=H.createContext(void 0);function dE(){let e=H.useContext(uE);if(e===void 0)throw Error(xr(53));return e}function fE(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var pE=`base-ui-disable-scrollbar`,mE={className:pE,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:pE,precedence:`base-ui:low`,children:`.${pE}{scrollbar-width:none}.${pE}::-webkit-scrollbar{display:none}`})}},hE=e=>t=>t?{[e]:``}:null,gE={hasOverflowX:hE(`data-has-overflow-x`),hasOverflowY:hE(`data-has-overflow-y`),overflowXStart:hE(`data-overflow-x-start`),overflowXEnd:hE(`data-overflow-x-end`),overflowYStart:hE(`data-overflow-y-start`),overflowYEnd:hE(`data-overflow-y-end`),cornerHidden:()=>null},Tte=H.createContext(void 0),Ete={disableStyleElements:!1};function _E(){return H.useContext(Tte)??Ete}var Dte={x:0,y:0},vE={width:0,height:0},yE={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},bE={x:!0,y:!0,corner:!0},xE=H.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=SE(i),d=ob(),f=db(),p=db(),{nonce:m,disableStyleElements:h}=_E(),[g,_]=H.useState(!1),[v,y]=H.useState(!1),[b,x]=H.useState(!1),[S,C]=H.useState(!1),[w,T]=H.useState(!1),[E,D]=H.useState(vE),[O,k]=H.useState(vE),[A,j]=H.useState(yE),[M,N]=H.useState(bE),P=H.useRef(null),F=H.useRef(null),I=H.useRef(null),ee=H.useRef(null),L=H.useRef(null),te=H.useRef(null),R=H.useRef(null),z=H.useRef(null),ne=H.useRef(0),re=H.useRef(0),B=H.useRef(0),ie=H.useRef(0),ae=H.useRef(`vertical`),oe=H.useRef(Dte),se=H.useRef(null);function V(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let ce=zy(e=>{let t=e.x-oe.current.x,n=e.y-oe.current.y;oe.current=e,n!==0&&V(!0),t!==0&&V(!1)}),le=zy(()=>{let e=F.current;e&&se.current===null&&(se.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),ue=zy(e=>{if(e.button!==0||z.current!==null&&(ae.current===`vertical`?L.current:te.current)?.hasPointerCapture(z.current))return;z.current=e.pointerId,ne.current=e.clientY,re.current=e.clientX,ae.current=e.currentTarget.getAttribute(`data-orientation`);let t=F.current;t&&(B.current=t.scrollTop,ie.current=t.scrollLeft,le()),(ae.current===`vertical`?L.current:te.current)?.setPointerCapture(e.pointerId)}),de=zy(e=>{if(e.pointerId!==z.current)return;z.current=null,(ae.current===`vertical`?x:y)(!1),se.current!==null&&(F.current&&(F.current.style.scrollSnapType=se.current),se.current=null);let t=ae.current===`vertical`?L.current:te.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),fe=zy(e=>{if(e.pointerId!==z.current)return;if(e.buttons%2==0){de(e);return}let t=F.current;if(!t)return;let n=ae.current===`vertical`,r=n?L.current:te.current,i=n?I.current:ee.current;if(!r||!i)return;let a=n?`y`:`x`,o=fE(i,`padding`,a),s=fE(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-ne.current:e.clientX-re.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?B.current:ie.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),V(n)});function pe(e){C(e.pointerType===`touch`)}function me(e){if(pe(e),e.pointerType!==`touch`){let t=zb(P.current,e.target);_(t)}}let he=H.useMemo(()=>({scrolling:v||b,hasOverflowX:!M.x,hasOverflowY:!M.y,overflowXStart:A.xStart,overflowXEnd:A.xEnd,overflowYStart:A.yStart,overflowYEnd:A.yEnd,cornerHidden:M.corner}),[v,b,M.x,M.y,M.corner,A]),ge={role:`presentation`,onPointerEnter:me,onPointerMove:me,onPointerDown:pe,onPointerLeave(){_(!1)},style:{position:`relative`,"--scroll-area-corner-height":`${E.height}px`,"--scroll-area-corner-width":`${E.width}px`}},_e=zr(`div`,e,{state:he,ref:[t,P],props:[ge,o],stateAttributesMapping:gE}),ve=H.useMemo(()=>({handlePointerDown:ue,handlePointerMove:fe,handlePointerUp:de,handleScroll:ce,disableViewportSnap:le,cornerSize:E,setCornerSize:D,thumbSize:O,setThumbSize:k,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:T,touchModality:S,cornerRef:R,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:F,scrollbarYRef:I,scrollbarXRef:ee,thumbYRef:L,thumbXRef:te,rootId:d,hiddenState:M,setHiddenState:N,overflowEdges:A,setOverflowEdges:j,viewportState:he,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[ue,fe,de,ce,le,E,O,w,S,v,b,g,d,M,A,he,s,c,l,u]);return(0,G.jsxs)(uE.Provider,{value:ve,children:[!h&&mE.getElement(m),_e]})});function SE(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var CE=H.createContext(void 0),wE=H.createContext(void 0);function TE(){return H.useContext(wE)?.direction??`ltr`}function EE(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function DE(e,t){return Math.max(0,e-t)}function OE(e,t){if(t<=0)return 0;let n=EE(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var kE=[`--scroll-area-overflow-x-start`,`--scroll-area-overflow-x-end`,`--scroll-area-overflow-y-start`,`--scroll-area-overflow-y-end`],AE=!1;function jE(){AE||Cb||(typeof CSS<`u`&&`registerProperty`in CSS&&kE.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),AE=!0)}var ME=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,setHasMeasuredScrollbar:v,handleScroll:y,touchModality:b,setHovering:x,setOverflowEdges:S,overflowEdgeThreshold:C,viewportState:w}=dE(),T=TE(),E=H.useRef(!0),D=H.useRef([NaN,NaN,NaN,NaN]),O=db(),k=db(),A=zy(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let h=e.scrollHeight,_=e.scrollWidth,y=e.clientHeight,b=e.clientWidth,x=e.scrollTop,w=e.scrollLeft,E=D.current,O=Number.isNaN(E[0]);if(E[0]=y,E[1]=h,E[2]=b,E[3]=_,O&&v(!0),h===0||_===0)return;let k=NE(e),A=k.y,j=k.x,M=b/_,N=y/h,P=Math.max(0,_-b),F=Math.max(0,h-y),I=0,ee=0;j||(I=OE(T===`rtl`?-w:w,P),ee=P-I);let L=A?0:OE(x,F),te=A?0:F-L,R=j?0:b,z=A?0:y,ne=0,re=0;!j&&!A&&(ne=t?.offsetWidth||0,re=n?.offsetHeight||0);let B=f.width===0&&f.height===0,ie=B?ne:0,ae=B?re:0,oe=fE(n,`padding`,`x`),se=fE(t,`padding`,`y`),V=fE(i,`margin`,`x`),ce=fE(r,`margin`,`y`),le=R-oe-V,ue=z-se-ce,de=n?Math.min(n.offsetWidth-ie,le):le,fe=t?Math.min(t.offsetHeight-ae,ue):ue,pe=Math.max(16,de*M),me=Math.max(16,fe*N);if(m(e=>PE(e,{width:pe,height:me})),t&&r){let e=FE(r,`--scroll-area-thumb-height`,x,F,h,me,t.offsetHeight-me-se-ce);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-pe-oe-V,t=FE(i,`--scroll-area-thumb-width`,T===`rtl`?-w:w,P,_,pe,e);i.style.transform=`translate3d(${T===`rtl`?-t:t}px,0,0)`}let he=[I,ee,L,te];kE.forEach((t,n)=>{e.style.setProperty(t,`${he[n]}px`)}),a&&p(e=>PE(e,{width:ne,height:re})),g(e=>PE(e,k));let ge={xStart:!j&&I>C.xStart,xEnd:!j&&ee>C.xEnd,yStart:!A&&L>C.yStart,yEnd:!A&&te>C.yEnd};S(e=>PE(e,ge))});Y(()=>{jE()},[]),Y(()=>{queueMicrotask(A)},[A,_,T,C.xStart,C.xEnd,C.yStart,C.yEnd]),Y(()=>{o.current?.matches(`:hover`)&&x(!0)},[o,x]),Y(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=D.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}A()});return n.observe(e),k.start(0,()=>{let t=e.getAnimations({subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished)).then(A).catch(()=>{})}),()=>{n.disconnect(),k.clear()}},[A,o,k]);function j(){E.current=!1}let M={role:`presentation`,...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:mE.className,style:{overflow:`scroll`},onScroll(){o.current&&(A(),(b||!E.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),O.start(100,()=>{E.current=!0}))},onWheel:j,onPointerMove:j,onPointerEnter:j,onKeyDown:j},N=zr(`div`,e,{ref:[t,o],state:w,props:[M,a],stateAttributesMapping:gE}),P=H.useMemo(()=>({computeThumbPosition:A}),[A]);return(0,G.jsx)(CE.Provider,{value:P,children:N})});function NE(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function PE(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function FE(e,t,n,r,i,a,o){let s=EE(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}var IE=H.createContext(void 0);function LE(){let e=H.useContext(IE);if(e===void 0)throw Error(xr(54));return e}var RE=H.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,handleScroll:y,disableViewportSnap:b,rootId:x,thumbSize:S,hasMeasuredScrollbar:C,viewportState:w}=dE(),T=i===`vertical`,E={...w,hovering:c,scrolling:T?u:l,orientation:i},D=TE(),O=!C&&!a,k=T?d.y:d.x,A=a||!k;H.useEffect(()=>{if(!A)return;let e=m.current,t=T?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!T,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&D===`rtl`?-a:0,s=n&&D===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),y({x:e.scrollLeft,y:e.scrollTop}))}return ex(t,`wheel`,n,{passive:!1})},[D,y,T,p,f,A,m]);let j={...x&&{"data-id":`${x}-scrollbar`},onPointerDown(e){if(e.button!==0)return;let t=Bb(e.nativeEvent),n=T?h.current:g.current;if(n&&zb(n,t))return;let r=m.current;if(!r)return;let i=T?f.current:p.current;if(!n||!i)return;let a=T?`y`:`x`,o=fE(n,`margin`,a),s=fE(i,`padding`,a),c=T?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=T?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=T?r.scrollHeight:r.scrollWidth,v=T?r.clientHeight:r.clientWidth,x=(T?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),T?r.scrollTop=S*C:r.scrollLeft=D===`rtl`?-(1-S)*C:S*C,y({x:r.scrollLeft,y:r.scrollTop}),_(e)},onPointerUp:v,onPointerCancel:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:O?`hidden`:void 0,...T?{top:0,bottom:`var(--scroll-area-corner-height)`,insetInlineEnd:0,"--scroll-area-thumb-height":`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(--scroll-area-corner-width)`,bottom:0,"--scroll-area-thumb-width":`${S.width}px`}}},M=zr(`div`,e,{ref:[t,T?f:p],state:E,props:[j,s],stateAttributesMapping:gE});return A?(0,G.jsx)(IE.Provider,{value:i,children:M}):null}),zE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=dE(),m=LE(),h=m===`vertical`;return zr(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),BE=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{cornerRef:o,cornerSize:s,hiddenState:c}=dE(),l=zr(`div`,e,{ref:[t,o],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:s.width,height:s.height}},a]});return c.corner?null:l});function VE({className:e,children:t,scrollFade:n=!1,scrollbarGutter:r=!1,...i}){return(0,G.jsxs)(xE,{className:W(`size-full min-h-0`,e),...i,children:[(0,G.jsx)(ME,{className:W(`h-full !overflow-y-auto overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,n&&`mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]`,r&&`data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5`),"data-slot":`scroll-area-viewport`,children:t}),(0,G.jsx)(HE,{orientation:`vertical`}),(0,G.jsx)(HE,{orientation:`horizontal`}),(0,G.jsx)(BE,{"data-slot":`scroll-area-corner`})]})}function HE({className:e,orientation:t=`vertical`,...n}){return(0,G.jsx)(RE,{className:W(`m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100`,e),"data-slot":`scroll-area-scrollbar`,orientation:t,...n,children:(0,G.jsx)(zE,{className:`relative flex-1 rounded-full bg-foreground/20`,"data-slot":`scroll-area-thumb`})})}var UE=e=>{typeof window>`u`||window.electronAPI?.browser?.setOverlayActive(e)},WE=0,GE=!1;function KE(){let e=WE>0;e!==GE&&(GE=e,UE(GE))}function qE(){WE+=1,KE()}function JE(){WE=Math.max(0,WE-1),KE()}function YE(e=!0){(0,H.useLayoutEffect)(()=>{if(e)return qE(),()=>JE()},[e])}function XE(){return YE(),null}var ZE=0,QE=!1,$E=!1,eD=!1;function tD(){let e=ZE>0&&!$E;e!==QE&&(QE=e,window.electronAPI?.window?.setTrafficLightsVisible(!e))}function nD(){eD||(eD=!0,window.electronAPI?.window?.isFullScreen().then(e=>{$E=e,tD()}).catch(()=>{}),window.electronAPI?.window?.onFullScreenChange(e=>{$E=e,tD()}))}function rD(){window.electronAPI?.env?.platform===`darwin`&&(nD(),ZE++,tD())}function iD(){window.electronAPI?.env?.platform===`darwin`&&(ZE=Math.max(0,ZE-1),tD())}function aD(e){(0,H.useEffect)(()=>{if(e)return rD(),()=>iD()},[e])}var oD={BASE:0,SETTINGS_WINDOW:10,MOBILE_DRAWER:30,DROPDOWN:40,MODAL_BACKDROP:50,MODAL_CONTENT:51,DROPDOWN_IN_MODAL:60,NESTED_MODAL_BACKDROP:70,NESTED_MODAL_CONTENT:71,DROPDOWN_IN_NESTED_MODAL:80,TOOLTIP:100,TOAST:110,DEVTOOLS_OVERLAY:120},sD=(0,H.createContext)(oD.DROPDOWN);function cD(e){return aD(e.open??!1),(0,G.jsx)(nE,{...e})}var lD=RT;function uD(e){return(0,G.jsx)(lE,{"data-slot":`dialog-trigger`,...e})}function dD({className:e,...t}){return(0,G.jsx)(dy,{className:W(`fixed inset-0 no-drag bg-black/32 backdrop-blur-sm transition-opacity duration-150 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,e),"data-slot":`dialog-backdrop`,"data-enso-float":``,...t})}function fD({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`fixed inset-0 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4 pointer-events-none`,e),"data-slot":`dialog-viewport`,...t})}function pD({className:e,children:t,showCloseButton:n=!0,bottomStickOnMobile:r=!0,disableNestedTransform:i=!1,showBackdrop:a=!0,zIndexLevel:o=`base`,style:s,...c}){let l=i?{...s??{},"--nested-dialogs":0}:s,u=o===`base`?oD.MODAL_CONTENT:oD.NESTED_MODAL_CONTENT,d=o===`base`?oD.MODAL_BACKDROP:oD.NESTED_MODAL_BACKDROP,f=o===`base`?oD.DROPDOWN_IN_MODAL:oD.DROPDOWN_IN_NESTED_MODAL;return(0,G.jsxs)(lD,{children:[(0,G.jsx)(XE,{}),a&&(0,G.jsx)(dD,{style:{zIndex:d}}),(0,G.jsx)(fD,{className:W(r&&`max-sm:grid-rows-[1fr_auto] max-sm:pt-12`),style:{zIndex:u},children:(0,G.jsxs)(FT,{className:W(`-translate-y-[calc(1.25rem*var(--nested-dialogs))] no-drag pointer-events-auto relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-150 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,r&&`max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none`,e),style:l,"data-slot":`dialog-popup`,...c,children:[(0,G.jsx)(sD.Provider,{value:f,children:t}),n&&(0,G.jsx)(nb,{"aria-label":`Close`,className:`absolute end-3 top-2.5 z-50 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors`,children:(0,G.jsx)(nr,{className:`h-4 w-4`})})]})})]})}function mD({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`flex flex-col gap-2 p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pb-3 max-sm:pb-4`,e),"data-slot":`dialog-header`,...t})}function hD({className:e,variant:t=`default`,...n}){return(0,G.jsx)(`div`,{className:W(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,t==="default"&&`border-t bg-muted/50 py-4`,t===`bare`&&`in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pt-3 pt-4 pb-6`,e),"data-slot":`dialog-footer`,...n})}function gD({className:e,...t}){return(0,G.jsx)(iE,{className:W(`font-heading text-xl leading-none`,e),"data-slot":`dialog-title`,...t})}function _D({className:e,...t}){return(0,G.jsx)(sb,{className:W(`text-muted-foreground text-sm`,e),"data-slot":`dialog-description`,...t})}var vD=`px-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-header])]:pt-1 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-header]))]:pt-6 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer]))]:pb-6! in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer].border-t))]:pb-1 pb-6`;function yD({className:e,bare:t=!1,...n}){let r=(0,G.jsx)(`div`,{className:W(vD,e),"data-slot":`dialog-panel`,...n});return t?r:(0,G.jsx)(VE,{className:`!h-auto min-h-0 flex-1`,children:r})}var bD=0;function xD(e){return bD+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${bD}`}var SD=H.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=HS({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(H.Fragment,{children:[l,c&&qs.createPortal(n,c)]})}),CD=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=yx(e,t)||{};if(l==null)return{};let f=Lx(u),p={x:n,y:r},m=Tx(i),h=Cx(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=vx(k,j,A),N=!c.arrow&&xx(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),wD=(e,t)=>({...CD(e),options:[e,t]}),TD={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},ED={sideX:`left`,sideY:`top`},DD=`--available-width`,OD=`--available-height`;function kD(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function AD(e,t,n){let{rects:r,placement:i}=e;return{side:kD(t,bx(i),n),align:xx(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function jD(e){return MD(e,nT)}function MD(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=H.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=zy(A),M=A?j:n,N=nx(n),P=nx(g),F=TE()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],ee=o===`center`?I:`${I}-${o}`,L=l;typeof L==`number`?L={top:L,right:L,bottom:L,left:L}:L&&={top:L.top||0,right:L.right||0,bottom:L.bottom||0,left:L.left||0};let te=+(i===`bottom`),R=+(i===`top`),z=+(i===`right`),ne=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:L},B=H.useRef(null),ie=nx(a),ae=nx(s),oe=typeof a==`function`?0:a,se=typeof s==`function`?0:s,V=[];p&&V.push(p),V.push(dw(e=>{let t=AD(e,i,F),n=typeof ie.current==`function`?ie.current(t):ie.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,se,F,i]));let ce=E===`none`&&T!==`shift`,le=!ce&&(u||O||T===`shift`),ue=T===`none`?null:mw({...re,padding:{top:L.top+1+te,right:L.right+1+ne,bottom:L.bottom+1+R,left:L.left+1+z},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),de=ce?null:fw({...re,rootBoundary:k,mainAxis:E!==`none`,crossAxis:le,limiter:u||O?void 0:pw(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=wx(bx(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})},[re,u,O,k,L,E]);T===`shift`||E===`shift`||o===`center`?V.push(de,ue):V.push(ue,de),V.push(hw({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(DD,`${t}px`),i.setProperty(OD,`${n}px`);let a=my(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),wD(e=>({element:B.current||Vy(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=bx(r),l=wx(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(AD(e,i,F)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,le&&l===`y`&&b?S:x),{}}},TD,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=H.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:V,strategy:r,whileElementsMounted:m?void 0:(...e)=>QC(...e,fe),nodeId:y,externalTree:S}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||ED,Te=xe?r:`fixed`,Ee=H.useMemo(()=>{let e;return e=xe?b?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[DD]=`100vw`,e[OD]=`100vh`,xe||(e.opacity=0),e},[b,Te,Ce,he,we,ge,Se,xe]),De=H.useRef(null);Y(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(ND(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,M,N]),H.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&ND(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,M,N]),H.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return QC(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=bx(ye),ke=kD(i,Oe,F),Ae=xx(ye)||`center`,je=!!_e.hide?.referenceHidden;Y(()=>{x&&g&&xe&&Oe!==I&&w(Oe)},[x,g,xe,Oe,I]);let Me=H.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return H.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:B,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,B,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function ND(e){return e!=null&&`current`in e}function PD(e){return e===`starting`?PS:Fr}function FD(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),zr(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},PD(r),i],stateAttributesMapping:ly})}function ID(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||xD(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var LD=ID();function RD(e){let t={error:1e4,warning:1e4,loading:0,success:5e3,info:5e3},n=e.type,r=e.timeout??(n?t[n]:5e3),{actions:i,data:a,...o}=e,s=i?{...a,actions:i}:a;return LD.add({...o,data:s,timeout:r})}var zD=[`agents`,`members`,`chats`];function BD(e){return[...zD.flatMap(t=>e[t].map(e=>({candidate:e,group:t}))),...e.files.map(e=>({candidate:e,group:`files`}))]}function VD(e,t){let n=zD.filter(t=>e[t].length>0);return!t.trim()&&n.length>0?[...n.map(e=>({type:`folder`,id:e})),...e.files.map(e=>({type:`item`,candidate:e,group:`files`}))]:BD(e).map(e=>({type:`item`,candidate:e.candidate,group:e.group}))}function HD(e){return e.map(e=>({...e,kind:`agent-type`,id:e.typeKey,label:e.displayName}))}function UD(e){let t=new Set,n=[];for(let r of e)!r.relativePath||t.has(r.relativePath)||(t.add(r.relativePath),n.push({kind:`file`,id:r.relativePath,label:r.name||r.relativePath.split(`/`).at(-1)||r.relativePath,relativePath:r.relativePath}));return n}function WD(e,t,n,r=[]){let i=e.trim().toLocaleLowerCase(),a=i?t.filter(e=>`${e.label}\n${e.description}\n${e.source}\n${e.typeKey}`.toLocaleLowerCase().includes(i)):[...t],o=i?n.filter(e=>`${e.label}\n${e.relativePath}`.toLocaleLowerCase().includes(i)):[...n],s=i?r.filter(e=>e.label.toLocaleLowerCase().includes(i)):[...r];return{agents:a.filter(e=>e.source!==`bot`),members:a.filter(e=>e.source===`bot`),files:o,chats:s}}function GD(e,t,n=[],r={}){let[i,a]=(0,H.useState)([]),[o,s]=(0,H.useState)([]),c=t!==null,{searchFiles:l,agents:u=!0}=r;return(0,H.useEffect)(()=>{if(!c||!u)return;a([]);let e=!1;return window.electronAPI.agentRegistry.list().then(t=>{let n=k(t);e||a(n?HD(n.candidates):[])}).catch(()=>{e||a([])}),()=>{e=!0}},[c,u]),(0,H.useEffect)(()=>{if(t===null||!e&&!l){s([]);return}let n=!1,r=window.setTimeout(()=>{(l?l(t):window.electronAPI.files.search({conversationId:e,query:t})).then(e=>{n||s(UD(e))}).catch(()=>{n||s([])})},150);return()=>{n=!0,window.clearTimeout(r)}},[e,t,l]),(0,H.useMemo)(()=>t===null?{agents:[],members:[],files:[],chats:[]}:WD(t,i,o,n),[i,o,n,t])}var KD=1024,qD=(e,t)=>e<=(t?KD:767),JD=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches,YD=()=>typeof window<`u`&&typeof window.innerWidth==`number`&&qD(window.innerWidth,JD()),XD=e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e));function ZD(){return(0,H.useSyncExternalStore)(XD,()=>qD(window.innerWidth,JD()),()=>!1)}var QD=`mod+shift+m`,$D=typeof navigator<`u`&&typeof navigator.platform==`string`?navigator.platform.startsWith(`Mac`):process.platform===`darwin`,eO={"toggle-sidebar":`mod+b`,"toggle-app-mode":`mod+e`,"toggle-side-panel":`mod+j`,"toggle-side-panel-fullscreen":`mod+shift+j`,"open-settings":`mod+,`,"open-secretary":`mod+shift+s`,"switch-model":`mod+.`,"focus-composer":`mod+l`,"send-message":`enter`,"find-in-chat":`mod+f`,"search-workspace":`mod+k`,"new-conversation":`mod+n`,"next-tab":$D?`ctrl+tab`:`mod+tab`,"prev-tab":$D?`ctrl+shift+tab`:`mod+shift+tab`,"new-side-tab":`mod+t`,"new-btw-tab":`mod+shift+b`,"close-side-tab":`mod+w`,"toggle-minimize-to-tray":QD};function tO(e){return{...eO,...e}}function nO(e,t){let n=rO(e);if([`meta`,`control`,`alt`,`shift`].includes(n))return null;let r=$D?e.metaKey:e.ctrlKey,i=$D&&e.ctrlKey;if(!(r||i||e.altKey)&&!(t?.allowBare&&n===`enter`))return null;let a=[];return r&&a.push(`mod`),i&&a.push(`ctrl`),e.altKey&&a.push(`alt`),e.shiftKey&&a.push(`shift`),a.push(n),a.join(`+`)}function rO(e){if(e.key===` `||e.key===`\xA0`)return`space`;if(e.altKey){let t=/^(?:Key([A-Z])|Digit([0-9]))$/.exec(e.code??``);if(t)return(t[1]??t[2]??``).toLowerCase()}return e.key.toLowerCase()}function iO(e){let t=e.split(`+`),n=t.at(-1)??``,r=n.length===1?n.toUpperCase():n.charAt(0).toUpperCase()+n.slice(1);return $D?[t.includes(`ctrl`)?`⌃`:``,t.includes(`alt`)?`⌥`:``,t.includes(`shift`)?`⇧`:``,t.includes(`mod`)?`⌘`:``,r].join(``):[t.includes(`mod`)?`Ctrl`:``,t.includes(`alt`)?`Alt`:``,t.includes(`shift`)?`Shift`:``,r].filter(Boolean).join(`+`)}var aO=new Set,oO=!1;function sO(e,t){t?aO.add(e):aO.delete(e);let n=aO.size>0;n!==oO&&(oO=n,window.electronAPI?.updater?.reportUnsentDraft?.(n))}var cO=[],lO=e=>`/${e.pluginId}:${e.id}`;function uO(e){return cO.find(t=>lO(t)===e)??null}function dO(){return cO}async function fO(e,t){let n=await window.electronAPI.extensionPlugins.call({pluginId:e.pluginId,method:`command.run`,payload:{id:e.id},sessionId:t});return n.ok?null:n.error}var pO=null,mO=new Map;function hO(e){return pO=e,()=>{pO===e&&(pO=null)}}function gO(e){let t=mO.get(e);return mO.delete(e),t}var _O=[],vO=0,yO=new Set;function bO(){return vO}function Ote(e){return yO.add(e),()=>yO.delete(e)}function kte(e){return _O.filter(t=>t.slot===`message.action`&&t.position===e)}function Ate(e){let t=e===`left`?`composer.left`:`composer.right`;return _O.filter(e=>e.slot===t)}function jte(e,t){return _O.find(n=>n.slot===`tool.card`&&n.pluginId===e&&n.toolName===t)}function Mte(){return _O.find(e=>e.slot===`thinking.body`)}function Nte(){return _O.find(e=>e.slot===`message.leaf`)}function Pte(e,t){let n=t.toLowerCase();return _O.find(t=>t.slot===`block`&&t.pluginId===e&&t.language===n)}var Fte=/^[a-z][a-z0-9]*(\.[a-z0-9]+)+$/;function Ite(e){if(!e)return null;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);return!Fte.test(n)||r.length===0?null:{pluginId:n,lang:r}}function Lte({entry:e,props:t}){return(0,H.createElement)(e.component,t)}function xO(){return(0,H.useSyncExternalStore)(Ote,bO,bO)}var Rte=class extends H.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin] ${this.props.pluginId} 挂点 ${this.props.slot} 渲染失败`,e)}render(){return this.state.failed?this.props.fallback??null:this.props.children}};function SO({entry:e,props:t,fallback:n}){return(0,G.jsx)(Rte,{pluginId:e.pluginId,slot:e.slot,fallback:n,children:(0,G.jsx)(Lte,{entry:e,props:t})})}function CO({position:e,text:t,messageIndex:n,sessionId:r}){xO();let i=kte(e);return i.length===0?null:(0,G.jsx)(G.Fragment,{children:i.map(i=>(0,G.jsx)(SO,{entry:i,props:{position:e,text:t,messageIndex:n,sessionId:r}},`${i.pluginId}:${i.uid}`))})}function zte({name:e,output:t,state:n}){xO();let r=C(e);if(!r)return null;let i=jte(r.pluginId,r.toolName);return i?(0,G.jsx)(SO,{entry:i,props:{toolName:r.toolName,output:t,state:n}}):null}var wO=[`t-acc-reveal mt-1 ml-[10px] border-l-2 border-border py-0.5 pl-[19px]`,`text-[13px] leading-relaxed text-muted-foreground whitespace-pre-wrap`].join(` `);function Bte({text:e,streaming:t,itemKey:n}){xO();let r=Mte();return r?(0,G.jsx)(`div`,{className:wO,children:(0,G.jsx)(SO,{entry:r,props:{text:e,streaming:t,itemKey:n},fallback:e},r.uid)}):(0,G.jsx)(`p`,{className:wO,children:e})}function Vte({entry:e,source:t,final:n,messageIndex:r,sessionId:i,Markdown:a}){return(0,G.jsx)(SO,{entry:e,props:{source:t,final:n,messageIndex:r,sessionId:i,Markdown:a}})}function Hte({pluginId:e,lang:t,source:n}){xO();let r=Pte(e,t);return r?(0,G.jsx)(SO,{entry:r,props:{language:t,source:n}}):null}function TO({side:e,sessionId:t,draft:n,busy:r,pluginPresetId:i}){xO();let a=Ate(e);return a.length===0?null:(0,G.jsx)(G.Fragment,{children:a.map(a=>(0,G.jsx)(SO,{entry:a,props:{position:e,sessionId:t,draft:n,busy:r,pluginPresetId:i}},`${a.pluginId}:${a.uid}`))})}var Ute=[],EO=new Set;function Wte(e){return EO.add(e),()=>EO.delete(e)}var DO=()=>Ute,Gte={neutral:`text-muted-foreground`,accent:`text-primary`,success:`text-emerald-600 dark:text-emerald-400`,warning:`text-amber-600 dark:text-amber-400`,danger:`text-red-600 dark:text-red-400`};function Kte({sessionId:e}){let t=(0,H.useSyncExternalStore)(Wte,DO,DO);return t.length===0?null:(0,G.jsx)(G.Fragment,{children:t.map(t=>{let n=t.command?dO().find(e=>e.pluginId===t.pluginId&&e.id===t.command):void 0,r=W(`shrink-0 truncate px-1 text-[11px]`,Gte[t.tone]),i=t.tooltip?`${t.tooltip} · ${t.pluginName}`:t.pluginName;return n?(0,G.jsx)(`button`,{type:`button`,title:i,className:W(r,`rounded hover:bg-accent`),onClick:()=>void fO(n,e).then(e=>{e&&RD({title:e})}),children:t.text},`${t.pluginId}:${t.id}`):(0,G.jsx)(`span`,{title:i,className:r,children:t.text},`${t.pluginId}:${t.id}`)})})}var OO=50,qte=64,Jte=120,Yte=32768,Xte=120,kO=[];function AO(e){return/(?:^|\s)#([^\s#]*)$/.exec(e)?.[1]??null}function Zte(e,t,n){if(!Array.isArray(n))return[];let r=[];for(let i of n){if(r.length>=OO)break;if(typeof i!=`object`||!i)continue;let{id:n,label:a,detail:o}=i;typeof n!=`string`||!n||typeof a!=`string`||!a||r.push({key:`${e}:${t}:${n}`,pluginId:e,name:t,item:{id:n.slice(0,200),label:a.slice(0,qte),...typeof o==`string`&&o?{detail:o.slice(0,Jte)}:{}}})}return r}function Qte(e){let t=typeof e==`string`?e:typeof e==`object`&&e?e.text:null;return typeof t==`string`&&t.length<=Yte?t:null}var jO=[],MO=new Set;function NO(e){return MO.add(e),()=>MO.delete(e)}var PO=()=>jO;function FO(e,t){let n=(0,H.useSyncExternalStore)(NO,PO,PO),[r,i]=(0,H.useState)(kO);return(0,H.useEffect)(()=>{if(e===null||n.length===0){i(kO);return}let r=!1,a=setTimeout(()=>{Promise.all(n.map(async({pluginId:n,name:r})=>{let i=await window.electronAPI.extensionPlugins.call({pluginId:n,method:`trigger.candidates`,payload:{name:r,query:e},sessionId:t});return i.ok?Zte(n,r,i.value):kO})).then(e=>{r||i(e.flat().slice(0,OO))})},Xte);return()=>{r=!0,clearTimeout(a)}},[e,n,t]),e===null?kO:r}async function IO(e,t){let n=await window.electronAPI.extensionPlugins.call({pluginId:e.pluginId,method:`trigger.pick`,payload:{name:e.name,item:e.item},sessionId:t});return n.ok?Qte(n.value):null}var LO=null,RO=null,zO=null,BO=null,VO=null,HO=null,UO=null,WO=null,GO=null;function KO(e){return LO=e,()=>{LO===e&&(LO=null)}}function qO(e){return BO=e,()=>{BO===e&&(BO=null)}}function JO(e){return RO=e,()=>{RO===e&&(RO=null)}}function YO(){return BO?(BO(),!0):!1}function XO(e){return zO=e,()=>{zO===e&&(zO=null)}}function ZO(e){return zO?(zO(e),!0):!1}function QO(e){return GO=e,()=>{GO===e&&(GO=null)}}function $O(e){return RO?(RO(e),!0):!1}function ek(e){return VO=e,()=>{VO===e&&(VO=null)}}function tk(e){return HO=e,()=>{HO===e&&(HO=null)}}function nk(e){return UO=e,()=>{UO===e&&(UO=null)}}function rk(e){return WO=e,()=>{WO===e&&(WO=null)}}var ik=`composer-drop`,ak=/<quote(?: truncated="true" original-lines="(\d+)")?>\n([\s\S]*?)\n<\/quote>/g;function ok(e){return`<quote${e.originalLines?` truncated="true" original-lines="${e.originalLines}"`:``}>\n${e.text.replace(/<\/quote>/g,`<\\/quote>`)}\n</quote>`}function sk(e){let t=e[2].replace(/<\\\/quote>/g,`</quote>`);return e[1]?{text:t,originalLines:Number(e[1])}:{text:t}}function ck(e){return e.search(ak)>=0}function lk(e){return e.replace(ak,(...e)=>{let t=sk(e),n=t.text.replace(/^/gm,`> `);return t.originalLines?`${n}\n> …`:n})}function uk(e){return e.replace(ak,``).trim()||[...e.matchAll(ak)].map(e=>sk(e).text).join(`
167
+ `)}var dk=[{name:`blue`,rgb:[58,150,221],cssVar:`--cursor-blue`},{name:`purple`,rgb:[155,89,182],cssVar:`--cursor-purple`},{name:`green`,rgb:[39,174,96],cssVar:`--cursor-green`},{name:`orange`,rgb:[242,153,74],cssVar:`--cursor-orange`},{name:`cyan`,rgb:[0,184,169],cssVar:`--cursor-cyan`},{name:`magenta`,rgb:[219,68,134],cssVar:`--cursor-magenta`},{name:`red`,rgb:[235,87,87],cssVar:`--cursor-red`},{name:`yellow`,rgb:[170,175,18],cssVar:`--cursor-yellow`}];dk.map(e=>e.name);function fk(e,t){return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`}dk.map(({rgb:e})=>({fill:fk(e,.04),stroke:fk(e,.5),scribbleStroke:fk(e,.92)})),dk.map(({rgb:e})=>({border:fk(e,1),bg:fk(e,.1),hoverBorder:fk(e,.3),hoverBg:fk(e,.02)}));var{PI:pk}=Math;pk+1e-4;var mk=`CSS edits — `;RegExp(`^${mk}.*$`,`m`),RegExp(`^${mk}`,`gm`);var hk=/\n*```browser_element\n[\s\S]*?```(?=\n|$)/g;function gk(e){return e.replace(hk,``).trimEnd()}var _k=/^<unattended>\n([\s\S]*?)\n<\/unattended>(?:\n\n|$)/;function vk(e){let t=_k.exec(e);return t?{note:/unattended mode is off/i.test(t[1])?`off`:`on`,rest:e.slice(t[0].length)}:{rest:e}}var yk=`background-tasks-wrap-up`,bk=RegExp(`^<${yk}>\\n[\\s\\S]*?\\n</${yk}>(?:\\n\\n|$)`),xk=/^- (\S+?): (.*?)(?: \(running ([^()]+)\))?$/;function Sk(e){let t=[];for(let n of e.split(`
168
+ `)){let e=xk.exec(n);e?.[1]&&t.push({taskId:e[1],command:e[2]??``,...e[3]?{ran:e[3]}:{}})}return t}function Ck(e){let t=bk.exec(e);return t?{items:Sk(t[0]),rest:e.slice(t[0].length)}:null}function wk(e){let t=e,n,r,i;for(;;){let a=n?{rest:t}:me(t);if(a.note){n=a.note,t=a.rest;continue}let o=i?null:Ck(t);if(o){let n=e.length-t.length;i={items:o.items,start:n,end:n+t.length-o.rest.length},t=o.rest;continue}let s=r?{rest:t}:vk(t);if(!s.note)break;r=s.note,t=s.rest}return{...n?{plan:n}:{},...r?{unattended:r}:{},wrapUp:i,rest:t}}function Tk(e){let{plan:t,unattended:n,rest:r}=wk(e);return{...t?{plan:t}:{},...n?{unattended:n}:{},rest:r}}function Ek(e){let t=wk(e).wrapUp;return t?{items:t.items}:void 0}function Dk(e){let t=wk(e).wrapUp;return t?e.slice(0,t.start)+e.slice(t.end):e}var Ok=/^\/skill:(\S+)(?:\s+|$)/,kk=/^<skill name="([^"]+)" location="([^"]*)">\n([\s\S]*?)\n<\/skill>(?:\n\n|$)/;function Ak(e){let t=[],n=e;for(let e=Ok.exec(n);e;e=Ok.exec(n))t.push(e[1]),n=n.slice(e[0].length);return{names:t,rest:t.length>0?n.trim():e}}function jk(e){let t=[],n=e;for(let e=kk.exec(n);e;e=kk.exec(n))t.push({name:e[1],location:e[2],body:e[3]}),n=n.slice(e[0].length);return t.length>0?{skills:t,rest:n.trim()}:null}var Mk=/^<workflow-preset name="([^"]*)">\n(\{.*\})\n<\/workflow-preset>(?:\n\n[\s\S]*)?$/,Nk=e=>e.replace(/&(amp|quot|lt|gt);/g,e=>e===`&amp;`?`&`:e===`&quot;`?`"`:e===`&lt;`?`<`:`>`);function Pk(e){let t=Mk.exec(e);if(!t)return null;let n;try{n=JSON.parse(t[2]??``)}catch{return null}if(!n||typeof n!=`object`||Array.isArray(n))return null;let{preset:r,args:i={}}=n;if(typeof r!=`string`||!r||!i||typeof i!=`object`||Array.isArray(i))return null;let a=Object.entries(i);return a.some(([,e])=>typeof e!=`string`)?null:{id:r,name:Nk(t[1]??``),args:a}}var Fk=/\[Referenced past chat "(.+?)" — transcript file: (.+?) \(pi session jsonl; read it if relevant\)\]/g,Ik=/\[Selected UI element "([^"]*)" — path: (.*?); text: (.*?)\]/g;function Lk(e,t){for(let n=t-1;n>=0;n--){let r=e[n];if(r===`@`){let r=n>0?e[n-1]:` `;return r===` `||r===`
169
+ `?e.slice(n+1,t):null}if(r===` `||r===`
170
+ `)return null}return null}function Rk(e){let t=Math.max(0,e.containerWidth-e.popupWidth),n=Math.min(Math.max(0,e.anchorLeft),t);return{left:n,flyoutSide:e.containerWidth-n-e.popupWidth-e.flyoutGap>=e.flyoutWidth?`right`:`left`}}function zk(e){if(e.isComposing||e.itemCount===0)return{type:`none`};let t=e.key===`Enter`&&!e.shiftKey||e.key===`Tab`;if(e.folderOpen){if(e.key===`Escape`||e.key===`ArrowLeft`)return{type:`close-folder`};let n=e.folderItemCount??0;if(n===0)return{type:`none`};let r=e.folderIndex??0;return e.key===`ArrowDown`?{type:`move-folder`,index:(r+1)%n}:e.key===`ArrowUp`?{type:`move-folder`,index:(r-1+n)%n}:t?{type:`pick`}:{type:`none`}}return e.activeIsFolder&&(e.key===`ArrowRight`||t)?{type:`open-folder`}:e.key===`ArrowDown`?{type:`move`,index:(e.activeIndex+1)%e.itemCount}:e.key===`ArrowUp`?{type:`move`,index:(e.activeIndex-1+e.itemCount)%e.itemCount}:t?{type:`pick`}:e.key===`Escape`?{type:`close`}:{type:`none`}}function Bk(e,t){return`[Referenced past chat "${e.replace(/["[\]\n]/g,` `).replace(/\s+/g,` `).trim()||`untitled`}" — transcript file: ${t} (pi session jsonl; read it if relevant)]`}var Vk=/^\[Referenced past chat "(.+)" — transcript file: (.+) \(pi session jsonl; read it if relevant\)\]$/,Hk=/^@(\S.*)$/;function Uk(e){let t=``;return e.forEach((n,r)=>{let i=e[r-1];t+=n.type===`text`?i?.type===`quote`?n.text.replace(/^[\u00a0 ]/,``):n.text:n.type===`quote`?`${t&&!t.endsWith(`
171
+ `)?`
172
+ `:``}${ok(n)}\n`:n.type===`file`?/\s/.test(n.path)&&!n.path.includes(`"`)?`@"${n.path}"`:`@${n.path}`:n.type===`chat`?Bk(n.label,n.sessionFile):vv(n)}),t}function Wk(e,t){Fk.lastIndex=t,Ik.lastIndex=t,ak.lastIndex=t;let n=Fk.exec(e),r=Ik.exec(e),i=ak.exec(e),a=n?{index:n.index,length:n[0].length,segment:{type:`chat`,label:n[1],sessionFile:n[2]}}:null,o=r?bv(r[0]):null,s=r&&o?{index:r.index,length:r[0].length,segment:{type:`ui-element`,id:``,...o,imageId:``}}:null,c=null;if(i){let n=+(i.index>t&&e[i.index-1]===`
173
+ `),r=+(e[i.index+i[0].length]===`
174
+ `);c={index:i.index-n,length:i[0].length+n+r,segment:{type:`quote`,...sk(i)}}}return[c,a,s].filter(e=>e!==null).sort((e,t)=>e.index-t.index)[0]??null}function Gk(e){let t=[],n=0;for(let r of e.matchAll(ak)){let i=r.index??0,a=+(i>n&&e[i-1]===`
175
+ `);i-a>n&&t.push({type:`text`,text:e.slice(n,i-a)}),t.push({type:`quote`,...sk(r)}),n=i+r[0].length,e[n]===`
176
+ `&&(n+=1)}return n<e.length?t.push({type:`text`,text:e.slice(n)}):t.at(-1)?.type===`quote`&&t.push({type:`text`,text:`\xA0`}),t}function Kk(e){let t=[],n=0,r=Wk(e,0);for(;r;){let i=e.slice(n,r.index);for(let e of Qk(i))(e.type!==`text`||e.text!==``)&&t.push(e);t.push(r.segment),n=r.index+r.length,r=Wk(e,n)}let i=e.slice(n);if(i||t.length===0)for(let e of Qk(i))e.type===`text`&&e.text===``&&t.length>0||t.push(e);return t}var qk=/^(?:[A-Za-z]:[\\/])?(?:[\p{L}\p{N}_./\\-]*\.[\w-]{1,16}(?:#L\d+(?:-L\d+)?)?|[\p{L}\p{N}_./\\-]+[\\/])$/u,Jk=/^"([^"\n]*(?:\.[\w-]{1,16}(?:#L\d+(?:-L\d+)?)?|[\\/]))"/,Yk=/#L\d+(?:-L\d+)?$/;function Xk(e){return e.replace(Yk,``)}function Zk(e){return e.replace(/[\\/]+$/,``).split(/[\\/]/).filter(Boolean).at(-1)||e}function Qk(e){return Tv(e).flatMap(e=>e.type===`file`?[e]:$k(e.text))}function $k(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e.indexOf(`@`,r);if(i===-1){n+=e.slice(r);break}let a=i>0?e[i-1]:` `,o=a===` `||a===`
177
+ `?Jk.exec(e.slice(i+1)):null;if(o){n+=e.slice(r,i),n&&=(t.push({type:`text`,text:n}),``),t.push({type:`file`,path:o[1]}),r=i+1+o[0].length;continue}let s=(/^\S*/.exec(e.slice(i+1))?.[0]??``).replace(/[),.;!?]+$/,``);(a===` `||a===`
178
+ `)&&s&&qk.test(s)?(n+=e.slice(r,i),n&&=(t.push({type:`text`,text:n}),``),t.push({type:`file`,path:s}),r=i+1+s.length):(n+=e.slice(r,i+1),r=i+1)}return n&&t.push({type:`text`,text:n}),t.length>0?t:[{type:`text`,text:e}]}function eA(e){let t={body:e,files:[],chats:[]},n=e.split(`
179
+ `),r=[],i=[],a=n.length-1;for(;a>=0;a--){let e=n[a],t=Vk.exec(e);if(t){i.unshift({label:t[1],sessionFile:t[2]});continue}if(Hk.test(e)){r.unshift(e.slice(1));continue}break}return r.length+i.length===0||a<0||n[a].trim()!==``?t:{body:n.slice(0,a).join(`
180
+ `).trimEnd(),files:r,chats:i}}function tA(e){let t=Uk(e.segments).trim(),n=e.segments.filter(e=>e.type!==`text`&&e.type!==`quote`).map(e=>e.type===`file`?{kind:`file`,id:e.path,label:Zk(e.path),relativePath:Xk(e.path)}:e.type===`chat`?{kind:`chat`,id:e.conversationId??e.sessionFile,label:e.label,sessionFile:e.sessionFile}:{kind:`ui-element`,id:e.id,label:e.label,path:e.path,text:e.text,imageId:e.imageId});e.recipient&&n.push(e.recipient);let r=e.slashes.join(` `);return{text:r?t?`${r} ${t}`:r:t,images:e.images.map(({data:e,mimeType:t})=>({data:e,mimeType:t})),mentions:n,...e.recipient?{recipient:e.recipient}:{}}}function nA(e){return e.startsWith(`/skill:`)?`skill`:e===`/goal`?`goal`:`command`}function rA(e){return e.startsWith(`/skill:`)?e.slice(7):e.replace(/^\//,``)}function iA(e){let t=/^\/skill:(\S+)(?:\s+([\s\S]*))?$/.exec(e);if(t)return{slash:`/skill:${t[1]}`,rest:t[2]??``};let n=/^\/([A-Za-z][\w:-]*)(?:\s+([\s\S]*))?$/.exec(e);return n?{slash:`/${n[1]}`,rest:n[2]??``}:{slash:null,rest:e}}var aA={skill:Vn,goal:Jn,command:Wn},oA={skill:`bg-info/15 text-info`,goal:`bg-warning/25 text-warning-foreground dark:bg-warning/15 dark:text-warning`,command:`bg-foreground/10 text-foreground`};function sA(e,t=!1){return W(`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 align-middle text-xs font-medium`,oA[e],t&&e===`skill`&&`hover:bg-info/25`,t&&e===`goal`&&`hover:bg-warning/35 dark:hover:bg-warning/25`,t&&e===`command`&&`hover:bg-foreground/15`)}function cA({name:e,className:t,interactive:n=!1,trailing:r}){let i=nA(e),a=aA[i];return(0,G.jsxs)(`span`,{className:W(sA(i,n),t),children:[(0,G.jsx)(a,{className:`h-3 w-3`}),rA(e),r]})}var lA=e=>e.startsWith(`/skill:`);function uA(e,t){return!lA(t)||!e.every(lA)?[t]:e.includes(t)?[...e]:[...e,t]}function dA(e){let t=Ak(e);if(t.names.length>0)return{slashes:t.names.map(e=>`/skill:${e}`),rest:t.rest};let n=iA(e);return{slashes:n.slash?[n.slash]:[],rest:n.rest}}function fA(e,t,n=!1){let r=e.segments.some(e=>e.type!==`text`||e.text.length>0);if(n&&(r||e.slashes.length>0))return{slashes:e.slashes,segments:[...e.segments,...t.text?Gk(`${r?`
181
+
182
+ `:``}${t.text}`):[]],images:[...e.images,...t.images??[]]};let i=dA(t.text??``);return{slashes:i.slashes,segments:i.rest?Gk(i.rest):[],images:[...n?e.images:[],...t.images??[]]}}var pA={"agent-type":`bg-purple-500/15 text-purple-600 dark:text-purple-400`,file:`bg-success/15 text-success`,chat:`bg-warning/25 text-warning-foreground dark:bg-warning/15 dark:text-warning`,"ui-element":`bg-purple-500/15 text-purple-600 dark:text-purple-400`};function mA(e){return W(`inline-flex max-w-52 items-center gap-1 rounded-md px-1.5 py-0.5 align-middle text-xs font-medium`,pA[e])}function hA({label:e,onRemove:t}){return(0,G.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-sm opacity-70 transition-opacity hover:opacity-100`,"aria-label":e,children:(0,G.jsx)(nr,{className:`h-3 w-3`})})}function gA({recipient:e,onRemove:t}){let{t:n}=K();return(0,G.jsxs)(`span`,{className:W(mA(`agent-type`),`mt-0.5 shrink-0`),children:[(0,G.jsx)(dt,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:e.label}),(0,G.jsx)(hA,{label:n(`Remove Agent recipient`),onRemove:t}),(0,G.jsx)(`span`,{className:`sr-only`,children:e.typeKey})]})}var _A=2e4,vA=3,yA=/^```/gm,bA=/^```/;function xA(e){return e.split(`
183
+ `).filter(e=>!bA.test(e)).length}function SA(e){let t=e.replace(/\r\n?/g,`
184
+ `).replace(/^\n+|\s+$/g,``);if(!t.trim())return null;let n=t.split(`
185
+ `),r=xA(t);if(r<=200&&t.length<=2e4)return{type:`quote`,text:t};let i=0;for(let e=0;i<n.length&&!(!bA.test(n[i])&&++e>200);i++);let a=n.slice(0,i).join(`
186
+ `).slice(0,_A);return(a.match(yA)?.length??0)%2==1&&(a+="\n```"),{type:`quote`,text:a,originalLines:r}}function CA(e){let t=e.split(`
187
+ `);return t.length<=vA?{preview:e,clipped:!1}:{preview:t.slice(0,vA).join(`
188
+ `),clipped:!0}}function wA(e){let t=[],n=0;for(let r of e.matchAll(/^```[^\n]*\n([\s\S]*?)\n?^```[ \t]*$/gm)){let i=e.slice(n,r.index).replace(/^\n|\n$/g,``);i&&t.push({type:`text`,text:i}),t.push({type:`code`,code:r[1]}),n=r.index+r[0].length}let r=e.slice(n).replace(/^\n/,``);return(r||t.length===0)&&t.push({type:`text`,text:r}),t}var TA=`[data-enso="code-block"]`,EA=`[data-quote-skip]`,DA=new Set([`P`,`DIV`,`LI`,`UL`,`OL`,`TR`,`TABLE`,`BLOCKQUOTE`,`H1`,`H2`,`H3`,`H4`,`H5`,`H6`,`PRE`]);function OA(e){return e?e.nodeType===1?e:e.parentElement:null}function kA(e,t){return`\`\`\`${t??``}\n${e.replace(/\n+$/,``)}\n\`\`\``}function AA(e){if(e.nodeType===3)return e.textContent??``;if(e.nodeType!==1&&e.nodeType!==11)return``;let t=e.nodeType===1?e:null;if(t?.tagName===`BUTTON`||t?.matches(EA))return``;if(t?.tagName===`BR`)return`
189
+ `;if(t?.matches(TA))return`\n${kA(t.querySelector(`pre`)?.textContent??t.textContent??``,t.getAttribute(`data-language`)??void 0)}\n`;let n=[...e.childNodes].map(AA).join(``);return t&&DA.has(t.tagName)?`${n}\n`:n}function jA(e,t){if(!e||e.rangeCount===0||e.isCollapsed)return null;let n=OA(e.anchorNode),r=OA(e.focusNode);if(!n||!r||!t.contains(n)||!t.contains(r))return null;let i=n.closest(`[data-nav-key]`);if(!i||i!==r.closest(`[data-nav-key]`))return null;let a=e.toString();if(!a.trim())return null;let o=e.getRangeAt(0),s=OA(o.commonAncestorContainer)?.closest(TA);if(s)return kA(a,s.getAttribute(`data-language`)??void 0);let c=o.cloneContents();return c.querySelector(`${TA}, ${EA}`)?AA(c).replace(/\n{3,}/g,`
190
+
191
+ `).trim():a}var MA=8,NA=6;function PA(e,t,n,r,i=[]){let a=(e,t)=>Math.min(Math.max(MA,e),t),o=t.height-n.height-MA,s=t.width-n.width-MA,c=e.top-n.height-NA,l=e.bottom+NA,u=a((e.left+e.right)/2-n.width/2,s),d=(r?[l,c]:[c,l]).filter(e=>e>=MA&&e<=o),f=(e,t)=>i.find(r=>t<r.right&&t+n.width>r.left&&e<r.bottom&&e+n.height>r.top),p=d.map(e=>({top:e,left:u}));for(let e of d){let t=f(e,u);t&&p.push({top:e,left:t.right+NA},{top:e,left:t.left-n.width-NA})}let m=a((e.top+e.bottom)/2-n.height/2,o);return p.push({top:m,left:e.right+NA},{top:m,left:e.left-n.width-NA}),p.find(({top:e,left:t})=>e>=MA&&e<=o&&t>=MA&&t<=s&&!f(e,t))||{top:a(r||c<MA?l:c,o),left:u}}function FA(e,t){return/(?:^|\s)\$([^\s$]*)$/.exec(e.slice(0,t))?.[1]??null}function IA(e){let t=new Set,n=[];for(let r of e){let e=r.name.trim().toLowerCase();!e||t.has(e)||(t.add(e),n.push(r))}return n}function LA(e,t,n){let r=n??t;if(r===null)return[];let i=r.toLowerCase();return IA(e.filter(e=>n===null?e.name.toLowerCase().includes(i):e.name.startsWith(`/skill:`)&&e.name.slice(7).toLowerCase().includes(i))).slice(0,10)}var RA={file:`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/></svg>`,chat:`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/></svg>`,"ui-element":`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 3a2 2 0 0 0-2 2"/><path d="M19 3a2 2 0 0 1 2 2"/><path d="M21 19a2 2 0 0 1-2 2"/><path d="M5 21a2 2 0 0 1-2-2"/><path d="M9 3h1"/><path d="M9 21h1"/><path d="M14 3h1"/><path d="M14 21h1"/><path d="M3 9v1"/><path d="M21 9v1"/><path d="M3 14v1"/><path d="M21 14v1"/></svg>`},zA=`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>`,BA={file:`bg-success/15 text-success`,chat:`bg-warning/25 text-warning-foreground dark:bg-warning/15 dark:text-warning`,"ui-element":`bg-purple-500/15 text-purple-600 dark:text-purple-400`},VA=`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/><path d="M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/></svg>`;function HA(e,t){let n=e.dataset.text??``,r=e.dataset.expanded===`true`,{preview:i,clipped:a}=CA(n),o=e.querySelector(`[data-quote-body]`);if(o&&(o.textContent=r?n:a?`${i}\n…`:i,o.className=W(`mt-0.5 block whitespace-pre-wrap break-words text-foreground/80`,r?`max-h-32 overflow-y-auto overscroll-contain`:`max-h-16 overflow-hidden`)),e.querySelector(`[data-quote-toggle]`)?.remove(),!r&&a){let n=document.createElement(`span`);n.dataset.quoteToggle=``,n.className=`shrink-0 text-muted-foreground/80`,n.textContent=t.expand,e.querySelector(`[data-quote-remove]`)?.before(n)}}function UA(e,t){let n=document.createElement(`span`);n.contentEditable=`false`,n.dataset.mentionKind=`quote`,n.dataset.text=e.text,e.originalLines&&(n.dataset.originalLines=String(e.originalLines)),n.className=`my-1 block cursor-pointer rounded-md border-l-2 border-brand/50 bg-muted/60 px-2 py-1 text-xs select-none`;let r=document.createElement(`span`);r.className=`flex items-center gap-1.5 text-muted-foreground`;let i=document.createElement(`span`);i.className=`shrink-0 inline-flex`,i.innerHTML=VA;let a=document.createElement(`span`);if(a.className=`min-w-0 flex-1 truncate`,a.textContent=t.title(xA(e.text)),r.append(i,a),e.originalLines){let n=document.createElement(`span`);n.dataset.quoteTruncated=``,n.className=`shrink-0 rounded bg-warning/20 px-1 text-warning-foreground dark:text-warning`,n.textContent=t.truncated(e.originalLines),r.appendChild(n)}let o=document.createElement(`button`);o.type=`button`,o.dataset.quoteRemove=``,o.setAttribute(`aria-label`,t.remove),o.className=`shrink-0 rounded-sm px-1 opacity-70 hover:opacity-100`,o.textContent=`×`,r.appendChild(o);let s=document.createElement(`span`);return s.dataset.quoteBody=``,n.append(r,s),HA(n,t),n}function WA(e,t){if(e.type===`quote`)return UA(e,t);let n=document.createElement(`span`);n.contentEditable=`false`,n.dataset.mentionKind=e.type,e.type===`file`?(n.dataset.path=e.path,e.label&&(n.dataset.label=e.label),n.title=e.path):e.type===`chat`?(n.dataset.label=e.label,n.dataset.sessionFile=e.sessionFile,e.conversationId&&(n.dataset.conversationId=e.conversationId)):(n.dataset.id=e.id,n.dataset.label=e.label,n.dataset.path=e.path,n.dataset.text=e.text,n.dataset.imageId=e.imageId,n.title=`${e.path}${e.text?` · ${e.text}`:``}`),n.className=W(`mx-0.5 inline-flex max-w-52 items-center gap-1 rounded-md px-1.5 py-0.5 align-middle text-xs font-medium leading-4 select-none`,BA[e.type]);let r=document.createElement(`span`);r.className=`shrink-0 inline-flex`,r.innerHTML=e.type===`file`&&/[\\/]$/.test(e.path)?zA:RA[e.type],n.appendChild(r);let i=document.createElement(`span`);return i.className=`truncate`,i.textContent=e.type===`file`?e.label??Zk(e.path):e.label,n.appendChild(i),n}function GA(e){if(e.dataset.mentionKind===`quote`&&e.dataset.text){let t=Number(e.dataset.originalLines);return{type:`quote`,text:e.dataset.text,...t>0?{originalLines:t}:{}}}return e.dataset.mentionKind===`file`&&e.dataset.path?{type:`file`,path:e.dataset.path,...e.dataset.label?{label:e.dataset.label}:{}}:e.dataset.mentionKind===`chat`&&e.dataset.label&&e.dataset.sessionFile?{type:`chat`,label:e.dataset.label,sessionFile:e.dataset.sessionFile,...e.dataset.conversationId?{conversationId:e.dataset.conversationId}:{}}:e.dataset.mentionKind===`ui-element`&&e.dataset.label&&e.dataset.path&&e.dataset.text?{type:`ui-element`,id:e.dataset.id??``,label:e.dataset.label,path:e.dataset.path,text:e.dataset.text,imageId:e.dataset.imageId??``}:null}function KA(e){let t=[],n=e=>{if(!e)return;let n=t.at(-1);n?.type===`text`?n.text+=e:t.push({type:`text`,text:e})},r=e=>{if(e.nodeType===Node.TEXT_NODE){n(e.textContent??``);return}if(e instanceof HTMLElement){if(e.dataset.mentionKind){let n=GA(e);n&&t.push(n);return}if(e.tagName===`BR`){n(`
192
+ `);return}(e.tagName===`DIV`||e.tagName===`P`)&&t.length>0&&n(`
193
+ `);for(let t of e.childNodes)r(t)}};for(let t of e.childNodes)r(t);return t}function qA(e){let t=window.getSelection();if(!t||t.rangeCount===0||!t.isCollapsed)return null;let{anchorNode:n,anchorOffset:r}=t;return!n||!e.contains(n)||n.nodeType!==Node.TEXT_NODE?null:{node:n,offset:r}}function JA(e,t){if(t.rangeCount===0||!t.isCollapsed)return null;let{anchorNode:n,anchorOffset:r}=t;if(!n||n.nodeType===Node.TEXT_NODE||n!==e&&!e.contains(n))return null;let i=n.childNodes,a=i[r],o=r>0?i[r-1]:void 0,s=a?.nodeType===Node.TEXT_NODE?{node:a,offset:0}:o?.nodeType===Node.TEXT_NODE?{node:o,offset:o.length}:null;if(!s)return null;let c=document.createRange();return c.setStart(s.node,s.offset),c.collapse(!0),c}function YA(e){return e instanceof HTMLElement&&!!e.dataset.mentionKind}function XA(e){return e instanceof Text&&!/[^\s\u00a0]/.test(e.textContent??``)}function ZA(e,t){let n=window.getSelection();if(!n||n.rangeCount===0||!n.isCollapsed)return null;let{anchorNode:r,anchorOffset:i}=n;if(!r||!e.contains(r))return null;if(r.nodeType===Node.TEXT_NODE){let e=r.textContent??``;if(t===`before`){if(/[^\s\u00a0]/.test(e.slice(0,i)))return null;let t=r.previousSibling;for(;XA(t);)t=t.previousSibling;return YA(t)?t:null}if(/[^\s\u00a0]/.test(e.slice(i)))return null;let n=r.nextSibling;for(;XA(n);)n=n.nextSibling;return YA(n)?n:null}let a=r.childNodes;if(t===`before`){let e=i-1;for(;e>=0&&XA(a[e]);)--e;let t=e>=0?a[e]:null;return YA(t)?t:null}let o=i;for(;o<a.length&&XA(a[o]);)o+=1;let s=a[o];return YA(s)?s:null}function QA(e,t){let n=e.nextSibling;XA(n)&&n.remove();let r=e.previousSibling;if(e.remove(),r){$A(r);return}let i=window.getSelection();if(!i)return;let a=document.createRange();a.setStart(t,0),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}function $A(e){let t=window.getSelection();if(!t)return;let n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}var ej=(0,H.forwardRef)(function({placeholder:e,disabled:t,className:n,onStateChange:r,onKeyDown:i,onPaste:a,onPasteText:o,onCompositionStart:s,onCompositionEnd:c,onChipActivate:l,ariaProps:u},d){let{t:f}=K(),p=(0,H.useRef)(null),m={title:e=>f(`Quote · {{count}} lines`,{count:e}),truncated:e=>f(`Truncated · original {{count}} lines`,{count:e}),expand:f(`Click to expand`),remove:f(`Remove quote`)},h=(0,H.useRef)(m);h.current=m;let g=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=e=>{let t=e.target;for(let e of p.current?.querySelectorAll(`[data-mention-kind="quote"][data-expanded]`)??[])t&&e.contains(t)||(delete e.dataset.expanded,HA(e,h.current))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]),(0,H.useEffect)(()=>{let e=()=>{let e=p.current;if(!e||document.activeElement!==e)return;let t=window.getSelection();if(!t||t.rangeCount===0||!t.isCollapsed)return;let n=t.anchorNode;if(n&&(n===e||e.contains(n))){let r=JA(e,t);r?(t.removeAllRanges(),t.addRange(r)):n.nodeType===Node.TEXT_NODE&&(g.current={node:n,offset:t.anchorOffset});return}let r=g.current,i=document.createRange();r?.node.isConnected&&e.contains(r.node)?(i.setStart(r.node,Math.min(r.offset,r.node.length)),i.collapse(!0)):(i.selectNodeContents(e),i.collapse(!0)),t.removeAllRanges(),t.addRange(i)};return document.addEventListener(`selectionchange`,e),()=>document.removeEventListener(`selectionchange`,e)},[]);let _=(0,H.useCallback)(()=>{let e=p.current;if(!e)return;let t=KA(e),n=t.map(e=>e.type===`text`?e.text:``).join(``),i=t.some(e=>e.type!==`text`),a=null,o=null,s=null,c=null,l=qA(e);if(l){let t=l.node.textContent?.slice(0,l.offset)??``;a=Lk(t,t.length),a===null&&(s=FA(t,t.length)),a===null&&s===null&&(c=AO(t)),a===null&&l.node===e.firstChild&&/^\/[^\s]*$/.test(t)&&(o=t.slice(1))}r({plainText:n,hasMentions:i,segments:t,mentionQuery:a,slashQuery:o,skillQuery:s,pluginQuery:c})},[r]),v=(0,H.useCallback)(e=>{let t=p.current;if(!t)return null;let n=qA(t);if(!n)return null;let r=n.node.textContent?.slice(0,n.offset)??``;if(e===`#`){let e=AO(r);return e===null?null:{node:n.node,start:r.length-e.length-1,end:n.offset}}if(e===`@`||e===`$`){let t=e===`@`?Lk(r,r.length):FA(r,r.length);return t===null?null:{node:n.node,start:r.length-t.length-1,end:n.offset}}return n.node!==t.firstChild||!/^\/[^\s]*$/.test(r)?null:{node:n.node,start:0,end:n.offset}},[]),y=(0,H.useCallback)((e,t)=>{let n=p.current;if(!n)return;n.focus();let r=document.createRange(),i=t?v(`@`):null;if(i)r.setStart(i.node,i.start),r.setEnd(i.node,i.end),r.deleteContents();else{let e=qA(n);e?(r.setStart(e.node,e.offset),r.collapse(!0)):(r.selectNodeContents(n),r.collapse(!1))}let a=e();r.insertNode(a);let o=document.createTextNode(`\xA0`);a.parentNode?.insertBefore(o,a.nextSibling),$A(o),_()},[v,_]);return(0,H.useImperativeHandle)(d,()=>({focus:()=>p.current?.focus(),isEmpty:()=>{let e=p.current;return!e||!KA(e).some(e=>e.type!==`text`||e.text.trim().length>0)},getSegments:()=>p.current?KA(p.current):[],setSegments:e=>{let t=p.current;if(t){t.textContent=``;for(let n of e)n.type===`text`?t.appendChild(document.createTextNode(n.text)):t.appendChild(WA(n,h.current));_()}},clear:()=>{let e=p.current;e&&(e.textContent=``,_())},insertMention:e=>{let t=e.kind===`file`?{type:`file`,path:e.relativePath}:e.kind===`chat`?{type:`chat`,label:e.label,sessionFile:e.sessionFile,conversationId:e.id}:{type:`ui-element`,id:e.id,label:e.label,path:e.path,text:e.text,imageId:e.imageId};y(()=>WA(t,h.current),e.kind!==`ui-element`)},consumeToken:e=>{let t=v(e);if(!t)return;let n=document.createRange();n.setStart(t.node,t.start),n.setEnd(t.node,t.end),n.deleteContents(),_()},insertFileChip:(e,t)=>{y(()=>WA({type:`file`,path:e,...t?{label:t}:{}},h.current),!1)},insertText:e=>{y(()=>document.createTextNode(e),!1)},insertQuote:e=>{let t=p.current;if(!t)return;let n=document.createTextNode(`\xA0`);t.append(WA(e,h.current),n),t.focus(),window.getSelection()?.collapse(n,n.length),t.scrollTop=t.scrollHeight,_()},getMentionAnchorRect:()=>{let e=v(`@`);if(!e)return null;let t=document.createRange();return t.setStart(e.node,e.start),t.setEnd(e.node,Math.min(e.start+1,e.node.length)),t.getBoundingClientRect()}}),[v,_,y]),(0,G.jsx)(`div`,{ref:p,contentEditable:!t,role:u?.role??`textbox`,"aria-placeholder":e,"data-placeholder":e,...u,onInput:_,onKeyDown:e=>{if(!e.nativeEvent.isComposing&&(e.key===`Backspace`||e.key===`Delete`)){let t=p.current,n=t&&ZA(t,e.key===`Backspace`?`before`:`after`);if(n&&t){e.preventDefault(),QA(n,t),_();return}}i(e)},onClick:e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`[data-mention-kind]`);if(!(n instanceof HTMLElement)||!p.current?.contains(n))return;if(n.dataset.mentionKind===`quote`){t.closest(`[data-quote-remove]`)?(QA(n,p.current),_()):n.dataset.expanded!==`true`&&(n.dataset.expanded=`true`,HA(n,h.current));return}if(!l)return;let r=GA(n);r&&l(r)},onKeyUp:e=>{e.key!==`Escape`&&_()},onMouseUp:_,onPaste:e=>{if(e.clipboardData.files.length>0){a(e);return}e.preventDefault();let t=e.clipboardData.getData(`text/plain`);t&&(o?.(t)||document.execCommand(`insertText`,!1,t))},onCompositionStart:s,onCompositionEnd:()=>{c(),_()},className:W(`max-h-40 min-h-10 min-w-0 flex-1 overflow-y-auto pt-0.5 text-sm break-words whitespace-pre-wrap outline-none`,`empty:before:pointer-events-none empty:before:text-muted-foreground empty:before:content-[attr(data-placeholder)]`,t&&`opacity-60`,n)})}),tj=Xr(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:after:absolute [button,a&]:pointer-coarse:after:size-full [button,a&]:pointer-coarse:after:min-h-11 [button,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-[calc(var(--radius-sm)-2px)] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white [button,a&]:hover:bg-destructive/90`,error:`bg-destructive/12 text-destructive dark:bg-destructive/16`,info:`bg-info/12 text-info dark:bg-info/16`,outline:`border-border bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48`,secondary:`bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90`,success:`bg-success/12 text-success dark:bg-success/16`,warning:`bg-warning/12 text-warning-foreground dark:bg-warning/16`}}});function nj({className:e,variant:t,size:n,render:r,...i}){return Gr({defaultTagName:`span`,props:or({className:W(tj({className:e,size:n,variant:t})),"data-slot":`badge`},i),render:r})}var rj=/[\\/]/;function ij(e){return e.split(rj).filter(e=>e.length>0)}function aj(e){let t=new Map,n=e.map(ij),r=n.map(e=>e.join(`/`));for(let i=0;i<e.length;i++){let a=e[i],o=n[i]??[],s=Math.max(0,o.length-3);for(;s>0;){let e=o.slice(s).join(`/`);if(!r.some(t=>t!==r[i]&&(t===e||t.endsWith(`/${e}`))))break;s--}let c=o.slice(s).join(`/`);t.set(a,s>0?`…/${c}`:c)}return t}function oj({groups:e,query:t,activeIndex:n,onActiveIndexChange:r,openFolderId:i,folderIndex:a,onOpenFolderIdChange:o,onFolderIndexChange:s,onSelect:c,id:l=`composer-mention-picker`,left:u=0,flyoutSide:d=`right`}){let{t:f}=K(),p=ZD(),m=(0,H.useMemo)(()=>VD(e,t),[e,t]),h=(0,H.useMemo)(()=>aj(e.files.map(e=>e.relativePath)),[e.files]),g=(0,H.useRef)(new Map),_=(0,H.useRef)(new Map),v=m[0]?.type===`folder`;if((0,H.useEffect)(()=>{g.current.get(n)?.scrollIntoView({block:`nearest`})},[n]),(0,H.useEffect)(()=>{i&&_.current.get(a)?.scrollIntoView({block:`nearest`})},[i,a]),m.length===0)return null;let y={agents:f(`Agents`),members:f(`Members`),chats:f(`Chats`)},b={agents:dt,members:$n,chats:An},x=i?e[i]:[],S=0,C=()=>x.map((e,t)=>(0,G.jsx)(sj,{ref:e=>{e?_.current.set(t,e):_.current.delete(t)},id:`${l}-sub-${t}`,candidate:e,active:t===a,onHover:()=>s(t),onSelect:()=>c(e)},`sub:${e.id}`)),w=!!(p&&i&&x.length>0),T=e=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-slot":`mention-sheet-back`,onClick:()=>o(null),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,children:[(0,G.jsx)(vt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 font-medium`,children:y[e]})]}),C()]}),E=(t,i)=>{let a=e[t];if(a.length===0)return null;let s=t===`files`?f(`Files`):y[t];return(0,G.jsxs)(`div`,{role:`group`,"aria-label":s,children:[(0,G.jsx)(`p`,{className:W(`px-2 pb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,i?`pt-2`:`pt-1.5`),children:s}),a.map(e=>{let i=S++;return(0,G.jsx)(sj,{ref:e=>{e?g.current.set(i,e):g.current.delete(i)},id:`${l}-option-${i}`,candidate:e,active:i===n,pathLabel:e.kind===`file`?h.get(e.relativePath):void 0,onHover:()=>{r(i),v&&o(null)},onSelect:()=>c(e)},`${t}:${e.id}`)})]})};return(0,G.jsxs)(`div`,{"data-slot":`mention-picker`,className:p?`absolute inset-x-0 bottom-full z-10 mb-1.5 w-full`:`absolute bottom-full z-10 mb-1.5 max-w-full`,style:p?void 0:{left:u},children:[(0,G.jsx)(`div`,{id:l,role:`listbox`,"aria-label":f(`Mention suggestions`),className:p?`max-h-[50dvh] w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`:`max-h-72 w-80 max-w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:w&&i?T(i):v?(0,G.jsxs)(G.Fragment,{children:[m.filter(e=>e.type===`folder`).map(e=>{let t=S++,a=b[e.id];return(0,G.jsxs)(`button`,{ref:e=>{e?g.current.set(t,e):g.current.delete(t)},id:`${l}-option-${t}`,type:`button`,role:`option`,"aria-selected":n===t,onClick:()=>{r(t),o(e.id),s(0)},onMouseMove:()=>{r(t),!p&&i!==e.id&&(o(e.id),s(0))},className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,n===t&&`bg-foreground/10`),children:[(0,G.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,G.jsx)(a,{className:`h-3.5 w-3.5 text-muted-foreground`})}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 font-medium`,children:y[e.id]}),(0,G.jsx)(_t,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]},`folder:${e.id}`)}),E(`files`,!0)]}):(0,G.jsxs)(G.Fragment,{children:[E(`agents`,!1),E(`members`,e.agents.length>0),E(`chats`,e.agents.length+e.members.length>0),E(`files`,e.agents.length+e.members.length+e.chats.length>0)]})}),!p&&i&&x.length>0&&(0,G.jsx)(`div`,{role:`listbox`,"aria-label":y[i],"data-slot":`mention-flyout`,className:W(`absolute top-0 z-20 max-h-72 w-72 overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,d===`right`?`left-full ml-1`:`right-full mr-1`),children:C()})]})}function sj({ref:e,id:t,candidate:n,active:r,pathLabel:i,onHover:a,onSelect:o}){let{t:s}=K(),c=cj(n),l=n.kind===`agent-type`?n.source===`bot`?$n:dt:n.kind===`chat`?An:c?Gt:Vt;return(0,G.jsxs)(`button`,{ref:e,id:t,type:`button`,role:`option`,"aria-selected":r,onClick:o,onMouseMove:a,className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,r&&`bg-foreground/10`),children:[(0,G.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,G.jsx)(l,{className:`h-3.5 w-3.5 text-muted-foreground`})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:n.label}),(0,G.jsx)(nj,{variant:`outline`,className:`px-1 py-0 text-[9px]`,children:n.kind===`agent-type`?s(n.source===`system`?`System`:n.source===`builtin`?`Built-in`:n.source===`bot`?`Member`:`Custom`):n.kind===`chat`?s(`Chat`):s(c?`Folder`:`File`)}),n.kind===`agent-type`&&n.locked&&(0,G.jsx)(nj,{variant:`secondary`,className:`px-1 py-0 text-[9px]`,children:s(`Locked`)})]}),(0,G.jsx)(`span`,{className:W(`block text-muted-foreground`,n.kind===`file`?`whitespace-normal break-all`:`truncate`),title:n.kind===`file`?n.relativePath:void 0,children:n.kind===`agent-type`?n.source===`bot`?n.description:s(n.description):n.kind===`chat`?n.sessionFile.split(`/`).at(-1):n.kind===`file`?i??n.relativePath:n.path})]})]})}function cj(e){return e.kind===`file`&&/[\\/]$/.test(e.relativePath)}var lj=[`on`,`off`],uj=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`];function dj(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function fj(e){return typeof e==`string`&&lj.includes(e)}function pj(e){return typeof e==`string`&&uj.includes(e)}function mj(e){if(!e)return{};let t={};fj(e.reasoning)&&(t.reasoning=e.reasoning),pj(e.thinkingLevel)&&(t.thinkingLevel=e.thinkingLevel);let n=dj(e.contextWindow);n!==void 0&&(t.contextWindow=n);let r=dj(e.maxTokens);return r!==void 0&&(t.maxTokens=r),t}var hj=e=>{let t=e.indexOf(`#`);return t===-1?e:e.slice(0,t)},gj=`enso-virtual`;function _j(e){return e?.providerId===gj}function vj(e,t){if(!(!t||!_j(t)))return e?.find(e=>e.id===t.modelId)}function yj(e,t){return e?.find(e=>e.id===t)?.name??t}new Set(Object.values({"openrouter.ai":`openrouter`,"opencode.ai":`opencode`,"ai-gateway.vercel.sh":`vercel-ai-gateway`,"api.typesafe.ai":`typesafe`}));function bj(e,t){if(e===void 0)return t.map(e=>({...e}));let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e){let e=n.get(t.id);n.delete(t.id);let i={id:t.id};t.label!==void 0&&(i.label=t.label),e&&(e.label!==void 0&&(i.label=e.label),e.enabled!==void 0&&(i.enabled=e.enabled),e.imageGeneration!==void 0&&(i.imageGeneration=e.imageGeneration),Object.assign(i,mj(e))),r.push(i)}for(let e of n.values())r.push({...e});return r}function xj(e,t){if(!t)return[...e];let n=new Map(t.providers.map(e=>[e.key,e]));return e.map(e=>{if(!e.oauthAccountKey)return e;let t=n.get(hj(e.oauthAccountKey));return t?{...e,models:bj(t.models,e.models)}:e})}var Sj=H.createContext(void 0);function Cj(e){let t=H.useContext(Sj);if(t===void 0&&!e)throw Error(xr(33));return t}var wj=H.createContext(void 0);function Tj(e){let t=H.useContext(wj);if(t===void 0&&!e)throw Error(xr(36));return t}var Ej=H.createContext(void 0);function Dj(e=!0){let t=H.useContext(Ej);if(t===void 0&&!e)throw Error(xr(25));return t}var Oj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Tj(),s=o.useState(`open`),c=o.useState(`mounted`),l=o.useState(`transitionStatus`),u=o.useState(`lastOpenChangeReason`),d=Dj(),f={open:s,transitionStatus:l};return zr(`div`,e,{ref:d?.backdropRef?[t,d.backdropRef]:t,state:f,stateAttributesMapping:uy,props:[{role:`presentation`,hidden:!c,style:{pointerEvents:u===`trigger-hover`?`none`:void 0,userSelect:`none`,WebkitUserSelect:`none`}},a]})});function kj({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=H.useRef(e!==void 0),[a,o]=H.useState(t);return[i?e:a,H.useCallback(e=>{i||o(e)},[])]}function Aj(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=Dj(!0),f=d!==void 0;return H.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Yy})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!xb&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&Hy(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var jj={type:`regular-item`};function Mj(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=H.useRef(null),{getButtonProps:d,buttonRef:f}=Uy({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Aj({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=H.useCallback(e=>or(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=wr(u,f);return H.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Nj=H.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Pj(){return H.useContext(Nj)}function Fj(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Pj(),u=H.useRef(-1),[d,f]=H.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=H.useRef(null),h=H.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Ij=H.createContext(void 0);function Lj(){let e=H.useContext(Ij);if(e===void 0)throw Error(xr(31));return e}var Rj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=H.useState(void 0),c=zr(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,G.jsx)(Ij.Provider,{value:s,children:c})}),zj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ob(a),c=Lj();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),zr(`div`,e,{ref:t,props:{id:s,role:`presentation`,...o}})}),Bj=H.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Fj({guess:!0,label:a}),f=Cj(!0),p=ob(i),{store:m}=Tj(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=Mj({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:jj});return zr(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),Vj=H.createContext(void 0);function Hj(e){let t=H.useContext(Vj);if(t===void 0&&!e)throw Error(xr(69));return t}var Uj=H.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Tj(),{side:c,align:l}=Cj(),u=Hj(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;Fw({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),H.useEffect(()=>{function e(e){s.setOpen(!1,tb(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),dT(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=zr(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:uy,props:[p,{onKeyDown(e){u&&NT.has(e.key)&&e.stopPropagation()}},PD(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,G.jsx)(cC,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})}),Wj=H.createContext(void 0);function Gj(){let e=H.useContext(Wj);if(e===void 0)throw Error(xr(32));return e}var Kj=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Tj();return i.useState(`mounted`)||n?(0,G.jsx)(Wj.Provider,{value:n,children:(0,G.jsx)(US,{ref:t,...r})}):null});function qj(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=zy(i),[,o]=H.useState(!1),s=Cr(Yj).current,c=Cr(Jj).current,l=H.useRef(0),u=H.useRef(!0),d=H.useRef([]),f=H.useRef(null),p=zy(()=>{u.current||(u.current=!0,o(e=>!e))}),m=zy((e,t)=>{c.set(e,t),p()}),h=zy(e=>{c.delete(e),p()}),g=zy(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Qj(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&$j(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Zj(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=zy(()=>{let[e,t]=Xj(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});Y(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=zy(e=>(s.add(e),()=>{s.delete(e)})),b=H.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,G.jsx)(Nj.Provider,{value:b,children:t})}function Jj(){return new Map}function Yj(){return new Set}function Xj(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>$j(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Zj(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Qj(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function $j(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var eM=20;function tM(e,t,n,r){let[i,a]=H.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=Vy(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-eM)},[e,t,n]),YT(e&&(!t||i),r)}var nM=H.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=IS,style:g,..._}=e,{store:v}=Tj(),y=Gj(),b=Dj(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),ee=H.useRef(null),L=Pw(A),te=n,R=c,z=l,ne=s,re=h;x.type===`context-menu`&&(te=n??x.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(z=e.alignOffset??2,R=e.sideOffset??-5));let B=o,ie=ne;x.type===`menu`?(B??=`inline-end`,ie??=`start`,re=e.collisionAvoidance??LS):x.type===`menubar`&&(B??=x.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=x.type===`context-menu`,oe=jD({anchor:te,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:B,sideOffset:R,align:ie,alignOffset:z,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:re,shift:ae?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});H.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,tb($y)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),H.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,tb(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let se=db();H.useEffect(()=>{T||se.clear()},[T,se]),H.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`))){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?se.isStarted()||se.start(e,()=>{v.setOpen(!1,tb($y))}):v.setOpen(!1,tb($y))}else se.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,se]),H.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Y(()=>{let e=I,t=ee.current;if(e&&(ee.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return L(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,L,v]);let V={open:T,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:x.type===`menu`,instant:j},ce=x.type===`menubar`&&x.context.modal;tM(T&&(ce||E&&N!==`trigger-hover`),D===`touch`,A,O);let le=FD(e,V,{styles:oe.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ue=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),de=null;return x.type===`menubar`?de=x.context.contentElement:x.type===void 0&&(de=O),(0,G.jsxs)(Sj.Provider,{value:oe,children:[ue&&(0,G.jsx)(LT,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:IT(!T),cutout:de}),(0,G.jsx)(ZS,{id:P,children:(0,G.jsx)(qj,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:le})})]})}),rM=H.createContext(null);function iM(e){let t=H.useContext(rM);if(t===null&&!e)throw Error(xr(5));return t}var aM={...eT,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},oM=class extends Aw{constructor(e){super({...cM(),...e},sM(),aM),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function sM(){return{positionerRef:H.createRef(),popupRef:H.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:H.createRef(),beforeContentFocusGuardRef:H.createRef(),onOpenChangeComplete:void 0,triggerElements:new qw}}function cM(){return{...Jw(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new GS,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Fr,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var lM=H.createContext(void 0);function uM(){return H.useContext(lM)}var dM=Ew(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Dj(!0),_=Tj(!0),v=iM(!0),y=uM(),b=H.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=fM({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=ab(),C=ab(),w=x.useState(`floatingTreeRoot`),T=XS(w),E=JS(),D=x.useState(`open`),O=x.useState(`activeTriggerElement`),k=x.useState(`positionerElement`),A=x.useState(`hoverEnabled`),j=x.useState(`disabled`),M=x.useState(`lastOpenChangeReason`),N=x.useState(`parent`),P=x.useState(`activeIndex`),F=x.useState(`payload`),I=x.useState(`floatingParentNodeId`),ee=H.useRef(null),L=H.useRef(N.type!==`context-menu`),te=db(),R=H.useRef(!0),z=db(),ne=I!=null,{openMethod:re,triggerProps:B}=cE(D);x.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:N.type===void 0?s:void 0,openMethod:re,rootId:S}),Uw(x);let{forceUnmount:ie}=Ww(D,x,()=>{x.set(`allowMouseEnter`,!1)});Y(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:T,floatingParentNodeId:E}):_&&x.update({floatingNodeId:T,floatingParentNodeId:E})},[g,_,T,E,x]),H.useEffect(()=>{if(D||(ee.current=null),N.type===`context-menu`){if(!D){te.clear(),L.current=!1;return}te.start(500,()=>{L.current=!0})}},[te,D,N.type]),Y(()=>{!D&&!A&&x.set(`hoverEnabled`,!0)},[D,A,x]);let ae=zy((e,t)=>{let n=t.reason;if(!e&&!x.select(`open`)||D===e&&t.trigger===O&&M===n)return;let i=Vw(t);if(!e&&t.trigger==null&&(t.trigger=O??void 0),r?.(e,t),t.isCanceled)return;x.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!R.current)return;e&&n===`trigger-focus`?(R.current=!1,z.start(300,()=>{R.current=!0})):(R.current=!0,z.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};ee.current=t.event,Bw(c,e,t.trigger,i()),x.update(c),N.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),oe=Mw({popupStore:x,floatingId:C,nested:E!=null,onOpenChange:ae}),se=oe.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>ae(e,t);return se.on(`setOpen`,e),()=>{se?.off(`setOpen`,e)}},[se,ae]);let V=H.useCallback(()=>{x.setOpen(!1,tb(eb))},[x]);H.useImperativeHandle(u,()=>({unmount:ie,close:V}),[ie,V]);let ce;N.type===`context-menu`&&(ce=N.context),H.useImperativeHandle(ce?.positionerRef,()=>k,[k]),H.useImperativeHandle(ce?.actionsRef,()=>({setOpen:ae}),[ae]);let le=fC(oe,{enabled:!j,bubbles:{escapeKey:d&&N.type===`menu`},outsidePress(){return N.type!==`context-menu`||ee.current?.type===`contextmenu`||L.current},externalTree:ne?w:void 0}),ue=TE(),de=H.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),fe=xT(oe,{enabled:!j,listRef:x.context.itemDomElements,activeIndex:P,nested:N.type!==void 0,loopFocus:c,orientation:l,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:ue===`rtl`,disabledIndices:Pr,onNavigate:de,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:ne?w:void 0,focusItemOnHover:h}),pe=H.useCallback(e=>{x.context.typingRef.current=e},[x]),me=ST(oe,{enabled:!j,listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:P,resetMs:500,onMatch:e=>{D&&e!==P&&x.set(`activeIndex`,e)},onTyping:pe});Gw(x,{floatingRootContext:oe,activeTriggerProps:H.useMemo(()=>{let e=or(me.reference,fe.reference,le.reference,{onMouseMove(){x.set(`allowMouseEnter`,!0)}},B);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=D,e},[x,me.reference,fe.reference,le.reference,B,D]),inactiveTriggerProps:H.useMemo(()=>{let e=or(fe.trigger,le.trigger,B);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[fe.trigger,le.trigger,B]),popupProps:H.useMemo(()=>or(Iw,{id:C,role:`menu`,"aria-labelledby":O?.id,onMouseMove(){x.set(`allowMouseEnter`,!0),N.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},me.floating,fe.floating,le.floating),[O,C,N.type,x,me.floating,fe.floating,le.floating]),itemProps:fe.item??Fr});let he=H.useMemo(()=>({store:x,parent:b}),[x,b]),ge=(0,G.jsxs)(wj.Provider,{value:he,children:[f&&(0,G.jsx)(zw,{handle:f,store:x}),typeof t==`function`?t({payload:F}):t]});return N.type===void 0||N.type===`context-menu`?(0,G.jsx)(QS,{externalTree:w,children:ge}):ge});function fM(e){return Cr(()=>new oM(e)).current}var pM=5;function mM(e,t){let n=hM(t);return e.clientX>=n.left-pM&&e.clientX<=n.right+pM&&e.clientY>=n.top-pM&&e.clientY<=n.bottom+pM}function hM(e){let t=e.getBoundingClientRect(),n=my(e);if(Tb)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function gM(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=By(),{ref:i,index:a}=Fj(e),o=n===a,s=H.useRef(null),c=wr(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function _M(e){let{render:t,className:n,style:r,state:i=Fr,props:a=Pr,refs:o=Pr,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=gM({metadata:s});return zr(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function vM(e){if(vy(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Ay(e))return vM(Ny(e))}function yM(e,t){let n=H.useRef(null);function r(t){qs.flushSync(()=>{e.setOpen(!1,tb(Xy,t.nativeEvent,t.currentTarget))}),pS(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&mS(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{qs.flushSync(()=>{e.setOpen(!1,tb(Xy,n.nativeEvent,n.currentTarget))});let i=fS(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&zb(r,i);){let e=i;if(i=lS(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function bM(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=H.useRef(!1);return H.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Vy(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Fr,[t,n,r])}var xM=Dw(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Tj(!0),h=tT(d)??m?.store;if(!h)throw Error(xr(85));let g=ob(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=H.useRef(null),S=CM(),C=By(!0),w=YS(),T=H.useMemo(()=>w??new GS,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Hw(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:XS(T),floatingParentNodeId:JS(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Uy({disabled:A,native:o});H.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=H.useRef(null),P=db(),F=zy(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;zb(N.current,t)||zb(h.select(`positionerElement`),t)||t===N.current||(t==null||vM(t)!==h.select(`rootId`))&&(mM(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:Qy}))});H.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Vy(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,ee=pT(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:AT({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),L=SM(y,h.select(`lastOpenChangeReason`)),te=lC(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&L}),R=aT(v,{enabled:!A&&I}),z=bM({open:y,enabled:O,mouseDownAction:`open`}),ne=H.useMemo(()=>or(R.reference,te.reference),[R.reference,te.reference]),re=h.useState(`triggerProps`,D),{preFocusGuardRef:B,handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=yM(h,x),oe={disabled:A,open:y},se=[N,t,M,E,x],V=[ne,ee??Fr,re,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Vy(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},z,p,j],ce=zr(`button`,e,{enabled:!O,stateAttributesMapping:cy,state:oe,ref:se,props:V});return O?(0,G.jsx)(_M,{tag:`button`,render:n,className:r,style:i,state:oe,refs:se,props:V,stateAttributesMapping:cy}):y?(0,G.jsxs)(H.Fragment,{children:[(0,G.jsx)(dx,{ref:B,onFocus:ie},`${g}-pre-focus-guard`),(0,G.jsx)(H.Fragment,{children:ce},g),(0,G.jsx)(dx,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,G.jsx)(H.Fragment,{children:ce},g)});function SM(e,t){let n=db(),[r,i]=H.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function CM(){let e=iM(!0);return H.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function wM(e){let[t,n]=H.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function TM(e){let t=jy(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=vy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(mx(n)!==a||mx(r)!==o)&&(n=a,r=o),{width:n,height:r}}function EM(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,onMeasureLayout:a,onMeasureLayoutComplete:o,side:s,direction:c}=e,l=Pw(t,!0),u=sx(),d=H.useRef(null),f=H.useRef(!0),p=H.useRef(Nr),m=zy(a),h=zy(o),g=H.useMemo(()=>DM(s,c),[s,c]);Y(()=>{if(!i){p.current=Nr,f.current=!0,d.current=null;return}if(!t||!n)return;p.current=kM(t,g),AM(t,`auto`);let e=OM(t,`position`,`static`),r=OM(t,`transform`,`none`),a=OM(t,`scale`,`1`),o=kM(n,{"--available-width":`max-content`,"--available-height":`max-content`});function s(){e(),r(),o()}function c(){s(),a()}if(m?.(),f.current||d.current===null){jM(n,`max-content`);let e=TM(t);return d.current=e,jM(n,e),c(),h?.(null,e),f.current=!1,()=>{p.current(),p.current=Nr}}jM(n,`max-content`);let _=d.current,v=TM(t);d.current=v,AM(t,_),c(),h?.(_,v),jM(n,v);let y=new AbortController;return u.request(()=>{AM(t,v),l(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},y.signal)}),()=>{y.abort(),u.cancel(),p.current(),p.current=Nr}},[r,t,n,l,u,i,m,h,g])}function DM(e,t){let n=e===`top`,r=e===`left`||e===(t===`rtl`?`inline-end`:`inline-start`);return!n&&!r?Fr:{position:`absolute`,[n?`bottom`:`top`]:`0`,[r?`right`:`left`]:`0`}}function OM(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function kM(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(OM(e,r,i));return n.length?()=>{n.forEach(e=>e())}:Nr}function AM(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function jM(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var MM={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=my(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:ED};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Vy(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=bx(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:ED.sideX,g=f===`top`?`bottom`:ED.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}},NM={activationDirection:e=>e?{"data-activation-direction":e}:null};function PM(e){let{store:t,side:n,children:r}=e,i=TE(),a=t.useState(`activeTriggerElement`),o=t.useState(`activeTriggerId`),s=t.useState(`open`),c=t.useState(`payload`),l=t.useState(`mounted`),u=t.useState(`popupElement`),d=t.useState(`positionerElement`),f=wM(s?a:null),p=RM(o,c),m=H.useRef(null),[h,g]=H.useState(null),[_,v]=H.useState(null),y=H.useRef(null),b=H.useRef(null),x=Pw(y,!0),S=sx(),C=H.useRef(null),[w,T]=H.useState(null),[E,D]=H.useState(!1);Y(()=>(t.set(`adaptiveOrigin`,MM),()=>{t.set(`adaptiveOrigin`,void 0)}),[t]);let O=zy(()=>{y.current?.style.setProperty(`animation`,`none`),y.current?.style.setProperty(`transition`,`none`),b.current?.style.setProperty(`display`,`none`)}),k=zy(e=>{y.current?.style.removeProperty(`animation`),y.current?.style.removeProperty(`transition`),b.current?.style.removeProperty(`display`),e&&T(e)}),A=zy(()=>{C.current?.abort();let e=new AbortController;C.current=e,x(()=>{g(null),T(null),m.current=null},e.signal)}),j=H.useRef(null);Y(()=>{(!s||!l)&&(j.current=null)},[s,l]),Y(()=>{if(a&&f&&a!==f&&j.current!==a&&m.current){g(m.current),D(!0);let e=LM(f,a);v(e),j.current=a}},[a,f]),Y(()=>{h!=null&&(C.current?.abort(),D(!0),S.request(()=>{qs.flushSync(()=>{D(!1)}),A()}))},[p,h,A,S]),Y(()=>{let e=y.current;if(!e)return;let t=Vy(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));m.current=t});let M=h!=null,N;N=M?(0,G.jsxs)(H.Fragment,{children:[(0,G.jsx)(`div`,{"data-previous":!0,inert:IT(!0),ref:b,style:{...w?{"--popup-width":`${w.width}px`,"--popup-height":`${w.height}px`}:null,position:`absolute`},"data-ending-style":E?void 0:``},`previous`),(0,G.jsx)(`div`,{"data-current":!0,ref:y,"data-starting-style":E?``:void 0,children:r},p)]}):(0,G.jsx)(`div`,{"data-current":!0,ref:y,children:r},p),Y(()=>{let e=b.current;!e||!h||e.replaceChildren(...Array.from(h.childNodes))},[h]),EM({popupElement:u,positionerElement:d,mounted:l,content:c,onMeasureLayout:O,onMeasureLayoutComplete:k,side:n,direction:i});let P={activationDirection:FM(_),transitioning:M};return{children:N,state:P}}function FM(e){if(e)return`${IM(e.horizontal,5,`right`,`left`)} ${IM(e.vertical,5,`down`,`up`)}`}function IM(e,t,n,r){return e>t?n:e<-t?r:``}function LM(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function RM(e,t){let[n,r]=H.useState(0),i=H.useRef(e),a=H.useRef(t),o=H.useRef(!1);return Y(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}var zM=H.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return zr(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function BM(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var VM=dM,HM=`relative flex not-[class*='w-']:min-w-32 origin-(--transform-origin) rounded-xl border bg-popover bg-clip-padding shadow-xl outline-none transition-[scale,opacity] duration-150 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] focus:outline-none has-data-starting-style:scale-95 has-data-starting-style:opacity-0 has-data-ending-style:scale-95 has-data-ending-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`;function UM(e){return(0,G.jsx)(xM,{"data-slot":`menu-trigger`,...e})}function WM({children:e,className:t,sideOffset:n=4,align:r=`center`,alignOffset:i,side:a=`bottom`,zIndex:o,...s}){let c=o??oD.MODAL_BACKDROP;return(0,G.jsxs)(Kj,{children:[(0,G.jsx)(Oj,{className:`fixed inset-0`,"data-enso-float":``,style:{zIndex:c-1}}),(0,G.jsx)(nM,{align:r,alignOffset:i,"data-slot":`menu-positioner`,side:a,sideOffset:n,style:{zIndex:c},children:(0,G.jsx)(Uj,{className:W(HM,t),"data-slot":`menu-popup`,...s,children:(0,G.jsx)(`div`,{className:`max-h-(--available-height) w-full overflow-y-auto p-1.5`,children:e})})})]})}var GM=`[&_svg]:-mx-0.5 flex min-h-8 cursor-default select-none items-center gap-2.5 whitespace-nowrap rounded-md px-2 py-1.5 text-base outline-none data-disabled:cursor-not-allowed data-disabled:bg-transparent! data-disabled:text-muted-foreground! data-highlighted:bg-accent data-inset:ps-8 data-[variant=destructive]:text-destructive data-highlighted:text-accent-foreground data-highlighted:data-[variant=destructive]:bg-destructive/10 data-highlighted:data-[variant=destructive]:text-destructive data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`;function KM(e){return(0,G.jsx)(Rj,{"data-slot":`menu-group`,...e})}function qM({className:e,inset:t,variant:n=`default`,style:r,...i}){return(0,G.jsx)(Bj,{className:W(GM,e),"data-inset":t,"data-slot":`menu-item`,"data-variant":n,style:{WebkitAppRegion:`no-drag`,...r},...i})}function JM({className:e,inset:t,...n}){return(0,G.jsx)(zj,{className:W(`px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:ps-9 sm:data-inset:ps-8`,e),"data-inset":t,"data-slot":`menu-label`,...n})}function YM({className:e,...t}){return(0,G.jsx)(zM,{className:W(`mx-2 my-1 h-px bg-border`,e),"data-slot":`menu-separator`,...t})}var XM=H.createContext(void 0);function ZM(){let e=H.useContext(XM);if(e===void 0)throw Error(xr(63));return e}var QM={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},$M={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},eN={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},tN={...eN,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},nN={invalid:void 0,name:void 0,validityData:{state:QM,errors:[],error:``,value:``,initialValue:null},setValidityData:Nr,disabled:void 0,setTouched:Nr,setDirty:Nr,setFilled:Nr,setFocused:Nr,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:$M,registerFieldControl:Nr,validation:{getValidationProps:(e,t=Fr)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Nr,getInputControl:()=>null,commit:async()=>{},change:Nr}},rN=H.createContext(nN);function iN(e=!0){let t=H.useContext(rN);if(t.setValidityData===Nr&&!e)throw Error(xr(28));return t}function aN(e,t,n,r,i=!0,a){let{registerFieldControl:o}=iN(),s=Cr(()=>Symbol());Y(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var oN=H.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Nr,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function sN(){return H.useContext(oN)}var cN=H.createContext({controlId:void 0,registerControlId:Nr,labelId:void 0,setLabelId:Nr,messageIds:[],setMessageIds:Nr,getDescriptionProps:e=>e});function lN(){return H.useContext(cN)}function uN(e,t,n,r=!0,i){let[a,o]=H.useState(),s=ob(i?`${i}-label`:void 0),c=e??t??a;return Y(()=>{let i=e||t||!r?void 0:dN(n.current,s);a!==i&&o(i)}),c}function dN(e,t){let n=fN(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function fN(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function pN(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=lN(),o=ob(t),s=n?i:void 0,c=Cr(()=>Symbol()),l=H.useRef(!1),u=H.useRef(t!=null),d=zy(()=>{!l.current||a===Nr||(l.current=!1,a(c.current,void 0))});return Y(()=>{if(a===Nr)return;let e;if(n){let n=r?.current;e=_y(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),H.useEffect(()=>d,[d]),i??o}var mN=H.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=sN(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,validationMode:D,disabled:O,name:k,validation:A}=iN(),{labelId:j}=lN(),M=O||m,N=k??l,P=H.useRef(null),F=wr(P,c,A.inputRef),I=H.useRef(null),ee=ob(),L=pN({id:s,implicit:!1,controlRef:I}),te=u?void 0:L,[R,z]=kj({controlled:n,default:!!i,name:`Switch`,state:`checked`});aN(I,ee,R,void 0,!M,l),Y(()=>{P.current&&T(P.current.checked)},[T]),oE(R,()=>{b(N),C(R!==w.initialValue),T(R),A.change(R)});let{getButtonProps:ne,buttonRef:re}=Uy({disabled:M,native:u}),B=uN(a,j,P,!u,te),ie={id:u?L:ee,role:`switch`,"aria-checked":R,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":B,onFocus(){M||E(!0)},onBlur(){let e=P.current;!e||M||(S(!0),E(!1),D===`onBlur`&&A.commit(e.checked))},onClick(e){if(f||M)return;e.preventDefault();let t=P.current;t&&Hy(t,e)}},ae={...A.getValidationProps(M),checked:R,disabled:M,form:o,id:te,name:N,required:p,style:N?ux:lx,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=tb(Gy,e.nativeEvent);d?.(t,n),!n.isCanceled&&z(t)},onClick(e){e.stopPropagation()},onFocus(){I.current?.focus()},..._===void 0?Fr:{value:_}},oe=H.useMemo(()=>({...x,checked:R,disabled:M,readOnly:f,required:p}),[x,R,M,f,p]),se=zr(`span`,e,{state:oe,ref:[t,I,re],props:[ie,y,ne,e=>A.getValidationProps(M,e)],stateAttributesMapping:tN});return(0,G.jsxs)(XM.Provider,{value:oe,children:[se,!R&&N&&g!==void 0&&(0,G.jsx)(`input`,{type:`hidden`,form:o,name:N,value:g,disabled:M}),(0,G.jsx)(`input`,{...ae,suppressHydrationWarning:!0})]})}),hN=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return zr(`span`,e,{state:ZM(),ref:t,stateAttributesMapping:tN,props:a})});function gN({className:e,...t}){return(0,G.jsx)(mN,{className:W(`group/switch inset-shadow-[0_1px_--theme(--color-black/4%)] inline-flex h-5.5 w-9.5 shrink-0 items-center rounded-full p-px outline-none transition-all focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:opacity-64 sm:h-4.5 sm:w-7.5`,e),"data-slot":`switch`,...t,children:(0,G.jsx)(hN,{className:W(`pointer-events-none block size-5 rounded-full bg-background shadow-sm transition-[translate,width] group-active/switch:not-data-disabled:w-5.5 data-checked:translate-x-4 data-unchecked:translate-x-0 data-checked:group-active/switch:translate-x-3.5 sm:size-4 sm:data-checked:translate-x-3 sm:group-active/switch:not-data-disabled:w-4.5 sm:data-checked:group-active/switch:translate-x-2.5`),"data-slot":`switch-thumb`})})}var _N=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},vN=(e=>e?_N(e):_N),yN=e=>e;function bN(e,t=yN){let n=H.useSyncExternalStore(e.subscribe,H.useCallback(()=>t(e.getState()),[e,t]),H.useCallback(()=>t(e.getInitialState()),[e,t]));return H.useDebugValue(n),n}var xN=e=>{let t=vN(e),n=e=>bN(t,e);return Object.assign(n,t),n},SN=(e=>e?xN(e):xN);SN(e=>({cache:{},generation:0,put:(t,n)=>e(e=>{let r={...e.cache};for(let e of n)r[`${t}/${e.modelId}`]=e;return{cache:r}}),invalidate:()=>e(e=>({cache:{},generation:e.generation+1}))}));function CN(e){let t=e=>String(e>=100?Math.round(e):Math.round(e*10)/10);return e<1e3?String(e):e<1e6?`${t(e/1e3)}K`:`${t(e/1e6)}M`}function wN(e){let t=e/1e3;if(t<60)return`${Math.round(t*10)/10}s`;let n=Math.round(t);return`${Math.floor(n/60)}m${n%60}s`}var TN=`enso:open-chat-model-picker`;function EN(){window.dispatchEvent(new Event(TN))}function DN(e,t){return e.filter(e=>e!==t)}var ON=new Map,kN=e=>e.images.length>0||e.segments.some(e=>e.type!==`text`||e.text.trim()!==``),AN=()=>!!window.electronAPI?.remote&&window.matchMedia?.(`(pointer: coarse)`).matches===!0;function jN({mentionConversationId:e,commands:t,running:n,busy:r,focusKey:i,pluginPresetId:a=null,autoFocus:o=!window.electronAPI?.remote,enterToSend:s=!AN(),toolbar:c,locked:l=!1,injectedDraft:u,injectedImages:d,injectedDraftAppend:f,onDraftConsumed:p,chatCandidates:m,onActivate:h,onSend:g,onAbort:_,queuedCount:v=0,onSteerQueued:y,isolated:b=!1,placeholder:x,planMode:S=!1,savePastedText:C}){let{t:w}=K(),E=ZD(),D=T(e=>e.keybindings),O=T(e=>e.privacyMasking),k=tO(D)[`send-message`],A=(0,H.useId)(),[j,M]=(0,H.useState)([]),[N,P]=(0,H.useState)([]),[F,I]=(0,H.useState)(),ee=(0,H.useRef)(i),[L,te]=(0,H.useState)(!1),{setNodeRef:R,isOver:z}=hv({id:b?`isolated-composer:${i??`side`}`:ik,disabled:b}),[ne,re]=(0,H.useState)(null),[B,ie]=(0,H.useState)(null),ae=(0,H.useRef)(new Set),oe=(0,H.useRef)(g);oe.current=g;let se=(0,H.useRef)(O);se.current=O,(0,H.useEffect)(()=>{if(b)return;let e=KO(e=>V.current?.insertMention(e)),t=JO(e=>V.current?.insertText(e)),n=XO(e=>V.current?.insertQuote(e)),r=qO(()=>V.current?.focus()),i=ek((e,t)=>{t&&M(n=>[...n,{...t,id:e.imageId}]),V.current?.insertMention(e),V.current?.focus()}),a=tk(e=>{M(t=>[...t,{data:e.data,mimeType:e.mimeType}]),V.current?.focus()}),o=QO(e=>{if(de.current)return!1;let t=se.current,n=t.enabled?Kv(e.text,t).blocked:[];return n.length>0?(RD({type:`error`,title:w(`Message not sent`),description:w(`Privacy masking blocks {{kinds}}. Remove it, or change the action or allow list in Settings → Privacy.`,{kinds:n.join(`, `)})}),!1):oe.current(e)!==!1});return()=>{e(),t(),n(),r(),i(),a(),o()}},[b,w]);let V=(0,H.useRef)(null),ce=(0,H.useRef)(null),le=(0,H.useRef)(null),ue=(0,H.useRef)(!1),de=(0,H.useRef)(l);de.current=l,(0,H.useEffect)(()=>{if(!(b||!i))return hO({key:i,segments:()=>V.current?.getSegments()??[],insertText:e=>V.current?.insertText(e),setText:e=>V.current?.setSegments(e?[{type:`text`,text:e}]:[]),busy:()=>ue.current||de.current||!V.current})},[b,i]);let[fe,pe]=(0,H.useState)({left:0,flyoutSide:`right`}),[me,he]=(0,H.useState)(``),[ge,_e]=(0,H.useState)(!1),ve=(0,H.useRef)(Symbol(`composer`)),ye=me.trim()!==``||ge||j.length>0;(0,H.useEffect)(()=>sO(ve.current,ye),[ye]),(0,H.useEffect)(()=>()=>sO(ve.current,!1),[]);let[be,xe]=(0,H.useState)(null),Se=GD(e,be,m),Ce=(0,H.useMemo)(()=>VD(Se,be??``),[Se,be]),[we,Te]=(0,H.useState)(null),[Ee,De]=(0,H.useState)(null),[Oe,ke]=(0,H.useState)(null),Ae=FO(Oe,i??null),[je,Me]=(0,H.useState)(0),[Ne,Pe]=(0,H.useState)(null),[Fe,Ie]=(0,H.useState)(0),Le=(0,H.useRef)(null),Re=(0,H.useCallback)(e=>{(e.plainText.trim()||e.hasMentions)&&h?.(),he(e.plainText),_e(e.hasMentions);let t=new Set(e.segments.filter(e=>e.type===`ui-element`&&e.imageId).map(e=>e.type===`ui-element`?e.imageId:``)),n=[...ae.current].filter(e=>!t.has(e));ae.current=t,n.length>0&&(M(e=>xv(e,n)),re(e=>e&&n.includes(e.imageId)?null:e)),xe(t=>(t!==e.mentionQuery&&(Me(0),Pe(null),Ie(0)),e.mentionQuery)),Te(e.slashQuery),De(e.skillQuery),ke(e.pluginQuery)},[h]);(0,H.useEffect)(()=>{let e=ee.current;if(e!==i){if(e){let t={segments:V.current?.getSegments()??[],images:j,slashes:N,recipient:F};ON.set(e,t),sO(`draft:${e}`,kN(t))}let t=i?ON.get(i):void 0;i&&sO(`draft:${i}`,!1);let n=i?gO(i):void 0;V.current?.setSegments(n?[{type:`text`,text:n}]:t?.segments??[]),ae.current=new Set((t?.segments??[]).filter(e=>e.type===`ui-element`&&e.imageId).map(e=>e.type===`ui-element`?e.imageId:``)),M(t?.images??[]),P(t?.slashes??[]),I(t?.recipient),ee.current=i,xe(null),Te(null),De(null),Me(0),Pe(null),Ie(0)}o&&V.current?.focus()},[i]),(0,H.useEffect)(()=>{if(!u&&!d?.length)return;let e=fA({segments:V.current?.getSegments()??[],images:j,slashes:N},{text:u,images:d},f);P(e.slashes),M(e.images),V.current?.setSegments(e.segments),p?.(),window.setTimeout(()=>V.current?.focus(),0)},[u,d,f]);let ze=N.length===1?N[0]:null,Be=Jv(ze,me.replaceAll(``,``)),Ve=LA(t,we,Ee),He=we===null&&Ee===null&&Be!==null?Yv(ze,Be):[];(0,H.useEffect)(()=>{Me(0)},[we,Ee,Be,Oe]),(0,H.useEffect)(()=>{(Le.current?.children[je])?.scrollIntoView({block:`nearest`})},[je]);let Ue=(0,H.useCallback)(e=>{if(e.kind===`agent-type`){V.current?.consumeToken(`@`),I(e),xe(null);return}V.current?.insertMention(e),xe(null)},[]),We=(0,H.useCallback)(e=>{ke(null),IO(e,i??null).then(e=>{let t=V.current;t&&(t.consumeToken(`#`),e&&t.insertText(e))})},[i]),Ge=be!==null&&Ce.length>0?`mention`:Oe!==null&&Ae.length>0?`plugin`:Ve.length>0?`slash`:He.length>0?`slash-sub`:null;(0,H.useLayoutEffect)(()=>{if(Ge!==`mention`)return;let e=ce.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=e.querySelector(`[data-slot="mention-picker"]`),r=n?.querySelector(`[role="listbox"]`),i=n?.querySelector(`[data-slot="mention-flyout"]`),a=V.current?.getMentionAnchorRect(),o=Rk({anchorLeft:a?a.left-t.left:0,containerWidth:t.width,popupWidth:r instanceof HTMLElement?r.offsetWidth:280,flyoutWidth:i instanceof HTMLElement?i.offsetWidth:252,flyoutGap:4});pe(e=>e.left===o.left&&e.flyoutSide===o.flyoutSide?e:o)};return t(),window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[be,me,Ne,Ge]);let Ke=Ge===`mention`?Ce.length:Ge===`plugin`?Ae.length:Ge===`slash-sub`?He.length:Ve.length,qe=(0,H.useCallback)((e,t)=>{let n=[{type:`text`,text:e}];V.current?.setSegments(n),t&&g(tA({segments:n,slashes:N,images:j,recipient:F}))!==!1&&(V.current?.clear(),M([]),P([]),I(void 0),xe(null),Te(null),De(null))},[j,g,F,N]),Je=(0,H.useCallback)(e=>{V.current?.consumeToken(Ee===null?`/`:`$`),Te(null),De(null);let t=uO(e);if(!t){P(t=>uA(t,e));return}fO(t,b?null:i??null).then(e=>{e&&RD({type:`error`,title:w(`Plugin command failed`),description:e})})},[Ee,b,i,w]),Ye=(0,H.useCallback)((e=!1)=>{if(Ge===`mention`){if(Ne){let e=Se[Ne][Fe];e&&Ue(e);return}let e=Ce[je];e?.type===`item`&&Ue(e.candidate)}else if(Ge===`plugin`){let e=Ae[je];e&&We(e)}else if(Ge===`slash`){let e=Ve[je];e&&Je(e.name)}else if(Ge===`slash-sub`){let t=He[je];if(!t)return;qe(t.name,e)}},[je,Fe,Ne,Se,Ce,Ue,We,Ae,Ge,Ve,Je,He,qe]),Xe=me.replaceAll(``,``).trim(),Ze=!!(Xe||N.length>0||j.length>0||ge),Qe=F!==void 0,$e=r&&!Qe,et={sessionId:b?null:i??null,draft:me.replaceAll(``,``),busy:l,pluginPresetId:a},tt=n&&v>0&&y!==void 0&&s&&!!k,U=tt&&!Ze&&!Qe&&!l,nt=(0,H.useMemo)(()=>O.enabled&&Xe?Kv(Xe,O):null,[Xe,O]),rt=()=>{if(!Ze)return;let e=tA({segments:V.current?.getSegments()??[],slashes:N,images:j,recipient:F}),t=O.enabled?Kv(e.text,O).blocked:[];if(t.length>0){RD({type:`error`,title:w(`Message not sent`),description:w(`Privacy masking blocks {{kinds}}. Remove it, or change the action or allow list in Settings → Privacy.`,{kinds:t.join(`, `)})});return}g(e)!==!1&&(V.current?.clear(),M([]),P([]),I(void 0),xe(null),Te(null),De(null))},it=(0,H.useCallback)(e=>{for(let t of e){if(t.type.startsWith(`image/`)){let e=new FileReader;e.onload=()=>{let n=e.result,r=n.slice(n.indexOf(`,`)+1);M(e=>[...e,{data:r,mimeType:t.type}])},e.readAsDataURL(t);continue}let e=window.electronAPI.files.pathForFile(t),n=window.electronAPI.remote;if(!e&&n){n.upload(t).then(e=>{e&&V.current?.insertFileChip(e)}).catch(()=>{});continue}e&&V.current?.insertFileChip(e)}},[]);return(0,H.useEffect)(()=>{if(b)return;let e=nk(e=>{it(e),V.current?.focus()}),t=rk(e=>{for(let t of e)V.current?.insertFileChip(t);V.current?.focus()});return()=>{e(),t()}},[b,it]),(0,G.jsxs)(`div`,{ref:ce,className:`relative`,children:[Ge===`mention`&&(0,G.jsx)(oj,{id:A,groups:Se,query:be??``,activeIndex:je,onActiveIndexChange:Me,openFolderId:Ne,folderIndex:Fe,onOpenFolderIdChange:Pe,onFolderIndexChange:Ie,onSelect:Ue,left:fe.left,flyoutSide:fe.flyoutSide}),Ge===`plugin`&&(0,G.jsx)(`div`,{ref:Le,role:`listbox`,"aria-label":w(`Plugin suggestions`),className:`absolute bottom-full left-0 z-10 mb-1.5 max-h-64 w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:Ae.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===je,onMouseDown:e=>e.preventDefault(),onClick:()=>We(e),onMouseMove:()=>Me(t),className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,t===je&&`bg-foreground/10`),children:[(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:`#`}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.item.label}),e.item.detail&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:e.item.detail})]},e.key))}),(Ge===`slash`||Ge===`slash-sub`)&&(0,G.jsx)(`div`,{ref:Le,role:`listbox`,"aria-label":w(`Command suggestions`),className:`absolute bottom-full left-0 z-10 mb-1.5 max-h-64 w-full overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:(Ge===`slash`?Ve:He).map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===je,onClick:()=>{Me(t),Ge===`slash`?Je(e.name):qe(e.name,!1)},onMouseMove:()=>Me(t),className:W(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs`,t===je&&`bg-foreground/10`),children:[(0,G.jsx)(Wn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono font-medium`,children:Ee===null?e.name:`$${e.name.slice(7)}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:w(e.description)})]},e.name))}),(0,G.jsxs)(`div`,{ref:R,"data-slot":`composer`,"data-enso":`composer`,className:W(`rounded-[24px] border bg-card shadow-[0_2px_6px_rgb(0_0_0/0.03),0_12px_32px_rgb(0_0_0/0.07)] transition-[border-color,box-shadow] duration-200 focus-within:border-foreground/20 [.dark_&]:shadow-[0_2px_6px_rgb(0_0_0/0.2),0_12px_32px_rgb(0_0_0/0.3)]`,(L||z)&&`border-brand/50 bg-brand/5`,(Qe||S)&&`border-primary/35 shadow-primary/5`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),te(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||te(!1)},onDrop:e=>{let t=Array.from(e.dataTransfer.files);t.length!==0&&(e.preventDefault(),te(!1),it(t))},children:[j.filter(e=>!e.id).length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,children:j.filter(e=>!e.id).map((e,t)=>(0,G.jsxs)(`div`,{className:`group relative`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>ie(e),className:`block rounded-md focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,"aria-label":w(`Preview`),children:(0,G.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:``,className:`h-16 w-16 rounded-md border object-cover`})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>M(t=>DN(t,e)),className:`absolute -top-1.5 -right-1.5 rounded-full border bg-background p-0.5 text-muted-foreground shadow-sm transition-opacity hover:text-destructive`,children:(0,G.jsx)(nr,{className:`h-3 w-3`})})]},t))}),(0,G.jsxs)(`div`,{className:W(`flex items-start gap-1.5 px-4`,j.length>0?`pt-1.5`:`pt-3.5`),children:[F&&(0,G.jsx)(gA,{recipient:F,onRemove:()=>I(void 0)}),N.map(e=>(0,G.jsx)(cA,{name:e,className:`mt-0.5 shrink-0`,trailing:(0,G.jsx)(`button`,{type:`button`,onClick:()=>P(t=>t.filter(t=>t!==e)),className:`rounded-sm opacity-70 hover:opacity-100`,"aria-label":w(`Remove`),children:(0,G.jsx)(nr,{className:`h-3 w-3`})})},e)),(0,G.jsx)(ej,{ref:V,placeholder:N.length>0?``:l?w(`Resolve the pending approval to continue`):Qe?w(`Message the selected Agent…`):tt?w(`Press {{key}} to steer the next queued message into this round…`,{key:iO(k)}):x||w(n?`Message will queue until this round finishes…`:`Type @ to choose a file or Agent`),disabled:l,onStateChange:Re,onChipActivate:e=>{e.type===`ui-element`&&re({kind:`ui-element`,id:e.id,label:e.label,path:e.path,text:e.text,imageId:e.imageId})},onKeyDown:e=>{let t=e.nativeEvent.isComposing||ue.current;if(Ge){let n=Ge===`mention`?Ce[je]:void 0,r=zk({key:e.key,shiftKey:e.shiftKey,isComposing:t,activeIndex:je,itemCount:Ke,folderOpen:Ge===`mention`&&Ne!==null,activeIsFolder:Ge===`mention`&&n?.type===`folder`,folderIndex:Fe,folderItemCount:Ne?Se[Ne].length:0});if(r.type===`move`){e.preventDefault(),Me(r.index),Pe(null);return}if(r.type===`move-folder`){e.preventDefault(),Ie(r.index);return}if(r.type===`open-folder`){e.preventDefault(),n?.type===`folder`&&Pe(n.id),Ie(0);return}if(r.type===`close-folder`){e.preventDefault(),Pe(null);return}if(r.type===`pick`){e.preventDefault(),Ye(Ge===`slash-sub`&&e.key===`Enter`);return}if(r.type===`close`){e.preventDefault(),xe(null),Te(null),De(null),ke(null),Pe(null);return}}if(t)return;let n=nO(e);if(!b&&n&&n===tO(T.getState().keybindings)[`switch-model`]){e.preventDefault(),EN();return}if(e.key===`Backspace`&&N.length>0&&Xe.length===0&&!ge){e.preventDefault(),P(e=>e.slice(0,-1));return}if(e.key===`Backspace`&&F&&V.current?.isEmpty()&&N.length===0){e.preventDefault(),I(void 0);return}s&&!Ge&&nO(e,{allowBare:!0})===k&&(e.preventDefault(),U?y?.():rt())},onPasteText:e=>!C||!Cv(e)?!1:(C(e).catch(()=>({ok:!1,error:`unavailable`})).then(t=>{let n=V.current;t.ok?n?.insertFileChip(t.path,`${Sv} · ${w(`{{count}} chars`,{count:t.chars.toLocaleString()})}`):n?.insertText(e)}),!0),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),it(t))},onCompositionStart:()=>{ue.current=!0},onCompositionEnd:()=>{ue.current=!1},ariaProps:{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":Ge!==null,"aria-controls":Ge===`mention`?A:void 0,"aria-activedescendant":Ge===`mention`?Ne?`${A}-sub-${Fe}`:`${A}-option-${je}`:void 0}})]}),Qe&&(0,G.jsx)(`p`,{className:`sr-only`,children:w(`Send only to the selected Agent`)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-1.5 px-3 pt-0.5 pb-2.5`,children:[(0,G.jsxs)(`div`,{className:W(`flex min-w-0 flex-1 items-center`,E?`gap-0.5 overflow-x-auto [scrollbar-width:none]`:`gap-1 overflow-hidden`),children:[(0,G.jsx)(`input`,{ref:le,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,onChange:e=>{it(Array.from(e.target.files??[])),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>le.current?.click(),"aria-label":w(`Attach image`),title:w(`Attach image`),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40 max-md:size-[32px]`,children:(0,G.jsx)(Qt,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(TO,{side:`left`,...et}),c,!b&&(0,G.jsx)(Kte,{sessionId:et.sessionId}),(0,G.jsx)(TO,{side:`right`,...et}),nt&&(nt.blocked.length>0||nt.masked>0)&&(0,G.jsxs)(`span`,{className:W(`flex shrink-0 items-center gap-1 text-[11px]`,nt.blocked.length>0?`text-red-600 dark:text-red-400`:`text-sky-600 dark:text-sky-400`),"data-privacy-precheck":!0,children:[nt.blocked.length>0?(0,G.jsx)(In,{className:`size-3.5`}):(0,G.jsx)(Ln,{className:`size-3.5`}),nt.blocked.length>0?w(`Will be blocked: {{kinds}}`,{kinds:nt.blocked.join(`, `)}):w(`{{count}} will be masked`,{count:nt.masked})]})]}),$e&&!Ze?(0,G.jsx)(Ea,{variant:`outline`,size:`icon`,className:`size-8 shrink-0 rounded-full`,onClick:_,"aria-label":w(`Stop`),children:(0,G.jsx)(Tt,{className:`h-4 w-4`})}):(0,G.jsx)(Ea,{size:`icon`,className:`size-8 shrink-0 rounded-full bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-35`,onClick:rt,disabled:!Ze||l,"aria-label":w(Qe?`Send only to the selected Agent`:`Send`),title:Qe?w(`Send only to the selected Agent`):s&&k?`${w(`Send`)} ${iO(k)}`:w(`Send`),children:(0,G.jsx)(st,{className:`h-4 w-4`})})]})]}),(0,G.jsx)(cD,{open:ne!==null,onOpenChange:e=>!e&&re(null),children:(0,G.jsxs)(pD,{className:`max-w-md`,children:[(0,G.jsx)(mD,{children:(0,G.jsx)(gD,{children:ne?.label??w(`Selected UI element`)})}),(0,G.jsx)(yD,{className:`space-y-2 text-xs`,children:ne&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-muted-foreground break-all`,children:ne.path}),ne.text&&(0,G.jsx)(`p`,{children:ne.text}),(()=>{let e=j.find(e=>e.id===ne.imageId);return e?(0,G.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:``,className:`max-h-72 w-full rounded-md border object-contain`}):null})()]})})]})}),(0,G.jsx)(cD,{open:B!==null,onOpenChange:e=>!e&&ie(null),children:(0,G.jsxs)(pD,{className:`max-w-3xl`,children:[(0,G.jsx)(mD,{children:(0,G.jsx)(gD,{children:w(`Preview`)})}),(0,G.jsx)(yD,{children:B&&(0,G.jsx)(`img`,{src:`data:${B.mimeType};base64,${B.data}`,alt:``,className:`max-h-[80vh] w-full rounded-md object-contain`})})]})})]})}var MN=(0,H.createContext)(null);function NN(){return(0,H.useContext)(MN)}function PN({className:e}){return(0,G.jsx)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,"aria-hidden":`true`,className:W(`size-4`,e),children:(0,G.jsx)(`path`,{d:`M 38.96 48.86 A 18.24 18.24 0 1 1 48.19 40.4`,stroke:`currentColor`,strokeWidth:`8.32`,strokeLinecap:`round`})})}var $te=12e4;function FN(e){return{id:e.id,dueAt:e.dueAt,...e.label?{label:e.label}:{}}}function IN(e,t){return e.filter(e=>e.dueAt>t-$te).sort((e,t)=>e.dueAt-t.dueAt)}function LN(e,t){let n=IN(e,t),r=n[0];if(r)return{...FN(r),count:n.length}}function RN(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function zN(e,t,n){let r=e-t;if(r<=0)return n(`due now`);if(r<6e4)return n(`<1m`);let i=Math.ceil(r/6e4);if(i<60)return n(`in {{minutes}}m`,{minutes:i});let a=Math.floor(i/60),o=i%60;return o>0?n(`in {{hours}}h {{minutes}}m`,{hours:a,minutes:o}):n(`in {{hours}}h`,{hours:a})}function BN(e,t,n){let r=[`${n(`Waiting for reminder · {{time}}`,{time:RN(e.dueAt)})} (${zN(e.dueAt,t,n)})`];return e.label&&r.push(e.label),e.count>1&&r.push(n(`{{count}} reminders`,{count:e.count})),r.join(` — `)}var VN=6e4,HN=60*VN;1*VN,2*VN,5*VN,10*VN,15*VN,6*HN,30*VN,24*HN,1*VN,1*VN,2*VN,5*VN,10*VN;function UN(e){return e?.status===`waiting`&&e.retry?.reason===`upstream`}function WN(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}var GN=3e4,KN=SN(e=>({byConversation:{},replace:(t,n)=>e(e=>{let r={...e.byConversation};if(n.length>0)r[t]=n;else if(r[t])delete r[t];else return e;return{byConversation:r}}),replaceAll:t=>{let n={};for(let[e,r]of Object.entries(t))Array.isArray(r)&&r.length>0&&(n[e]=r);e({byConversation:n})}}));function qN(e,t=!0){let n=KN(n=>t&&e?n.byConversation[e]:void 0),[,r]=(0,H.useState)(0),i=!!(n&&n.length>0);(0,H.useEffect)(()=>{if(!i)return;let e=setInterval(()=>r(e=>e+1),GN);return()=>clearInterval(e)},[i]);let a=Date.now();return!t||!n||n.length===0?{reminder:void 0,now:a}:{reminder:LN(n,a),now:a}}var JN={activeId:null,conversations:{},rewind:()=>{},retry:()=>{},forkFromMessage:async()=>null,selectConversation:()=>{},removeQueuedMessage:()=>{},updateQueuedMessage:()=>{},sendQueuedNow:()=>{},interruptAndSendQueued:async()=>{},pauseGoal:()=>{},resumeGoal:()=>{},clearGoal:()=>{}};function YN(e){Object.assign(JN,e)}function XN(e){if(!e){JN.activeId=null,JN.conversations={};return}JN.activeId=e.id,JN.conversations={[e.id]:e}}function ZN(e){return e(JN)}ZN.getState=()=>JN,ZN.subscribe=e=>()=>{};var QN=`rounded-lg border border-border/60 bg-muted/20 px-2.5 py-1.5 text-xs`;function $N({className:e}){return(0,G.jsx)(Jn,{className:W(`h-3.5 w-3.5 shrink-0 text-muted-foreground`,e)})}var eP=`w-full overflow-hidden rounded-lg border border-dashed border-border/60 text-xs text-muted-foreground`,tP=W(eP,`px-3 py-2`),nP=`mt-0.5 h-3.5 w-3.5 shrink-0`,rP={active:`bg-green-500 animate-pulse`,paused:`bg-amber-500`,waiting:`bg-amber-500`,blocked:`bg-destructive`,completed:`bg-blue-500`};function iP({conversationId:e,goal:t,sessionStatus:n}){let{t:r}=K(),i=UN(t)?t.retry:void 0,{reminder:a,now:o}=qN(e,!i&&t.status===`active`&&n!==`running`),s={active:r(`working`),paused:r(`paused`),waiting:r(`waiting`),blocked:r(`blocked`),completed:r(`completed`)},c=i?i.kind===`quota`?r(`Quota exhausted · next {{time}}`,{time:WN(i.at)}):r(`Waiting for upstream recovery · next {{time}}`,{time:WN(i.at)}):s[t.status],l=a?BN(a,o,r):void 0;return(0,G.jsxs)(`div`,{className:W(`mb-1 flex items-center gap-2`,QN),children:[(0,G.jsx)($N,{}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:i?.lastError?`${t.text} — ${i.lastError}`:l?`${t.text} — ${l}`:t.note?`${t.text} — ${t.note}`:t.text,children:[t.text,t.note&&(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[` — `,t.note]})]}),a?(0,G.jsxs)(`span`,{"data-enso":`goal-reminder-waiting`,title:l,className:`inline-flex min-w-0 max-w-[260px] shrink-0 items-center gap-1 rounded bg-sky-500/15 px-1.5 py-0.5 font-mono text-[10px] text-sky-600 tabular-nums dark:text-sky-400`,children:[(0,G.jsx)(At,{className:`h-3 w-3 shrink-0`,"aria-hidden":!0}),(0,G.jsxs)(`span`,{className:`truncate`,children:[r(`Waiting for reminder · {{time}}`,{time:RN(a.dueAt)}),a.label?` · ${a.label}`:``]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,rP[t.status])}),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground tabular-nums`,children:[c,t.status===`active`&&t.autoTurns>0?` · ${t.autoTurns}/25`:``]})]}),i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`upstream-retry-now`,title:r(`Retry now`),onClick:()=>void ZN.getState().retryUpstreamNow(e),className:`inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-amber-600 transition-colors hover:bg-amber-500/10 dark:text-amber-400`,children:[(0,G.jsx)(jn,{className:`h-3 w-3`}),r(`Retry now`)]}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`upstream-stop`,title:r(`Stop auto-retry`),onClick:()=>void ZN.getState().abort(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-destructive`,children:(0,G.jsx)(qn,{className:`h-3 w-3`})})]}):t.status===`active`?(0,G.jsx)(`button`,{type:`button`,title:r(`Pause goal`),onClick:()=>ZN.getState().pauseGoal(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(xn,{className:`h-3.5 w-3.5`})}):t.status===`completed`?null:(0,G.jsx)(`button`,{type:`button`,title:r(`Resume goal`),onClick:()=>ZN.getState().resumeGoal(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(wn,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(`button`,{type:`button`,title:r(`Clear goal`),onClick:()=>ZN.getState().clearGoal(e),className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-destructive`,children:(0,G.jsx)(nr,{className:`h-3.5 w-3.5`})})]})}function aP(e,t){return e.trim().length>0||t>0}function oP(e,t){return e>0?`${e} ${t}`:null}var sP=lk;function cP(e){return!ck(e)}function lP({conversationId:e,queued:t}){let{t:n}=K(),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(``);if(t.length===0)return null;let s=t=>{aP(a,t.images?.length??0)&&ZN.getState().updateQueuedMessage(e,t.id,a.trim()),i(null)};return(0,G.jsx)(`div`,{className:`mb-1 flex flex-col gap-0.5`,children:t.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 border-dashed bg-muted/20 px-2.5 py-1.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,children:n(`Queued`)}),r===t.id?(0,G.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`&&s(t),e.key===`Escape`&&i(null))},autoFocus:!0,className:`h-6 min-w-0 flex-1 rounded border bg-transparent px-1.5 outline-none focus:ring-1 focus:ring-ring`}):(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:sP(t.text)||`[image]`}),oP(t.images?.length??0,n(`attachments`))&&(0,G.jsxs)(`span`,{title:oP(t.images?.length??0,n(`attachments`))??void 0,className:`flex shrink-0 items-center gap-0.5 text-muted-foreground`,children:[(0,G.jsx)(en,{className:`h-3 w-3`}),t.images?.length]}),r===t.id?(0,G.jsx)(`button`,{type:`button`,onClick:()=>s(t),className:`shrink-0 rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(ht,{className:`h-3.5 w-3.5`})}):(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,G.jsx)(`button`,{type:`button`,title:n(`Withdraw message`),"aria-label":n(`Withdraw message`),onClick:()=>ZN.getState().withdrawMessage(e,{kind:`queue`,id:t.id}),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Xn,{className:`h-3 w-3`})}),cP(t.text)&&(0,G.jsx)(`button`,{type:`button`,title:n(`Edit`),onClick:()=>{i(t.id),o(t.text)},className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Sn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Send now`),onClick:()=>ZN.getState().sendQueuedNow(e,t.id),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Pn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Interrupt and send now`),onClick:()=>void ZN.getState().interruptAndSendQueued(e,t.id),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Kn,{className:`h-3 w-3`})}),(0,G.jsx)(`button`,{type:`button`,title:n(`Remove`),onClick:()=>ZN.getState().removeQueuedMessage(e,t.id),className:`rounded p-0.5 text-muted-foreground hover:text-destructive`,children:(0,G.jsx)(nr,{className:`h-3.5 w-3.5`})})]})]},t.id))})}var uP=0,dP=1,fP=2,pP=4;function mP(e){return()=>e}function hP(e){e()}function gP(e,t){return n=>e(t(n))}function _P(e,t){return()=>e(t)}function vP(e,t){return n=>e(t,n)}function yP(e){return e!==void 0}function bP(...e){return()=>{e.map(hP)}}function xP(){}function SP(e,t){return t(e),e}function CP(e,t){return t(e)}function wP(...e){return e}function TP(e,t){return e(dP,t)}function EP(e,t){e(uP,t)}function DP(e){e(fP)}function OP(e){return e(pP)}function kP(e,t){return TP(e,vP(t,uP))}function AP(e,t){let n=e(dP,e=>{n(),t(e)});return n}function jP(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function MP(e,t){return e===t}function NP(e=MP){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function PP(e){return t=>n=>{e(n)&&t(n)}}function FP(e){return t=>gP(t,e)}function IP(e){return t=>()=>{t(e)}}function X(e,...t){let n=VP(...t);return((t,r)=>{switch(t){case fP:DP(e);return;case dP:return TP(e,n(r))}})}function LP(e,t){return n=>r=>{n(t=e(t,r))}}function RP(e){return t=>n=>{e>0?e--:t(n)}}function zP(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function BP(...e){let t=Array.from({length:e.length}),n=0,r=null,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;TP(e,e=>{let s=n;n|=o,t[a]=e,s!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{let o=()=>{e([a].concat(t))};n===i?o():r=o}}function VP(...e){return t=>e.reduceRight(CP,t)}function HP(e){let t,n,r=()=>t?.();return function(i,a){switch(i){case dP:return a?n===a?void 0:(r(),n=a,t=TP(e,a),t):(r(),xP);case fP:r(),n=null;return}}}function Z(e){let t=e,n=WP();return((e,r)=>{switch(e){case uP:t=r;break;case dP:r(t);break;case pP:return t}return n(e,r)})}function UP(e,t){return SP(Z(t),t=>kP(e,t))}function WP(){let e=[];return((t,n)=>{switch(t){case uP:e.slice().forEach(e=>{e(n)});return;case fP:e.splice(0);return;case dP:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}})}function GP(e){return SP(WP(),t=>kP(e,t))}var KP={singleton:!0};function qP(e,t=[],n=KP){let{singleton:r}=n;return{constructor:e,dependencies:t,id:JP(),singleton:r}}var JP=()=>Symbol(`id`);function YP(e){let t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);let o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}function XP(...e){let t=WP(),n=Array.from({length:e.length}),r=0,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;TP(e,e=>{n[a]=e,r|=o,r===i&&EP(t,n)})}),function(e,a){switch(e){case fP:DP(t);return;case dP:return r===i&&a(n),TP(t,a)}}}function ZP(e,t=MP){return X(e,NP(t))}function QP(...e){return function(t,n){switch(t){case fP:return;case dP:return bP(...e.map(e=>TP(e,n)))}}}var $P={DEBUG:0,INFO:1,WARN:2,ERROR:3},eF={[$P.DEBUG]:`debug`,[$P.ERROR]:`error`,[$P.INFO]:`log`,[$P.WARN]:`warn`},tF=()=>typeof globalThis>`u`?window:globalThis,nF=qP(()=>{let e=Z($P.ERROR);return{log:Z((t,n,r=$P.INFO)=>{r>=(tF().VIRTUOSO_LOG_LEVEL??OP(e))&&console[eF[r]](`%creact-virtuoso: %c%s %o`,`color: #0253b3; font-weight: bold`,`color: initial`,t,n)}),logLevel:e}},[],{singleton:!0});function rF(e){return`self`in e?e.document.documentElement:e}function iF(e){let t=rF(e);return t.ownerDocument.defaultView.getComputedStyle(t).direction===`rtl`}function aF(e,t){return iF(e)?-t:t}function oF(e,t){return iF(e)?-t:t}function sF(e,t,n){return cF(e,t,n).callbackRef}function cF(e,t,n){let r=H.useRef(null),i=e=>{},a=H.useMemo(()=>typeof ResizeObserver<`u`?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;n.offsetParent!==null&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function lF(e,t,n,r,i,a,o,s,c){return cF(H.useCallback(n=>{let c=uF(n.children,t,s?`offsetWidth`:`offsetHeight`,i),l=n.parentElement;for(;l.dataset.virtuosoScroller===void 0;)l=l.parentElement;let u=l.lastElementChild?.dataset.viewportType===`window`,d;u&&(d=l.ownerDocument.defaultView);let f=o?s?o.scrollWidth:o.scrollHeight:u?s?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:s?l.scrollWidth:l.scrollHeight,p=o?s?o.offsetWidth:o.offsetHeight:u?s?d.innerWidth:d.innerHeight:s?l.offsetWidth:l.offsetHeight,m=o?s?aF(o,o.scrollLeft):o.scrollTop:u?s?aF(d,d.scrollX||d.document.documentElement.scrollLeft):d.scrollY||d.document.documentElement.scrollTop:s?aF(l,l.scrollLeft):l.scrollTop;r({scrollHeight:f,scrollTop:Math.max(m,0),viewportHeight:p}),a?.(s?dF(`column-gap`,getComputedStyle(n).columnGap,i):dF(`row-gap`,getComputedStyle(n).rowGap,i)),c!==null&&e(c)},[e,t,i,a,o,r,s]),n,c)}function uF(e,t,n,r){let i=e.length;if(i===0)return null;let a=[];for(let o=0;o<i;o++){let i=e.item(o);if(i.dataset.index===void 0)continue;let s=parseInt(i.dataset.index,10),c=parseFloat(i.dataset.knownSize),l=t(i,n);if(l===0&&r(`Zero-sized element, this should not happen`,{child:i},$P.ERROR),l===c)continue;let u=a[a.length-1];a.length===0||u.size!==l||u.endIndex!==s-1?a.push({endIndex:s,size:l,startIndex:s}):a[a.length-1].endIndex++}return a}function dF(e,t,n){return t!==`normal`&&t?.endsWith(`px`)!==!0&&n(`${e} was not resolved to pixel value correctly`,t,$P.WARN),t===`normal`?0:parseInt(t??`0`,10)}function fF(e,t,n){let r=H.useRef(null),i=H.useCallback(n=>{if(!n?.offsetParent)return;let i=n.getBoundingClientRect(),a=i.width,s,c;if(t){let e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),s=n+t.scrollTop}else{let e=o.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),s=i.top+e.scrollY}r.current={listHeight:i.height,offsetTop:s,visibleHeight:c,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:a,ref:o}=cF(i,!0,n),s=H.useCallback(()=>{i(o.current)},[i,o]);return H.useEffect(()=>{if(t){t.addEventListener(`scroll`,s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener(`scroll`,s),e.unobserve(t)}}let e=o.current?.ownerDocument.defaultView;return e?.addEventListener(`scroll`,s),e?.addEventListener(`resize`,s),()=>{e?.removeEventListener(`scroll`,s),e?.removeEventListener(`resize`,s)}},[s,t,o]),a}var pF=qP(()=>{let e=WP(),t=WP(),n=Z(0),r=WP(),i=Z(0),a=WP(),o=WP(),s=Z(0),c=Z(0),l=Z(0),u=Z(0),d=WP(),f=WP(),p=Z(!1),m=Z(!1),h=Z(!1);return kP(X(e,FP(({scrollTop:e})=>e)),t),kP(X(e,FP(({scrollHeight:e})=>e)),o),kP(t,i),{deviation:n,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:s,horizontalDirection:m,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:h,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),mF={lvl:0};function hF(e,t){let n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]),a=[];for(let o=1;o<n;o++){let{index:n,value:s}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=s}return a.push({end:1/0,start:r,value:i}),a}function gF(e){return e===mF}function _F(e,t){if(!gF(e))return t===e.k?e.v:t<e.k?_F(e.l,t):_F(e.r,t)}function vF(e,t,n=`k`){if(gF(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=vF(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return vF(e.l,t,n)}function yF(e,t,n){return gF(e)?AF(t,n,1):t===e.k?EF(e,{k:t,v:n}):t<e.k?jF(EF(e,{l:yF(e.l,t,n)})):jF(EF(e,{r:yF(e.r,t,n)}))}function bF(){return mF}function xF(e,t,n){if(gF(e))return[];let r=vF(e,t)[0];return ene(wF(e,r,n))}function SF(e,t){if(gF(e))return mF;let{k:n,l:r,r:i}=e;if(t===n){if(gF(r))return i;if(gF(i))return r;let[t,n]=kF(r);return TF(EF(e,{k:t,l:DF(r),v:n}))}return TF(t<n?EF(e,{l:SF(r,t)}):EF(e,{r:SF(i,t)}))}function CF(e){return gF(e)?[]:[...CF(e.l),{k:e.k,v:e.v},...CF(e.r)]}function wF(e,t,n){if(gF(e))return[];let{k:r,l:i,r:a,v:o}=e,s=[];return r>t&&(s=s.concat(wF(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(wF(a,t,n))),s}function TF(e){let{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(OF(t))return MF(EF(e,{lvl:n-1}));if(!gF(t)&&!gF(t.r))return EF(t.r,{l:EF(t,{r:t.r.l}),lvl:n,r:EF(e,{l:t.r.r,lvl:n-1})});throw Error(`Unexpected empty nodes`)}if(OF(e))return NF(EF(e,{lvl:n-1}));if(!gF(r)&&!gF(r.l)){let t=r.l,i=OF(t)?r.lvl-1:r.lvl;return EF(t,{l:EF(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:NF(EF(r,{l:t.r,lvl:i}))})}throw Error(`Unexpected empty nodes`)}function EF(e,t){return AF(t.k===void 0?e.k:t.k,t.v===void 0?e.v:t.v,t.lvl===void 0?e.lvl:t.lvl,t.l===void 0?e.l:t.l,t.r===void 0?e.r:t.r)}function DF(e){return gF(e.r)?e.l:TF(EF(e,{r:DF(e.r)}))}function OF(e){return gF(e)||e.lvl>e.r.lvl}function kF(e){return gF(e.r)?[e.k,e.v]:kF(e.r)}function AF(e,t,n,r=mF,i=mF){return{k:e,l:r,lvl:n,r:i,v:t}}function jF(e){return NF(MF(e))}function MF(e){let{l:t}=e;return!gF(t)&&t.lvl===e.lvl?EF(t,{r:EF(e,{l:t.r})}):e}function NF(e){let{lvl:t,r:n}=e;return!gF(n)&&!gF(n.r)&&n.lvl===t&&n.r.lvl===t?EF(n,{l:EF(e,{r:n.l}),lvl:t+1}):e}function ene(e){return hF(e,({k:e,v:t})=>({index:e,value:t}))}function PF(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function FF(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}var IF=qP(()=>({recalcInProgress:Z(!1)}),[],{singleton:!0});function LF(e,t,n){return e[RF(e,t,n)]}function RF(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw Error(`Failed binary finding record in array - ${e.join(`,`)}, searched for ${t}`)}function tne(e,t,n,r){let i=RF(e,t,r),a=RF(e,n,r,i);return e.slice(i,a+1)}function zF(e,t){return Math.round(e.getBoundingClientRect()[t])}function BF(e){return!gF(e.groupOffsetTree)}function VF({index:e},t){return t===e?0:t<e?-1:1}function nne(){return{groupIndices:[],groupOffsetTree:bF(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:bF()}}function rne(e,t){let n=gF(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),gF(e)){e=yF(e,0,i);continue}let o=xF(e,a-1,t+1);if(o.some(une(r)))continue;let s=!1,c=!1;for(let{end:n,start:r,value:a}of o)s?(t>=r||i===a)&&(e=SF(e,r)):(c=a!==i,s=!0),n>t&&t>=r&&a!==i&&(e=yF(e,t+1,a));c&&(e=yF(e,a,i))}return[e,n]}function ine(e){return e.groupIndex!==void 0}function ane({offset:e},t){return t===e?0:t<e?-1:1}function HF(e,t,n){if(t.length===0)return 0;let{index:r,offset:i,size:a}=LF(t,e,VF),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function UF(e,t){if(!BF(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function WF(e,t,n){if(ine(e))return t.groupIndices[e.groupIndex]+1;let r=UF(e.index===`LAST`?n:e.index,t);return r=Math.max(0,Math.min(n,r)),r}function one(e,t,n,r=0){return r>0&&(t=Math.max(t,LF(e,r,VF).offset)),hF(tne(e,t,n,ane),lne)}function sne(e,[t,n,r,i]){t.length>0&&r(`received item sizes`,t,$P.DEBUG);let a=e.sizeTree,o=a,s=0;if(n.length>0&&gF(a)&&t.length===2){let e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>yF(yF(t,n,e),n+1,r),o)}else[o,s]=rne(o,t);if(o===a)return e;let{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=KF(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>yF(e,t,HF(t,d,i)),bF()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function cne(e){return CF(e).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:i===void 0?1/0:i.k-1,size:t,startIndex:e}})}function GF(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function KF(e,t,n,r){let i=e,a=0,o=0,s=0,c=0;if(t===0)i=[];else{c=RF(i,t-1,VF),s=i[c].offset;let e=vF(n,t-1);a=e[0],o=e[1],i.length&&i[c].size===vF(n,t)[1]&&--c,i=i.slice(0,c+1)}for(let{start:e,value:c}of xF(n,t,1/0)){let t=e-a,n=t*o+s+t*r;i.push({index:e,offset:n,size:c}),a=e,s=n,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function lne(e){return{index:e.index,value:e}}function une(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}var dne={offsetHeight:`height`,offsetWidth:`width`},qF=qP(([{log:e},{recalcInProgress:t}])=>{let n=WP(),r=WP(),i=UP(r,0),a=WP(),o=WP(),s=Z(0),c=Z([]),l=Z(void 0),u=Z(void 0),d=Z(void 0),f=Z(void 0),p=Z((e,t)=>zF(e,dne[t])),m=Z(void 0),h=Z(0),g=nne(),_=UP(X(n,BP(c,e,h),LP(sne,g),NP()),g),v=UP(X(c,NP(),LP((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),FP(({prev:e})=>e)),[]);kP(X(c,PP(e=>e.length>0),BP(_,h),FP(([e,t,n])=>{let r=e.reduce((e,r,i)=>yF(e,r,HF(r,t.offsetTree,n)||i),bF());return{...t,groupIndices:e,groupOffsetTree:r}})),_),kP(X(r,BP(_),PP(([e,{lastIndex:t}])=>e<t),FP(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),kP(l,u);let y=UP(X(l,FP(e=>e===void 0)),!0);kP(X(u,PP(e=>e!==void 0&&gF(OP(_).sizeTree)),FP(e=>{let t=OP(d),n=OP(c).length>0;return t!==void 0&&t!==0?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),kP(X(f,PP(e=>e!==void 0&&e.length>0&&gF(OP(_).sizeTree)),FP(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),kP(X(c,BP(d,u),PP(([,e,t])=>e!==void 0&&t!==void 0),FP(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),o!==void 0&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);let b=GP(X(n,BP(_),LP(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:g}),FP(e=>e.changed)));TP(X(s,LP((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),FP(e=>e.diff)),e=>{let{groupIndices:n}=OP(_);if(e>0)EP(t,!0),EP(a,e+GF(e,n));else if(e<0){let t=OP(v);t.length>0&&(e-=GF(-e,t)),EP(o,e)}}),TP(X(s,BP(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},$P.ERROR)});let x=GP(a);kP(X(a,BP(_),FP(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=_F(t.sizeTree,0),a=0,o=0;for(;a<e;){let e=t.groupIndices[o],s=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),o++,a+=s+1}let s=CF(t.sizeTree);return a!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return t.prevSize!==0&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return CF(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=GP(X(o,BP(_,h),FP(([e,{offsetTree:t},n])=>HF(-e,t,n))));return kP(X(o,BP(_,h),FP(([e,t,n])=>{if(t.groupIndices.length>0){if(gF(t.sizeTree))return t;let r=bF(),i=OP(v),a=0,o=0,s=0;for(;a<-e;){s=i[o];let e=i[o+1]-s-1;o++,a+=e+1}if(r=CF(t.sizeTree).reduce((t,{k:n,v:r})=>yF(t,Math.max(0,n+e),r),r),a!==-e){let n=_F(t.sizeTree,s);r=yF(r,0,n);let i=vF(t.sizeTree,-e+1)[1];r=yF(r,1,i)}return{...t,sizeTree:r,...KF(t.offsetTree,0,r,n)}}let r=CF(t.sizeTree).reduce((t,{k:n,v:r})=>yF(t,Math.max(0,n+e),r),bF());return{...t,sizeTree:r,...KF(t.offsetTree,0,r,n)}})),_),{beforeUnshiftWith:x,data:m,defaultItemSize:u,firstItemIndex:s,fixedItemSize:l,fixedGroupSize:d,gap:h,groupIndices:c,heightEstimates:f,itemSize:p,listRefresh:b,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:_,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:a}},wP(nF,IF),{singleton:!0});function fne(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}var JF=qP(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let a=WP(),o=WP(),s=GP(X(a,FP(fne)));return kP(X(s,FP(e=>e.totalCount)),n),kP(X(s,FP(e=>e.groupIndices)),e),kP(X(XP(i,t,r),PP(([e,t])=>BF(t)),FP(([e,t,n])=>vF(t.groupOffsetTree,Math.max(e-n,0),`v`)[0]),NP(),FP(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},wP(qF,pF)),YF=qP(([{log:e}])=>{let t=Z(!1),n=GP(X(t,PP(e=>e),NP()));return TP(t,t=>{t&&OP(e)(`props updated`,{},$P.DEBUG)}),{didMount:n,propsReady:t}},wP(nF),{singleton:!0}),pne=typeof document<`u`&&`scrollBehavior`in document.documentElement.style;function XF(e){let t=typeof e==`number`?{index:e}:{...e};return t.align||=`start`,(!t.behavior||!pne)&&(t.behavior=`auto`),t.offset===void 0&&(t.offset=0),t}var ZF=qP(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{let p=WP(),m=WP(),h=Z(0),g=null,_=null,v=null;function y(){g!==null&&(g(),g=null),v!==null&&(v(),v=null),_&&=(clearTimeout(_),null),EP(c,!1)}return kP(X(p,BP(n,d,r,h,s,o,f),BP(e,a,i),FP(([[e,n,r,i,a,o,s,l],d,f,h])=>{let b=XF(e),{align:x,behavior:S,offset:C}=b,w=i-1,T=WF(b,n,w),E=HF(T,n.offsetTree,d)+o;x===`end`?(E+=f+vF(n.sizeTree,T)[1]-r+h,T===w&&(E+=s)):x===`center`?E+=(f+vF(n.sizeTree,T)[1]-r+h)/2:E-=a,C!==void 0&&C!==0&&(E+=C);let D=t=>{y(),t?(l(`retrying to scroll to`,{location:e},$P.DEBUG),EP(p,e)):(EP(m,!0),l(`list did not change, scroll successful`,{},$P.DEBUG))};if(y(),S===`smooth`){let e=!1;v=TP(t,t=>{e||=t}),g=AP(u,()=>{D(e)})}else g=AP(X(t,mne(150)),D);return _=setTimeout(()=>{y()},1200),EP(c,!0),l(`scrolling from index to`,{behavior:S,index:T,top:E},$P.DEBUG),{behavior:S,top:E}})),l),{scrollTargetReached:m,scrollToIndex:p,topListHeight:h}},wP(qF,pF,nF),{singleton:!0});function mne(e){return t=>{let n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}function QF(e,t){e===0?t():requestAnimationFrame(()=>{QF(e-1,t)})}function $F(e,t){if(e===void 0)return 0;let n=t-1,r=typeof e==`number`?e:e.index===`LAST`?n:e.index;return Math.max(0,Math.min(r,n))}function eI(e){return e===void 0?!0:typeof e==`number`?e===0:e.index===0&&(e.align===void 0||e.align===`start`)&&(e.offset===void 0||e.offset===0)}var tI=qP(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{let s=Z(!0),c=Z(0),l=Z(!0);return kP(X(o,BP(c),PP(([e,t])=>!eI(t)),IP(!1)),s),kP(X(o,BP(c),PP(([e,t])=>!eI(t)),IP(!1)),l),TP(X(XP(t,o),BP(s,n,e,l),PP(([[,e],t,{sizeTree:n},r,i])=>e&&(!gF(n)||yP(r))&&!t&&!i),BP(c)),([,e])=>{if(e===void 0){EP(s,!0),EP(l,!0);return}AP(i,()=>{EP(l,!0)}),QF(4,()=>{AP(r,()=>{EP(s,!0)}),EP(a,e)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:s}},wP(qF,pF,ZF,YF),{singleton:!0});function nI(e,t){return Math.abs(e-t)<1.01}var rI=`up`,iI=`down`,hne=`none`,gne={atBottom:!1,notAtBottomBecause:`NOT_SHOWING_LAST_ITEM`,state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},_ne=0,aI=qP(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{let o=Z(!1),s=Z(!0),c=WP(),l=WP(),u=Z(4),d=Z(_ne),f=UP(X(QP(X(ZP(i),RP(1),IP(!0)),X(ZP(i),RP(1),IP(!1),jP(100))),NP()),!1),p=UP(X(QP(X(n,IP(!0)),X(n,IP(!1),jP(200))),NP()),!1);kP(X(XP(ZP(i),ZP(d)),FP(([e,t])=>e<=t),NP()),s),kP(X(s,zP(50)),l);let m=GP(X(XP(r,ZP(a),ZP(t),ZP(e),ZP(u)),LP((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{let s=n+r-t>-o,c={scrollHeight:t,scrollTop:n,viewportHeight:r};if(s){let t,r;return n>e.state.scrollTop?(t=`SCROLLED_DOWN`,r=e.state.scrollTop-n):(t=`SIZE_DECREASED`,r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:c}}let l;return l=c.scrollHeight>e.state.scrollHeight?`SIZE_INCREASED`:r<e.state.viewportHeight?`VIEWPORT_HEIGHT_DECREASING`:n<e.state.scrollTop?`SCROLLING_UPWARDS`:`NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM`,{atBottom:!1,notAtBottomBecause:l,state:c}},gne),NP((e,t)=>e!==void 0&&e.atBottom===t.atBottom))),h=UP(X(r,LP((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!nI(e.scrollHeight,t)){let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),PP(e=>e.changed),FP(e=>e.jump)),0);kP(X(m,FP(e=>e.atBottom)),o),kP(X(o,zP(50)),c);let g=Z(iI);kP(X(r,FP(({scrollTop:e})=>e),NP(),LP((e,t)=>OP(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?rI:iI,prevScrollTop:t},{direction:iI,prevScrollTop:0}),FP(e=>e.direction)),g),kP(X(r,zP(50),IP(hne)),g);let _=Z(0);return kP(X(f,PP(e=>!e),IP(0)),_),kP(X(i,zP(100),BP(f),PP(([e,t])=>t),LP(([e,t],[n])=>[t,n],[0,0]),FP(([e,t])=>t-e)),_),{atBottomState:m,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:h,scrollDirection:g,scrollVelocity:_}},wP(pF)),oI=`top`,sI=`bottom`,cI=`none`;function lI(e,t,n){return typeof e==`number`?n===rI&&t===oI||n===iI&&t===sI?e:0:n===rI?t===oI?e.main:e.reverse:t===sI?e.main:e.reverse}function uI(e,t){return typeof e==`number`?e:e[t]??0}var dI=qP(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let a=WP(),o=Z(0),s=Z(0),c=Z(0);return{increaseViewportBy:s,listBoundary:a,overscan:c,topListHeight:o,visibleRange:UP(X(XP(ZP(r),ZP(i),ZP(n),ZP(a,FF),ZP(c),ZP(o),ZP(t),ZP(e),ZP(s)),FP(([e,t,n,[r,i],a,o,s,c,l])=>{let u=e-c,d=o+s,f=Math.max(n-u,0),p=cI,m=uI(l,oI),h=uI(l,sI);return r-=c,r+=n+s,i+=n+s,i-=c,r>e+d-m&&(p=rI),i<e-f+t+h&&(p=iI),p===cI?null:[Math.max(u-n-lI(a,oI,p)-m,0),u-f-s+t+lI(a,sI,p)+h]}),PP(e=>e!==null),NP(FF)),[0,0])}},wP(pF),{singleton:!0});function vne(e,t,n){if(BF(t)){let r=UF(e,t);return[{index:vF(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}var fI={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function pI(e,t,n,r,i,a){let{lastIndex:o,lastOffset:s,lastSize:c}=i,l=0,u=0;if(e.length>0){l=e[0].offset;let t=e[e.length-1];u=t.offset+t.size}let d=n-o,f=s+d*c+(d-1)*r,p=l,m=f-u;return{bottom:u,firstItemIndex:a,items:hI(e,i,a),offsetBottom:m,offsetTop:l,top:p,topItems:hI(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function mI(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-o>=e)break;o++}let s=e+o,c=$F(t,s);return pI(Array.from({length:s}).map((e,t)=>({data:a[t+c],index:t+c,offset:0,size:0})),[],s,i,n,r)}function hI(e,t,n){if(e.length===0)return[];if(!BF(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,a=[],o=xF(t.groupOffsetTree,r,i),s,c=0;for(let r of e){(!s||s.end<r.index)&&(s=o.shift(),c=t.groupIndices.indexOf(s.start));let e;e=r.index===s.start?{index:c,type:`group`}:{groupIndex:c,index:r.index-(c+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function gI(e,t){return e===void 0?0:typeof e==`number`?e:e[t]??0}var _I=qP(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:p},{recalcInProgress:m}])=>{let h=Z([]),g=Z(0),_=WP(),v=Z(0);kP(a.topItemsIndexes,h);let y=UP(X(XP(p,m,ZP(c,FF),ZP(i),ZP(r),ZP(l),u,ZP(h),ZP(t),ZP(n),ZP(v),e),PP(([e,t,,n,,,,,,,,r])=>{let i=r!==void 0&&r.length!==n;return e&&!t&&!i}),FP(([,,[e,t],n,r,i,a,o,s,c,l,u])=>{let d=r,{offsetTree:f,sizeTree:p}=d,m=OP(g);if(n===0)return{...fI,totalCount:n};if(e===0&&t===0)return m===0?{...fI,totalCount:n}:mI(m,i,r,s,c,u||[]);if(gF(p))return m>0?null:pI(vne($F(i,n),d,u),[],n,c,d,s);let h=[];if(o.length>0){let e=o[0],t=o[o.length-1],n=0;for(let r of xF(p,e,t)){let i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)h.push({data:u?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return pI([],h,n,c,d,s);let _=o.length>0?o[o.length-1]+1:0,v=one(f,e,t,_);if(v.length===0)return null;let y=n-1,b=SP([],n=>{for(let r of v){let i=r.value,a=i.offset,o=r.start,s=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+c)/(s+c));let t=o-r.start;a+=t*s+t*c}o<_&&(a+=(_-o)*s,o=_);let l=Math.min(r.end,y);for(let e=o;e<=l&&!(a>=t);e++)n.push({data:u?.[e],index:e,offset:a,size:s}),a+=s+c}}),x=gI(l,oI),S=gI(l,sI);if(b.length>0&&(x>0||S>0)){let e=b[0],t=b[b.length-1];if(x>0&&e.index>_){let t=Math.min(x,e.index-_),n=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=xF(p,i,i)[0]?.value??e.size;r-=t+c,n.unshift({data:u?.[i],index:i,offset:r,size:t})}b.unshift(...n)}if(S>0&&t.index<y){let e=Math.min(S,y-t.index),n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){let e=xF(p,r,r)[0]?.value??t.size;b.push({data:u?.[r],index:r,offset:n,size:e}),n+=e+c}}}return pI(b,h,n,c,d,s)}),PP(e=>e!==null),NP()),fI);kP(X(e,PP(yP),FP(e=>e?.length)),i),kP(X(y,FP(e=>e.topListHeight)),d),kP(d,s),kP(X(y,FP(e=>[e.top,e.bottom])),o),kP(X(y,FP(e=>e.items)),_);let b=GP(X(y,PP(({items:e})=>e.length>0),BP(i,e),PP(([{items:e},t])=>e[e.length-1].originalIndex===t-1),FP(([,e,t])=>[e-1,t]),NP(FF),FP(([e])=>e))),x=GP(X(y,zP(200),PP(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),FP(({items:e})=>e[0].index),NP()));return{endReached:b,initialItemCount:g,itemsRendered:_,listState:y,minOverscanItemCount:v,rangeChanged:GP(X(y,PP(({items:e})=>e.length>0),FP(({items:e})=>{let t=0,n=e.length-1;for(;e[t].type===`group`&&t<n;)t++;for(;e[n].type===`group`&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),NP(PF))),startReached:x,topItemsIndexes:h,...f}},wP(qF,JF,dI,tI,ZF,aI,YF,IF),{singleton:!0}),vI=qP(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let a=WP(),o=UP(X(XP(n,e,r,t,i),FP(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return kP(ZP(o),a),{totalListHeight:o,totalListHeightChanged:a}},wP(pF,_I),{singleton:!0}),yne=qP(([{viewportHeight:e},{totalListHeight:t}])=>{let n=Z(!1);return{alignToBottom:n,paddingTopAddition:UP(X(XP(n,e,t),PP(([e])=>e),FP(([,e,t])=>Math.max(0,e-t)),zP(0),NP()),0)}},wP(pF,vI),{singleton:!0}),yI=qP(()=>({context:Z(null)})),bne=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??`start`,...r===void 0?{}:{behavior:r}}:e>a?{...i,align:n??`end`,...r===void 0?{}:{behavior:r}}:null,bI=qP(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:c},{scrollToIndex:l}])=>{let u=WP();return kP(X(u,BP(t,c,n,a,i,r,s),BP(e),FP(([[e,t,n,r,i,a,s,c],l])=>{let{calculateViewLocation:u=bne,done:d,...f}=e,p=WF(e,t,r-1),m=HF(p,t.offsetTree,l)+i+a,h=m+vF(t.sizeTree,p)[1],g=c+a,_=u({itemBottom:h,itemTop:m,locationParams:f,viewportBottom:c+n-s,viewportTop:g});return _===null?d?.():d&&AP(X(o,PP(e=>!e),RP(OP(o)?1:2)),d),_}),PP(e=>e!==null)),l),{scrollIntoView:u}},wP(qF,pF,ZF,_I,nF),{singleton:!0});function xI(e){return e===!1?!1:e===`smooth`?`smooth`:`auto`}var xne=(e,t)=>typeof e==`function`?xI(e(t)):t&&xI(e),Sne=qP(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:s},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:p}])=>{let m=Z(!1),h=WP(),g=null;function _(e){EP(o,{align:`end`,behavior:e,index:`LAST`})}TP(X(XP(X(ZP(t),RP(1)),c),BP(ZP(m),a,s,d),FP(([[e,t],n,r,i,a])=>{let o=t&&i,s=`auto`;return o&&(s=xne(n,r||a),o&&=s!==!1),{followOutputBehavior:s,shouldFollow:o,totalCount:e}}),PP(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{g!==null&&(g(),g=null),OP(n)===void 0?g=AP(e,()=>{OP(u)(`following output to `,{totalCount:r},$P.DEBUG),_(t),g=null}):requestAnimationFrame(()=>{OP(u)(`following output to `,{totalCount:r},$P.DEBUG),_(t)})});function v(e){let t=AP(i,t=>{e&&!t.atBottom&&t.notAtBottomBecause===`SIZE_INCREASED`&&g===null&&(OP(u)(`scrolling to bottom due to increased size`,{},$P.DEBUG),_(`auto`))});setTimeout(t,100)}TP(X(XP(ZP(m),t,l),PP(([e,,t])=>e!==!1&&t),LP(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),PP(({refreshed:e})=>e),BP(m,t)),([,e])=>{OP(s)&&v(e!==!1)}),TP(h,()=>{v(OP(m)!==!1)}),TP(XP(ZP(m),i),([e,t])=>{e!==!1&&!t.atBottom&&t.notAtBottomBecause===`VIEWPORT_HEIGHT_DECREASING`&&_(`auto`)});let y=Z(null),b=WP();return kP(QP(X(ZP(r),FP(e=>e?.length??0)),X(ZP(t))),b),TP(X(XP(X(b,RP(1)),c),BP(ZP(y),s,d,f),FP(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),PP(e=>!!e),zP(0)),t=>{g!==null&&(g(),g=null),OP(n)===void 0?g=AP(e,()=>{OP(u)(`scrolling into view`,{}),EP(p,t),g=null}):requestAnimationFrame(()=>{OP(u)(`scrolling into view`,{}),EP(p,t)})}),{autoscrollToBottom:h,followOutput:m,scrollIntoViewOnChange:y}},wP(qF,aI,ZF,tI,YF,nF,pF,yI,bI)),Cne=qP(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(kP(X(s,BP(a),PP(([,e])=>e!==0),BP(i,r,t,n,e),FP(([[,e],t,n,r,i,a=[]])=>mI(e,t,n,r,i,a))),o),{}),wP(qF,tI,_I,YF),{singleton:!0}),wne=qP(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=Z(0);return TP(X(e,BP(r),PP(([,e])=>e!==0),FP(([,e])=>({top:e}))),e=>{AP(X(n,RP(1),PP(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{EP(t,e)})})}),{initialScrollTop:r}},wP(YF,pF,_I),{singleton:!0}),SI=qP(([{scrollVelocity:e}])=>{let t=Z(!1),n=WP(),r=Z(!1);return kP(X(e,BP(r,t,n),PP(([e,t])=>t!==!1&&t!==void 0),FP(([e,t,n,r])=>{let{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),NP()),t),TP(X(XP(t,e,n),BP(r)),([[e,t,n],r])=>{e&&r!==!1&&r!==void 0&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},wP(aI),{singleton:!0}),CI=qP(([{scrollContainerState:e,scrollTo:t}])=>{let n=WP(),r=WP(),i=WP(),a=Z(!1),o=Z(void 0);return kP(X(XP(n,r),FP(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),kP(X(t,BP(r),FP(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},wP(pF)),Tne=qP(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:c}])=>{let l=WP(),u=Z(void 0),d=Z(null),f=Z(null);return kP(s,d),kP(c,f),TP(X(l,BP(t,r,o,d,f,n)),([e,t,n,r,i,a,o])=>{let s=cne(t.sizeTree);r&&i!==null&&a!==null&&(n=i.scrollTop-a.offsetTop),n-=o,e({ranges:s,scrollTop:n})}),kP(X(u,PP(yP),FP(Ene)),i),kP(X(a,BP(u),PP(([,e])=>e!==void 0),NP(),FP(([,e])=>e.ranges)),e),{getState:l,restoreStateFrom:u}},wP(qF,pF,tI,YF,CI));function Ene(e){return{align:`start`,index:0,offset:e.scrollTop}}var Dne=qP(([{topItemsIndexes:e}])=>{let t=Z(0);return kP(X(t,PP(e=>e>=0),FP(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},wP(_I));function wI(e){let t=!1,n;return(()=>(t||(t=!0,n=e()),n))}var One=wI(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),TI=qP(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:s,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g},_,v,y,b,{scrollToIndex:x},S,{topItemCount:C},{groupCounts:w},T])=>{let{listState:E,minOverscanItemCount:D,topItemsIndexes:O,rangeChanged:k,...A}=b;return kP(k,T.scrollSeekRangeChanged),kP(X(XP(T.windowViewportRect,_.headerHeight,_.fixedHeaderHeight),FP(([e,t,n])=>Math.max(t+n+1,e.visibleHeight))),_.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:w,heightEstimates:s,initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:l,topItemCount:C,topItemsIndexes:O,totalCount:f,...y,groupIndices:o,itemSize:c,listState:E,minOverscanItemCount:D,scrollToIndex:x,statefulTotalCount:d,trackItemSizes:p,rangeChanged:k,...A,...T,..._,sizes:u,...v}},wP(qF,tI,pF,Tne,Sne,_I,ZF,qP(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:p},{recalcInProgress:m}])=>{let h=GP(X(c,BP(o),LP(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},s])=>{let c=r+a,l=0;return t===o&&e.length>0&&i.length>0&&(i[0].originalIndex===0&&e[0].originalIndex===0||(l=c-n,l!==0&&(l+=s))),[l,i,o,c]},[0,[],0,0]),PP(([e])=>e!==0),BP(r,s,n,i,p,m),PP(([,e,t,n,,,r])=>!r&&!n&&e!==0&&t===rI),FP(([[e],,,,,t])=>(t(`Upward scrolling compensation`,{amount:e},$P.DEBUG),e))));function g(n){n>0?(EP(t,{behavior:`auto`,top:-n}),EP(e,0)):(EP(e,0),EP(t,{behavior:`auto`,top:-n}))}return TP(X(h,BP(e,a)),([t,n,r])=>{r&&One()?EP(e,n-t):g(-t)}),TP(X(XP(UP(a,!1),e,m),PP(([e,t,n])=>!e&&!n&&t!==0),FP(([e,t])=>t),zP(1)),g),kP(X(d,FP(e=>({top:-e}))),t),TP(X(l,BP(f,u),FP(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(t.length===0)return a(e);let o=0,s=_F(r,0),c=0,l=0;for(;c<e;){c++,o+=s;let n=t.length===l+1?1/0:t[l+1]-t[l]-1;c+n>e&&(o-=s,n=e-c+1),c+=n,o+=a(n),l++}return o})),n=>{EP(e,n),requestAnimationFrame(()=>{EP(t,{top:n}),requestAnimationFrame(()=>{EP(e,0),EP(m,!1)})})}),{deviation:e}},wP(pF,aI,_I,qF,nF,IF)),Dne,JF,qP(([e,t,n,r,i,a,o,s,c,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}),wP(dI,Cne,YF,SI,vI,wne,yne,CI,bI,nF,yI))));function kne(e,t){let n={},r={},i=0,a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}var EI=typeof document>`u`?H.useEffect:H.useLayoutEffect;function DI(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=H.createContext({});function c(e,n){e.propsReady!==void 0&&EP(e.propsReady,!1);for(let i of r){let r=e[t.required[i]];EP(r,n[i])}for(let r of i)if(r in n){let i=e[t.optional[r]];EP(i,n[r])}e.propsReady!==void 0&&EP(e.propsReady,!0)}function l(e){return a.reduce((n,r)=>(n[r]=n=>{let i=e[t.methods[r]];EP(i,n)},n),{})}function u(e){return o.reduce((n,r)=>(n[r]=HP(e[t.events[r]]),n),{})}return{Component:H.forwardRef(function(t,a){let{children:d,...f}=t,[p]=H.useState(()=>SP(YP(e),e=>{c(e,f)})),[m]=H.useState(_P(u,p));EI(()=>{for(let e of o)e in f&&TP(m[e],f[e]);return()=>{Object.values(m).map(DP)}},[f,m,p]),EI(()=>{c(p,f)}),H.useImperativeHandle(a,mP(l(p)));let h=n;return(0,G.jsx)(s.Provider,{value:p,children:n===void 0?d:(0,G.jsx)(h,{...kne([...r,...i,...o],f),children:d})})}),useEmitter:(e,t)=>{let n=H.useContext(s)[e];EI(()=>TP(n,t),[t,n])},useEmitterValue:e=>{let t=H.useContext(s)[e],n=H.useCallback(e=>TP(t,e),[t]);return H.useSyncExternalStore(n,()=>OP(t),()=>OP(t))},usePublisher:e=>{let t=H.useContext(s);return H.useCallback(n=>{EP(t[e],n)},[t,e])}}}var OI=H.createContext(void 0),kI=H.createContext(void 0),AI=`-webkit-sticky`,jI=`sticky`,MI=wI(()=>{if(typeof document>`u`)return jI;let e=document.createElement(`div`);return e.style.position=AI,e.style.position===AI?AI:jI}),NI=typeof document>`u`?H.useEffect:H.useLayoutEffect;function PI(e){return`self`in e}function FI(e){return`body`in e}function II(e,t,n,r=xP,i,a){let o=H.useRef(null),s=H.useRef(null),c=H.useRef(null),l=H.useCallback(n=>{let r,i,o,l=n.target;if(FI(l)||PI(l)){let e=PI(l)?l:l.defaultView;o=a===!0?aF(e,e.scrollX):e.scrollY,r=a===!0?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a===!0?e.innerWidth:e.innerHeight}else o=a===!0?aF(l,l.scrollLeft):l.scrollTop,r=a===!0?l.scrollWidth:l.scrollHeight,i=a===!0?l.offsetWidth:l.offsetHeight;let u=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync===!0?u():qs.flushSync(u),s.current!==null&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&=(clearTimeout(c.current),null))},[e,t,a]);H.useEffect(()=>{let e=i??o.current;return r(i??o.current),l({suppressFlushSync:!0,target:e}),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r(null),e.removeEventListener(`scroll`,l)}},[o,l,n,r,i]);function u(n){let r=o.current;if(!r||(a===!0?`offsetWidth`in r&&r.offsetWidth===0:`offsetHeight`in r&&r.offsetHeight===0))return;let i=n.behavior===`smooth`,l,u,d;PI(r)?(u=Math.max(zF(r.document.documentElement,a===!0?`width`:`height`),a===!0?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),l=a===!0?r.innerWidth:r.innerHeight,d=a===!0?aF(r,r.scrollX):r.scrollY):(u=r[a===!0?`scrollWidth`:`scrollHeight`],l=zF(r,a===!0?`width`:`height`),d=a===!0?aF(r,r.scrollLeft):r.scrollTop);let f=u-l;if(n.top===void 0){r.scrollTo(n);return}let p=Math.ceil(Math.max(Math.min(f,n.top),0));if(n.top=p,nI(l,u)||p===d){e({scrollHeight:u,scrollTop:d,viewportHeight:l}),i&&t(!0);return}i?(s.current=p,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,a===!0&&(n={...n.behavior===void 0?{}:{behavior:n.behavior},left:oF(r,p)}),r.scrollTo(n)}function d(e){a===!0&&(e={...e.behavior===void 0?{}:{behavior:e.behavior},...e.top===void 0?{}:{left:oF(o.current,e.top)}}),o.current.scrollBy(e)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}function LI(e){return e}var RI=qP(([e,t])=>({...e,...t}),wP(TI,qP(()=>{let e=Z(e=>`Item ${e}`),t=Z(e=>`Group ${e}`),n=Z({}),r=Z(LI),i=Z(`div`),a=Z(xP),o=(e,t=null)=>UP(X(n,FP(t=>t[e]),NP()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o(`EmptyPlaceholder`),FooterComponent:o(`Footer`),GroupComponent:o(`Group`,`div`),groupContent:t,HeaderComponent:o(`Header`),HeaderFooterTag:i,ItemComponent:o(`Item`,`div`),itemContent:e,ListComponent:o(`List`,`div`),ScrollerComponent:o(`Scroller`,`div`),scrollerRef:a,ScrollSeekPlaceholder:o(`ScrollSeekPlaceholder`),TopItemListComponent:o(`TopItemList`)}}))),zI=({height:e})=>(0,G.jsx)(`div`,{style:{height:e}}),BI={overflowAnchor:`none`,position:MI(),zIndex:1},VI={overflowAnchor:`none`},HI={...VI,display:`inline-block`,height:`100%`},UI=H.memo(function({showTopList:e=!1}){let t=oL(`listState`),n=sL(`sizeRanges`),r=oL(`useWindowScroll`),i=oL(`customScrollParent`),a=sL(`windowScrollContainerState`),o=sL(`scrollContainerState`),s=i||r?a:o,c=oL(`itemContent`),l=oL(`context`),u=oL(`groupContent`),d=oL(`trackItemSizes`),f=oL(`itemSize`),p=oL(`log`),m=sL(`gap`),h=oL(`horizontalDirection`),{callbackRef:g}=lF(n,f,d,e?xP:s,p,m,i,h,oL(`skipAnimationFrameInResizeObserver`)),[_,v]=H.useState(0);aL(`deviation`,e=>{_!==e&&v(e)});let y=oL(`EmptyPlaceholder`),b=oL(`ScrollSeekPlaceholder`)??zI,x=oL(`ListComponent`),S=oL(`ItemComponent`),C=oL(`GroupComponent`),w=oL(`computeItemKey`),T=oL(`isSeeking`),E=oL(`groupIndices`).length>0,D=oL(`alignToBottom`),O=oL(`initialItemFinalLocationReached`),k=e?{}:{boxSizing:`border-box`,...h?{display:`inline-block`,height:`100%`,marginInlineStart:_===0?D?`auto`:0:_,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:`nowrap`}:{marginTop:_===0?D?`auto`:0:_,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...O?{}:{visibility:`hidden`}};return!e&&t.totalCount===0&&y!=null?(0,G.jsx)(y,{...YI(y,l)}):(0,G.jsx)(x,{...YI(x,l),"data-testid":e?`virtuoso-top-item-list`:`virtuoso-item-list`,ref:g,style:k,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=w(n+t.firstItemIndex,e.data,l);return T?(0,H.createElement)(b,{...YI(b,l),height:e.size,index:e.index,key:r,type:e.type||`item`,...e.type===`group`?{}:{groupIndex:e.groupIndex}}):e.type===`group`?(0,H.createElement)(C,{...YI(C,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:BI},u(e.index,l)):(0,H.createElement)(S,{...YI(S,l),...XI(S,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:h?HI:VI},E?c(e.index,e.groupIndex,e.data,l):c(e.index,e.data,l))})})}),WI={height:`100%`,outline:`none`,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},GI={outline:`none`,overflowX:`auto`,position:`relative`},KI=e=>({height:`100%`,position:`absolute`,top:0,width:`100%`,...e?{display:`flex`,flexDirection:`column`}:void 0}),qI=(e,t,n=0)=>({...KI(e),position:t?`relative`:`absolute`,top:t?-n:0}),JI={position:MI(),top:0,width:`100%`,zIndex:1};function YI(e,t){if(typeof e!=`string`)return{context:t}}function XI(e,t){return{item:typeof e==`string`?void 0:t}}var ZI=H.memo(function(){let e=oL(`HeaderComponent`),t=sL(`headerHeight`),n=oL(`HeaderFooterTag`),r=sF(H.useMemo(()=>e=>{t(zF(e,`height`))},[t]),!0,oL(`skipAnimationFrameInResizeObserver`)),i=oL(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...YI(e,i)})})}),QI=H.memo(function(){let e=oL(`FooterComponent`),t=sL(`footerHeight`),n=oL(`HeaderFooterTag`),r=sF(H.useMemo(()=>e=>{t(zF(e,`height`))},[t]),!0,oL(`skipAnimationFrameInResizeObserver`)),i=oL(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...YI(e,i)})})});function $I({useEmitter:e,useEmitterValue:t,usePublisher:n}){return H.memo(function({children:r,style:i,context:a,...o}){let s=n(`scrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`scrollerRef`),d=t(`horizontalDirection`)||!1,{scrollByCallback:f,scrollerRef:p,scrollToCallback:m}=II(s,l,c,u,void 0,d);return e(`scrollTo`,m),e(`scrollBy`,f),(0,G.jsx)(c,{"data-testid":`virtuoso-scroller`,"data-virtuoso-scroller":!0,ref:p,style:{...d?GI:WI,...i},tabIndex:0,...o,...YI(c,a),children:r})})}function eL({useEmitter:e,useEmitterValue:t,usePublisher:n}){return H.memo(function({children:r,style:i,context:a,...o}){let s=n(`windowScrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`totalListHeight`),d=t(`deviation`),f=t(`customScrollParent`),p=H.useRef(null),{scrollByCallback:m,scrollerRef:h,scrollToCallback:g}=II(s,l,c,t(`scrollerRef`),f);return NI(()=>(h.current=f??p.current?.ownerDocument.defaultView,()=>{h.current=null}),[h,f]),e(`windowScrollTo`,g),e(`scrollBy`,m),(0,G.jsx)(c,{ref:p,"data-virtuoso-scroller":!0,style:{position:`relative`,...i,...u===0?void 0:{height:u+d}},...o,...YI(c,a),children:r})})}var tL=({children:e})=>{let t=H.useContext(OI),n=sL(`viewportHeight`),r=sL(`fixedItemHeight`),i=oL(`alignToBottom`),a=oL(`horizontalDirection`),o=sF(H.useMemo(()=>gP(n,e=>zF(e,a?`width`:`height`)),[n,a]),!0,oL(`skipAnimationFrameInResizeObserver`));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`element`,ref:o,style:KI(i),children:e})},nL=({children:e})=>{let t=H.useContext(OI),n=sL(`windowViewportRect`),r=sL(`fixedItemHeight`),i=oL(`customScrollParent`),a=oL(`useWindowScroll`),o=oL(`topListHeight`),s=fF(n,i,oL(`skipAnimationFrameInResizeObserver`)),c=oL(`alignToBottom`);return H.useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`window`,ref:s,style:qI(c,a,o),children:e})},rL=({children:e})=>{let t=oL(`TopItemListComponent`)??`div`,n=oL(`headerHeight`),r={...JI,marginTop:`${n}px`},i=oL(`context`);return(0,G.jsx)(t,{style:r,...YI(t,i),children:e})},{Component:iL,useEmitter:aL,useEmitterValue:oL,usePublisher:sL}=DI(RI,{optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,scrollIntoViewOnChange:`scrollIntoViewOnChange`,itemContent:`itemContent`,groupContent:`groupContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,groupCounts:`groupCounts`,topItemCount:`topItemCount`,firstItemIndex:`firstItemIndex`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,heightEstimates:`heightEstimates`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`HeaderFooterTag`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,horizontalDirection:`horizontalDirection`,skipAnimationFrameInResizeObserver:`skipAnimationFrameInResizeObserver`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,autoscrollToBottom:`autoscrollToBottom`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},H.memo(function(e){let t=oL(`useWindowScroll`),n=oL(`topItemsIndexes`).length>0,r=oL(`customScrollParent`),i=oL(`context`);return(0,G.jsxs)(r||t?lL:cL,{...e,context:i,children:[n&&(0,G.jsx)(rL,{children:(0,G.jsx)(UI,{showTopList:!0})}),(0,G.jsxs)(r||t?nL:tL,{children:[(0,G.jsx)(ZI,{}),(0,G.jsx)(UI,{}),(0,G.jsx)(QI,{})]})]})})),cL=$I({useEmitter:aL,useEmitterValue:oL,usePublisher:sL}),lL=eL({useEmitter:aL,useEmitterValue:oL,usePublisher:sL}),uL=iL,dL=qP(([e,t])=>({...e,...t}),wP(TI,qP(()=>{let e=Z(e=>(0,G.jsxs)(`td`,{children:[`Item $`,e]})),t=Z(null),n=Z(e=>(0,G.jsxs)(`td`,{colSpan:1e3,children:[`Group `,e]})),r=Z(null),i=Z(null),a=Z({}),o=Z(LI),s=Z(xP),c=(e,t=null)=>UP(X(a,FP(t=>t[e]),NP()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c(`EmptyPlaceholder`),FillerRow:c(`FillerRow`),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`),TableBodyComponent:c(`TableBody`,`tbody`),TableComponent:c(`Table`,`table`),TableFooterComponent:c(`TableFoot`,`tfoot`),TableHeadComponent:c(`TableHead`,`thead`),TableRowComponent:c(`TableRow`,`tr`),GroupComponent:c(`Group`,`tr`)}}))),fL=({height:e})=>(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{style:{height:e}})}),pL=({height:e})=>(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{style:{border:0,height:e,padding:0}})}),mL={overflowAnchor:`none`},hL={position:MI(),zIndex:2,overflowAnchor:`none`},gL=H.memo(function({showTopList:e=!1}){let t=xL(`listState`),n=xL(`computeItemKey`),r=xL(`firstItemIndex`),i=xL(`context`),a=xL(`isSeeking`),o=xL(`fixedHeaderHeight`),s=xL(`groupIndices`).length>0,c=xL(`itemContent`),l=xL(`groupContent`),u=xL(`ScrollSeekPlaceholder`)??fL,d=xL(`GroupComponent`),f=xL(`TableRowComponent`),p=(e?t.topItems:[]).reduce((e,t,n)=>(n===0?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let m=t.originalIndex,h=n(m+r,t.data,i),g=e?m===0?0:p[m-1]:0;return a?(0,H.createElement)(u,{...YI(u,i),height:t.size,index:t.index,key:h,type:t.type||`item`}):t.type===`group`?(0,H.createElement)(d,{...YI(d,i),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,key:h,style:{...hL,top:o}},l(t.index,i)):(0,H.createElement)(f,{...YI(f,i),...XI(f,t.data),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:h,style:e?{...hL,top:o+g}:mL},s?c(t.index,t.groupIndex,t.data,i):c(t.index,t.data,i))})}),_L=H.memo(function(){let e=xL(`listState`),t=xL(`topItemsIndexes`).length>0,n=SL(`sizeRanges`),r=xL(`useWindowScroll`),i=xL(`customScrollParent`),a=SL(`windowScrollContainerState`),o=SL(`scrollContainerState`),s=i||r?a:o,c=xL(`trackItemSizes`),{callbackRef:l,ref:u}=lF(n,xL(`itemSize`),c,s,xL(`log`),void 0,i,!1,xL(`skipAnimationFrameInResizeObserver`)),[d,f]=H.useState(0);bL(`deviation`,e=>{d!==e&&(u.current.style.marginTop=`${e}px`,f(e))});let p=xL(`EmptyPlaceholder`),m=xL(`FillerRow`)??pL,h=xL(`TableBodyComponent`),g=xL(`paddingTopAddition`),_=xL(`statefulTotalCount`),v=xL(`context`);if(_===0&&p!=null)return(0,G.jsx)(p,{...YI(p,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),b=e.offsetTop+g+d-y,x=e.offsetBottom,S=b>0?(0,G.jsx)(m,{context:v,height:b},`padding-top`):null,C=x>0?(0,G.jsx)(m,{context:v,height:x},`padding-bottom`):null;return(0,G.jsxs)(h,{"data-testid":`virtuoso-item-list`,ref:l,...YI(h,v),children:[S,t&&(0,G.jsx)(gL,{showTopList:!0}),(0,G.jsx)(gL,{}),C]})}),vL=({children:e})=>{let t=H.useContext(OI),n=SL(`viewportHeight`),r=SL(`fixedItemHeight`),i=sF(H.useMemo(()=>gP(n,e=>zF(e,`height`)),[n]),!0,xL(`skipAnimationFrameInResizeObserver`));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`element`,ref:i,style:KI(!1),children:e})},yL=({children:e})=>{let t=H.useContext(OI),n=SL(`windowViewportRect`),r=SL(`fixedItemHeight`),i=xL(`customScrollParent`),a=xL(`useWindowScroll`),o=fF(n,i,xL(`skipAnimationFrameInResizeObserver`));return H.useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,G.jsx)(`div`,{"data-viewport-type":`window`,ref:o,style:qI(!1,a),children:e})},{Component:Ane,useEmitter:bL,useEmitterValue:xL,usePublisher:SL}=DI(dL,{optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,groupContent:`groupContent`,fixedHeaderContent:`fixedHeaderContent`,fixedFooterContent:`fixedFooterContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},H.memo(function(e){let t=xL(`useWindowScroll`),n=xL(`customScrollParent`),r=SL(`fixedHeaderHeight`),i=SL(`fixedFooterHeight`),a=xL(`fixedHeaderContent`),o=xL(`fixedFooterContent`),s=xL(`context`),c=sF(H.useMemo(()=>gP(r,e=>zF(e,`height`)),[r]),!0,xL(`skipAnimationFrameInResizeObserver`)),l=sF(H.useMemo(()=>gP(i,e=>zF(e,`height`)),[i]),!0,xL(`skipAnimationFrameInResizeObserver`)),u=n||t?wL:CL,d=n||t?yL:vL,f=xL(`TableComponent`),p=xL(`TableHeadComponent`),m=xL(`TableFooterComponent`),h=a?(0,G.jsx)(p,{ref:c,style:{position:`sticky`,top:0,zIndex:2},...YI(p,s),children:a()},`TableHead`):null,g=o?(0,G.jsx)(m,{ref:l,style:{bottom:0,position:`sticky`,zIndex:1},...YI(m,s),children:o()},`TableFoot`):null;return(0,G.jsx)(u,{...e,...YI(u,s),children:(0,G.jsx)(d,{children:(0,G.jsxs)(f,{style:{borderSpacing:0,overflowAnchor:`none`},...YI(f,s),children:[h,(0,G.jsx)(_L,{},`TableBody`),g]})})})})),CL=$I({useEmitter:bL,useEmitterValue:xL,usePublisher:SL}),wL=eL({useEmitter:bL,useEmitterValue:xL,usePublisher:SL}),TL={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},EL={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:DL,floor:OL,max:kL,min:AL,round:jL}=Math;function ML(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:n===null?null:n[r+e],index:r+e}))}function NL(e){return{...EL,items:e}}function PL(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function FL(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}var IL=qP(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,p,{didMount:m,propsReady:h},{customScrollParent:g,useWindowScroll:_,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b},x])=>{let S=Z(0),C=Z(0),w=Z(TL),T=Z({height:0,width:0}),E=Z({height:0,width:0}),D=WP(),O=WP(),k=Z(0),A=Z(null),j=Z({column:0,row:0}),M=WP(),N=WP(),P=Z(!1),F=Z(0),I=Z(!0),ee=Z(!1),L=Z(!1);TP(X(m,BP(F),PP(([e,t])=>!eI(t))),()=>{EP(I,!1)}),TP(X(XP(m,I,E,T,F,ee),PP(([e,t,n,r,,i])=>e&&!t&&n.height!==0&&r.height!==0&&!i)),([,,,,e])=>{if(e===void 0){EP(I,!0);return}EP(ee,!0),QF(1,()=>{EP(D,e)}),AP(X(l),()=>{EP(t,[0,0]),EP(I,!0)})}),kP(X(N,PP(e=>e!=null&&e.scrollTop>0),IP(0)),C),TP(X(m,BP(N),PP(([,e])=>e!=null)),([,e])=>{e&&(EP(T,e.viewport),EP(E,e.item),EP(j,e.gap),e.scrollTop>0&&(EP(P,!0),AP(X(l,RP(1)),e=>{EP(P,!1)}),EP(c,{top:e.scrollTop})))}),kP(X(T,FP(({height:e})=>e)),d),kP(X(XP(ZP(T,PL),ZP(E,PL),ZP(j,(e,t)=>e!==void 0&&e.column===t.column&&e.row===t.row),ZP(l)),FP(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),M),kP(X(XP(ZP(S),r,ZP(j,FL),ZP(E,PL),ZP(T,PL),ZP(A),ZP(C),ZP(P),ZP(I),ZP(F)),PP(([,,,,,,,e])=>!e),FP(([e,[t,n],r,i,a,o,s,,c,l])=>{let{column:u,row:d}=r,{height:f,width:p}=i,{width:m}=a;if(s===0&&(e===0||m===0))return TL;if(p===0){let t=$F(l,e);return NL(ML(t,t+Math.max(s-1,0),o))}let h=LL(m,p,u),g,_;c?t===0&&n===0&&s>0?(g=0,_=s-1):(g=h*OL((t+d)/(f+d)),_=h*DL((n+d)/(f+d))-1,_=AL(e-1,kL(_,h-1)),g=AL(_,kL(0,g))):(g=0,_=-1);let v=ML(g,_,o),{bottom:y,top:b}=RL(a,r,i,v),x=DL(e/h);return{bottom:y,itemHeight:f,items:v,itemWidth:p,offsetBottom:x*f+(x-1)*d-y,offsetTop:b,top:b}})),w),kP(X(A,PP(e=>e!==null),FP(e=>e.length)),S),kP(X(XP(T,E,w,j),PP(([e,t,{items:n}])=>n.length>0&&t.height!==0&&e.height!==0),FP(([e,t,{items:n},r])=>{let{bottom:i,top:a}=RL(e,r,t,n);return[a,i]}),NP(FF)),t);let te=Z(!1);kP(X(l,BP(te),FP(([e,t])=>t||e!==0)),te);let R=GP(X(XP(w,S),PP(([{items:e}])=>e.length>0),BP(te),PP(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&e.offsetBottom===0&&e.items.length===t)&&r}),FP(([[,e]])=>e-1),NP())),z=GP(X(ZP(w),PP(({items:e})=>e.length>0&&e[0].index===0),IP(0),NP())),ne=GP(X(ZP(w),BP(P),PP(([{items:e},t])=>e.length>0&&!t),FP(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),NP(PF),zP(0)));kP(ne,p.scrollSeekRangeChanged),kP(X(D,BP(T,E,S,j),FP(([e,t,n,r,i])=>{let a=XF(e),{align:o,behavior:s,offset:c}=a,l=a.index;l===`LAST`&&(l=r-1),l=kL(0,l,AL(r-1,l));let u=zL(t,i,n,l);return o===`end`?u=jL(u-t.height+n.height):o===`center`&&(u=jL(u-t.height/2+n.height/2)),c!==void 0&&c!==0&&(u+=c),{behavior:s,top:u}})),c);let re=UP(X(w,FP(e=>e.offsetBottom+e.bottom)),0);return kP(X(b,FP(e=>({height:e.visibleHeight,width:e.visibleWidth}))),T),{customScrollParent:g,data:A,deviation:k,footerHeight:i,gap:j,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:E,overscan:n,restoreStateFrom:N,scrollBy:o,scrollContainerState:s,scrollHeight:O,scrollTo:c,scrollToIndex:D,scrollTop:l,smoothScrollTargetReached:u,totalCount:S,useWindowScroll:_,viewportDimensions:T,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b,...p,gridState:w,horizontalDirection:L,initialTopMostItemIndex:F,totalListHeight:re,...f,endReached:R,propsReady:h,rangeChanged:ne,startReached:z,stateChanged:M,stateRestoreInProgress:P,...x}},wP(dI,pF,aI,SI,YF,CI,nF));function LL(e,t,n){return kL(1,OL((e+n)/(OL(t)+n)))}function RL(e,t,n,r){let{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};let a=zL(e,t,n,r[0].index);return{bottom:zL(e,t,n,r[r.length-1].index)+i,top:a}}function zL(e,t,n,r){let i=OL(r/LL(e.width,n.width,t.column)),a=i*n.height+kL(0,i-1)*t.row;return a>0?a+t.row:a}var BL=qP(([e,t])=>({...e,...t}),wP(IL,qP(()=>{let e=Z(e=>`Item ${e}`),t=Z({}),n=Z(null),r=Z(`virtuoso-grid-item`),i=Z(`virtuoso-grid-list`),a=Z(LI),o=Z(`div`),s=Z(xP),c=(e,n=null)=>UP(X(t,FP(t=>t[e]),NP()),n),l=Z(!1),u=Z(!1);return kP(ZP(u),l),{components:t,computeItemKey:a,context:n,FooterComponent:c(`Footer`),HeaderComponent:c(`Header`),headerFooterTag:o,itemClassName:r,ItemComponent:c(`Item`,`div`),itemContent:e,listClassName:i,ListComponent:c(`List`,`div`),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`,`div`)}}))),VL=H.memo(function(){let e=qL(`gridState`),t=qL(`listClassName`),n=qL(`itemClassName`),r=qL(`itemContent`),i=qL(`computeItemKey`),a=qL(`isSeeking`),o=JL(`scrollHeight`),s=qL(`ItemComponent`),c=qL(`ListComponent`),l=qL(`ScrollSeekPlaceholder`),u=qL(`context`),d=JL(`itemDimensions`),f=JL(`gap`),p=qL(`log`),m=qL(`stateRestoreInProgress`),h=JL(`reportReadyState`),g=sF(H.useMemo(()=>e=>{let t=e.parentElement.parentElement.scrollHeight;o(t);let n=e.firstChild;if(n!==null){let{height:e,width:t}=n.getBoundingClientRect();d({height:e,width:t})}f({column:ZL(`column-gap`,getComputedStyle(e).columnGap,p),row:ZL(`row-gap`,getComputedStyle(e).rowGap,p)})},[o,d,f,p]),!0,!1);return NI(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),m?null:(0,G.jsx)(c,{className:t,ref:g,...YI(c,u),"data-testid":`virtuoso-item-list`,style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let o=i(t.index,t.data,u);return a?(0,G.jsx)(l,{...YI(l,u),height:e.itemHeight,index:t.index,width:e.itemWidth},o):(0,H.createElement)(s,{...YI(s,u),className:n,"data-index":t.index,key:o},r(t.index,t.data,u))})})}),HL=H.memo(function(){let e=qL(`HeaderComponent`),t=JL(`headerHeight`),n=qL(`headerFooterTag`),r=sF(H.useMemo(()=>e=>{t(zF(e,`height`))},[t]),!0,!1),i=qL(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...YI(e,i)})})}),UL=H.memo(function(){let e=qL(`FooterComponent`),t=JL(`footerHeight`),n=qL(`headerFooterTag`),r=sF(H.useMemo(()=>e=>{t(zF(e,`height`))},[t]),!0,!1),i=qL(`context`);return e==null?null:(0,G.jsx)(n,{ref:r,children:(0,G.jsx)(e,{...YI(e,i)})})}),WL=({children:e})=>{let t=H.useContext(kI),n=JL(`itemDimensions`),r=JL(`viewportDimensions`),i=sF(H.useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,G.jsx)(`div`,{ref:i,style:KI(!1),children:e})},GL=({children:e})=>{let t=H.useContext(kI),n=JL(`windowViewportRect`),r=JL(`itemDimensions`),i=qL(`customScrollParent`),a=qL(`useWindowScroll`),o=fF(n,i,!1);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,G.jsx)(`div`,{ref:o,style:qI(!1,a),children:e})},{Component:jne,useEmitter:KL,useEmitterValue:qL,usePublisher:JL}=DI(BL,{optional:{context:`context`,totalCount:`totalCount`,overscan:`overscan`,itemContent:`itemContent`,components:`components`,computeItemKey:`computeItemKey`,data:`data`,initialItemCount:`initialItemCount`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`headerFooterTag`,listClassName:`listClassName`,itemClassName:`itemClassName`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,restoreStateFrom:`restoreStateFrom`,initialTopMostItemIndex:`initialTopMostItemIndex`,increaseViewportBy:`increaseViewportBy`},methods:{scrollTo:`scrollTo`,scrollBy:`scrollBy`,scrollToIndex:`scrollToIndex`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,stateChanged:`stateChanged`,readyStateChanged:`readyStateChanged`}},H.memo(function({...e}){let t=qL(`useWindowScroll`),n=qL(`customScrollParent`),r=n||t?XL:YL,i=n||t?GL:WL,a=qL(`context`);return(0,G.jsx)(r,{...e,...YI(r,a),children:(0,G.jsxs)(i,{children:[(0,G.jsx)(HL,{}),(0,G.jsx)(VL,{}),(0,G.jsx)(UL,{})]})})})),YL=$I({useEmitter:KL,useEmitterValue:qL,usePublisher:JL}),XL=eL({useEmitter:KL,useEmitterValue:qL,usePublisher:JL});function ZL(e,t,n){return t!==`normal`&&t?.endsWith(`px`)!==!0&&n(`${e} was not resolved to pixel value correctly`,t,$P.WARN),t===`normal`?0:parseInt(t??`0`,10)}function QL({name:e,color:t}){return(0,G.jsx)(No,{name:e,variant:`beam`,colors:to(t),size:`100%`,className:`absolute inset-0 h-full w-full`})}var $L=2e3,eR=6e4;function tR(){let e=globalThis[c];return typeof e==`string`?e:null}function nR(e,t,n){let r=$L,i=!1,a,o=()=>{t(e).then(e=>{if(!i){if(e)return n();r=Math.min(r*2,eR),a=setTimeout(o,r)}})};return a=setTimeout(o,r),()=>{i=!0,clearTimeout(a)}}var rR=e=>new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e});function iR(e){let t=tR();!t||typeof caches>`u`||Ae(caches,t,e).catch(()=>{})}var aR=`#7c5cff`;function oR({name:e,color:t,image:n,className:r,enso:i}){let[a,o]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!(!n||a!==n||!tR()))return nR(n,rR,()=>o(null))},[a,n]),n&&a!==n?(0,G.jsx)(`img`,{"data-enso":i,"data-image":`true`,src:n,alt:``,draggable:!1,onError:()=>o(n),className:W(`object-cover`,r),style:t?{backgroundColor:t}:void 0}):(0,G.jsx)(`span`,{"data-enso":i,"data-generated":`true`,className:W(`relative block shrink-0 overflow-hidden`,r),children:(0,G.jsx)(QL,{name:e.trim()||`secretary`,color:t??aR})})}var sR={xs:`size-6 rounded-[8px] text-[11.5px]`,sm:`size-[22px] rounded-[7px] text-[11.5px]`,md:`size-7 rounded-[9px] text-[13px]`,lg:`size-11 rounded-[13px] text-base`};function cR({name:e,color:t,image:n,needsYou:r,running:i,size:a=`md`,enso:o=`secretary-avatar`}){let s=r>0?`warn`:i>0?`run`:null;return(0,G.jsxs)(`span`,{"data-enso":o,"data-image":n?`true`:void 0,className:W(`relative flex shrink-0`,sR[a]),children:[(0,G.jsx)(oR,{name:e,color:t,image:n,enso:`${o}-face`,className:`size-full overflow-hidden rounded-[inherit]`}),s&&(0,G.jsx)(`span`,{"data-enso":`secretary-pip`,"data-tone":s,className:W(`absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-background`,s===`warn`?`bg-warning`:`bg-success`)})]})}var lR=e=>e===`oauth-credentials-unloaded`||e===`oauth-credentials-loading`||e===`oauth-credentials-error`;function uR(e){switch(e.oauthCredentials.status){case`unloaded`:return{reason:`oauth-credentials-unloaded`,suggestedAction:`load-oauth-credentials`};case`loading`:return{reason:`oauth-credentials-loading`,suggestedAction:`wait-for-oauth-credentials`};case`error`:return{reason:`oauth-credentials-error`,suggestedAction:`retry-oauth-credentials`,credentialError:e.oauthCredentials.error};case`ready`:return null}}function dR(e,t,n,r){if(!e)return`missing-selection`;if(_j(e)){if(!r)return`provider-missing`;let i=vj(r,e);return i?i.enabled?dR(i.primary,t,n):`model-disabled`:`model-missing`}let i=t.find(t=>t.id===e.providerId);if(!i)return`provider-missing`;if(!i.enabled)return`provider-disabled`;if(ge(i))return`classifier-only`;let a=i.models.find(t=>t.id===e.modelId);return a?a.enabled===!1?`model-disabled`:i.oauthAccountPool!==void 0&&!D(i)?`oauth-account-missing`:i.oauthAccountKey?n.oauthCredentials.status===`ready`?D(i)?u(i,e.modelId,t,n.oauthCredentials.authenticatedAccountKeys).length>0?`usable`:`oauth-account-missing`:n.oauthCredentials.authenticatedAccountKeys.has(i.oauthAccountKey)?`usable`:`oauth-account-missing`:uR(n)?.reason??`oauth-credentials-error`:i.apiKey?`usable`:`api-key-missing`:`model-missing`}function fR(e,t){let n=e?.groupId?t.find(t=>t.id===e.groupId):void 0;return{projectDefaultModel:e?.defaultModel??null,groupDefaultModel:n?.defaultModel??null,projectReasoningEnabled:e?.defaultReasoningEnabled,projectThinkingLevel:e?.defaultThinkingLevel,groupReasoningEnabled:n?.defaultReasoningEnabled,groupThinkingLevel:n?.defaultThinkingLevel}}function pR(e){let t=dR(e.defaultModel,e.providers,e.credentials,e.virtualModels),n=e.defaultModel!==null&&t!==`usable`&&!lR(t),r=[{selection:e.lastProviderId&&e.lastModelId?{providerId:e.lastProviderId,modelId:e.lastModelId}:null,source:`session`},{selection:e.projectDefaultModel??null,source:`project`},{selection:e.groupDefaultModel??null,source:`group`},{selection:e.defaultModel,source:`default`}];for(let t of r){let r=dR(t.selection,e.providers,e.credentials,e.virtualModels);if(r===`usable`&&t.selection)return{...t.selection,source:t.source,invalidDefault:t.source!=="default"&&n};if(lR(r)){let t=uR(e.credentials);if(t)return{providerId:null,modelId:null,source:`none`,invalidDefault:n,...t}}}return{providerId:null,modelId:null,source:`none`,invalidDefault:n,...(lR(t)?uR(e.credentials):null)??{reason:`no-usable-model`}}}var mR={revision:0,availability:{status:`unloaded`}},hR=SN(()=>({snapshot:mR}));function gR(e){return{oauthCredentials:e.availability}}var _R=SN(()=>({snapshot:void 0}));function vR(){return xj(T.getState().providers,_R.getState().snapshot)}function yR(e){new Set(e)}function bR(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var xR=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return xR(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return xR(t)(e)}}}},SR=(e,t)=>(n,r,i)=>{let a={storage:bR(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return xR(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},CR=e=>{if(typeof e!=`string`||!e.startsWith(`plugin:`))return!1;let t=e.indexOf(`:`,7);return t>7&&t<e.length-1};function wR(e,t,n){if(!t)return!1;let r=e.uiByConversation[t]?.open;return r===void 0?!n&&e.liveGlobalTabs.length>0:r}function TR(e){let t=Array.isArray(e.globalTabs)?e.globalTabs.filter(CR):[],n=e.globalScopeOverrides,r={};if(n&&typeof n==`object`&&!Array.isArray(n))for(let[e,t]of Object.entries(n))CR(e)&&(t===`global`||t===`session`)&&(r[e]=t);return{globalTabs:[...new Set(t)],globalScopeOverrides:r}}function ER(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function DR(e,t){if(ER(e)){if(e.type===`leaf`){let n=ER(e.data)?e.data:void 0,r=Array.isArray(n?.views)?n.views.filter(e=>typeof e==`string`&&t.has(e)):[];if(r.length===0)return;let i=n?.views,a=i.indexOf(n?.activeView),o=typeof n?.activeView==`string`&&t.has(n.activeView)?n.activeView:[...i.slice(0,Math.max(a,0)).reverse(),...i.slice(a+1)].find(e=>typeof e==`string`&&t.has(e))??r[0];return{type:`leaf`,data:{...n,views:r,activeView:o},size:e.size}}if(e.type===`branch`){let n=Array.isArray(e.data)?e.data.flatMap(e=>{let n=DR(e,t);return n?[n]:[]}):[];return n.length===0?void 0:{type:`branch`,data:n,size:e.size}}}}function OR(e,t){return!e||!ER(e.panels)||!(t in e.panels)?e:kR(e,e=>e!==t)}function kR(e,t){if(!ER(e)||!ER(e.panels))return;let n={};for(let[r,i]of Object.entries(e.panels))t(r,i)&&(n[r]=i);let r=new Set(Object.keys(n));if(r.size===0)return;let i=ER(e.grid)?e.grid:void 0,a=i?DR(i.root,r):void 0;if(a)return{...e,panels:n,grid:{...i,root:a}}}var AR=4,jR=e=>{if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null};function MR(e){if(!jR(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(!jR(r))continue;let e={};for(let[t,n]of Object.entries(r))typeof n==`string`&&(e[t]=n);Object.keys(e).length>0&&(t[n]=e)}return t}function NR(e,t){let n=jR(e)?e:{};if(t<2)return{state:{uiByConversation:{},layouts:{}},snapshots:{}};if(t<AR)return{state:{uiByConversation:t<3?{}:n.uiByConversation??{},layouts:n.layouts??{},changesModeByConversation:n.changesModeByConversation??{}},snapshots:MR(n.snapshotsByConversation)};let{snapshotsByConversation:r,...i}=n;return{state:i,snapshots:{}}}function PR(e,t){let{state:n,snapshots:r}=NR(e,t);return{state:{...n,...TR(n)},snapshots:r}}function FR(e){return typeof e!=`number`||!Number.isFinite(e)?224:Math.min(480,Math.max(160,e))}function IR(e,t){let n=FR(e);if(t<=0)return n;let r=Math.max(224,t-240-1);return Math.min(n,r)}function LR(e,t,n){let r=IR(e,n),i=IR(r+t,n);return i===r?FR(e):i}function RR(e,t,n=1){let r=Math.max(280,e);if(t<=0)return r;let i=Math.max(0,t-360-n);return Math.min(i,r)}function zR(e,t,n,r=1){let i=RR(e,n,r),a=RR(i+t,n,r);return a===i?e:a}function BR(){return ZN.getState().activeId??void 0}function VR(e,t){return e.uiByConversation[t]??{width:e.lastWidth}}function HR(e,t){return wR(e,t,YD())}function UR(e,t,n){return{...e.fullscreenByConversation,[t]:n}}function WR(e,t,n){return{...e.uiByConversation,[t]:{...VR(e,t),...n}}}var GR=SN()(SR((e,t)=>({fullscreen:!1,fullscreenByConversation:{},lastWidth:360,filesTreeWidth:224,uiByConversation:{},browserHoles:{},layouts:{},pinnedTabs:[],globalTabs:[],globalScopeOverrides:{},liveGlobalTabs:[],changesModeByConversation:{},snapshotsByConversation:{},toggleOpen:()=>{let n=BR();if(!n)return;let r=!HR(t(),n);e({uiByConversation:WR(t(),n,{open:r}),fullscreen:r?t().fullscreen:!1,fullscreenByConversation:UR(t(),n,r?t().fullscreen:!1)})},reconcileForActiveConversation:()=>{let n=BR(),r=n?t().fullscreenByConversation[n]??!1:!1;r!==t().fullscreen&&e({fullscreen:r})},ensureOpen:n=>{let r=n??BR();!r||VR(t(),r).open||e({uiByConversation:WR(t(),r,{open:!0})})},nudgeWidth:(n,r,i)=>{let a=BR();if(!a)return;let o=zR(VR(t(),a).width,n,r,i);e({uiByConversation:WR(t(),a,{width:o}),lastWidth:o})},nudgeFilesTreeWidth:(n,r=0)=>{let i=LR(t().filesTreeWidth,n,r);i!==t().filesTreeWidth&&e({filesTreeWidth:i})},resetFilesTreeWidth:()=>e({filesTreeWidth:224}),toggleFullscreen:()=>{let n=BR();if(!n)return;let{fullscreen:r}=t();if(!HR(t(),n)){e({uiByConversation:WR(t(),n,{open:!0}),fullscreen:!0,fullscreenByConversation:UR(t(),n,!0)});return}e({fullscreen:!r,fullscreenByConversation:UR(t(),n,!r)})},setFullscreen:n=>{let r=BR();if(n&&r){e({fullscreen:!0,uiByConversation:WR(t(),r,{open:!0}),fullscreenByConversation:UR(t(),r,!0)});return}e({fullscreen:n,...r?{fullscreenByConversation:UR(t(),r,n)}:{}})},togglePinnedTab:n=>{let r=t().pinnedTabs,i=Array.isArray(r)?r:[];e({pinnedTabs:i.includes(n)?i.filter(e=>e!==n):[...i,n]})},setBrowserHole:(n,r)=>{let{[n]:i,...a}=t().browserHoles;!r&&!i||e({browserHoles:r?{...a,[n]:r}:a})},setGlobalTabs:t=>e({globalTabs:t}),setGlobalScopeOverride:(n,r)=>{let{[n]:i,...a}=t().globalScopeOverrides;e({globalScopeOverrides:r?{...a,[n]:r}:a})},setLiveGlobalTabs:n=>{let r=t().liveGlobalTabs;r.length===n.length&&r.every((e,t)=>e===n[t])||e({liveGlobalTabs:n})},dropPanelFromLayouts:(n,r)=>{let{layouts:i,uiByConversation:a}=t(),o={...i},s={...a},c=!1;for(let[e,t]of Object.entries(i)){if(r.has(e))continue;let i=OR(t,n);if(i===t)continue;c=!0,o[e]=i;let l=a[e];!i&&l?.open===!0&&(s[e]={...l,open:!1})}c&&e({layouts:o,uiByConversation:s})},saveLayout:(n,r)=>{ZN.getState().conversations[n]&&e({layouts:{...t().layouts,[n]:r}})},forgetConversation:n=>{let{[n]:r,...i}=t().layouts,{[n]:a,...o}=t().uiByConversation,{[n]:s,...c}=t().fullscreenByConversation,{[n]:l,...u}=t().changesModeByConversation,{[n]:d,...f}=t().snapshotsByConversation;e({layouts:i,uiByConversation:o,fullscreenByConversation:c,changesModeByConversation:u,snapshotsByConversation:f})},setChangesMode:(n,r)=>{e({changesModeByConversation:{...t().changesModeByConversation,[n]:r}})},saveSnapshots:(n,r)=>{e({snapshotsByConversation:{...t().snapshotsByConversation,[n]:r}}),window.electronAPI.changes.writeSnapshots({conversationId:n,snapshots:r})},loadSnapshots:n=>{if(n in t().snapshotsByConversation)return;let r=r=>{n in t().snapshotsByConversation||e({snapshotsByConversation:{...t().snapshotsByConversation,[n]:r}})};window.electronAPI.changes.readSnapshots({conversationId:n}).then(r,()=>r({}))}}),{name:`enso-side-panel`,version:5,storage:bR(()=>localStorage),partialize:e=>({lastWidth:e.lastWidth,filesTreeWidth:e.filesTreeWidth,uiByConversation:e.uiByConversation,fullscreenByConversation:e.fullscreenByConversation,layouts:e.layouts,pinnedTabs:e.pinnedTabs,globalTabs:e.globalTabs,globalScopeOverrides:e.globalScopeOverrides,changesModeByConversation:e.changesModeByConversation}),merge:(e,t)=>{let n=e&&typeof e==`object`?e:{};return{...t,...n,...TR(n)}},migrate:(e,t)=>{let{state:n,snapshots:r}=PR(e,t),i=window.electronAPI?.changes;if(i)for(let[e,t]of Object.entries(r))i.writeSnapshots({conversationId:e,snapshots:t});return n}})),KR=`Let's set you up. Ask me a few questions about what to call me, which model you should use, and how much you may do on your own. Then submit the draft with secretary_profile_propose and wait for my confirmation.`,qR={enabled:!1,projectId:null,profile:null,persona:``,board:{needsYou:[],running:[],done:[],todos:[]},proposals:{},takeovers:[]};function JR(e,t){return t&&e.some(e=>e.id===t)?t:e[0]?.id??null}function YR(e){yR(Object.values(e).flatMap(e=>e.takeovers.map(e=>e.conversationId)))}function XR(e){return e?ZR.getState().secretaries.find(t=>t.projectId===e)?.id??null:null}var ZR=SN()((e,t)=>({secretary:qR,secretaries:[],states:{},focusedId:null,resolving:{},welcomeOpen:!1,focusProposal:null,focus:n=>{let{states:r,focusedId:i}=t();i===n&&r[n]||(e({focusedId:n,secretary:r[n]??qR,welcomeOpen:!1}),r[n]||t().reload(n))},reload:async n=>{let r=n??t().focusedId;if(!r)return;let i=await window.electronAPI.secretary.getState(r).catch(()=>null);i&&e(e=>({states:{...e.states,[r]:i},...e.focusedId===r?{secretary:i}:{}}))},createSecretary:async()=>{let n=await window.electronAPI.secretary.create();return n.ok?(e({secretaries:await window.electronAPI.secretary.list()}),t().focus(n.secretaryId),e({welcomeOpen:!0}),n.secretaryId):null},openWelcome:()=>e({welcomeOpen:!0}),closeWelcome:()=>e({welcomeOpen:!1}),focusProposalCard:t=>e({focusProposal:{proposalId:t,at:Date.now()}}),clearFocusProposal:()=>e({focusProposal:null}),bind:()=>{let n=new Set,r=!0,i=n=>{let r=n.secretaryId??t().focusedId;r&&e(e=>{let t={...e.states,[r]:n};YR(t);let i=JR(e.secretaries,e.focusedId)??r;if(i!==r)return{states:t,focusedId:i};let a=e.states[r]??e.secretary;return{states:t,focusedId:i,secretary:n,welcomeOpen:n.profile?!1:a.profile!==null&&a.enabled?!0:e.welcomeOpen}})},a=window.electronAPI.secretary.onStateChanged(e=>{e.secretaryId&&n.add(e.secretaryId),i(e)}),o=window.electronAPI.secretary.onListChanged(t=>{iR(t.map(e=>e.id)),e(e=>{let n=new Set(t.map(e=>e.id)),r=Object.fromEntries(Object.entries(e.states).filter(([e])=>n.has(e))),i=JR(t,e.focusedId);return YR(r),{secretaries:t,states:r,focusedId:i,secretary:i&&r[i]||(i===e.focusedId?e.secretary:qR)}})});window.electronAPI.secretary.list().then(async t=>{if(r){iR(t.map(e=>e.id)),e(e=>({secretaries:t,focusedId:JR(t,e.focusedId)}));for(let e of t){let t=await window.electronAPI.secretary.getState(e.id);!r||n.has(e.id)||i({...t,secretaryId:t.secretaryId??e.id})}}}).catch(()=>void 0);let s=window.electronAPI.secretary.onOpenConversation(e=>{ZN.getState().selectConversation(e.conversationId),GR.getState().ensureOpen(e.conversationId),e.proposalId&&t().focusProposalCard(e.proposalId)}),c=ZN.subscribe((e,n)=>{if(e.activeId===n.activeId)return;let r=XR(e.activeId?e.conversations[e.activeId]?.projectId:void 0);r&&t().focus(r)});return()=>{r=!1,a(),o(),s(),c(),yR([]),e({secretary:qR,secretaries:[],states:{},focusedId:null,welcomeOpen:!1,focusProposal:null})}},newSecretaryConversation:async e=>{let{states:n,secretary:r,secretaries:i}=t(),a=e?.secretaryId?n[e.secretaryId]:r;e?.secretaryId&&t().focus(e.secretaryId);let o=a?.projectId??(e?.secretaryId?i.find(t=>t.id===e.secretaryId)?.projectId:null);if(!o)return null;let s=T.getState().projects.find(e=>e.id===o);if(!s)return null;let c=e?.greeting?QR(o):null;if(e?.greeting&&!c)return null;let l=ZN.getState(),u=await l.newConversation(o);if(!u)return null;if(c){let e=Es(T.getState().language);await l.send(Os(e,KR),{...c,cwd:s.path},void 0,u)}return u},resolveProposal:async(n,r,i,a)=>{e({resolving:{...t().resolving,[n]:!0}});try{await window.electronAPI.secretary.resolveProposal(n,r,i,a)}catch{}finally{let r={...t().resolving};delete r[n],e({resolving:r})}}}));function QR(e){let t=T.getState(),n=t.projects.find(t=>t.id===e);if(!n)return null;let r=pR({defaultModel:t.defaultModel,...fR(n,t.projectGroups),providers:vR(),credentials:gR(hR.getState().snapshot),virtualModels:t.virtualModels});return r.source===`none`?null:{providerId:r.providerId,modelId:r.modelId}}function $R(){let e=ZR(e=>e.secretary.enabled?e.secretary.profile:null),t=ZR(e=>e.secretary.secretaryId??void 0);if(!e)return null;let n=e.avatar.imageVersion;return{name:e.name.trim()||`·`,color:e.avatar.color,...n?{image:F(n,e.avatar.imageHash,t)}:{}}}function ez(e){return typeof e!=`number`||!Number.isInteger(e)?5:e<1?1:e>60?60:e}function tz(e){return ez(e)*1e3}var nz=new Set(`ls.tree.pwd.cd.cat.bat.head.tail.wc.nl.tac.less.more.rg.grep.egrep.fgrep.ag.find.fd.fdfind.which.type.file.stat.du.df.sort.uniq.cut.tr.awk.sed.diff.jq.yq.echo.printf.basename.dirname.realpath.readlink.printenv.date.whoami.uname.column.true.test.[.git`.split(`.`)),rz=new Set([`status`,`log`,`diff`,`show`,`blame`,`grep`,`ls-files`,`ls-tree`,`rev-parse`,`describe`,`shortlog`,`reflog`,`cat-file`,`name-rev`,`remote`,`config`,`branch`,`tag`]),iz={sed:/^(-[a-zA-Z]*i|--in-place)|\/[a-zA-Z]*e[a-zA-Z]*['"]?$|^['"]?e\b/,awk:/^-[a-zA-Z]*[fiE]|^--(file|include|exec)/,yq:/^-[a-zA-Z]*[is]|^--(inplace|split-exp)/,sort:/^-[a-zA-Z]*o|^--(output|compress-program)/,find:/^-(exec|execdir|ok|okdir|delete|fprint|fprintf|fprint0|fls)$/,git:/^--(output|ext-diff|textconv|filters|exec-path)/,rg:/^--pre($|=)/,fd:/^-[a-zA-Z0-9]*[xX]|^--exec/,fdfind:/^-[a-zA-Z0-9]*[xX]|^--exec/,ag:/^--pager/,bat:/^--pager/,tree:/^-o$|^--output/,file:/^-[a-zA-Z]*C/,date:/^(-s|--set)/},az={branch:/^-(d|D|m|M|c|C|u|f|-delete|-move|-copy|-set-upstream-to|-unset-upstream|-force)/,tag:/^-(a|s|d|f|m|F|-annotate|-sign|-delete|-force|-message)/,config:/^(-e|--edit|--unset|--unset-all|--add|--replace-all|--rename-section|--remove-section)$/,remote:/^(add|remove|rm|rename|set-url|set-head|set-branches|prune|update)$/,reflog:/^(expire|delete)$/,grep:/^(-O|--open-files-in-pager)/},oz=/^\/(usr\/(local\/)?)?s?bin\/[^/]+$|^\/opt\/homebrew\/bin\/[^/]+$/,sz=new Set([`--no-pager`,`-P`,`--no-optional-locks`]),cz=/^(LC_[A-Z_]+|LANG|LANGUAGE|TZ|NO_COLOR|FORCE_COLOR|CLICOLOR(_FORCE)?|COLUMNS|TERM)=/,lz=new Set([`node`,`npm`,`pnpm`,`yarn`,`bun`,`deno`,`python`,`python3`,`pip`,`pip3`,`ruby`,`go`,`cargo`,`rustc`,`java`,`javac`]),uz=/^['"]?((\d+|\$)(,(\d+|\$))?|\/[^/]*\/)p['"]?$/,dz=new Set([`-n`,`-E`,`-r`,`--quiet`,`--silent`]);function fz(e){let t=e.trim().split(/\s+/),n=0;for(;n<t.length&&/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[n]);)n+=1;return{env:t.slice(0,n),tokens:t.slice(n)}}function pz(e){let t=fz(e).tokens[0]??``;return t.slice(t.lastIndexOf(`/`)+1)}function mz(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31&&n!==10)return!0}return!1}function hz(e){let t=e.find(e=>!dz.has(e));return!t||!uz.test(t)?!1:e.slice(0,e.indexOf(t)).every(e=>dz.has(e))}function gz(e){let t=1;for(;t<e.length&&e[t].startsWith(`-`);)if(e[t]===`-C`){if(t+1>=e.length)return!1;t+=2}else if(sz.has(e[t]))t+=1;else return!1;if(t>=e.length)return!1;let n=e[t];if(!rz.has(n))return!1;let r=e.slice(t+1),i=az[n];return!(i&&r.some(e=>i.test(e))||n===`config`&&!r.some(e=>/^(--get|--get-all|--list|-l|--get-regexp)$/.test(e))||(n===`branch`||n===`tag`)&&r.some(e=>!e.startsWith(`-`))&&!r.some(e=>e===`-l`||e===`--list`))}function _z(e){let t=e.trim();if(!t||/\$\(|<\(|`/.test(t)||mz(t))return!1;let n=t.replace(/2>&1|[12]?>\s*\/dev\/null/g,``);if(n.includes(`>`))return!1;let r=n.split(/\|\|?|&&?|;|\n/);for(let e of r){let t=e.trim();if(!t)continue;let{env:n,tokens:r}=fz(t);if(n.some(e=>!cz.test(e)))return!1;let i=pz(t),a=r[0]??``;if(a.includes(`/`)&&!oz.test(a))return!1;let o=r.slice(1);if(lz.has(i)){if(o.length!==1||![`--version`,`-v`,`-V`].includes(o[0]))return!1;continue}if(!nz.has(i))return!1;let s=iz[i];if(s&&o.some(e=>s.test(e))||i===`awk`&&/system\s*\(/.test(o.join(` `))||i===`sed`&&!hz(o)||i===`git`&&!gz(r)||i===`uniq`&&o.filter(e=>!e.startsWith(`-`)).length>1)return!1}return!0}var vz=`</untrusted-content`,yz=`<untrusted-content`;function bz(e){return e.split(`<\\/untrusted-content`).join(vz).split(`<\\untrusted-content`).join(yz)}var xz=/^<untrusted-content(?:\s[^<>\n]*)?>([\s\S]*)<\/untrusted-content>$/u,Sz=/<\\?untrusted-content source="plugin:[^"<>\n]*"[^<>\n]*>/u,Cz=/<\\?\/untrusted-content>\s*$/u;function wz(e){let t=xz.exec(e.trim()),n=!!(t&&!t[1].includes(vz)),r=n&&t?t[1]:e,i=Sz.exec(r),a=Cz.exec(r);return i&&a&&a.index>=i.index+i[0].length&&(r=r.slice(0,i.index)+r.slice(i.index+i[0].length,a.index)),n&&(r=bz(r)),r===e?e:r.trim()}function Tz(e){let t=/^mcp__(.+?)__(.+)$/.exec(e);return t?{server:t[1],tool:t[2]}:null}function Ez(e){let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return null}return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function Dz(e){let t=[e.tool,e.name].find(e=>typeof e==`string`&&e);if(typeof t==`string`)return t.startsWith(`mcp__`)||typeof e.server!=`string`||!e.server?t:`mcp__${e.server}__${t}`}function Oz(e,t){if(e!==`mcp`)return{name:e,args:t};let n=Ez(t);if(!n)return{name:e,args:t};let r=Dz(n);return n.action===`list`?{name:e,args:t,summary:typeof n.server==`string`&&n.server?n.server:`list`}:n.action===`describe`&&r?{name:e,args:t,summary:r}:n.action===`call`&&r&&Tz(r)?{name:r,args:Ez(n.arguments)??{}}:{name:e,args:t}}function kz(e,t,n){let r=[];for(let i=0;i<e.length;){let a=e[i];if(a.kind!==`tool`||!a.name||!t(a.name)){r.push(a),i+=1;continue}let o=i+1;for(;o<e.length&&e[o].kind===`tool`&&e[o].name===a.name;)o+=1;r.push(o-i>=2?n(a,e.slice(i+1,o)):a),i=o}return r}var Az=[`日`,`一`,`二`,`三`,`四`,`五`,`六`],jz=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Mz(e){let t=e.trim();return t.length<=8?t:`${t.slice(0,8)}…`}function Nz(e,t){return t?.trim()||(e?Mz(e):``)}function Pz(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Fz(e){return String(e).padStart(2,`0`)}function Iz(e,t){return`${Fz(e)}:${Fz(t)}`}function Lz(e,t,n){return e.length===n-t+1&&e[0]===t&&e[e.length-1]===n}function Rz(e,t){if(e.length<2||e[0]!==0)return;let n=e[1]-e[0];if(!(n<1)){for(let t=1;t<e.length;t+=1)if(e[t]-e[t-1]!==n)return;return e[e.length-1]+n>=t?n:void 0}}function zz(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Bz(e,t){let n=Ro(e);if(!n)return e.trim();let r=Lz(n.dayOfMonth,1,31)&&Lz(n.month,1,12)&&Lz(n.dayOfWeek,0,6);if(r&&Lz(n.hour,0,23)){let e=Rz(n.minute,60);if(e===1)return t===`zh`?`每分钟`:`every minute`;if(e)return t===`zh`?`每 ${e} 分钟`:`every ${e} minutes`}if(n.minute.length!==1||n.hour.length!==1||!Lz(n.month,1,12))return n.source;let i=Iz(n.hour[0],n.minute[0]);if(r)return t===`zh`?`每天 ${i}`:`every day at ${i}`;if(Lz(n.dayOfMonth,1,31)&&zz(n.dayOfWeek,[1,2,3,4,5]))return t===`zh`?`每个工作日 ${i}`:`weekdays at ${i}`;if(Lz(n.dayOfMonth,1,31)&&n.dayOfWeek.length===1){let e=n.dayOfWeek[0];return t===`zh`?`每周${Az[e]} ${i}`:`every ${jz[e]} at ${i}`}return n.source}var Vz=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Hz(e){if(!e)return null;try{let t=JSON.parse(e);return Vz(t)?t:null}catch{return null}}function Uz(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){if(!Vz(r)||typeof r.id!=`string`||!r.id||typeof r.title!=`string`||typeof r.content!=`string`)return null;let{spaceId:e,[t]:i}=r;n.push({id:r.id,title:r.title,content:r.content,unitType:typeof r.unitType==`string`&&r.unitType?r.unitType:null,space:e===`global`?`global`:typeof e==`string`&&e.startsWith(`proj:`)?`project`:null,relevance:typeof i==`number`&&Number.isFinite(i)?i:null})}return n}function Wz(e){let t=Hz(e);return t?Uz(t.results,`relevance`):null}function Gz(e,t){let n=Hz(e);if(n?.status===`candidates_found`){let e=Uz(n.candidates,`similarity`);return e?{written:!1,candidates:e}:null}if(n?.status!==`inserted`||!Vz(n.memory)||!t)return null;let r=Uz([{...n.memory,content:t}],`relevance`)?.[0];return r?{written:!0,deduplicated:n.deduplicated===!0,memory:r}:null}var Kz=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function qz(e){for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(!(e.type!==`image`||typeof e.data!=`string`||!e.data)&&typeof e.mimeType==`string`&&Kz.has(e.mimeType))return e}}var Jz=e=>typeof e==`number`?e:null;function Yz(e){let t=e?.split(`
194
+ `,1)[0]?.trim();if(!t?.startsWith(`{`))return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!=`object`)return null;let r=n;return{path:typeof r.path==`string`&&r.path?r.path:null,size:Jz(r.size),width:Jz(r.width),height:Jz(r.height)}}var Xz=/^(?:\/|[A-Za-z]:[\\/]|\\\\)/u;function Zz(e,t,n){return n?e?`data:${e.mimeType};base64,${e.data}`:t&&Xz.test(t)?f(t):null:null}var Qz=new Set([...se,`memory_search`,`memory_capture`,`memory_delete`,`memory_crystallize`,`web_search`,`web_fetch`]);function $z(e,t=!1){return e===`task_settle`?!0:t?Qz.has(e)||e.startsWith(`my_`)||Tz(e)!==null:!1}var eB=new Map;function tB(e,t){eB.set(e,t)}function nB(e,t){return(eB.get(e.name)??HB)(e,t)}var rB={todo_item_update:`Updated {{count}} to-dos`,todo_item_add:`Added {{count}} to-dos`,session_send:`Sent {{count}} messages`,session_stop:`Stopped {{count}} sessions`,session_task_stop:`Stopped {{count}} background tasks`,session_archive:`Archived {{count}} sessions`,result_mark_done:`Marked {{count}} sessions done`,result_mark_undo:`Undid {{count}} marks`,session_answer:`Answered {{count}} questions`,session_create:`Created {{count}} sessions`,todo_item_dispatch:`Dispatched {{count}} to-dos`,schedule_add:`Added {{count}} schedules`,schedule_remove:`Removed {{count}} schedules`};function iB(e,t){let n=e.map(e=>nB(e,t));if(n.length<=1)return{grouped:!1,title:n[0]?.title??``,cards:n};let r=e[0]?.name??``,i=rB[r];return{grouped:!0,title:i?t.t(i,{count:n.length}):t.t(`{{count}} × {{tool}}`,{count:n.length,tool:aB(r,t)}),cards:n}}function aB(e,t){if(e.startsWith(`my_`))return t.t(`Custom tool {{name}}`,{name:e.slice(3).replaceAll(`-`,` `)});let n=Tz(e);if(n)return`${n.tool.replaceAll(`_`,` `)} · ${n.server}`;let r=Ps[e];return r?t.t(r):e.replaceAll(`_`,` `)}function oB(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Q(e){return oB(e)?e:null}function sB(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function cB(e){let t=sB(e);return t===null?sB(e?.split(`
195
+ `,1)[0]??null):t}function $(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function lB(e){let t=$(e);if(!t)return;let n=t.match(/^<untrusted-content\b[^>]*>([\s\S]*)<\/untrusted-content>$/u);return(n?n[1]:t).trim()||void 0}function uB(e){return e.length>280||e.split(`
196
+ `).length>6}function dB(e){let t=``;try{t=typeof e.args==`string`?e.args:JSON.stringify(e.args,null,2)??``}catch{t=String(e.args)}return{rawArgs:t,rawOutput:e.output??``}}function fB(e,t,n,r){return{name:e.name,title:t,state:e.state,blocks:n,...r?{status:r}:{},...dB(e)}}var pB={"dispatch-limit":`Dispatch limit reached`,"project-not-visible":`Project is not visible`,"project-required":`A project is required`,"not-found":`Not found`,"invalid-cron":`Invalid schedule`,"invalid-at":`Invalid schedule`,"at-in-past":`Invalid schedule`,"exactly-one-of-at-or-cron":`Invalid schedule`,"stale-index":`The message changed (the session was rewound or switched branches). List the session again and read it with the new id.`,"not-readable":`Only user and assistant messages can be read; tool calls and tool output are not shown.`};function mB(e,t){if(e.state!==`error`)return null;let n=e.output?.trim()??``;if(!n)return t.t(`Tool failed`);let r=pB[n]??pB[/^([a-z][a-z-]*):\s/u.exec(n)?.[1]??``];return r?t.t(r):n}function hB(e,t){return e?Nz(e,t.lookup?.sessionTitle?.(e)):t.t(`Unknown session`)}function gB(e,t){return e?Nz(e,t.lookup?.projectName?.(e)):t.t(`Not set`)}function _B(e,t){if(e==null||e===``)return t.t(`Not set`);if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function vB(e,t){return Object.entries(e).map(([e,n])=>({label:e,value:_B(n,t)}))}var yB={running:{key:`Session running`,tone:`ok`},idle:{key:`Session idle`,tone:`neutral`},waiting:{key:`Session needs you`,tone:`pending`},error:{key:`Session error`,tone:`error`},"not-started":{key:`Session not started`,tone:`neutral`}};function bB(e,t){let n=typeof e==`string`?yB[e]:void 0;return n?{badge:t.t(n.key),badgeTone:n.tone}:{badge:typeof e==`string`?e:``,badgeTone:`neutral`}}function xB(e){let t=Q(e);return(typeof t?.approvals==`number`?t.approvals:0)+(typeof t?.asks==`number`?t.asks:0)}function SB(e){return e.replace(/<untrusted-content[^>]*>/gu,``).replace(/<\/untrusted-content>/gu,``).trim()}function CB(e){let t=SB(e).split(`
197
+ `).map(e=>e.trim()).find(Boolean)??``;return t.length>120?`${t.slice(0,120)}…`:t}var wB={dispatch:`Dispatch card`,profile:`Profile card`,skill:`Skill card`,tool:`Tool card`,takeover:`Takeover card`,cleanup:`Cleanup card`};function TB(e,t){if(e?.status!==`awaiting_confirmation`)return;let n=$(e.proposalId)??``,r=n?t.lookup?.proposal?.(n):void 0,i=r?.status??`pending`,a=t.t(wB[r?.kind??``]??`Confirmation card`);return i===`pending`||i===`executing`?{tone:`pending`,label:t.t(`Waiting on {{card}} {{id}}`,{card:a,id:n?Mz(n):t.t(`Not set`)})}:i===`succeeded`?{tone:`ok`,label:t.t(`Confirmed`)}:i===`rejected`?{tone:`error`,label:t.t(`Rejected`)}:i===`failed`?{tone:`error`,label:t.t(`Confirmation failed`)}:i===`expired`?{tone:`neutral`,label:t.t(`Confirmation expired`)}:{tone:`pending`,label:t.t(`Waiting on {{card}} {{id}}`,{card:a,id:Mz(n)})}}function EB(e,t){let n=$(e?.conversationId);return e?.status!==`created`&&e?.status!==`queued`||!n?null:{kind:`session`,id:n,label:hB(n,t)}}tB(`session_send`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=$(n?.conversationId),a=$(n?.mode)===`steer`,o=t.t(`Send message {{title}}`,{title:hB(i,t)}),s=[],c=$(n?.goal);c&&s.push({kind:`kv`,rows:[{label:t.t(`Goal`),value:c,display:`long`}]});let l=$(n?.message);l&&s.push({kind:`prompt`,label:t.t(`Message`),text:l});let u=mB(e,t);u&&s.unshift({kind:`error`,text:u});let d;u?d={tone:`error`,label:t.t(`Refused`)}:r?.status===`steered`?d={tone:`ok`,label:t.t(`Steered into the current turn`)}:r?.status===`queued`?d={tone:`queued`,label:t.t(`Queued until the current turn ends`)}:r?.status===`sent`?d={tone:`ok`,label:a?t.t(`Delivered as a new turn (the session was idle)`):t.t(`Delivered`)}:e.state===`running`&&(d={tone:`neutral`,label:a?t.t(`Steering…`):t.t(`Sending…`)});let f=i?{kind:`session`,id:i,label:hB(i,t)}:null;return f&&s.unshift(f),fB(e,o,s,d)}),tB(`session_answer`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=$(n?.conversationId),a=$(n?.answer),o=mB(e,t);return fB(e,t.t(`Answer {{title}}`,{title:hB(i,t)}),[...i?[{kind:`session`,id:i,label:hB(i,t)}]:[],...a?[{kind:`note`,text:a}]:[],...o?[{kind:`error`,text:o}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:r?.status===`answered`?{tone:`ok`,label:t.t(`Answered`)}:e.state===`running`?{tone:`neutral`,label:t.t(`Answering…`)}:void 0)}),tB(`task_settle`,(e,t)=>{let n=Q(sB(e.output)),r=(Array.isArray(n?.settled)?n.settled:Array.isArray(Q(e.args)?.tasks)?Q(e.args)?.tasks:[]).flatMap(e=>{let t=Q(e),r=t?.action;return!t||r!==`stop`&&r!==`keep`?[]:[{item:t,action:r,done:n?t.ok!==!1:void 0}]}),i=r.filter(e=>e.action===`stop`&&e.done).length,a=r.filter(e=>e.action===`keep`&&e.done).length,o=mB(e,t);return fB(e,t.t(`Background task wrap-up`),[...r.length>0?[{kind:`list`,items:r.map(({item:e,action:n,done:r})=>({title:$(e.command)??$(e.taskId)??``,badge:r===!1?t.t(`Not running`):n===`stop`?t.t(`Stopped`):t.t(`Kept`),badgeTone:n===`keep`&&r!==!1?`pending`:`neutral`,...$(e.reason)?{detail:$(e.reason)}:{}}))}]:[],...o?[{kind:`error`,text:o}]:[]],o?{tone:`error`,label:t.t(`Failed`)}:n?{tone:`neutral`,label:t.t(`Stop {{stopped}} · Keep {{kept}}`,{stopped:i,kept:a})}:e.state===`running`?{tone:`neutral`,label:t.t(`Settling…`)}:void 0)}),tB(`session_task_stop`,(e,t)=>{let n=Q(e.args),r=$(n?.conversationId),i=$(n?.taskId),a=Q(sB(e.output)),o=mB(e,t);return fB(e,t.t(`Stop background task {{task}}`,{task:i??``}),[...r?[{kind:`session`,id:r,label:hB(r,t)}]:[],...i?[{kind:`note`,text:i}]:[],...o?[{kind:`error`,text:o}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:a?.status===`stopped`?{tone:`ok`,label:t.t(`Stopped`)}:e.state===`running`?{tone:`neutral`,label:t.t(`Stopping…`)}:void 0)}),tB(`session_stop`,(e,t)=>{let n=$(Q(e.args)?.conversationId),r=Q(sB(e.output)),i=mB(e,t),a=r?.status===`running`,o=r?.status===`cancelled`,s=$(r?.note);return fB(e,o?t.t(`Cancel waiting dispatch`):t.t(`Stop session {{title}}`,{title:hB(n,t)}),[...n?[{kind:`session`,id:n,label:hB(n,t)}]:[],...s?[{kind:`note`,text:s}]:[],...i?[{kind:`error`,text:i}]:[]],i?{tone:`error`,label:t.t(`Refused`)}:a?{tone:`queued`,label:t.t(`Still running`)}:o?{tone:`ok`,label:t.t(`Cancelled`)}:{tone:`ok`,label:t.t(`Stopped`)})});function DB(e,t,n){let r=Q(e.args),i=Q(sB(e.output)),a=$(r?.projectId),o=$(r?.title)??(n===`dispatch`?t.lookup?.todoText?.($(r?.todoId)??``):void 0)??$(i?.conversationId)?Nz($(i?.conversationId),$(r?.title)??(n===`dispatch`?t.lookup?.todoText?.($(r?.todoId)??``):void 0)):t.t(`New session`),s=[...a?[{label:t.t(`Project`),value:gB(a,t)}]:[],{label:t.t(`Worktree`),value:r?.worktree===!0?t.t(`Run in a worktree`):t.t(`Run in the project checkout`)},...$(r?.checkout)?[{label:t.t(`Checkout`),value:$(r?.checkout),display:`path`}]:[],...$(r?.baseRef)?[{label:t.t(`Base`),value:$(r?.baseRef)}]:[],...$(r?.branch)?[{label:t.t(`New branch`),value:$(r?.branch)}]:[],...Array.isArray(r?.after)&&r.after.length>0?[{label:t.t(`After`),value:r.after.map(String).join(`, `)}]:[],...$(r?.model)?[{label:t.t(`Model`),value:$(r?.model)}]:[],...$(r?.goal)?[{label:t.t(`Goal`),value:$(r?.goal),display:`long`}]:[]],c=$(r?.prompt),l=mB(e,t),u=EB(i,t),d=[...l?[{kind:`error`,text:l}]:[],...s.length>0?[{kind:`kv`,rows:s}]:[],...c?[{kind:`prompt`,label:t.t(`Dispatch instructions`),text:c}]:[],...u?[u]:[]],f=n===`dispatch`?`Dispatch session {{title}}`:`Create session {{title}}`;return fB(e,t.t(f,{title:o||t.t(`New session`)}),d,l?{tone:`error`,label:t.t(`Refused`)}:i?.status===`waiting`?{tone:`queued`,label:t.t(`Waiting for dependencies`)}:i?.status===`queued`?{tone:`queued`,label:typeof i.position==`number`?t.t(`Queued at #{{n}}`,{n:i.position}):t.t(`Queued`)}:TB(i,t)??(u?{tone:`ok`,label:t.t(`Created the session`)}:void 0))}tB(`session_create`,(e,t)=>DB(e,t,`create`)),tB(`todo_item_dispatch`,(e,t)=>DB(e,t,`dispatch`)),tB(`todo_item_add`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=$(r?.text)??$(n?.text)??t.t(`Not set`),a=[...typeof r?.dueAt==`number`||typeof n?.dueAt==`number`?[{label:t.t(`Due time`),value:Pz(Number(r?.dueAt??n?.dueAt))}]:[],...$(n?.projectId)?[{label:t.t(`Project`),value:gB($(n?.projectId),t)}]:[]];return fB(e,t.t(`Add to-do {{text}}`,{text:i}),a.length?[{kind:`kv`,rows:a}]:[])});function OB(e,t){let n=Q(e.args),r=Q(sB(e.output)),i=Q(r?.after),a=Q(r?.before),o=$(n?.todoId)??$(r?.todoId)??``;return $(i?.text)??$(a?.text)??$(n?.text)??(o?t.lookup?.todoText?.(o):void 0)??(o?Mz(o):t.t(`Not set`))}tB(`todo_item_update`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=Q(r?.before),a=Q(r?.after),o=[],s=mB(e,t);if(s&&o.push({kind:`error`,text:s}),i&&a){let e=i.done===!0,n=a.done===!0;e!==n&&o.push({kind:`note`,text:n?t.t(`Marked done`):t.t(`Marked not done`)});let r=[];$(i.text)!==$(a.text)&&(i.text!==void 0||a.text!==void 0)&&String(i.text??``)!==String(a.text??``)&&r.push({label:t.t(`To-do text`),before:String(i.text??``),after:String(a.text??``)}),(i.dueAt??null)!==(a.dueAt??null)&&r.push({label:t.t(`Due time`),before:typeof i.dueAt==`number`?Pz(i.dueAt):t.t(`Not set`),after:typeof a.dueAt==`number`?Pz(a.dueAt):t.t(`Not set`)}),String(i.projectId??``)!==String(a.projectId??``)&&r.push({label:t.t(`Project`),before:gB($(i.projectId),t),after:gB($(a.projectId),t)}),r.length>0&&o.push({kind:`diff`,rows:r})}else n?.done===!0?o.push({kind:`note`,text:t.t(`Marked done`)}):n?.done===!1&&o.push({kind:`note`,text:t.t(`Marked not done`)});return fB(e,t.t(`Update to-do {{text}}`,{text:OB(e,t)}),o,s?{tone:`error`,label:t.t(`Refused`)}:void 0)});var kB={todo:`To do`,active:`In progress`,problem:`Problem`,done:`Done`};tB(`todo_list`,(e,t)=>{let n=Q(sB(e.output)),r=(Array.isArray(n?.todos)?n.todos:[]).flatMap(e=>{let n=Q(e);if(!n)return[];let r=$(n.status),i=r?t.t(kB[r]??r):void 0;return[{title:lB(n.text)??t.t(`Not set`),...i?{badge:i}:{}}]}),i=mB(e,t);return fB(e,t.t(`List to-dos`),[...i?[{kind:`error`,text:i}]:[],...r.length>0?[{kind:`list`,items:r}]:[]],i?{tone:`error`,label:t.t(`Refused`)}:void 0)});function AB(e,t){let n=$(e?.cron);if(n)return Bz(n,t.locale);let r=$(e?.at);if(!r)return t.t(`Not set`);let i=Date.parse(r);return t.t(`Once at {{time}}`,{time:Number.isNaN(i)?r:Pz(i)})}tB(`schedule_add`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=$(n?.name)??$(r?.name)??t.t(`Not set`),a=$(n?.prompt),o=mB(e,t),s=[...o?[{kind:`error`,text:o}]:[],{kind:`note`,text:AB(n,t)},...typeof r?.nextRunAt==`number`?[{kind:`note`,text:t.t(`Next run {{time}}`,{time:Pz(r.nextRunAt)})}]:[],...a?[{kind:`markdown`,text:a,collapsed:!0}]:[]];return fB(e,t.t(`Add schedule {{name}}`,{name:i}),s,o?{tone:`error`,label:t.t(`Refused`)}:void 0)}),tB(`schedule_remove`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=$(n?.scheduleId)??$(r?.scheduleId)??``,a=$(r?.name)??$(n?.name)??(i?Mz(i):t.t(`Not set`)),o=mB(e,t);return fB(e,t.t(`Remove schedule {{name}}`,{name:a}),o?[{kind:`error`,text:o}]:[],o?{tone:`error`,label:t.t(`Refused`)}:void 0)}),tB(`session_list`,(e,t)=>{let n=Q(e.args),r=Q(sB(e.output)),i=$(n?.projectId),a=i?gB(i,t):``,o=(Array.isArray(r?.sessions)?r.sessions:[]).flatMap(e=>{let n=Q(e);if(!n)return[];let r=xB(n.pending),i=bB(n.state,t);return[{title:$(n.title)??hB($(n.conversationId),t),badge:i.badge,badgeTone:i.badgeTone,...r>0?{detail:t.t(`{{count}} pending`,{count:r})}:{},...$(n.conversationId)?{sessionId:$(n.conversationId)}:{}}]});return fB(e,a?t.t(`List sessions in {{project}}`,{project:a}):t.t(`List sessions`),o.length>0?[{kind:`list`,items:o}]:[])}),tB(`session_read`,(e,t)=>{let n=Q(sB(e.output)),r=$(n?.conversationId)??$(Q(e.args)?.conversationId),i=$(n?.title)??hB(r,t),a=mB(e,t);if(typeof n?.index==`number`){let r=lB(n.text)??``,o=[];a&&o.push({kind:`error`,text:a}),r&&o.push({kind:`markdown`,text:r,collapsed:uB(r)});let s=typeof n.nextOffset==`number`?n.nextOffset:void 0;return s!==void 0&&o.push({kind:`note`,text:t.t(`More text from character {{next}}`,{next:s})}),fB(e,t.t(`Read message {{index}} in {{title}}`,{index:String(n.index),title:i}),o,a?{tone:`error`,label:t.t(`Refused`)}:{tone:`neutral`,label:t.t(`Read`)})}let o=bB(n?.state,t),s={tone:o.badgeTone,label:o.badge},c=Q(n?.pending),l=typeof c?.approvals==`number`?c.approvals:0,u=typeof c?.asks==`number`?c.asks:0,d=Array.isArray(n?.messages)?n.messages:[],f=d.flatMap(e=>{let t=Q(e);return t?.truncated===!0&&typeof t.index==`number`?[t.index]:[]}),p=d.flatMap(e=>{let n=Q(e),r=$(n?.text);return!n||!r?[]:[`${n.role===`assistant`?t.t(`Assistant`):t.t(`User`)}: ${CB(r)}`]}).join(`
198
+ `),m=[...a?[{kind:`error`,text:a}]:[],...l>0||u>0?[{kind:`kv`,rows:[{label:t.t(`Pending approvals`),value:String(l)},{label:t.t(`Pending questions`),value:String(u)}]}]:[]];return p&&m.push({kind:`markdown`,text:p,collapsed:!0}),f.length>0&&m.push({kind:`note`,text:t.t(`Truncated messages {{indexes}}: read them by index`,{indexes:f.map(e=>`#${e}`).join(`, `)})}),fB(e,t.t(`Read session {{title}}`,{title:i}),m,a?{tone:`error`,label:t.t(`Refused`)}:s)});function jB(e,t){let n=Q(e.git),r=[];return n?(r.push($(n.branch)??t.t(`No local branch`)),r.push(n.dirty===!0?t.t(`Uncommitted changes`):t.t(`Clean tree`))):r.push(t.t(`No local branch`)),r.join(` · `)}tB(`project_list`,(e,t)=>{let n=Array.isArray(Q(sB(e.output))?.projects)?Q(sB(e.output))?.projects:[];return fB(e,t.t(`List projects`),[{kind:`list`,items:n.flatMap(e=>{let n=Q(e);return n?[{title:$(n.name)??gB($(n.projectId),t),detail:jB(n,t)}]:[]})}])}),tB(`project_info`,(e,t)=>{let n=Q(sB(e.output))??{},r=$(n.name)??gB($(n.projectId)??$(Q(e.args)?.projectId),t);return fB(e,t.t(`Project {{name}}`,{name:r}),[{kind:`note`,text:jB(n,t)}])});function MB(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60);return n>=60?`${Math.floor(n/60)}h ${n%60}m`:n>0?`${n}m ${t%60}s`:`${t}s`}var NB={running:{key:`Running`,tone:`ok`},exited:{key:`Exited`,tone:`neutral`},killed:{key:`Killed`,tone:`error`}};tB(`repo_status`,(e,t)=>{let n=Q(sB(e.output))??{},r=gB($(n.projectId)??$(Q(e.args)?.projectId),t),i=mB(e,t),a=$(n.branch),o=Q(n.head),s=Q(n.changes),c=Q(n.operation),l=Q(n.base),u=Q(n.contains),d=[];i&&d.push({kind:`error`,text:i});let f=typeof s?.total==`number`?s.total:0,p=[{label:t.t(`Branch`),value:a??t.t(`No local branch`)}];if(o){let e=lB(o.subject)??``;p.push({label:t.t(`HEAD`),value:`${$(o.sha)??``} ${e}`.trim()})}p.push({label:t.t(`Working tree`),value:f===0?t.t(`Clean tree`):t.t(`{{count}} changed files`,{count:f})}),l&&p.push({label:t.t(`Against {{ref}}`,{ref:$(l.ref)??``}),value:t.t(`{{ahead}} ahead, {{behind}} behind`,{ahead:typeof l.ahead==`number`?l.ahead:0,behind:typeof l.behind==`number`?l.behind:0})}),u&&p.push({label:t.t(`Contains {{sha}}`,{sha:$(u.sha)??``}),value:u.inHead===!0?t.t(`Yes`):t.t(`No`)});let m=[...c?.merge===!0?[t.t(`Merge`)]:[],...c?.rebase===!0?[t.t(`Rebase`)]:[]];m.length>0&&p.push({label:t.t(`In progress`),value:m.join(` · `)}),d.push({kind:`kv`,rows:p});let h=Array.isArray(n.commits)?n.commits:[];h.length>0&&d.push({kind:`list`,items:h.flatMap(e=>{let t=Q(e),n=$(t?.sha);if(!t||!n)return[];let r=lB(t.subject)??``,i=[lB(t.author)??``,typeof t.at==`number`?Pz(t.at):``].filter(Boolean).join(` · `);return[{title:`${n} ${r}`.trim(),...i?{detail:i}:{}}]})});let g=Array.isArray(s?.files)?s.files:[];g.length>0&&d.push({kind:`list`,items:g.flatMap(e=>{let t=Q(e),n=$(t?.path);return!t||!n?[]:[{title:n,badge:$(t.status)??``}]})});let _=Array.isArray(n.worktrees)?n.worktrees:[];return _.length>1&&d.push({kind:`list`,items:_.flatMap(e=>{let n=Q(e),r=$(n?.path);return!n||!r?[]:[{title:r,detail:[$(n.branch)??t.t(`No local branch`),$(n.head)??``].filter(Boolean).join(` · `)}]})}),fB(e,t.t(`Repository status {{project}}`,{project:r}),d,i?{tone:`error`,label:t.t(`Refused`)}:{tone:`neutral`,label:a??t.t(`No local branch`)})}),tB(`session_tasks`,(e,t)=>{let n=Q(sB(e.output)),r=hB($(n?.conversationId)??$(Q(e.args)?.conversationId),t),i=mB(e,t),a=Array.isArray(n?.tasks)?n.tasks:[],o=a.filter(e=>Q(e)?.state===`running`).length,s=[];return i&&s.push({kind:`error`,text:i}),a.length>0&&s.push({kind:`list`,items:a.flatMap(e=>{let n=Q(e);if(!n)return[];let r=$(n.state)??``,i=NB[r],a=[typeof n.ranMs==`number`?t.t(`ran {{duration}}`,{duration:MB(n.ranMs)}):``,typeof n.exitCode==`number`?t.t(`exit {{code}}`,{code:n.exitCode}):``,n.alive===!1?t.t(`Process gone`):n.stalled===!0?t.t(`Past its deadline`):``,n.persistent===!0?t.t(`Persistent service`):``,$(n.leftover)?t.t(`Leftover`):``].filter(Boolean).join(` · `);return[{title:CB(lB(n.command)??``)||$(n.taskId)||t.t(`Unknown task`),badge:i?t.t(i.key):r,badgeTone:i?.tone??`neutral`,...a?{detail:a}:{}}]})}),fB(e,t.t(`Background tasks in {{title}}`,{title:r}),s,i?{tone:`error`,label:t.t(`Refused`)}:o>0?{tone:`ok`,label:t.t(`{{count}} running`,{count:o})}:{tone:`neutral`,label:t.t(`{{count}} tasks`,{count:a.length})})}),tB(`session_activity`,(e,t)=>{let n=Q(sB(e.output)),r=hB($(n?.conversationId)??$(Q(e.args)?.conversationId),t),i=mB(e,t),a=Array.isArray(n?.calls)?n.calls:[],o=a.filter(e=>{let t=Q(e);return t?.ok===!1&&t.pending!==!0}).length,s=[];return i&&s.push({kind:`error`,text:i}),a.length>0&&s.push({kind:`list`,items:a.flatMap(e=>{let n=Q(e),r=$(n?.name);if(!n||!r)return[];let i=n.pending===!0,a=n.ok===!0,o=[typeof n.durationMs==`number`?MB(n.durationMs):``,typeof n.at==`number`?Pz(n.at):``,CB(lB(n.command)??``)].filter(Boolean);return[{title:aB(r,t),badge:i?t.t(`Running`):a?t.t(`Succeeded`):t.t(`Failed`),badgeTone:i?`pending`:a?`ok`:`error`,...o.length>0?{detail:o.join(` · `)}:{}}]})}),fB(e,t.t(`Recent tool calls in {{title}}`,{title:r}),s,i?{tone:`error`,label:t.t(`Refused`)}:o>0?{tone:`error`,label:t.t(`{{count}} failed`,{count:o})}:{tone:`ok`,label:t.t(`{{count}} calls`,{count:a.length})})});var PB={name:`Name`,avatarColor:`Avatar color`,model:`Model`,autonomy:`Autonomy`,autoApproveProjectIds:`Auto-approved projects`,visibleProjectIds:`Visible projects`,dispatchModel:`Dispatch model`,dispatchWorktree:`Dispatch worktree`,maxRunningDispatches:`Dispatch limit`,addressAs:`What to call you`,replyLanguage:`Reply language`,style:`Communication style`,notify:`System notifications`,dailyBriefAt:`Daily brief time`,persona:`Persona`};tB(`secretary_profile_propose`,(e,t)=>{let n=Q(sB(e.output)),r=(Array.isArray(n?.changes)?n.changes:[]).flatMap(e=>{let n=Q(e),r=$(n?.field);return!n||!r?[]:[{label:t.t(PB[r]??r),before:_B(n.before,t),after:_B(n.after,t)}]}),i=mB(e,t);return fB(e,t.t(`Propose profile changes`),[...i?[{kind:`error`,text:i}]:[],...r.length>0?[{kind:`diff`,rows:r}]:[]],i?{tone:`error`,label:t.t(`Refused`)}:TB(n,t))});function FB(e,t,n){let r=Q(e.args),i=Q(sB(e.output)),a=$(r?.name)??t.t(`Not set`),o=$(r?.description),s=$(r?.body)??$(r?.code),c=mB(e,t);return fB(e,t.t(n,{name:a}),[...c?[{kind:`error`,text:c}]:[],...o?[{kind:`note`,text:o}]:[],...s?[{kind:`markdown`,text:s,collapsed:!0}]:[]],c?{tone:`error`,label:t.t(`Refused`)}:TB(i,t))}tB(`skill_propose`,(e,t)=>FB(e,t,`Propose skill {{name}}`)),tB(`tool_propose`,(e,t)=>FB(e,t,`Propose tool {{name}}`)),tB(`session_takeover_propose`,(e,t)=>{let n=Q(e.args),r=$(n?.conversationId),i=$(n?.reason),a=Q(sB(e.output)),o=mB(e,t);return fB(e,t.t(`Ask to take over {{title}}`,{title:hB(r,t)}),[...o?[{kind:`error`,text:o}]:[],...i?[{kind:`note`,text:i}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:TB(a,t))});function IB(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}var LB={branch:`Branch`,worktree:`Worktree`,session:`Session`};function RB(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)??e}var zB={"not-merged":`Not merged yet`,"current-branch":`Currently checked out`,"used-by-worktree":`Used by a worktree`,"detached-head":`Detached HEAD`,"uncommitted-changes":`Has uncommitted changes`};function BB(e,t){let n=$(e.kind)??``,r=$(e.blocked),i=Array.isArray(e.mergedInto)?e.mergedInto.filter(e=>typeof e==`string`):[],a=typeof e.sizeBytes==`number`?e.sizeBytes:null,o=[];return i.length>0&&o.push(t.t(`merged into {{refs}}`,{refs:i.join(`, `)})),a!==null&&o.push(IB(a)),r&&o.push(t.t(zB[r]??r)),{title:$(e.name)??t.t(`Not set`),badge:t.t(LB[n]??n),badgeTone:r?`error`:`ok`,...o.length>0?{detail:o.join(` · `)}:{}}}tB(`image_view`,(e,t)=>{let n=Q(e.args),r=mB(e,t),i=r?null:Yz(e.output),a=i?.path??$(n?.path)??``,{width:o,height:s,size:c}=i??{width:null,height:null,size:null},l=a?RB(a):t.t(`Not set`),u=[];r?u.push({kind:`error`,text:r}):(e.image||i?.path)&&u.push({kind:`image`,...e.image?{image:e.image}:{},...i?.path?{path:i.path}:{},alt:l});let d=[];return i?.path&&d.push({label:t.t(`Path`),value:i.path}),o&&s&&d.push({label:t.t(`Dimensions`),value:`${o} × ${s}`}),c!==null&&d.push({label:t.t(`File size`),value:IB(c)}),d.length>0&&u.push({kind:`kv`,rows:d}),fB(e,t.t(`Look at {{name}}`,{name:l}),u,r?{tone:`error`,label:t.t(`Refused`)}:void 0)}),tB(`cleanup_list`,(e,t)=>{let n=Q(cB(e.output)),r=Array.isArray(n?.items)?n.items.map(Q).filter(e=>e!==null):[],i=typeof n?.total==`number`?n.total:r.length,a=mB(e,t);return fB(e,t.t(`Cleanup candidates · {{count}}`,{count:i}),[...a?[{kind:`error`,text:a}]:[],...r.length>0?[{kind:`list`,items:r.map(e=>BB(e,t))}]:[]],a?{tone:`error`,label:t.t(`Refused`)}:void 0)}),tB(`cleanup_apply`,(e,t)=>{let n=Q(e.args),r=Q(cB(e.output)),i=Array.isArray(n?.ids)?n.ids.length:0,a=typeof r?.total==`number`?r.total:i,o=mB(e,t);return fB(e,t.t(`Clean up {{count}} items`,{count:a}),o?[{kind:`error`,text:o}]:[],o?{tone:`error`,label:t.t(`Refused`)}:TB(r,t))}),tB(`memory_search`,(e,t)=>{let n=$(Q(e.args)?.query)??``,r=Wz(e.output)??[];return fB(e,t.t(`Search memory {{query}} · {{count}}`,{query:n,count:r.length}),[{kind:`list`,items:r.map(e=>({title:e.title||Mz(e.id)}))}])}),tB(`memory_capture`,(e,t)=>{let n=Gz(e.output,$(Q(e.args)?.content));return n?n.written?fB(e,t.t(`Save memory {{title}}`,{title:n.memory.title}),[{kind:`note`,text:CB(n.memory.content)}]):fB(e,t.t(`Memory not written`),[{kind:`list`,items:n.candidates.map(e=>({title:e.title,detail:CB(e.content)}))}]):HB(e,t)}),tB(`memory_delete`,(e,t)=>{let n=Q(sB(e.output)),r=$(n?.id)??$(Q(e.args)?.id)??``,i=$(n?.title)??(r?Mz(r):t.t(`Not set`)),a=$(n?.content),o=mB(e,t);return fB(e,t.t(`Delete memory {{title}}`,{title:i}),[...o?[{kind:`error`,text:o}]:[],...a?[{kind:`note`,text:CB(a)}]:[]],o?{tone:`error`,label:t.t(`Refused`)}:void 0)});function VB(e){if(!e)return[];let t=[];for(let n of e.matchAll(/^\d+\.\s+\[([^\]]+)\]\((https?:\/\/[^)]+)\)/gmu))t.push({title:n[1],url:n[2]});return t}tB(`web_search`,(e,t)=>{let n=$(Q(e.args)?.query)??``,r=VB(e.output);return fB(e,t.t(`Web search {{query}}`,{query:n}),[{kind:`list`,items:r.map(e=>({title:e.title,detail:e.url}))}])}),tB(`web_fetch`,(e,t)=>{let n=e.output??``,r=$(Q(e.args)?.url),i=/^Fetched (\S+)/u.exec(n)?.[1],a=r??i??``,o=a;try{o=new URL(a).host}catch{o=a||t.t(`Not set`)}let s=/^Title: (.+)$/mu.exec(n)?.[1]?.trim();return fB(e,t.t(`Fetch {{domain}}`,{domain:o}),s?[{kind:`note`,text:s}]:[])});function HB(e,t){let n=Q(e.args),r=sB(e.output),i=[],a=mB(e,t);return a&&i.push({kind:`error`,text:a}),n&&Object.keys(n).length>0&&i.push({kind:`kv`,rows:vB(n,t)}),oB(r)?i.push({kind:`kv`,rows:vB(r,t)}):typeof e.output==`string`&&e.output.trim()&&!a&&i.push({kind:`note`,text:e.output.trim(),collapsed:uB(e.output)}),fB(e,aB(e.name,t),i,a?{tone:`error`,label:t.t(`Refused`)}:void 0)}function UB(e){return e.some(e=>e===`error`)?`error`:e.some(e=>e===`running`||e===`reviewing`)?`running`:`ok`}function WB(e,t){let n=new Set([t]),r=e[t]?.forkedFromConversationId;for(;r&&!n.has(r);)n.add(r),r=e[r]?.forkedFromConversationId;return n.size}function GB(e){return!e.started&&!e.spawning&&!e.parentId&&!!e.sessionFile&&!e.historyOnly&&!e.worktreeMissing&&!e.workspaceMigrating&&e.status!==`running`}function KB(e,t){return t&&!t.canRewind||!e||e.historyOnly||e.worktreeMissing||e.workspaceMigrating||e.spawning||e.status===`running`||e.rewinding||e.restoringFiles?!1:e.started?!0:GB(e)}function qB(e,t,n=1){return t&&(!t.canRewind||t.canFork===!1)||n>=3||!e||e.parentId||e.historyOnly||e.status!==`idle`?!1:e.started?!e.spawning:GB(e)}function JB(e,t){let n=typeof t==`string`?e.messages.findIndex(e=>e.entryId===t):QB(e.messages,t);if(n===null||n<0)return null;let r=e.messages[n];return r?.role!==`user`||r.optimistic||!r.entryId?.trim()?null:{entryId:r.entryId,userIndexFromEnd:e.messages.slice(n+1).filter(e=>e.role===`user`).length}}function YB(e,t,n,r,i){if(!n||t!==e)return null;let a=i??XB(n,r);if(a===null)return null;let o=JB(n,a);return o?{conversationId:e,...o}:null}function XB(e,t){if(!Number.isInteger(t)||t<0)return null;let n=t-(e.historyBaseIndex??0);return n<0||e.messages[n]?.role!==`user`?null:e.messages.slice(n+1).filter(e=>e.role===`user`).length}function ZB(e){return e.optimistic?!1:e.role===`user`||e.role===`custom`&&!!e.pluginSource}function QB(e,t){if(!Number.isInteger(t)||t<0)return null;let n=[];for(let t=0;t<e.length;t++)e[t]?.role===`user`&&n.push(t);let r=n[n.length-1-t];return r===void 0?null:r}function $B(e){let t=(e,t)=>`${e}:\n${t.length>0?t.map(e=>`- ${e}`).join(`
199
+ `):`(none)`}`;return[`Patch ${e.status}.`,t(`Applied`,e.applied),t(`Failed paths`,e.failed),...e.error?[`Error: ${e.error}`]:[],t(`Unattempted`,e.unattempted),t(`Uncertain`,e.uncertain),...e.status===`success`?[]:[`Re-read failed or uncertain paths before retrying.`],...e.input?[`Input:\n${e.input}`]:[]].join(`
200
+ `)}function eV(e,t){return!t&&e.kind===`tool`&&e.name===`apply_patch`&&!!e.fileChanges?.length}function tV(e,t,n){return e===null?n&&t:e}function nV(e){return e.kind===`tool`&&e.name===`apply_patch`&&!!e.fileChanges?.length&&!!e.output}var rV=[`path`,`file_path`,`command`,`pattern`,`query`,`url`,`description`,`summary`,`reason`,`goal`],iV=new Set([`path`,`file_path`]),aV=/^\[(.+)#([0-9A-Fa-f]{4})\]$/,oV=/^\*\*\* (?:(?:Add|Delete|Update) File|Move to): (.+)$/;function sV(e){let t=e.replaceAll(`\\`,`/`),n=/^[A-Za-z]:(\/.*)?$/.exec(t);return n?n[1]&&n[1].length>0?n[1]:`/`:t}function cV(e,t){if(!t)return e;let n=sV(t).replace(/\/+$/,``),r=sV(e);if(!n)return r;if(r===n)return`.`;let i=n.endsWith(`/`)?n:`${n}/`;return r.startsWith(i)?r.slice(i.length):r===e?e:r}var lV=new Set(N);function uV(e){return e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)}function dV(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=``;for(let e of[`path`,`file_path`]){let t=n[e];if(typeof t==`string`&&t){r=t;break}}if(!r||!lV.has(Me(r))||r.startsWith(`\\\\`)||r.startsWith(`//`))return null;if(uV(r))return r;if(!t)return null;let i=t.includes(`\\`)&&!t.includes(`/`)?`\\`:`/`;return`${t.replace(/[\\/]+$/,``)}${i}${r.replace(/^[\\/]+/,``)}`}function fV(e){if(typeof e==`string`)for(let t of e.split(`
201
+ `)){let e=t.trim();if(e)return aV.exec(e)?.[1]}}function pV(e){if(!e||typeof e!=`object`)return null;let t=e.input;if(typeof t!=`string`)return null;let n=new Set;for(let e of t.split(`
202
+ `)){let t=oV.exec(e.trim())?.[1];t&&n.add(t)}return[...n]}function mV(e,t){if(!e||typeof e!=`object`)return``;let n=e;for(let e of rV){let r=n[e];if(typeof r==`string`&&r)return iV.has(e)?cV(r,t):r}let r=fV(n.input);if(r)return cV(r,t);let i=JSON.stringify(n);return i===`{}`?``:i.slice(0,80)}function hV(e,t,n,r=!1,i=!1){return e?t?`loading`:n&&i?`more`:n===!1&&r?`start`:`none`:`none`}function gV(e,t,n,r,i=80){return e&&!t&&n<=r+i}function _V(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=[t.code,t.command].find(e=>typeof e==`string`&&e.trim());return typeof n==`string`?n:null}function vV(e){let t=e.split(`
203
+ `).map(e=>e.trim()).find(Boolean)??``;return t.length>72?`${t.slice(0,72)}…`:t}function yV(e){let t=new Map;for(let n of e)t.set(n.name,(t.get(n.name)??0)+1);return[...t].map(([e,t])=>`${e} ×${t}`).join(` `)}var bV=e=>e===`exec`||e===`codemode`,xV=/^Script (?:completed|failed)\nWall time [^\n]*\nOutput:\n/;function SV(e){return e===null?null:e.replace(xV,``)||null}var CV=/(?:^|\n)<console_output>\n([\s\S]*?)\n<\/console_output>(?:\n|$)/;function wV(e){let t=CV.exec(e);return t?{body:[e.slice(0,t.index),e.slice(t.index+t[0].length)].filter(Boolean).join(`
204
+ `),console:t[1]}:{body:e}}function TV(e,t,n){let{body:r,console:i}=wV(e??``),a=i===void 0?{}:{console:i};return t?{status:`failed`,error:r,...a,calls:[...n??[]]}:{status:`completed`,value:r,...a,calls:[...n??[]]}}function EV(e){if(!e?.trim())return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(n.status!==`completed`&&n.status!==`failed`)return null;let r=Array.isArray(n.calls)?n.calls.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;return typeof t.name!=`string`||!t.name?[]:[{name:t.name,ok:t.ok===!0,...typeof t.error==`string`?{error:t.error}:{},...typeof t.summary==`string`?{summary:t.summary}:{}}]}):[];return{status:n.status,...n.status===`failed`&&typeof n.error==`string`?{error:n.error}:{},...n.status===`completed`?{value:n.value}:{},calls:r}}catch{return null}}function DV(e,t){if(e!==`submit_plan`||!t||typeof t!=`object`)return null;let{title:n,plan:r}=t;return typeof n==`string`&&typeof r==`string`&&r.trim()?{title:n.trim(),text:r.trim()}:null}function OV(e,t){if(e!==`write`||!t||typeof t!=`object`)return null;let n=t.content;return typeof n==`string`&&n?n:null}var kV=new Map([[`message_main_agent`,e=>[e.message]],[`message_coworker`,e=>[e.text,e.to]],[`subagent`,(e,t)=>e.operation===`send`?[e.message,t.get(String(e.agentId))]:e.operation===`message`?[e.text,t.get(String(e.to))]:[]]]),AV=/(?:^|\n)\((?:delivered to |the main agent is blocked waiting )[^\n]*\)\s*$/,jV=new Set([`agentId`,`runId`,`delivery`,`status`]);function MV(e,t,n){let r=kV.get(e);if(!r||!t||typeof t!=`object`)return null;let[i,a]=r(t,n);if(typeof i!=`string`||!i.trim())return null;let o=i.trim();return{text:o,summary:typeof a==`string`&&a.trim()?`${a.trim()} · ${o}`:o}}function NV(e,t){if(e!==`subagent`||!t||typeof t!=`object`)return null;let{operation:n,prompt:r}=t;return n===`spawn`&&typeof r==`string`&&r.trim()?r.trim():null}function PV(e){if(!e)return null;let t=e.startsWith(`{`)?0:e.lastIndexOf(`
205
+ {`)+1;try{let n=JSON.parse(e.slice(t));return n&&typeof n==`object`&&!Array.isArray(n)?{head:e.slice(0,t).trimEnd(),value:n}:null}catch{return null}}function FV(e){let t=PV(e);return(t&&Object.keys(t.value).every(e=>jV.has(e))?t.head:e?.replace(AV,``))?.trimEnd()||null}var IV=new Set([`spawn`,`send`,`message`,`resume`]);function LV(e,t,n,r){if(!n||typeof n!=`object`)return;let{operation:i,name:a,description:o}=n;if(!IV.has(i))return;let{agentId:s,runId:c}=PV(r)?.value??{};if(typeof s!=`string`||(typeof c==`string`&&t.set(c,s),i!==`spawn`))return;let l=[a,o].find(e=>typeof e==`string`&&e.trim());typeof l==`string`&&e.set(s,l.trim())}var RV=new Set([`report`,`wait`,`stop`,`dismiss`,`list`,`resume`]);function zV(e,t){if(!t||typeof t!=`object`)return null;let n=t;return e===`task_output`?typeof n.timeout_ms==`number`&&n.timeout_ms>0?`task`:null:e===`subagent`&&(n.operation===`wait`||(n.operation===`spawn`||n.operation===`send`)&&n.wait===!0)?`subagent`:null}function BV(e,t,n){if(!e||typeof e!=`object`)return null;let{operation:r,name:i,description:a,agentId:o,runId:s,runIds:c}=e;if(r===`spawn`){if(typeof i!=`string`||!i.trim())return null;let e=[i,a].flatMap(e=>typeof e==`string`&&e.trim()?[e.trim()]:[]);return{title:[...new Set(e)].join(` · `)}}if(!RV.has(r))return null;if(r===`list`)return t.size>0?{op:`list`,title:``,titles:Object.fromEntries(t)}:{op:`list`,title:``};let l=r===`dismiss`||r===`resume`?[o]:[s,...Array.isArray(c)?c:[]].map(e=>typeof e==`string`?n.get(e):void 0),u={};for(let e of l){if(typeof e!=`string`)continue;let n=t.get(e);n&&(u[e]=n)}let d=[...new Set(Object.values(u))].join(`, `);return r===`wait`&&d?{op:`wait`,title:d,titles:u}:{op:r,title:d}}function VV(e,t){if(e!==`memory_capture`||!t||typeof t!=`object`)return null;let{title:n,content:r}=t;if(typeof r!=`string`||!r.trim())return null;let i=r.trim();return{title:(typeof n==`string`?n.trim():``)||i.split(`
206
+ `,1)[0].trim(),content:i}}var HV=/^\s*<(system-reminder|background-task-update)>[\s\S]*?<\/\1>/,UV=/ \(auto-selected: no response in time\)$/;function WV(e,t,n,r){if(e!==`ask_user`||!t||typeof t!=`object`)return null;let{question:i,options:a}=t;if(typeof i!=`string`||!i.trim())return null;let o=Array.isArray(a)?a.slice(0,4).flatMap(e=>typeof e==`string`&&e.trim()?[e.trim()]:[]):[],s={question:i.trim(),options:o,answer:null,autoSelected:!1};if(!r||!n)return{ask:s,output:n};let c=n,l=[];for(let e=HV.exec(c);e;e=HV.exec(c))l.push(e[0].trim()),c=c.slice(e[0].length);let u=c.trim(),d=u.replace(UV,``);return{ask:{...s,answer:d||null,autoSelected:d!==u},output:l.join(`
207
+
208
+ `)||null}}function GV(e,t){if(e!==`edit`||!t||typeof t!=`object`)return null;let n=t;if(!(`edits`in n)&&typeof n.oldText==`string`&&typeof n.newText==`string`)return JV(n,n.oldText,n.newText);let r=n.edits;if(typeof r==`string`)try{r=JSON.parse(r)}catch{return null}return!Array.isArray(r)||r.length===0?null:r.every(e=>e&&typeof e==`object`&&typeof e.oldText==`string`&&typeof e.newText==`string`)?r:null}function KV(e,t){return e!==`edit`||!t||typeof t.oldText!=`string`||typeof t.newText!=`string`?null:JV(t,t.oldText,t.newText)}var qV=new WeakMap;function JV(e,t,n){let r=qV.get(e);return r||(r=[{oldText:t,newText:n}],qV.set(e,r)),r}var YV=e=>e.content.map(e=>e.type===`text`?e.text:``).join(``),XV=/(?:^|\n)<source_reference type="(?:file|web)" (?:path|url)="[^"\n]*" \/>(?:\n<source_reference type="(?:file|web)" (?:path|url)="[^"\n]*" \/>)*$/,ZV=e=>e.content.map(e=>e.type===`text`?e.text.replace(XV,``):``).join(``);function QV(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`text`&&n.text.trim()||n.type===`thinking`&&n.text||n.type===`toolCall`||n.type===`image`)return t}return-1}function $V(e){let t=e.timing;if(t?.completedMs)return typeof e.duration==`number`&&e.duration>0?e.duration:Math.max(0,t.completedMs-t.stepStartMs)}function eH(e,t){let n=e.timing,r=$V(e);if(!n||r===void 0)return;let{stepStartMs:i,firstTokenMs:a}=n,o=e.usage?.output??0,s=typeof e.ttft==`number`&&e.ttft>0?e.ttft:a===void 0?void 0:Math.max(0,a-i);return{runMs:r,...t===void 0?{}:{turnMs:t},...s===void 0?{}:{ttftMs:s},...o>0&&r>0?{tps:o/(r/1e3)}:{}}}var tH=`<thinking>`,nH=`</thinking>`;function rH(e){let t=[],n=(e,n)=>{let r=n.trim();r&&t.push({kind:e,text:r})},r=0;for(;r<e.length;){let t=e.indexOf(tH,r);if(t===-1){n(`text`,e.slice(r));break}t>r&&n(`text`,e.slice(r,t));let i=t+10,a=e.indexOf(nH,i);if(a===-1){n(`thinking`,e.slice(i));break}n(`thinking`,e.slice(i,a)),r=a+11}return t}function iH(e){let t=new Set;for(let n of e??[])if(n.phase===`reviewing`&&n.toolCallId){t.add(n.toolCallId);let e=Cs(n.toolCallId);e&&t.add(e)}return t}function aH(e,t){return(t??[]).filter(t=>t.toolCallId&&Cs(t.toolCallId)===e).length}function oH(e,t,n,r,i,a,o=0,s,c=!1,l){let u=iH(i),d=new Map;for(let t of e)t.role===`toolResult`&&t.toolCallId&&d.set(t.toolCallId,{output:ZV(t),isError:t.isError===!0,todos:t.todos??null,durationMs:t.toolDurationMs??null,agentMeta:t.subagentMeta??null,editDiff:t.editDiff??null,fileChanges:t.fileChanges??null,applyPatchOutcome:t.applyPatchOutcome??null,codemodeCalls:t.codemodeCalls??null,rtk:t.rtk,approvalReview:t.approvalReview,backgroundTaskId:t.backgroundTaskId,shellFailure:t.shellFailure,dcgWarning:t.dcgWarning,pluginArtifacts:t.pluginArtifacts,generatedImages:t.generatedImages,image:qz(t.content)});let f=-1;for(let t=e.length-1;t>=0;t--)if(!e[t].optimistic&&e[t].role!==`toolResult`){f=t;break}let p=[],m=new Map,h=new Map,g=Array(e.length);for(let t=e.length-1,n;t>=0;t--)g[t]=n,ZB(e[t])?n=`user`:e[t].role===`assistant`&&!e[t].optimistic&&(n=`assistant`);let _=e.findLastIndex(e=>e.role===`user`&&!e.optimistic),v=e.findLastIndex(e=>!e.optimistic),b=0,x=0,S=!1,C,w=!1,T;return e.forEach((E,D)=>{let O=D===v,k=o+D;if(E.role===`user`&&E.optimistic){p.push({kind:`user`,key:`${k}`,text:YV(E),images:E.content.filter(e=>e.type===`image`),timestamp:E.timestamp,canCollapse:!1,deliveryState:E.deliveryRejected?E.rejectedReason===`turn-stuck`?`stuck`:`rejected`:`pending`});return}if(E.role===`user`){C=E.timestamp,w=!1,b=0,x=0,S=!1;let n=YV(E),r=E.content.filter(e=>e.type===`image`),i=/^<background-task-update>\n?([\s\S]*?)\n?<\/background-task-update>\s*$/.exec(n.trim());if(i&&r.length===0){let e=i[1].trim();p.push({kind:`task-note`,key:`${k}`,summary:e.split(`
209
+ `,1)[0]??e,detail:e}),T=void 0;return}if(n||r.length>0){let i=D+1;for(;e[i]?.role===`system`||e[i]?.optimistic;)i++;let a=i<e.length&&!ZB(e[i])&&!(t&&D===_),o={kind:`user`,key:`${k}`,text:n,images:r,timestamp:E.timestamp,canCollapse:a};p.push(o),T=o}return}if(E.role===`custom`){E.pluginSource&&(C=E.timestamp,w=!1,b=0,x=0,S=!1,T=void 0,p.push({kind:`plugin-message`,key:`${k}`,text:wz(YV(E)),...E.pluginSource}));return}if(E.role===`compactionSummary`){p.push({kind:`compaction`,key:`${k}`,summary:YV(E),tokensBefore:E.tokensBefore??null,...E.verified?{verified:!0}:{},...E.memory?{memory:!0}:{}});return}if(E.role===`toolResult`){E.toolName===`ask_user`&&(w=!0),x>0&&E.toolName!==`ask_user`&&typeof E.toolDurationMs==`number`&&Number.isFinite(E.toolDurationMs)&&E.toolDurationMs>0&&(b+=E.toolDurationMs);return}if(E.role!==`assistant`)return;x+=1,T&&E.model&&(x===1||S)&&(T.replyModel=E.model,S=E.stopReason===`error`),x===1&&T&&E.timestamp!==void 0&&(T.replyAt=E.timestamp),T&&E.privacyMask&&(T.replyPrivacyMask=y(T.replyPrivacyMask,E.privacyMask));let A=$V(E);A!==void 0&&(b+=A);let j=g[D]===void 0||g[D]===`user`,M=j&&x>1?b:void 0,N=!(g[D]===void 0&&(t||E.stopReason===`pending`)),P;if(j&&N){if(b>0)P=b;else if(!w){let e=E.timing?.completedMs??E.timestamp;typeof C==`number`&&typeof e==`number`&&e>C&&(P=e-C)}T&&P!==void 0&&(T.turnDurationMs=P)}if(E.restartResumed){p.push(sH(E,k,n));return}let F=QV(E.content);if(E.content.forEach((e,o)=>{let l=`${k}-${o}`,g=O&&o===F,_=!!E.stopReason&&E.stopReason!==`pending`,v=t&&g&&!_;switch(e.type){case`text`:{if(!e.text.trim())return;let t=rH(e.text);if(t.length===0)return;if(t.length===1&&t[0].kind===`text`){let t=j&&!v;p.push({kind:`text`,key:l,text:e.text,streaming:v,timestamp:E.timestamp,perf:eH(E,M),...t?{turnEnd:!0,...P===void 0?{}:{turnDurationMs:P}}:{}});return}t.forEach((e,n)=>{let r=t.length===1?l:`${l}-${n}`,i=v&&n===t.length-1;if(e.kind===`thinking`){p.push({kind:`thinking`,key:r,text:e.text,streaming:i,durationMs:null});return}let a=j&&!i&&n===t.length-1;p.push({kind:`text`,key:r,text:e.text,streaming:i,timestamp:E.timestamp,perf:eH(E,M),...a?{turnEnd:!0,...P===void 0?{}:{turnDurationMs:P}}:{}})});return}case`thinking`:if(e.text){let t=E.timing,n=t?.thinkingEndMs??t?.completedMs;p.push({kind:`thinking`,key:l,text:e.text,streaming:v,durationMs:t&&n!==void 0?Math.max(0,n-t.stepStartMs):null,...t?{startedAt:t.stepStartMs}:{}})}return;case`toolCall`:{let o=d.get(e.id),g=r?.[e.id],_=bV(e.name),v=_?_V(e.arguments):null,y=o?o.applyPatchOutcome?$B(o.applyPatchOutcome):o.output:(g??null)||null,b=e.name===`codemode`?SV(y):y,x=e.name===`exec`?EV(b):e.name===`codemode`&&o?TV(b,o.isError,o.codemodeCalls):null,S=Oz(e.name,e.arguments);e.name===`subagent`&&LV(m,h,e.arguments,o?.output);let C=e.name===`subagent`?BV(e.arguments,m,h):null,w=MV(e.name,e.arguments,m),T=w?.text??NV(e.name,e.arguments),E=VV(e.name,e.arguments),O=WV(e.name,e.arguments,b,!!(o&&!o.isError)),k=e.name===`apply_patch`?o?.fileChanges?.length?o.fileChanges.map(e=>e.path):pV(e.arguments):null,A=!o&&t&&D===f,j=A&&(e.name===`bash`||e.name===`powershell`),M=A?zV(e.name,e.arguments):null,N=e.name===`read`&&!o?.isError?dV(e.arguments,n):null;p.push({kind:`tool`,key:l,name:S.name,...$z(S.name,c)?{args:S.args??null}:{},summary:v?vV(v):k?k.length>1?`${k.length} files`:cV(k[0]??``,n):w?.summary??E?.title??O?.ask.question??C?.title??S.summary??mV(S.args,n),source:v,output:w?FV(b):O?O.output:b,nestedPending:aH(e.id,i)||void 0,...N?{imagePath:N}:{},...e.name===`image_view`&&o?.image&&!o.isError?{image:o.image}:{},...o?.generatedImages?.length?{generatedImages:o.generatedImages}:{},..._?{sandbox:x}:{},state:o?o.isError||x?.status===`failed`?`error`:`ok`:t&&D===f?u.has(e.id)?`reviewing`:`running`:t?`ok`:`error`,edits:o?.isError?null:GV(e.name,e.arguments)??KV(e.name,o?.editDiff),writeContent:OV(e.name,e.arguments),fileChanges:o?.fileChanges??null,todos:o?.todos??null,durationMs:o?.durationMs??null,agentMeta:o?.agentMeta??null,...o?.rtk?{rtk:o.rtk}:{},...o?.approvalReview?{approvalReview:o.approvalReview}:{},...j||M?{callId:e.id}:{},...M?{waiting:M}:{},...o?.backgroundTaskId?{backgroundTaskId:o.backgroundTaskId}:{},...o?.shellFailure?{shellFailure:o.shellFailure}:{},...o?.dcgWarning?{dcgWarning:o.dcgWarning}:{},...e.name===`submit_plan`?{plan:DV(e.name,e.arguments)}:{},...T?{sentMessage:T}:{},...E?{memoryContent:E.content}:{},...O?{ask:O.ask}:{},...C?.op?{subagentOp:C.op}:{},...C?.titles?{subagentTitles:C.titles}:{},...o?.pluginArtifacts?{pluginArtifacts:o.pluginArtifacts}:{},...s?.has(e.id)?{batchLabel:s.get(e.id)}:{},...o||!a?{}:{startedAt:a[e.id]??null}});return}default:return}}),E.errorMessage){let n=D+1;for(;e[n]?.role===`system`;)n++;let r=e[n]?.role===`assistant`,i=t&&D===e.length-1,a=l!==void 0&&E.errorMessage===l;!r&&!i&&!a&&p.push({kind:`error`,key:`${k}-err`,text:E.errorMessage})}}),p}function sH(e,t,n){let r=t=>e.content.flatMap(e=>e.type===t&&e.text.trim()?[e.text.trim()]:[]).join(`
210
+
211
+ `);return{kind:`resumed-reply`,key:`${t}-resumed`,thinking:r(`thinking`),text:r(`text`),tools:e.content.flatMap(e=>e.type===`toolCall`?[{name:e.name,summary:mV(e.arguments,n)}]:[]),expanded:!1}}var cH=e=>e.kind===`capability-receipt`?e.receipt.occurredAt:e.at,lH=`<${yk}>`;function uH(e){return e.content.map(e=>e.type===`text`?e.text:``).join(`
212
+ `).trim()}function dH(e){if(!e.includes(lH))return!1;if(Ek(e))return!0;let t=jk(e);return!!(t&&Ek(t.rest))}function fH(e,t,n){let r=new Set,i=t.filter(e=>e.kind===`task-wrap-up-nudge`).map(e=>e.at).sort((e,t)=>e-t);if(i.length===0)return r;let a=0,o=!1;return e.forEach((e,t)=>{if(e.optimistic)return;let s=e.timestamp??-1/0;for(;a<i.length&&(i[a]??0)<=s;)o=!0,a+=1;if(!o||e.role!==`user`&&e.role!==`toolResult`)return;let c=uH(e);if(e.role===`toolResult`){c.includes(lH)&&(o=!1);return}dH(c)&&(r.add(n+t),o=!1)}),r}var pH=e=>{let t=e.key.indexOf(`-`),n=Number.parseInt(t===-1?e.key:e.key.slice(0,t),10);return Number.isInteger(n)?n:-1},mH=(e,t,n=0)=>{let r=pH(e)-n;return r>=0?t[r]?.timestamp??-1/0:-1/0};function hH(e,t){let n=e.findLast(e=>e.kind===`compaction`);if(!n||t<=pH(n))return e;let r=e.length;for(let n=0;n<e.length;n++)if(pH(e[n])>=t){r=n;break}if(r===e.length&&pH(e.at(-1)??e[0])+1<t||e[r-1]?.kind===`compaction`)return e;let i={kind:`compaction-notice`,key:`compaction-notice:${n.key}`,summary:n.summary,tokensBefore:n.tokensBefore,...n.tokensAfter===void 0?{}:{tokensAfter:n.tokensAfter},...n.verified?{verified:!0}:{},...n.memory?{memory:!0}:{}};return[...e.slice(0,r),i,...e.slice(r)]}function gH(e,t){if(t===void 0)return e;let n=e.findLastIndex(e=>e.kind===`compaction`),r=e[n];if(r?.kind!==`compaction`)return e;let i=[...e];return i[n]={...r,tokensAfter:t},i}function _H(e,t,n,r){let i=gH(e,r),a=n===void 0?i:hH(i,n);return t?[...a,{kind:`compaction-progress`,key:`compaction:${t}`,state:t}]:a}function vH(e,t,n=[],r,i){let a=i?.historyBaseIndex??0,o=new Map,s=[];for(let e of n)e.kind===`tool-batch-label`?o.set(e.callId,e.label):s.push(e);let c=oH(e,t,r,i?.toolOutputs,i?.pendingApprovals,i?.toolStartedAt,a,o,i?.secretarySession===!0,i?.interrupted?.suppressedError),l=fH(e,s,a),u=l.size===0?c:c.map(e=>e.kind===`user`&&!e.deliveryState&&l.has(pH(e))?{...e,hostTaskWrapUp:!0}:e),d=s.length===0?u:[...u.map((t,n)=>({item:t,at:mH(t,e,a),order:n})),...s.map((e,t)=>({item:{kind:`session-custom`,key:e.kind===`capability-receipt`?`custom:receipt:${e.receipt.receiptId}`:e.kind===`oauth-account-selected`?`custom:${e.kind}:${e.accountKey}:${e.at}:${t}`:e.kind===`task-wrap-up-nudge`?`custom:${e.kind}:${e.at}:${t}`:`custom:${e.kind}:${e.child.generation}:${e.at}:${t}`,entry:e},at:cH(e),order:u.length+t}))].sort((e,t)=>e.at-t.at||e.order-t.order).map(({item:e})=>e),f=u.filter(e=>e.kind===`user`&&e.deliveryState),p=f.length?d.filter(e=>!(e.kind===`user`&&e.deliveryState)):d;for(let e of f){let t=e.kind===`user`?e.timestamp:void 0,n=t!==void 0&&Number.isFinite(t)?p.findIndex(e=>e.kind===`user`&&!e.deliveryState&&e.timestamp!==void 0&&Number.isFinite(e.timestamp)&&e.timestamp>t):-1;p.splice(n<0?p.length:n,0,e)}let m=_H(i?.runDividers?.length?bH(p,i.runDividers,t=>t.kind===`session-custom`?cH(t.entry):mH(t,e,a),a===0):p,i?.compaction,i?.compactionNoticeAt,i?.compactionTokensAfter);return i?.interrupted?[...m,{kind:`interrupted`,key:`interrupted`,at:i.interrupted.at,exitKind:i.interrupted.kind,unfinishedTools:i.interrupted.unfinishedTools}]:m}var yH=1e4;function bH(e,t,n,r){let i=[...e],a=-1;for(let e of t){let t=i.findIndex((t,r)=>r>a&&n(t)>=e.at);if(t<0&&(t=i.length),!r&&!i.slice(0,t).some(t=>n(t)<e.at))continue;let o=i[t-1];t-1>a&&o.kind===`user`&&e.at-n(o)<=yH&&--t,i.splice(t,0,{kind:`divider`,key:e.key,text:e.text}),a=t+1}return i}var xH=3;function SH(e){switch(e.kind){case`compaction`:case`compaction-notice`:case`compaction-progress`:case`error`:case`divider`:case`plugin-message`:case`discarded-turn`:case`interrupted`:return!1;default:return!0}}var CH=new Set([`grep`,`find`,`glob`,`ls`]);function wH(e,t,n,r){e===`read`?n.reads+=1:CH.has(e)?n.searches+=1:e===`bash`?!r||!_z(t)?n.commands+=1:DH.has(pz(t))?n.reads+=1:n.searches+=1:n.others+=1}var TH=new Set([`read`,...CH]);function EH(e){let t=[],n=e=>{e.kind===`tool-group`?e.children.forEach(n):e.kind===`tool`&&e.batchLabel&&!t.includes(e.batchLabel)&&t.push(e.batchLabel)};return e.forEach(n),t.length>0?t.join(` · `):void 0}var DH=new Set([`cat`,`bat`,`head`,`tail`,`less`,`more`,`nl`,`tac`]);function OH(e){return TH.has(e.name)||e.name===`bash`&&_z(e.summary)}function kH(e){let t=[];for(let n of e){let e=t.at(-1);n.kind===`thinking`&&e?.kind===`thinking`&&pH(n)>=0&&pH(e)===pH(n)?t[t.length-1]={...e,text:`${e.text}\n\n${n.text}`,streaming:e.streaming||n.streaming,durationMs:e.durationMs??n.durationMs,startedAt:e.startedAt??n.startedAt}:t.push(n)}return t}var AH=new Set([`explore_mark`,`explore_fold`]),jH=/^Explore folded\.[^\n]*\n*/,MH=e=>`${e}:steps`;function NH(e,t,n){let r=[],i=-1;for(let a of e){if(a.kind!==`tool`&&a.kind!==`thinking`&&a.kind!==`text`)i=-1;else if(a.kind===`tool`&&a.state===`ok`){if(a.name===`explore_fold`&&i>=0){let e=[...r.splice(i),a],o=e[0],s={commands:0,reads:0,searches:0,others:0},c=0;for(let t of e)t.kind!==`tool`||AH.has(t.name)||(wH(t.name,t.summary,s,n),c+=1);let l=`explore-${o.key}`,u=t.has(l);r.push({kind:`tool-group`,key:l,expanded:u,count:c,stats:s,exploring:!1,explore:{goal:o.summary,report:(a.output??``).replace(jH,``).trim(),steps:u&&t.has(MH(l))},children:e}),i=-1;continue}a.name===`explore_mark`&&i<0&&(i=r.length)}r.push(a)}return r}var PH=/^Turn discarded[:.]?\s*/;function FH(e,t){let n=[];for(let r of e){if(r.kind===`tool`&&r.name===`turn_discard`&&r.state===`ok`){let e=n.length;for(;e>0&&(n[e-1].kind===`thinking`||n[e-1].kind===`text`||n[e-1].kind===`tool`);)e--;let i=e;for(;e>0&&n[e-1].kind===`plugin-message`;)e--;if(e<i){let i=n.splice(e),a=i.filter(e=>e.kind===`plugin-message`),o=`discard-${a[0].key}`;n.push({kind:`discarded-turn`,key:o,reason:r.output==null?r.summary:r.output.replace(PH,``).trim(),pluginId:a[0].pluginId,pluginName:a[0].pluginName,messages:a.map(e=>e.text),tools:i.flatMap(e=>e.kind===`tool`?[{name:e.name,summary:e.summary}]:[]),expanded:t.has(o)});continue}}n.push(r)}return n}function IH(e){return e.kind===`tool-group`&&e.explore?.steps?[e,...e.children]:[e]}function LH(e,t,n=!1){if(e.length<2)return e.flatMap(IH);let r={commands:0,reads:0,searches:0,others:0},i=0,a=0,o=0;for(let t of e.flatMap(e=>e.kind===`tool-group`?e.children:[e]))t.kind===`thinking`?i+=1:t.kind===`tool`&&(wH(t.name,t.summary,r,!1),o+=1),(t.kind===`thinking`||t.kind===`tool`)&&(a+=t.durationMs??0);let s=`group-${e[0].key}`,c=t.has(s),l=EH(e),u={kind:`tool-group`,key:s,expanded:c,count:o,stats:r,exploring:!1,activity:{thinking:i,workedMs:a},...n?{live:!0}:{},...l?{summary:l}:{},children:e};return c?[u,...e.flatMap(IH)]:[u]}var RH={signature:``,closedAt:null,held:[]};function zH(e){return e.kind===`tool-group`&&e.children[0]?e.children[0].key:e.key}function BH(e,t){return e.kind===`tool`&&e.generatedImages?.length||e.kind===`tool`&&$z(e.name,t)?!1:e.kind===`thinking`||e.kind===`tool-group`||e.kind===`tool`&&e.state===`ok`&&!e.name.startsWith(`goal_`)&&e.name!==`submit_plan`}function VH(e,t,n,r){let i=FH(e,n),a=r.autoCollapseCompletedTurns===!0,o=r.turnOverrides,s=i.findLastIndex(e=>e.kind===`user`&&!e.deliveryState),c=i;if(a||o&&o.size>0){let e=[],n=0;for(;n<i.length;){let r=i[n];if(r.kind===`user`){let c=n===s,l=a&&!c&&r.canCollapse===!0,u=!r.deliveryState&&!(t&&c)&&(o?.get(r.key)??l);if(e.push(u?{...r,collapsed:!0}:r),n+=1,u)for(;n<i.length&&i[n].kind!==`user`;){let t=i[n];SH(t)||e.push(t),n+=1}}else e.push(r),n+=1}c=e}c=NH(c,n,r.compact===!0);let l=c.findLastIndex(e=>e.kind===`user`&&!e.deliveryState),u=Math.max(l,c.findLastIndex(e=>e.kind===`text`));return{sourceItems:c,lastUserIndex:l,liveFrom:u}}function HH(e,t,n){if(n.collapseLiveActivity!==!0||!t)return null;let{sourceItems:r,liveFrom:i}=VH(e,t,new Set,n),a=n.readableToolCards===!0,o=[],s=!1,c=0;for(;c<r.length;){if(!(c>i)||!BH(r[c],a)){c+=1;continue}let e=[],t=c;for(;t<r.length&&BH(r[t],a);){let n=r[t];if(n.kind===`thinking`&&n.streaming){s=!0;break}e.push(zH(n)),t+=1}for(e.length>0&&o.push(e);t<r.length&&BH(r[t],a);)t+=1;c=t}return o.length===0?null:{segments:o,blocked:s}}function UH(e,t,n,r,i){let a=HH(e,t,n);if(!a)return{witness:RH,released:new Set,wakeAt:null};let{segments:o,blocked:s}=a,c=new Set(r.held),l=[],u=[],d=!0;for(let e of o)for(let t of e)d&&c.has(t)?l.push(t):(d=!1,u.push(t));let f=new Set(l);if(s)return{witness:{signature:``,closedAt:null,held:l},released:f,wakeAt:null};let p=o.some(e=>e.filter(e=>!f.has(e)).length>0&&e.length>=2);if(u.length===0||!p)return{witness:{signature:``,closedAt:null,held:l},released:f,wakeAt:null};let m=u.join(`\0`),h=r.signature===m&&r.closedAt!==null?r.closedAt:i,g=h+tz(n.liveActivityFoldDelaySec);if(i<g)return{witness:{signature:m,closedAt:h,held:l},released:f,wakeAt:g};let _=[...l,...u];return{witness:{signature:``,closedAt:null,held:_},released:new Set(_),wakeAt:null}}function WH(e,t,n,r,i,a,o,s,c,l){let u=e=>e.kind===`tool`&&c?.has(e.key)===!0,d=e=>e.kind===`tool`&&$z(e.name,l),f=e=>i&&!(t&&e>s),p=n=>{if(!a||!t||!(n>s)||!BH(e[n],l)||u(e[n])||!a.has(zH(e[n])))return n;let r=n;for(;r<e.length&&BH(e[r],l)&&!u(e[r])&&a.has(zH(e[r]));)r+=1;return r-n>=2?r:n},m=(e,t)=>!d(e)&&!u(e)&&!(e.kind===`tool`&&e.generatedImages?.length)&&(e.kind===`thinking`||e.kind===`tool-group`&&f(t)||e.kind===`tool`&&(f(t)?e.state===`ok`&&!e.name.startsWith(`goal_`)&&e.name!==`submit_plan`:!r||OH(e))),h=[],g=0;for(;g<e.length;){let i=e[g],a=p(g);if(a>g){h.push(...LH(kH(e.slice(g,a)),n,!0)),g=a;continue}if(!m(i,g)){h.push(...IH(i)),g+=1;continue}let s=g;for(;s<e.length&&m(e[s],s)&&p(s)===s;)s+=1;let c=kH(e.slice(g,s));if(f(g)){h.push(...LH(c,n)),g=s;continue}let l=!r&&t&&o>=0&&g>o,u=e=>e.kind===`tool`?e.edits!==null||e.writeContent||e.fileChanges?.length||e.imagePath&&e.state!==`error`||e.name===`todo`||e.name===`submit_plan`?!0:e.state!==`running`&&e.state!==`reviewing`?!1:!(r&&OH(e)):!1,d=c.filter(u),_=c.filter(e=>!u(e)),v=_.filter(e=>e.kind===`tool`).length;if(l||v<xH)h.push(...c);else{let i={commands:0,reads:0,searches:0,others:0};for(let e of _)e.kind===`tool`&&wH(e.name,e.summary,i,r);let a=`group-${c[0].key}`,o=n.has(a),l=EH(_);h.push({kind:`tool-group`,key:a,expanded:o,count:v,stats:i,exploring:r&&(t&&s===e.length||_.some(e=>e.kind===`tool`&&(e.state===`running`||e.state===`reviewing`))),...l?{summary:l}:{},children:_}),o?h.push(...c):h.push(...d)}g=s}return h}function GH(e){return e.kind===`user`&&!e.deliveryState}function KH(e){return e.kind===`text`&&de(e.text)}function qH(e){return e.kind===`text`&&e.text.trim().length>0&&!de(e.text)}function JH(e,t){for(let n of e)n.kind===`tool`?t(n):n.kind===`tool-group`&&JH(n.children,t)}function YH(e,t,n){if(e.length===0)return[];let r={commands:0,reads:0,searches:0,others:0},i=0,a=0,o=0;JH(e,e=>{wH(e.name,e.summary,r,!1),i+=1,o+=e.durationMs??0});for(let t of e)t.kind===`thinking`&&(a+=1,o+=t.durationMs??0);let s=`${n?`silent`:`group`}-${e[0].key}`,c=t.has(s),l=EH(e),u={kind:`tool-group`,key:s,expanded:c,count:i,stats:r,exploring:!1,activity:{thinking:a,workedMs:o},...n?{notice:n}:{},...l&&!n?{summary:l}:{},children:e};return c?[u,...e]:[u]}function XH(e){return/<secretary-schedule>/.test(e)&&!/<session-updates>/.test(e)?`patrol`:`seen`}function ZH(e){let t=!1;return JH(e,e=>{e.name===`silence_turn`&&(t=!0)}),t||e.some(KH)}function QH(e,t,n,r){let i=[],a=0;for(;a<e.length;){if(!GH(e[a])){i.push(e[a]),a+=1;continue}let o=a+1;for(;o<e.length&&!GH(e[o]);)o+=1;let s=e.slice(a,o),c=t&&o===e.length;i.push(...$H(s,c,n,r)),a=o}return i}function $H(e,t,n,r){let i=e[0];if(t||i?.kind!==`user`)return e;let a=e.slice(1).filter(e=>!KH(e));if(be(i.text)&&ZH(e.slice(1))){let e=XH(i.text);return YH([{...i,canCollapse:!1},...a],n,e)}if(!r||a.some(qH))return e;let o=!1,s=0;return JH(a,e=>{s+=1,e.state!==`ok`&&(o=!0)}),o||s<1||a.some(e=>e.kind!==`tool`&&e.kind!==`thinking`&&e.kind!==`tool-group`)?e:[{...i,canCollapse:!1},...YH(a,n)]}function eU(e,t,n,r={}){let{sourceItems:i,lastUserIndex:a,liveFrom:o}=VH(QH(e.map(e=>e.kind===`resumed-reply`?{...e,expanded:n.has(e.key)}:e),t,n,r.foldToolOnlyTurns===!0),t,n,r),s=r.readableToolCards===!0,c=kz(i,e=>$z(e,s),(e,t)=>e.kind===`tool`?{...e,cardPeers:t.flatMap(e=>e.kind===`tool`?[{key:e.key,args:e.args??null,output:e.output,state:e.state,...e.image?{image:e.image}:{}}]:[])}:e),l=r.collapseLiveActivity===!0?r.releasedLiveActivity??null:null;return WH(c,t,n,r.compact===!0,r.collapseCompletedActivity===!0,l,a,o,r.heldOpenTools??null,s)}var tU={rows:new Set,expanded:new Set};function nU(e,t,n){let r=[],i=[],a=new Map,o=new Set;for(let s of t){if(s.kind!==`tool-group`||!s.explore)continue;let t=e.rows.has(s.key);if(s.explore.steps){o.add(s.key),t&&!e.expanded.has(s.key)&&i.push(s.key),s.children.forEach((e,t)=>{a.set(e.key,{group:s.key,index:t})});continue}let c=s.children[0]?.key??``,l=s.children.at(-1)?.key??``,u=!t&&e.rows.has(c)&&e.rows.has(l);if(!u&&!e.expanded.has(s.key))continue;let d=n(u?c:s.key,l);d>0&&r.push({key:s.key,height:d,pair:u})}return{collapses:r,expands:i,children:a,next:{rows:new Set(t.map(e=>e.key)),expanded:o}}}function rU({loading:e=!1,runStartedAt:t}){if(!e)return t}var iU=(0,H.createContext)({query:``,activeKey:``,activeNth:-1});function aU(){return(0,H.useContext)(iU)}var oU=`rounded-[2px] px-0.5 py-px`,sU=`${oU} bg-yellow-300 text-foreground dark:bg-yellow-500/80`,cU=`${oU} bg-orange-600 text-white dark:bg-orange-500`;function lU(e,t,n,r){let i=t.trim();if(!i)return e;let a=e.toLowerCase(),o=i.toLowerCase(),s=0,c=a.indexOf(o,s);if(c<0)return e;let l=[];for(;c>=0;){c>s&&l.push(e.slice(s,c));let t=r.n++;l.push((0,G.jsx)(`mark`,{className:t===n?cU:sU,children:e.slice(c,c+i.length)},t)),s=c+i.length,c=a.indexOf(o,s)}return s<e.length&&l.push(e.slice(s)),l}function uU(e,t,n,r){return e==null||typeof e==`boolean`?e:typeof e==`string`||typeof e==`number`?lU(String(e),t,n,r):Array.isArray(e)?e.map((e,i)=>(0,G.jsx)(H.Fragment,{children:uU(e,t,n,r)},i)):e}function dU(e){return e===`right`||e===`off`?e:`left`}function fU(e,t,n){return e!==`off`&&!t&&n>=2}var pU=40;function mU({items:e,activeKey:t,onJump:n}){let r=T(e=>e.chatWide),i=dU(T(e=>e.navRailSide)),[a,o]=(0,H.useState)(null);if(!fU(i,r,e.length))return null;let s=i===`right`,c=Math.max(0,e.findIndex(e=>e.key===t)),l=Math.min(Math.max(0,c-Math.floor(pU/2)),Math.max(0,e.length-pU)),u=e.slice(l,l+pU),d=l>0,f=l+pU<e.length,p=(e,t)=>{let n=t?24:12;if(a===null)return n;let r=Math.abs(e-a);return n+Math.max(0,16-r*6)};return(0,G.jsx)(`div`,{className:W(`group/rail absolute top-0 z-10 hidden h-full w-14 @min-[52rem]:block`,s?`right-0`:`left-0`),children:(0,G.jsx)(`div`,{className:W(`absolute top-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-200 group-hover/rail:opacity-100`,s?`right-2`:`left-2`),onMouseLeave:()=>o(null),children:(0,G.jsxs)(`div`,{className:`relative flex flex-col justify-center gap-[5px]`,style:{maskImage:d||f?`linear-gradient(to bottom, ${d?`transparent, black 24px`:`black`}, ${f?`black calc(100% - 24px), transparent`:`black`})`:void 0},children:[u.map((e,r)=>{let i=e.key===t,c=r===a;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(e.key),onMouseEnter:()=>o(r),className:W(`flex h-[7px] w-10 items-center`,s&&`justify-end`),children:(0,G.jsx)(`span`,{className:W(`rounded-full transition-all duration-150`,i||c?`h-[3px] bg-foreground`:`h-[2px] bg-muted-foreground/40`),style:{width:p(r,i)}})},e.key)}),a!==null&&u[a]&&(0,G.jsxs)(`div`,{className:W(`pointer-events-none absolute w-72 -translate-y-1/2 rounded-xl border bg-popover p-3 shadow-lg`,s?`right-10`:`left-10`),style:{top:`${(a+.5)/u.length*100}%`},children:[(0,G.jsx)(`p`,{className:`line-clamp-2 text-xs font-semibold`,children:u[a].question}),u[a].answer&&(0,G.jsx)(`p`,{className:`mt-1 line-clamp-3 text-xs text-muted-foreground`,children:u[a].answer})]})]})})})}var hU={width:72,height:28};function gU(e,t){let n=[];for(let r of e.querySelectorAll(`[data-quote-skip]`)){let e=r.getBoundingClientRect();e.height>0&&e.bottom>0&&e.top<t&&n.push(e)}return n}function _U({containerRef:e}){let{t}=K(),n=T(e=>e.quoteSelectionButton),r=ZD(),[i,a]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!n){a(null);return}let t=()=>{let t=e.current,n=window.getSelection(),i=t?jA(n,t):null;if(!i||!n||!t){a(null);return}let o=n.getRangeAt(0).getBoundingClientRect(),s={width:window.innerWidth,height:window.innerHeight},c=gU(t,s.height);a({text:i,...PA(o,s,hU,r,c)})};return document.addEventListener(`selectionchange`,t),window.addEventListener(`scroll`,t,!0),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`selectionchange`,t),window.removeEventListener(`scroll`,t,!0),window.removeEventListener(`resize`,t)}},[n,r,e]),!n||!i?null:(0,qs.createPortal)((0,G.jsxs)(`button`,{type:`button`,"data-enso":`quote-selection`,title:t(`Quote into the input box`),onMouseDown:e=>e.preventDefault(),onClick:()=>{let e=SA(i.text);!e||!ZO(e)||(window.getSelection()?.removeAllRanges(),a(null))},style:{top:i.top,left:i.left,minWidth:hU.width},className:`fixed z-50 inline-flex h-7 items-center justify-center gap-1 rounded-full border bg-card px-2.5 text-xs text-foreground shadow-float hover:bg-muted`,children:[(0,G.jsx)(On,{className:`h-3 w-3`}),t(`Quote`)]}),document.body)}var vU=/\n*<chat-reference id="([^"]*)" title="([^"]*)" kind="(?:direct|group)">\n[\s\S]*?\n<\/chat-reference>/g;function yU(e){let t=[],n=e.replace(vU,(e,n,r)=>(t.push({id:n,title:r}),``));return t.length?{body:n.trim(),refs:t}:{body:e,refs:t}}var bU={zh:`这是同一件事的补充,保留原目标,把它并进这一轮的结果;不要单独回一句「收到」。只有明确说换掉或取消才改目标。
213
+ 补充内容:
214
+ `,en:`This adds to the same request. Keep the original goal and fold it into this turn's result; do not reply with a standalone "got it". Only change the goal if explicitly told to replace or cancel it.
215
+ Addition:
216
+ `};function xU(e){for(let t of Object.values(bU))if(e.startsWith(t))return e.slice(t.length);return e}var SU=/^\s*<notes-updated>[\s\S]*?<\/notes-updated>\s*/;function CU(e){return xU(e.replace(SU,``))}var wU={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&apos;":`'`},TU=e=>e.replace(/&(?:amp|lt|gt|quot|apos);/g,e=>wU[e]);function EU(e){let t=Object.create(null);return e.replace(/\s+([\w-]+)="([^"]*)"/g,(e,n,r)=>(t[n]=TU(r),``)).trim()?null:t}function DU(e){let t=CU(e).trim(),n=OU(t);if(n||t.startsWith(`<group`)||t.startsWith(`(`))return n;for(let e of t.matchAll(/\n(?=<group-info>|<group-state>|<group-context>\n|<group-message |(省略了 \d+ 条)/g)){let n=OU(t.slice(0,e.index).trim()),r=OU(t.slice(e.index).trim());if(n&&n.kind!==`group`&&r?.kind===`group`)return{...n,group:r.messages}}return null}function OU(e){let t=/^(省略了 \d+ 条更早的消息)\s*/,n=/^<group-context>\n([\s\S]*)\n<\/group-context>$/.exec(e);if(n){let e=n[1].search(/^(?:<group-message |(省略了 \d+ 条)/m);if(e<0)return null;let r=OU(n[1].slice(e).replace(t,``).trim());return r?.kind===`group`&&!r.instruction&&!r.note&&!r.refs?{kind:`group`,messages:r.messages,instruction:``}:null}if(e.startsWith(`<group-info>`)||e.startsWith(`<group-state>`)||e.startsWith(`<group-message `)||t.test(e)){let n=e.replace(/^<group-info>[\s\S]*?<\/group-info>\s*/,``).replace(/^<group-state>[\s\S]*?<\/group-state>\s*/,``),r=t.exec(n)?.[0].trim();n=n.replace(t,``);let i=[];for(;n.startsWith(`<group-message `);){let e=/^<group-message([^>]*)>([\s\S]*?)<\/group-message>\s*/.exec(n);if(!e)return null;let t=EU(e[1]);if(!t?.from)return null;i.push({from:t.from,text:TU(e[2].trim())}),n=n.slice(e[0].length)}if(!i.length)return null;let a=/\n*<routing-note>([\s\S]*?)<\/routing-note>\s*$/.exec(n);a&&(n=n.slice(0,a.index));let{body:o,refs:s}=yU(n);return{kind:`group`,messages:i,instruction:TU([r,o.trim()].filter(Boolean).join(`
217
+ `)),...a?{note:TU(a[1].trim())}:{},...s.length?{refs:s}:{}}}let r=/^<delegation-results(\s[^>]*)?>([\s\S]*)<\/delegation-results>$/.exec(e);if(r){if(!EU(r[1]??``))return null;let e=r[2].trim(),t=[];for(;e;){let n=/^<delegation-result([^>]*)>([\s\S]*?)<\/delegation-result>\s*/.exec(e),r=n&&EU(n[1]);if(!n||!r?.from)return null;t.push({from:r.from,status:r.status??``,text:TU(n[2].trim())}),e=e.slice(n[0].length)}return t.length?{kind:`delegation-results`,results:t}:null}let i=/^<(routine|delegation-task|delegation-result|delegation-retry|delegation-check-failed)(\s[^>]*)?>([\s\S]*)<\/\1>$/.exec(e);if(!i)return null;let a=EU(i[2]??``);if(!a)return null;let o=i[3].trim();if(i[1]===`delegation-retry`||i[1]===`delegation-check-failed`)return!a.id||/[<>]/.test(o)?null:{kind:i[1],text:TU(o)};if(i[1]===`routine`){if(!a.title)return null;if(a[`dry-run`]!==`true`)return{kind:`routine`,title:a.title,prompt:TU(o)};let e=TU(o.replace(/^\[Dry run\][^\n]*\n*/,``));return{kind:`routine`,title:a.title,prompt:e,dryRun:!0}}if(!a.from)return null;if(i[1]===`delegation-result`)return{kind:`delegation-result`,from:a.from,status:a.status??``,text:TU(o)};let s=o.replace(/\s*<previous-runs>[\s\S]*<\/previous-runs>$/,``).replace(/\s*<acceptance-check>[\s\S]*<\/acceptance-check>$/,``),c=/\s*<context>([\s\S]*)<\/context>$/.exec(s);return!c&&/<\/?context>/.test(s)?null:{kind:`delegation-task`,from:a.from,task:TU((c?s.slice(0,c.index):s).trim()),context:TU(c?.[1].trim()??``)}}var kU=`You are a side conversation attached to a coding session. The main agent cannot see this thread. Do not continue the main task unless the user asks you to. Follow the same tool and skill constraints as the main session. Do not spawn subagents, coworkers, or workflows. Answer the user directly.`;function AU(e){return e.startsWith(kU)}function jU(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var MU={zh:{quit:`被关闭`,update:`被关闭(安装更新)`},en:{quit:`was closed`,update:`was closed (installing an update)`}};function NU(e){let t=jU(e.at),n=[...new Set(e.unfinishedTools)];return e.lang===`en`?`${`The app ${MU.en[e.kind]} at ${t} and this turn was interrupted.`}${n.length>0?` ${n.length} tool call(s) never returned (${n.join(`, `)}) and may have run halfway — check the result before continuing.`:``}`.trim():`${`应用在 ${t} ${MU.zh[e.kind]},这一轮被中断。`}${n.length>0?`中断时有 ${n.length} 个工具调用没有结果(${n.join(`、`)}),可能只执行了一半,继续前请先检查。`:``}`}function PU(e){let t=NU(e);return e.lang===`en`?`${t} You can retry to continue.`:`${t}可以点重试继续。`}var FU={"too-large":`超过 10MB,没有保存`,"not-image":`不是 png / jpeg / webp / gif 图片,没有保存`,unavailable:`没能保存`},IU=String.raw`\[图片 \d+(?: 未收下)?\] [^\n]*`;new RegExp(String.raw`(?:^|\n\n)${IU}(?:\n${IU})*$`,`u`);function LU(e){return[...e.matchAll(/^\[图片 \d+\] (.+)$/gmu)].map(e=>e[1])}var RU=new Map(Object.entries(FU).map(([e,t])=>[t,e]));function zU(e){return/^(?:\/|[A-Za-z]:\/)/u.test(e.replace(/\\/gu,`/`))}function BU(e){return zU(e)&&e.replace(/\\/gu,`/`).includes(`/bot-chats/secretary-images/`)}function VU(e,t=0){let n=[];for(let[r,i]of e.split(`
218
+ `).entries()){let e=/^\[图片 (\d+)( 未收下)?\] (.+)$/u.exec(i);if(!e||Number(e[1])!==r+1)return null;let a=e[3];if(e[2]){let e=RU.get(a);if(!e)return null;n.push({index:r+1,rejected:e})}else{if(!(r<t?zU(a):BU(a)))return null;n.push({index:r+1,path:a})}}return n}var HU=new RegExp(String.raw`(?:^|\n\n)(${IU}(?:\n${IU})*)`+String.raw`((?:\n\n\[Image[^\n]*\](?:\n\[Image[^\n]*\])*)?)$`,`u`);function UU(e,t=0){let n=HU.exec(e);if(!n)return null;let r=VU(n[1],t);if(!r)return null;let i=e.slice(0,n.index),a=n[2]??``;return{text:i?`${i}${a}`:a.replace(/^\n\n/u,``),entries:r}}new TextEncoder;function WU(e){if(e)try{return decodeURIComponent(e)}catch{return e}}var GU=`([A-Za-z0-9._@:+/=%-]+)`,KU=RegExp(String.raw`^\[(?:来自|From) ([^\]\n@·「」]{1,40}?)`+String.raw`(?: (私聊|private|群|group)(?:「([^」\]\n]{1,64})」)?)?`+`(?: chatId=${GU})?(?: topicId=${GU})?(?: senderId=${GU}| (发送者未知|sender unknown))?`+String.raw`(?: @([^\]\n@·]{1,32}?))?(?: · (\d{2}):(\d{2}))?\]\n`+String.raw`<untrusted-content source="([a-z0-9._:-]+?)(?::@[^"\n]{1,32})?(?: [^"\n]*)?">`+String.raw`([\s\S]*)<\/untrusted-content>((?:\n${IU})*)$`,`u`);function qU(e){let t=KU.exec(e);if(!t)return null;let[,n=``,r,i,a,o,s,c,l,u,d,f=``,p=``,m=``]=t,h=r===`私聊`||r===`private`?`private`:r?`group`:void 0,g={chat:WU(a),topic:WU(o),sender:WU(s)},_=LU(m),v=m?VU(m.slice(1)):null;return{channel:f,title:n,...g.chat?{chatId:g.chat}:{},...h?{chatType:h}:{},...h===`group`&&i?{chatTitle:i}:{},...g.topic?{topicId:g.topic}:{},...g.sender?{senderId:g.sender}:{},...c?{senderUnknown:!0}:{},...l?{username:l}:{},...u&&d?{time:`${u}:${d}`}:{},body:bz(p),..._.length?{images:_}:{},...v?.length?{imageLines:v}:{}}}var JU=RegExp(`<(agent-notification|goal-continuation|coworker-hired|coworker-dismissed|background-task-update|session-updates|secretary-schedule|secretary-message)>\\n?([\\s\\S]*?)\\n?</\\1>`,`g`),YU=/\n(?=Work toward this goal autonomously\.|Continue working toward it\.)/;function XU(e){let t=(e.split(`
219
+ `).map(e=>e.trim()).find(Boolean)??``).split(/(?<=[。!?.!?])\s*/)[0]?.trim()??``;return t.length<=72?t:`${t.slice(0,72)}…`}function ZU(e){let t=e.trim(),n=/^(?:Session goal(?: resumed)?:[ \t]*)([\s\S]*)$/.exec(t),r=(n?n[1]:t).trim(),i=r.search(YU);return i<0?{goal:r,instructions:``}:{goal:r.slice(0,i).trim(),instructions:r.slice(i).trim()}}function QU(e){let t=[],n=new RegExp(JU.source,`g`),r=0,i=!1;for(let a of e.matchAll(n)){i=!0;let n=a.index??0;n>r&&t.push({kind:`text`,text:e.slice(r,n)});let o=a[1]??``,s=a[2]??``;o===`goal-continuation`?t.push({kind:`goal`,...ZU(s)}):o===`secretary-schedule`?t.push({kind:`schedule`,raw:a[0]}):o===`session-updates`?t.push({kind:`updates`,raw:a[0]}):t.push({kind:`notice`,tag:o,body:s}),r=n+a[0].length}return i?(r<e.length&&t.push({kind:`text`,text:e.slice(r)}),t):null}var $U=/^<\/?(?:agent-notification|goal-continuation|coworker-hired|coworker-dismissed|background-task-update|session-updates|secretary-schedule|secretary-message)>$/;function eW(e){return e.split(`
220
+ `).filter(e=>!$U.test(e.trim())).join(`
221
+ `).trim()}function tW(e){return e.length<=72?e:`${e.slice(0,72)}…`}function nW(e){let t=e.trim(),n=t.indexOf(`
222
+ `),r=(n<0?t:t.slice(0,n)).trim(),i=r.indexOf(`:`);if(i>0&&i<=8){let e=r.slice(i+1).trim();if(e){let r=n<0?``:t.slice(n+1);return{summary:tW(e),body:r?`${e}\n${r.trim()}`:e}}}return{summary:tW(r),body:t}}function rW(e){let t=eW(e);return t?t.split(/\n(?=- \[schedule\])/).map(e=>nW(e.replace(/^- \[schedule\][ \t]?/,``))).filter(e=>e.body.length>0):[]}function iW(e){let t=eW(e).replace(/^- \[[a-z-]+(?: session:[^\]]+)?\][ \t]?/gm,``).trim();return{summary:tW(t.split(`
223
+ `).map(e=>e.trim()).find(Boolean)??``),body:t}}var aW=`#7c5cff`,oW=/^#[0-9a-f]{6}$/iu,sW=/^[0-9a-f]{8}$/u,cW=/^([01]\d|2[0-3]):[0-5]\d$/u,lW=[`ui`,`zh`,`en`],uW=[`concise`,`detailed`],dW=[`needs-user`,`with-done`,`off`],fW=[`goal-complete`,`goal-blocked`,`turn-ended`,`needs-user`,`failed`,`stalled`,`interrupted`];function pW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mW(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function hW(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function gW(e){let t=hW(e);return t===void 0?void 0:Math.floor(t)}function _W(e,t,n){if(!(typeof e!=`number`||!Number.isFinite(e)))return Math.min(n,Math.max(t,Math.round(e)))}function vW(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=mW(n);e&&!t.includes(e)&&t.push(e)}return t}function yW(e,t,n){return t.includes(e)?e:n}function bW(e,t){return typeof e==`boolean`?e:t}var xW={mode:`projects`,projectIds:[]};function SW(e){return pW(e)?e.mode===`all`?{mode:`all`}:e.mode===`explicit`?{mode:`explicit`}:e.mode===`projects`?{mode:`projects`,projectIds:vW(e.projectIds)}:xW:xW}function CW(e){if(!pW(e))return null;let t=pW(e.avatar)?e.avatar:{},n=gW(t.imageVersion),r=typeof t.imageHash==`string`&&sW.test(t.imageHash)?t.imageHash:void 0,i={version:1,name:mW(e.name)??`秘书`,avatar:{color:typeof t.color==`string`&&oW.test(t.color)?t.color:aW,...n&&n>0?{imageVersion:n,...r?{imageHash:r}:{}}:{}},takeoverScope:SW(e.takeoverScope),pluginIds:vW(e.pluginIds),skillIds:vW(e.skillIds),visibleProjectIds:Array.isArray(e.visibleProjectIds)?vW(e.visibleProjectIds):`all`,maxRunningDispatches:_W(e.maxRunningDispatches,1,10)??3,patrolEnabled:bW(e.patrolEnabled,!0),...e.cleanupSkipConfirm===!0?{cleanupSkipConfirm:!0}:{},replyLanguage:yW(e.replyLanguage,lW,`ui`),style:yW(e.style,uW,`concise`),notify:yW(e.notify,dW,`needs-user`),updatedAt:hW(e.updatedAt)??0},a=_W(e.updateWindowMs,1e3,6e4);a!==void 0&&(i.updateWindowMs=a);let o=vW(e.disabledSkillNames);o.length>0&&(i.disabledSkillNames=o);let s=mW(e.addressAs);return s&&(i.addressAs=s),typeof e.dailyBriefAt==`string`&&cW.test(e.dailyBriefAt)&&(i.dailyBriefAt=e.dailyBriefAt),i}var wW=/^<(session-updates|secretary-schedule)>\n([\s\S]*?)\n<\/\1>(?:\n|$)/,TW=/^- \[([a-z-]+)(?: (?:session|pending):([^\]\s]+))?\] ([^\n]*)(?:\n|$)/,EW=/^<untrusted-content source="[^"]*">/,DW=`</untrusted-content>`;function OW(e){return fW.includes(e)}function kW(e,t,n,r){return e===`secretary-schedule`?t===`schedule`&&!n?{kind:t,text:r}:null:t===`proposal`?n?null:{kind:t,text:r}:t===`pending`?{kind:t,text:r}:t===`ask-relay`||t===`leftover`||t===`queued`?n?{kind:t,text:r,conversationId:n}:null:OW(t)?n?{kind:t,text:r,conversationId:n}:{kind:t,text:r}:null}function AW(e,t){let n=[],r=t;for(;r;){let t=TW.exec(r),i=t&&kW(e,t[1],t[2],t[3]);if(!t||!i)return null;r=r.slice(t[0].length);let a=EW.exec(r);if(a){let e=r.indexOf(DW);if(e<0)return null;if(i.detail=bz(r.slice(a[0].length,e)),r=r.slice(e+20),r.startsWith(`
224
+ `))r=r.slice(1);else if(r)return null}n.push(i)}return n.length>0?n:null}function jW(e){let t=[],n=e.trim();for(;n;){let e=wW.exec(n),r=e&&AW(e[1],e[2]);if(!e||!r)return null;t.push(...r),n=n.slice(e[0].length)}return t.length>0?t:null}var MW=new Set([`Shell read-only shortcut: prefer read (offset/limit) for files, grep for content, find for paths — the dedicated tools handle line ranges and stream far less output.`,"Sleep-waiting in a foreground command costs a model round per check. Put the whole wait in one command that exits when the condition holds (e.g. `until <check>; do sleep 10; done; <report>`) and run it with background: true — you are notified when it finishes, then end your turn.",`timeout only kills the process; it does not keep this call in the foreground. If the command may outlast the yield, set background: true and end your turn — completion wakes you. Do not poll with sleep, ps, pgrep, or task_output loops.`]);function NW(e){let t=e.split(`
225
+ `),n=0;for(;n<t.length&&MW.has(t[n].replace(/\r$/,``));)n++;if(n===0)return e;for(;n<t.length&&!t[n].trim();)n++;return t.slice(n).join(`
226
+ `)||e}var PW=/^Command exited with code \d+$/,FW=/^Command (?:aborted|timed out after \d+ seconds|terminated without an exit code)/,IW=/^\[[^\]]+\]/,LW=/^at\s/,RW=/\b(?:error|fatal|panic|exception|failed|failure|cannot|not found|no such file|denied|refused)\b(?!\.\w|\()/i;function zW(e){let t=NW(e).split(/\r?\n/).map(e=>e.trim()),n=t.findLastIndex(e=>PW.test(e)||FW.test(e));if(n<0)return t.find(Boolean)??``;if(FW.test(t[n]))return t[n];for(let e=n-1;e>=0;e--){let n=t[e];if(n&&!IW.test(n)&&!LW.test(n)&&RW.test(n))return n}return t[n]}function BW({message:e}){let{t}=K(),n={queued:t(`Queued`),running:t(`In progress`),completed:t(`Completed`),failed:t(`Failed`),canceled:t(`Canceled`)},r=e.kind===`routine`?At:e.kind===`group`?dn:e.kind===`delegation-task`?kt:e.kind===`delegation-retry`||e.kind===`delegation-check-failed`?jn:Pt,i=e.kind===`routine`?`${e.dryRun?t(`Routine dry run`):t(`Routine task`)} · ${e.title}`:e.kind===`group`?t(`Group messages`):e.kind===`delegation-task`?t(`Task from {{name}}`,{name:e.from}):e.kind===`delegation-results`?t(`Delegation results`):e.kind===`delegation-retry`?t(`Continue delegated task`):e.kind===`delegation-check-failed`?t(`Acceptance check not passed`):t(`Result from {{name}}`,{name:e.from});return(0,G.jsxs)(`div`,{"data-bot-injection":e.kind,className:`w-full rounded-lg border border-border/60 bg-muted/20 px-3 py-2 text-sm`,children:[(0,G.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,G.jsx)(r,{className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:i}),e.kind===`delegation-result`&&e.status&&(0,G.jsxs)(`span`,{children:[`· `,n[e.status]??e.status]})]}),(0,G.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.kind===`routine`?e.prompt:e.kind===`delegation-task`?e.task:e.kind===`delegation-result`||e.kind===`delegation-retry`||e.kind===`delegation-check-failed`?e.text:e.kind===`delegation-results`?e.results.map((e,t)=>(0,G.jsxs)(`p`,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[e.from,e.status&&` · ${n[e.status]??e.status}`,`:`]}),e.text]},`${t}:${e.from}`)):e.messages.map((e,t)=>(0,G.jsxs)(`p`,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[e.from,`:`]}),e.text]},`${t}:${e.from}`))}),e.kind===`delegation-task`&&e.context&&(0,G.jsxs)(`details`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:t(`Context`)}),(0,G.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.context})]}),e.kind===`group`&&e.instruction&&(0,G.jsxs)(`details`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:t(`Instructions`)}),(0,G.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.instruction})]}),e.kind===`group`&&!!e.refs?.length&&(0,G.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:e.refs.map(e=>(0,G.jsxs)(`span`,{title:t(`Referenced chat`),className:`inline-flex h-6 max-w-56 items-center gap-1 rounded-md bg-muted px-1.5 text-xs`,children:[(0,G.jsx)(dn,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]},e.id))}),e.kind===`group`&&e.note&&(0,G.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:t(`Dispatch hint: {{note}}`,{note:e.note})}),e.kind!==`group`&&!!e.group?.length&&(0,G.jsxs)(`details`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[(0,G.jsxs)(`summary`,{className:`cursor-pointer`,children:[t(`Group messages`),` · `,e.group.length]}),(0,G.jsx)(`div`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.group.map((e,t)=>(0,G.jsxs)(`p`,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[e.from,`:`]}),e.text]},`${t}:${e.from}`))})]})]})}async function VW(e,t){let n=await ZN.getState().restartConversation(e);n&&RD({type:`error`,title:t(`Failed to restart conversation`),description:n})}function HW(e,t){if(!t)return null;for(let[n,r]of Object.entries(e))if(r?.sessionFile===t)return n;return null}function UW(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function WW(e){return e.alias?.trim()||(e.name===e.path?UW(e.path):e.name)}function GW(e,t,n){if(!t)return``;if(_j(t))return yj(n,t.modelId);let r=e.find(e=>e.id===t.providerId);return r?`${r.name} / ${t.modelId}`:t.modelId}var KW=CW({});if(!KW)throw Error(`secretary default profile`);var qW=KW;function JW(e,t){let n=e??qW;return{name:e?.name.trim()||t,avatar:{color:n.avatar.color,...n.avatar.imageVersion?{imageVersion:n.avatar.imageVersion}:{}},takeoverScope:n.takeoverScope.mode===`projects`?{mode:`projects`,projectIds:[...n.takeoverScope.projectIds]}:n.takeoverScope,visibleProjectIds:n.visibleProjectIds===`all`?`all`:[...n.visibleProjectIds],maxRunningDispatches:n.maxRunningDispatches,patrolEnabled:n.patrolEnabled,cleanupSkipConfirm:n.cleanupSkipConfirm===!0,replyLanguage:n.replyLanguage,style:n.style,notify:n.notify,addressAs:n.addressAs??null,dailyBriefAt:n.dailyBriefAt??null}}function YW(e){return JW(null,e)}function XW(e,t){switch(t.type){case`patch`:{let{avatar:n,...r}=t.patch;return{...e,...r,...n?{avatar:{...e.avatar,...n}}:{}}}case`reset`:return t.draft}}var ZW=H.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=iN(),{clearErrors:C}=sN(),w=h||s,T=m??a,E={...p,disabled:w},{labelId:D}=lN(),O=pN({id:i});Y(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let k=H.useRef(null);Y(()=>{u&&k.current===Rb(Vy(k.current))&&y(!0)},[u,y]);let[A]=kj({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,M=j?A:void 0,N=zy(()=>S.inputRef.current?.value);return aN(S.inputRef,O,M,N,!w,a),zr(`input`,e,{ref:[t,k],state:E,props:[{id:O,disabled:w,name:T,ref:S.inputRef,"aria-labelledby":D,autoFocus:u,...j?{value:M}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,tb(Gy,e.nativeEvent)),_(t!==(v.initialValue??``)),b(t!==``),e.nativeEvent.defaultPrevented||(C(T),S.change(t))},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},f,e=>S.getValidationProps(w,e)],stateAttributesMapping:eN})}),QW=H.forwardRef(function(e,t){return(0,G.jsx)(ZW,{ref:t,...e})});function $W({className:e,size:t=`default`,unstyled:n=!1,...r}){return(0,G.jsx)(`span`,{className:W(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base shadow-xs ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:(0,G.jsx)(QW,{className:W(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,r.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,r.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),"data-slot":`input`,size:typeof t==`number`?t:void 0,...r})})}var eG=[`#7c5cff`,`#2f9e75`,`#c2553f`,`#2f7fc2`,`#b07a1e`,`#7a4fb5`],tG=/^#[0-9a-f]{6}$/iu;function nG(e){let t=e.trim();return tG.test(t)?t.toLowerCase():null}function rG(e){let t=e?nG(e):null,n=eG.find(e=>e===t)??null;return{preset:n,customSelected:t!==null&&n===null}}function iG({color:e,onChange:t}){let{t:n}=K(),[r,i]=(0,H.useState)(e);(0,H.useEffect)(()=>i(e),[e]);let a=rG(e),o=e=>{let n=nG(e);n&&t(n)};return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,"data-enso":`secretary-form-avatar`,children:[eG.map(e=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":a.preset===e,"aria-label":e,onClick:()=>t(e),style:{backgroundColor:e},className:W(`size-6 rounded-full border-2 transition-transform`,a.preset===e?`border-foreground`:`border-transparent hover:scale-105`)},e)),(0,G.jsxs)(`label`,{"data-enso":`secretary-form-avatar-custom`,"data-selected":a.customSelected?`true`:`false`,title:n(`Custom color`),style:a.customSelected?{backgroundColor:e}:void 0,className:W(`relative grid size-6 cursor-pointer place-items-center overflow-hidden rounded-full border-2 text-[10px]`,a.customSelected?`border-foreground text-white`:`border-border text-muted-foreground`),children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:a.customSelected?`sr-only`:void 0,children:`+`}),(0,G.jsx)(`input`,{type:`color`,"aria-label":n(`Custom color`),value:nG(e)??`#7c5cff`,onChange:e=>o(e.target.value),className:`absolute inset-0 cursor-pointer opacity-0`})]}),(0,G.jsx)($W,{"data-enso":`secretary-form-avatar-hex`,value:r,spellCheck:!1,"aria-label":n(`Custom color`),onChange:e=>{let t=e.target.value;i(t),o(t)},className:`h-7 w-24 font-mono text-xs`})]})}var aG=[1,2,3,4,5];function oG({value:e,options:t,onChange:n,enso:r}){let{t:i}=K();return(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,"data-enso":r,children:t.map(t=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t.value===e,onClick:()=>n(t.value),className:W(`rounded-md border px-2.5 py-1 text-xs transition-colors`,t.value===e?`border-primary/60 bg-primary/10 text-foreground`:`border-border text-muted-foreground hover:bg-muted`),children:i(t.label)},t.value))})}function sG({label:e,hint:t,children:n}){let{t:r}=K();return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`p`,{className:`text-sm`,children:r(e)}),n,t?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(t)}):null]})}function cG({label:e,hint:t,checked:n,onChange:r,enso:i}){let{t:a}=K();return(0,G.jsxs)(`label`,{className:`flex items-start justify-between gap-3`,"data-enso":i,children:[(0,G.jsxs)(`span`,{className:`space-y-1`,children:[(0,G.jsx)(`span`,{className:`block text-sm`,children:a(e)}),(0,G.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(t)})]}),(0,G.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,onClick:()=>r(!n),className:W(`relative mt-0.5 h-5 w-9 shrink-0 rounded-full border transition-colors`,n?`border-primary bg-primary`:`border-border bg-muted`),children:(0,G.jsx)(`span`,{className:W(`absolute top-0.5 size-3.5 rounded-full bg-background transition-all`,n?`left-[18px]`:`left-0.5`)})})]})}function lG({selected:e,onChange:t,enso:n}){let r=T(e=>e.projects).filter(e=>e.kind!==`scratch`&&e.kind!==`secretary`);return r.length===0?null:(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,"data-enso":n,children:r.map(n=>{let r=e.includes(n.id);return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(r?e.filter(e=>e!==n.id):[...e,n.id]),className:W(`rounded-md border px-2.5 py-1 text-xs transition-colors`,r?`border-primary/60 bg-primary/10 text-foreground`:`border-border text-muted-foreground hover:bg-muted`),children:WW(n)},n.id)})})}function uG({initialDraft:e,submitLabel:t,onSubmit:n,busy:r=!1,error:i=null,allowDefaults:a=!1,onCancel:o,hideMaxRunning:s=!1}){let{t:c}=K(),[l,u]=H.useReducer(XW,e),d=e=>u({type:`patch`,patch:e});return(0,G.jsxs)(`div`,{className:`space-y-4`,"data-enso":`secretary-profile-form`,children:[(0,G.jsx)(sG,{label:`Name`,children:(0,G.jsx)($W,{"data-enso":`secretary-form-name`,value:l.name??``,onChange:e=>d({name:e.target.value}),className:`max-w-xs`})}),(0,G.jsx)(sG,{label:`Avatar color`,children:(0,G.jsx)(iG,{color:l.avatar?.color??`#7c5cff`,onChange:e=>d({avatar:{color:e}})})}),(0,G.jsxs)(sG,{label:`Visible projects`,children:[(0,G.jsx)(oG,{enso:`secretary-form-visible-mode`,value:l.visibleProjectIds===`all`?`all`:`selected`,options:[{value:`all`,label:`All projects`},{value:`selected`,label:`Selected projects`}],onChange:e=>d({visibleProjectIds:e===`all`?`all`:l.visibleProjectIds===`all`?[]:l.visibleProjectIds})}),l.visibleProjectIds===`all`?null:(0,G.jsx)(lG,{enso:`secretary-form-visible-projects`,selected:l.visibleProjectIds??[],onChange:e=>d({visibleProjectIds:e})})]}),!s&&(0,G.jsx)(sG,{label:`Running dispatches at most`,children:(0,G.jsx)(oG,{enso:`secretary-form-max-running`,value:String(l.maxRunningDispatches??3),options:aG.map(e=>({value:String(e),label:String(e)})),onChange:e=>d({maxRunningDispatches:Number(e)})})}),(0,G.jsx)(cG,{enso:`secretary-form-patrol`,label:`Watch running sessions automatically`,hint:`While anything is running the secretary checks it and only reports an anomaly: a goal session idle for 3 minutes with an unfinished goal and no live background task, idle for 20 minutes with a background task that never woke it, or running for 30 minutes without any event. Every hour it also reports background tasks left running in finished sessions; nothing is killed. Nothing is sent when all is well.`,checked:l.patrolEnabled??!0,onChange:e=>d({patrolEnabled:e})}),(0,G.jsx)(cG,{enso:`secretary-form-cleanup-skip-confirm`,label:`Clean up without asking`,hint:`Off by default. When on, this secretary's cleanup deletes immediately, with no confirmation card: merged local branches and their worktrees. Sessions are only archived, never deleted. Unmerged branches, branches in use, feat/secretary-agent, main, the current branch and worktrees with uncommitted changes are still refused or skipped.`,checked:l.cleanupSkipConfirm??!1,onChange:e=>d({cleanupSkipConfirm:e})}),i?(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:i}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(Ea,{size:`sm`,disabled:r,"data-enso":`secretary-form-submit`,onClick:()=>n(l),children:t}),o&&(0,G.jsx)(Ea,{variant:`ghost`,size:`sm`,disabled:r,onClick:o,children:c(`Cancel`)}),a&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-form-defaults`,disabled:r,onClick:()=>n(YW(c(`Secretary`))),className:`text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,children:c(`Use all defaults and start`)})]})]})}var dG=new Set([`session_create`,`todo_item_dispatch`,`secretary_profile_propose`,`skill_propose`,`tool_propose`,`session_takeover_propose`,`cleanup_apply`]);function fG(e){if(!dG.has(e.name)||e.state===`running`||e.state===`error`||!e.output)return null;let t;try{t=JSON.parse(e.output)}catch{return null}if(!t||typeof t!=`object`)return null;let n=t;return n.status===`awaiting_confirmation`&&typeof n.proposalId==`string`?n.proposalId:null}var pG={pending:`Waiting for your confirmation`,executing:`Creating the session…`,succeeded:`Session created`,failed:`Failed`,rejected:`Rejected`,expired:`Expired`},mG={...pG,executing:`Saving the profile…`,succeeded:`Profile saved`};function hG(e){return W(`mb-1 w-full rounded-lg border px-2.5 py-2`,e?`border-warning/40 bg-warning/5`:`border-border/60 bg-muted/20`)}function gG(e){return e.draft.title?.trim()||e.draft.prompt.split(`
227
+ `)[0]?.trim()||``}function _G({proposalId:e,prominent:t}){let{t:n}=K(),r=ZR(t=>t.secretary.proposals[e]),i=ZR(t=>t.resolving[e]===!0),a=ZR(e=>e.resolveProposal),o=T(e=>e.projects),s=T(e=>e.providers)??[],c=T(e=>e.virtualModels);if(!r)return(0,G.jsx)(`div`,{"data-enso":`secretary-proposal`,className:W(hG(t),`text-[11px] text-muted-foreground`),children:n(`Waiting for your confirmation`)});if(r.kind===`profile`)return(0,G.jsx)(vG,{proposal:r,prominent:t});if(r.kind===`skill`)return(0,G.jsx)(wG,{proposal:r,prominent:t});if(r.kind===`tool`)return(0,G.jsx)(CG,{proposal:r,prominent:t});if(r.kind===`takeover`)return(0,G.jsx)(SG,{proposal:r,prominent:t});if(r.kind===`cleanup`)return(0,G.jsx)(AG,{proposal:r,prominent:t});let l=o.find(e=>e.id===r.draft.projectId),u=r.status===`failed`,d=GW(s,r.draft.model,c);return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,className:hG(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Dispatch`)}),l&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:WW(l)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:gG(r)}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:r.draft.worktree?n(`Isolated worktree`):n(`Project checkout`)})]}),(r.draft.branch||r.draft.baseRef||d||(r.draft.after?.length??0)>0)&&(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal-base`,className:`mt-1 flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[r.draft.branch&&(0,G.jsx)(`span`,{children:r.draft.branch}),r.draft.baseRef&&(0,G.jsx)(`span`,{children:n(`from {{ref}}`,{ref:r.draft.baseRef})}),d&&(0,G.jsx)(`span`,{"data-enso":`secretary-proposal-model`,children:n(`Model: {{model}}`,{model:d})}),r.draft.after&&r.draft.after.length>0&&(0,G.jsx)(`span`,{children:n(`After {{ids}}`,{ids:r.draft.after.join(`, `)})})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,u?`text-destructive`:`text-muted-foreground`),children:[n(pG[r.status]),u&&r.error?` · ${r.error}`:``]}),r.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void a(r.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm dispatch`)}),(0,G.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void a(r.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function vG({proposal:e,prominent:t}){let{t:n}=K(),r=ZR(t=>t.resolving[e.id]===!0),i=ZR(e=>e.resolveProposal),[a,o]=H.useState(!1),s=e.draft,c=e.status===`failed`,l=H.useMemo(()=>({...JW(null,n(`Secretary`)),...s}),[s,n]);return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`profile`,className:hG(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Profile`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:s.name??n(`Secretary`)})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:n(`Up to {{n}} at a time`,{n:s.maxRunningDispatches??3})}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsx)(`span`,{children:n(s.patrolEnabled===!1?`Patrol off`:`Patrol on`)}),(0,G.jsx)(`span`,{children:n(s.cleanupSkipConfirm?`Cleanup without confirmation`:`Cleanup asks first`)})]}),a?(0,G.jsx)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:(0,G.jsx)(uG,{initialDraft:l,submitLabel:n(`Confirm`),busy:r,onSubmit:t=>{o(!1),i(e.id,`confirm`,void 0,t)},onCancel:()=>o(!1)})}):(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,c?`text-destructive`:`text-muted-foreground`),children:[n(mG[e.status]),c&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-proposal-edit`,disabled:r,onClick:()=>o(!0),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Edit here`)})]})]})]})}var yG={...pG,executing:`Saving the skill…`,succeeded:`Skill saved`},bG={...pG,executing:`Saving the tool…`,succeeded:`Tool saved`},xG={...pG,executing:`Handing it over…`,succeeded:`Handed over to the secretary`};function SG({proposal:e,prominent:t}){let{t:n}=K(),r=ZR(t=>t.resolving[e.id]===!0),i=ZR(e=>e.resolveProposal),a=T(e=>e.projects).find(t=>t.id===e.draft.projectId),o=e.status===`failed`;return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`takeover`,className:hG(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Take over`)}),a&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:WW(a)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.draft.title??n(`Unnamed`)})]}),(0,G.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[n(`The secretary asks to manage this session: it may message and stop it like its own.`),e.draft.reason?` ${e.draft.reason}`:``]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,o?`text-destructive`:`text-muted-foreground`),children:[n(xG[e.status]),o&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Allow takeover`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function CG({proposal:e,prominent:t}){let{t:n}=K(),r=ZR(t=>t.resolving[e.id]===!0),i=ZR(e=>e.resolveProposal),a=e.draft,o=e.status===`failed`;return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`tool`,className:hG(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Tool`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:a.name}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.runtime===`python`?`Python`:`Node`}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.readOnly?n(`Read-only`):n(`Asks every call`)}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:e.previous?n(`Update`):n(`New`)})]}),(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:a.description}),(0,G.jsxs)(`details`,{className:`mt-1.5 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the arguments`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap text-[11px]`,children:JSON.stringify(a.parameters,null,2)})]}),(0,G.jsxs)(`details`,{className:`mt-1 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the code`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre font-mono text-[11px]`,children:a.code})]}),e.previous?(0,G.jsxs)(`details`,{className:`mt-1 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the current version`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre font-mono text-[11px]`,children:e.previous.code})]}):null,(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,o?`text-destructive`:`text-muted-foreground`),children:[n(bG[e.status]),o&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function wG({proposal:e,prominent:t}){let{t:n}=K(),r=ZR(t=>t.resolving[e.id]===!0),i=ZR(e=>e.resolveProposal),a=e.draft,o=e.status===`failed`;return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`skill`,className:hG(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Skill`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:a.name}),(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:e.previous?n(`Update`):n(`New`)})]}),(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:a.description}),(0,G.jsxs)(`details`,{className:`mt-1.5 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the content`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap text-[11px]`,children:a.body})]}),e.previous?(0,G.jsxs)(`details`,{className:`mt-1 rounded border border-border/60 bg-background/40 px-2 py-1`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-[11px] text-muted-foreground`,children:n(`Show the current version`)}),(0,G.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto whitespace-pre-wrap text-[11px]`,children:e.previous.body})]}):null,(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,o?`text-destructive`:`text-muted-foreground`),children:[n(yG[e.status]),o&&e.error?` · ${e.error}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}var TG={...pG,executing:`Cleaning up…`,succeeded:`Cleanup done`},EG={branch:`Branch`,worktree:`Worktree`,session:`Session`},DG={"not-merged":`Not merged yet`,"current-branch":`Currently checked out`,"used-by-worktree":`Used by a worktree`,"detached-head":`Detached HEAD`,"uncommitted-changes":`Has uncommitted changes`};function OG(e){return e===void 0?null:e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}var kG=5;function AG({proposal:e,prominent:t}){let{t:n}=K(),r=ZR(t=>t.resolving[e.id]===!0),i=ZR(e=>e.resolveProposal),a=e.draft.items,o=a.slice(0,kG),s=a.length-o.length,c=e.status===`failed`,l=a.reduce((e,t)=>(e[t.kind]=(e[t.kind]??0)+1,e),{});return(0,G.jsxs)(`div`,{"data-enso":`secretary-proposal`,"data-kind":`cleanup`,className:hG(t),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:n(`Clean up`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n(`{{count}} items`,{count:a.length})}),[`branch`,`worktree`,`session`].map(e=>l[e]?(0,G.jsxs)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 text-[10px] text-muted-foreground`,children:[l[e],` `,n(EG[e])]},e):null)]}),(0,G.jsxs)(`ul`,{"data-enso":`secretary-cleanup-items`,className:`mt-1.5 space-y-0.5`,children:[o.map(e=>{let t=OG(e.sizeBytes),r=[e.mergedInto?.length?n(`merged into {{refs}}`,{refs:e.mergedInto.join(`, `)}):null,t,e.blocked?n(DG[e.blocked]??e.blocked):null].filter(Boolean);return(0,G.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-[11px]`,children:[(0,G.jsx)(`span`,{"data-enso":`secretary-cleanup-kind`,className:`shrink-0 rounded bg-muted px-1 text-[10px] text-muted-foreground`,children:n(EG[e.kind])}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:e.name}),r.length>0&&(0,G.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:r.join(` · `)})]},e.id)}),s>0&&(0,G.jsx)(`li`,{"data-enso":`secretary-cleanup-rest`,className:`text-[11px] text-muted-foreground`,children:n(`and {{count}} more`,{count:s})})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:W(`text-[11px]`,c?`text-destructive`:`text-muted-foreground`),children:[n(TG[e.status]),c&&e.error?` · ${e.error}`:``,e.report?` · ${e.report}`:``]}),e.status===`pending`&&(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-cleanup-confirm`,disabled:r,onClick:()=>void i(e.id,`confirm`),className:`rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50`,children:n(`Confirm cleanup`)}),(0,G.jsx)(`button`,{type:`button`,disabled:r,onClick:()=>void i(e.id,`reject`),className:`rounded-md px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:n(`Reject`)})]})]})]})}function jG(e){let[t,n]=H.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=H.useRef(null),i=H.useRef(null),a=H.useRef(null),o=H.useRef(null),s=H.useRef(!0),c=H.useRef(null),l=ab(),u=H.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,G.jsx)(Ej.Provider,{value:u,children:(0,G.jsx)(wj.Provider,{value:void 0,children:(0,G.jsx)(dM,{...e})})})}var MG=500,NG=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=Dj(!1),{store:m}=Tj(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=H.useRef(null),v=H.useRef(null),y=db(),b=db(),x=H.useRef(!1),S=H.useRef(null);function C(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,tb(Ky,n)),b.start(MG,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,Eb(e),C(e.clientX,e.clientY,e.nativeEvent);let t=Vy(_.current);S.current?.abort();let n=new AbortController;S.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=Bb(e);zb(u.current,t)||p&&t&&vM(t)===p||s.current?.setOpen(!1,tb(Qy,e))},{once:!0,signal:n.signal})}function T(){y.clear(),v.current=null}function E(e){if(g){T();return}if(d.current=!1,e.touches.length!==1){T();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(MG,()=>{C(n.x,n.y,e.nativeEvent)})}function D(e){if(e.touches.length!==1){T();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&T()}}return H.useEffect(()=>()=>{S.current?.abort()},[]),H.useEffect(()=>{function e(e){if(g)return;let t=Bb(e);(zb(_.current,t)||zb(c.current,t)||zb(l.current,t))&&e.preventDefault()}return ex(Vy(_.current),`contextmenu`,e)},[l,g,c]),zr(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:E,onTouchMove:D,onTouchEnd:T,onTouchCancel:T,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:cy})}),PG=jG;function FG(e){return(0,G.jsx)(NG,{"data-slot":`context-menu-trigger`,...e})}function IG({children:e,className:t,zIndex:n,...r}){return(0,G.jsxs)(Kj,{children:[(0,G.jsx)(Oj,{className:`fixed inset-0 z-40`,"data-enso-float":``,style:n===void 0?void 0:{zIndex:n-1}}),(0,G.jsx)(nM,{className:`z-50`,"data-slot":`context-menu-positioner`,style:n===void 0?void 0:{zIndex:n},children:(0,G.jsx)(Uj,{className:W(HM,t),"data-slot":`context-menu-popup`,...r,children:(0,G.jsx)(`div`,{className:`max-h-(--available-height) w-full overflow-y-auto p-1.5`,children:e})})})]})}function LG({className:e,variant:t=`default`,...n}){return(0,G.jsx)(Bj,{className:W(GM,e),"data-slot":`context-menu-item`,"data-variant":t,...n})}async function RG(e){let t=/^data:([^;,]+);base64,(.*)$/s.exec(e);if(!t)return(await fetch(e)).blob();let n=atob(t[2]),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t[1]})}async function zG(e){let t=await RG(e),n=t;if(t.type!==`image/png`){let e=await createImageBitmap(t),r=new OffscreenCanvas(e.width,e.height);r.getContext(`2d`)?.drawImage(e,0,0),e.close(),n=await r.convertToBlob({type:`image/png`})}await navigator.clipboard.write([new ClipboardItem({"image/png":n})])}function BG({src:e,className:t,frameClassName:n,onError:r,alt:i=``,lazy:a=!1,children:o,title:s}){let{t:c}=K(),[l,u]=(0,H.useState)(!1);YE(l),(0,H.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]);let d=()=>{zG(e).then(()=>RD({type:`success`,title:c(`Image copied`)}),e=>RD({type:`error`,title:c(`Could not copy image`),description:e instanceof Error?e.message:String(e)}))};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(PG,{children:[(0,G.jsx)(FG,{render:(0,G.jsx)(`button`,{type:`button`,onClick:()=>u(!0),title:s,className:W(`cursor-zoom-in`,n),children:o??(0,G.jsx)(`img`,{src:e,alt:i,className:t,onError:r,...a?{loading:`lazy`,decoding:`async`}:{}})}),onContextMenu:e=>e.stopPropagation()}),(0,G.jsx)(IG,{className:`min-w-36`,children:(0,G.jsx)(LG,{closeOnClick:!0,onClick:d,children:c(`Copy image`)})})]}),l&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>u(!1),className:W(`fixed inset-0 flex cursor-zoom-out items-center justify-center bg-black/75`),style:{zIndex:oD.NESTED_MODAL_BACKDROP},"data-enso-float":``,children:(0,G.jsx)(`img`,{src:e,alt:``,className:`max-h-[92vh] max-w-[92vw] rounded-lg object-contain`})})]})}var VG={"too-large":`over 10 MB, not saved`,"not-image":`not a png / jpeg / webp / gif image, not saved`,unavailable:`could not be saved`};function HG(e){return e.split(/[\\/]/u).pop()??e}function UG({entries:e,thumbnails:t=0,align:n=`end`}){let{t:r}=K(),i=e.filter(e=>`path`in e&&e.index>t),a=e.filter(e=>`rejected`in e);return i.length===0&&a.length===0?null:(0,G.jsxs)(`div`,{"data-enso":`inbound-images`,className:W(`flex flex-col gap-1`,n===`end`?`items-end`:`items-start`),children:[i.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,G.jsxs)(BG,{src:f(e.path),title:HG(e.path),frameClassName:`inline-flex h-6 items-center gap-1 rounded-md bg-muted px-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)($t,{className:`size-3 shrink-0`}),(0,G.jsx)(`span`,{children:r(`Image {{n}}`,{n:e.index})})]},e.index))}),a.map(e=>(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`Image {{n}} not accepted: {{reason}}`,{n:e.index,reason:r(VG[e.rejected])})},e.index))]})}var WG={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,ico:`image/x-icon`,avif:`image/avif`,svg:`image/svg+xml`};function GG(e){let t=e.split(/[?#]/)[0]??``,n=t.lastIndexOf(`.`);return n<0?null:WG[t.slice(n+1).toLowerCase()]??null}var KG=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JG={};function YG(e,t){return((t||JG).jsx?qG:KG).test(e)}var XG=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(`
228
+ `);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})),ZG=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(XG());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}})),QG=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))}})),$G=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ZG()),r=QG();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})),eK=nK(`end`),tK=nK(`start`);function nK(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 rK(e){let t=tK(e),n=eK(e);if(t&&n)return{start:t,end:n}}function iK(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?oK(e.position):`start`in e||`end`in e?oK(e):`line`in e||`column`in e?aK(e):``}function aK(e){return sK(e&&e.line)+`:`+sK(e&&e.column)}function oK(e){return aK(e&&e.start)+`-`+aK(e&&e.end)}function sK(e){return e&&typeof e==`number`?e:1}var cK=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=iK(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}};cK.prototype.file=``,cK.prototype.name=``,cK.prototype.reason=``,cK.prototype.message=``,cK.prototype.stack=``,cK.prototype.column=void 0,cK.prototype.line=void 0,cK.prototype.ancestors=void 0,cK.prototype.cause=void 0,cK.prototype.fatal=void 0,cK.prototype.place=void 0,cK.prototype.ruleId=void 0,cK.prototype.source=void 0;var lK=e($G(),1),uK={}.hasOwnProperty,dK=new Map,fK=/[A-Z]/g,pK=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),mK=new Set([`td`,`th`]),hK=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function gK(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=DK(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=EK(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`?Fd:Pd,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=_K(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function _K(e,t,n){if(t.type===`element`)return vK(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return yK(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return xK(e,t,n);if(t.type===`mdxjsEsm`)return bK(e,t);if(t.type===`root`)return SK(e,t,n);if(t.type===`text`)return CK(e,t)}function vK(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Fd,e.schema=i),e.ancestors.push(t);let a=NK(e,t.tagName,!1),o=OK(e,t),s=AK(e,t);return pK.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!gf(e)})),wK(e,o,a,t),TK(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function yK(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)}PK(e,t.position)}function bK(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);PK(e,t.position)}function xK(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Fd,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:NK(e,t.name,!0),o=kK(e,t),s=AK(e,t);return wK(e,o,a,t),TK(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function SK(e,t,n){let r={};return TK(r,AK(e,t)),e.create(t,e.Fragment,r,n)}function CK(e,t){return t.value}function wK(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function TK(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function EK(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 DK(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=tK(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 OK(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&uK.call(t.properties,i)){let a=jK(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&mK.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 kK(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 PK(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 PK(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function AK(e,t){let n=[],r=-1,i=e.passKeys?new Map:dK;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=_K(e,a,o);s!==void 0&&n.push(s)}return n}function jK(e,t,n){let r=jd(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pf(n):mf(n)),r.property===`style`){let t=typeof n==`object`?n:MK(e,String(n));return e.stylePropertyNameCase===`css`&&(t=FK(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Dd[r.property]||r.property:r.attribute,n]}}function MK(e,t){try{return(0,lK.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new cK("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=hK+`#cannot-parse-style-attribute`,r}}function NK(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=YG(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=YG(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return uK.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);PK(e)}function PK(e,t){let n=new cK("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=hK+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function FK(e){let t={},n;for(n in e)uK.call(e,n)&&(t[IK(n)]=e[n]);return t}function IK(e){let t=e.replace(fK,LK);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function LK(e){return`-`+e.toLowerCase()}var RK={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`]},zK={};function BK(e,t){let n=t||zK;return VK(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function VK(e,t,n){if(UK(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 HK(e.children,t,n)}return Array.isArray(e)?HK(e,t,n):``}function HK(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=VK(e[i],t,n);return r.join(``)}function UK(e){return!!(e&&typeof e==`object`)}var WK=document.createElement(`i`);function GK(e){let t=`&`+e+`;`;WK.innerHTML=t;let n=WK.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function KK(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 qK(e,t){return e.length>0?(KK(e,e.length,0,t),e):t}var JK={}.hasOwnProperty;function YK(e){let t={},n=-1;for(;++n<e.length;)XK(t,e[n]);return t}function XK(e,t){let n;for(n in t){let r=(JK.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){JK.call(r,a)||(r[a]=[]);let e=i[a];ZK(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ZK(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);KK(e,0,0,r)}function QK(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 $K(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var eq=fq(/[A-Za-z]/),tq=fq(/[\dA-Za-z]/),nq=fq(/[#-'*+\--9=?A-Z^-~]/);function rq(e){return e!==null&&(e<32||e===127)}var iq=fq(/\d/),aq=fq(/[\dA-Fa-f]/),oq=fq(/[!-/:-@[-`{-~]/);function sq(e){return e!==null&&e<-2}function cq(e){return e!==null&&(e<0||e===32)}function lq(e){return e===-2||e===-1||e===32}var uq=fq(/\p{P}|\p{S}/u),dq=fq(/\s/);function fq(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function pq(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&tq(e.charCodeAt(n+1))&&tq(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 mq(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return lq(r)?(e.enter(n),s(r)):t(r)}function s(r){return lq(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var hq={tokenize:gq};function gq(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`),mq(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 sq(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var _q={tokenize:yq},vq={tokenize:bq};function yq(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 KK(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(vq,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(vq,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 sq(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++;KK(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 bq(e,t,n){return mq(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function xq(e){if(e===null||cq(e)||dq(e))return 1;if(uq(e))return 2}function Sq(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 Cq={name:`attention`,resolveAll:wq,tokenize:Tq};function wq(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};Eq(d,-c),Eq(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=qK(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=qK(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=qK(l,Sq(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=qK(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=qK(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,KK(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 Tq(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=xq(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=xq(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 Eq(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Dq={name:`autolink`,tokenize:Oq};function Oq(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 eq(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||tq(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||tq(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||rq(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):nq(t)?(e.consume(t),l):n(t)}function u(e){return tq(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||tq(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var kq={partial:!0,tokenize:Aq};function Aq(e,t,n){return r;function r(t){return lq(t)?mq(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||sq(e)?t(e):n(e)}}var jq={continuation:{tokenize:Nq},exit:Pq,name:`blockQuote`,tokenize:Mq};function Mq(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 lq(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Nq(e,t,n){let r=this;return i;function i(t){return lq(t)?mq(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(jq,t,n)(r)}}function Pq(e){e.exit(`blockQuote`)}var Fq={name:`characterEscape`,tokenize:Iq};function Iq(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 oq(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Lq={name:`characterReference`,tokenize:Rq};function Rq(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=tq,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=aq,u):(e.enter(`characterReferenceValue`),a=7,o=iq,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===tq&&!GK(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 zq={partial:!0,tokenize:Hq},Bq={concrete:!0,name:`codeFenced`,tokenize:Vq};function Vq(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`),lq(t)?mq(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||sq(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(zq,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||sq(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):lq(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),mq(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||sq(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||sq(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&&lq(t)?mq(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||sq(t)?e.check(zq,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||sq(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`),lq(t)?mq(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`),lq(t)?mq(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||sq(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Hq(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 Uq={name:`codeIndented`,tokenize:Gq},Wq={partial:!0,tokenize:Kq};function Gq(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),mq(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):sq(t)?e.attempt(Wq,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||sq(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Kq(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):sq(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):mq(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):sq(e)?i(e):n(e)}}var qq={name:`codeText`,previous:Yq,resolve:Jq,tokenize:Xq};function Jq(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 Yq(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Xq(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)):sq(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||sq(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 Zq=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&&Qq(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),Qq(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Qq(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);Qq(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Qq(this.left,t.reverse())}}}};function Qq(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 $q(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Zq(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,eJ(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 KK(e,0,1/0,u.slice(0)),!l}function eJ(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 tJ={resolve:rJ,tokenize:iJ},nJ={partial:!0,tokenize:aJ};function rJ(e){return $q(e),e}function iJ(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):sq(t)?e.check(nJ,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 aJ(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),mq(e,a,`linePrefix`)}function a(i){if(i===null||sq(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 oJ(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||rq(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||sq(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||cq(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||rq(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 sJ(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):sq(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||sq(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!lq(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function cJ(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):sq(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),mq(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||sq(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 lJ(e,t){let n;return r;function r(i){return sq(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):lq(i)?mq(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var uJ={name:`definition`,tokenize:fJ},dJ={partial:!0,tokenize:pJ};function fJ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return sJ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=$K(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 cq(t)?lJ(e,l)(t):l(t)}function l(t){return oJ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(dJ,d,d)(t)}function d(t){return lq(t)?mq(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||sq(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function pJ(e,t,n){return r;function r(t){return cq(t)?lJ(e,i)(t):n(t)}function i(t){return cJ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return lq(t)?mq(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||sq(e)?t(e):n(e)}}var mJ={name:`hardBreakEscape`,tokenize:hJ};function hJ(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return sq(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var gJ={name:`headingAtx`,resolve:_J,tokenize:vJ};function _J(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`},KK(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function vJ(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||cq(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||sq(n)?(e.exit(`atxHeading`),t(n)):lq(n)?mq(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||cq(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var yJ=`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(`.`),bJ=[`pre`,`script`,`style`,`textarea`],xJ={concrete:!0,name:`htmlFlow`,resolveTo:wJ,tokenize:TJ},SJ={partial:!0,tokenize:DJ},CJ={partial:!0,tokenize:EJ};function wJ(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 TJ(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:I):eq(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):eq(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):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 eq(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||cq(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&bJ.includes(l)?(i=1,r.interrupt?t(s):O(s)):yJ.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||tq(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 lq(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||eq(t)?(e.consume(t),b):lq(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||tq(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):lq(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):lq(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||sq(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||cq(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||lq(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||sq(t)?O(t):lq(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):sq(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(SJ,L,k)(t)):t===null||sq(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(CJ,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||sq(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return bJ.includes(n)?(e.consume(t),ee):O(t)}return eq(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||sq(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),ee)}function L(n){return e.exit(`htmlFlow`),t(n)}}function EJ(e,t,n){let r=this;return i;function i(t){return sq(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 DJ(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(kq,t,n)}}var OJ={name:`htmlText`,tokenize:kJ};function kJ(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):eq(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):eq(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):sq(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(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):sq(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):sq(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):sq(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return eq(t)?(e.consume(t),S):n(t)}function S(t){return t===45||tq(t)?(e.consume(t),S):C(t)}function C(t){return sq(t)?(o=C,N(t)):lq(t)?(e.consume(t),C):M(t)}function w(t){return t===45||tq(t)?(e.consume(t),w):t===47||t===62||cq(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||eq(t)?(e.consume(t),E):sq(t)?(o=T,N(t)):lq(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||tq(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):sq(t)?(o=D,N(t)):lq(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):sq(t)?(o=O,N(t)):lq(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):sq(t)?(o=k,N(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||cq(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||cq(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return lq(t)?mq(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var AJ={name:`labelEnd`,resolveAll:PJ,resolveTo:FJ,tokenize:IJ},jJ={tokenize:LJ},MJ={tokenize:RJ},NJ={tokenize:zJ};function PJ(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&&KK(e,0,e.length,n),e}function FJ(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=qK(s,e.slice(a+1,a+r+3)),s=qK(s,[[`enter`,u,t]]),s=qK(s,Sq(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=qK(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=qK(s,e.slice(o+1)),s=qK(s,[[`exit`,c,t]]),KK(e,a,e.length,s),e}function IJ(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($K(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(jJ,u,o?u:d)(t):t===91?e.attempt(MJ,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(NJ,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function LJ(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 cq(t)?lJ(e,a)(t):a(t)}function a(t){return t===41?u(t):oJ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return cq(t)?lJ(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?cJ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return cq(t)?lJ(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 RJ(e,t,n){let r=this;return i;function i(t){return sJ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes($K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function zJ(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 BJ={name:`labelStartImage`,resolveAll:AJ.resolveAll,tokenize:VJ};function VJ(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 HJ={name:`labelStartLink`,resolveAll:AJ.resolveAll,tokenize:UJ};function UJ(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 WJ={name:`lineEnding`,tokenize:GJ};function GJ(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),mq(e,t,`linePrefix`)}}var KJ={name:`thematicBreak`,tokenize:qJ};function qJ(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||sq(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),lq(t)?mq(e,s,`whitespace`)(t):s(t))}}var JJ={continuation:{tokenize:QJ},exit:eY,name:`list`,tokenize:ZJ},YJ={partial:!0,tokenize:tY},XJ={partial:!0,tokenize:$J};function ZJ(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:iq(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(KJ,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 iq(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(kq,r.interrupt?n:u,e.attempt(YJ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return lq(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 QJ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(kq,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mq(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!lq(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(XJ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,mq(e,e.attempt(JJ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function $J(e,t,n){let r=this;return mq(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 eY(e){e.exit(this.containerState.type)}function tY(e,t,n){let r=this;return mq(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!lq(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var nY={name:`setextUnderline`,resolveTo:rY,tokenize:iY};function rY(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 iY(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`),lq(t)?mq(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||sq(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var aY={tokenize:oY};function oY(e){let t=this,n=e.attempt(kq,r,e.attempt(this.parser.constructs.flowInitial,i,mq(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tJ,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 sY={resolveAll:dY()},cY=uY(`string`),lY=uY(`text`);function uY(e){return{resolveAll:dY(e===`text`?fY: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 dY(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 fY(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 pY=t({attentionMarkers:()=>xY,contentInitial:()=>hY,disable:()=>SY,document:()=>mY,flow:()=>_Y,flowInitial:()=>gY,insideSpan:()=>bY,string:()=>vY,text:()=>yY}),mY={42:JJ,43:JJ,45:JJ,48:JJ,49:JJ,50:JJ,51:JJ,52:JJ,53:JJ,54:JJ,55:JJ,56:JJ,57:JJ,62:jq},hY={91:uJ},gY={[-2]:Uq,[-1]:Uq,32:Uq},_Y={35:gJ,42:KJ,45:[nY,KJ],60:xJ,61:nY,95:KJ,96:Bq,126:Bq},vY={38:Lq,92:Fq},yY={[-5]:WJ,[-4]:WJ,[-3]:WJ,33:BJ,38:Lq,42:Cq,60:[Dq,OJ],91:HJ,92:[mJ,Fq],93:AJ,95:Cq,96:qq},bY={null:[Cq,sY]},xY={null:[42,95]},SY={null:[]};function CY(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=qK(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Sq(a,l.events,l),l.events):[]}function f(e,t){return TY(p(e),t)}function p(e){return wY(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){sq(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&&KK(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 wY(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 TY(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=`
229
+ `;break;case-3:o=`\r
230
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function EY(e){let t={constructs:YK([pY,...(e||{}).extensions||[]]),content:n(hq),defined:[],document:n(_q),flow:n(aY),lazy:{},string:n(cY),text:n(lY)};return t;function n(e){return n;function n(n){return CY(t,e,n)}}}function DY(e){for(;!$q(e););return e}var OY=/[\0\t\n\r]/g;function kY(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(OY.lastIndex=u,c=OY.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var AY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jY(e){return e.replace(AY,MY)}function MY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return QK(n.slice(t?2:1),t?16:10)}return GK(n)||e}var NY={}.hasOwnProperty;function PY(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),FY(n)(DY(EY(n).document().write(kY()(e,t,!0))))}function FY(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(le),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(V),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ce),hardBreakEscape:a(ue),hardBreakTrailing:a(ue),htmlFlow:a(de,o),htmlFlowData:T,htmlText:a(de,o),htmlTextData:T,image:a(fe),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(le),strong:a(_e),thematicBreak:a(ye)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ie,autolinkProtocol:B,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:ne,characterReference:re,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:R,resourceDestinationString:I,resourceTitleString:ee,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};LY(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];NY.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||zY).call(a,void 0,e[0])}for(r.position={start:IY(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:IY(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:IY(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||zY).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+iK({start:e.start,end:e.end})+`): it’s not open`);n.position.end=IY(e.end)}function u(){return BK(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$K(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ve(),n.position={start:IY(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=IY(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=IY(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=jY(t),n.identifier=$K(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function R(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=$K(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function z(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=QK(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=GK(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=IY(e.end)}function B(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function V(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ce(){return{type:`emphasis`,children:[]}}function le(){return{type:`heading`,depth:0,children:[]}}function ue(){return{type:`break`}}function de(){return{type:`html`,value:``}}function fe(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function _e(){return{type:`strong`,children:[]}}function ve(){return{type:`text`,value:``}}function ye(){return{type:`thematicBreak`}}}function IY(e){return{line:e.line,column:e.column,offset:e.offset}}function LY(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?LY(e,r):RY(e,r)}}function RY(e,t){let n;for(n in t)if(NY.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function zY(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+iK({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+iK({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+iK({start:t.start,end:t.end})+`) is still open`)}function BY(e){let t=this;t.parser=n;function n(n){return PY(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function VY(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function HY(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
231
+ `}]}function UY(e,t){let n=t.value?t.value+`
232
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function WY(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GY(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KY(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=pq(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function qY(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JY(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function YY(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function XY(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return YY(e,t);let i={src:pq(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ZY(e,t){let n={src:pq(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function QY(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function $Y(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return YY(e,t);let i={href:pq(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function eX(e,t){let n={href:pq(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function tX(e,t,n){let r=e.all(t),i=n?nX(n):rX(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
233
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
234
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function nX(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=rX(n[r])}return t}function rX(e){return e.spread??e.children.length>1}function iX(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function aX(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oX(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function sX(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cX(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=tK(t.children[1]),o=eK(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function lX(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function uX(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var dX=9,fX=32;function pX(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(mX(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(mX(t.slice(i),i>0,!1)),a.join(``)}function mX(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===dX||t===fX;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===dX||t===fX;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function hX(e,t){let n={type:`text`,value:pX(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gX(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var _X={blockquote:VY,break:HY,code:UY,delete:WY,emphasis:GY,footnoteReference:KY,heading:qY,html:JY,imageReference:XY,image:ZY,inlineCode:QY,linkReference:$Y,link:eX,listItem:tX,list:iX,paragraph:aX,root:oX,strong:sX,table:cX,tableCell:uX,tableRow:lX,text:hX,thematicBreak:gX,toml:vX,yaml:vX,definition:vX,footnoteDefinition:vX};function vX(){}var yX=typeof self==`object`?self:globalThis,bX=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new yX[e](t)},xX=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof yX[e]==`function`?bX(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(bX(a,o),i)};return r},SX=e=>xX(new Map,e)(0),CX=``,{toString:wX}={},{keys:TX}=Object,EX=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=wX.call(e).slice(8,-1);switch(n){case`Array`:return[1,CX];case`Object`:return[2,CX];case`Date`:return[3,CX];case`RegExp`:return[4,CX];case`Map`:return[5,CX];case`Set`:return[6,CX];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},DX=([e,t])=>e===0&&(t===`function`||t===`symbol`),OX=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=EX(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of TX(r))(e||!DX(EX(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?CX:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(DX(EX(n))||DX(EX(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!DX(EX(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},kX=(e,{json:t,lossy:n}={})=>{let r=[];return OX(!(t||n),!!t,new Map,r)(e),r},AX=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?SX(kX(e,t)):structuredClone(e):(e,t)=>SX(kX(e,t));function jX(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function MX(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function NX(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||jX,r=e.options.footnoteBackLabel||MX,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=pq(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...AX(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
235
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
236
+ `}]}}var PX=(function(e){if(e==null)return zX;if(typeof e==`function`)return RX(e);if(typeof e==`object`)return Array.isArray(e)?FX(e):IX(e);if(typeof e==`string`)return LX(e);throw Error(`Expected function, string, or object as test`)});function FX(e){let t=[],n=-1;for(;++n<e.length;)t[n]=PX(e[n]);return RX(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function IX(e){let t=e;return RX(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function LX(e){return RX(t);function t(t){return t&&t.type===e}}function RX(e){return t;function t(t,n,r){return!!(BX(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function zX(){return!0}function BX(e){return typeof e==`object`&&!!e&&`type`in e}function VX(e){return e}var HX=[];function UX(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=PX(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+VX(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=HX,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=WX(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function WX(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?HX:[e]}function GX(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),UX(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var KX={}.hasOwnProperty,qX={};function JX(e,t){let n=t||qX,r=new Map,i=new Map,a={all:s,applyData:XX,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{..._X,...n.handlers},one:o,options:n,patch:YX,wrap:QX};return GX(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(KX.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=AX(n);return r.children=a.all(e),r}return AX(e)}return(a.options.unknownHandler||ZX)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=$X(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=$X(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function YX(e,t){e.position&&(t.position=rK(e))}function XX(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,AX(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function ZX(e,t){let n=t.data||{},r=`value`in t&&!(KX.call(n,`hProperties`)||KX.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function QX(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
237
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
238
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
239
+ `}),n}function $X(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eZ(e,t){let n=JX(e,t),r=n.one(e,void 0),i=NX(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
240
+ `},i)),a}function tZ(e,t){return e&&`run`in e?async function(n,r){let i=eZ(n,{file:r,...t});await e.run(i,r)}:function(n,r){return eZ(n,{file:r,...e||t})}}function nZ(e){if(e)throw e}var rZ=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function iZ(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function aZ(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?oZ(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function oZ(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var sZ={basename:cZ,dirname:lZ,extname:uZ,join:dZ,sep:`/`};function cZ(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);mZ(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lZ(e){if(mZ(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function uZ(e){mZ(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function dZ(...e){let t=-1,n;for(;++t<e.length;)mZ(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:fZ(n)}function fZ(e){mZ(e);let t=e.codePointAt(0)===47,n=pZ(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function pZ(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function mZ(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var hZ={cwd:gZ};function gZ(){return`/`}function _Z(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function vZ(e){if(typeof e==`string`)e=new URL(e);else if(!_Z(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return yZ(e)}function yZ(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var bZ=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],xZ=class{constructor(e){let t;t=e?_Z(e)?{path:e}:typeof e==`string`||TZ(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:hZ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<bZ.length;){let e=bZ[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)bZ.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?sZ.basename(this.path):void 0}set basename(e){CZ(e,`basename`),SZ(e,`basename`),this.path=sZ.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?sZ.dirname(this.path):void 0}set dirname(e){wZ(this.basename,`dirname`),this.path=sZ.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?sZ.extname(this.path):void 0}set extname(e){if(SZ(e,`extname`),wZ(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=sZ.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){_Z(e)&&(e=vZ(e)),CZ(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?sZ.basename(this.path,this.extname):void 0}set stem(e){CZ(e,`stem`),SZ(e,`stem`),this.path=sZ.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new cK(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function SZ(e,t){if(e&&e.includes(sZ.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+sZ.sep+"`")}function CZ(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function wZ(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function TZ(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var EZ=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),DZ=e(rZ(),1),OZ={}.hasOwnProperty,kZ=new class e extends EZ{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=aZ()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,DZ.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(MZ(`data`,this.frozen),this.namespace[e]=t,this):OZ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(MZ(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=FZ(e),n=this.parser||this.Parser;return AZ(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),AZ(`process`,this.parser||this.Parser),jZ(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=FZ(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);LZ(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),AZ(`processSync`,this.parser||this.Parser),jZ(`processSync`,this.compiler||this.Compiler),this.process(e,r),PZ(`processSync`,`process`,t),n;function r(e,r){t=!0,nZ(e),n=r}}run(e,t,n){NZ(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=FZ(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),PZ(`runSync`,`run`,n),r;function i(e,t){nZ(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=FZ(t),r=this.compiler||this.Compiler;return jZ(`stringify`,r),NZ(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(MZ(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,DZ.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];iZ(o)&&iZ(r)&&(r=(0,DZ.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function AZ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function jZ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function MZ(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function NZ(e){if(!iZ(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function PZ(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function FZ(e){return IZ(e)?e:new xZ(e)}function IZ(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function LZ(e){return typeof e==`string`||RZ(e)}function RZ(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var zZ=[],BZ={allowDangerousHtml:!0},VZ=/^(https?|ircs?|mailto|xmpp)$/i,HZ=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function UZ(e){let t=WZ(e),n=GZ(e);return KZ(t.runSync(t.parse(n),n),e)}function WZ(e){let t=e.rehypePlugins||zZ,n=e.remarkPlugins||zZ,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BZ}:BZ;return kZ().use(BY).use(n).use(tZ,r).use(t)}function GZ(e){let t=e.children||``,n=new xZ;return typeof t==`string`?n.value=t:``+t,n}function KZ(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||qZ;for(let e of HZ)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return GX(e,l),gK(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in RK)if(Object.hasOwn(RK,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=RK[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function qZ(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||VZ.test(e.slice(0,t))?e:``}function JZ(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function YZ(e,t,n){let r=PX((n||{}).ignore||[]),i=XZ(t),a=-1;for(;++a<i.length;)UX(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function XZ(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ZZ(e[0]),QZ(e[1])])}return t}function ZZ(e){return typeof e==`string`?new RegExp(JZ(e),`g`):e}function QZ(e){return typeof e==`function`?e:function(){return e}}var $Z=`phrasing`,eQ=[`autolink`,`link`,`image`,`label`];function tQ(){return{transforms:[lQ],enter:{literalAutolink:rQ,literalAutolinkEmail:iQ,literalAutolinkHttp:iQ,literalAutolinkWww:iQ},exit:{literalAutolink:cQ,literalAutolinkEmail:sQ,literalAutolinkHttp:aQ,literalAutolinkWww:oQ}}}function nQ(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:$Z,notInConstruct:eQ},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:$Z,notInConstruct:eQ},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:$Z,notInConstruct:eQ}]}}function rQ(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function iQ(e){this.config.enter.autolinkProtocol.call(this,e)}function aQ(e){this.config.exit.autolinkProtocol.call(this,e)}function oQ(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function sQ(e){this.config.exit.autolinkEmail.call(this,e)}function cQ(e){this.exit(e)}function lQ(e){YZ(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,uQ],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,dQ]],{ignore:[`link`,`linkReference`]})}function uQ(e,t,n,r,i){let a=``;if(!mQ(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!fQ(n)))return!1;let o=pQ(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function dQ(e,t,n,r){return!mQ(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function fQ(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function pQ(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=ff(e,`(`),a=ff(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function mQ(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||dq(n)||uq(n))&&(!t||n!==47)}wQ.peek=CQ;function hQ(){this.buffer()}function gQ(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function _Q(){this.buffer()}function vQ(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function yQ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$K(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bQ(e){this.exit(e)}function xQ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$K(this.sliceSerialize(e)).toLowerCase(),n.label=t}function SQ(e){this.exit(e)}function CQ(){return`[`}function wQ(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function TQ(){return{enter:{gfmFootnoteCallString:hQ,gfmFootnoteCall:gQ,gfmFootnoteDefinitionLabelString:_Q,gfmFootnoteDefinition:vQ},exit:{gfmFootnoteCallString:yQ,gfmFootnoteCall:bQ,gfmFootnoteDefinitionLabelString:xQ,gfmFootnoteDefinition:SQ}}}function EQ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wQ},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
241
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?OQ:DQ))),s(),o}}function DQ(e,t,n){return t===0?e:OQ(e,t,n)}function OQ(e,t,n){return(n?``:` `)+e}var kQ=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];PQ.peek=FQ;function AQ(){return{canContainEols:[`delete`],enter:{strikethrough:MQ},exit:{strikethrough:NQ}}}function jQ(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:kQ}],handlers:{delete:PQ}}}function MQ(e){this.enter({type:`delete`,children:[]},e)}function NQ(e){this.exit(e)}function PQ(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function FQ(){return`~`}function IQ(e){return e.length}function LQ(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||IQ,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=RQ(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=zQ(r[d]);else{let e=zQ(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
242
+ `)}function RQ(e){return e==null?``:String(e)}function zQ(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function BQ(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),VQ);return i(),o}function VQ(e,t,n){return`>`+(n?``:` `)+e}function HQ(e,t){return UQ(e,t.inConstruct,!0)&&!UQ(e,t.notInConstruct,!1)}function UQ(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function WQ(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
243
+ `&&HQ(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
244
+ `}function GQ(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function KQ(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qQ(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function JQ(e,t,n,r){let i=qQ(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(KQ(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,YQ);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(GQ(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
245
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
246
+ `),a&&(u+=s.move(a+`
247
+ `)),u+=s.move(c),l(),u}function YQ(e,t,n){return(n?``:` `)+e}function XQ(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ZQ(e,t,n,r){let i=XQ(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
248
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function QQ(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $Q(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function e$(e,t,n){let r=xq(e),i=xq(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}t$.peek=n$;function t$(e,t,n,r){let i=QQ(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=e$(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$Q(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=e$(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$Q(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function n$(e,t,n){return n.options.emphasis||`*`}function r$(e,t){let n=!1;return GX(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&BK(e)&&(t.options.setext||n))}function i$(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(r$(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
249
+ `,after:`
250
+ `});return r(),t(),o+`
251
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
252
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
253
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=$Q(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}a$.peek=o$;function a$(e){return e.value||``}function o$(){return`<`}s$.peek=c$;function s$(e,t,n,r){let i=XQ(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function c$(){return`!`}l$.peek=u$;function l$(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function u$(){return`!`}d$.peek=f$;function d$(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function f$(){return"`"}function p$(e,t){let n=BK(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}m$.peek=h$;function m$(e,t,n,r){let i=XQ(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(p$(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function h$(e,t,n){return p$(e,n)?`<`:`[`}g$.peek=_$;function g$(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function _$(){return`[`}function v$(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function y$(e){let t=v$(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function b$(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function x$(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function S$(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?b$(n):v$(n),s=e.ordered?o===`.`?`)`:`.`:y$(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),x$(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function C$(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function w$(e,t,n,r){let i=C$(n),a=n.bulletCurrent||v$(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function T$(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var E$=PX([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function D$(e,t,n,r){return(e.children.some(function(e){return E$(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function O$(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}k$.peek=A$;function k$(e,t,n,r){let i=O$(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=e$(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$Q(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=e$(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$Q(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function A$(e,t,n){return n.options.strong||`*`}function j$(e,t,n,r){return n.safe(e.value,r)}function M$(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function N$(e,t,n){let r=(x$(n)+(n.options.ruleSpaces?` `:``)).repeat(M$(n));return n.options.ruleSpaces?r.slice(0,-1):r}var P$={blockquote:BQ,break:WQ,code:JQ,definition:ZQ,emphasis:t$,hardBreak:WQ,heading:i$,html:a$,image:s$,imageReference:l$,inlineCode:d$,link:m$,linkReference:g$,list:S$,listItem:w$,paragraph:T$,root:D$,strong:k$,text:j$,thematicBreak:N$};function F$(){return{enter:{table:I$,tableData:B$,tableHeader:B$,tableRow:R$},exit:{codeText:V$,table:L$,tableData:z$,tableHeader:z$,tableRow:z$}}}function I$(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function L$(e){this.exit(e),this.data.inTable=void 0}function R$(e){this.enter({type:`tableRow`,children:[]},e)}function z$(e){this.exit(e)}function B$(e){this.enter({type:`tableCell`,children:[]},e)}function V$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,H$));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function H$(e,t){return t===`|`?t:e}function U$(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
254
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
255
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return LQ(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=P$.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function W$(){return{exit:{taskListCheckValueChecked:K$,taskListCheckValueUnchecked:K$,paragraph:q$}}}function G$(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:J$}}}function K$(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function q$(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function J$(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=P$.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Y$(){return[tQ(),TQ(),AQ(),F$(),W$()]}function X$(e){return{extensions:[nQ(),EQ(e),jQ(),U$(e),G$()]}}var Z$={tokenize:d1,partial:!0},Q$={tokenize:f1,partial:!0},$$={tokenize:p1,partial:!0},e1={tokenize:m1,partial:!0},t1={tokenize:h1,partial:!0},n1={name:`wwwAutolink`,tokenize:l1,previous:g1},r1={name:`protocolAutolink`,tokenize:u1,previous:_1},i1={name:`emailAutolink`,tokenize:c1,previous:v1},a1={};function o1(){return{text:a1}}for(var s1=48;s1<123;)a1[s1]=i1,s1++,s1===58?s1=65:s1===91&&(s1=97);a1[43]=i1,a1[45]=i1,a1[46]=i1,a1[95]=i1,a1[72]=[i1,r1],a1[104]=[i1,r1],a1[87]=[i1,n1],a1[119]=[i1,n1];function c1(e,t,n){let r=this,i,a;return o;function o(t){return!y1(t)||!v1.call(r,r.previous)||b1(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return y1(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(t1,u,l)(t):t===45||t===95||tq(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&eq(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function l1(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!g1.call(r,r.previous)||b1(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Z$,e.attempt(Q$,e.attempt($$,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function u1(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&_1.call(r,r.previous)&&!b1(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(eq(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||rq(t)||cq(t)||dq(t)||uq(t)?n(t):e.attempt(Q$,e.attempt($$,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function d1(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function f1(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(e1,c,s)(t):t===null||cq(t)||dq(t)||t!==45&&uq(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function p1(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(e1,t,a)(o):o===null||cq(o)||dq(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function m1(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||cq(o)||dq(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||cq(e)||dq(e)?t(e):r(e)}function a(e){return eq(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):eq(t)?(e.consume(t),o):n(t)}}function h1(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return tq(e)?n(e):t(e)}}function g1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cq(e)}function _1(e){return!eq(e)}function v1(e){return!(e===47||y1(e))}function y1(e){return e===43||e===45||e===46||e===95||tq(e)}function b1(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var x1={tokenize:k1,partial:!0};function S1(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:E1,continuation:{tokenize:D1},exit:O1}},text:{91:{name:`gfmFootnoteCall`,tokenize:T1},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:C1,resolveTo:w1}}}}function C1(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=$K(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function w1(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function T1(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||cq(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes($K(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return cq(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function E1(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||cq(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=$K(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return cq(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),mq(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function D1(e,t,n){return e.check(kq,t,e.attempt(x1,t,n))}function O1(e){e.exit(`gfmFootnoteDefinition`)}function k1(e,t,n){let r=this;return mq(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function A1(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&KK(o,o.length,0,Sq(s,e.slice(r+1,n),t)),KK(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),KK(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=xq(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=xq(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var j1=class{constructor(){this.map=[]}add(e,t,n){M1(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function M1(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function N1(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function P1(){return{flow:{null:{name:`table`,tokenize:F1,resolveAll:I1}}}}function F1(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):sq(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):lq(t)?mq(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||cq(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,lq(t)?mq(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return lq(t)?mq(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||sq(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return lq(t)?mq(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||sq(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||sq(n)?(e.exit(`tableRow`),t(n)):lq(n)?mq(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||cq(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function I1(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new j1;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(R1(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=L1(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=L1(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=L1(f,t,o,i,n,d)):(o[0]=o[1],d=L1(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&R1(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=N1(t.events,n))}return e}function L1(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},z1(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=z1(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=z1(t.events,n[2]),a=z1(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},z1(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function R1(e,t,n,r,i){let a=[],o=z1(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function z1(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var B1={name:`tasklistCheck`,tokenize:H1};function V1(){return{text:{91:B1}}}function H1(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return cq(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return sq(r)?t(r):lq(r)?e.check({tokenize:U1},t,n)(r):n(r)}}function U1(e,t,n){return mq(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function W1(e){return YK([o1(),S1(),A1(e),P1(),V1()])}var G1={};function K1(e){let t=this,n=e||G1,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(W1(n)),a.push(Y$()),o.push(X$(n))}function q1(){let e=navigator.userAgent;return e.includes(`Mac`)?`Reveal in Finder`:e.includes(`Linux`)?`Open Containing Folder`:`Reveal in File Explorer`}function J1({image:e,onClose:t}){let{t:n}=K();return(0,G.jsx)(cD,{open:e!==null,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(pD,{className:`max-w-4xl`,children:[(0,G.jsxs)(mD,{children:[(0,G.jsx)(gD,{children:n(`Image preview`)}),(0,G.jsx)(_D,{className:`break-all`,children:e?.rel})]}),(0,G.jsx)(yD,{className:`max-h-[70vh]`,children:e&&(0,G.jsx)(`img`,{src:e.dataUrl,alt:e.rel,className:`mx-auto max-h-[65vh] max-w-full object-contain`})}),(0,G.jsx)(hD,{children:(0,G.jsx)(Ea,{variant:`outline`,onClick:t,children:n(`Close`)})})]})})}function Y1(e){try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function X1(e){let t=typeof navigator>`u`?void 0:navigator.clipboard;if(!t?.writeText||window.isSecureContext===!1)return Promise.resolve(Y1(e));try{return Promise.resolve(t.writeText(e)).then(()=>!0,()=>Y1(e))}catch{return Promise.resolve(Y1(e))}}function Z1(){return!!window.electronAPI?.remote}function Q1(e){return new TextDecoder().decode(Uint8Array.from(atob(e),e=>e.charCodeAt(0)))}function $1(e,t){return e[t]?.btwParentId||t}var e0=new Map,t0=new Map,n0=new Map,r0=new Set,i0=[];function a0(){let e=ZN.getState(),t=e.activeId;if(!t)return null;let n=e.conversations[t],r=e0.get(t);return!n||!r?null:{api:r,conversationId:t,projectId:n.projectId}}function o0(e){let t=a0();if(!t||c0(t.projectId))return;GR.getState().ensureOpen();let n=t.api.getPanel(`changes`);if(n){n.focus();return}t.api.addPanel({id:`changes`,component:`changes`,title:e?.title??`Changes`,params:{conversationId:t.conversationId,projectId:t.projectId}})}function s0(e,t){return t?e.some(e=>e.id===t&&e.kind===`secretary`):!1}function c0(e){return s0(T.getState().projects,e)}function l0(e,t,n,r){let i=e.getPanel(`files`);if(i){i.focus();return}e.addPanel({id:`files`,component:`files`,title:r??`Files`,params:{conversationId:t,projectId:n}})}function u0(e,t,n,r){let i=ZN.getState(),a=$1(i.conversations,e),o=i.conversations[a]?.projectId;if(!o||c0(o))return;GR.getState().ensureOpen(a);let s=r?[t,n,r]:n?[t,n]:[t],c=t0.get(a);c?c(...s):n0.set(a,s);let l=e0.get(a);l?l0(l,a,o):r0.add(a)}function d0(e){let t=ZN.getState(),n=e?.conversationId??t.activeId;if(!n)return;let r=t.conversations[n];if(!r)return;let i=$1(t.conversations,n),a=e0.get(i);GR.getState().ensureOpen(i);let o=e?.tabId??`browser:${crypto.randomUUID()}`;if(!a){i0.push({conversationId:i,tabId:o,ownerId:n});return}let s=a.getPanel(o);if(s){s.focus();return}a.addPanel({id:o,component:`browser`,title:e?.title??`Browser`,params:{conversationId:n,projectId:r.projectId}})}function f0(e,t){if(!ZN.getState().conversations[e])return null;let n=`browser:${crypto.randomUUID()}`;return d0({conversationId:e,tabId:n,title:new URL(t).host}),window.electronAPI.browser.navigate(n,e,t)}var p0=`my-2 overflow-x-auto rounded-lg border bg-[var(--sunken,var(--muted))] text-(length:--chat-code-block-size) [font-weight:var(--chat-code-block-weight)] leading-relaxed`;function m0(e){let t=e.trimStart();return/^<[a-zA-Z!/]/.test(t)?`html`:/^[{[]/.test(t)?`json`:/^[$#] /.test(t)?`shellscript`:`text`}function h0({code:e,language:t,streaming:n=!1}){let[r,i]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(n){i(null);return}let r=!0;return o_(e,t??m0(e),!0).then(e=>{r&&i(e)}),()=>{r=!1}},[e,t,n]);let a=!n&&(0,G.jsx)(Ls,{text:e,className:`absolute top-1.5 right-1.5 rounded-md border bg-background/80 p-1.5 text-muted-foreground opacity-0 backdrop-blur transition-opacity group-hover/code:opacity-100`});return r==null?(0,G.jsxs)(`div`,{"data-enso":`code-block`,"data-language":t,className:`group/code relative`,children:[(0,G.jsx)(`pre`,{className:`${p0} p-3 font-mono`,children:(0,G.jsx)(`code`,{children:e})}),a]}):(0,G.jsxs)(`div`,{"data-enso":`code-block`,"data-language":t,className:`group/code relative`,children:[(0,G.jsx)(`div`,{className:`${p0} [&_pre]:m-0 [&_pre]:overflow-x-auto [&_pre]:bg-transparent! [&_pre]:p-3 [&_pre]:font-mono [&_pre]:[--shiki-dark-bg:transparent]!`,dangerouslySetInnerHTML:{__html:r}}),a]})}var g0=50,_0=3e4,v0={status:`missing`},y0=new Map,b0=new Map,x0=new Set,S0=new Map,C0=null,w0=0,T0={batches:0,paths:0,ms:0},E0=e=>e.cwd??`conversation:${e.conversationId}`,D0=(e,t)=>`${E0(e)}\0${t}`;function O0(e){return e?e.state.status===`ok`?e.epoch===w0:Date.now()-e.at<_0:!1}function k0(e,t){let n=y0.get(e)?.state,r=n?.status===t.status&&(t.status===`missing`||n.status===`ok`&&n.rel===t.rel&&n.kind===t.kind);if(y0.set(e,{state:r&&n?n:t,epoch:w0,at:Date.now()}),!r)for(let t of b0.get(e)??[])t()}function A0(e){return e?{status:`ok`,rel:e.rel,kind:e.kind}:v0}async function j0(e,t){let n=performance.now();try{let n=await window.electronAPI.workspaceFiles.resolveLinks({conversationId:e.conversationId,projectId:e.projectId,rels:t});return t.map((e,t)=>A0(n.ok?n.items[t]:null))}catch{return t.map(()=>v0)}finally{T0.batches+=1,T0.paths+=t.length,T0.ms+=performance.now()-n}}function M0(){C0=null;let e=[...S0.values()];S0.clear();for(let{scope:t,rels:n}of e){let e=[...n];for(let n=0;n<e.length;n+=200){let r=e.slice(n,n+200);j0(t,r).then(e=>{r.forEach((n,r)=>{let i=D0(t,n);x0.delete(i),k0(i,e[r])})})}}}function N0(e,t){let n=D0(e,t);if(x0.has(n)||O0(y0.get(n)))return;x0.add(n);let r=`${e.conversationId}\0${e.projectId}`,i=S0.get(r)??{scope:e,rels:new Set};i.rels.add(t),S0.set(r,i),C0??=setTimeout(M0,g0)}async function P0(e,t){let[n]=await j0(e,[t]);return k0(D0(e,t),n),n}function F0(e,t,n){let r=e&&t?D0(e,t):null,i=(0,H.useCallback)(e=>{if(!r)return()=>{};let t=b0.get(r)??new Set;return b0.set(r,t),t.add(e),()=>{t.delete(e),t.size===0&&b0.delete(r)}},[r]),a=(0,H.useSyncExternalStore)(i,()=>r?y0.get(r)?.state:void 0);return(0,H.useEffect)(()=>{n&&e&&t&&N0(e,t)},[n,r]),a}var I0=2;function L0({value:e}){return typeof e==`string`?(0,G.jsx)(`span`,{className:`text-emerald-700 dark:text-emerald-400`,children:JSON.stringify(e)}):typeof e==`number`?(0,G.jsx)(`span`,{className:`text-sky-700 dark:text-sky-400`,children:String(e)}):(0,G.jsx)(`span`,{className:`text-violet-700 dark:text-violet-400`,children:String(e)})}function R0({name:e,value:t,depth:n}){let[r,i]=(0,H.useState)(n<I0),a=e!==void 0&&(0,G.jsxs)(`span`,{className:`text-foreground/80`,children:[e,(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:`: `})]});if(typeof t!=`object`||!t)return(0,G.jsxs)(`div`,{className:`pl-4`,children:[a,(0,G.jsx)(L0,{value:t})]});let o=Array.isArray(t),s=o?t.map((e,t)=>[String(t),e]):Object.entries(t),[c,l]=o?[`[`,`]`]:[`{`,`}`];return(0,G.jsxs)(`div`,{className:n>0?`pl-4`:void 0,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(!r),className:`-ml-4 inline-flex items-center text-left hover:text-foreground`,children:[(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 transition-transform`,r&&`rotate-90`)}),(0,G.jsxs)(`span`,{className:`ml-1`,children:[a,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[c,!r&&` ${s.length} ${l}`]})]})]}),r&&(0,G.jsxs)(G.Fragment,{children:[s.map(([e,t])=>(0,G.jsx)(R0,{name:o?void 0:e,value:t,depth:n+1},e)),(0,G.jsx)(`div`,{className:`text-muted-foreground`,children:l})]})]})}function z0({source:e,value:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1),a=e=>W(`rounded px-1.5 py-0.5`,e?`bg-muted text-foreground`:`hover:text-foreground`);return(0,G.jsxs)(`div`,{"data-enso":`json-tree`,className:`group/code relative my-2 rounded-lg border`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1 border-b px-2 py-1 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`mr-auto font-mono`,children:`JSON`}),(0,G.jsx)(`button`,{type:`button`,className:a(!r),onClick:()=>i(!1),children:n(`Tree view`)}),(0,G.jsx)(`button`,{type:`button`,className:a(r),onClick:()=>i(!0),children:n(`Raw text`)}),(0,G.jsx)(Ls,{text:e,className:`rounded p-1`})]}),r?(0,G.jsx)(`div`,{className:`px-2`,children:(0,G.jsx)(h0,{code:e,language:`json`})}):(0,G.jsx)(`div`,{className:`max-h-[480px] overflow-auto py-2 pr-3 pl-6 font-mono text-(length:--chat-code-block-size) leading-relaxed`,children:(0,G.jsx)(R0,{value:t,depth:0})})]})}function B0(e,{prefersDark:t,terminalIsDark:n}){switch(e){case`light`:return`light`;case`dark`:return`dark`;case`system`:return t?`dark`:`light`;case`sync-terminal`:return n?`dark`:`light`}}function V0(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches}function H0(){let e=T(e=>e.theme),t=T(e=>e.terminalTheme),[n,r]=(0,H.useState)(V0);return(0,H.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>r(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),B0(e,{prefersDark:n,terminalIsDark:ke(t)})}function U0(e){let t=H0();return(0,H.useMemo)(()=>({...e,themeType:t}),[e,t])}var W0=`http://www.w3.org/2000/svg`,G0=`http://www.w3.org/1999/xlink`,K0=/<svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/i,q0=16384,J0=q0*q0,Y0=2;function X0(e){return RegExp(`\\s${e}\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s"'>]+)`,`i`)}function Z0(e,t){let n=e.match(X0(t));return n?n[0].replace(/^[^=]*=\s*/,``).replace(/^["']|["']$/g,``):null}function Q0(e,t,n){let r=` ${t}="${n}"`,i=X0(t);return i.test(e)?e.replace(i,r):e.replace(/\s*\/?>$/,e=>`${r}${e}`)}function $0(e){let t=e.match(K0)?.[0],n=t?Z0(t,`viewBox`):null;if(!n)return null;let r=n.trim().split(/[\s,]+/).map(Number);if(r.length!==4)return null;let[,,i,a]=r;return Number.isFinite(i)&&Number.isFinite(a)&&i>0&&a>0?{width:i,height:a}:null}function e2(e){let t=e.match(K0);if(!t)return e;let n=t[0];Z0(n,`xmlns`)||(n=Q0(n,`xmlns`,W0)),e.includes(`xlink:`)&&!Z0(n,`xmlns:xlink`)&&(n=Q0(n,`xmlns:xlink`,G0));let r=$0(e);if(r){n=Q0(n,`width`,String(r.width)),n=Q0(n,`height`,String(r.height));let e=Z0(n,`style`);if(e!==null){let t=e.split(`;`).filter(e=>e.trim()&&!/^\s*max-width\s*:/i.test(e)).join(`;`).trim();n=t?Q0(n,`style`,t):n.replace(X0(`style`),``)}}return e.replace(t[0],()=>n)}function t2(e,t=new Date){let n=e=>String(e).padStart(2,`0`);return`mermaid-${`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}`}-${`${n(t.getHours())}${n(t.getMinutes())}${n(t.getSeconds())}`}.${e}`}function n2(e,t){let n=Math.min(Y0,q0/e,q0/t,Math.sqrt(J0/(e*t)));return n>=1?n:null}function r2(e){return new Blob([e2(e)],{type:`image/svg+xml`})}function i2(e){return e2(new XMLSerializer().serializeToString(e))}function a2(e){let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);if(!t)throw Error(`No svg in markup`);return i2(t)}function o2(e,t){let n=typeof e==`string`?e:URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),typeof e!=`string`&&setTimeout(()=>URL.revokeObjectURL(n),0)}async function s2(e,t,n,r,i){let a=new Image;a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await a.decode();let o=document.createElement(`canvas`);o.width=Math.floor(t*r),o.height=Math.floor(n*r);let s=o.getContext(`2d`);if(!s)throw Error(`Canvas unavailable`);s.fillStyle=i,s.fillRect(0,0,o.width,o.height),s.drawImage(a,0,0,o.width,o.height);let c=o.toDataURL(`image/png`);if(!c.startsWith(`data:image/png`))throw Error(`Canvas export failed`);return c}async function c2(e){let t=t=>{try{let n=e.currentSvg();return n?(e.download(r2(n),t2(`svg`)),{kind:`svg`,reason:t}):{kind:`failed`}}catch{return{kind:`failed`}}},n;try{n=e2(await e.rerender())}catch{return t(`rerender-failed`)}if(/<foreignObject\b/i.test(n))return t(`rerender-failed`);let r=$0(n);if(!r)return t(`draw-failed`);let i=n2(r.width,r.height);if(i===null)return t(`too-large`);try{let t=await e.rasterize(n,r.width,r.height,i);return e.download(t,t2(`png`)),{kind:`png`}}catch{return t(`draw-failed`)}}var l2=`position:fixed;left:0;top:0;width:800px;height:600px;overflow:hidden;opacity:0;pointer-events:none;visibility:hidden;contain:strict;`;function u2(e){return!e.includes(`<svg`)||/\bfocusable=/.test(e)?e:e.replace(`<svg`,`<svg focusable="false" tabindex="-1"`)}function d2(e){return{startOnLoad:!1,theme:e,securityLevel:`strict`,fontFamily:`inherit`,suppressErrorRendering:!0,flowchart:{htmlLabels:!1,useMaxWidth:!0}}}var f2=/<(?:a|area)\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,p2=/\s(?:xlink:)?(?:href|target)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]+)/gi;function m2(e){return e.replace(f2,e=>e.replace(p2,``))}var h2=null,g2=null,_2=Promise.resolve(),v2=0;async function y2(){return g2||(h2||=q(()=>import(`./mermaid.core-wueTI3u_.js`).then(e=>(g2=e.default,g2)),__vite__mapDeps([126,127,128,1,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143])).catch(e=>{throw h2=null,e}),h2)}function b2(e){let t=_2.then(e,e);return _2=t.then(()=>void 0,()=>void 0),t}async function x2(e,t,n={}){return b2(async()=>{let r=await y2();r.initialize({...d2(t),...n});let i=`ensoMermaid${++v2}`,a=document.createElement(`div`);a.setAttribute(`aria-hidden`,`true`),a.style.cssText=l2,document.body.appendChild(a);try{let{svg:t}=await r.render(i,e,a);return u2(m2(t))}finally{a.remove(),document.getElementById(i)?.remove(),document.getElementById(`d${i}`)?.remove()}})}var S2=.1,C2={dark:`#1f2020`,default:`#ffffff`},w2=.1;function T2({code:e,streaming:t=!1,className:n}){let{t:r}=K(),i=(0,H.useRef)(null),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(1),[d,f]=(0,H.useState)({x:0,y:0}),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1);YE(h);let _=(0,H.useRef)({x:0,y:0}),v=(0,H.useRef)({x:0,y:0}),y=(0,H.useRef)(null),b=(0,H.useRef)(!1),x=H0()===`dark`?`dark`:`default`;(0,H.useEffect)(()=>{if(t){o(null),c(null);return}let n=!1;return(async()=>{if(!e.trim()){o(null),c(null);return}try{let t=await x2(e,x);n||(o(t),c(null),u(1),f({x:0,y:0}))}catch(e){n||(c(e instanceof Error?e.message:`Mermaid render failed`),o(null))}})(),()=>{n=!0}},[e,x,t]);let S=(0,H.useCallback)(()=>u(e=>e+S2),[]),C=(0,H.useCallback)(()=>u(e=>Math.max(e-S2,w2)),[]),w=(0,H.useCallback)(()=>{u(1),f({x:0,y:0})},[]),T=(0,H.useCallback)(()=>{g(!1),u(1),f({x:0,y:0})},[]),E=(0,H.useCallback)(()=>{g(!0),requestAnimationFrame(()=>{let e=y.current,t=e?.firstElementChild;if(!e||!t?.offsetWidth||!t.offsetHeight)return;let n=Math.min((e.clientWidth-48)/t.offsetWidth,(e.clientHeight-48)/t.offsetHeight);u(Math.round(n*100)/100),f({x:0,y:0})})},[]),D=(0,H.useCallback)(e=>{if(!h)return;e.preventDefault();let t=e.deltaY>0?-.1:S2;u(e=>Math.round(Math.max(e+t,w2)*100)/100)},[h]),O=(0,H.useCallback)(e=>{!h||e.button!==0||(m(!0),b.current=!1,_.current={x:e.clientX,y:e.clientY},v.current={...d})},[h,d]),k=(0,H.useCallback)(e=>{if(!p)return;let t=e.clientX-_.current.x,n=e.clientY-_.current.y;(Math.abs(t)>2||Math.abs(n)>2)&&(b.current=!0),f({x:v.current.x+t,y:v.current.y+n})},[p]),A=(0,H.useCallback)(()=>m(!1),[]),j=(0,H.useCallback)(e=>{e.stopPropagation()},[]),M=(0,H.useCallback)(()=>{b.current||T()},[T]),N=(0,H.useCallback)(()=>{try{let e=i.current?.querySelector(`svg`);if(!e)throw Error(`No svg`);o2(r2(i2(e)),t2(`svg`))}catch{RD({type:`error`,title:r(`Export failed`)})}},[r]),P=(0,H.useCallback)(async()=>{let t=await c2({currentSvg:()=>{let e=i.current?.querySelector(`svg`);return e?i2(e):null},rerender:async()=>a2(await x2(e,x,{htmlLabels:!1})),rasterize:(e,t,n,r)=>s2(e,t,n,r,C2[x]),download:o2});t.kind===`failed`?RD({type:`error`,title:r(`Export failed`)}):t.kind===`svg`&&RD({type:`warning`,title:t.reason===`too-large`?r(`Diagram is too large for PNG, exported SVG instead`):r(`PNG export failed, exported SVG instead`)})},[e,x,r]),F=e=>{let t=e===`sm`?`h-6 w-6`:`h-7 w-7`,n=e===`sm`?`h-3.5 w-3.5`:`h-4 w-4`,i=e===`sm`?`h-6 min-w-[2.5rem]`:`h-7 min-w-[3rem]`;return(0,G.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border bg-background/95 p-1 shadow-sm`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:S,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Zoom in`),children:(0,G.jsx)(En,{className:n})}),(0,G.jsxs)(`button`,{type:`button`,onClick:w,className:W(`flex items-center justify-center rounded text-xs transition-colors hover:bg-accent hover:text-accent-foreground`,i),title:r(`Reset zoom`),children:[Math.round(l*100),`%`]}),(0,G.jsx)(`button`,{type:`button`,onClick:C,disabled:l<=w2,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t,l<=w2&&`cursor-not-allowed opacity-50`),title:r(`Zoom out`),children:(0,G.jsx)(pn,{className:n})}),l!==1&&(0,G.jsx)(`button`,{type:`button`,onClick:w,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Fit to original size`),children:(0,G.jsx)(jn,{className:n})}),(0,G.jsx)(`div`,{className:`mx-0.5 h-4 w-px bg-border`}),(0,G.jsx)(`button`,{type:`button`,onClick:N,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Export SVG`),children:(0,G.jsx)(Lt,{className:n})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>void P(),className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Export PNG`),children:(0,G.jsx)(Xt,{className:n})}),h?(0,G.jsx)(`button`,{type:`button`,onClick:T,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`Exit fullscreen`),children:(0,G.jsx)(fn,{className:n})}):(0,G.jsx)(`button`,{type:`button`,onClick:E,className:W(`flex items-center justify-center rounded text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,t),title:r(`View fullscreen`),children:(0,G.jsx)(sn,{className:n})})]})};return s?(0,G.jsxs)(`div`,{className:W(`overflow-x-auto rounded-lg border border-destructive/50`,n),children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2 border-b border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:(0,G.jsx)(`span`,{children:r(`Mermaid render error`)})}),(0,G.jsx)(`pre`,{className:`p-4 text-sm`,children:(0,G.jsx)(`code`,{className:`block font-mono leading-relaxed text-muted-foreground`,children:e})}),(0,G.jsx)(`div`,{className:`border-t border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground`,children:s})]}):a?(0,G.jsxs)(`div`,{className:W(`relative rounded-lg border border-border bg-muted/30`,n),style:{userSelect:`none`,WebkitUserSelect:`none`},children:[(0,G.jsx)(`div`,{ref:i,className:W(`max-h-[min(50vh,20rem)] overflow-hidden [overflow-anchor:none]`,h&&(p?`cursor-grabbing`:`cursor-grab`)),onWheel:D,onMouseDown:O,onMouseMove:k,onMouseUp:A,onMouseLeave:A,onDoubleClick:h?void 0:E,children:(0,G.jsx)(`div`,{className:`origin-center transition-transform duration-100 ease-out`,style:{transform:`translate(${d.x}px, ${d.y}px) scale(${l})`},children:(0,G.jsx)(`div`,{className:`p-4`,dangerouslySetInnerHTML:{__html:a}})})}),(0,G.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:F(`sm`)}),h&&(0,G.jsxs)(`div`,{className:`fixed inset-0 flex select-none flex-col bg-background`,style:{zIndex:oD.TOAST},"data-enso-float":``,onClick:M,onKeyDown:e=>{e.key===`Escape`&&T()},children:[(0,G.jsxs)(`div`,{className:`relative z-10 flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-4 py-2`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,G.jsx)(`span`,{className:`text-sm font-medium text-muted-foreground`,children:r(`Mermaid preview`)}),(0,G.jsx)(`button`,{type:`button`,onClick:T,className:`flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background/95 text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,title:r(`Exit fullscreen`),children:(0,G.jsx)(nr,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,G.jsx)(`div`,{ref:y,className:W(`flex min-h-0 flex-1 select-none overflow-hidden`,p?`cursor-grabbing`:`cursor-grab`),onWheel:D,onMouseDown:O,onMouseMove:k,onMouseUp:A,onMouseLeave:A,onClick:j,onKeyDown:j,children:(0,G.jsx)(`div`,{className:`m-auto origin-center transition-transform duration-100 ease-out`,style:{transform:`translate(${d.x}px, ${d.y}px) scale(${l})`},children:(0,G.jsx)(`div`,{className:`p-4`,dangerouslySetInnerHTML:{__html:a}})})}),(0,G.jsx)(`div`,{className:`absolute right-4 bottom-4`,children:F(`md`)})]})]})]}):(0,G.jsx)(`div`,{className:W(`flex items-center justify-center rounded-lg border border-border bg-muted/30 p-8`,n),children:(0,G.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:r(`Loading Mermaid diagram...`)})})}var E2=/^[a-z][a-z\d+.-]*:/i,D2=/^(?:https?|ircs?|mailto|xmpp):/i,O2=/^(?:[a-z]:[\\/]|\\\\)/i;function k2(e){let t=e?.trim();if(!t||!/^https?:\/\//i.test(t))return null;try{return new URL(t)}catch{return null}}function A2(e){let t=/^(.*?):(\d+)(?:-\d+)?$/.exec(e);if(!t)return{path:e};let n=Number(t[2]);return n>0?{path:t[1],line:n}:{path:t[1]}}function j2(e){try{return decodeURIComponent(e)}catch{return null}}function M2(e){let t=e.search(/[?#]/);return t<0?e:e.slice(0,t)}function N2(e){try{let t=new URL(e);if(t.protocol!==`file:`)return null;let n=decodeURIComponent(t.pathname);return n?(t.hostname&&t.hostname.toLowerCase()!==`localhost`?n=`//${t.hostname}${n}`:/^\/[a-z]:[\\/]/i.test(n)&&(n=n.slice(1)),n):null}catch{return null}}function P2(e){let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`?`))return{kind:`external`};if(/^file:/i.test(t)){let e=N2(t);return e?{kind:`local`,path:e}:{kind:`blocked`}}if(D2.test(t)||t.startsWith(`//`))return{kind:`external`};let n=j2(M2(t));return n==null||n.includes(`\0`)||E2.test(n)&&!O2.test(n)?{kind:`blocked`}:{kind:`local`,path:n}}function F2(e){let t=e.replace(/\\/g,`/`),n=/^[a-z]:\//i.test(t)||t.startsWith(`//`);if(!n&&!t.startsWith(`/`))return null;let r=/^[a-z]:\//i.test(t)?t.slice(0,2).toLowerCase():null,i=(r||n?t.slice(2):t.slice(1)).split(`/`),a=[];for(let e of i)if(!(!e||e===`.`)){if(e===`..`){if(a.length===0)return null;a.pop()}else a.push(e)}return r?{value:`${r}/${a.join(`/`)}`.replace(/\/$/,``),windows:!0}:n?{value:`//${a.join(`/`)}`,windows:!0}:{value:`/${a.join(`/`)}`.replace(/\/$/,``)||`/`,windows:!1}}function I2(e){let t=e.replace(/\\/g,`/`),n=[];for(let e of t.split(`/`))if(!(!e||e===`.`)){if(e===`..`){if(n.length===0)return null;n.pop()}else{if(e.includes(`\0`))return null;n.push(e)}}return n.join(`/`)}function L2(e){return F2(e)!==null}function R2(e,t){if(!t)return F2(e)?null:I2(e);let n=F2(t);if(!n)return null;let r=n.windows&&/^\/[a-z]:[\\/]/i.test(e)?e.slice(1):e,i=F2(r);if(!i)return r===e?I2(e):null;if(i.windows!==n.windows)return null;let a=n.value.toLowerCase(),o=i.value.toLowerCase();if(o===a)return``;let s=n.value.endsWith(`/`)?n.value:`${n.value}/`;return o.startsWith(s.toLowerCase())?I2(i.value.slice(s.length)):null}function z2(e,t){let n=t?F2(t):null;if(!n||R2(e,t)!==null)return null;let r=n.windows&&/^\/[a-z]:[\\/]/i.test(e)?e.slice(1):e;return F2(r)?r:null}var B2=/^(?:%|ms|s|sec|min|h|ms\/op|ns|µs|us|b|kb|mb|gb|tb|kib|mib|gib|x|×|k|m|bn)$/i;function V2(e){let t=e.trim().replace(/^[$€£¥₹]\s*/,``),n=!1;/^\(.*\)$/.test(t)&&(n=!0,t=t.slice(1,-1));let r=/^([+-]?(?:\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?)\s*(\S*)$/.exec(t);if(!r||r[2]&&!B2.test(r[2]))return null;let i=Number(r[1].replace(/,/g,``));return n?-i:i}function H2(e){let t=Math.max(0,...e.map(e=>e.length));return Array.from({length:t},(t,n)=>{let r=e.map(e=>e[n]?.trim()??``).filter(Boolean);return r.length>0&&r.every(e=>V2(e)!==null)})}function U2(e,t,n){return n?(V2(e)??0)-(V2(t)??0):e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function W2(e,t,n){let r=e.map((e,t)=>t);if(!t)return r;let i=t.dir===`asc`?1:-1,a=n=>e[n][t.column]?.trim()??``;return r.sort((e,r)=>{let o=a(e),s=a(r);return!o||!s?o?-1:+!!s:i*U2(o,s,n[t.column]??!1)||e-r})}function G2(e,t){return e?.column===t?e.dir===`asc`?{column:t,dir:`desc`}:null:{column:t,dir:`asc`}}var K2=new Set([`json`,`jsonc`,`json5`]),q2=new Set([`console`,`shell-session`,`terminal`,`output`,`ansi`]),J2=new Set([`sh`,`bash`,`shell`,`zsh`,`shellscript`]),Y2=`$ `;function X2(e,t){let n=e?.toLowerCase();if(n&&K2.has(n))return Z2(t)?`json`:null;if(!n&&/^\s*[{[]/.test(t)&&Z2(t))return`json`;if(n&&q2.has(n)||t.includes(`\x1B[`))return`terminal`;if(!n||J2.has(n)){let e=t.split(`
256
+ `).filter(e=>e.trim());if(e[0]?.startsWith(Y2)&&e.some(e=>!e.startsWith(Y2)))return`terminal`}return null}function Z2(e){let t=Q2(e);return t.ok&&typeof t.value==`object`&&t.value!==null}function Q2(e){let t=``,n=0;for(;n<e.length;){let r=e[n];if(r===`"`){let r=n+1;for(;r<e.length&&e[r]!==`"`;)r+=e[r]===`\\`?2:1;t+=e.slice(n,r+1),n=r+1}else if(r===`/`&&e[n+1]===`/`)for(;n<e.length&&e[n]!==`
257
+ `;)n++;else if(r===`/`&&e[n+1]===`*`){let t=e.indexOf(`*/`,n+2);n=t<0?e.length:t+2}else r===`,`&&/^\s*[}\]]/.test(e.slice(n+1))||(t+=r),n++}try{return{ok:!0,value:JSON.parse(t)}}catch{return{ok:!1}}}var $2=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`],e4=[0,95,135,175,215,255],t4=`\x1B`,n4=`\x07`,r4=RegExp(`${t4}\\[([0-9;?]*)([A-Za-z])|${t4}\\][^${n4}${t4}]*(?:${n4}|${t4}\\\\)?|${t4}[@-Z\\\\-_]`,`g`);function i4(...e){return`#${e.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function a4(e){if(e<0||e>255)return;if(e<8)return $2[e];if(e<16)return`bright-${$2[e-8]}`;if(e<232){let t=e-16;return i4(e4[Math.floor(t/36)],e4[Math.floor(t/6)%6],e4[t%6])}let t=8+(e-232)*10;return i4(t,t,t)}function o4(e,t){if(e[t+1]===5)return[a4(e[t+2]??-1),3];if(e[t+1]===2){let[n,r,i]=e.slice(t+2,t+5);return[n===void 0||r===void 0||i===void 0?void 0:`rgb(${n},${r},${i})`,5]}return[void 0,1]}function s4(e,t){let n=t?t.split(`;`).map(e=>Number(e||0)):[0],r={...e};for(let e=0;e<n.length;e++){let t=n[e];if(t===0)r={};else if(t===1)r.bold=!0;else if(t===2)r.dim=!0;else if(t===3)r.italic=!0;else if(t===4)r.underline=!0;else if(t===22)delete r.bold,delete r.dim;else if(t===23)delete r.italic;else if(t===24)delete r.underline;else if(t>=30&&t<=37)r.fg=$2[t-30];else if(t>=90&&t<=97)r.fg=`bright-${$2[t-90]}`;else if(t>=40&&t<=47)r.bg=$2[t-40];else if(t>=100&&t<=107)r.bg=`bright-${$2[t-100]}`;else if(t===39)delete r.fg;else if(t===49)delete r.bg;else if(t===38||t===48){let[i,a]=o4(n,e);i&&(r[t===38?`fg`:`bg`]=i),e+=a-1}}return r}var c4=(e,t)=>e.fg===t.fg&&e.bg===t.bg&&e.bold===t.bold&&e.dim===t.dim&&e.italic===t.italic&&e.underline===t.underline;function l4(e){let t=[],n={},r=e=>{if(!e)return;let r=t.at(-1);r&&c4(r,n)?r.text+=e:t.push({text:e,...n})},i=0;for(let t of e.matchAll(r4))r(e.slice(i,t.index)),i=t.index+t[0].length,t[2]===`m`&&!t[1]?.includes(`?`)&&(n=s4(n,t[1]??``));return r(e.slice(i)),t}function u4(e){return e.replace(r4,``)}function d4(e){let t=[];for(let n of e.split(`
258
+ `)){if(n.startsWith(Y2)){t.push({kind:`command`,text:n.slice(2)});continue}let e=t.at(-1);e?.kind===`output`?e.text+=`\n${n}`:t.push({kind:`output`,text:n})}return t}var f4=40,p4={black:`#6e7781`,red:`#d1242f`,green:`#1a7f37`,yellow:`#9a6700`,blue:`#0969da`,magenta:`#8250df`,cyan:`#1b7c83`,white:`#8c959f`,"bright-black":`#8c959f`,"bright-red":`#e5534b`,"bright-green":`#3fb950`,"bright-yellow":`#d4a72c`,"bright-blue":`#539bf5`,"bright-magenta":`#b083f0`,"bright-cyan":`#39c5cf`,"bright-white":`#adbac7`};function m4({segment:e}){let{text:t,fg:n,bg:r,bold:i,dim:a,italic:o,underline:s}=e;return!n&&!r&&!i&&!a&&!o&&!s?t:(0,G.jsx)(`span`,{style:{color:n?p4[n]??n:void 0,backgroundColor:r?p4[r]??r:void 0},className:W(i&&`font-semibold`,a&&`opacity-60`,o&&`italic`,s&&`underline`),children:t})}function h4({source:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=e.split(`
259
+ `),a=!n&&i.length>f4,o=a?i.slice(-20).join(`
260
+ `):e,s=(0,H.useMemo)(()=>d4(o),[o]);return(0,G.jsxs)(`div`,{"data-enso":`terminal-block`,className:`group/code relative my-2`,children:[(0,G.jsxs)(`div`,{className:`overflow-x-auto rounded-lg border bg-[var(--sunken,var(--muted))] p-3 font-mono text-(length:--chat-code-block-size) leading-relaxed`,children:[a&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`mb-1 text-[11px] text-muted-foreground hover:text-foreground`,children:t(`Show all {{count}} lines`,{count:i.length})}),s.map((e,t)=>e.kind===`command`?(0,G.jsxs)(`div`,{className:`whitespace-pre font-semibold`,children:[(0,G.jsx)(`span`,{className:`select-none text-muted-foreground`,children:`$ `}),u4(e.text)]},t):(0,G.jsx)(`div`,{className:`whitespace-pre`,children:l4(e.text).map((e,t)=>(0,G.jsx)(m4,{segment:e},t))},t))]}),(0,G.jsx)(Ls,{text:()=>u4(e),className:`absolute top-1.5 right-1.5 rounded-md border bg-background/80 p-1.5 text-muted-foreground opacity-0 backdrop-blur transition-opacity group-hover/code:opacity-100`})]})}function g4(e){if(!e)return;let t=e.split(`:`).at(-1)??e;return/\.(\w+)$/.exec(t)?.[1]||(/^[\w-]+$/.test(e)?e:void 0)}var _4={note:{label:`Note`,border:`border-blue-500`,text:`text-blue-600 dark:text-blue-400`},tip:{label:`Tip`,border:`border-green-500`,text:`text-green-600 dark:text-green-400`},important:{label:`Important`,border:`border-purple-500`,text:`text-purple-600 dark:text-purple-400`},warning:{label:`Warning`,border:`border-amber-500`,text:`text-amber-600 dark:text-amber-400`},caution:{label:`Caution`,border:`border-red-500`,text:`text-red-600 dark:text-red-400`}};function v4(){return e=>{GX(e,`blockquote`,e=>{let t=e.children[0];if(t?.type!==`paragraph`)return;let n=t.children[0];if(n?.type!==`text`)return;let r=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i.exec(n.value);if(!r)return;n.value=n.value.slice(r[0].length),n.value||t.children.shift();let i=r[1].toLowerCase();e.data={...e.data,hProperties:{...e.data?.hProperties,"data-alert":i,dataAlert:i}}})}}var y4=/^(?:[\w.@-]+\/)+[\w.@-]+\.\w{1,8}(?::\d+(?:-\d+)?)?$|^[\w.-]+\.\w{1,8}:\d+(?:-\d+)?$/,b4=/^(?!(?:\.+\/)+$)(?:[\w.@-]+\/)+$/,x4=`rounded-[5px] border border-border/70 bg-muted/70 px-1 py-px font-mono text-(length:--chat-inline-code-size) [font-weight:var(--chat-inline-code-weight)]`,S4=[K1,v4],C4=(0,H.createContext)({text:``,streaming:!1,searchQuery:``,activeNth:-1}),w4=(0,H.createContext)(null),T4=(0,H.createContext)(!0);function E4({text:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=()=>{let n=window.getSelection?.();n&&!n.isCollapsed&&n.toString()||X1(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1200),RD({type:`success`,title:t(`Copied`)}))})};return(0,G.jsxs)(`span`,{role:`button`,tabIndex:0,title:t(`Copy`),"data-copy-code":``,className:`group/copy relative cursor-pointer`,onClick:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())},children:[(0,G.jsx)(`code`,{className:x4,children:e}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:W(`pointer-events-none absolute -top-2.5 -right-2 inline-flex rounded-[4px] border border-border bg-background p-0.5 text-muted-foreground shadow-sm transition-opacity`,n?`opacity-100`:`opacity-0 group-hover/copy:opacity-100`),children:n?(0,G.jsx)(ht,{className:`h-3 w-3`}):(0,G.jsx)(Nt,{className:`h-3 w-3`})})]})}function D4(e){for(let t=e.parentElement;t;t=t.parentElement){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`)return t}return null}function O4(e){let[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)(()=>typeof IntersectionObserver!=`function`);return(0,H.useEffect)(()=>{if(!e||!t||r)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&i(!0)},{root:D4(t),rootMargin:`100% 0px`});return n.observe(t),()=>n.disconnect()},[e,t,r]),[n,r]}function k4(e,t){let[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!t)return;let n=setTimeout(()=>r(e),300);return()=>clearTimeout(n)},[e,t]),!t||n===e}function A4(e,t){switch(e){case`invalid-path`:return t(`The link is outside the current workspace.`);case`unsupported`:return t(`This link is not available on the local computer.`);case`unavailable`:return t(`The linked file or folder is unavailable.`);case`unsupported-viewer`:return t(`This file format cannot be previewed inside EnsoCode.`);case`too-large`:return t(`The image is too large to preview.`);case`invalid-application`:return t(`The selected application path is invalid.`);case`application-unavailable`:return t(`VS Code is unavailable. Install it or select another application.`);default:return e}}async function j4(e,t,n,r){try{let r=R2(t,e.cwd);if(r===null)throw Error(`invalid-path`);let i=await window.electronAPI.workspaceFiles.openContext({conversationId:e.conversationId,projectId:e.projectId,rel:r,itemId:n});if(!i.ok)throw Error(i.error)}catch(e){RD({type:`error`,title:r(`Could not open local file link`),description:A4(e instanceof Error?e.message:String(e),r)})}}function M4({context:e,file:t,extra:n,children:r}){let{t:i}=K(),a=T(e=>e.contextMenuOpen),o=e?a.filter(e=>e.enabled):[];return o.length===0&&!n?r:(0,G.jsxs)(PG,{children:[(0,G.jsx)(FG,{render:r,onContextMenu:e=>e.stopPropagation()}),(0,G.jsxs)(IG,{className:`min-w-48`,children:[n,o.map(n=>{let r=n.target===`application`?(n.applicationPath.split(/[/\\]/).at(-1)??n.applicationPath).replace(/\.(?:exe|app)$/i,``):`VS Code`;return(0,G.jsx)(LG,{closeOnClick:!0,onClick:()=>e&&void j4(e,t,n.id,i),children:n.target===`reveal`?i(q1()):i(`Open in {{app}}`,{app:r})},n.id)})]})]})}function N4(e){let t=P2(e);if(t.kind===`external`)return{classification:t,line:void 0};let n=A2(t.kind===`local`?t.path:e);return n.line&&/\.[\w]+$/.test(n.path)?{classification:P2(n.path),line:n.line}:{classification:t,line:void 0}}function P4(e){let t=e?.children;if(t?.length!==1)return null;let n=t[0],r=n.tagName===`code`&&n.children?.length===1?n.children[0]:null;return r?.type===`text`&&typeof r.value==`string`?r.value:null}function F4(e,t){let{t:n}=K(),r=(0,H.useContext)(w4),[i,a]=(0,H.useState)(null),o=e=>{RD({type:`error`,title:n(`Could not open local file link`),description:A4(e,n)})},s=r&&e!==null?z2(e,r.cwd):null,c=async e=>{if(r)try{let t=await window.electronAPI.workspaceFiles.revealExternal({conversationId:r.conversationId,projectId:r.projectId,path:e});!t.ok&&t.error!==`cancelled`&&o(t.error)}catch(e){o(e instanceof Error?e.message:String(e))}};return{linkContext:r,external:s,openLocal:async n=>{if(!r||e===null)return;let i=R2(e,r.cwd);if(i==null){s?await c(s):o(`invalid-path`);return}if(!n&&t){u0(r.conversationId,i,t);return}let l={conversationId:r.conversationId,projectId:r.projectId,rel:i};try{if(n){let e=await window.electronAPI.workspaceFiles.reveal(l);e.ok||o(e.error);return}let e=await window.electronAPI.workspaceFiles.open(l);if(!e.ok){o(e.error);return}if(e.target===`handled`)return;if(e.viewer===`image`){let t=GG(e.rel);if(!t){o(`unsupported-viewer`);return}let n=await window.electronAPI.workspaceFiles.readImage({...l,rel:e.rel});if(!n.ok){o(n.error);return}let r=`data:${t};base64,`;if(!n.dataUrl.startsWith(r)||!/^[A-Za-z0-9+/=]+$/.test(n.dataUrl.slice(r.length))){o(`unsupported-viewer`);return}a({rel:e.rel,dataUrl:n.dataUrl})}else e.viewer===`markdown`?u0(r.conversationId,e.rel,void 0,`markdown`):u0(r.conversationId,e.rel)}catch(e){o(e instanceof Error?e.message:String(e))}},preview:(0,G.jsx)(J1,{image:i,onClose:()=>a(null)})}}function I4({path:e,children:t}){let{t:n}=K(),r=T(e=>e.contextMenuOpen.some(e=>e.enabled&&e.target===`reveal`)),{classification:i}=N4(e),a=i.kind===`local`?i.path:null,{linkContext:o,external:s,openLocal:c,preview:l}=F4(a),u=T(e=>e.projects.some(e=>e.id===o?.projectId&&e.kind===`ssh`)),d=o!==null&&a!==null&&R2(a,o.cwd)!==null,f=(0,G.jsxs)(G.Fragment,{children:[(d&&!r||!d&&s)&&!u&&(0,G.jsx)(LG,{closeOnClick:!0,onClick:()=>void c(!0),children:n(q1())}),(0,G.jsx)(LG,{closeOnClick:!0,onClick:()=>{navigator.clipboard.writeText(a??e).then(()=>RD({type:`success`,title:n(`Copied`)}),e=>RD({type:`error`,title:n(`Copy failed`),description:e instanceof Error?e.message:String(e)}))},children:n(`Copy Path`)})]});return d?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(M4,{context:o,file:a??e,extra:f,children:(0,G.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer`,onClick:()=>void c(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c(!1))},children:t})}),l]}):(0,G.jsx)(M4,{context:null,file:a??e,extra:f,children:(0,G.jsx)(`span`,{children:t})})}function L4({children:e,href:t,node:n}){let{t:r}=K(),{classification:i,line:a}=N4(t??``),{linkContext:o,external:s,openLocal:c,preview:l}=F4(i.kind===`local`?i.path:null,a),u=i.kind===`local`&&o!==null,d=u?P4(n):null,f=(0,H.useContext)(T4),p=u&&!s&&i.kind===`local`&&R2(i.path,o?.cwd)||null,m=F0(p?o:null,p,f),h=T(e=>e.openLinksInBuiltinBrowser&&ce(e.disabledBuiltinTools,e.projects,o?.projectId,`browser`))&&o&&i.kind===`external`?k2(t):null,g=e=>{if(i.kind===`external`){if(!h||!o||($D?e.metaKey:e.ctrlKey))return;let t=f0(o.conversationId,h.href);if(!t)return;e.preventDefault(),t.then(e=>{e.ok||RD({type:`error`,title:r(`Navigation failed`),description:e.error})});return}e.preventDefault(),u&&_()},_=async()=>{if(p&&o&&(await P0(o,p)).status!==`ok`){RD({type:`error`,title:r(`Could not open local file link`),description:A4(`unavailable`,r)});return}await c(!1)},v=(0,G.jsx)(`a`,{href:i.kind===`external`&&t||void 0,className:W(`text-brand underline decoration-brand/40 underline-offset-2 transition-colors hover:decoration-brand`,u&&`cursor-pointer break-all`),role:u?`link`:void 0,tabIndex:u?0:void 0,title:h?r(`{{key}}+Click to open in external browser`,{key:$D?`Cmd`:`Ctrl`}):void 0,...i.kind===`external`?{target:`_blank`,rel:`noreferrer`}:{},onClick:g,onKeyDown:e=>{u&&e.key===`Enter`&&(e.preventDefault(),_())},children:d??e});if(!u||i.kind!==`local`||!o)return v;if(!s&&m?.status!==`ok`)return d===null?(0,G.jsx)(`span`,{children:e}):p&&!m?(0,G.jsx)(`code`,{className:x4,children:d}):(0,G.jsx)(E4,{text:d});let y=s?(0,G.jsx)(M4,{context:null,file:i.path,extra:(0,G.jsx)(LG,{closeOnClick:!0,onClick:()=>void c(!0),children:r(q1())}),children:v}):(0,G.jsx)(M4,{context:o,file:i.path,children:v});return d===null?(0,G.jsxs)(`span`,{className:`inline`,children:[y,(0,G.jsx)(`button`,{type:`button`,className:`ml-1 inline-flex rounded p-0.5 align-middle text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":r(q1()),title:r(q1()),onClick:()=>void c(!0),children:(0,G.jsx)(Wt,{className:`h-3.5 w-3.5`})}),l]}):(0,G.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-0.5 rounded-[5px] border border-border/70 bg-muted/70 py-px pr-0.5 pl-1 align-baseline font-mono text-(length:--chat-inline-code-size) [font-weight:var(--chat-inline-code-weight)]`,children:[y,(0,G.jsx)(`button`,{type:`button`,className:`inline-flex shrink-0 rounded-[3px] p-0.5 text-muted-foreground hover:bg-background hover:text-foreground`,"aria-label":r(q1()),title:r(q1()),onClick:()=>void c(!0),children:(0,G.jsx)(Wt,{className:`h-3 w-3`})}),l]})}function R4(e,t,n=!0){let r=qZ(e);return r||t!==`href`?r:n&&N4(e).classification.kind===`local`?e:``}var z4=`my-2 leading-[1.625] first:mt-0 last:mb-0`;function B4({children:e}){let{t}=K(),n=(0,H.useContext)(w4),r=(0,H.useContext)(T4),i=typeof e==`string`?e:``,a=b4.test(i)||y4.test(i),{path:o,line:s}=A2(i),c=a&&n&&!(b4.test(i)&&Z1())&&R2(o,n.cwd)||null,l=F0(c?n:null,c,r);if(!a)return(0,G.jsx)(`code`,{className:x4,children:e});if(!c||!n||l?.status===`missing`)return(0,G.jsx)(E4,{text:i});if(!l)return(0,G.jsx)(`code`,{className:x4,children:e});if(l.kind===`dir`&&Z1())return(0,G.jsx)(E4,{text:i});let u=e=>RD({type:`error`,title:t(`Could not open local file link`),description:A4(e,t)}),d=async()=>{let e=await P0(n,c);if(e.status!==`ok`){u(`unavailable`);return}if(e.kind===`file`){u0(n.conversationId,e.rel,s);return}try{let t=await window.electronAPI.workspaceFiles.reveal({conversationId:n.conversationId,projectId:n.projectId,rel:e.rel});t.ok||u(t.error)}catch(e){u(e instanceof Error?e.message:String(e))}};return(0,G.jsx)(M4,{context:n,file:l.rel,children:(0,G.jsx)(`button`,{type:`button`,onClick:()=>void d(),title:i,className:`inline-flex max-w-full items-center rounded-[5px] border border-border/70 bg-muted/70 px-1 py-px align-baseline font-mono text-(length:--chat-inline-code-size) [font-weight:var(--chat-inline-code-weight)] text-brand transition-colors hover:bg-muted`,children:(0,G.jsx)(`span`,{className:`truncate`,children:i})})})}var V4=`mt-4 mb-2 text-(length:--chat-h1-size) leading-tight [font-weight:var(--chat-h1-weight)]`,H4=`mt-4 mb-2 text-(length:--chat-h2-size) leading-tight [font-weight:var(--chat-h2-weight)]`,U4=`mt-3 mb-1.5 text-(length:--chat-h3-size) leading-tight [font-weight:var(--chat-h3-weight)]`,W4=`mt-3 mb-1 text-(length:--chat-h4-size) [font-weight:var(--chat-h4-weight)]`,G4=`whitespace-nowrap border-b border-border px-2 py-1 text-left font-medium`,K4=`whitespace-nowrap border-b border-border/50 px-2 py-1`;function q4({source:e,language:t,streaming:n}){let r=(0,H.useMemo)(()=>{let r=X2(t,e);if(r===`json`){let t=Q2(e);return!n&&t.ok?{kind:r,value:t.value}:null}return r?{kind:r}:null},[t,e,n]);return r?.kind===`json`?(0,G.jsx)(z0,{source:e,value:r.value}):r?.kind===`terminal`?(0,G.jsx)(h4,{source:e}):(0,G.jsx)(h0,{code:e,language:t,streaming:n})}var J4=6;function Y4(e){return e.type===`text`?e.value:`children`in e?e.children.map(Y4).join(``):``}var X4=(e,t)=>(e?.children??[]).filter(e=>e.type===`element`&&e.tagName===t),Z4=(e,t)=>H.Children.toArray(e).filter(e=>(0,H.isValidElement)(e)&&(t===void 0||e.type===t));function Q4({children:e,sort:t,onSort:n}){return n?(0,G.jsx)(`th`,{className:G4,"aria-sort":t===`asc`?`ascending`:t===`desc`?`descending`:void 0,children:(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:`group/sort inline-flex items-center gap-1 hover:text-foreground`,children:[e,(0,G.jsx)(t===`desc`?at:st,{className:W(`h-3 w-3 shrink-0`,t===`none`?`opacity-0 group-hover/sort:opacity-40`:`opacity-70`)})]})}):(0,G.jsx)(`th`,{className:G4,children:e})}function $4({children:e,node:t}){let{t:n}=K(),{text:r,streaming:i}=(0,H.useContext)(C4),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(null),l=t?.position?.start?.offset,u=t?.position?.end?.offset,d=l!==void 0&&u!==void 0?r.slice(l,u):null,f=Z4(e),p=f.find(e=>e.type===`thead`),m=Z4(f.find(e=>e.type===`tbody`)?.props.children,`tr`),h=(0,H.useMemo)(()=>X4(t,`tbody`).flatMap(e=>X4(e,`tr`)).map(e=>e.children.filter(e=>e.type===`element`).map(Y4)),[t]),g=(0,H.useMemo)(()=>H2(h),[h]),_=!i&&p!==void 0&&h.length>=2&&m.length===h.length,v=e;if(_){let e=s?.trim().toLowerCase(),t=W2(h,a,g).filter(t=>!e||h[t].join(` `).toLowerCase().includes(e)),n=Z4(p.props.children,`tr`);v=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`thead`,{children:n.map((e,t)=>(0,H.cloneElement)(e,{key:e.key??t},Z4(e.props.children).map((e,t)=>(0,H.cloneElement)(e,{key:e.key??t,sort:a?.column===t?a.dir:`none`,onSort:()=>o(e=>G2(e,t))}))))}),(0,G.jsx)(`tbody`,{children:t.map(e=>m[e])})]})}let y=`rounded-md border bg-background/80 p-1.5 text-muted-foreground opacity-0 backdrop-blur transition-opacity group-hover/table:opacity-100`;return(0,G.jsxs)(`div`,{className:`group/table relative my-2 min-w-0 max-w-full`,children:[_&&s!==null&&(0,G.jsx)(`input`,{autoFocus:!0,type:`text`,onInput:e=>c(e.currentTarget.value),onKeyDown:e=>{e.key===`Escape`&&c(null)},placeholder:n(`Search table`),className:`mb-1 h-7 w-56 rounded-md border bg-background px-2 text-xs outline-none focus:border-ring`}),(0,G.jsx)(`div`,{className:`overflow-x-auto overscroll-x-contain [-webkit-overflow-scrolling:touch]`,children:(0,G.jsx)(`table`,{className:`w-max min-w-full border-collapse text-(length:--chat-table-size) [font-weight:var(--chat-table-weight)] leading-[1.5] [overflow-wrap:normal]`,children:v})}),d&&!i&&(0,G.jsxs)(`div`,{className:`absolute top-0.5 right-0.5 flex gap-1`,children:[_&&h.length>=J4&&(0,G.jsx)(`button`,{type:`button`,title:n(`Search table`),onClick:()=>c(e=>e===null?``:null),className:W(y,`hover:text-foreground`),children:(0,G.jsx)(Nn,{className:`h-3 w-3`})}),(0,G.jsx)(Ls,{text:d,className:y})]})]})}var e3={p:({children:e})=>(0,G.jsx)(u3,{className:z4,children:e}),a:L4,ul:({children:e})=>(0,G.jsx)(`ul`,{className:`my-2 list-disc space-y-1 pl-5 leading-[1.625] marker:text-muted-foreground [&_p]:leading-[1.625]`,children:e}),ol:({children:e})=>(0,G.jsx)(`ol`,{className:`my-2 list-decimal space-y-1 pl-5 leading-[1.625] marker:text-muted-foreground [&_p]:leading-[1.625]`,children:e}),h1:({children:e})=>(0,G.jsx)(`h1`,{className:V4,children:e}),h2:({children:e})=>(0,G.jsx)(`h2`,{className:H4,children:e}),h3:({children:e})=>(0,G.jsx)(`h3`,{className:U4,children:e}),h4:({children:e})=>(0,G.jsx)(`h4`,{className:W4,children:e}),h5:({children:e})=>(0,G.jsx)(`h5`,{className:W4,children:e}),h6:({children:e})=>(0,G.jsx)(`h6`,{className:W4,children:e}),blockquote:({children:e,node:t})=>{let{t:n}=K(),r=t?.properties,i=_4[String(r?.dataAlert??r?.[`data-alert`]??``)];return i?(0,G.jsxs)(`blockquote`,{className:W(`my-1.5 border-l-2 pl-3`,i.border),children:[(0,G.jsx)(`p`,{className:W(`mt-1.5 mb-0.5 text-xs font-semibold`,i.text),children:n(i.label)}),e]}):(0,G.jsx)(`blockquote`,{className:`my-2 border-l-2 border-brand/30 pl-3 text-muted-foreground`,children:e})},code:B4,pre:({node:e})=>{let{streaming:t}=(0,H.useContext)(C4),n=e?.children?.[0],r=n&&`properties`in n?n.properties:void 0,i=/language-(\S+)/.exec(r?.className?.join(` `)??``)?.[1],a=n&&`children`in n?n.children?.[0]:void 0,o=(a&&`value`in a?String(a.value):``).replace(/\n$/,``),s=g4(i),c=Ite(s);return c?(0,G.jsx)(Hte,{pluginId:c.pluginId,lang:c.lang,source:o}):s?.toLowerCase()===`mermaid`?(0,G.jsx)(T2,{code:o,streaming:t}):(0,G.jsx)(q4,{source:o,language:s,streaming:t})},table:$4,th:Q4,td:({children:e})=>(0,G.jsx)(`td`,{className:K4,children:e}),hr:()=>(0,G.jsx)(`hr`,{className:`my-3 border-border`})},t3=new Set([`blockquote`,`div`,`dl`,`figure`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`li`,`ol`,`p`,`pre`,`table`,`ul`]),n3=`mt-2 mb-0 leading-[1.625] first:mt-0`,r3=`empty:hidden whitespace-normal`;function i3(e){return e.type===`element`&&t3.has(e.tagName)}function a3(e,t,n){let r,i;for(let t of e?.children??[]){if(i3(t))break;let e=t.position?.start?.offset,n=t.position?.end?.offset;e!=null&&n!=null&&(r??=e,i=n)}if(r==null||i==null)return null;let a=t.slice(r,i);if(!a.trim())return null;let o=e?.position?.end?.offset??i;return{source:a,final:!n||o<t.trimEnd().length}}function o3(e,t){let n=0;for(let r of e)if(!(t&&r.type===`text`&&!r.value.trim())){if(i3(r))return n;n+=1}return null}function s3(e){let{text:t,streaming:n,leafSlot:r}=(0,H.useContext)(C4);if(!r)return null;let i=a3(e,t,n);return i?{...i,messageIndex:r.messageIndex,sessionId:r.sessionId,entry:r.entry}:null}function c3({text:e}){return(0,G.jsx)(x3,{text:e})}function l3({leaf:e}){return(0,G.jsx)(`div`,{className:r3,children:(0,G.jsx)(Vte,{entry:e.entry,source:e.source,final:e.final,messageIndex:e.messageIndex,sessionId:e.sessionId,Markdown:c3})})}function u3({children:e,className:t}){let{searchQuery:n,activeNth:r}=(0,H.useContext)(C4);return(0,G.jsx)(`p`,{className:t,children:n.trim()?uU(e,n,r,{n:0}):e})}function d3({children:e,node:t}){let n=s3(t);return n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(u3,{className:n3,children:e}),(0,G.jsx)(l3,{leaf:n})]}):(0,G.jsx)(u3,{className:z4,children:e})}function f3(e,t){return function({children:n,node:r}){let i=s3(r),a=(0,G.jsx)(e,{className:t,children:n});return i?(0,G.jsxs)(G.Fragment,{children:[a,(0,G.jsx)(l3,{leaf:i})]}):a}}function p3({tag:e,className:t,children:n,node:r}){let i=s3(r),a=e;if(!i)return(0,G.jsx)(a,{className:t,children:n});let o=o3(r?.children??[],e!==`li`),s=H.Children.toArray(n);return(0,G.jsxs)(a,{className:t,children:[o==null?s:s.slice(0,o),(0,G.jsx)(l3,{leaf:i}),o==null?null:s.slice(o)]})}var m3=f3(`h1`,V4),h3=f3(`h2`,H4),g3=f3(`h3`,U4),_3=f3(`h4`,W4),v3=f3(`h5`,W4),y3=f3(`h6`,W4),b3={...e3,p:d3,h1:m3,h2:h3,h3:g3,h4:_3,h5:v3,h6:y3,li:({children:e,node:t,className:n})=>(0,G.jsx)(p3,{tag:`li`,className:n,node:t,children:e}),th:({children:e,node:t})=>(0,G.jsx)(p3,{tag:`th`,className:G4,node:t,children:e}),td:({children:e,node:t})=>(0,G.jsx)(p3,{tag:`td`,className:K4,node:t,children:e})};function x3({text:e,streaming:t=!1,searchQuery:n=``,activeNth:r=-1,leafSlot:i=null}){let a=(0,H.useContext)(w4)!==null,[o,s]=O4(a),c=k4(e,t),l=s&&c,u=(0,H.useMemo)(()=>({text:e,streaming:t,searchQuery:n,activeNth:r,...i?{leafSlot:i}:{}}),[e,t,n,r,i]),d=(0,H.useMemo)(()=>(e,t)=>R4(e,t,a),[a]);return(0,G.jsx)(C4.Provider,{value:u,children:(0,G.jsx)(T4.Provider,{value:l,children:(0,G.jsx)(`div`,{ref:o,className:W(`[font-weight:var(--chat-body-weight)]`,t&&`t-stream-live`),children:(0,G.jsx)(UZ,{remarkPlugins:S4,components:i?b3:e3,urlTransform:d,children:e})})})})}function S3({leaf:e,...t}){xO();let n=Nte(),r=(0,H.useMemo)(()=>n?{messageIndex:e.messageIndex,sessionId:e.sessionId,entry:n}:null,[n,e.messageIndex,e.sessionId]);return(0,G.jsx)(x3,{...t,leafSlot:r})}function C3({text:e,streaming:t=!1,searchQuery:n=``,activeNth:r=-1,leaf:i}){return i?(0,G.jsx)(S3,{text:e,streaming:t,searchQuery:n,activeNth:r,leaf:i}):(0,G.jsx)(x3,{text:e,streaming:t,searchQuery:n,activeNth:r})}function w3(e){let t=(e.split(`
261
+ `).map(e=>e.replace(/^[#>\-*\s]+/u,``).trim()).find(Boolean)??``).replace(/\s+/gu,` `);return t.length>60?`${t.slice(0,60)}…`:t}function T3({message:e}){let{t}=K(),n=e.username?`@${e.username}`:``;return(0,G.jsxs)(`div`,{"data-telegram-inbound":e.channel,className:`w-full rounded-lg border border-border/60 bg-muted/20 px-3 py-2 text-sm`,children:[(0,G.jsxs)(`details`,{className:`group`,children:[(0,G.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,G.jsx)(Pn,{className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`shrink-0`,children:e.channel===`telegram`?t(`From Telegram`):t(`From {{name}}`,{name:e.title})}),n&&(0,G.jsx)(`span`,{className:`shrink-0 text-foreground`,children:n}),e.time&&(0,G.jsxs)(`span`,{className:`shrink-0`,children:[`· `,e.time]}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-normal group-open:hidden`,children:w3(e.body)})]}),(0,G.jsx)(`div`,{className:`mt-1.5 break-words`,children:(0,G.jsx)(C3,{text:e.body})})]}),e.imageLines&&(0,G.jsx)(`div`,{className:`mt-1.5`,children:(0,G.jsx)(UG,{entries:e.imageLines,align:`start`})})]})}var E3=H.createContext(void 0);function D3(e){let t=H.useContext(E3);if(t===void 0&&!e)throw Error(xr(47));return t}var O3={...eT,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},k3=class extends Aw{constructor(e,t,n){let r=new qw;super(A3(e,r,t,n),j3(r),O3)}setOpen=(e,t)=>{let n=t.reason===qy,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Vw(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};Bw(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),qs.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function A3(e,t,n,r=!1){let i={...Jw(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i.floatingRootContext=Yw(t,n,r),i}function j3(e){return{popupRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:H.createRef(),beforeContentFocusGuardRef:H.createRef(),stickIfOpenTimeout:new ub,triggerElements:e}}function M3({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=P3(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Kw(u,d),Uw(u);let{forceUnmount:m}=Ww(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),H.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),H.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,tb(eb))}),[m,u]);let h=d||f;return(0,G.jsxs)(E3.Provider,{value:u,children:[s&&(0,G.jsx)(zw,{handle:s,store:u}),h&&(0,G.jsx)(F3,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function N3(e){return D3(!0)?(0,G.jsx)(M3,{props:e}):(0,G.jsx)(QS,{children:(0,G.jsx)(M3,{props:e})})}function P3(e,t){let n=Rw((e,n)=>new k3(t,e,n));return H.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function F3({store:e,modal:t}){let n=fC(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Gw(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var I3=H.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=D3(!0),h=tT(s)??m;if(!h)throw Error(xr(74));let g=ob(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=H.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=Hw(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),O=pT(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:AT(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=lC(v,{stickIfOpen:T}),A=sE(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=Uy({disabled:a,native:o}),P={open(e){return e&&w===`trigger-press`?cy.open(e):sy.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:I,handleFocusTargetFocus:ee}=yM(h,x),L=zr(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,O,j,A,{[FS]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),te=(0,G.jsx)(H.Fragment,{children:L},g);return C&&!D?(0,G.jsxs)(H.Fragment,{children:[(0,G.jsx)(dx,{ref:F,onFocus:I}),te,(0,G.jsx)(dx,{ref:h.context.triggerFocusTargetRef,onFocus:ee})]}):te}),L3=H.createContext(void 0);function R3(){let e=H.useContext(L3);if(e===void 0)throw Error(xr(45));return e}var z3=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return D3().useState(`mounted`)||n?(0,G.jsx)(L3.Provider,{value:n,children:(0,G.jsx)(US,{ref:t,...r})}):null}),B3=H.createContext(void 0);function V3(){let e=H.useContext(B3);if(!e)throw Error(xr(46));return e}var H3=H.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=LS,..._}=e,v=D3(),y=R3(),b=XS(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=H.useRef(null),N=Pw(O),P=jD({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j}),F=x.useState(`domReferenceElement`);Y(()=>{let e=F,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,N,v]);let I=E===!0&&w!==`trigger-hover`;tM(C&&I,D===`touch`,O,T);let ee=v.useStateSetter(`positionerElement`),L=FD(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,ee],hidden:!S,inert:!C});return(0,G.jsxs)(B3.Provider,{value:P,children:[S&&I&&(0,G.jsx)(LT,{inert:IT(!C),cutout:T}),(0,G.jsx)(ZS,{id:b,children:L})]})}),U3=H.createContext(void 0);function W3(){let[e,t]=H.useState(0),n=zy(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:H.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var G3=H.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=D3(),l=V3(),u=Hj(!0)!=null,{context:d,hasClosePart:f}=W3(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Fw({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),dT(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Lw(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=zr(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Iw,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&NT.has(e.key)&&e.stopPropagation()}},PD(g),s],stateAttributesMapping:uy});return(0,G.jsx)(cC,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:vy(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(U3.Provider,{value:d,children:M})})}),K3=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=D3(),{side:c}=V3(),l=s.useState(`instantType`),{children:u,state:d}=PM({store:s,side:c,children:a});return zr(`div`,e,{state:{activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l},ref:t,props:[o,{children:u}],stateAttributesMapping:NM})}),q3=N3;function J3(e){return(0,G.jsx)(I3,{"data-slot":`popover-trigger`,...e})}function Y3({children:e,className:t,positionerClassName:n,side:r=`bottom`,align:i=`center`,sideOffset:a=4,alignOffset:o=0,tooltipStyle:s=!1,...c}){return(0,G.jsx)(z3,{children:(0,G.jsx)(H3,{align:i,alignOffset:o,className:W(`z-50 h-(--positioner-height) max-h-(--available-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,n),"data-slot":`popover-positioner`,side:r,sideOffset:a,children:(0,G.jsx)(G3,{className:W(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-lg border bg-popover bg-clip-padding text-popover-foreground shadow-lg transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,s&&`w-fit text-balance rounded-md text-xs shadow-black/5 shadow-md before:rounded-[calc(var(--radius-md)-1px)]`,t),"data-slot":`popover-popup`,...c,children:(0,G.jsx)(K3,{className:W(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 outline-none [--viewport-inline-padding:--spacing(4)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,s?`py-1 [--viewport-inline-padding:--spacing(2)]`:`not-data-transitioning:overflow-y-auto`),"data-slot":`popover-viewport`,children:e})})})})}var X3=new Map,Z3;function Q3(e){if(Z3?.revision===e)return Z3.request;let t=window.electronAPI.providers.listOauth().then(t=>{let n=new Map;for(let e of t)for(let t of e.accounts){if(typeof t.email!=`string`)continue;let e=``;for(let n of t.email){let t=n.codePointAt(0)??0;t>=32&&t!==127&&(e+=n)}e=e.trim(),e&&n.set(t.key,e)}return{revision:e,emails:n}}).catch(t=>(console.error(`Failed to load OAuth account metadata`,t),{revision:e,emails:X3})),n={revision:e,request:t,data:void 0};return Z3=n,t.then(e=>{Z3===n&&(n.data=e)}),t}function $3(){let e=hR(e=>e.snapshot.revision),[t,n]=(0,H.useState)(()=>Z3?.revision===e?Z3.data:void 0);return(0,H.useEffect)(()=>{let t=!1;return Q3(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t?.revision===e?t.emails:X3}function e6(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function t6(e,t,n){return`${e}:${e6(t)}:${e6(n,1)}`}var n6=/(?:\x1b\]|\x9d)[^\x07\x1b\x9c]*(?:\x07|\x1b\\|\x9c|$)/g,r6=/(?:\x1b\[|\x9b)[0-?]*[ -/]*(?:[@-~]|$)/g;function i6(e){return e.replace(n6,``).replace(r6,``)}var a6=SN()(e=>({conversationId:null,result:null,tab:`session`,from:null,open:(t,n,r)=>e({conversationId:t,result:n??null,tab:n?`result`:`session`,from:r??null}),setTab:t=>e({tab:t}),close:()=>e({conversationId:null,result:null,tab:`session`,from:null})})),o6=SN()(()=>({back:null}));function s6(e){return ZN.getState().conversations[e]?.parentId??e}function c6(e){let t=ZN.getState().conversations[e]?.projectId;return T.getState().projects.some(e=>e.id===t&&e.kind===`secretary`)}var l6=!1;function u6(){l6||(l6=!0,ZN.subscribe((e,t)=>{if(e.activeId===t.activeId)return;let{back:n}=o6.getState();n&&(!e.activeId||s6(e.activeId)!==n.to)&&o6.setState({back:null})}))}function d6(e,t){let n=ZN.getState();if(!n.conversations[e])return;let r=t??n.activeId,i=r?s6(r):null,a=s6(e);u6(),a6.getState().close(),n.selectConversation(e),o6.setState({back:i&&i!==a&&c6(i)&&!c6(a)?{from:i,to:a}:null})}var f6=`
262
+ …`;function p6(e){return e.length>=32768&&e.endsWith(f6)?e.slice(0,-2):null}function m6(e){return!!(e?.role===`user`&&e.optimistic&&e.deliveryRejected&&e.deliveryId&&!e.entryId)}function h6(e){return!!(e?.role===`user`&&e.optimistic&&!e.deliveryRejected&&!e.withdrawRequested&&e.deliveryId&&!e.entryId)}var g6=SN(e=>({byConversation:{},replace:(t,n)=>e(e=>{let r={...e.byConversation};if(n.length>0)r[t]=n;else if(r[t])delete r[t];else return e;return{byConversation:r}})}));function _6(e){let t=e.toLowerCase();return t.startsWith(`image/`)?`image`:t.startsWith(`text/`)||t===`application/json`||t===`application/javascript`||t===`application/xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)?`text`:`file`}function v6(e){return!Number.isFinite(e)||e<1024?`${Math.max(0,Math.round(e))} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}async function y6(e){if(!window.electronAPI.remote){let t=await window.electronAPI.extensionPlugins.artifactSave(e.id);return t.ok?null:t.error}let t=await window.electronAPI.extensionPlugins.artifactRead(e.id);if(!t.ok)return t.error;let n=Uint8Array.from(atob(t.base64),e=>e.charCodeAt(0)),r=URL.createObjectURL(new Blob([n],{type:e.mime||`application/octet-stream`})),i=document.createElement(`a`);return i.href=r,i.download=e.name,i.click(),URL.revokeObjectURL(r),null}function b6({artifact:e,onDelete:t}){let[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(!1),c=_6(e.mime),l=async()=>{s(!0),a(null);let t=await window.electronAPI.extensionPlugins.artifactRead(e.id);if(s(!1),!t.ok){a(t.error),r(null);return}if(c===`image`){r({kind:`image`,body:`data:${t.info.mime};base64,${t.base64}`});return}if(c===`text`){r({kind:`text`,body:Q1(t.base64)});return}r(null),a(`这个文件不能在这里预览`)};return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:[e.name,(0,G.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[e.mime,` · `,v6(e.size)]})]}),c!==`file`&&(0,G.jsx)(Ea,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>void l(),children:`预览`}),(0,G.jsx)(Ea,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>{s(!0),y6(e).then(e=>{s(!1),a(e)})},children:window.electronAPI.remote?`下载`:`另存`}),t&&(0,G.jsx)(Ea,{size:`sm`,variant:`ghost`,onClick:()=>t(e.id),children:`删除`})]}),i&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:i}),n?.kind===`text`&&(0,G.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-all font-mono text-muted-foreground text-xs`,children:n.body}),n?.kind===`image`&&(0,G.jsx)(`img`,{src:n.body,alt:e.name,className:`max-h-48 max-w-full rounded border object-contain`})]})}function x6({artifacts:e,onDelete:t}){return e.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`还没有产出文件`}):(0,G.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,G.jsx)(b6,{artifact:e,onDelete:t},e.id))})}function S6({artifacts:e,align:t=`tool-row`}){return(0,G.jsxs)(`div`,{className:W(`mt-1 mb-1.5 rounded-lg border border-border/70 bg-card px-3 py-2`,t===`card`?`w-full`:`ml-[30px]`),children:[(0,G.jsx)(`p`,{className:`mb-1 text-[11px] text-muted-foreground`,children:`产出文件`}),(0,G.jsx)(x6,{artifacts:e})]})}var C6={},w6=new Set,T6=new Map;function E6(e){return w6.add(e),()=>w6.delete(e)}function D6(e,t){let n=`${e}\0${t}`,r=T6.get(n);return r||(r=window.electronAPI.extensionPlugins.asset(e,t).then(e=>e.ok?`data:${e.mime};base64,${e.base64}`:null).catch(()=>null),r.then(e=>e===null&&T6.delete(n)),T6.set(n,r)),r}function O6({pluginId:e,icon:t,className:n}){let r=(0,H.useSyncExternalStore)(E6,()=>C6[e]),i=t??r,[a,o]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(o(null),!i)return;let t=!0;return D6(e,i).then(e=>t&&o(e)),()=>{t=!1}},[e,i]),a?(0,G.jsx)(`img`,{src:a,alt:``,className:W(`object-contain`,n)}):(0,G.jsx)(Dn,{className:n})}var k6={read_only:`Read-only`,regenerable:`Regenerable output`,reversible_workspace_change:`Reversible workspace change`,data_loss:`Possible data loss`,system_state:`Changes system state`,exfiltration:`Sends data externally`,unclear_target:`Unclear target or intent`};function A6({value:e}){let t=Ce(e),{t:n}=K();if(!t)return null;let r=`allow ${t.allow.toFixed(2)} · ask ${t.ask.toFixed(2)} · block ${t.block.toFixed(2)}`;return(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 border-border/60 border-t px-3 py-1 text-[10px] text-muted-foreground`,"data-approval-review":t.verdict,children:[(0,G.jsx)(`span`,{className:`font-semibold tracking-wide text-foreground/75`,children:t.verdict===`allow`?n(`Auto-managed · allowed`):n(`Auto-managed · denied`)}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{className:`font-mono`,children:t.model}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{className:`font-mono`,children:r}),t.reason&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{children:[n(`Reason`),`: `,n(k6[t.reason])]})]})]})}function j6({ask:e,waiting:t}){let{t:n}=K(),r=e.answer!==null&&!e.options.includes(e.answer)?e.answer:null;return(0,G.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2 text-xs`,children:[(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words leading-relaxed text-foreground`,children:e.question}),(e.options.length>0||r!==null)&&(0,G.jsxs)(`ul`,{className:`space-y-0.5`,children:[e.options.map(t=>(0,G.jsx)(M6,{selected:t===e.answer,text:t},t)),r!==null&&(0,G.jsx)(M6,{selected:!0,text:r,label:e.options.length>0&&!e.autoSelected?n(`Custom answer`):void 0})]}),e.autoSelected&&(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:n(`No answer in time; the default was selected`)}),t&&e.answer===null&&(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:n(`Waiting for your answer`)})]})}function M6({selected:e,text:t,label:n}){let{t:r}=K(),i=e?St:Dt;return(0,G.jsxs)(`li`,{"data-selected":e||void 0,className:W(`flex items-start gap-1.5 rounded-md px-2 py-1 leading-relaxed`,e?`bg-primary/10 text-foreground`:`text-muted-foreground`),children:[(0,G.jsx)(i,{className:W(`mt-0.5 h-3.5 w-3.5 shrink-0`,e?`text-primary`:`opacity-40`)}),(0,G.jsxs)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words`,children:[n&&(0,G.jsx)(`span`,{className:`mr-1.5 text-muted-foreground`,children:n}),t]}),e&&(0,G.jsx)(`span`,{className:`sr-only`,children:r(`Selected`)})]})}var N6=/^Subagent ".*" \(agentId [^,\s]+, runId [^)\s]+\) \S+ after .+\.$/gm,P6=/^The following is the subagent's report: .*$\n?/m,F6=/<usage>([\s\S]*?)<\/usage>/,I6=/^Background tasks this subagent started\b.*\n((?:- .*(?:\n|$))+)/m,L6=(e,t)=>{let n=RegExp(`^${t}: (\\d+)$`,`m`).exec(e);return n?Number(n[1]):null};function R6(e){let t=e.indexOf(`
263
+ `),n=t<0?e:e.slice(0,t),r=t<0?``:e.slice(t+1),i=null,a=[],o=F6.exec(r);if(o){let e=I6.exec(r.slice(o.index+o[0].length));e&&(a=e[1].split(`
264
+ `).filter(e=>e.startsWith(`- `)).map(e=>e.slice(2))),r=r.slice(0,o.index);let t=L6(o[1],`subagent_tokens`),n=L6(o[1],`tool_uses`),s=L6(o[1],`duration_ms`);t!==null&&n!==null&&s!==null&&(i={tokens:t,toolUses:n,durationMs:s})}return{header:n,report:r.replace(P6,``).trim(),usage:i,...a.length>0?{tasks:a}:{}}}function z6(e){let t=e.trim(),n=[...t.matchAll(N6)].map(e=>e.index);return n[0]===0?n.map((e,r)=>R6(t.slice(e,n[r+1]).replace(/\n+---\s*$/,``).trim())):null}function B6(e){return tE(`alert-dialog`,e)}function V6(e){return aD(e.open??!1),(0,G.jsx)(B6,{...e})}var H6=RT;function U6({className:e,style:t,...n}){return(0,G.jsx)(dy,{className:W(`fixed inset-0 bg-black/32 backdrop-blur-sm transition-all duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,e),style:t,"data-slot":`alert-dialog-backdrop`,...n})}function W6({className:e,style:t,...n}){return(0,G.jsx)(rE,{className:W(`fixed inset-0 grid grid-rows-[1fr_auto] justify-items-center pt-6 sm:grid-rows-[1fr_auto_3fr] sm:p-4`,e),style:t,"data-slot":`alert-dialog-viewport`,...n})}function G6({className:e,showBackdrop:t=!0,zIndexLevel:n=`base`,...r}){let i=n===`nested`?oD.NESTED_MODAL_BACKDROP:oD.MODAL_BACKDROP,a=n===`nested`?oD.NESTED_MODAL_CONTENT:oD.MODAL_CONTENT,o=n===`nested`?oD.DROPDOWN_IN_NESTED_MODAL:oD.DROPDOWN_IN_MODAL;return(0,G.jsxs)(H6,{children:[(0,G.jsx)(XE,{}),t&&(0,G.jsx)(U6,{style:{zIndex:i}}),(0,G.jsx)(W6,{style:{zIndex:a},children:(0,G.jsx)(sD.Provider,{value:o,children:(0,G.jsx)(FT,{className:W(`sm:-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 grid max-h-full w-full min-w-0 border-t bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-nested-dialog-open:origin-top data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden sm:max-w-lg sm:data-nested:data-ending-style:translate-y-8 sm:data-nested:data-starting-style:translate-y-8 sm:scale-[calc(1-0.1*var(--nested-dialogs))] sm:rounded-2xl sm:border sm:data-ending-style:scale-98 sm:data-starting-style:scale-98 sm:before:rounded-[calc(var(--radius-2xl)-1px)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,e),"data-slot":`alert-dialog-popup`,...r})})})]})}function K6({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`flex flex-col gap-2 p-6 not-has-[+[data-slot=alert-dialog-footer]]:pb-4 text-center max-sm:pb-4 sm:text-left`,e),"data-slot":`alert-dialog-header`,...t})}function q6({className:e,variant:t=`default`,...n}){return(0,G.jsx)(`div`,{className:W(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,t==="default"&&`border-t bg-muted/50 py-4`,t===`bare`&&`pt-4 pb-6`,e),"data-slot":`alert-dialog-footer`,...n})}function J6({className:e,...t}){return(0,G.jsx)(iE,{className:W(`font-heading text-xl leading-none`,e),"data-slot":`alert-dialog-title`,...t})}function Y6({className:e,...t}){return(0,G.jsx)(sb,{className:W(`text-muted-foreground text-sm`,e),"data-slot":`alert-dialog-description`,...t})}function X6(e){return(0,G.jsx)(nb,{"data-slot":`alert-dialog-close`,...e})}function Z6({open:e,onOpenChange:t,title:n,description:r,confirmLabel:i,cancelLabel:a,onConfirm:o,zIndexLevel:s}){let{t:c}=K();return(0,G.jsx)(V6,{open:e,onOpenChange:t,children:(0,G.jsxs)(G6,{className:`sm:max-w-sm`,zIndexLevel:s,children:[(0,G.jsxs)(K6,{children:[(0,G.jsx)(J6,{className:`text-base`,children:n}),r&&(0,G.jsx)(Y6,{children:r})]}),(0,G.jsxs)(q6,{variant:`bare`,children:[(0,G.jsx)(X6,{render:(0,G.jsx)(Ea,{variant:`outline`,size:`sm`}),children:a??c(`Cancel`)}),(0,G.jsx)(Ea,{variant:`destructive`,size:`sm`,onClick:()=>{o(),t(!1)},children:i})]})]})})}function Q6(e,t){return!e||e<=0||t===void 0||t>=e?null:Math.round((1-t/e)*100)}function $6({hits:e,defaultOpen:t=!1}){let{t:n}=K();return e.length===0?(0,G.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:n(`No results`)}):(0,G.jsx)(`ul`,{className:`divide-y divide-border/60`,children:e.map(e=>(0,G.jsx)(t8,{hit:e,defaultOpen:t},e.id))})}function e8({view:e}){let{t}=K(),n=e.written?e.deduplicated&&t(`Identical memory already exists, nothing new was written`):t(`Similar memories already exist, nothing was written`);return(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsx)(`p`,{className:`px-3 pt-2 text-xs text-muted-foreground`,children:n}),e.written?(0,G.jsx)($6,{hits:[e.memory],defaultOpen:!0}):(0,G.jsx)($6,{hits:e.candidates})]})}function t8({hit:e,defaultOpen:t}){let{t:n}=K(),[r,i]=(0,H.useState)(t);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:e=>{let t=window.getSelection();t?.toString()&&e.currentTarget.contains(t.anchorNode)||i(e=>!e)},className:`block w-full cursor-pointer px-3 py-2 text-left transition-colors hover:bg-muted/40`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1 font-medium text-foreground text-xs`,r?`break-words`:`truncate`),children:e.title}),e.unitType&&(0,G.jsx)(nj,{variant:`secondary`,size:`sm`,children:e.unitType}),e.space&&(0,G.jsx)(nj,{variant:`outline`,size:`sm`,children:n(e.space===`global`?`Global`:`Project`)}),e.relevance!==null&&(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,title:n(`Semantic similarity`),children:e.relevance.toFixed(2)})]}),(0,G.jsx)(`span`,{className:W(`mt-0.5 whitespace-pre-wrap break-words text-muted-foreground text-xs leading-relaxed`,r?`block`:`line-clamp-2`),children:e.content})]})})}var n8=H.createContext(void 0);function r8(e){let t=H.useContext(n8);if(t===void 0&&!e)throw Error(xr(50));return t}var i8={...eT,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay},a8=class extends Aw{constructor(e,t,n){let r=new qw;super(o8(e,r,t,n),s8(r),i8)}setOpen=(e,t)=>{let{inlineRectCoordsRef:n}=this.context;xte(this,e,t,{onBeforeDispatch(){let r=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in r&&`clientY`in r&&n.current?.element!==t.trigger&&Sw(n,t.trigger,r.clientX,r.clientY)}})}};function o8(e,t,n,r=!1){let i={...Jw(),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e};return i.floatingRootContext=Yw(t,n,r),i}function s8(e){return{popupRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}function c8(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:o,triggerId:s,defaultTriggerId:c=null,children:l}=e,u=Rw((e,r)=>new a8({open:n,openProp:t,activeTriggerId:c,triggerIdProp:s},e,r));u.useControlledProp(`openProp`,t),u.useControlledProp(`triggerIdProp`,s),u.useContextCallback(`onOpenChange`,r),u.useContextCallback(`onOpenChangeComplete`,i);let d=u.useState(`open`),f=u.useState(`activeTriggerId`),p=u.useState(`mounted`),m=u.useState(`payload`);Uw(u,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:h}=Ww(d,u,()=>{u.context.inlineRectCoordsRef.current=void 0});Y(()=>{d&&(f??u.set(`payload`,void 0))},[u,f,d]),H.useImperativeHandle(a,()=>({unmount:h,close:()=>u.setOpen(!1,tb(eb))}),[h,u]);let g=d||p;return(0,G.jsxs)(n8.Provider,{value:u,children:[o&&(0,G.jsx)(zw,{handle:o,store:u}),g&&(0,G.jsx)(l8,{store:u}),typeof l==`function`?l({payload:m}):l]})}function l8({store:e}){let t=fC(e.useState(`floatingRootContext`));return Gw(e,{activeTriggerProps:t.reference,inactiveTriggerProps:t.trigger,popupProps:t.floating}),null}var u8=Ew(function(e){return r8(!0)?(0,G.jsx)(c8,{...e}):(0,G.jsx)(QS,{children:(0,G.jsx)(c8,{...e})})}),d8=H.createContext(void 0);function f8(){let e=H.useContext(d8);if(e===void 0)throw Error(xr(48));return e}var p8=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return r8().useState(`mounted`)||n?(0,G.jsx)(d8.Provider,{value:n,children:(0,G.jsx)(SD,{ref:t,...r})}):null}),m8=Dw(function(e,t){let{render:n,className:r,delay:i,closeDelay:a,id:o,payload:s,handle:c,style:l,...u}=e,d=r8(!0),f=tT(c)??d;if(!f)throw Error(xr(89));let p=ob(o),m=f.useState(`isTriggerActive`,p),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`floatingRootContext`),_=f.context.inlineRectCoordsRef,v=H.useRef(null),y=i??600,b=a??300,{registerTrigger:x,isMountedByThisTrigger:S}=Hw(p,v,f,{payload:s,closeDelay:b}),C=pT(g,{mouseOnly:!0,move:!1,handleClose:AT(),delay:()=>({open:y,close:b}),triggerElementRef:v,isActiveTrigger:m,isClosing:()=>f.select(`transitionStatus`)===`ending`}),w=aT(g,{delay:y}),T={open:h},E=f.useState(`triggerProps`,S),D=ate(_,h);return zr(`a`,e,{state:T,ref:[t,x,v],props:[C,w.reference,E,D,{id:p},u],stateAttributesMapping:sy})}),h8=H.createContext(void 0);function g8(){let e=H.useContext(h8);if(e===void 0)throw Error(xr(49));return e}var _8=H.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=LS,style:g,..._}=e,v=r8(),y=f8(),b=XS(),x=v.useState(`open`),S=v.useState(`mounted`),C=v.useState(`floatingRootContext`),w=v.useState(`instantType`),T=v.useState(`transitionStatus`),E=v.useState(`adaptiveOrigin`),D=v.context.inlineRectCoordsRef,O=jD({anchor:i,floatingRootContext:C,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:E,inline:ote(D)}),k=O.update;Y(()=>{x&&S&&k()},[x,S,k]);let A=FD(e,{open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:w},{styles:O.positionerStyles,transitionStatus:T,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!S,inert:!x});return(0,G.jsx)(h8.Provider,{value:O,children:(0,G.jsx)(ZS,{id:b,children:A})})}),v8=H.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=r8(),{side:s,align:c}=g8(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`closeDelay`);return Fw({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),dT(p,{closeDelay:m}),zr(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[Iw,f,PD(d),a],stateAttributesMapping:uy})}),y8=u8;function b8({...e}){return(0,G.jsx)(m8,{"data-slot":`preview-card-trigger`,...e})}function x8({className:e,children:t,align:n=`center`,sideOffset:r=4,...i}){return(0,G.jsx)(p8,{children:(0,G.jsx)(_8,{align:n,className:`z-50`,"data-slot":`preview-card-positioner`,sideOffset:r,children:(0,G.jsx)(v8,{className:W(`relative flex w-64 origin-(--transform-origin) text-balance rounded-lg border bg-popover bg-clip-padding p-4 text-popover-foreground text-sm shadow-lg transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,e),"data-slot":`preview-card-content`,...i,children:t})})})}var S8={mask:`text-sky-600 dark:text-sky-400`,warn:`text-amber-600 dark:text-amber-400`,block:`text-red-600 dark:text-red-400`},C8={mask:Ln,warn:Fn,block:In},w8={mask:`Mask`,warn:`Warn only`,block:`Block`},T8={system:`System prompt`,user:`Your message`,tool_result:`Tool output`,tool_args:`Tool arguments`,assistant:`Earlier replies`,tools:`Tool descriptions`};function E8({report:e}){let{t}=K(),n=x(e);if(!n)return null;let r=C8[n],i=new Set(e.hits.map(e=>e.token)).size;return(0,G.jsxs)(y8,{children:[(0,G.jsxs)(b8,{render:(0,G.jsx)(`span`,{className:W(`inline-flex shrink-0 items-center gap-0.5 text-[11px]`,S8[n]),"data-privacy-mask":n}),children:[(0,G.jsx)(r,{className:`size-3.5`}),(0,G.jsx)(`span`,{className:`tabular-nums`,children:i})]}),(0,G.jsxs)(x8,{className:`max-h-(--available-height) w-72 flex-col overflow-y-auto overscroll-contain text-xs`,children:[(0,G.jsx)(`p`,{className:`mb-1.5 font-medium`,children:t(`Privacy masking`)}),(0,G.jsx)(`ul`,{className:`space-y-1`,children:m(e.hits).map(e=>(0,G.jsxs)(`li`,{className:`flex flex-wrap gap-x-2`,children:[(0,G.jsx)(`span`,{className:S8[e.action],children:t(w8[e.action])}),(0,G.jsx)(`span`,{children:e.kind}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:t(T8[e.where]??e.where)}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e.values>1?t(`{{count}} values`,{count:e.values}):e.preview}),e.count>1&&(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`×`,e.count]})]},`${e.action}-${e.kind}-${e.where}`))}),e.restored>0&&(0,G.jsx)(`p`,{className:`mt-1.5 text-muted-foreground`,children:t(`Restored {{count}} in the reply`,{count:e.restored})})]})]})}function D8(e){let{inputTokens:t,outputTokens:n}=e;if(typeof t!=`number`||!Number.isFinite(t)||t<0||typeof n!=`number`||!Number.isFinite(n)||n<0)return null;let r=Math.max(0,t-n);return{tokens:r,percent:t>0?Math.round(r/t*100):null}}var O8={compressed:`Compressed`,unchanged:`Unchanged`,pending:`Background task started`,bypassed:`Bypassed`,unavailable:`Unavailable`};function k8({value:e}){let t=re(e),{t:n}=K();if(!t)return null;let r=D8(t);return(0,G.jsxs)(`div`,{className:`border-border/60 border-t text-[10px] text-muted-foreground`,"data-rtk-status":t.status,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 px-3 py-1`,children:[(0,G.jsx)(`span`,{className:`font-semibold tracking-wide text-foreground/75`,children:`RTK`}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:n(O8[t.status])}),r&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:n(`~{{count}} tokens saved`,{count:CN(r.tokens)})}),r.percent!==null&&(0,G.jsxs)(`span`,{children:[`(`,r.percent,`%)`]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-2 px-3 pb-2`,children:[t.status===`pending`&&(0,G.jsx)(`p`,{className:`rounded bg-muted/40 px-2 py-1 text-foreground/80`,children:n(`This is the startup receipt; see the task_output result for final statistics.`)}),(t.inputTokens!==void 0||t.reason)&&(0,G.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1`,children:[t.inputTokens!==void 0&&t.outputTokens!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:n(`Input estimate`)}),(0,G.jsx)(`dd`,{className:`font-mono text-foreground/80`,children:n(`{{count}} tokens`,{count:CN(t.inputTokens)})}),(0,G.jsx)(`dt`,{children:n(`Output estimate`)}),(0,G.jsx)(`dd`,{className:`font-mono text-foreground/80`,children:n(`{{count}} tokens`,{count:CN(t.outputTokens)})})]}),t.reason&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{children:n(`Reason`)}),(0,G.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap text-foreground/80`,children:t.reason})]})]})]})]})}function A8(e,t,n){if(e==null||t===void 0||t<=e)return null;let r=Math.max(0,t-n);return{remainingMs:r,fraction:Math.min(1,r/(t-e))}}function j8(e,t,n=fe){let r=t-e;return r>=n?r:null}var M8={exit_nonzero:`Exit {{code}}`,deadline:`Killed at timeout`,stopped_by_user:`Stopped by you`,tty_required:`Needs terminal`,auth_required:`Needs login`,not_found:`Command not found`,not_executable:`Not executable`,binary_output:`Binary output`,output_truncated:`Log truncated`},N8={deadline:`Killed when its timeout was reached. Raise the timeout or run it in the background.`,tty_required:`Needs an interactive terminal. Use a non-interactive flag (such as --yes) or run it in your own terminal.`,auth_required:`Needs credentials. Sign in from your own terminal, then retry.`,not_found:`The program is not installed or not on PATH.`};function P8(e){return e?.kind===`deadline`?[`background`,`timeout`]:[]}function F8(e,t,n){let r=`\`\`\`\n${t}\n\`\`\``;return e===`background`?n(`Rerun this command with background: true:
265
+
266
+ {{command}}`,{command:r}):n(`Rerun this command with timeout: {{seconds}}:
267
+
268
+ {{command}}`,{seconds:600,command:r})}function I8(e,t,n){return t(e)?(n(),!0):!1}function L8(){let[e,t]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(e)},[]),e}var R8=5,z8=2*Math.PI*R8;function B8({startedAt:e,deadlineAt:t,output:n}){let{t:r}=K(),i=L8(),a=(0,H.useRef)({output:n,at:e??Date.now()});a.current.output!==n&&(a.current={output:n,at:Date.now()});let o=A8(e,t,i),s=j8(a.current.at,i);return!o&&s===null?null:(0,G.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[10px] text-muted-foreground/70 tabular-nums`,children:[s!==null&&(0,G.jsx)(`span`,{"data-shell-quiet":!0,className:`rounded bg-muted px-1`,children:r(`No output for {{seconds}}s`,{seconds:Math.floor(s/1e3)})}),o&&o.remainingMs>0&&(0,G.jsxs)(`span`,{className:`flex items-center gap-0.5`,title:r(`Moves to background in {{seconds}}s`,{seconds:Math.ceil(o.remainingMs/1e3)}),children:[(0,G.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{cx:`6`,cy:`6`,r:R8,fill:`none`,stroke:`currentColor`,opacity:`0.25`}),(0,G.jsx)(`circle`,{cx:`6`,cy:`6`,r:R8,fill:`none`,stroke:`currentColor`,strokeDasharray:z8,strokeDashoffset:z8*(1-o.fraction),transform:`rotate(-90 6 6)`})]}),Math.ceil(o.remainingMs/1e3),`s`]})]})}function V8(e,t){return e.kind===`exit_nonzero`&&e.exitCode===void 0?t(`Failed`):t(M8[e.kind],{code:e.exitCode??``})}function H8({failure:e}){let{t}=K();return(0,G.jsx)(`span`,{"data-shell-failure":e.kind,className:W(`shrink-0 rounded px-1 text-[10px]`,e.retryable?`bg-muted text-muted-foreground`:`bg-destructive/10 text-destructive`),children:V8(e,t)})}function U8({warning:e}){let{t,locale:n}=K(),r=n===`zh`?vs(e):{what:e.reason};return(0,G.jsx)(`span`,{"data-dcg-warning":e.ruleId,title:[r.what,r.why,e.ruleId].filter(Boolean).join(`
269
+ `),className:`shrink-0 rounded bg-muted px-1 text-[10px] text-muted-foreground`,children:t(`dcg notice`)})}function W8({failure:e,command:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1);if(!e)return null;let a=N8[e.kind],o=P8(e);return(0,G.jsxs)(`div`,{"data-shell-status":e.kind,className:`mt-2 flex items-center gap-2 border-t border-current/10 pt-1.5 text-[11px] opacity-80`,children:[(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:V8(e,n)}),a&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:n(a)}),o.map(e=>(0,G.jsx)(`button`,{type:`button`,"data-shell-rerun":e,onClick:()=>{I8(F8(e,t,n),$O,YO)},className:`flex shrink-0 items-center gap-1 underline-offset-2 hover:underline hover:opacity-100`,children:e===`background`?n(`Rerun in background`):n(`Rerun with {{seconds}}s timeout`,{seconds:600})},e)),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1e3)})},className:`ml-auto flex shrink-0 items-center gap-1 hover:opacity-100`,title:n(`Copy command`),children:[r?(0,G.jsx)(ht,{className:`h-3 w-3`}):(0,G.jsx)(Nt,{className:`h-3 w-3`}),n(`Copy command`)]})]})}function G8({icon:e,state:t}){let n=t===`running`||t===`reviewing`;return(0,G.jsxs)(`span`,{className:W(`relative flex size-[22px] shrink-0 items-center justify-center rounded-full border text-muted-foreground`,n&&`border-transparent text-brand`,t===`error`&&`border-destructive/40 text-destructive`),children:[(0,G.jsx)(e,{className:`size-3`}),n&&(0,G.jsx)(`span`,{className:`absolute -inset-px animate-spin rounded-full border-[1.5px] border-brand/20 border-t-brand`})]})}function K8({state:e}){return(0,G.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:e===`running`||e===`reviewing`?(0,G.jsx)(`span`,{className:`size-2.5 animate-spin rounded-full border-[1.5px] border-border border-t-brand`}):e===`error`?(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-destructive`}):(0,G.jsx)(`span`,{className:`size-1 rounded-full bg-current opacity-60`})})}var q8={queued:[`Queued`,`bg-muted-foreground`],running:[`running`,`bg-amber-500`],awaiting_input:[`awaiting input`,`bg-amber-500`],validating:[`validating`,`bg-amber-500`],succeeded:[`succeeded`,`bg-emerald-500`],failed:[`failed`,`bg-destructive`],cancelled:[`cancelled`,`bg-muted-foreground`],interrupted:[`interrupted`,`bg-muted-foreground`],creating:[`creating`,`bg-amber-500`],ready:[`idle`,`bg-muted-foreground`],active:[`running`,`bg-amber-500`],parked:[`parked`,`bg-muted-foreground`],closed:[`closed`,`bg-muted-foreground`]};function J8({view:e,titles:t}){let{t:n}=K();return(0,G.jsxs)(`div`,{className:`space-y-2 px-3 py-2 text-sm`,children:[e.kind===`report`&&e.text&&(0,G.jsx)(C3,{text:e.text}),e.kind===`report`&&e.value&&(0,G.jsx)(C3,{text:`\`\`\`json\n${e.value}\n\`\`\``}),e.kind===`report`&&e.error&&(0,G.jsx)(`p`,{className:`whitespace-pre-wrap text-destructive`,children:e.error}),e.runs.length>0&&(0,G.jsx)(`ul`,{className:`space-y-0.5 text-xs text-muted-foreground`,children:e.runs.map(e=>(0,G.jsx)(Y8,{run:e,title:t?.[e.agentId]},e.runId||e.agentId))}),e.kind===`list`&&e.runs.length===0&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`No agents`)}),e.kind===`wait`&&e.timedOut&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Timed out; unfinished agents keep running`)}),e.kind===`wait`&&e.interrupted&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Wait was interrupted`)}),(0,G.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer hover:text-foreground`,children:n(`Run info`)}),(0,G.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap font-mono`,children:e.info})]}),e.head&&(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-muted-foreground`,children:e.head})]})}function Y8({run:e,title:t}){let{t:n}=K(),[r,i]=q8[e.status]??[null,`bg-muted-foreground`],a=e.durationMs===null?``:n(`took {{duration}}`,{duration:wN(e.durationMs)});return(0,G.jsxs)(`li`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,i)}),t&&(0,G.jsx)(`span`,{className:`truncate text-foreground`,children:t}),(0,G.jsx)(`span`,{className:`shrink-0`,children:[r?n(r):e.status,a].filter(Boolean).join(` · `)})]})}var X8=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Z8=e=>typeof e==`string`&&e.trim()?e:null;function Q8(e){if(!X8(e))return null;let{agentId:t,runId:n,status:r,createdAt:i,startedAt:a,finishedAt:o}=e;if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)return null;let s=typeof a==`number`?a:i;return{agentId:t,runId:n,status:r,durationMs:typeof o==`number`&&typeof s==`number`?Math.max(0,o-s):null}}var $8=new Set([`closed`,`parked`,`creating`]);function e5(e){if(!X8(e))return null;let{agentId:t,status:n,latestRun:r}=e;return typeof t!=`string`||typeof n!=`string`?null:($8.has(n)?null:Q8(r))??{agentId:t,runId:``,status:n,durationMs:null}}function t5(e,t){let n=PV(t);if(!n)return null;let{head:r,value:i}=n;if(e===`report`){let e=Q8(i.run);if(!e)return null;let{text:t,value:n,error:a,...o}=i;return{kind:`report`,head:r,runs:[e],text:Z8(t),value:n==null?null:JSON.stringify(n,null,2),error:Z8(a),info:JSON.stringify(o,null,2)}}if(e===`list`){if(!Array.isArray(i.agents))return null;let e=i.agents.flatMap(e=>e5(e)??[]);return e.length===i.agents.length?{kind:`list`,head:r,runs:e,info:JSON.stringify(i,null,2)}:null}let a=e===`wait`?i:e===void 0?i.report:null;if(!X8(a)||!Array.isArray(a.runs))return(e===void 0||e===`resume`)&&i.report===void 0&&typeof i.agentId==`string`&&typeof i.runId==`string`?{kind:`receipt`,head:r,runs:[],info:JSON.stringify(i,null,2)}:null;let o=a.runs.flatMap(e=>Q8(e)??[]);return o.length===a.runs.length?{kind:`wait`,head:r,runs:o,timedOut:a.timedOut===!0,interrupted:a.interrupted===!0,info:JSON.stringify(i,null,2)}:null}var n5={"restart-lost":`This subagent was started before EnsoCode restarted, and its record was lost in the restart`,"other-owner":`This subagent belongs to another conversation and cannot be controlled here`,"not-found":`This conversation has no subagent with this id (mistyped, or agentId and runId mixed up)`};function r5(e){let t=/^([a-z][a-z-]*):\s/u.exec(e?.trim()??``)?.[1];return t&&n5[t]||null}function i5({items:e,live:t=[],onOpen:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{"data-enso":`task-wrap-up`,"data-open":i?`true`:`false`,className:tP,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full items-start gap-2 text-left hover:text-foreground`,children:[(0,G.jsx)(Yt,{className:nP}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:r(`{{count}} background tasks to wrap up: stop them or say why they keep running`,{count:e.length})})]}),i&&(0,G.jsx)(`ul`,{className:`mt-1.5 space-y-1.5 border-t border-border/60 pt-1.5`,children:e.map(e=>{let r=t.find(t=>t.taskId===e.taskId);return(0,G.jsx)(a5,{item:e,command:r?.command??e.command,onOpen:r?.status===`running`?n:void 0},e.taskId)})})]})}function a5({item:e,command:t,onOpen:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`li`,{"data-enso":`task-wrap-up-item`,"data-task-id":e.taskId,className:`flex min-w-0 gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`min-w-0 flex-1 text-left hover:text-foreground`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-foreground`,children:e.taskId}),e.ran&&(0,G.jsx)(`span`,{className:`shrink-0`,children:r(`Running for {{duration}}`,{duration:e.ran})})]}),(0,G.jsx)(`span`,{"data-enso":`task-wrap-up-command`,title:t,className:W(`block font-mono text-[11px]`,i?`whitespace-pre-wrap break-all`:`truncate`),children:t})]}),n&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`task-wrap-up-open`,title:r(`Show in task bar`),"aria-label":r(`Show in task bar`),onClick:()=>n(e.taskId),className:`flex size-5 shrink-0 items-center justify-center rounded-[5px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(ot,{className:`h-3.5 w-3.5`})})]})}function o5({command:e,output:t,failure:n}){let r=T(e=>e.terminalTheme),i=T(e=>e.terminalFontFamily),a=ve(r)??ae;return(0,G.jsxs)(`div`,{"data-slot":`terminal-output`,className:`px-3 py-2 text-xs leading-relaxed`,style:{backgroundColor:a.background,"--terminal-bg":a.background,color:a.foreground,fontFamily:i},children:[(0,G.jsxs)(`div`,{className:`whitespace-pre-wrap [overflow-wrap:anywhere]`,children:[(0,G.jsx)(`span`,{style:{color:a.green},children:`$ `}),e]}),t&&(0,G.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,style:{fontFamily:`inherit`},children:i6(t)}),(0,G.jsx)(W8,{failure:n,command:e})]})}function s5(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(!(n.role!==`toolResult`||n.toolName!==`todo`||!n.todos))return n.todos.some(e=>e.status!==`completed`)?{id:n.toolCallId??String(t),todos:n.todos}:null}return null}function c5({todos:e}){return(0,G.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:e.map(e=>(0,G.jsxs)(`li`,{className:`flex items-start gap-1.5`,children:[e.status===`completed`?(0,G.jsx)(ht,{className:`mt-0.5 h-3 w-3 shrink-0 text-brand`}):e.status===`in_progress`?(0,G.jsx)(Ct,{className:`mt-0.5 h-3 w-3 shrink-0 text-brand`}):(0,G.jsx)(Dt,{className:`mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/50`}),(0,G.jsx)(`span`,{className:W(e.status===`completed`?`text-muted-foreground line-through`:e.status===`in_progress`?`font-medium`:`text-muted-foreground`),children:e.content})]},e.content))})}function l5({done:e,total:t,className:n}){return(0,G.jsx)(`div`,{className:W(`h-0.5 overflow-hidden rounded-full bg-border`,n),children:(0,G.jsx)(`div`,{className:`h-full rounded-full bg-brand transition-[width]`,style:{width:`${t?e/t*100:0}%`}})})}var u5=new Set;function d5({conversationId:e}){let{t}=K(),n=T(e=>e.pinUnfinishedTodos),r=ZN(t=>t.conversations[e]?.messages),i=(0,H.useMemo)(()=>n&&r?s5(r):null,[n,r]),[a,o]=(0,H.useState)(!1),[,s]=(0,H.useState)(0);if(!i||u5.has(i.id))return null;let c=i.todos.filter(e=>e.status===`completed`).length,l=i.todos.find(e=>e.status===`in_progress`)??i.todos.find(e=>e.status===`pending`);return(0,G.jsxs)(`div`,{"data-enso":`todo`,className:`mb-1.5 rounded-xl border bg-card px-3 py-1.5 text-xs shadow-xs`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,G.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:t(`Todos`)}),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground tabular-nums`,children:[c,`/`,i.todos.length]}),!a&&l&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:l.content,children:l.content}),a?(0,G.jsx)(gt,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,G.jsx)(_t,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),(0,G.jsx)(`button`,{type:`button`,title:t(`Hide until the todo list updates`),onClick:()=>{u5.add(i.id),s(e=>e+1)},className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(nr,{className:`h-3.5 w-3.5`})})]}),a&&(0,G.jsxs)(`div`,{className:`mt-1.5 max-h-48 overflow-y-auto pb-0.5`,children:[(0,G.jsx)(l5,{done:c,total:i.todos.length,className:`mb-2`}),(0,G.jsx)(c5,{todos:i.todos})]})]})}function f5({image:e,path:t,alt:n}){let{t:r}=K(),i=(0,H.useMemo)(()=>Zz(e,t,!0),[e,t]),[a,o]=(0,H.useState)(!1);return!i||a?(0,G.jsx)(`p`,{"data-slot":`tool-image-missing`,className:`text-xs text-muted-foreground`,children:r(`Image unavailable`)}):(0,G.jsx)(BG,{src:i,alt:n,lazy:!0,onError:()=>o(!0),frameClassName:`block max-w-full`,className:`block max-h-64 max-w-full rounded-md border border-border/60 bg-muted/40 object-contain`})}function p5({image:e,output:t}){let{t:n}=K(),r=(0,H.useMemo)(()=>Yz(t),[t]),i=[];return r?.path&&i.push([n(`Path`),r.path]),r?.width&&r.height&&i.push([n(`Dimensions`),`${r.width} × ${r.height}`]),r?.size!==null&&r?.size!==void 0&&i.push([n(`File size`),IB(r.size)]),(0,G.jsxs)(`div`,{"data-slot":`image-view`,className:`space-y-2 px-3 py-2`,children:[(0,G.jsx)(f5,{image:e,path:r?.path,alt:r?.path??``}),i.length>0?(0,G.jsx)(`dl`,{className:`space-y-0.5 text-xs`,children:i.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,G.jsx)(`dt`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:t})]},e))}):null]})}function m5(){let e=ZN(e=>e.conversations),t=T(e=>e.projects),n=ZR(e=>e.secretary.board.todos),r=ZR(e=>e.secretary.proposals);return{sessionTitle(t){return e[t]?.title?.trim()||void 0},projectName(e){let n=t.find(t=>t.id===e);return n?.alias?.trim()||n?.name?.trim()||void 0},todoText(e){return n.find(t=>t.id===e)?.text},proposal(e){let t=r[e];return t?{status:t.status,kind:t.kind}:void 0}}}function h5(e){let t=e.cardPeers??[];return[{name:e.name,args:e.args??null,output:e.output,state:e.state,...e.image?{image:e.image}:{}},...t.map(t=>({name:e.name,args:t.args??null,output:t.output,state:t.state,...t.image?{image:t.image}:{}}))]}function g5({item:e,framed:t=!1}){let{t:n,locale:r}=K(),i=m5(),a=ZN(e=>e.conversations),o=iB(h5(e),{t:n,locale:r===`zh`?`zh`:`en`,lookup:i}),s=UB(o.cards.map(e=>e.state)),[c,l]=(0,H.useState)(!1),u=o.grouped?null:o.cards[0]??null;return(0,G.jsxs)(`div`,{"data-enso":`tool-card`,"data-tool":e.name,"data-open":c?`true`:`false`,"data-grouped":o.grouped?`true`:`false`,"data-count":o.cards.length,className:`my-0.5 w-full min-w-0 text-[13px]`,children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`tool-card-expand`,"aria-expanded":c,onClick:()=>l(e=>!e),className:`group/step flex min-h-6 w-full min-w-0 items-center gap-2 text-left text-[13px] text-muted-foreground`,children:[(0,G.jsx)(K8,{state:s}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o.grouped?o.title:u?.title}),u?.status?(0,G.jsx)(_5,{status:u.status}):null,(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 opacity-0 transition-[opacity,transform] group-hover/step:opacity-100`,c&&`rotate-90 opacity-100`)})]}),c&&o.grouped?o.cards.map((e,n)=>(0,G.jsx)(v5,{card:e,known:a,onOpen:d6,framed:t},`${e.title}-${n}`)):null,c&&u?(0,G.jsx)(y5,{card:u,known:a,onOpen:d6,framed:t}):null]})}function _5({status:e}){return(0,G.jsx)(`span`,{"data-enso":`tool-card-status`,"data-tone":e.tone,className:W(`shrink-0 rounded px-1 py-px text-[10px]`,e.tone===`error`&&`bg-destructive/15 text-destructive`,e.tone===`ok`&&`bg-success/15 text-success`,(e.tone===`queued`||e.tone===`pending`)&&`bg-warning/15 text-warning`,e.tone===`neutral`&&`bg-muted text-muted-foreground`),children:e.label})}function v5({card:e,known:t,onOpen:n,framed:r}){let[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{className:`pl-5`,children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`tool-card-expand`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`group/step flex min-h-6 w-full min-w-0 items-center gap-2 text-left text-[13px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.status?(0,G.jsx)(_5,{status:e.status}):null,(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 opacity-0 transition-[opacity,transform] group-hover/step:opacity-100`,i&&`rotate-90 opacity-100`)})]}),i?(0,G.jsx)(y5,{card:e,known:t,onOpen:n,framed:r,nested:!0}):null]})}function y5({card:e,known:t,onOpen:n,framed:r,nested:i=!1}){let{t:a}=K(),[o,s]=(0,H.useState)(!1),c=(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-raw`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`text-[11px] text-muted-foreground hover:text-foreground`,children:a(`View raw data`)}),l=o?(0,G.jsxs)(`div`,{className:W(`mt-1 space-y-1`,r&&`max-h-60 overflow-auto`),children:[e.rawArgs&&(0,G.jsx)(`pre`,{className:`overflow-auto font-mono text-[10px] leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:e.rawArgs}),e.rawOutput&&(0,G.jsx)(`pre`,{className:`overflow-auto font-mono text-[10px] leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:e.rawOutput})]}):null,u=(e,r)=>(0,G.jsx)(T5,{block:e,known:t,onOpen:n},`${e.kind}-${r}`);if(r){let t=[];e.blocks.forEach((e,n)=>{let r=e.kind===`prompt`,i=t.at(-1);!r&&i&&!i.prompt?i.blocks.push([e,n]):t.push({prompt:r,blocks:[[e,n]]})});let n=t.at(-1),r=!n||n.prompt,a=(0,G.jsxs)(`div`,{children:[c,l]});return(0,G.jsxs)(`div`,{"data-enso":`tool-card-body`,"data-framed":`true`,className:W(`mt-1 mb-1.5 min-w-0 overflow-hidden rounded-lg border border-border/70 bg-card text-[12px]`,!i&&`ml-5`),children:[t.map((e,t)=>(0,G.jsxs)(`div`,{className:W(`min-w-0`,t>0&&`border-t border-border/60`,!e.prompt&&`space-y-1.5 px-3 py-2`),children:[e.blocks.map(([e,t])=>e.kind===`prompt`?(0,G.jsx)(C5,{label:e.label,text:e.text},t):u(e,t)),!r&&e===n?a:null]},t)),r?(0,G.jsx)(`div`,{className:W(`px-3 py-2`,n&&`border-t border-border/60`),children:a}):null]})}return(0,G.jsxs)(`div`,{"data-enso":`tool-card-body`,className:`space-y-1 py-0.5 pl-5 text-[12px]`,children:[(0,G.jsx)(`div`,{className:`space-y-1`,children:e.blocks.map(u)}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-raw`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`mt-1 text-[11px] text-muted-foreground hover:text-foreground`,children:a(`View raw data`)}),l]})}var b5={"--chat-h1-size":`1em`,"--chat-h2-size":`1em`,"--chat-h3-size":`1em`,"--chat-h4-size":`1em`,"--chat-code-block-size":`11px`},x5=4;function S5(e){let t=e.split(`
270
+ `).filter(e=>e.trim()&&!/^\s*(```|~~~)/.test(e)).map(e=>e.replace(/^\s*#{1,6}\s+/,``).trimEnd());return{preview:t.slice(0,x5).join(`
271
+ `),folded:t.length>x5||e.length>320}}function C5({label:e,text:t}){let{t:n}=K(),{preview:r,folded:i}=S5(t),[a,o]=(0,H.useState)(!1),s=a||!i;return(0,G.jsxs)(`section`,{"data-enso":`tool-card-prompt`,"data-open":s?`true`:`false`,className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 px-3 pt-1.5 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2.5`,children:[i&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-prompt-toggle`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`hover:text-foreground`,children:n(a?`Show less`:`Show full text`)}),(0,G.jsx)(Ls,{text:t,label:n(`Copy`)})]})]}),s?(0,G.jsx)(`div`,{"data-enso":`tool-card-prompt-body`,style:b5,className:`max-h-80 min-w-0 overflow-y-auto overscroll-contain px-3 pt-1 pb-2 text-xs leading-relaxed [&_:is(h1,h2,h3,h4)]:mt-2.5 [&_:is(h1,h2,h3,h4)]:mb-1 [&_[data-enso=code-block]>:first-child]:border-0`,children:(0,G.jsx)(C3,{text:t})}):(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-prompt-preview`,onClick:()=>o(!0),className:`line-clamp-4 block w-full min-w-0 px-3 pt-1 pb-2 text-left text-xs leading-relaxed text-muted-foreground break-words whitespace-pre-wrap`,children:r})]})}function w5({row:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=e.display===`long`&&(e.value.length>120||e.value.includes(`
272
+ `));return(0,G.jsxs)(`div`,{className:`contents`,children:[(0,G.jsx)(`dt`,{className:`whitespace-nowrap text-muted-foreground`,children:e.label}),(0,G.jsxs)(`dd`,{"data-enso":`tool-card-kv-value`,"data-display":e.display,title:e.display===`path`?e.value:void 0,className:W(`min-w-0`,e.display===`path`?`truncate`:`whitespace-pre-wrap break-words`),children:[i&&!n?(0,G.jsx)(`span`,{className:`line-clamp-2`,children:e.value}):e.value,i&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-kv-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`block text-[11px] text-muted-foreground hover:text-foreground`,children:t(n?`Show less`:`Show more`)})]})]})}function T5({block:e,known:t,onOpen:n}){let{t:r}=K(),[i,a]=(0,H.useState)(!1);if(e.kind===`error`)return(0,G.jsx)(`p`,{className:`rounded-md bg-destructive/10 px-2 py-1 text-destructive text-xs whitespace-pre-wrap`,children:e.text});if(e.kind===`note`)return(0,G.jsx)(`p`,{className:`whitespace-pre-wrap text-xs`,children:e.text});if(e.kind===`prompt`)return(0,G.jsx)(C5,{label:e.label,text:e.text});if(e.kind===`markdown`){let t=e.collapsed&&!i;return(0,G.jsxs)(`div`,{className:`text-sm`,children:[t?(0,G.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.text.split(`
273
+ `).find(e=>e.trim())}):(0,G.jsx)(C3,{text:e.text}),e.collapsed&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-fold`,onClick:()=>a(e=>!e),className:`text-[11px] text-muted-foreground hover:text-foreground`,children:r(i?`Show less`:`Show more`)})]})}return e.kind===`image`?(0,G.jsx)(`div`,{"data-enso":`tool-card-image`,children:(0,G.jsx)(f5,{image:e.image,path:e.path,alt:e.alt})}):e.kind===`session`?t[e.id]?(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-session`,"data-conversation-id":e.id,onClick:()=>n(e.id),className:`truncate text-left text-xs text-foreground underline-offset-2 hover:underline`,children:e.label}):(0,G.jsx)(`p`,{className:`text-xs`,children:e.label}):e.kind===`kv`?(0,G.jsx)(`dl`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5 text-xs`,children:e.rows.map(e=>(0,G.jsx)(w5,{row:e},e.label))}):e.kind===`diff`?(0,G.jsx)(`div`,{className:`space-y-0.5 text-xs`,children:e.rows.map(e=>(0,G.jsxs)(`p`,{className:`min-w-0 break-words`,children:[(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.label,` `]}),(0,G.jsx)(`span`,{className:`text-muted-foreground line-through`,children:e.before}),(0,G.jsxs)(`span`,{children:[` → `,e.after]})]},e.label))}):e.kind===`list`?(0,G.jsx)(`ul`,{className:`space-y-0.5`,children:e.items.map((e,r)=>(0,G.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-1.5 text-xs`,children:[e.sessionId&&t[e.sessionId]?(0,G.jsx)(`button`,{type:`button`,"data-enso":`tool-card-session`,"data-conversation-id":e.sessionId,onClick:()=>n(e.sessionId),className:`min-w-0 truncate text-left hover:underline`,children:e.title}):(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title}),e.badge&&(0,G.jsx)(`span`,{"data-enso":`tool-card-badge`,"data-tone":e.badgeTone,className:W(`shrink-0 rounded px-1 py-px text-[10px]`,e.badgeTone===`error`&&`bg-destructive/15 text-destructive`,e.badgeTone===`ok`&&`bg-success/15 text-success`,e.badgeTone===`pending`&&`bg-warning/15 text-warning`,(!e.badgeTone||e.badgeTone===`neutral`||e.badgeTone===`queued`)&&`bg-muted text-muted-foreground`),children:e.badge}),e.detail&&(0,G.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:e.detail})]},`${e.title}-${r}`))}):null}var E5=(0,H.createContext)({report:()=>{},scroller:{current:null}}),D5=E5.Provider;function O5(){return(0,H.useContext)(E5)}var k5=(0,H.lazy)(()=>q(()=>import(`./EditDiff-7At9BpWJ.js`).then(e=>({default:e.EditDiff})),__vite__mapDeps([144,1,145,146]))),A5=(0,H.lazy)(()=>q(()=>import(`./ReadFileView-CFkjh0Xx.js`).then(e=>({default:e.ReadFileView})),__vite__mapDeps([147,1,145,146]))),j5=(e,t)=>e===t||!!e&&!!t&&e.runMs===t.runMs&&e.turnMs===t.turnMs&&e.ttftMs===t.ttftMs&&e.tps===t.tps;function Mne(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>{let n=r[t];return n!==void 0&&e.key===n.key&&e.state===n.state&&e.output===n.output&&e.image?.data===n.image?.data&&JSON.stringify(e.args??null)===JSON.stringify(n.args??null)})}function Nne(e,t){if(e.secretarySession!==t.secretarySession)return!1;let n=e.item,r=t.item;if(n===r)return!0;if(n.kind!==r.kind||n.key!==r.key)return!1;switch(n.kind){case`user`:return r.kind!==`user`||n.text!==r.text||n.images.length!==r.images.length||n.timestamp!==r.timestamp||n.deliveryState!==r.deliveryState||n.turnDurationMs!==r.turnDurationMs||n.collapsed!==r.collapsed||n.canCollapse!==r.canCollapse||n.hostTaskWrapUp!==r.hostTaskWrapUp?!1:n.images.every((e,t)=>e===r.images[t]);case`text`:case`thinking`:return r.kind===n.kind&&n.text===r.text&&n.streaming===r.streaming&&(n.kind!==`text`||r.kind===`text`&&j5(n.perf,r.perf)&&n.timestamp===r.timestamp&&n.turnDurationMs===r.turnDurationMs)&&(n.kind!==`thinking`||r.kind===`thinking`&&n.durationMs===r.durationMs);case`tool`:return r.kind===`tool`&&n.state===r.state&&n.name===r.name&&n.summary===r.summary&&n.output===r.output&&n.edits===r.edits&&n.writeContent===r.writeContent&&n.fileChanges===r.fileChanges&&n.imagePath===r.imagePath&&n.image?.data===r.image?.data&&n.image?.mimeType===r.image?.mimeType&&n.generatedImages===r.generatedImages&&n.todos===r.todos&&n.durationMs===r.durationMs&&n.startedAt===r.startedAt&&n.agentMeta===r.agentMeta&&n.source===r.source&&n.nestedPending===r.nestedPending&&JSON.stringify(n.sandbox)===JSON.stringify(r.sandbox)&&n.rtk===r.rtk&&n.approvalReview===r.approvalReview&&n.plan?.title===r.plan?.title&&n.plan?.text===r.plan?.text&&n.sentMessage===r.sentMessage&&n.memoryContent===r.memoryContent&&n.ask?.question===r.ask?.question&&n.ask?.options.join(`
274
+ `)===r.ask?.options.join(`
275
+ `)&&n.ask?.answer===r.ask?.answer&&n.ask?.autoSelected===r.ask?.autoSelected&&n.subagentOp===r.subagentOp&&JSON.stringify(n.subagentTitles)===JSON.stringify(r.subagentTitles)&&n.waiting===r.waiting&&n.pluginArtifacts===r.pluginArtifacts&&n.shellFailure===r.shellFailure&&n.dcgWarning===r.dcgWarning&&JSON.stringify(n.args??null)===JSON.stringify(r.args??null)&&Mne(n.cardPeers,r.cardPeers);case`tool-group`:return r.kind===`tool-group`&&n.expanded===r.expanded&&n.count===r.count&&n.stats.commands===r.stats.commands&&n.stats.reads===r.stats.reads&&n.stats.searches===r.stats.searches&&n.stats.others===r.stats.others&&n.exploring===r.exploring&&n.live===r.live&&n.activity?.thinking===r.activity?.thinking&&n.activity?.workedMs===r.activity?.workedMs&&n.explore?.goal===r.explore?.goal&&n.explore?.report===r.explore?.report&&n.explore?.steps===r.explore?.steps&&n.notice===r.notice;case`error`:return r.kind===`error`&&n.text===r.text;case`interrupted`:return r.kind===`interrupted`&&n.at===r.at&&n.exitKind===r.exitKind&&n.unfinishedTools.length===r.unfinishedTools.length;case`task-note`:return r.kind===`task-note`&&n.detail===r.detail;case`compaction`:case`compaction-notice`:return(r.kind===`compaction`||r.kind===`compaction-notice`)&&n.kind===r.kind&&n.summary===r.summary&&n.tokensBefore===r.tokensBefore&&n.tokensAfter===r.tokensAfter&&n.verified===r.verified;case`compaction-progress`:return r.kind===`compaction-progress`&&n.state===r.state;case`session-custom`:return r.kind===`session-custom`&&n.entry===r.entry;case`divider`:return r.kind===`divider`&&n.text===r.text;case`plugin-message`:return r.kind===`plugin-message`&&n.text===r.text&&n.pluginId===r.pluginId;case`resumed-reply`:return r.kind===`resumed-reply`&&n.expanded===r.expanded&&n.text===r.text&&n.thinking===r.thinking&&n.tools.length===r.tools.length;case`discarded-turn`:return r.kind===`discarded-turn`&&n.expanded===r.expanded&&n.reason===r.reason&&n.messages.length===r.messages.length&&n.messages.every((e,t)=>e===r.messages[t])&&n.tools.length===r.tools.length}}var M5=/^<role>\n?([\s\S]*?)\n?<\/role>\s*/,Pne=/^<workspace-migrated>\n?([\s\S]*?)\n?<\/workspace-migrated>\s*/,Fne=/^<workspace-branch-changed>\n?([\s\S]*?)\n?<\/workspace-branch-changed>\s*/;function Ine({note:e}){let{t}=K(),n=/on Git branch ("(?:[^"\\]|\\.)*")/.exec(e)?.[1],r=``;try{r=n?String(JSON.parse(n)):``}catch{}return(0,G.jsxs)(`aside`,{title:e,className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(qt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 break-all`,children:r?t(`Workspace switched to branch {{branch}}`,{branch:r}):t(`Workspace switched branch`)})]})}function N5({items:e}){let t=NN(),n=ZN(e=>t?void 0:Y5(e)?.id),r=ZN(e=>t?void 0:Y5(e)?.backgroundTasks);return(0,G.jsx)(i5,{items:e,live:r,onOpen:n?e=>ZN.setState({pendingAgentOpen:{sessionId:n,agentId:e}}):void 0})}function Lne({note:e}){let{t}=K(),n=/(?:moved to|main working tree): (.+)$/m.exec(e)?.[1]?.trim(),r=e.includes(`main working tree`);return(0,G.jsxs)(`aside`,{title:e,className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(qt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[t(r?`Workspace fell back to the main working tree`:`Workspace moved to an isolated worktree`),n&&(0,G.jsx)(`span`,{className:`ml-1.5 break-all font-mono text-[11px] opacity-80`,children:n})]})]})}function P5({note:e}){let{t}=K();return(0,G.jsxs)(`aside`,{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(kt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0`,children:t(e===`on`?`Plan mode on: read-only research, then a plan for your approval`:e===`off`?`Plan mode off`:`Context compacted: the approved plan was attached again`)})]})}function F5({note:e}){let{t}=K(),n=e===`on`;return(0,G.jsxs)(`aside`,{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[n?(0,G.jsx)(Rt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}):(0,G.jsx)(Qn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0`,children:t(n?`Unattended mode on: no one is watching, so it decides and keeps going`:`Unattended mode off: a person is available again`)})]})}function Rne({tag:e,body:t}){let n=e===`agent-notification`?z6(t):null;return n?(0,G.jsx)(Vne,{notices:n}):(0,G.jsx)(Hne,{tag:e,body:t})}function zne({goal:e,instructions:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1),a=XU(e);return(0,G.jsxs)(`div`,{"data-enso":`goal-continuation`,"data-open":r?`true`:`false`,className:W(`my-1 w-full min-w-0`,QN),children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)($N,{}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n(`Continue goal: {{summary}}`,{summary:a||e})})]}),r&&(0,G.jsxs)(`div`,{className:`mt-1.5 space-y-1.5 border-t border-border/60 pt-1.5`,children:[(0,G.jsx)(`p`,{className:`whitespace-pre-wrap text-foreground`,children:e}),t&&(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[11px] leading-relaxed text-muted-foreground`,children:t})]})]})}function I5({enso:e,icon:t,title:n,body:r}){let[i,a]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{"data-enso":e,"data-open":i?`true`:`false`,className:tP,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full items-start gap-2 text-left enabled:hover:text-foreground`,children:[(0,G.jsx)(t,{className:nP}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n})]}),i&&r&&(0,G.jsx)(`p`,{className:`mt-1.5 whitespace-pre-wrap text-foreground`,children:r})]})}function Bne({segments:e,searchQuery:t,activeNth:n}){let{t:r}=K();return(0,G.jsx)(G.Fragment,{children:e.map((e,i)=>{let a=`${e.kind}-${i}`;if(e.kind===`text`){let r=e.text.trim();return r?(0,G.jsx)(U5,{text:r,searchQuery:t,activeNth:n},a):null}if(e.kind===`goal`)return(0,G.jsx)(zne,{goal:e.goal,instructions:e.instructions},a);if(e.kind===`schedule`){let t=rW(e.raw),n=t.length>0?t:[{summary:``,body:``}];return(0,G.jsx)(H.Fragment,{children:n.map((e,t)=>(0,G.jsx)(I5,{enso:`secretary-schedule-card`,icon:nt,title:e.summary?r(`Scheduled: {{summary}}`,{summary:e.summary}):r(`Scheduled`),body:e.body},t))},a)}if(e.kind===`updates`){let t=jW(e.raw);if(t)return(0,G.jsx)(L5,{lines:t},a);let n=iW(e.raw);return(0,G.jsx)(I5,{enso:`session-updates-card`,icon:dn,title:n.summary?r(`Session updates: {{summary}}`,{summary:n.summary}):r(`Session updates`),body:n.body},a)}return(0,G.jsx)(Rne,{tag:e.tag,body:e.body},a)})})}function Vne({notices:e}){let{t}=K(),[n,r]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{className:eP,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-start gap-2 px-3 py-2 text-left hover:text-foreground`,children:[(0,G.jsx)(dt,{className:nP}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.map(e=>e.header).join(` · `)})]}),n&&e.map((n,r)=>(0,G.jsxs)(`div`,{className:`border-border/60 border-t`,children:[e.length>1&&(0,G.jsx)(`p`,{className:`truncate px-3 pt-2`,children:n.header}),n.report&&(0,G.jsx)(`div`,{className:`max-h-80 overflow-auto px-3 py-2 text-sm text-foreground`,children:(0,G.jsx)(C3,{text:n.report})}),n.usage&&(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 border-border/60 border-t px-3 py-1 text-[10px]`,children:[(0,G.jsx)(`span`,{className:`font-semibold tracking-wide text-foreground/75`,children:`Subagent`}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:t(`{{count}} tokens`,{count:CN(n.usage.tokens)})}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:t(`{{count}} tool calls`,{count:n.usage.toolUses})}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:wN(n.usage.durationMs)})]}),n.tasks&&(0,G.jsxs)(`div`,{className:`border-border/60 border-t px-3 py-1 text-[11px]`,children:[(0,G.jsx)(`p`,{className:`text-foreground/75`,children:t(`Background tasks started by this subagent`)}),n.tasks.map(e=>(0,G.jsx)(`p`,{className:`truncate font-mono text-muted-foreground`,children:e},e))]})]},r))]})}function Hne({tag:e,body:t}){let[n,r]=(0,H.useState)(!1),i=eW(t);if(!i)return null;let a=i.indexOf(`
276
+ `),o=a>0,s=e.startsWith(`coworker-`)||e===`agent-notification`?dt:Gn;return(0,G.jsxs)(`div`,{className:tP,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!o,onClick:()=>r(e=>!e),className:`flex w-full items-start gap-2 text-left enabled:hover:text-foreground`,children:[(0,G.jsx)(s,{className:nP}),(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1`,o?`truncate`:`whitespace-pre-wrap`),children:o?i.slice(0,a):i})]}),o&&n&&(0,G.jsx)(`pre`,{className:`mt-1.5 max-h-80 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words`,children:i.slice(a+1)})]})}var Une={"goal-complete":ht,"goal-blocked":xt,"needs-user":Qn,"turn-ended":dn,failed:Et,stalled:Yt,interrupted:An,proposal:Ot,schedule:nt,pending:Yt,"ask-relay":cn,leftover:Yt,queued:nt};function L5({lines:e}){return(0,G.jsx)(`div`,{"data-enso":`secretary-updates`,className:W(eP,`divide-y divide-border/60`),children:e.map((e,t)=>(0,G.jsx)(Wne,{line:e,onOpen:d6},t))})}function Wne({line:e,onOpen:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1),a=Une[e.kind],o=`conversationId`in e?e.conversationId:void 0,s=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(a,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:e.text})]});return(0,G.jsxs)(`div`,{"data-enso":`secretary-update`,"data-open":r?`true`:`false`,className:`px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[e.detail?(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-update-expand`,"aria-expanded":r,onClick:()=>i(e=>!e),className:`flex min-w-0 flex-1 items-start gap-2 text-left hover:text-foreground`,children:s}):(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:s}),o&&t?(0,G.jsx)(`button`,{type:`button`,"data-enso":`secretary-update-open`,title:n(`Open session`),"aria-label":n(`Open session`),onClick:e=>{e.stopPropagation(),t(o)},className:`-mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-[5px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(ot,{className:`h-3.5 w-3.5`})}):null]}),e.detail&&r&&(0,G.jsx)(`pre`,{className:`mt-1.5 ml-5.5 max-h-60 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words`,children:e.detail})]})}var R5=/^<message-from-main-agent>\n?([\s\S]*?)\n?<\/message-from-main-agent>\s*$/;function Gne(e){let t=M5.exec(e);return R5.test(t?e.slice(t[0].length):e)}function Kne({name:e,content:t}){let{t:n}=K();return(0,G.jsxs)(cD,{children:[(0,G.jsxs)(uD,{className:sA(`skill`,!0),children:[(0,G.jsx)(Vn,{className:`h-3 w-3`}),e]}),(0,G.jsxs)(pD,{className:`max-w-lg`,children:[(0,G.jsx)(mD,{children:(0,G.jsxs)(gD,{className:`text-base`,children:[n(`Skill`),` · `,e]})}),(0,G.jsx)(yD,{className:`max-h-[50vh] text-sm`,children:(0,G.jsx)(C3,{text:t})})]})]})}function z5({chip:e,extra:t}){return(0,G.jsxs)(`div`,{className:`max-w-[80%] rounded-2xl rounded-br-md bg-muted px-4 py-2.5 text-sm`,children:[(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:e}),t?(0,G.jsx)(`div`,{className:`mt-1.5 whitespace-pre-wrap break-words leading-relaxed`,children:(0,G.jsx)(V5,{text:t})}):null]})}function qne({blocks:e,hostTaskWrapUp:t}){let n=Tk(e.rest),r=t?Ek(e.rest):void 0,i=(0,G.jsx)(z5,{chip:(0,G.jsx)(`span`,{className:`inline-flex flex-wrap gap-1 align-middle`,children:e.skills.map(e=>(0,G.jsx)(Kne,{name:e.name,content:e.body},e.location))}),extra:n.rest.trim()});return!n.plan&&!n.unattended&&!r?i:(0,G.jsxs)(G.Fragment,{children:[n.plan&&(0,G.jsx)(P5,{note:n.plan}),n.unattended&&(0,G.jsx)(F5,{note:n.unattended}),r&&(0,G.jsx)(N5,{items:r.items}),i]})}function Jne({text:e}){let t=Ak(e);if(t.names.length>1)return(0,G.jsx)(z5,{chip:(0,G.jsx)(`span`,{className:`inline-flex flex-wrap gap-1 align-middle`,children:t.names.map(e=>(0,G.jsx)(cA,{name:`/skill:${e}`},e))}),extra:t.rest});let n=iA(e);return n.slash?(0,G.jsx)(z5,{chip:(0,G.jsx)(cA,{name:n.slash}),extra:n.rest.trim()}):null}function Yne({preset:e}){let{t}=K();return(0,G.jsxs)(`div`,{className:`min-w-64 max-w-[80%] overflow-hidden rounded-2xl rounded-br-md bg-muted text-sm`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3.5 py-2.5`,children:[(0,G.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-info/15 text-info`,children:(0,G.jsx)(er,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:t(`Workflow preset`)}),(0,G.jsx)(`p`,{className:`truncate font-medium`,title:e.id,children:e.name||e.id})]})]}),e.args.length>0&&(0,G.jsx)(`dl`,{className:`space-y-1 border-t border-border/60 px-3.5 py-2 text-xs`,children:e.args.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`dt`,{className:`shrink-0 font-mono text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap break-words`,children:t})]},e))})]})}function B5({kind:e,label:t,title:n}){let r=e===`file`?Vt:e===`chat`?An:Hn;return(0,G.jsxs)(`span`,{className:W(mA(e),`mx-0.5 max-w-52 rounded-md px-1.5 align-middle leading-4`),title:n,children:[(0,G.jsx)(r,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:t})]})}function Xne({label:e,sessionFile:t}){let n=HW(ZN(e=>e.conversations),t);return n?(0,G.jsxs)(`button`,{type:`button`,"data-enso":`chat-ref`,onClick:()=>d6(n),title:t,className:W(mA(`chat`),`mx-0.5 inline-flex max-w-52 items-center gap-1 rounded-md px-1.5 align-middle leading-4 hover:bg-muted`),children:[(0,G.jsx)(An,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:e})]}):(0,G.jsx)(B5,{kind:`chat`,label:e,title:t})}var Zne=240;function Qne({text:e,originalLines:t}){let{t:n}=K(),r=(0,H.useRef)(null),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(!1);(0,H.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>a(e.scrollHeight>241);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let c=i&&!o;return(0,G.jsxs)(`span`,{"data-enso":`quote-block`,className:`mt-1 mb-2.5 block border-l-2 border-brand/40 pl-2.5 text-muted-foreground`,children:[t?(0,G.jsx)(`span`,{"data-quote-truncated":``,className:`mb-0.5 block text-[11px] text-warning`,children:n(`Truncated · original {{count}} lines`,{count:t})}):null,(0,G.jsx)(`span`,{ref:r,"data-quote-body":``,"data-clipped":c?``:void 0,style:c?{maxHeight:Zne}:void 0,className:W(`block`,c&&`overflow-hidden mask-b-from-60%`),children:wA(e).map((e,t)=>e.type===`code`?(0,G.jsx)(`span`,{"data-quote-code":``,className:`my-1 block overflow-x-auto whitespace-pre rounded-md bg-background/60 px-2 py-1 font-mono text-xs`,children:e.code},t):(0,G.jsx)(`span`,{children:e.text},t))}),i?(0,G.jsx)(`button`,{type:`button`,"data-quote-toggle":``,"data-quote-skip":``,onClick:()=>s(e=>!e),className:`mt-0.5 text-[11px] text-muted-foreground/80 select-none hover:text-foreground`,children:n(o?`Show less`:`Show more`)}):null]})}function V5({text:e,searchQuery:t=``,activeNth:n=-1}){let r=Kk(gk(e)),i={n:0};return(0,G.jsx)(`span`,{className:`whitespace-pre-wrap`,children:r.map((e,r)=>e.type===`file`?(0,G.jsx)(I4,{path:e.path,children:(0,G.jsx)(B5,{kind:`file`,label:Zk(e.path),title:e.path})},r):e.type===`chat`?(0,G.jsx)(Xne,{label:e.label,sessionFile:e.sessionFile},r):e.type===`ui-element`?(0,G.jsx)(B5,{kind:`ui-element`,label:e.label,title:`${e.path}${e.text?` · ${e.text}`:``}`},r):e.type===`quote`?(0,G.jsx)(Qne,{text:e.text,originalLines:e.originalLines},r):(0,G.jsx)(`span`,{children:t.trim()?lU(e.text,t,n,i):e.text},r))})}function $ne({files:e,chats:t}){return(0,G.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:[e.map(e=>(0,G.jsx)(I4,{path:e,children:(0,G.jsx)(B5,{kind:`file`,label:Zk(e),title:e})},`f:${e}`)),t.map(e=>(0,G.jsx)(B5,{kind:`chat`,label:e.label,title:e.sessionFile},`c:${e.sessionFile}`))]})}var H5=`max-w-[82%] rounded-[10px] bg-muted px-3.5 py-[9px] text-(length:--chat-body-size) leading-[1.6]`;function U5({text:e,searchQuery:t=``,activeNth:n=-1,thumbnails:r=0,align:a=`end`,hostTaskWrapUp:o=!1}){let{t:s}=K(),c=NN(),l=!!(c?.speaker||c?.botSession),u=UU(e,r);if(u)return(0,G.jsxs)(G.Fragment,{children:[u.text&&(0,G.jsx)(U5,{text:u.text,searchQuery:t,activeNth:n,hostTaskWrapUp:o}),(0,G.jsx)(UG,{entries:u.entries,thumbnails:r,align:a})]});let d=qU(e);if(d)return(0,G.jsx)(T3,{message:d});let f=l?DU(e):null;if(f)return(0,G.jsx)(BW,{message:f});let p=l?CU(e):e;if(p!==e)return(0,G.jsx)(U5,{text:p,searchQuery:t,activeNth:n,hostTaskWrapUp:o});let m=l?yU(e):null;if(m?.refs.length)return(0,G.jsxs)(`div`,{className:`flex w-full flex-col items-end gap-1.5`,children:[m.body&&(0,G.jsx)(U5,{text:m.body,searchQuery:t,activeNth:n}),(0,G.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:m.refs.map(e=>(0,G.jsxs)(`span`,{title:s(`Referenced chat`),className:`inline-flex h-6 max-w-56 items-center gap-1 rounded-md bg-muted px-1.5 text-xs`,children:[(0,G.jsx)(dn,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]},e.id))})]});let h=me(e);if(h.note){let e=h.rest.trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(P5,{note:h.note}),e&&(0,G.jsx)(U5,{text:e,searchQuery:t,activeNth:n,hostTaskWrapUp:o})]})}let g=vk(e);if(g.note){let e=g.rest.trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F5,{note:g.note}),e&&(0,G.jsx)(U5,{text:e,searchQuery:t,activeNth:n,hostTaskWrapUp:o})]})}let _=o?Ck(e):null;if(_){let e=_.rest.trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(N5,{items:_.items}),e&&(0,G.jsx)(U5,{text:e,searchQuery:t,activeNth:n})]})}let v=Fne.exec(e);if(v){let r=e.slice(v[0].length).trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ine,{note:v[1]??``}),r&&(0,G.jsx)(U5,{text:r,searchQuery:t,activeNth:n})]})}let y=i(e);if(y?.kind===`approved`)return(0,G.jsxs)(`div`,{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(Ot,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[s(`Plan approved, executing`),(0,G.jsx)(`span`,{className:`ml-1.5 text-foreground`,children:y.title})]})]});if(y?.kind===`feedback`)return(0,G.jsxs)(`div`,{className:W(H5,`whitespace-pre-wrap`),children:[(0,G.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:[(0,G.jsx)(kt,{className:`h-3 w-3`}),s(`Plan feedback`)]}),(0,G.jsx)(V5,{text:y.feedback,searchQuery:t,activeNth:n})]});let b=Pk(e);if(b)return(0,G.jsx)(Yne,{preset:b});let x=eA(e);if(x.files.length>0||x.chats.length>0){let e=iA(x.body);return(0,G.jsxs)(`div`,{className:H5,children:[e.slash?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(cA,{name:e.slash}),e.rest.trim()?(0,G.jsx)(`span`,{className:`ml-1.5 align-middle`,children:(0,G.jsx)(V5,{text:e.rest.trim(),searchQuery:t,activeNth:n})}):null]}):(0,G.jsx)(V5,{text:x.body,searchQuery:t,activeNth:n}),(0,G.jsx)($ne,{files:x.files,chats:x.chats})]})}let S=jk(e);if(S)return(0,G.jsx)(qne,{blocks:S,hostTaskWrapUp:o});if(iA(e).slash)return(0,G.jsx)(Jne,{text:e});let C=Pne.exec(e);if(C){let r=e.slice(C[0].length).trim();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Lne,{note:C[1]}),r&&(0,G.jsx)(U5,{text:r,searchQuery:t,activeNth:n})]})}let w=QU(e);if(w)return(0,G.jsx)(Bne,{segments:w,searchQuery:t,activeNth:n});let T=jW(e);if(T)return(0,G.jsx)(L5,{lines:T});let E=M5.exec(e),D=E?e.slice(E[0].length):e,O=R5.exec(D),k=O?O[1]:D;return(0,G.jsxs)(`div`,{className:W(O?`max-w-[80%] rounded-2xl rounded-bl-md border border-blue-500/20 bg-blue-500/8 px-4 py-2.5 text-sm`:W(H5,`whitespace-pre-wrap`)),children:[O&&(0,G.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[10px] font-medium tracking-wide text-blue-600 uppercase dark:text-blue-400`,children:[(0,G.jsx)(dt,{className:`h-3 w-3`}),s(`From main agent`)]}),E?.[1]&&!AU(E[1])&&(0,G.jsxs)(`div`,{className:`mb-2 rounded-md bg-background/60 px-2.5 py-1.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-semibold`,children:s(`Role`)}),` · `,E[1]]}),O?(0,G.jsx)(C3,{text:k,searchQuery:t,activeNth:n}):(0,G.jsx)(V5,{text:k,searchQuery:t,activeNth:n})]})}function W5(e){return e.kind===`tool-group`||e.kind===`thinking`||e.kind===`tool`&&OH(e)}var G5=`text-[color:var(--subtle-foreground,var(--muted-foreground))]`,K5=`animate-pulse motion-reduce:animate-none`;function ere({model:e,at:t,privacyMask:n,secretarySession:r=!1,face:i}){let a=NN(),o=$R(),s=r?i??o:null,c=a?.speaker??(a?null:s),l=!a&&s?!0:void 0,u=[e,typeof t==`number`?n7(t):null].filter(Boolean).join(` · `);return!c&&!u&&!n?null:(0,G.jsxs)(`div`,{"data-quote-skip":``,className:`mb-2 flex h-6 min-w-0 items-center gap-2 text-xs select-none`,children:[c&&(c.image?(0,G.jsx)(`img`,{"data-enso":l?`secretary-chat-avatar`:void 0,"data-image":l?`true`:void 0,src:c.image,alt:``,draggable:!1,className:`size-[22px] shrink-0 rounded-full object-cover`,style:{backgroundColor:c.color}}):l?(0,G.jsx)(oR,{name:c.name,color:c.color,enso:`secretary-chat-avatar`,className:`size-[22px] rounded-full`}):(0,G.jsx)(`span`,{className:`flex size-[22px] shrink-0 items-center justify-center rounded-full font-semibold text-[11px] text-white`,style:{backgroundColor:c.color},children:[...c.name.trim()][0]?.toUpperCase()??`?`})),c&&(0,G.jsx)(`span`,{className:`shrink-0 truncate text-[13px] font-semibold text-foreground`,children:c.name}),u&&(0,G.jsx)(`span`,{className:W(`min-w-0 truncate text-[11.5px]`,G5),children:u}),n&&(0,G.jsx)(E8,{report:n})]})}var tre=(0,H.memo)(function({item:e,secretarySession:t=!1,onToggleGroup:n,onToggleTurn:r}){let i=aU(),a=i.query,o=i.activeKey===e.key?i.activeNth:-1,s=t;switch(e.kind){case`user`:{let t=e.text?Gne(e.text):!1,n=e.collapsed===!0,i=e.hostTaskWrapUp?Dk(e.text):e.text;return(0,G.jsxs)(`div`,{"data-enso":`message-user`,className:W(`group/user flex flex-col gap-1.5`,t?`items-start`:`items-end`),children:[e.images.map((e,t)=>(0,G.jsx)(BG,{src:`data:${e.mimeType};base64,${e.data}`,className:`max-h-48 max-w-full rounded-lg border object-contain`},t)),e.text&&(0,G.jsx)(U5,{text:e.text,searchQuery:a,activeNth:o,thumbnails:e.images.length,align:t?`start`:`end`,hostTaskWrapUp:e.hostTaskWrapUp===!0}),n?(0,G.jsx)(hre,{turnKey:e.key,text:i,timestamp:e.timestamp,turnDurationMs:e.turnDurationMs,onToggle:r}):(0,G.jsx)(gre,{turnKey:e.key,messageIndex:Number(e.key),text:i,timestamp:e.timestamp,deliveryState:e.deliveryState,canCollapse:e.canCollapse,onToggleTurn:r})]})}case`text`:return(0,G.jsx)(_re,{item:e,searchQuery:a,activeNth:o});case`thinking`:return(0,G.jsx)(xre,{itemKey:e.key,text:e.text,streaming:e.streaming,durationMs:e.durationMs,startedAt:e.startedAt});case`tool`:{let t=fG(e),n=$z(e.name,s),r=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(zte,{name:e.name,output:e.output,state:e.state}),n?(0,G.jsx)(g5,{item:e,framed:s}):(0,G.jsx)(Ore,{item:e}),t?(0,G.jsx)(_G,{proposalId:t}):null,e.pluginArtifacts?(0,G.jsx)(S6,{artifacts:e.pluginArtifacts,align:n?`card`:`tool-row`}):null]});return n?(0,G.jsx)(`div`,{"data-enso":`tool-card-pair`,className:`w-full min-w-0`,children:r}):r}case`tool-group`:return(0,G.jsx)(Tre,{item:e,onToggle:n});case`error`:return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-sm text-destructive`,children:[(0,G.jsx)(xt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap`,children:e.text}),(0,G.jsx)(Z5,{})]});case`interrupted`:return(0,G.jsx)(sre,{item:e});case`task-note`:return(0,G.jsx)(Sre,{item:e});case`compaction`:case`compaction-notice`:return(0,G.jsx)(wre,{item:e});case`compaction-progress`:return(0,G.jsx)(Cre,{state:e.state});case`session-custom`:return(0,G.jsx)(ore,{entry:e.entry});case`plugin-message`:return(0,G.jsx)(rre,{item:e});case`discarded-turn`:return(0,G.jsx)(ire,{item:e,onToggle:n});case`resumed-reply`:return(0,G.jsx)(are,{item:e,onToggle:n});case`divider`:return(0,G.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`}),e.text,(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})}},Nne),q5=e=>{if(typeof e==`string`)return e;if(e===void 0)return`—`;try{return JSON.stringify(e)}catch{return String(e)}};function nre({entry:e}){let{t}=K(),n=$3(),r=n.get(e.accountKey),i=e.previousAccountKey?n.get(e.previousAccountKey):void 0,a=e.previousAccountKey?i&&r?t(`ChatGPT account switched: {{previous}} → {{current}}`,{previous:i,current:r}):t(`ChatGPT account switched`):r?t(`ChatGPT account selected: {{account}}`,{account:r}):t(`ChatGPT account selected`);return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(kn,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-primary`}),(0,G.jsx)(`p`,{className:`min-w-0 break-words text-muted-foreground`,children:a})]})}function rre({item:e}){let{t}=K();return(0,G.jsxs)(`div`,{"data-plugin-message":e.pluginId,className:`rounded-md border border-dashed border-border bg-muted/20 px-3 py-2 text-xs`,children:[(0,G.jsxs)(`p`,{className:`mb-1 flex items-center gap-1.5 text-muted-foreground`,children:[(0,G.jsx)(O6,{pluginId:e.pluginId,className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:t(`From plugin {{name}}`,{name:e.pluginName})}),(0,G.jsx)(`span`,{className:`font-mono opacity-70`,children:e.pluginId})]}),(0,G.jsx)(`div`,{className:J5,children:(0,G.jsx)(C3,{text:e.text})})]})}var J5=`break-words text-foreground [&_p]:whitespace-pre-line`;function ire({item:e,onToggle:t}){let{t:n}=K();return(0,G.jsxs)(`div`,{"data-discarded-turn":e.pluginId,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.key),"data-enso":`tool-row`,className:W(`group/step flex min-h-6 w-full items-center gap-2 text-left text-[13px] transition-colors hover:text-foreground`,G5),children:[(0,G.jsx)(Rn,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground group-hover/step:text-foreground`,children:Fs(`turn_discard`,n)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.pluginName,e.reason].filter(Boolean).join(` · `)}),(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 transition-transform`,e.expanded&&`rotate-90`)})]}),e.expanded&&(0,G.jsxs)(`div`,{className:`t-acc-reveal mt-1 mb-1.5 ml-5 space-y-2 rounded-md border border-dashed border-border bg-muted/20 px-3 py-2 text-xs`,children:[(0,G.jsxs)(`p`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,G.jsx)(O6,{pluginId:e.pluginId,className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:n(`From plugin {{name}}`,{name:e.pluginName})})]}),e.messages.map((e,t)=>(0,G.jsx)(`div`,{className:J5,children:(0,G.jsx)(C3,{text:e})},t)),e.tools.map((e,t)=>(0,G.jsxs)(`p`,{className:W(`truncate`,G5),children:[Fs(e.name,n),` `,e.summary]},t))]})]})}function are({item:e,onToggle:t}){let{t:n}=K();return(0,G.jsxs)(`div`,{"data-resumed-reply":``,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.key),"aria-expanded":e.expanded,"data-enso":`tool-row`,className:W(`group/step flex min-h-6 w-full items-center gap-2 text-left text-[13px] transition-colors hover:text-foreground`,G5),children:[(0,G.jsx)(xn,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[n(`Interrupted by a restart, continued below`),(0,G.jsx)(`span`,{className:`ml-1.5 opacity-70`,children:e.expanded?n(`Hide the interrupted part`):n(`Show the interrupted part`)})]}),(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 transition-transform`,e.expanded&&`rotate-90`)})]}),e.expanded&&(0,G.jsxs)(`div`,{className:`t-acc-reveal mt-1 mb-1.5 ml-5 space-y-2 rounded-md border border-dashed border-border bg-muted/20 px-3 py-2 text-xs`,children:[e.thinking&&(0,G.jsx)(`p`,{className:W(`whitespace-pre-wrap break-words`,G5),children:e.thinking}),e.text&&(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-foreground`,children:e.text}),e.tools.map((e,t)=>(0,G.jsxs)(`p`,{className:W(`truncate`,G5),children:[Fs(e.name,n),` `,e.summary]},t))]})]})}function ore({entry:e}){let{t}=K();if(e.kind===`oauth-account-selected`)return(0,G.jsx)(nre,{entry:e});if(e.kind===`agent-dispatch`)return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(dt,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:t(`Dispatched to`)}),(0,G.jsx)(`span`,{className:`font-medium`,children:e.child.instanceName})]});if(e.kind===`agent-completed`)return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-emerald-500/20 bg-emerald-500/5 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(ht,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-500`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[e.child.instanceName,` · `,t(`Completed`)]}),e.receiptSummary&&(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground`,children:e.receiptSummary})]})]});if(e.kind===`agent-failed`)return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-destructive/20 bg-destructive/5 px-2.5 py-2 text-xs`,children:[(0,G.jsx)(xt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[e.child.instanceName,` · `,t(`Failed`)]}),(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground`,children:e.message})]})]});if(e.kind===`tool-batch-label`)return null;if(e.kind===`task-wrap-up-nudge`)return(0,G.jsxs)(`div`,{"data-enso":`task-wrap-up-nudge`,className:`my-1 flex items-center gap-1.5 text-[12px] text-subtle-foreground`,children:[(0,G.jsx)(tn,{className:`size-3.5 shrink-0`}),t(`{{count}} background tasks are still undeclared; the next message asks the agent to stop each one or state why it keeps running`,{count:e.count})]});let n=e.receipt,r=n.outcome===`succeeded`;return(0,G.jsx)(`div`,{className:W(`rounded-md border px-2.5 py-2 text-xs`,r?`border-emerald-500/20 bg-emerald-500/5`:n.outcome===`failed`?`border-destructive/20 bg-destructive/5`:`border-amber-500/20 bg-amber-500/5`),children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[r?(0,G.jsx)(ht,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-500`}):(0,G.jsx)(xt,{className:W(`mt-0.5 h-3.5 w-3.5 shrink-0`,n.outcome===`failed`?`text-destructive`:`text-amber-500`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`font-medium`,children:[n.subject.label,` · `,t(n.outcome)]}),(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground`,children:n.summary}),n.changes&&n.changes.length>0&&(0,G.jsx)(`dl`,{className:`mt-2 space-y-1 border-t border-border/50 pt-2`,children:n.changes.map(e=>(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2`,children:[(0,G.jsx)(`dt`,{className:`truncate text-muted-foreground`,children:e.field}),(0,G.jsxs)(`dd`,{className:`text-right font-mono`,children:[q5(e.previous),` → `,q5(e.value)]})]},e.field))})]})]})})}function Y5(e){let t=e.activeId?e.conversations[e.activeId]:null;return t?t.activeTabId?e.conversations[t.activeTabId]??t:t:null}var X5=()=>()=>{};function sre({item:e}){let{locale:t}=K(),n=PU({at:e.at,kind:e.exitKind,unfinishedTools:e.unfinishedTools,lang:t});return(0,G.jsxs)(`div`,{"data-enso":`timeline-interrupted`,className:`flex items-start gap-2 text-sm text-warning`,children:[(0,G.jsx)(xt,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap`,children:n}),(0,G.jsx)(cre,{})]})}function cre(){let{t:e}=K();return ZN(e=>{let t=Y5(e);return!!(t&&!t.spawning&&t.status!==`running`)})?(0,G.jsxs)(`button`,{type:`button`,"data-enso":`timeline-interrupted-retry`,title:e(`Retry`),onClick:()=>{let e=Y5(ZN.getState());e&&ZN.getState().retryInterrupted(e.id)},className:`mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(kn,{className:`h-3 w-3`}),e(`Retry`)]}):null}function Z5(){let{t:e}=K(),t=NN(),n=t?.botControls,r=ZN(e=>{if(t&&(!t.canRetry||t.botControls))return!1;let n=Y5(e);return!!(n?.started&&!n.spawning&&n.status!==`running`)}),i=()=>{if(!n||!t?.canRetry)return!1;let e=n.projection();return!!(e&&e.status!==`running`)},a=(0,H.useSyncExternalStore)(n?.subscribe??X5,i,i);return(n?a:r)?(0,G.jsxs)(`button`,{type:`button`,title:e(`Retry`),onClick:()=>{if(n)return n.retry();let e=Y5(ZN.getState());e&&ZN.getState().retry(e.id)},className:`mt-0.5 inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(kn,{className:`h-3 w-3`}),e(`Retry`)]}):null}function lre(e,t){return KB(Y5(e),t)}var Q5=`flex items-center gap-1 text-[11px] text-muted-foreground transition-opacity hover:text-foreground`;function ure({messageIndex:e}){let{t}=K(),n=NN();return ZN(e=>{let t=Y5(e);return qB(t,n,t?WB(e.conversations,t.id):1)})?(0,G.jsxs)(`button`,{type:`button`,className:Q5,title:t(`Keep this session and start a parallel one from here`),onClick:()=>{let t=ZN.getState(),n=Y5(t);n&&t.forkFromTurn(n.id,e)},children:[(0,G.jsx)(qt,{className:`h-3 w-3`}),t(`Conversation branch`)]}):null}function dre({messageIndex:e}){let{t}=K(),n=NN(),r=ZN(e=>Y5(e)?.id),i=ZN(t=>{let i=r?t.conversations[r]:void 0;if(n||!i||i.historyOnly||i.rewinding||i.restoringFiles||i.workspaceMigrating)return;let a=i.messages[e-(i.historyBaseIndex??0)];return m6(a)||i.status===`running`&&h6(a)?a?.deliveryId:void 0});return!r||!i?null:(0,G.jsxs)(`button`,{type:`button`,title:t(`Withdraw message`),onClick:()=>ZN.getState().withdrawMessage(r,{kind:`delivery`,id:i}),className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,G.jsx)(Xn,{className:`h-3 w-3`}),t(`Withdraw message`)]})}function fre(){let{t:e}=K(),t=ZN(e=>Y5(e)?.id);return t?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>void VW(t,e),className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,G.jsx)(jn,{className:`h-3 w-3`}),e(`Restart conversation`)]}):null}function pre({messageIndex:e}){let{t}=K(),n=NN(),r=ZN(e=>Y5(e)?.id),i=ZN(t=>{let i=r?t.conversations[r]:void 0;if(n||!i||i.historyOnly)return;let a=i.messages[e-(i.historyBaseIndex??0)];return m6(a)?a?.deliveryId:void 0});return!r||!i?null:(0,G.jsxs)(`button`,{type:`button`,title:t(`Resend`),onClick:()=>ZN.getState().resendMessage(r,i),className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,G.jsx)(kn,{className:`h-3 w-3`}),t(`Resend`)]})}function mre({messageIndex:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(null),o=NN(),s=o?.botControls,c=ZN(t=>{if(o?.botControls)return!1;let n=Y5(t);return lre(t,o)&&!!(n&&YB(n.id,n.id,n,e))}),l=()=>{if(!s||!o?.canRewind||!o.sessionId)return null;let t=s.projection();return!t||t.status===`running`?null:YB(o.sessionId,o.sessionId,t,e)?.entryId??null},u=(0,H.useSyncExternalStore)(s?.subscribe??X5,l,l);if(!(s?u!==null:c))return null;let d=t=>{if(s&&o?.sessionId&&u){a({restoreFiles:t,conversationId:o.sessionId,entryId:u});return}let n=Y5(ZN.getState());if(!n)return;let r=YB(n.id,n.id,n,e);r&&a({restoreFiles:t,conversationId:n.id,entryId:r.entryId})},f=(t,n,r)=>{if(s)return s.rewind(r,t);let i=ZN.getState(),a=YB(n,Y5(i)?.id,i.conversations[n],e,r);a&&i.rewind(a.conversationId,a.entryId,t)},p=[{icon:Xn,label:t(`Conversation only`),desc:t(`Rewind to this message`),restoreFiles:!1,action:()=>d(!1)},{icon:An,label:t(`Conversation + files`),desc:t(`Rewind and restore files to before this turn`),restoreFiles:!0,action:()=>d(!0)}];return(0,G.jsxs)(q3,{open:n,onOpenChange:r,children:[(0,G.jsxs)(J3,{className:Q5,title:t(`Rewind to this message`),children:[(0,G.jsx)(Xn,{className:`h-3 w-3`}),t(`Rewind`)]}),(0,G.jsx)(Y3,{side:`bottom`,align:`end`,className:`w-72 [&_[data-slot=popover-viewport]]:p-1`,children:p.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{r(!1),e.action()},className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-muted/60`,children:[(0,G.jsx)(e.icon,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block`,children:e.label}),(0,G.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.desc})]})]},e.label))}),(0,G.jsx)(Z6,{open:i!==null,onOpenChange:e=>{e||a(null)},title:t(`Rewind to this message?`),description:i?.restoreFiles?t(`Later messages leave the current branch and working-tree files are restored to before this turn.`):t(`Later messages leave the current branch; the text returns to the input box.`),confirmLabel:t(`Rewind`),onConfirm:()=>{i&&f(i.restoreFiles,i.conversationId,i.entryId)}})]})}function hre({turnKey:e,text:t,timestamp:n,turnDurationMs:r,onToggle:i}){let{t:a}=K();return(0,G.jsxs)(`div`,{"data-quote-skip":``,className:`flex items-center gap-1.5 text-[11px] text-muted-foreground/80 select-none`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i?.(e,!1),className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground cursor-pointer border border-border/40`,title:a(`Expand`),children:[(0,G.jsx)(_t,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{children:a(`Expand`)})]}),(0,G.jsx)($5,{text:t}),typeof n==`number`&&(0,G.jsx)(`span`,{children:n7(n)}),r!==void 0&&(0,G.jsxs)(`span`,{children:[`· `,a(`took {{duration}}`,{duration:wN(r)})]})]})}function $5({text:e}){return e.trim()?(0,G.jsx)(`span`,{"data-enso":`copy-user-prompt`,className:`inline-flex`,children:(0,G.jsx)(e7,{text:lk(e),className:`opacity-0 transition-opacity group-hover/user:opacity-100 focus-visible:opacity-100`})}):null}function gre({turnKey:e,messageIndex:t,text:n,timestamp:r,canCollapse:i,deliveryState:a,onToggleTurn:o}){let{t:s}=K(),c=T(e=>e.autoCollapseTurns);return(0,G.jsxs)(`div`,{"data-quote-skip":``,className:`flex items-center gap-2 text-[11px] text-muted-foreground/75 select-none`,children:[(0,G.jsx)(mre,{messageIndex:t}),(0,G.jsx)(pre,{messageIndex:t}),(0,G.jsx)(dre,{messageIndex:t}),(0,G.jsx)($5,{text:n}),a&&(0,G.jsx)(`span`,{children:s(a===`stuck`?`Not sent: the previous turn is stuck and could not be interrupted. Restart the conversation, then resend.`:a===`rejected`?`Not sent`:`Delivery unconfirmed`)}),a===`stuck`&&(0,G.jsx)(fre,{}),c&&i&&o&&(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e,!0),className:W(Q5,`cursor-pointer opacity-0 group-hover/user:opacity-100`),title:s(`Collapse`),children:[(0,G.jsx)(gt,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{children:s(`Collapse`)})]}),typeof r==`number`&&(0,G.jsx)(`span`,{children:n7(r)})]})}function _re({item:e,searchQuery:t=``,activeNth:n=-1}){let{t:r}=K(),i=NN(),a=e.perf?vre(e.perf,r,e.turnDurationMs!==void 0):``,o=ZN(e=>Y5(e)?.id??null),s=Number(e.key.split(`-`)[0]),c={text:e.text,messageIndex:s,sessionId:i?i.sessionId:o};return(0,G.jsxs)(`div`,{"data-enso":`message-assistant`,className:`group text-(length:--chat-body-size)`,children:[(0,G.jsx)(C3,{text:e.text,streaming:e.streaming,searchQuery:t,activeNth:n,leaf:{messageIndex:c.messageIndex,sessionId:c.sessionId}}),e.turnEnd&&!e.streaming&&i?.turnFooter?.(Number(e.key.split(`-`)[0])),!e.streaming&&(0,G.jsxs)(`div`,{"data-quote-skip":``,className:`mt-1 flex items-center gap-2 text-[11px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`,children:[(0,G.jsx)(CO,{position:`left`,...c}),(0,G.jsx)(e7,{text:e.text}),(0,G.jsx)(CO,{position:`right`,...c}),e.turnEnd&&(0,G.jsx)(ure,{messageIndex:Number(e.key.split(`-`)[0])}),e.timestamp&&!e.turnEnd&&(0,G.jsx)(`span`,{children:n7(e.timestamp)}),e.turnDurationMs!==void 0&&(0,G.jsxs)(`span`,{children:[e.timestamp&&!e.turnEnd&&`· `,r(`took {{duration}}`,{duration:wN(e.turnDurationMs)})]}),a&&(0,G.jsxs)(`span`,{children:[`· `,a]})]})]})}function e7({text:e,className:t}){let{t:n}=K(),[r,i]=(0,H.useState)(!1);return(0,G.jsx)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),1e3)})},className:W(`flex items-center gap-1 transition-colors hover:text-foreground`,t),title:n(`Copy`),children:r?(0,G.jsx)(ht,{className:`h-3 w-3`}):(0,G.jsx)(Nt,{className:`h-3 w-3`})})}var t7=e=>String(e).padStart(2,`0`),n7=e=>{let t=new Date(e);return`${t7(t.getHours())}:${t7(t.getMinutes())}`},r7=e=>{let t=e/1e3;return String(t<10?Math.round(t*10)/10:Math.round(t))};function vre(e,t,n=!1){let r=[];return(!n||e.turnMs!==void 0)&&r.push(`${r7(e.runMs)}s`),e.ttftMs!==void 0&&r.push(`TTFT ${r7(e.ttftMs)}s`),e.tps!==void 0&&r.push(`${Math.round(e.tps)} tok/s`),!n&&e.turnMs!==void 0&&r.push(t(`total {{duration}}`,{duration:wN(e.turnMs)})),r.join(` · `)}function yre(e,t,n=16){return e.top<t.top?e.top-t.top-n:e.bottom>t.bottom?e.bottom-t.bottom+n:0}function bre(e){let t=e.parentElement;for(;t;){if(t.hasAttribute(`data-virtuoso-scroller`))return t;let e=typeof window.getComputedStyle==`function`?window.getComputedStyle(t).overflowY:t.style.overflowY;if(e===`auto`||e===`scroll`||e===`overlay`)return t;t=t.parentElement}return null}function xre({itemKey:e,text:t,streaming:n,durationMs:r,startedAt:i}){let{t:a}=K(),o=T(e=>e.expandLiveReasoning),[s,c]=(0,H.useState)(null),l=tV(s,n,o),u=(0,H.useRef)(null),d=(0,H.useRef)(!1);return(0,H.useLayoutEffect)(()=>{if(l||!d.current)return;d.current=!1;let e=u.current;if(!e)return;let t=bre(e);if(!t){e.getBoundingClientRect().top<0&&e.scrollIntoView?.({block:`nearest`});return}let n=yre(e.getBoundingClientRect(),t.getBoundingClientRect());n!==0&&(t.scrollTop=Math.max(0,t.scrollTop+n))},[l]),(0,G.jsxs)(`div`,{ref:u,"data-enso":`thinking`,"data-live":n||void 0,children:[(0,G.jsxs)(`button`,{type:`button`,"data-quote-skip":``,onClick:()=>c(!l),className:W(`flex min-h-6 select-none items-center gap-2 text-[13px] transition-colors hover:text-foreground`,G5),children:[(0,G.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,G.jsx)(ft,{className:W(`size-3`,n&&`animate-pulse text-brand`)})}),n?(0,G.jsx)(`span`,{className:W(`text-foreground`,K5),children:a(`Thinking…`)}):r===null?(0,G.jsx)(`span`,{children:a(`Thought process`)}):(0,G.jsx)(`span`,{children:a(`Thought for {{duration}}`,{duration:wN(r)})}),n&&(0,G.jsx)(s7,{itemKey:e,since:i}),(0,G.jsx)(_t,{className:W(`h-3 w-3 transition-transform`,l&&`rotate-90`)})]}),l&&(0,G.jsx)(Bte,{text:t,streaming:n,itemKey:e}),l&&!n&&(0,G.jsxs)(`button`,{type:`button`,"data-enso":`thinking-collapse`,"data-quote-skip":``,onClick:()=>{d.current=!0,c(!1)},className:W(`mt-1 ml-[31px] flex min-h-6 select-none items-center gap-1 text-[12px] transition-colors hover:text-foreground`,G5),children:[(0,G.jsx)(yt,{className:`h-3 w-3`}),(0,G.jsx)(`span`,{children:a(`Collapse thinking`)})]})]})}function Sre({item:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(void 0),o=/^Background task (\S+) finished \((.+?), ran (.+?)\)/.exec(e.summary),s=o?`${o[1]} · ${o[2]} · ${o[3]}`:e.summary,c=/(?:read ((?:\/|[A-Za-z]:[\\/]).+?\.log) for the complete log|Full log: ((?:\/|[A-Za-z]:[\\/])\S+?\.log))/.exec(e.detail)?.slice(1).find(Boolean)??null;return(0,H.useEffect)(()=>{!n||!c||i!==void 0||window.electronAPI.files.read(c).then(e=>{a(typeof e==`string`?e:null)}).catch(()=>a(null))},[n,c,i]),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-3`,title:e.detail,children:[(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,G.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground`,children:[(0,G.jsx)(ht,{className:`h-3 w-3 text-green-600 dark:text-green-500`}),s,(0,G.jsx)(_t,{className:W(`h-3 w-3 transition-transform`,n&&`rotate-90`)})]}),(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`})]}),n&&(0,G.jsxs)(`div`,{className:`mt-1.5 rounded-lg border border-border/60 bg-muted/20`,children:[(0,G.jsx)(`pre`,{className:`border-b border-border/60 px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:e.detail}),(0,G.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 py-2 font-mono text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:c?i===void 0?t(`Loading…`):i6(i??t(`(log unavailable)`)):t(`(no log available)`)})]})]})}function Cre({state:e}){let{t}=K();return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(on,{className:`h-3 w-3 animate-spin`}),(0,G.jsx)(`span`,{children:t(e===`queued`?`Compacts after this turn`:`Compacting…`)})]})}function wre({item:e}){let{t}=K(),[n,r]=(0,H.useState)(!1),i=e.kind===`compaction`,a=e.tokensBefore===null?null:CN(e.tokensBefore),o=Q6(e.tokensBefore,e.tokensAfter),s=o!==null&&e.tokensBefore!==null&&e.tokensAfter!==void 0?t(`{{kind}} · {{before}} → {{after}} · freed {{percent}}%`,{kind:t(e.memory?`Memory context compacted`:e.verified?`Verified context compacted`:`Context compacted`),before:CN(e.tokensBefore),after:CN(e.tokensAfter),percent:o}):e.memory?a===null?t(`Memory context compacted`):t(`Memory context compacted ({{tokens}} tokens before)`,{tokens:a}):e.verified?a===null?t(`Verified context compacted`):t(`Verified context compacted ({{tokens}} tokens before)`,{tokens:a}):a===null?t(`Context compacted`):t(`Context compacted ({{tokens}} tokens before)`,{tokens:a});return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:W(`flex items-center gap-3`,i&&`w-full`),title:e.memory?t(`Summary rendered from continuous memory. Messages above are no longer in the model context; use recall for sources.`):e.verified?t(`Verified summary from smart compaction. Messages above are no longer in the model context.`):t(i?`Messages above are no longer in the model context; only this summary is.`:`Latest compaction summary — expand to read what the model kept.`),children:[i&&(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,G.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground`,children:[(0,G.jsx)(gn,{className:`h-3 w-3`}),s,(0,G.jsx)(_t,{className:W(`h-3 w-3 transition-transform`,n&&`rotate-90`)})]}),i&&(0,G.jsx)(`span`,{className:`h-px flex-1 bg-border`})]}),n&&(0,G.jsx)(`pre`,{className:`mt-1.5 max-h-80 overflow-auto rounded-lg border border-border/60 bg-muted/20 px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:e.summary||t(`(summary unavailable)`)})]})}function Tre({item:e,onToggle:t}){let{t:n}=K(),r=T(e=>e.compactReadOnlyTools),i=[];e.stats.commands>0&&i.push(n(`ran {{count}} commands`,{count:e.stats.commands})),e.stats.reads>0&&i.push(n(`read {{count}} files`,{count:e.stats.reads})),e.stats.searches>0&&i.push(n(`searched {{count}} times`,{count:e.stats.searches})),e.stats.others>0&&i.push(n(`{{count}} other calls`,{count:e.stats.others}));let a=[];r&&(e.stats.reads>0&&a.push(n(`{{count}} files`,{count:e.stats.reads})),e.stats.searches>0&&a.push(n(`{{count}} searches`,{count:e.stats.searches})));let o=e.activity,s=[];o&&(o.thinking>0&&s.push(n(`{{count}} thinking steps`,{count:o.thinking})),e.count>0&&s.push(n(`{{count}} tool calls`,{count:e.count})));let c=e.explore,l=e.exploring||!!(o&&e.live),u=e.notice===`patrol`?n(`Patrol clear`):e.notice===`seen`?n(`Update seen`):null,d=c?Fs(`explore_fold`,n):u||(o?n(`Worked for {{duration}}`,{duration:wN(o.workedMs)}):r?e.exploring?n(`Exploring`):n(`Explored`):n(`{{count}} tool calls`,{count:e.count})),f=c?[c.goal,n(`{{count}} tool calls`,{count:e.count})].filter(Boolean):u?s:e.summary&&!e.exploring?[e.summary]:o?s:r?a:i,p=(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{c?.steps&&t?.(MH(e.key)),t?.(e.key)},title:c?.goal,"data-explore-head":c?``:void 0,"data-enso":`tool-row`,"data-notice":e.notice,className:W(`group/step flex min-h-6 w-full items-center gap-2 text-left text-[13px] transition-colors hover:text-foreground`,G5),children:[(0,G.jsx)(K8,{state:e.exploring?`running`:`ok`}),(0,G.jsx)(`span`,{className:W(`shrink-0 text-muted-foreground group-hover/step:text-foreground`,l&&W(K5,`text-foreground`),e.exploring&&`font-medium`),children:d}),(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate`,l&&K5),children:f.join(` · `)}),(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 transition-transform`,e.expanded&&`rotate-90`)})]});return!c||!e.expanded?p:(0,G.jsxs)(G.Fragment,{children:[p,(0,G.jsxs)(`div`,{"data-slot":`tool-details`,className:`t-acc-reveal mt-1 mb-1.5 ml-5 overflow-hidden rounded-lg border border-border/70 bg-card text-sm shadow-xs`,children:[c.goal&&(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[11px] text-muted-foreground`,children:n(`Goal`)}),(0,G.jsx)(`p`,{className:`whitespace-pre-wrap`,children:c.goal})]}),c.report&&(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[11px] text-muted-foreground`,children:n(`Result`)}),(0,G.jsx)(C3,{text:c.report})]}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t?.(MH(e.key)),className:`flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 transition-transform`,c.steps&&`rotate-90`)}),(0,G.jsx)(`span`,{children:c.steps?n(`Hide process`):n(`Show process`)}),(0,G.jsxs)(`span`,{children:[`· `,n(`{{count}} tool calls`,{count:e.count})]})]})]})]})}function i7({children:e,className:t,follow:n}){let r=(0,H.useRef)(null),i=(0,H.useRef)(null),a=(0,H.useRef)(n),o=(0,H.useRef)(n),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useRef)(0);o.current=n;let u=(0,H.useCallback)(()=>{a.current=!1,s.current=null,cancelAnimationFrame(l.current)},[]),d=(0,H.useCallback)(()=>{!o.current||!a.current||(cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{let e=r.current;if(!e||!o.current||!a.current)return;let t=Math.max(0,e.scrollHeight-e.clientHeight);s.current=t,e.scrollTop=t}))},[]);return(0,H.useEffect)(()=>{n?(a.current=!0,d()):(s.current=null,cancelAnimationFrame(l.current))},[n,d]),(0,H.useEffect)(d),(0,H.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(d);return t.observe(e),()=>t.disconnect()},[d]),(0,H.useEffect)(()=>()=>cancelAnimationFrame(l.current),[]),(0,G.jsx)(`div`,{ref:r,onWheel:e=>{e.deltaY<0&&u()},onPointerDown:e=>{e.target===e.currentTarget&&u()},onTouchStart:e=>{c.current=e.touches[0]?.clientY??null},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&c.current!==null&&t>c.current&&u(),c.current=t??null},onTouchEnd:()=>{c.current=null},onScroll:e=>{if(!o.current)return;let t=e.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight<=2){a.current=!0,s.current=null;return}let n=s.current;if(n!==null&&t.scrollTop>=n-2){s.current=null,d();return}u()},className:W(`max-h-96 overflow-auto [overflow-anchor:none]`,t),children:(0,G.jsx)(`div`,{ref:i,children:e})})}function Ere(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function Dre({source:e,output:t,view:n}){let r=n?.status===`completed`?Ere(n.value):n?.error??t;return(0,G.jsxs)(`div`,{className:`space-y-1 px-3 py-1`,children:[e?(0,G.jsx)(h0,{code:e,language:`javascript`}):null,n&&n.calls.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...new Map(n.calls.map(e=>[e.name,e])).keys()].map(e=>{let t=n.calls.filter(t=>t.name===e),r=t.find(e=>!e.ok),i=`${e} ×${t.length}`;return(0,G.jsx)(`span`,{className:W(`rounded-md border px-1.5 py-0.5 font-mono text-[10px]`,r?`border-destructive/40 text-destructive`:`text-muted-foreground`),title:t.map(e=>e.summary).filter(Boolean).join(`
277
+ `),children:r?`${i} · ${r.error??`error`}`:i},e)})}):null,r?n?.status===`completed`&&typeof n.value!=`string`?(0,G.jsx)(h0,{code:r,language:`json`}):(0,G.jsx)(`pre`,{className:`font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:i6(r)}):null,n?.console?(0,G.jsx)(`pre`,{className:`border-l-2 pl-2 font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:i6(n.console)}):null]})}function a7({path:e,fallback:t}){let[n,r]=(0,H.useState)(!1);return n?t:(0,G.jsx)(`div`,{"data-slot":`read-image`,className:`w-full min-w-0 px-3 py-3`,children:(0,G.jsx)(BG,{src:f(e),onError:()=>r(!0),frameClassName:`block w-full`,className:`mx-auto block max-h-80 max-w-full rounded-md bg-muted/40 object-contain`})})}function Ore({item:e}){let{t}=K(),n=NN(),r=T(e=>e.compactReadOnlyTools),i=T(e=>e.expandLiveEdits),a=r&&e.name!==`bash`&&OH(e),o=!!(e.edits&&e.edits.length>0),s=!!e.writeContent,c=!!(e.fileChanges&&e.fileChanges.length>0),l=e.sandbox??null,u=e.state===`error`?null:e.sentMessage,d=!!e.imagePath&&e.state!==`error`,f=Ps[e.name],p=Tz(e.name),m=e.state!==`error`&&e.todos?.length===0,h=m?t(`Todo list cleared`):e.subagentOp?[t(Is[e.subagentOp]),e.summary].filter(Boolean).join(` · `):e.summary,g=e.nestedPending&&e.state===`running`?`${h} · ${e.nestedPending} pending`:l?.calls.length&&e.state!==`error`?yV(l.calls):h,_=!m&&!!(e.output||e.source||u||e.ask),v=e.state===`running`&&e.waiting===`subagent`&&!n,y=o||s||c||_||v||d,b=i&&(o||s||d)&&e.state===`running`,[x,S]=(0,H.useState)(b),[C,w]=(0,H.useState)(!1),E=(0,H.useRef)(null),D=O5();(0,H.useEffect)(()=>{if(!C)return;let t=E.current;if(!t)return;let n=e.key,r=D.report,i=new IntersectionObserver(([e])=>r(n,e?.isIntersecting===!0),{root:D.scroller.current});return i.observe(t),()=>{i.disconnect(),r(n,!1)}},[C,e.key,D]);let O=x&&e.name===`memory_search`?Wz(e.output):null,k=x&&e.name===`memory_capture`?Gz(e.output,e.memoryContent):null,A=x&&e.name===`subagent`&&e.state!==`error`?t5(e.subagentOp,e.output):null,j=e.name===`subagent`&&e.state===`error`?r5(e.output):null,M=(0,H.useRef)(c);return(0,H.useEffect)(()=>{let t=eV(e,M.current);M.current=c,(b||i&&t)&&S(!0)},[b,i,c,e]),e.todos&&e.todos.length>0?(0,G.jsx)(jre,{todos:e.todos}):e.name.startsWith(`goal_`)?(0,G.jsx)(kre,{item:e}):e.plan&&e.state!==`error`?(0,G.jsx)(Are,{plan:e.plan}):(0,G.jsxs)(`div`,{ref:E,"data-enso":`tool-row`,"data-tool-style":a?`compact`:`full`,"data-user-open":C?`true`:void 0,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!y,onClick:()=>{let t=!x;S(t),w(t),D.report(e.key,t)},className:W(`group/step flex min-h-6 min-w-0 flex-1 items-center gap-2 text-left text-[13px]`,G5,y&&`cursor-pointer`),children:[(0,G.jsx)(K8,{state:e.state}),(0,G.jsx)(`span`,{className:W(`shrink-0 text-muted-foreground transition-colors group-hover/step:text-foreground`,e.state===`running`&&W(K5,`text-foreground`)),children:f?t(f):p?.tool??e.name}),(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1 truncate font-mono text-[12px]`,e.state===`error`?`text-destructive`:`text-muted-foreground`,e.state===`running`&&K5),children:e.state===`error`&&e.output?h&&e.name===`apply_patch`&&c?`${g} · ${Rre(e.output)}`:j?t(j):zW(i6(e.output)):h?g:null}),e.backgroundTaskId&&(0,G.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,title:e.backgroundTaskId,children:t(`Moved to background`)}),e.shellFailure&&e.state!==`running`&&(0,G.jsx)(H8,{failure:e.shellFailure}),e.dcgWarning&&(0,G.jsx)(U8,{warning:e.dcgWarning}),e.state===`reviewing`?(0,G.jsx)(`span`,{className:W(`shrink-0 text-[11px] text-foreground`,K5),children:t(`Assistant reviewing…`)}):e.state===`running`&&e.startedAt!==null?(0,G.jsxs)(G.Fragment,{children:[e.callId&&(e.name===`bash`||e.name===`powershell`)&&(0,G.jsx)(Lre,{callId:e.callId,startedAt:e.startedAt,output:e.output??``}),(0,G.jsx)(s7,{itemKey:e.key,since:e.startedAt??void 0})]}):(e.agentMeta||e.durationMs!==null)&&(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:[e.agentMeta?.modelId,e.agentMeta?.outputTokens?`${e.agentMeta.outputTokens} tok`:null,e.durationMs===null?null:wN(e.durationMs)].filter(Boolean).join(` · `)}),y&&(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 text-muted-foreground opacity-0 transition-[opacity,transform] group-hover/step:opacity-100`,x&&`rotate-90 opacity-100`)})]}),e.state===`running`&&e.callId&&!n&&(0,G.jsx)(Mre,{callId:e.callId,waiting:!!e.waiting}),(o||s||c)&&(e.state===`ok`||c)&&(0,G.jsx)(`button`,{type:`button`,title:t(`Open in side panel`),className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:()=>o0(),children:(0,G.jsx)(Jt,{className:`h-3 w-3`})})]}),e.generatedImages?.length?(0,G.jsx)(`div`,{"data-slot":`generated-images`,className:`mt-2 mb-3 ml-5 grid gap-3`,children:e.generatedImages.map(e=>(0,G.jsx)(a7,{path:e,fallback:(0,G.jsx)(`p`,{className:`break-all px-3 py-2 text-xs text-muted-foreground`,children:e})},e))}):null,x&&y&&(0,G.jsxs)(`div`,{"data-slot":`tool-details`,className:`t-acc-reveal mt-1 mb-1.5 ml-5 overflow-hidden rounded-lg border border-border/70 bg-card shadow-xs`,children:[p&&(0,G.jsxs)(`div`,{className:`truncate border-b border-border/60 px-3 py-1 font-mono text-[10px] text-muted-foreground`,children:[p.server,`.`,p.tool]}),v&&(0,G.jsx)(Ire,{agentIds:e.subagentTitles?Object.keys(e.subagentTitles):void 0}),o&&e.edits&&(0,G.jsx)(i7,{follow:e.state===`running`,children:(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(k5,{path:e.summary,blocks:e.edits})})}),c&&e.fileChanges&&(0,G.jsx)(i7,{follow:e.state===`running`,children:e.fileChanges.map((e,n)=>(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:W(`flex items-center gap-2 border-border/60 px-3 py-1 font-mono text-[10px] text-muted-foreground`,(n>0||o)&&`border-t`),children:[(0,G.jsx)(`span`,{className:`uppercase`,children:e.type}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.path,children:e.path}),e.truncated&&(0,G.jsx)(`span`,{children:t(`Truncated preview`)})]}),(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(k5,{path:e.path,blocks:[e],snapshot:e})})]},`${e.type}:${t6(e.path,e.oldText,e.newText)}`))}),nV(e)&&(0,G.jsx)(i7,{follow:!1,className:`border-t border-border/60`,children:(0,G.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:i6(e.output??``)})}),s&&e.writeContent&&(0,G.jsx)(i7,{follow:e.state===`running`,className:W((o||c)&&`border-t border-border/60`),children:(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(A5,{path:e.summary,contents:e.writeContent})})}),!o&&!s&&!c&&(_||d)&&(0,G.jsxs)(i7,{follow:e.state===`running`,children:[bV(e.name)?(0,G.jsx)(Dre,{source:e.source,output:e.output,view:l}):e.name===`bash`||e.name===`powershell`?(0,G.jsx)(o5,{command:e.summary,output:e.output??``,failure:e.shellFailure}):e.name===`read`&&d&&e.imagePath?(0,G.jsx)(a7,{path:e.imagePath,fallback:(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(A5,{path:e.summary,contents:e.output??``})})},e.imagePath):e.name===`image_view`&&e.state===`ok`?(0,G.jsx)(p5,{image:e.image,output:e.output}):e.name===`read`?(0,G.jsx)(H.Suspense,{fallback:null,children:(0,G.jsx)(A5,{path:e.summary,contents:e.output??``})}):e.name===`subagent`&&e.state!==`error`&&!u&&!A?(0,G.jsx)(`div`,{className:`px-3 py-2 text-sm`,children:(0,G.jsx)(C3,{text:e.output??``})}):O?(0,G.jsx)($6,{hits:O}):k?(0,G.jsx)(e8,{view:k}):(0,G.jsxs)(G.Fragment,{children:[e.ask&&(0,G.jsx)(j6,{ask:e.ask,waiting:e.state===`running`}),u&&(0,G.jsx)(`div`,{className:`px-3 py-2 text-sm`,children:(0,G.jsx)(C3,{text:u})}),A?(0,G.jsx)(J8,{view:A,titles:e.subagentTitles}):e.output&&(0,G.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:i6(e.output)})]}),(0,G.jsx)(k8,{value:e.rtk}),(0,G.jsx)(A6,{value:e.approvalReview})]})]})]})}function kre({item:e}){let{t}=K(),n=e.name.replace(`goal_`,``),r=t(n===`complete`?`Goal completed`:n===`blocked`?`Goal blocked`:`Goal waiting`);return(0,G.jsxs)(`div`,{className:W(`flex items-start gap-2 rounded-lg border px-3 py-2 text-sm`,n===`complete`&&`border-green-500/50 bg-green-500/5`,n===`blocked`&&`border-destructive/50 bg-destructive/5`,n===`wait`&&`border-amber-500/50 bg-amber-500/5`),children:[(0,G.jsx)(Jn,{className:W(`mt-0.5 h-4 w-4 shrink-0`,n===`complete`&&`text-green-600 dark:text-green-500`,n===`blocked`&&`text-destructive`,n===`wait`&&`text-amber-500`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`font-medium`,children:r}),e.summary&&(0,G.jsx)(`p`,{className:`mt-0.5 whitespace-pre-wrap text-muted-foreground text-xs`,children:e.summary})]})]})}function Are({plan:e}){let{t}=K(),[n,r]=(0,H.useState)(!1);return(0,G.jsxs)(`div`,{className:`rounded-lg border border-border/60 bg-muted/30 px-3 py-2`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 text-left text-xs`,children:[(0,G.jsx)(kt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium text-muted-foreground`,children:t(`Plan`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,G.jsx)(_t,{className:W(`h-3 w-3 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,G.jsx)(`div`,{className:`mt-2 border-border/60 border-t pt-2 text-sm`,children:(0,G.jsx)(C3,{text:e.text})})]})}function jre({todos:e}){let{t}=K(),n=e.filter(e=>e.status===`completed`).length;return(0,G.jsxs)(`div`,{"data-enso":`todo`,className:`rounded-lg border bg-card px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:t(`Todos`)}),(0,G.jsxs)(`span`,{className:`ml-auto tabular-nums`,children:[n,`/`,e.length]})]}),(0,G.jsx)(l5,{done:n,total:e.length,className:`mt-1.5 mb-2`}),(0,G.jsx)(c5,{todos:e})]})}var o7=new Map;function Mre({callId:e,waiting:t}){let{t:n}=K(),r=ZN(e=>Y5(e)?.id??``),[i,a]=(0,H.useState)(!1);if((0,H.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>a(!1),5e3);return()=>clearTimeout(e)},[i]),!r)return null;let o=n(t?i?`Stopping wait…`:`Stop waiting`:i?`Moving to background…`:`Move to background`);return(0,G.jsxs)(`button`,{type:`button`,disabled:i,title:o,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-60`,onClick:()=>{a(!0),window.electronAPI.agent.backgroundTool(r,e).then(e=>{e.ok||a(!1)},()=>a(!1))},children:[(0,G.jsx)(t?Rn:it,{className:`h-3 w-3`}),o]})}var Nre=5e3,Pre=[];function Fre(e,t){if(e.status===`queued`)return t(`Queued`);let n=e.activity;return n?.phase===`tool`?[n.tool,n.detail].filter(Boolean).join(` `):n?.phase===`writing`?t(`Writing reply…`):t(`Thinking…`)}function Ire({agentIds:e}){let{t}=K(),n=ZN(e=>Y5(e)?.id??``),r=g6(e=>e.byConversation[n]??Pre),[i,a]=(0,H.useState)(!1);if((0,H.useEffect)(()=>{if(!n)return;let e=!0,t=t=>{e&&(g6.getState().replace(n,t),a(!0))},r=()=>window.electronAPI.agent.subagentProgress(n).then(t,()=>{}),i=window.electronAPI.agent.onSubagentProgress(e=>{e.sessionId===n&&t(e.runs)});r();let o=setInterval(r,Nre);return()=>{e=!1,clearInterval(o),i()}},[n]),!i)return null;let o=e?.length?r.filter(t=>e.includes(t.agentId)):r;return(0,G.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2 text-xs`,children:[o.length===0?(0,G.jsx)(`div`,{className:`text-muted-foreground`,children:t(`No running subagents`)}):o.map(e=>(0,G.jsxs)(`div`,{className:`py-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-medium`,children:e.title??e.agentId.slice(0,8)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground`,children:Fre(e,t)}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:wN(e.elapsedMs)})]}),e.text&&(0,G.jsx)(`div`,{className:`line-clamp-2 break-words pl-2 text-[11px] text-muted-foreground/80`,children:e.text.replace(/\s+/g,` `)})]},e.runId)),(0,G.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground/80`,children:t(`Stopping the wait does not stop subagents; the assistant is notified when they finish.`)})]})}function s7({itemKey:e,since:t}){let n=NN(),r=ZN(e=>Y5(e)?.id??``),i=n?n.sessionId??``:r,a=(0,H.useRef)(null);if(a.current===null){let n=`${i}:${e}`;a.current=t??o7.get(n)??Date.now(),t===void 0&&o7.set(n,a.current)}let o=t??a.current,[,s]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:wN(Date.now()-o)})}function Lre({callId:e,startedAt:t,output:n}){let r=NN(),i=ZN(t=>r?void 0:Y5(t)?.toolDeadlineAt?.[e]);return(0,G.jsx)(B8,{startedAt:t,deadlineAt:i,output:n})}function c7(e){return e.kind===`tool-group`||e.kind===`tool`&&!e.todos?.length&&!e.name.startsWith(`goal_`)}var Rre=e=>i6(e.split(`
278
+ `,1)[0]??``);function zre(e,t,n,r,i=100){if(r||!n)return{hiddenSince:t,delayMs:null};let a=t??e;return{hiddenSince:a,delayMs:Math.max(0,i-(e-a))}}var Bre=1e6;function Vre(e,t,n=Bre){if(t.length===0)return{anchor:null,firstItemIndex:n,remount:!1};if(!e)return{anchor:{keys:t,index:n},firstItemIndex:n,remount:!1};let r=new Map(t.map((e,t)=>[e,t]));for(let n=0;n<e.keys.length;n++){let i=r.get(e.keys[n]);if(i===void 0)continue;let a=e.index+n-i;return{anchor:{keys:t,index:a},firstItemIndex:a,remount:!1}}return{anchor:{keys:t,index:n},firstItemIndex:n,remount:!0}}function Hre(e,t){return t}var Ure=new Set([`text`,`thinking`,`tool`,`tool-group`]);function Wre(e,t,n,r){let i=(0,H.useRef)(RH),[a,o]=(0,H.useState)(()=>Date.now()),s=r.compact,c=r.autoCollapseCompletedTurns,l=r.collapseCompletedActivity===!0,u=r.collapseLiveActivity===!0,d={compact:s,autoCollapseCompletedTurns:c,turnOverrides:r.turnOverrides},f=u?UH(e,t,r,i.current,a):null;i.current=f?.witness??RH;let p=f?.wakeAt??null,m=eU(e,t,n,{...d,collapseCompletedActivity:l,collapseLiveActivity:u,releasedLiveActivity:f?.released,heldOpenTools:r.heldOpenTools,foldToolOnlyTurns:r.foldToolOnlyTurns===!0,readableToolCards:r.readableToolCards===!0});return(0,H.useEffect)(()=>{if(p===null||p<=a)return;let e=window.setTimeout(()=>o(p),p-a);return()=>window.clearTimeout(e)},[p,a]),m}var Gre=[{icon:Mt,title:`Map the project`,hint:`Entry points, modules and key dependencies`,prompt:`Walk me through this project's structure: entry points, module layout and key dependencies.`},{icon:pt,title:`Find potential issues`,hint:`Suspicious logic and unhandled edge cases`,prompt:`Review this project for potential bugs, suspicious logic and unhandled edge cases, and list them by severity.`},{icon:Ht,title:`Add unit tests`,hint:`Cover the core modules with tests`,prompt:`Find the core modules that lack tests and add unit tests for them.`},{icon:An,title:`Summarize recent changes`,hint:`A digest based on git log`,prompt:`Summarize the recent changes in this repository based on git log.`}];function Kre({onPick:e}){let{t}=K();return(0,G.jsx)(`div`,{className:`mx-auto grid w-full max-w-[560px] grid-cols-1 gap-2.5 text-left @min-[36rem]:grid-cols-2`,children:Gre.map(({icon:n,title:r,hint:i,prompt:a})=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>e(t(a)),"data-slot":`welcome-suggestion`,className:`group flex items-start gap-3 rounded-xl border bg-card px-3.5 py-3 text-left shadow-xs transition-[border-color,box-shadow,transform] duration-200 hover:-translate-y-px hover:border-brand/25 hover:shadow-float`,children:[(0,G.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-lg bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(n,{className:`size-3.5`})}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block text-[13px] font-medium`,children:t(r)}),(0,G.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:t(i)})]})]},r))})}var l7=`enso-chat-col mx-auto w-full max-w-2xl px-4 @min-[56rem]:max-w-3xl @min-[72rem]:max-w-4xl @min-[84rem]:max-w-5xl @min-[96rem]:max-w-6xl @min-[112rem]:max-w-7xl`,u7=1e3;function d7({className:e,children:t}){let[n,r]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(e)},[]),(0,G.jsx)(`div`,{className:W(`t-stagger`,n&&`is-shown`,e),children:t})}var f7=40,qre={index:`LAST`,align:`end`},Jre={top:600,bottom:600},Yre=e=>e?`auto`:!1;function Xre({style:e,...t}){let n=e?.visibility===`hidden`,[r,i]=(0,H.useState)(!1),a=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=zre(Date.now(),a.current,n,r);if(a.current=e.hiddenSince,e.delayMs===null)return;let t=window.setTimeout(()=>i(!0),e.delayMs);return()=>window.clearTimeout(t)},[n,r]),(0,G.jsx)(`div`,{...t,style:n&&r?{...e,visibility:`visible`}:e})}function Zre({ref:e,items:t,busy:n,loading:r=!1,running:i,runStartedAt:a,lastOutputAt:o,error:s,emptyTitle:c,emptyDescription:l,onSuggestion:u,onRetryResume:d,onRetrySync:f,virtualize:p=!0,onStartReached:m,historyLoading:h=!1,hasOlder:g,olderCursor:_,searchQuery:v=``,activeHit:y=null,secretarySession:b=!1,secretaryFace:x,quotable:S=!1}){let{t:C}=K(),w=NN(),E=$R(),D=b?x??E:null,O=!w&&D?D:null,k=b,A=(0,H.useRef)(null),[j,M]=(0,H.useState)(!0),[N,P]=(0,H.useState)(!1),F=(0,H.useRef)(!0),I=(0,H.useRef)(null),ee=(0,H.useRef)(null),L=(0,H.useRef)(0),te=(0,H.useRef)(0),R=(0,H.useRef)(null),z=(0,H.useRef)(!1),ne=(0,H.useRef)(!1),re=(0,H.useRef)(0),[B,ie]=(0,H.useState)(null),ae=(0,H.useRef)(0),oe=(0,H.useCallback)(e=>{cancelAnimationFrame(ae.current),ae.current=requestAnimationFrame(()=>ie(e()))},[]);(0,H.useEffect)(()=>()=>cancelAnimationFrame(ae.current),[]);let[se,V]=(0,H.useState)(new Set),ce=(0,H.useRef)(new Set),[le,ue]=(0,H.useState)(()=>new Set),de=(0,H.useCallback)((e,t)=>{let n=ce.current;t!==n.has(e)&&(t?n.add(e):n.delete(e),ue(new Set(n)))},[]),fe=(0,H.useRef)({report:de,scroller:I});fe.current.report=de;let pe=(0,H.useCallback)(e=>{V(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[me,he]=(0,H.useState)(new Map),ge=T(e=>e.autoCollapseTurns),_e=T(e=>e.collapseCompletedActivity),ve=T(e=>e.collapseLiveActivity),ye=T(e=>e.liveActivityFoldDelaySec),be=T(e=>e.compactReadOnlyTools),xe=Wre(t,i,se,{compact:be,autoCollapseCompletedTurns:ge,collapseCompletedActivity:_e,collapseLiveActivity:ve,liveActivityFoldDelaySec:ye,heldOpenTools:le,turnOverrides:me,foldToolOnlyTurns:!w&&k,readableToolCards:k}),Se=(0,H.useRef)({state:tU,collapse:new Map,reveal:new Map}),Ce=(0,H.useMemo)(()=>{let e=Se.current,t=e=>I.current?.querySelector(`[data-nav-key="${CSS.escape(e)}"]`),n=nU(e.state,xe,(e,n)=>{let r=t(e)?.getBoundingClientRect().top,i=t(n)?.getBoundingClientRect().bottom;return r===void 0||i===void 0?0:i-r}),r=Date.now();e.state=n.next;for(let{key:t,...i}of n.collapses)e.collapse.set(t,{at:r,...i});for(let t of n.expands)e.reveal.set(t,r);return n.children},[xe]),we=(0,H.useRef)(null),Te=(0,H.useRef)(0),Ee=(0,H.useRef)(null),De=Vre(we.current,xe.map(e=>e.key));we.current=De.anchor,De.remount&&(Te.current+=1,Ee.current=null);let Oe=De.firstItemIndex,ke=(0,H.useCallback)((e,t)=>{he(n=>n.get(e)===t?n:new Map(n).set(e,t))},[]),Ae=(0,H.useMemo)(()=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(r.kind!==`user`)continue;let i=``;for(let e=n+1;e<t.length;e++){let n=t[e];if(n.kind===`user`)break;if(n.kind===`text`){i=n.text;break}}e.push({key:r.key,question:uk(r.text)||`[image]`,answer:i})}return e},[t]),je=(0,H.useCallback)(()=>{let e=I.current;e&&e.scrollHeight-e.scrollTop-e.clientHeight>2&&(z.current=!0,e.scrollTop=e.scrollHeight)},[]),Me=(0,H.useCallback)(()=>{cancelAnimationFrame(L.current);let e=Date.now()+1200,t=null,n=()=>{cancelAnimationFrame(L.current),z.current=!1,t?.removeEventListener(`touchstart`,n),t?.removeEventListener(`wheel`,n)},r=()=>{if(ne.current){n();return}!t&&I.current&&(t=I.current,t.addEventListener(`touchstart`,n,{passive:!0,once:!0}),t.addEventListener(`wheel`,n,{passive:!0,once:!0})),je(),F.current=!0,M(!0),Date.now()<e?L.current=requestAnimationFrame(r):n()};r(),M(!0),F.current=!0},[je]);(0,H.useEffect)(()=>()=>{cancelAnimationFrame(L.current),cancelAnimationFrame(te.current),window.clearTimeout(re.current)},[]);let Ne=()=>{ne.current=!0,window.clearTimeout(re.current)},Pe=()=>{window.clearTimeout(re.current),re.current=window.setTimeout(()=>{ne.current=!1},400)},Fe=()=>{Ne(),Pe()},Ie=()=>{cancelAnimationFrame(L.current),cancelAnimationFrame(te.current),z.current=!1,F.current=!1,M(!1)},Le=(0,H.useCallback)(e=>{if(R.current?.disconnect(),R.current=null,!e)return;let t=new ResizeObserver(()=>{if(!F.current&&!z.current)return;cancelAnimationFrame(te.current);let e=8,t=()=>{je();let n=I.current;(n?n.scrollHeight-n.scrollTop-n.clientHeight:0)<=2||(--e>0?te.current=requestAnimationFrame(t):Me())};t()});t.observe(e),R.current=t,Me()},[je,Me]);(0,H.useEffect)(()=>()=>R.current?.disconnect(),[]);let Re=e=>xe.findIndex(t=>t.key===e||t.kind===`tool-group`&&p7(t,e)),ze=e=>{if(!p){I.current?.querySelector(`[data-nav-key="${CSS.escape(e)}"]`)?.scrollIntoView({block:`center`});return}let t=Re(e);t>=0&&A.current?.scrollToIndex({index:Hre(Oe,t),align:`center`})},Be=(0,H.useRef)(null),Ve=e=>{if(Ie(),Re(e)>=0){Be.current=null,ze(e);return}let n=null,r=!1;for(let i of t)if(i.kind===`user`&&(n=i.key),i.key===e){r=!0;break}!r||!n||(Be.current=e,ke(n,!1))};(0,H.useLayoutEffect)(()=>{let e=Be.current;!e||Re(e)<0||(Be.current=null,ze(e))},[xe]),(0,H.useImperativeHandle)(e,()=>({scrollToBottom:Me,pinToBottom:je,isAtBottom:()=>F.current,getScroller:()=>p?null:I.current,scrollToKey:Ve}));let He=(0,H.useRef)(!1),Ue=`${_}:${Oe}`,We=(0,H.useRef)(Ue);We.current!==Ue&&(We.current=Ue,He.current=!1);let Ge=()=>{!m||He.current||(He.current=!0,m())};(0,H.useEffect)(()=>{p&&!h&&Ee.current===Oe&&Ge()},[_,h]);let Ke=(0,H.useMemo)(()=>({query:v,activeKey:y?.key??``,activeNth:y?.nth??-1}),[v,y?.key,y?.nth]),qe=(e,t)=>{let n=xe[t+1];if(n!==void 0&&c7(e)&&c7(n))return`pb-0`;if(!be)return`pb-4`;let r=n!==void 0&&W5(n);return W5(e)?r?`pb-1`:`pb-2`:e.kind===`text`&&r?`pb-1`:`pb-4`},Je=(e,t)=>{let n=xe[t-1],r=n?.kind===`user`&&!n.collapsed&&Ure.has(e.kind)?n:void 0,i=Date.now(),a=Se.current.collapse.get(e.key),o=a&&i-a.at<u7?a:void 0,s=Ce.get(e.key),c=s&&Se.current.reveal.get(s.group),l=s&&c!==void 0&&i-c<u7;return(0,G.jsxs)(`div`,{"data-nav-key":e.key,"data-fold-collapse":o?o.pair?`pair`:`toggle`:void 0,style:o?{"--fold-from":`${o.height}px`}:l?{"--fold-i":s.index}:void 0,className:W(l7,qe(e,t),l&&`t-fold-reveal`,`[overflow-wrap:anywhere]`),children:[r&&(0,G.jsx)(ere,{model:r.replyModel,at:r.replyAt,privacyMask:r.replyPrivacyMask,secretarySession:k,face:D}),(0,G.jsx)(rie,{itemKey:e.key,children:(0,G.jsx)(tre,{item:e,secretarySession:k,onToggleGroup:pe,onToggleTurn:ke})})]},e.key)},Ye=(0,H.useRef)(!1);g===!0&&(Ye.current=!0);let Xe=hV(t.length>0,h,g,Ye.current,!p&&N);(0,H.useLayoutEffect)(()=>{if(p){P(!1);return}let e=I.current;P(!!e&&gV(g===!0,h,e.scrollHeight,e.clientHeight))},[p,g,h,Oe,xe.length,t.length]);let Ze={pageChrome:Xe,onLoadMore:Xe===`more`?Ge:void 0,busy:n,loading:!!r,since:rU({loading:!!r,runStartedAt:a,lastOutputAt:o}),error:s,onRetryResume:d};return(0,G.jsx)(iU.Provider,{value:Ke,children:(0,G.jsx)(D5,{value:fe.current,children:(0,G.jsxs)(`div`,{ref:ee,"data-enso":`timeline`,className:`@container relative min-h-24 flex-1`,onWheel:Fe,onKeyDown:Fe,onTouchStart:e=>{I.current?.contains(e.target)&&Ne()},onTouchEnd:Pe,onPointerDown:e=>{e.target===I.current&&(Ne(),window.addEventListener(`pointerup`,Pe,{once:!0}))},children:[(0,G.jsx)(mU,{items:Ae,activeKey:B,onJump:Ve}),S&&(0,G.jsx)(_U,{containerRef:ee}),t.length===0&&!n?(0,G.jsxs)(d7,{className:`flex h-full flex-col items-center justify-center gap-2 overflow-y-auto px-4 text-center`,children:[(0,G.jsx)(`span`,{className:`t-stagger-line t-stagger-line--1 mb-3`,children:O?(0,G.jsx)(cR,{name:O.name,color:O.color,image:O.image,needsYou:0,running:0,size:`lg`,enso:`secretary-chat-avatar`}):(0,G.jsx)(`span`,{className:`flex size-11 items-center justify-center rounded-[13px] border border-brand/20 bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(PN,{className:`size-6`})})}),(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--1 text-[22px] font-semibold tracking-tight`,children:c}),s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--2 max-w-md text-sm text-destructive whitespace-pre-wrap`,children:C(s)}),d&&(0,G.jsx)(Ea,{size:`sm`,variant:`outline`,onClick:d,children:C(`Retry resume`)})]}):(0,G.jsxs)(G.Fragment,{children:[f?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--2 max-w-md text-sm text-muted-foreground`,children:C(`Session is not ready yet — no history to show.`)}),(0,G.jsx)(Ea,{size:`sm`,variant:`outline`,onClick:f,children:C(`Retry sync`)})]}):l===``?null:(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--2 text-sm text-muted-foreground`,children:l??C(`Ask the agent…`)}),u&&(0,G.jsx)(`div`,{className:`t-stagger-line t-stagger-line--3 mt-5 w-full`,children:(0,G.jsx)(Kre,{onPick:u})})]})]}):t.length===0&&s?(0,G.jsxs)(d7,{className:`flex h-full flex-col items-center justify-center gap-2 text-center`,children:[(0,G.jsx)(`p`,{className:`t-stagger-line t-stagger-line--1 max-w-md text-sm text-destructive whitespace-pre-wrap`,children:C(s)}),d&&(0,G.jsx)(Ea,{size:`sm`,variant:`outline`,onClick:d,children:C(`Retry resume`)})]}):t.length===0?(0,G.jsxs)(`div`,{"data-timeline-loading":``,className:`flex h-full flex-col items-center justify-center gap-2.5 text-center`,children:[(0,G.jsx)(on,{className:`h-5 w-5 animate-spin text-muted-foreground`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:C(`Preparing session…`)})]}):p?(0,G.jsx)(uL,{ref:A,data:xe,defaultItemHeight:80,computeItemKey:(e,t)=>t.key,firstItemIndex:Oe,startReached:Ge,followOutput:Yre,atBottomThreshold:f7,atBottomStateChange:e=>{if(!e&&F.current&&!ne.current){Me();return}M(e),F.current=e},increaseViewportBy:Jre,initialTopMostItemIndex:qre,rangeChanged:({startIndex:e})=>{Ee.current=e,e>Oe+4&&(He.current=!1),oe(()=>{let t=Math.max(0,e-Oe),n=null;for(let e=0;e<=Math.min(t+1,xe.length-1);e++)xe[e]?.kind===`user`&&(n=xe[e].key);return n})},scrollerRef:e=>{I.current=e instanceof HTMLElement?e:null},className:`h-full select-text`,context:Ze,components:$re,itemContent:(e,t)=>Je(t,e-Oe)},Te.current):(0,G.jsx)(`div`,{ref:e=>{I.current=e},onScroll:e=>{let t=e.currentTarget;if(z.current){z.current=!1,F.current=!0,M(!0);return}if(!ne.current){F.current&&je();return}let n=t.scrollHeight-t.scrollTop-t.clientHeight<=f7;n!==F.current&&(F.current=n,M(n)),m&&(t.scrollTop<80&&!He.current?(He.current=!0,m()):t.scrollTop>240&&(He.current=!1))},className:`h-full select-text overflow-y-auto [overflow-anchor:none]`,children:(0,G.jsxs)(`div`,{ref:Le,children:[(0,G.jsx)(m7,{context:Ze}),xe.map((e,t)=>Je(e,t)),(0,G.jsx)(h7,{context:Ze})]})}),!j&&t.length>0&&(0,G.jsxs)(`button`,{type:`button`,onClick:Me,className:`absolute bottom-4 left-1/2 z-10 inline-flex h-7 -translate-x-1/2 items-center gap-1.5 rounded-full border bg-card px-3 text-xs text-muted-foreground shadow-float transition-colors hover:text-foreground`,children:[(0,G.jsx)(at,{className:`h-3 w-3`}),C(`Scroll to bottom`)]})]})})})}function p7(e,t){return e.children.some(e=>e.key===t||e.kind===`tool-group`&&p7(e,t))}function Qre({chrome:e,onLoadMore:t}){let{t:n}=K();return e===`none`?(0,G.jsx)(`div`,{className:`h-6`}):(0,G.jsx)(`div`,{className:W(l7,`flex items-center justify-center gap-2 py-3`),children:e===`loading`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(on,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Loading earlier messages…`)})]}):e===`more`?(0,G.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline-offset-2 hover:underline`,onClick:t,children:n(`Load earlier messages`)}):(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Beginning of conversation`)})})}function m7({context:e}){return(0,G.jsx)(Qre,{chrome:e.pageChrome,onLoadMore:e.onLoadMore})}function h7({context:e}){let{t}=K(),{busy:n,loading:r,since:i,error:a,onRetryResume:o}=e;return(0,G.jsxs)(`div`,{className:W(l7,`pb-6 [overflow-wrap:anywhere]`),children:[n&&(0,G.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 text-[13px]`,children:[(0,G.jsx)(eie,{}),(0,G.jsx)(`span`,{className:`animate-pulse text-foreground motion-reduce:animate-none`,children:t(r?`Loading…`:`Working…`)}),i!==void 0&&(0,G.jsx)(nie,{since:i})]}),a&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-sm text-destructive whitespace-pre-wrap`,children:t(a)}),(0,G.jsx)(Z5,{}),o&&(0,G.jsx)(Ea,{size:`sm`,variant:`outline`,onClick:o,children:t(`Retry resume`)})]})]})}var $re={List:Xre,Header:m7,Footer:h7};function eie(){return(0,G.jsxs)(`span`,{className:`relative flex size-[22px] shrink-0 items-center justify-center`,children:[(0,G.jsx)(`span`,{className:`absolute size-2 animate-ping rounded-full bg-brand/50`}),(0,G.jsx)(`span`,{className:`relative size-2 rounded-full bg-brand`})]})}var tie=e=>{let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m${t%60}s`},nie=(0,H.memo)(function({since:e}){let[,t]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,G.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground tabular-nums`,children:tie(Date.now()-e)})}),rie=class extends H.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidUpdate(e){e.itemKey!==this.props.itemKey&&this.state.failed&&this.setState({failed:!1})}render(){return this.state.failed?(0,G.jsxs)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-1.5 text-xs text-destructive`,children:[`message render failed · `,this.props.itemKey]}):this.props.children}};function iie({retry:e,onCancel:t}){let{t:n}=K(),[r,i]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),500);return()=>clearInterval(e)},[]);let a=Math.max(0,Math.ceil((e.at+e.delayMs-r)/1e3));return(0,G.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 py-1.5 text-xs`,children:[(0,G.jsx)(kn,{className:`h-3.5 w-3.5 shrink-0 animate-spin text-amber-500 [animation-duration:2s]`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.error,children:[e.maxAttempts>0?n(`Auto-retrying ({{attempt}}/{{max}})`,{attempt:e.attempt,max:e.maxAttempts}):n(`Auto-retrying ({{attempt}})`,{attempt:e.attempt}),(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,a>0?n(`retrying in {{seconds}}s`,{seconds:a}):n(`retrying…`),` — `,e.error]})]}),t&&(0,G.jsx)(`button`,{type:`button`,title:n(`Cancel auto-retry`),onClick:t,className:`shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(nr,{className:`h-3.5 w-3.5`})})]})}function g7(e){return e.status===`running`?e.idle?`idle`:e.keep?`kept`:`running`:e.status}function _7(e,t){let n=Math.max(0,Math.floor(e/6e4));if(n<60)return t(`{{n}} min`,{n});let r=Math.floor(n/60),i=n%60;return i===0?t(`{{n}} h`,{n:r}):t(`{{h}} h {{m}} min`,{h:r,m:i})}function aie(e){let t=Math.max(0,Math.floor(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${String(t%60).padStart(2,`0`)}m`}function v7(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function y7(e=3e4){let[t,n]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var oie={ok:`bg-success/15 text-success`,pending:`bg-warning/15 text-warning`,neutral:`bg-muted text-muted-foreground`};function b7({tone:e,children:t,className:n}){return(0,G.jsx)(`span`,{className:W(`shrink-0 rounded px-1 py-px text-[10px]`,oie[e],n),children:t})}function x7(e,t,n){return n(`Idle {{duration}}`,{duration:_7(t-(e.idle?.since??t),n)})}function sie({task:e,now:t}){let{t:n}=K(),r=g7(e);return r===`idle`?(0,G.jsx)(b7,{tone:`pending`,children:x7(e,t,n)}):r===`kept`?(0,G.jsx)(b7,{tone:`neutral`,children:n(`Kept`)}):r===`running`?(0,G.jsx)(b7,{tone:`ok`,children:n(`Running`)}):e.interrupted===`restart`?(0,G.jsx)(b7,{tone:`pending`,children:n(`Interrupted by restart`)}):null}function cie({task:e}){return g7(e)===`idle`?(0,G.jsx)(`span`,{className:`relative flex size-[22px] shrink-0 items-center justify-center rounded-full border border-dashed border-warning/60 text-warning`,children:(0,G.jsx)(hn,{className:`size-3`})}):(0,G.jsx)(G8,{icon:Gn,state:e.status===`running`?`running`:e.status===`failed`?`error`:`ok`})}function lie(e,t){let n=e.keep;if(!n)return;let r=n.reason??v7(n.at);return n.by===`user`?t(`Kept by you · {{detail}}`,{detail:r}):t(`Kept: {{reason}}`,{reason:r})}function uie({task:e,className:t}){let{t:n}=K(),r=g7(e)===`kept`?lie(e,n):void 0;return r?(0,G.jsxs)(`div`,{className:W(`flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground/85`,t),children:[(0,G.jsx)(Cn,{className:`size-3 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,title:r,children:r})]}):null}function S7(e,t){window.electronAPI.agent.stopTask(e,t)}function C7(e,t,n){window.electronAPI.agent.keepTask(e,t,n)}function die({onStop:e,className:t}){let{t:n}=K();return(0,G.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},title:n(`Stop task`),className:W(`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,t),children:n(`Stop`)})}function w7({sessionId:e,taskId:t}){let{t:n}=K();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ea,{size:`xs`,variant:`ghost`,className:`text-muted-foreground`,onClick:n=>{n.stopPropagation(),C7(e,t,``)},children:n(`Keep`)}),(0,G.jsx)(Ea,{size:`xs`,variant:`outline`,className:`hover:text-destructive`,onClick:n=>{n.stopPropagation(),S7(e,t)},children:n(`Stop`)})]})}var fie=[`pattern`,`query`,`path`,`file_path`],pie=[`path`,`file_path`,`query`,`pattern`],mie=[`command`,`cmd`,`script`],hie=[`path`,`file_path`,`pattern`,`query`,`command`,`url`,`description`,`summary`],gie=120;function T7(e){let t=e.replace(/\s+/g,` `).trim();return t.length>gie?`${t.slice(0,119)}…`:t}function _ie(e){let t=e.toLowerCase();return t.includes(`search`)||t.includes(`grep`)||t===`find`?fie:t===`read`||t.endsWith(`_read`)?pie:t===`bash`||t.includes(`shell`)||t.includes(`terminal`)?mie:hie}function vie(e,t){let n=t.trim();if(!n)return``;let r;try{r=JSON.parse(n)}catch{return T7(n)}if(r===null)return``;if(typeof r!=`object`||Array.isArray(r))return T7(JSON.stringify(r)??String(r));let i=Oz(e,r);if(i.summary!==void 0)return T7(i.summary);if(!i.args||typeof i.args!=`object`)return``;let a=i.args;for(let e of _ie(i.name)){let t=a[e];if(typeof t==`string`&&t.trim())return T7(t)}let o=JSON.stringify(a);return o===`{}`?``:T7(o)}function yie(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=24}var E7=new Map,bie=e=>{let t=E7.get(e);return t?new Set(t):new Set},D7=(e,t)=>(E7.set(e,t),t),O7=new Map,xie=(e,t)=>{let n=O7.get(e)??new Set;O7.set(e,n);for(let e of t)n.add(e);return n},k7=`enso:task-bar-expanded`,A7=new Map,j7=()=>{try{let e=JSON.parse(window.sessionStorage.getItem(k7)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}},Sie=e=>A7.get(e)??j7().includes(e),Cie=(e,t)=>{A7.set(e,t);try{let n=j7().filter(t=>t!==e);window.sessionStorage.setItem(k7,JSON.stringify(t?[...n,e]:n))}catch{}return t};function wie({sessionId:e,tasks:t,subagents:n,readOnly:r}){let i=T(e=>e.virtualModels),{t:a}=K(),[o,s]=(0,H.useState)(()=>bie(e)),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(()=>Sie(e)),f=ZN(e=>e.pendingAgentOpen);(0,H.useEffect)(()=>{!f||f.sessionId!==e||(l(f.agentId),ZN.setState({pendingAgentOpen:null}))},[f,e]);let p=xie(e,[...t.filter(e=>e.status===`running`).map(e=>e.taskId),...n.filter(e=>e.status===`running`).map(e=>e.id)]),m=(e,t)=>!o.has(e)&&(t===`running`||p.has(e)),h=t.filter(e=>m(e.taskId,e.status)),g=n.filter(e=>m(e.id,e.status));if((0,H.useEffect)(()=>{let r=O7.get(e),i=[...t.filter(e=>e.status!==`running`).map(e=>e.taskId),...n.filter(e=>e.status!==`running`).map(e=>e.id)].filter(e=>r?.has(e)&&!o.has(e)&&e!==c);if(i.length===0)return;let a=setTimeout(()=>{s(t=>{let n=new Set(t);for(let e of i)n.add(e);return D7(e,n)})},5e3);return()=>clearTimeout(a)},[e,t,n,o,c]),h.length===0&&g.length===0)return null;let _=t=>{s(n=>D7(e,new Set(n).add(t))),c===t&&l(null)},v=h.find(e=>e.taskId===c)??null,y=g.find(e=>e.id===c)??null,b=h.length>=2;return(0,G.jsxs)(`div`,{className:`relative mb-1.5`,children:[(v||y)&&(0,G.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-30 mb-1.5 rounded-xl border bg-card shadow-float`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-1.5 text-xs`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground`,children:[v?v.command:y?.description,y?.modelId?` · ${yj(i,y.modelId)}`:``]}),v&&(0,G.jsx)(Oie,{sessionId:e,task:v,readOnly:r}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(nr,{className:`h-3.5 w-3.5`})})]}),v&&(0,G.jsx)(kie,{sessionId:e,task:v,readOnly:r}),y&&(0,G.jsx)(Aie,{agent:y},y.id)]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-xl border bg-card p-1 shadow-xs`,children:[b&&(0,G.jsx)(Tie,{sessionId:e,tasks:h,expanded:u,readOnly:r,onToggle:()=>d(Cie(e,!u))}),(!b||u)&&h.map(t=>(0,G.jsx)(Die,{sessionId:e,task:t,readOnly:r,open:c===t.taskId,onToggle:()=>l(c===t.taskId?null:t.taskId),onDismiss:()=>_(t.taskId)},t.taskId)),g.map(t=>(0,G.jsxs)(Eie,{icon:dt,status:t.status,meta:(0,G.jsx)(Fie,{agent:t}),open:c===t.id,onToggle:()=>l(c===t.id?null:t.id),stopTitle:a(`Stop subagent`),onStop:r?void 0:()=>void window.electronAPI.agent.stopSubagent(e,t.id),onDismiss:()=>_(t.id),children:[t.agentType&&(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:t.agentType}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:[t.description,t.modelId&&(0,G.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[` `,`· `,yj(i,t.modelId)]}),t.status===`running`&&t.currentActivity&&(0,G.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[` · `,t.currentActivity]})]})]},t.id))]})]})}function Tie({sessionId:e,tasks:t,expanded:n,readOnly:r,onToggle:i}){let{t:a}=K(),o=y7(1e3),[s,c]=(0,H.useState)(!1),l=t.filter(e=>e.status===`running`),u=t.filter(e=>g7(e)===`idle`).length,d=l.reduce((e,t)=>Math.min(e,t.startedAt),o),f=!r&&l.length>0;return(0,H.useEffect)(()=>{f||c(!1)},[f]),(0,G.jsxs)(`div`,{"data-enso":`background-task-summary`,className:`flex min-h-[30px] min-w-0 items-center gap-2 rounded-lg px-1 text-[13px]`,children:[(0,G.jsx)(G8,{icon:Gn,state:l.length>0?`running`:`ok`}),s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:a(`Stop {{count}} background tasks?`,{count:l.length})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs whitespace-nowrap text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:a(`Cancel`)}),(0,G.jsx)(`button`,{type:`button`,"data-enso":`background-task-stop-all-confirm`,onClick:()=>{for(let t of l)S7(e,t.taskId);c(!1)},className:`flex h-6 shrink-0 items-center rounded-md bg-destructive/10 px-1.5 text-xs whitespace-nowrap text-destructive transition-colors hover:bg-destructive/15`,children:a(`Stop {{count}}`,{count:l.length})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-enso":`background-task-summary-toggle`,onClick:i,"aria-expanded":n,className:`flex h-6 min-w-0 flex-1 items-center gap-1.5 rounded-md text-left text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 truncate`,children:[a(`{{count}} background tasks`,{count:t.length}),l.length>0&&` · ${a(`longest running {{duration}}`,{duration:wN(o-d)})}`]}),u>0&&(0,G.jsx)(b7,{tone:`pending`,className:`whitespace-nowrap`,children:a(`{{count}} suspected idle`,{count:u})}),(0,G.jsx)(gt,{className:W(`h-3 w-3 shrink-0 transition-transform`,n&&`rotate-180`)})]}),f&&(0,G.jsx)(`button`,{type:`button`,"data-enso":`background-task-stop-all`,onClick:()=>c(!0),className:`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs whitespace-nowrap text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,children:a(`Stop all`)})]})]})}function Eie({icon:e,status:t,meta:n,open:r,onToggle:i,stopTitle:a,onStop:o,onDismiss:s,children:c}){let{t:l}=K();return(0,G.jsxs)(`div`,{className:`flex min-h-[30px] min-w-0 items-center gap-2 px-1 text-[13px]`,children:[(0,G.jsx)(G8,{icon:e,state:t===`running`?`running`:t===`failed`?`error`:`ok`}),c,n,(0,G.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":r,className:`flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[l(`Output`),(0,G.jsx)(gt,{className:W(`h-3 w-3 transition-transform`,r&&`rotate-180`)})]}),t===`running`?o&&(0,G.jsx)(`button`,{type:`button`,onClick:o,title:a,className:`flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,children:l(`Stop`)}):(0,G.jsx)(`button`,{type:`button`,onClick:s,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(nr,{className:`h-3 w-3`})})]})}function Die({sessionId:e,task:t,readOnly:n,open:r,onToggle:i,onDismiss:a}){let{t:o}=K(),s=y7(),c=g7(t);return(0,G.jsxs)(`div`,{"data-enso":`background-task-row`,"data-view":c,className:W(`flex min-h-[30px] min-w-0 items-center gap-2 rounded-lg px-1 text-[13px]`,c===`kept`&&`py-1`,c===`idle`&&`bg-warning/[0.06]`,r&&`bg-muted`),children:[(0,G.jsx)(cie,{task:t}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,title:t.command,children:t.command}),c===`idle`&&(0,G.jsx)(b7,{tone:`pending`,children:x7(t,s,o)})]}),(0,G.jsx)(uie,{task:t,className:`mt-0.5`})]}),(0,G.jsx)(Iie,{task:t}),(0,G.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":r,className:W(`flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,r&&`bg-foreground/[0.06] text-foreground`),children:[o(`Output`),(0,G.jsx)(gt,{className:W(`h-3 w-3 transition-transform`,r&&`rotate-180`)})]}),t.status===`running`?n?null:c===`idle`?(0,G.jsx)(w7,{sessionId:e,taskId:t.taskId}):(0,G.jsx)(die,{onStop:()=>S7(e,t.taskId)}):(0,G.jsx)(`button`,{type:`button`,onClick:a,className:`flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(nr,{className:`h-3 w-3`})})]})}function Oie({sessionId:e,task:t,readOnly:n}){let{t:r}=K(),i=y7(),a=g7(t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(sie,{task:t,now:i}),!n&&a===`idle`&&(0,G.jsx)(w7,{sessionId:e,taskId:t.taskId}),!n&&a===`kept`&&(0,G.jsx)(Ea,{size:`xs`,variant:`ghost`,className:`text-muted-foreground`,onClick:()=>C7(e,t.taskId,null),children:r(`Unkeep`)})]})}function M7({icon:e,label:t,value:n}){return(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md bg-muted px-2 py-1.5`,children:[(0,G.jsx)(e,{className:`size-3.5 shrink-0 text-warning`}),(0,G.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t}),(0,G.jsx)(`span`,{className:`ml-auto shrink-0 font-medium tabular-nums`,children:n})]})}function N7({children:e}){return(0,G.jsx)(`div`,{className:`text-[11px] text-subtle-foreground tabular-nums`,children:e})}function kie({sessionId:e,task:t,readOnly:n}){let{t:r}=K(),i=y7(),a=g7(t),o=aie(i-t.startedAt),s=t.idle?.ports??[],c=a===`idle`||a===`kept`;return(0,G.jsxs)(G.Fragment,{children:[a===`idle`&&(0,G.jsxs)(`div`,{className:`space-y-2.5 px-3 py-2.5 text-xs`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:[(0,G.jsx)(M7,{icon:At,label:r(`No new output`),value:_7(i-(t.idle?.since??i),r)}),(0,G.jsx)(M7,{icon:Zn,label:s.length>0?r(`Port {{ports}}`,{ports:s.join(`, `)}):r(`Ports`),value:s.length>0?r(`No connections`):r(`Not listening`)}),(0,G.jsx)(M7,{icon:Ft,label:`CPU`,value:`0%`})]}),(0,G.jsx)(N7,{children:r(`Running for {{duration}} · Suspected idle tasks are never stopped automatically`,{duration:o})})]}),a===`kept`&&t.keep&&(0,G.jsxs)(`div`,{className:`space-y-2.5 px-3 py-2.5 text-xs`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted px-2.5 py-2`,children:[(0,G.jsx)(Cn,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[t.keep.by===`user`&&!n?(0,G.jsx)(`input`,{"data-enso":`background-task-keep-reason`,defaultValue:t.keep.reason??``,maxLength:200,placeholder:r(`Add a reason (optional)`),className:`w-full bg-transparent text-[13px] outline-none placeholder:text-subtle-foreground`,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},onBlur:n=>{let r=n.currentTarget.value.trim();r!==(t.keep?.reason??``)&&C7(e,t.taskId,r)}},t.keep.at):(0,G.jsx)(`div`,{className:`text-[13px]`,children:t.keep.reason??`—`}),(0,G.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:t.keep.by===`agent`?r(`Kept by the agent at {{time}} when wrapping up`,{time:v7(t.keep.at)}):r(`Kept by you at {{time}}`,{time:v7(t.keep.at)})})]})]}),(0,G.jsx)(N7,{children:r(`Running for {{duration}}`,{duration:o})})]}),c&&(0,G.jsx)(`div`,{className:`flex items-center gap-2 border-t border-border/60 px-3 pt-2 text-[11px] text-subtle-foreground`,children:(0,G.jsx)(`span`,{children:r(`Recent output`)})}),(0,G.jsx)(Lie,{tail:t.tail,outputBytes:t.outputBytes,running:t.status===`running`,framed:!c})]})}function Aie({agent:e}){let{t}=K(),n=e.activities??[],r=(0,H.useRef)(null),i=(0,H.useRef)(!0);return(0,H.useEffect)(()=>{let e=r.current;e&&i.current&&(e.scrollTop=e.scrollHeight)},[n,e.resultText]),(0,G.jsxs)(`div`,{ref:r,className:`max-h-96 space-y-2 overflow-auto px-3 py-2 text-sm`,onScroll:e=>{i.current=yie(e.currentTarget)},children:[n.map(e=>(0,G.jsx)(jie,{activity:e},e.id)),n.length===0&&!e.resultText&&(0,G.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:(e.activityLog??[]).join(`
279
+ `)||t(`(no output yet)`)}),e.detailsPruned&&(0,G.jsx)(`div`,{className:`rounded-md border border-dashed px-2.5 py-2 text-xs text-muted-foreground`,children:t(`Earlier activity details were cleared; the final report is still available.`)}),e.resultText&&e.status!==`running`&&(0,G.jsxs)(`section`,{className:W(`rounded-lg border px-3 py-2`,e.status===`failed`?`border-destructive/30 bg-destructive/5`:`border-blue-500/30 bg-blue-500/5`),children:[(0,G.jsx)(`div`,{className:`mb-1.5 font-medium text-xs text-foreground`,children:t(`Final report`)}),(0,G.jsx)(C3,{text:e.resultText})]})]})}function jie({activity:e}){let{t}=K(),[n,r]=(0,H.useState)(!1);if(e.type===`assistant`)return(0,G.jsxs)(`section`,{className:`rounded-md bg-muted/30 px-2.5 py-2`,children:[(0,G.jsx)(`div`,{className:`mb-1 text-[10px] font-medium tracking-wide text-muted-foreground uppercase`,children:t(`Assistant`)}),(0,G.jsx)(Pie,{text:e.text,markdown:!0})]});let i=vie(e.toolName,e.argumentsText),a=Oz(e.toolName,e.argumentsText).name,o=Tz(a),s=`subagent-tool-${e.id.replace(/[^A-Za-z0-9_-]/g,`-`)}`;return(0,G.jsxs)(`section`,{className:`border-b border-border/40 last:border-b-0`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-controls":s,"aria-expanded":n,onClick:()=>r(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 text-left text-xs transition-colors hover:bg-muted/50`,children:[(0,G.jsx)(Mie,{toolName:a}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium text-foreground/80`,children:o?.tool??a}),i&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground`,title:i,children:i}),!i&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1`}),(0,G.jsx)(Nie,{status:e.status,label:t(e.status)}),(0,G.jsx)(_t,{"aria-hidden":`true`,className:W(`h-3 w-3 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,G.jsxs)(`div`,{id:s,className:`ml-5 border-border/50 border-l pb-2 pl-2.5`,children:[o&&(0,G.jsxs)(`div`,{className:`mb-1 truncate font-mono text-[10px] text-muted-foreground/70`,children:[o.server,`.`,o.tool]}),(0,G.jsx)(`div`,{className:`text-[10px] text-muted-foreground/70`,children:t(`Arguments`)}),(0,G.jsx)(`pre`,{className:`max-h-28 overflow-auto font-mono text-[10px] leading-relaxed whitespace-pre-wrap text-muted-foreground/80`,children:i6(e.argumentsText)}),e.outputText&&(0,G.jsxs)(`div`,{className:`mt-1.5 border-border/40 border-t pt-1.5`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[10px] text-muted-foreground`,children:t(`Result`)}),(0,G.jsx)(`pre`,{className:`overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-foreground/80`,children:i6(e.outputText)})]})]})]})}function Mie({toolName:e}){let t=e.toLowerCase(),n=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return t.includes(`search`)||t.includes(`grep`)||t===`find`?(0,G.jsx)(Nn,{"aria-hidden":`true`,className:n}):t===`read`||t===`write`||t===`edit`||t===`apply_patch`||t.endsWith(`_read`)?(0,G.jsx)(Vt,{"aria-hidden":`true`,className:n}):t===`bash`||t===`exec`||t===`codemode`||t.includes(`shell`)||t.includes(`terminal`)?(0,G.jsx)(Yn,{"aria-hidden":`true`,className:n}):(0,G.jsx)(tr,{"aria-hidden":`true`,className:n})}function Nie({status:e,label:t}){let n=`h-3.5 w-3.5`;return(0,G.jsx)(`span`,{role:`status`,"aria-label":t,title:t,className:W(`shrink-0`,e===`failed`?`text-destructive`:`text-muted-foreground`),children:e===`running`?(0,G.jsx)(on,{"aria-hidden":`true`,className:W(n,`animate-spin`)}):e===`done`?(0,G.jsx)(ht,{"aria-hidden":`true`,className:n}):e===`failed`?(0,G.jsx)(xt,{"aria-hidden":`true`,className:n}):(0,G.jsx)(ct,{"aria-hidden":`true`,className:n})})}function Pie({text:e,label:t,markdown:n=!1}){let{t:r}=K(),i=e.length>800||e.split(`
280
+ `).length>16,a=n?(0,G.jsx)(C3,{text:e}):(0,G.jsx)(`pre`,{className:`overflow-x-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground`,children:i6(e)});return i?(0,G.jsxs)(`details`,{className:`group/details`,children:[(0,G.jsxs)(`summary`,{className:`cursor-pointer text-[10px] text-muted-foreground hover:text-foreground`,children:[t?`${t} · `:``,r(`{{count}} chars`,{count:e.length})]}),(0,G.jsx)(`div`,{className:`mt-1.5`,children:a})]}):(0,G.jsxs)(`div`,{children:[t&&(0,G.jsx)(`div`,{className:`mb-0.5 text-[10px] text-muted-foreground`,children:t}),a]})}function Fie({agent:e}){let[,t]=(0,H.useState)(0);return(0,H.useEffect)(()=>{if(e.status!==`running`)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e.status]),(0,G.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:[e.steps>0?`${e.steps} steps · `:``,e.outputTokens?`${e.outputTokens} tok · `:``,e.status===`running`?wN(Date.now()-e.startedAt):e.status]})}function Iie({task:e}){let[,t]=(0,H.useState)(0);return(0,H.useEffect)(()=>{if(e.status!==`running`)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e.status]),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums`,children:e.status===`running`?wN(Date.now()-e.startedAt):e.exitCode===void 0?e.status:`exit ${e.exitCode}`})}function Lie({tail:e,outputBytes:t,running:n,framed:r=!0}){let{t:i}=K(),a=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight)},[e]),(0,G.jsx)(`pre`,{ref:a,className:W(`max-h-56 overflow-auto font-mono text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground`,r?`border-t border-border/60 px-2.5 py-2`:`px-3 pt-1 pb-2.5`),children:i6(e)||(t===void 0?i(`Loading…`):t>0?i(`Output written ({{size}}), not loaded yet`,{size:IB(t)}):n?`${i(`(no output yet)`)}\n${i(`The process has not written anything. Without a terminal, some programs buffer output and only write it in blocks or on exit.`)}`:i(`(no output yet)`))})}function Rie(e){return{sessionId:e.sessionId,canRewind:!e.bot&&!e.deviceReadOnly,canRetry:!e.bot&&!e.deviceReadOnly,canFork:!1,...e.bot?{botSession:!0}:{}}}var P7=7e5,zie=1600;async function F7(e,t=P7,n=zie){let r=await createImageBitmap(e),i=Math.min(1,n/Math.max(r.width,r.height)),a=document.createElement(`canvas`);a.width=Math.round(r.width*i),a.height=Math.round(r.height*i);let o=a.getContext(`2d`);if(!o)throw Error(`画布不可用`);o.drawImage(r,0,0,a.width,a.height),r.close();for(let e of[.85,.7,.55,.4]){let n=a.toDataURL(`image/jpeg`,e),r=n.slice(n.indexOf(`,`)+1);if(r.length*.75<=t)return{data:r,mimeType:`image/jpeg`}}throw Error(`图片太大,请换一张更小的图`)}var I7=e=>Math.floor(P7/Math.max(1,e));async function L7(e,t){try{return await F7(e,t)}catch{return F7(e,t,1024)}}async function Bie(e){let t=I7(e.length),n=[];for(let r of e)n.push(await L7(r,t));return n}function Vie(e,t,n,r){let i=e?.find(e=>e.id===n);if(!i)return null;let a=i.text;return{sessionId:t,messageId:n,text:a,...i.hasImages?{hasImages:!0}:{},priorMatches:r.filter(e=>R7(a,e)).length,priorUserCount:r.length}}function R7(e,t){if(t===e)return!0;let n=p6(t);return n!==null&&e.trimStart().startsWith(n)}function Hie(e,t,n){let r=new Set(t.filter(e=>e.sessionId===n).map(e=>e.messageId));return(e??[]).filter(e=>!r.has(e.id))}function Uie(e,t,n){let r=t.filter(e=>e.sessionId===n).map(e=>Gie(e));return r.length===0?[...e]:[...e,...r]}function Wie(e,t,n,r){return e.filter(e=>e.sessionId===t?r?.turnSettled&&n.length>e.priorUserCount?!1:e.text?n.filter(t=>R7(e.text,t)).length<=e.priorMatches:n.length<=e.priorUserCount:!0)}function z7(e){return e.filter(e=>e.role===`user`).map(Kie)}function Gie(e){let t=e.text||(e.hasImages?`[image]`:``);return{role:`user`,content:t?[{type:`text`,text:t}]:[]}}function Kie(e){return e.content.map(e=>e.type===`text`?e.text:``).join(`
281
+ `).trim()}var qie=e=>e===`outbox-discarding`?`正在移除…`:e===`outbox-discard`?`移除未保存,请勿关闭页面;请再次移除,重启后可能重新入队`:e===`outbox-storage`?`无法保存离线消息,请勿关闭页面;可重试或复制消息`:e===`delivery-unconfirmed`?`未收到回执,发送结果未确认;可重试确认`:e===`read-only`?`此设备为只读`:e===`session-busy`?`请等当前回复结束`:e&&Os(`zh`,Aa(e)??e),B7=(e=!1)=>e?`此设备为只读,刚才的操作未执行;可在桌面「设置 → 设备」切换为可操作`:`此设备为只读,只能查看;可在桌面「设置 → 设备」切换为可操作`,Jie=70;function Yie({percent:e,critical:t}){return(0,G.jsx)(`span`,{"aria-hidden":!0,className:`h-1 w-7 shrink-0 overflow-hidden rounded-full bg-muted-foreground/20`,children:(0,G.jsx)(`span`,{className:W(`block h-full rounded-full`,t?`bg-destructive`:e>=Jie?`bg-warning`:`bg-muted-foreground/70`),style:{width:`${e}%`}})})}function Xie(e,t){let n={inputTokens:0,outputTokens:0,...e};return t&&(n.contextUsed=t.used,t.window!==void 0&&(n.contextWindow=t.window)),n.inputTokens===0&&n.outputTokens===0&&n.cacheHitPercent===void 0&&n.ttftAvgMs===void 0&&n.tokensPerSecond===void 0&&n.contextUsed===void 0?void 0:n}function Zie(e,t){let n={tokens:void 0,cache:void 0,context:void 0,speed:void 0};if(!t)return n;if(t.contextUsed!==void 0){let e=t.contextUsed,r=t.contextWindow??0;if(r>0){let t=Math.min(100,Math.round(e/r*100));n.context={compact:`${t}%`,full:`${CN(r)} · ${t}%`,percent:t,critical:t>=90}}else n.context={compact:`${CN(e)}·?`,full:`${CN(e)} · ?`}}let r=[],i=[];return t.ttftAvgMs!==void 0&&(r.push(wN(t.ttftAvgMs)),i.push(e(`First token avg {{duration}}`,{duration:wN(t.ttftAvgMs)}))),t.tokensPerSecond!==void 0&&(r.push(`${t.tokensPerSecond} tok/s`),i.push(e(`{{speed}} tok/s`,{speed:t.tokensPerSecond}))),r.length>0&&(n.speed={compact:r.join(` · `),full:i.join(` · `)}),(t.inputTokens>0||t.outputTokens>0)&&(n.tokens={compact:`↑${CN(t.inputTokens)} ↓${CN(t.outputTokens)}`,full:e(`Input {{input}} tok · Output {{output}} tok`,{input:CN(t.inputTokens),output:CN(t.outputTokens)})}),t.cacheHitPercent!==void 0&&(n.cache={compact:`${t.cacheHitPercent}%`,full:e(`Cache hit {{percent}}%`,{percent:t.cacheHitPercent})}),n}var Qie=[[`tokens`,jt],[`cache`,It],[`context`,Kt],[`speed`,rr]];function $ie({usageTotals:e,context:t}){let{t:n}=K(),r=Zie(n,Xie(e,t));return(0,G.jsx)(`div`,{"data-slot":`stats-line`,className:`flex min-h-6 flex-wrap items-center justify-center gap-x-3 px-1`,children:Qie.map(([e,t])=>{let n=r[e];return n?(0,G.jsxs)(`span`,{className:W(`flex items-center gap-1 text-[11px] tabular-nums`,n.critical?`text-destructive`:`text-muted-foreground/80`),children:[n.percent===void 0?(0,G.jsx)(t,{className:`h-3 w-3 shrink-0 opacity-75`}):(0,G.jsx)(Yie,{percent:n.percent,critical:!!n.critical}),n.compact]},e):null})})}function V7(e){let{view:t,sessionId:n}=e,r=(0,H.useRef)(null),[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(!1);(0,H.useLayoutEffect)(()=>{let e=o.current,t=s.current,n=e?.querySelector(`[aria-selected="true"]`);!e||!t||!n||(c.current||(t.style.transition=`none`),t.style.transform=`translate(${n.offsetLeft}px, ${n.offsetTop}px)`,t.style.width=`${n.offsetWidth}px`,t.style.height=`${n.offsetHeight}px`,c.current||=(t.offsetWidth,t.style.transition=``,!0))},[n,e.tabGroup]);let l=t?.status===`running`,u=e.bot,d=!!(u?.readOnly||e.deviceReadOnly),f=e.artifacts?.chatId,p=e.artifacts?.conversationId,m=(0,H.useMemo)(()=>({...Rie({sessionId:n,bot:u,deviceReadOnly:e.deviceReadOnly}),...f&&p?{turnFooter:e=>(0,G.jsx)(Ja,{target:{chatId:f,conversationId:p,messageIndex:e}})}:{}}),[n,u,e.deviceReadOnly,f,p]),h=(0,H.useMemo)(()=>{if(u)return[];let t=[{name:`/goal`,description:`Set a session goal (/goal <objective> · pause · resume · clear)`},{name:`/compact`,description:`Compact the context now (/compact [summary focus])`}],n=(e.slashCommands??[]).filter(e=>e.name!==`/goal`&&e.name!==`/compact`);return[...t,...n]},[e.slashCommands,u]),g=(0,H.useMemo)(()=>t?[...t.messages.entries()].sort((e,t)=>e[0]-t[0]):[],[t]),v=(0,H.useMemo)(()=>Uie(g.map(([,e])=>e),e.echoes??[],n??``),[g,e.echoes,n]),y=v.length>0||t?.status===`running`||t?.status===`failed`;XN(n?{id:n,projectId:``,status:t?.status??`idle`,started:y,spawning:!1,messages:v,queuedMessages:e.queued?.map(e=>({id:e.id,text:e.text}))}:null);let b=(0,H.useMemo)(()=>vH(v,l,[],e.cwd,{pendingApprovals:t?.approvals,compaction:t?.compaction,compactionNoticeAt:_(g.map(([e])=>e),t?.compactionNoticeAt)}),[v,g,l,e.cwd,t?.approvals,t?.compaction,t?.compactionNoticeAt]),x=t?.messages.size?Math.min(...t.messages.keys()):null,S=(0,H.useRef)(null),C=(0,H.useCallback)(()=>{if(!e.hasOlder||!e.onLoadOlder)return;let t=r.current?.getScroller();S.current=t?{height:t.scrollHeight,top:t.scrollTop}:null,e.onLoadOlder()},[e.hasOlder,e.onLoadOlder]);(0,H.useLayoutEffect)(()=>{let e=r.current?.getScroller(),t=S.current;!e||!t||(S.current=null,e.scrollTop=t.top+(e.scrollHeight-t.height))},[x]),(0,H.useEffect)(()=>{r.current?.isAtBottom()&&r.current.pinToBottom()},[b]);let w=async(t,n)=>{a(!0);try{let i=I7(n.length),a=[];for(let e of n)a.push(await eae(e,i));e.onSend(t,a),r.current?.scrollToBottom()}finally{a(!1)}};return(0,G.jsx)(MN.Provider,{value:m,children:(0,G.jsxs)(`div`,{className:`phone-chat-root flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 items-center gap-1 border-b bg-background px-2 py-2 pt-safe`,children:[u?.onBack||!e.drawerDocked?(0,G.jsx)(`button`,{type:`button`,onClick:u?.onBack??e.onOpenDrawer,"aria-label":u?.onBack?`返回群聊`:`打开会话列表`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:u?.onBack?(0,G.jsx)(vt,{className:`h-4.5 w-4.5`}):(0,G.jsx)(bn,{className:`h-4.5 w-4.5`})}):(0,G.jsx)(`span`,{className:`h-9 w-9 shrink-0`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 text-center`,children:[(0,G.jsxs)(`p`,{className:`flex min-w-0 items-center justify-center gap-1.5`,children:[e.connState!==`host-offline`&&e.connState!==`unauthorized`&&(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,e.connState===`online`&&!e.syncing?`bg-emerald-500`:`animate-pulse bg-amber-500`),title:e.connState===`online`&&e.syncing?`同步中…`:e.stateLabel}),(0,G.jsx)(`span`,{className:`truncate font-medium text-sm`,children:e.title})]}),(0,G.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.projectName||e.stateLabel})]}),u?.readOnly?(0,G.jsx)(`span`,{className:`h-9 w-9 shrink-0`}):(0,G.jsx)(`button`,{type:`button`,onClick:e.onNewSession,disabled:!e.canCreate||d||!!u&&i||e.connState!==`online`,"aria-label":`新建会话`,title:e.newSessionHint??`新建会话`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Un,{className:`h-4.5 w-4.5`})})]}),e.connState===`host-offline`&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center gap-1.5 bg-amber-500/10 py-1 text-amber-700 text-xs dark:text-amber-400`,children:[(0,G.jsx)(on,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:e.stateLabel})]}),e.tabGroup&&e.tabGroup.children.length>0&&(0,G.jsxs)(`div`,{ref:o,role:`tablist`,className:`t-tabs relative flex shrink-0 items-center justify-start gap-1 overflow-x-auto border-b px-2 py-1`,children:[(0,G.jsx)(`span`,{ref:s,"aria-hidden":`true`,className:`t-tabs-pill pointer-events-none absolute top-0 left-0 z-0 rounded-md bg-muted`}),(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e.tabGroup.parent.id,className:H7(n===e.tabGroup.parent.id),onClick:()=>e.onSelectTab?.(e.tabGroup?.parent.id??``),children:[(0,G.jsx)(ln,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`max-w-40 truncate`,children:e.tabGroup.parent.title||`新对话`})]}),e.tabGroup.children.map(t=>(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n===t.id,className:H7(n===t.id),onClick:()=>e.onSelectTab?.(t.id),children:[(0,G.jsx)(dt,{className:`h-3 w-3 shrink-0`}),(0,G.jsx)(`span`,{className:`max-w-28 truncate`,children:t.title||`coworker`}),(0,G.jsx)(`span`,{className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`?`animate-pulse bg-brand`:t.status===`failed`?`bg-destructive`:`bg-muted-foreground/30`)})]},t.id))]}),n===null?(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,G.jsx)(`span`,{className:`mb-3 flex size-11 items-center justify-center rounded-[13px] border border-brand/20 bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(PN,{className:`size-6`})}),(0,G.jsx)(`p`,{className:`font-semibold text-[22px] tracking-tight`,children:`EnsoCode`}),(0,G.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.connState===`online`?`从左上角选择会话,或新建一个`:e.stateLabel})]}):(0,G.jsx)(Zre,{ref:r,items:b,busy:t===null?!!e.syncing:l,loading:t===null,running:l,error:void 0,emptyTitle:e.projectName||`EnsoCode`,virtualize:!1,historyLoading:e.historyLoading,hasOlder:e.hasOlder,firstItemIndex:x??0,onStartReached:e.hasOlder?C:void 0},n),n!==null&&(0,G.jsx)(`div`,{className:`phone-dock @container flex min-h-0 flex-col pt-1 pb-safe`,children:(0,G.jsxs)(`div`,{className:W(`enso-chat-col mx-auto w-full max-w-2xl px-4 @min-[56rem]:max-w-3xl @min-[72rem]:max-w-4xl @min-[84rem]:max-w-5xl @min-[96rem]:max-w-6xl @min-[112rem]:max-w-7xl`,`flex min-h-0 flex-col`),children:[t?.retry&&(0,G.jsx)(iie,{retry:t.retry}),!d&&(0,G.jsx)(lP,{conversationId:n,queued:(e.queued??[]).map(e=>({id:e.id,text:e.text}))}),e.goal&&!d&&(0,G.jsx)(iP,{conversationId:n,goal:{...e.goal,noProgressRuns:0}}),(0,G.jsx)(d5,{conversationId:n},n),(0,G.jsx)(wie,{sessionId:n,tasks:t?.tasks??[],subagents:t?.subagents??[],readOnly:e.deviceReadOnly}),(0,G.jsxs)(`div`,{"data-enso":`composer-stack`,className:`flex min-h-0 flex-col overflow-y-auto overscroll-contain`,children:[u?.outbox,u?.notice&&(0,G.jsx)(`p`,{className:`mb-1 rounded-md bg-destructive/10 px-2 py-1 text-destructive text-xs`,children:u.notice}),e.deviceReadOnly?(0,G.jsx)(`p`,{className:`mb-1 rounded-md bg-muted px-2 py-1 text-center text-muted-foreground text-xs`,children:B7(e.readOnlyRejected)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h_,{approvals:t?.approvals??[],onRespond:e.onApproval,clockOffset:e.clockOffset}),(0,G.jsx)(y_,{asks:t?.asks??[],onAnswer:e.onAsk,clockOffset:e.clockOffset,autoFocus:!1})]})]}),!d&&(0,G.jsx)(jN,{commands:h,running:l,busy:l,locked:e.newSessionBusy||!!u&&i||(t?.approvals??[]).length>0,focusKey:u?.chatId?`bot-chat:${u.chatId}`:n,autoFocus:!1,enterToSend:!1,toolbar:e.modelLabel&&e.onOpenConfig?(0,G.jsxs)(`button`,{type:`button`,onClick:e.onOpenConfig,className:`flex min-w-0 items-center gap-0.5 rounded-md px-1.5 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:e.modelLabel}),(0,G.jsx)(gt,{className:`h-3 w-3 shrink-0`})]}):void 0,onSend:e=>{w(e.text,e.images)},onAbort:e.onAbort}),!d&&(0,G.jsx)($ie,{usageTotals:e.usageTotals,context:e.context})]})})]})})}function H7(e){return W(`t-tab flex min-w-0 shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors`,e?`font-medium`:`text-muted-foreground`)}async function eae(e,t){if(e.data.length*.75<=t)return e;let n=await(await fetch(`data:${e.mimeType};base64,${e.data}`)).blob();return L7(new File([n],`image`,{type:e.mimeType}),t)}function U7(e){if(e.kind===`ssh`)return e.sshConnectionName?.trim()||e.sshHost}function W7(e){return e.alias?.trim()||e.name}function G7(e){let t=W7(e),n=U7(e);return n?`${t} (${n})`:t}var K7=`enso-phone-drawer-segment`;function tae(){let e=localStorage.getItem(K7);return e===`bot`||e===`code`?e:null}function nae(e){localStorage.setItem(K7,e)}function q7(e,t){if(!e)return!1;let n=tae();return n?n===`bot`:t!==null}function rae(e,t=0){let n=new Map;for(let r of e)if(!(r.seq<=t)&&((r.kind===`human`||r.newConversation)&&n.clear(),r.kind===`bot`&&r.botId&&n.delete(r.botId),r.failure&&n.set(r.failure.botId,r.id),r.retryOf))for(let[e,t]of n)t===r.retryOf&&n.delete(e);return new Set(n.values())}function iae(e,t){let n=RegExp(`#${t}(?!\\d)`).exec(e);if(!n)return;let r=n.index+n[0].length;return[e.slice(0,n.index),n[0],e.slice(r)]}function aae({status:e}){return e===`running`?(0,G.jsx)(on,{className:`h-3 w-3 shrink-0 animate-spin text-brand`}):e===`done`?(0,G.jsx)(ht,{className:`h-3 w-3 shrink-0 text-muted-foreground`}):e===`denied`?(0,G.jsx)(zn,{className:`h-3 w-3 shrink-0 text-muted-foreground`}):e===`timeout`?(0,G.jsx)(At,{className:`h-3 w-3 shrink-0 text-warning`}):(0,G.jsx)(nr,{className:`h-3 w-3 shrink-0 text-destructive`})}function oae({item:e,bots:t,clockOffset:n,onOpen:r}){let i=t.get(e.botId),a=e.ownerBotId?t.get(e.ownerBotId):void 0,o=e.state!==`queued`,[s,c]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{if(!o)return;let e=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(e)},[o]);let l=s-n,u=o&&r?()=>r(e.conversationId):void 0;return(0,G.jsxs)(`button`,{type:`button`,disabled:!u,onClick:u,className:`flex w-full gap-2 rounded-lg border bg-muted/30 px-2.5 py-2 text-left disabled:cursor-default`,children:[(0,G.jsx)(Po,{bot:i,size:`sm`,busy:o}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,G.jsxs)(`span`,{className:`truncate font-medium`,children:[i?.name??`成员`,a?(0,G.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` 替 `,a.name]}):null]}),(0,G.jsx)(`span`,{className:W(`shrink-0`,o?`text-brand`:`text-muted-foreground`),children:as(e)}),o&&e.startedAt!==void 0&&(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:cs(l-e.startedAt)}),u&&(0,G.jsx)(_t,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),e.more>0&&(0,G.jsxs)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:[`+`,e.more,` 个更早的步骤`]}),e.steps.map((e,t)=>(0,G.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-[11px]`,children:[(0,G.jsx)(aae,{status:e.status}),(0,G.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.name}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground`,children:e.detail}),e.status===`timeout`&&(0,G.jsx)(`span`,{className:`shrink-0 text-warning`,children:e.name===`ask_user`?`已超时未回答`:`已超时拒绝`}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:e.durationMs===void 0?e.startedAt===void 0?``:cs(l-e.startedAt):cs(e.durationMs)})]},t))]})]})}var J7=e=>[...e].sort((e,t)=>t.activityAt-e.activityAt);function sae(e,t,n=10){let r=J7(e),i=e=>e.id===t.currentId||e.id===t.rootId?0:e.unread||e.running?1:2,a=new Set([...r].sort((e,t)=>i(e)-i(t)).slice(0,n).map(e=>e.id));return r.filter(e=>a.has(e.id)).sort((e,n)=>Number(n.id===t.rootId)-Number(e.id===t.rootId))}function cae(e,t,n){let r=t.trim().toLowerCase();return J7(e).filter(e=>(n===`all`||(n===`unread`?e.unread:e.running))&&(!r||`${e.title}\n${e.preview??``}`.toLowerCase().includes(r)))}var Y7=nE,lae=RT;function uae({className:e,...t}){return(0,G.jsx)(dy,{className:W(`fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-opacity duration-150 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,e),"data-slot":`sheet-backdrop`,...t})}function dae({className:e,side:t,inset:n=!1,...r}){return(0,G.jsx)(rE,{className:W(`fixed inset-0 z-50 grid`,t===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,t===`top`&&`grid grid-rows-[auto_1fr] pb-12`,t===`left`&&`flex justify-start`,t===`right`&&`flex justify-end`,n&&`sm:p-4`),"data-slot":`sheet-viewport`,...r})}function X7({className:e,children:t,showCloseButton:n=!0,side:r=`right`,inset:i=!1,...a}){return(0,G.jsxs)(lae,{children:[(0,G.jsx)(XE,{}),(0,G.jsx)(uae,{}),(0,G.jsx)(dae,{inset:i,side:r,children:(0,G.jsxs)(FT,{className:W(`relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover bg-clip-padding text-popover-foreground shadow-lg transition-[opacity,translate] duration-150 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]`,r===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,r===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,r===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,r===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,i&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,e),"data-slot":`sheet-popup`,...a,children:[t,n&&(0,G.jsx)(nb,{"aria-label":`Close`,className:`absolute end-2 top-2`,render:(0,G.jsx)(Ea,{size:`icon`,variant:`ghost`}),children:(0,G.jsx)(nr,{})})]})})]})}function Z7({className:e,...t}){return(0,G.jsx)(`div`,{className:W(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,e),"data-slot":`sheet-header`,...t})}function Q7({className:e,...t}){return(0,G.jsx)(iE,{className:W(`font-heading text-xl leading-none`,e),"data-slot":`sheet-title`,...t})}function $7(e,t,n=Date.now()){let r=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),i=e-n,a=Math.abs(i);return a<6e4?r.format(0,`second`):a<36e5?r.format(Math.trunc(i/6e4),`minute`):a<864e5?r.format(Math.trunc(i/36e5),`hour`):a<2592e6?r.format(Math.trunc(i/864e5),`day`):a<31536e6?r.format(Math.trunc(i/2592e6),`month`):r.format(Math.trunc(i/31536e6),`year`)}function e9({entry:e}){return(0,G.jsxs)(G.Fragment,{children:[e.running&&(0,G.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-warning`}),(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:$7(e.activityAt,`zh`)})]})}function fae({threads:e,status:t}){let[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(``),{entries:o,currentId:s,rootId:c,disabledHint:l}=e,u=o.find(e=>e.id===s),d=sae(o,{currentId:s,rootId:c}),f=o.length-d.length,p=cae(o,i,`all`),m=t=>{!l&&t!==s&&e.onSelect(t)};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(VM,{children:[(0,G.jsxs)(UM,{"aria-label":`切换话题`,className:`mx-auto flex max-w-full items-center justify-center gap-0.5 text-[11px] text-muted-foreground`,children:[(0,G.jsxs)(`span`,{className:`truncate`,children:[u?.title??`主话题`,t&&` · ${t}`]}),(0,G.jsx)(gt,{className:`h-3 w-3 shrink-0`})]}),(0,G.jsxs)(WM,{className:`w-72 max-w-[calc(100vw-1rem)]`,children:[(0,G.jsxs)(KM,{children:[(0,G.jsx)(JM,{children:`话题`}),d.map(e=>(0,G.jsxs)(qM,{disabled:!!l&&e.id!==s,onClick:()=>m(e.id),children:[(0,G.jsx)(ht,{className:W(e.id!==s&&`invisible`)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,G.jsx)(e9,{entry:e})]},e.id))]}),(0,G.jsx)(YM,{}),f>0&&(0,G.jsxs)(qM,{onClick:()=>{a(``),r(!0)},children:[(0,G.jsx)(an,{}),`全部话题(`,o.length,`)`]}),(0,G.jsxs)(qM,{disabled:!!l,onClick:e.onCreate,children:[(0,G.jsx)(un,{}),`新话题`]}),l&&(0,G.jsx)(`p`,{className:`px-2 py-1.5 text-muted-foreground text-xs`,children:l})]})]}),(0,G.jsx)(Y7,{open:n,onOpenChange:r,children:(0,G.jsxs)(X7,{side:`bottom`,className:`max-h-[80vh] pb-safe`,children:[(0,G.jsx)(Z7,{children:(0,G.jsxs)(Q7,{children:[`全部话题(`,o.length,`)`]})}),(0,G.jsx)(`div`,{className:`px-4 pb-2`,children:(0,G.jsx)($W,{value:i,placeholder:`搜索话题…`,onChange:e=>a(e.target.value)})}),l&&(0,G.jsx)(`p`,{className:`px-4 pb-2 text-muted-foreground text-xs`,children:l}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-3`,children:[p.map(e=>(0,G.jsxs)(`button`,{type:`button`,disabled:!!l&&e.id!==s,onClick:()=>{m(e.id),r(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left hover:bg-accent disabled:opacity-60`,children:[(0,G.jsx)(ht,{className:W(`h-4 w-4 shrink-0`,e.id!==s&&`invisible`)}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm`,children:e.title}),e.preview&&(0,G.jsx)(`span`,{className:`block truncate text-muted-foreground text-xs`,children:e.preview})]}),(0,G.jsx)(e9,{entry:e})]},e.id)),p.length===0&&(0,G.jsx)(`p`,{className:`py-8 text-center text-muted-foreground text-sm`,children:`没有匹配的话题`})]})]})})]})}var pae={queued:`排队中`,running:`进行中`,completed:`已完成`,failed:`失败`,canceled:`已取消`,blocked:`卡住了`},t9=4,mae=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),hae={started:{icon:wt,className:`border-brand/50 text-brand`},blocked:{icon:xt,className:`border-warning/60 text-warning`},delivered:{icon:St,className:`border-success/60 text-success`}};function gae({entry:e,bots:t}){let n=!!e.taskId,[r,i]=(0,H.useState)(!n),a=(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsx)(_t,{"aria-hidden":!0,className:W(`h-3 w-3 shrink-0 transition-transform`,r&&`rotate-90`)}),(0,G.jsxs)(`span`,{className:`font-medium`,children:[t.get(e.from)?.name??`成员`,` → `,t.get(e.to)?.name??`成员`]}),(0,G.jsx)(`span`,{className:W(`rounded px-1.5 py-0.5`,e.state===`running`||e.state===`queued`?`bg-brand/10 text-brand`:e.state===`failed`?`bg-destructive/10 text-destructive`:`bg-muted text-muted-foreground`),children:pae[e.state]})]});return(0,G.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 px-3 py-2 text-xs`,children:[n?(0,G.jsx)(`button`,{type:`button`,"aria-expanded":r,"aria-label":r?`收起委派结果`:`展开委派结果`,className:`flex w-full items-center gap-1.5 text-left`,onClick:()=>i(e=>!e),children:a}):(0,G.jsx)(`p`,{className:`flex items-center gap-1.5`,children:a}),r&&e.summary&&(0,G.jsx)(`p`,{className:`mt-1 line-clamp-3 text-muted-foreground`,children:e.summary})]})}function n9(e,t){let n=[...t].sort((e,t)=>t.length-e.length),r=[],i=e,a=0;for(;i;){let e=i.indexOf(`@`),t=e<0?void 0:n.find(t=>i.startsWith(t,e+1));if(e<0||!t){r.push(i);break}e>0&&r.push(i.slice(0,e)),r.push((0,G.jsxs)(`span`,{className:`font-medium text-brand`,children:[`@`,t]},a++)),i=i.slice(e+1+t.length)}return r}function _ae(e){let{chat:t,bots:n,timeline:r,state:i}=e,a=(0,H.useRef)(null),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(!0),l=(0,H.useRef)(null),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(0),[m,h]=(0,H.useState)([]),[g,_]=(0,H.useState)(!1),[v,y]=(0,H.useState)(null),b=r?.entries??[],x=t.epochSeq??b.findLast(e=>e.kind===`system`&&e.newConversation)?.seq??0,[S,C]=(0,H.useState)(!1);(0,H.useEffect)(()=>C(!1),[t.id,x]);let w=x>0&&!S,T=Jo(b,x,S),E=rae(b,x),D=t.members.map(e=>n.get(e)).filter(e=>!!(e&&!e.archived)),O=D.map(e=>e.name),k=!!i?.current||t.status!==`idle`,A=Zo(u,f),j=A?$o(A.query,D):[],M=T[0]?.seq,N=T.at(-1)?.seq;(0,H.useLayoutEffect)(()=>{let e=a.current;if(!e)return;let t=s.current;t?(s.current=null,e.scrollTop=t.top+(e.scrollHeight-t.height)):c.current&&(e.scrollTop=e.scrollHeight)},[M,N,i?.current,e.activities.length]);let P=()=>{let t=a.current;!r?.hasOlder||!t||e.historyLoading||e.connState!==`online`||w&&(b[0]?.seq??x)<=x||(s.current={height:t.scrollHeight,top:t.scrollTop},e.onLoadOlder())},F=e=>{if(!A)return;let t=es(u,A,f,e.name);d(t.text),p(t.caret),requestAnimationFrame(()=>{o.current?.focus(),o.current?.setSelectionRange(t.caret,t.caret)})},I=(0,H.useRef)(m);I.current=m,(0,H.useEffect)(()=>()=>{for(let e of I.current)URL.revokeObjectURL(e.url)},[]);let ee=e=>{let t=[...e??[]].filter(e=>e.type.startsWith(`image/`)).slice(0,t9-m.length).map(e=>({file:e,url:URL.createObjectURL(e)}));h(e=>[...e,...t]),y(null)},L=e=>{URL.revokeObjectURL(e),h(t=>t.filter(t=>t.url!==e))},te=async()=>{if(!u.trim()&&m.length===0||g||e.newSessionBusy)return;let t=[];if(m.length){_(!0);try{t=await Bie(m.map(e=>e.file))}catch(e){y(e instanceof Error?e.message:`图片处理失败`);return}finally{_(!1)}}e.onSend(u,t);for(let e of m)URL.revokeObjectURL(e.url);h([]),y(null),d(``),p(0),c.current=!0},R=t=>{switch(t.kind){case`human`:return(0,G.jsxs)(`div`,{className:`flex flex-col items-end`,children:[t.text&&(0,G.jsxs)(`div`,{className:`max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-brand/10 px-3 py-2 text-sm`,children:[n9(t.text,O),t.truncated&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`消息过长,仅显示部分内容`})]}),t.images?.length?(0,G.jsx)(Ja,{target:{chatId:e.chat.id,entryId:t.id}}):null]},t.seq);case`bot`:{let r=n.get(t.botId);return(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(Po,{bot:r,size:`sm`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`flex items-baseline gap-1.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:r?.name??`成员`}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:mae(t.at)})]}),(0,G.jsxs)(`div`,{className:`mt-0.5 min-w-0 text-sm`,children:[(0,G.jsx)(C3,{text:t.text}),t.truncated&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`消息过长,仅显示部分内容`})]}),(0,G.jsx)(Ja,{target:{chatId:e.chat.id,entryId:t.id}}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenProcess(t.conversationId),className:`mt-0.5 flex items-center gap-0.5 text-muted-foreground text-xs hover:text-foreground`,children:[(0,G.jsx)(_t,{className:`h-3 w-3`}),`查看过程`]})]})]},t.seq)}case`delegation`:return(0,G.jsx)(gae,{entry:t,bots:n},t.seq);case`progress`:{let e=n.get(t.botId),r=hae[t.phase],i=r.icon,a=iae(t.text,t.taskSeq);return(0,G.jsxs)(`div`,{"data-phase":t.phase,className:`flex gap-2 text-xs`,children:[(0,G.jsx)(Po,{bot:e,size:`sm`}),(0,G.jsxs)(`div`,{className:W(`flex min-w-0 items-start gap-1.5 rounded-md border-l-2 bg-muted/50 px-2 py-1`,r.className),children:[(0,G.jsx)(i,{"aria-hidden":!0,className:`mt-px h-3.5 w-3.5 shrink-0`}),(0,G.jsxs)(`p`,{className:`line-clamp-2 min-w-0 break-words text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:e?.name??`成员`}),` `,a?(0,G.jsxs)(G.Fragment,{children:[n9(a[0],O),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:a[1]}),n9(a[2],O)]}):n9(t.text,O)]})]})]},t.seq)}case`system`:return(0,G.jsxs)(`p`,{className:`text-center text-muted-foreground text-xs`,children:[t.text,E.has(t.id)&&e.onRetry&&!e.deviceReadOnly&&(0,G.jsx)(`button`,{type:`button`,className:`ml-2 underline disabled:opacity-50`,disabled:k||e.connState!==`online`,onClick:()=>e.onRetry?.(t.id),children:`重试`})]},t.seq)}},z=i?.current?n.get(i.current):void 0;return(0,G.jsxs)(`div`,{className:`phone-chat-root flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 items-center gap-1 border-b bg-background px-2 py-2 pt-safe`,children:[e.drawerDocked?(0,G.jsx)(`span`,{className:`h-9 w-9 shrink-0`}):(0,G.jsx)(`button`,{type:`button`,onClick:e.onOpenDrawer,"aria-label":`打开会话列表`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(bn,{className:`h-4.5 w-4.5`})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 text-center`,children:[(0,G.jsx)(`p`,{className:`truncate font-medium text-sm`,children:t.title||`群聊`}),e.threads?(0,G.jsx)(fae,{threads:e.threads,status:e.connState===`online`?void 0:e.stateLabel}):(0,G.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:e.connState===`online`?`${t.members.length} 位成员`:e.stateLabel})]}),e.threads?(0,G.jsx)(`button`,{type:`button`,onClick:e.threads.onCreate,disabled:!!e.threads.disabledHint,"aria-label":`新话题`,title:e.threads.disabledHint??`新话题`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Un,{className:`h-4.5 w-4.5`})}):(0,G.jsx)(`button`,{type:`button`,onClick:e.onNewSession,disabled:!e.canCreate||e.deviceReadOnly||g||e.connState!==`online`,"aria-label":`新建会话`,title:e.newSessionHint??`新建会话`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40`,children:(0,G.jsx)(Un,{className:`h-4.5 w-4.5`})})]}),(0,G.jsxs)(`div`,{ref:a,onScroll:e=>{let t=e.currentTarget;c.current=t.scrollHeight-t.scrollTop-t.clientHeight<40,t.scrollTop<60&&P()},className:`min-h-24 flex-1 space-y-3 overflow-y-auto px-3 py-3`,children:[r===void 0?(0,G.jsxs)(`p`,{className:`flex items-center justify-center gap-1.5 py-8 text-muted-foreground text-sm`,children:[(0,G.jsx)(on,{className:`h-4 w-4 animate-spin`}),`读取中…`]}):r.hasOlder&&(!w||(b[0]?.seq??x)>x)?(0,G.jsx)(`button`,{type:`button`,onClick:P,disabled:e.historyLoading||e.connState!==`online`,className:`w-full py-1 text-center text-muted-foreground text-xs`,children:e.historyLoading?`加载中…`:`加载更早的消息`}):T.length===0?(0,G.jsx)(`p`,{className:`py-8 text-center text-muted-foreground text-sm`,children:`@ 成员开始对话,未 @ 时由群主回复`}):null,x>0&&(0,G.jsx)(`button`,{type:`button`,className:`w-full py-1 text-center text-muted-foreground text-xs`,onClick:()=>{C(!S),S&&r?.history?e.onJumpLatest?.():!S&&r?.hasOlder&&!b.some(e=>e.seq<x)&&e.onLoadOlder()},children:w?`更早的对话 · ${x-1} 条`:`收起更早的对话`}),r?.history&&(0,G.jsx)(`button`,{type:`button`,className:`w-full py-1 text-center text-brand text-xs`,onClick:()=>{c.current=!0,e.onJumpLatest?.()},children:`回到最新消息`}),T.map(R),e.activities.map(t=>(0,G.jsx)(oae,{item:t,bots:n,clockOffset:e.clockOffset,onOpen:e.onOpenProcess},t.conversationId)),z&&e.activities.length===0&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Po,{bot:z,size:`sm`,busy:!0}),(0,G.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[z.name,` 正在回复…`]})]})]}),(0,G.jsxs)(`div`,{className:`phone-dock flex min-h-0 flex-col gap-2 px-3 pt-1 pb-safe`,children:[(0,G.jsxs)(`div`,{"data-enso":`composer-stack`,className:`flex min-h-0 flex-col gap-2 overflow-y-auto overscroll-contain empty:hidden`,children:[e.outbox,e.notice&&(0,G.jsx)(`p`,{className:`rounded-md bg-destructive/10 px-2 py-1 text-destructive text-xs`,children:e.notice}),e.deviceReadOnly&&(0,G.jsx)(`p`,{className:`rounded-md bg-muted px-2 py-1 text-center text-muted-foreground text-xs`,children:B7(e.readOnlyRejected)}),!e.deviceReadOnly&&e.pending.map(({sessionId:t,botId:r,view:i})=>i.approvals.length>0||i.asks.length>0?(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:n.get(r)?.name??`成员`}),(0,G.jsx)(h_,{approvals:i.approvals,clockOffset:e.clockOffset,onRespond:(n,r)=>e.onApproval(t,n,r)}),(0,G.jsx)(y_,{asks:i.asks,clockOffset:e.clockOffset,onAnswer:(n,r)=>e.onAsk(t,n,r),autoFocus:!1})]},t):null)]}),(0,G.jsxs)(`div`,{className:W(`relative`,e.deviceReadOnly&&`hidden`),children:[j.length>0&&(0,G.jsx)(`div`,{className:`absolute right-0 bottom-full left-0 mb-1 max-h-48 overflow-y-auto rounded-lg border bg-popover p-1 shadow-md`,children:j.map(e=>{let t=n.get(e.id);return(0,G.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>F(e),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent`,children:[t?(0,G.jsx)(Po,{bot:t,size:`sm`}):(0,G.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center rounded-full bg-muted text-xs`,children:`@`}),(0,G.jsx)(`span`,{className:`font-medium`,children:e.name}),t?.title&&(0,G.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:t.title})]},e.id)})}),v&&(0,G.jsx)(`p`,{className:`mb-1 text-destructive text-xs`,children:v}),m.length>0&&(0,G.jsx)(`div`,{className:`mb-1.5 flex gap-1.5`,children:m.map(e=>(0,G.jsxs)(`div`,{className:`relative h-14 w-14 overflow-hidden rounded-lg border`,children:[(0,G.jsx)(`img`,{src:e.url,alt:``,className:`h-full w-full object-cover`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`移除图片`,onClick:()=>L(e.url),className:`absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-black/60 text-white`,children:(0,G.jsx)(nr,{className:`h-3 w-3`})})]},e.url))}),(0,G.jsxs)(`div`,{className:`flex items-end gap-2 rounded-2xl border bg-background px-3 py-2`,children:[(0,G.jsx)(`input`,{ref:l,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,onChange:e=>{ee(e.target.files),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`添加图片`,disabled:m.length>=t9,onClick:()=>l.current?.click(),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground disabled:opacity-40`,children:(0,G.jsx)(Qt,{className:`h-4.5 w-4.5`})}),(0,G.jsx)(`textarea`,{ref:o,rows:1,value:u,placeholder:`@ 成员,或直接说…`,onChange:e=>{d(e.target.value),p(e.target.selectionStart??e.target.value.length)},onSelect:e=>p(e.currentTarget.selectionStart??0),className:`max-h-32 min-h-6 flex-1 resize-none bg-transparent text-sm outline-none field-sizing-content`}),k&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`停止`,onClick:e.onStop,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-foreground`,children:(0,G.jsx)(qn,{className:`h-3.5 w-3.5 fill-current`})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`发送`,disabled:!u.trim()&&m.length===0||g||e.newSessionBusy||!e.outbox&&e.connState!==`online`,onClick:()=>void te(),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-brand text-brand-foreground disabled:opacity-40`,children:(0,G.jsx)(st,{className:`h-4 w-4`})})]})]})]})]})}var r9=e=>typeof window.matchMedia==`function`&&window.matchMedia(e).matches;function vae(e){return(0,H.useSyncExternalStore)(t=>{if(typeof window.matchMedia!=`function`)return()=>{};let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},()=>r9(e),()=>r9(e))}var yae=`(min-width: 900px)`;function bae(e){let t=H.useRef(!0);t.current&&(t.current=!1,e())}var i9=H.createContext(null);function a9(){let e=H.useContext(i9);if(e===null)throw Error(xr(60));return e}var xae=(e,t)=>Object.is(e,t);function o9(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function s9(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&o9(e,t,n))}function Sae(e,t,n){return e.filter(e=>!o9(t,e,n))}function c9(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function l9(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Cae(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(l9(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function u9(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return c9(e)}function d9(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?c9(e.value):c9(e)}function f9(e,t,n){function r(){return u9(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=l9(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function wae(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(H.Fragment,{children:f9(r,t,n)},i)),e),[])}var p9={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:d9(t,r)!==``},hasNullItemLabel:(e,t)=>t?Cae(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>o9(t,e,n)):o9(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Tae(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Eae(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=xae,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=sN(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=iN(),F=pN({id:t}),I=M||d,ee=j??c,[L,te]=kj({controlled:n,default:y?r??Pr:r,name:`Select`,state:`value`}),[R,z]=kj({controlled:a,default:o,name:`Select`,state:`open`}),ne=H.useRef([]),re=H.useRef([]),B=H.useRef(null),ie=H.useRef(null),ae=H.useRef(0),oe=H.useRef(null),se=H.useRef([]),V=H.useRef(!1),ce=H.useRef(null),le=H.useRef(null),ue=H.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=H.useRef(!1),{mounted:fe,setMounted:pe,transitionStatus:me}=Nw(R),{openMethod:he,triggerProps:ge}=cE(R),_e=Cr(()=>new Aw({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:L,open:R,mounted:fe,transitionStatus:me,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ve=kw(_e,p9.activeIndex),ye=kw(_e,p9.selectedIndex),be=kw(_e,p9.triggerElement),xe=kw(_e,p9.positionerElement),Se=wM(he),Ce=he??Se,we=H.useMemo(()=>y?``:d9(L,x),[y,L,x]),Te=H.useMemo(()=>y&&Array.isArray(L)?L.map(e=>d9(e,x)):d9(L,x),[y,L,x]);aN(nx(be),F,L,zy(()=>Te),!I,c);let Ee=H.useRef(L),De=y?Array.isArray(L)&&L.length>0:L!=null&&we!==``;Y(()=>{A(De)},[De,A]),Y(function(){let e=L,t=!1;if(y){let n=Array.isArray(L)?L:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:s9(se.current,e,S),r=n===-1?null:n;r===null&&(le.current=null),!R&&_e.set(`selectedIndex`,r)},[y,R,L,S,_e]);function Oe(e){let t=k.initialValue;return Array.isArray(e)&&Array.isArray(t)?!Tae(e,t,(e,t)=>o9(e,t,S)):e!==t}oE(L,()=>{T(ee),E(Oe(L)),N.change(L)});let ke=zy((e,t)=>{s?.(e,t),!t.isCanceled&&(z(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(L)))}),Ae=zy(()=>{pe(!1),_e.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});Fw({enabled:!h,open:R,ref:B,onComplete(){R||Ae()}}),H.useImperativeHandle(h,()=>({unmount:Ae}),[Ae]);let je=zy((e,t)=>{i?.(e,t),!t.isCanceled&&te(e)}),Me=zy(e=>{let t=DE(e.scrollHeight,e.clientHeight),n=OE(e.scrollTop,t),r=n>0,i=n<t;_e.set(`scrollUpArrowVisible`,r),_e.set(`scrollDownArrowVisible`,i)}),Ne=wte({open:R,onOpenChange:ke,elements:{reference:be,floating:xe}}),Pe=lC(Ne,{enabled:!f&&!I,event:`mousedown`}),Fe=fC(Ne),Ie=xT(Ne,{enabled:!f&&!I,listRef:ne,activeIndex:ve,selectedIndex:ye,disabledIndices:Pr,onNavigate(e){e===null&&!R||_e.set(`activeIndex`,e)},focusItemOnHover:C}),Le=ST(Ne,{enabled:!f&&!I&&(R||!y),listRef:re,activeIndex:ve,selectedIndex:ye,disabledIndices:e=>BM(ne.current[e]),onMatch(e){R?_e.set(`activeIndex`,e):je(se.current[e],tb(Gy))},onTyping(e){V.current=e}}),Re=H.useMemo(()=>or(Le.reference,Ie.reference,Fe.reference,Pe.reference,ge),[Pe.reference,Le.reference,Ie.reference,Fe.reference,ge]),ze=H.useMemo(()=>or(Iw,Le.floating,Ie.floating,Fe.floating),[Le.floating,Ie.floating,Fe.floating]),Be=Ie.item??Fr;bae(()=>{_e.update({popupProps:ze,triggerProps:Re})}),_e.useSyncedValues({id:F,modal:m,multiple:y,value:L,open:R,mounted:fe,transitionStatus:me,popupProps:ze,triggerProps:Re,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Ce});let Ve=H.useMemo(()=>({store:_e,floatingContext:Ne,required:p,disabled:I,readOnly:f,multiple:y,highlightItemOnHover:C,setValue:je,setOpen:ke,listRef:ne,popupRef:B,scrollHandlerRef:ie,handleScrollArrowVisibility:Me,scrollArrowsMountedCountRef:ae,itemProps:Be,valueRef:oe,valuesRef:se,labelsRef:re,typingRef:V,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,validation:N,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:de,initialValueRef:Ee}),[_e,Ne,p,I,f,y,C,je,ke,Be,N,_,Me]),He=wr(g,N.inputRef),Ue=y?void 0:ee,We=H.useMemo(()=>!y||!Array.isArray(L)||!ee?null:L.map(e=>{let t=d9(e,x);return(0,G.jsx)(`input`,{type:`hidden`,form:l,name:ee,value:t,disabled:I},t)}),[y,L,l,ee,x,I]);return(0,G.jsxs)(i9.Provider,{value:Ve,children:[w,(0,G.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){_e.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=tb(Gy,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=se.current.findIndex(t=>d9(t,x).toLowerCase()===e||u9(t,b).toLowerCase()===e);r===-1&&(r=se.current.findIndex((t,n)=>{let r=re.current[n];return r!=null&&r.toLowerCase()===e}));let i=se.current[r];i!=null&&je(i,n)}_e.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Ue==null?`${F}-hidden-input`:void 0,form:l,name:Ue,autoComplete:u,value:we,disabled:I,required:p&&!(y&&De),readOnly:f,ref:He,style:ee?ux:lx,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),We]})}function Dae(e,t){return e??t}var Oae=400,kae={...cy,...eN,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Aae=H.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=iN(),{labelId:m}=lN(),{store:h,setOpen:g,selectionRef:_,validation:v,readOnly:y,required:b,alignItemWithTriggerActiveRef:x,disabled:S}=a9(),C=p||S||a,w=kw(h,p9.open),T=kw(h,p9.mounted),E=kw(h,p9.value),D=kw(h,p9.triggerProps),O=kw(h,p9.positionerElement),k=kw(h,p9.listElement),A=kw(h,p9.popupSide),j=kw(h,p9.id),M=kw(h,p9.labelId),N=kw(h,p9.hasSelectedValue),P=T&&O?A:null,F=i??j,I=Dae(m,M);pN({id:F});let ee=nx(O),L=H.useRef(null),{getButtonProps:te,buttonRef:R}=Uy({disabled:C,native:o}),z=h.useStateSetter(`triggerElement`),ne=db(),re=db(),B=db();H.useEffect(()=>{if(w)return B.start(Oae,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{B.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},re.clear()},[w,_,re,B]);let ie=or(D,{id:F,role:`combobox`,"aria-expanded":w,"aria-haspopup":`listbox`,"aria-controls":w?k?.id??Jb(O)?.id:void 0,"aria-labelledby":I,"aria-readonly":y||void 0,"aria-required":b||void 0,tabIndex:C?-1:0,onFocus(e){u(!0),w&&x.current&&g(!1,tb(Gy,e.nativeEvent)),ne.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){zb(O,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&v.commit(E))},onMouseDown(e){if(w)return;let t=Vy(e.currentTarget);function n(e){if(!L.current)return;let t=e.target;zb(L.current,t)||zb(ee.current,t)||mM(e,L.current)||g(!1,tb(Qy,e))}re.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,te),ae=v.getValidationProps(C,ie);ae.role=`combobox`;let oe={...f,open:w,disabled:C,value:E,readOnly:y,popupSide:P,placeholder:!N};return zr(`button`,e,{ref:[t,L,R,z],state:oe,stateAttributesMapping:kae,props:ae})}),jae={value:()=>null},Mae=H.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=a9(),u=kw(c,p9.value),d=kw(c,p9.items),f=kw(c,p9.itemToStringLabel),p=kw(c,p9.hasSelectedValue),m=!p&&a!=null&&i==null,h=kw(c,p9.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?wae(u,d,f):f9(u,d,f)),zr(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:jae})}),Nae=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=a9();return zr(`span`,e,{state:{open:kw(o,p9.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:sy})}),Pae=H.forwardRef(function(e,t){let{store:n}=a9(),r=kw(n,p9.mounted),i=kw(n,p9.forceMount);return r||i?(0,G.jsx)(US,{ref:t,...e}):null}),m9=H.createContext(void 0);function h9(){let e=H.useContext(m9);if(!e)throw Error(xr(59));return e}function g9(e,t){e&&Object.assign(e.style,t)}var _9={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Fae={position:`fixed`},Iae=H.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=IS,style:_,...v}=e,{store:y,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:D,floatingContext:O}=a9(),k=kw(y,p9.open),A=kw(y,p9.mounted),j=kw(y,p9.modal),M=kw(y,p9.value),N=kw(y,p9.openMethod),P=kw(y,p9.positionerElement),F=kw(y,p9.triggerElement),I=kw(y,p9.isItemEqualToValue),ee=kw(y,p9.transitionStatus),L=H.useRef(null),te=H.useRef(null),[R,z]=H.useState(h),ne=A&&R&&N!==`touch`;!A&&R!==h&&z(h),H.useImperativeHandle(S,()=>ne),tM((ne||j)&&k,N===`touch`,P,F);let re=jD({anchor:n,floatingRootContext:O,positionMethod:a,mounted:A,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??ne,collisionAvoidance:g,keepMounted:!0}),B=ne?`none`:re.side,ie=ne?Fae:re.positionerStyles,ae={open:k,side:B,align:re.align,anchorHidden:re.anchorHidden};Y(()=>{y.set(`popupSide`,re.side)},[y,re.side]);let oe=FD(e,ae,{styles:ie,transitionStatus:ee,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!A,inert:!k}),se=H.useRef(0),V=zy(e=>{if(w.current.length===0)return;let t=se.current;if(se.current=e.size,e.size===t)return;let n=tb(Gy);if(t!==0&&!y.state.multiple&&M!==null&&s9(w.current,M,I)===-1){let e=T.current,t=e!=null&&s9(w.current,e,I)!==-1?e:null;D(t,n),t===null&&(y.set(`selectedIndex`,null),C.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(M)){let e=M.filter(e=>s9(w.current,e,I)!==-1);e.length!==M.length&&(D(e,n),e.length===0&&(y.set(`selectedIndex`,null),C.current=null))}if(k&&ne){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};g9(P,e),g9(E.current,e)}}),ce=H.useMemo(()=>({...re,side:B,alignItemWithTriggerActive:ne,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:L,scrollDownArrowRef:te}),[re,B,ne,z]);return(0,G.jsx)(qj,{elementsRef:b,labelsRef:x,onMapChange:V,children:(0,G.jsxs)(m9.Provider,{value:ce,children:[A&&j&&(0,G.jsx)(LT,{inert:IT(!k),cutout:F}),oe]})})}),Lae={...ly,...ty},Rae=H.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:v,floatingContext:y}=a9(),{side:b,align:x,alignItemWithTriggerActive:S,isPositioned:C,setControlledAlignItemWithTrigger:w}=h9(),T=Hj(!0)!=null,E=TE(),{nonce:D,disableStyleElements:O}=_E(),k=kw(s,p9.id),A=kw(s,p9.open),j=kw(s,p9.openMethod),M=kw(s,p9.mounted),N=kw(s,p9.popupProps),P=kw(s,p9.transitionStatus),F=kw(s,p9.triggerElement),I=kw(s,p9.positionerElement),ee=kw(s,p9.listElement),L=H.useRef(!1),te=H.useRef(!1),R=H.useRef({}),z=sx(),ne=zy(e=>{if(!I||!c.current||!te.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(L.current||!S||!t&&!n){h(e);return}let r=b9(I),i=x9(I.getBoundingClientRect().height,`y`,r),a=Vy(I),o=my(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=v9(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=y9(e),g=null,_=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=EE(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(L.current=!0),h(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=EE(g,0,y9(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(L.current=!0),h(e)});H.useImperativeHandle(g,()=>ne,[ne]),Fw({open:A,ref:c,onComplete(){A&&l?.(!0)}});let re={open:A,transitionStatus:P,side:b,align:x};Y(()=>{!I||!c.current||Object.keys(R.current).length||(R.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),Y(()=>{A||S||(te.current=!1,L.current=!1,g9(I,R.current))},[A,S,I,c]),Y(()=>{let e=c.current;if(!A||!F||!I||!e||S&&!C||s.state.transitionStatus===`ending`)return;if(te.current=!0,e.style.removeProperty(`--transform-origin`),!S){z.request(()=>h(ee||e));return}let t=zae(e);try{let t=p.current;t?.isConnected||(t=!p9.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=my(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=Vy(F),c=b9(F),l=S9(F.getBoundingClientRect(),c),u=S9(I.getBoundingClientRect(),c),m=l.height,g=ee||e,y=g.scrollHeight,b=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,S=parseFloat(i.marginBottom)||10,C=parseFloat(i.minHeight)||100,T=v9(a),D=o.documentElement.clientHeight-x-S,O=o.documentElement.clientWidth,k=D-l.bottom+m,A,j=E===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=S9(n.getBoundingClientRect(),c);A=S9(t.getBoundingClientRect(),c),j=u.left+(E===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+S+b,P=Math.min(D,N),te=D-x-S,z=N-P,ne=O-5;I.style.left=`${EE(j,5,ne-u.width)}px`,I.style.height=`${P}px`,I.style.maxHeight=`none`,I.style.marginTop=`${x}px`,I.style.marginBottom=`${S}px`,e.style.height=`100%`;let re=y9(g),B=z>=re-1;B&&(P=Math.min(D,u.height)-(z-re));let ie=l.top<20||l.bottom>D-20||Math.ceil(P)+1<Math.min(y,C),ae=(r.visualViewport?.scale??1)!==1&&Cb;if(ie||ae){g9(I,R.current),w(!1);return}let oe=Math.max(C,P);if(B){let e=Math.max(0,D-N);I.style.top=u.height>=te?`0`:`${e}px`,I.style.height=`${P}px`,g.scrollTop=y9(g)}else I.style.bottom=`0`,g.scrollTop=z;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=EE(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(oe===D||P>=T)&&(L.current=!0),h(g),v&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,A,I,F,d,f,p,c,h,S,w,z,ee,_,v,E,C]),H.useEffect(()=>{if(!S||!I||!A)return;let e=my(I);function t(e){u(!1,tb(tte,e))}return ex(e,`resize`,t)},[u,S,I,A]);let B={...ee?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${k}-list`},onKeyDown(e){T&&NT.has(e.key)&&e.stopPropagation()},onScroll(e){ee||ne(e.currentTarget)},...S&&{style:ee?{height:`100%`}:_9},className:!ee&&S?mE.className:void 0},ie=zr(`div`,e,{ref:[t,c],state:re,stateAttributesMapping:Lae,props:[N,B,PD(P),o]});return(0,G.jsxs)(H.Fragment,{children:[!O&&mE.getElement(D),(0,G.jsx)(cC,{context:y,modal:!1,disabled:!M,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:ie})]})});function v9(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function y9(e){return DE(e.scrollHeight,e.clientHeight)}function b9(e){return YC.getScale(e)}function x9(e,t,n){return e/n[t]}function S9(e,t){return Rx({x:x9(e.x,`x`,t),y:x9(e.y,`y`,t),width:x9(e.width,`x`,t),height:x9(e.height,`y`,t)})}var C9=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function zae(e){let{style:t}=e,n={};for(let[e,r]of C9)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of C9){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Bae=H.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s,multiple:c}=a9(),{alignItemWithTriggerActive:l}=h9(),u=kw(o,p9.hasScrollArrows),d=kw(o,p9.openMethod),f={id:`${kw(o,p9.id)}-list`,role:`listbox`,"aria-multiselectable":c||void 0,onScroll(e){s.current?.(e.currentTarget)},...l&&{style:_9},className:u&&d!==`touch`?mE.className:void 0};return zr(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),w9=H.createContext(void 0);function T9(){let e=H.useContext(w9);if(!e)throw Error(xr(57));return e}var Vae=H.memo(H.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=H.useRef(null),d=Fj({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:y,selectedItemTextRef:b,disabled:x,readOnly:S}=a9(),C=x||s,w=kw(f,p9.isActive,d.index),T=kw(f,p9.open),E=kw(f,p9.isSelected,a),D=kw(f,p9.isSelectedByFocus,d.index),O=kw(f,p9.isItemEqualToValue),k=d.index,A=H.useRef(null);Y(()=>{let e=v.current;return e[k]=a,()=>{delete e[k]}},[k,a,v]),Y(()=>{let e=f.state.value,t=e;y&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&o9(a,t,O)&&(f.set(`selectedIndex`,k),u.current&&(b.current=u.current))},[k,y,O,f,a,b]);let j=H.useRef(`mouse`),M=H.useRef(!1),{getButtonProps:N,buttonRef:P}=Uy({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),F={disabled:C,selected:E,highlighted:w};function I(e){if(x||S)return;let t=f.state.value;if(y){let n=Array.isArray(t)?t:[],r=E?Sae(n,a,O):[...n,a];h(r,tb(Yy,e))}else h(a,tb(Yy,e)),m(!1,tb(Yy,e))}function ee(){g.current.dragY=0}let L={role:`option`,"aria-selected":E,tabIndex:T&&w?0:-1,onKeyDown(e){f.set(`activeIndex`,k),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Ob(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!M.current;M.current=!1,!(C||i)&&I(e.nativeEvent)},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,ee()},onMouseUp(){if(ee(),C||j.current===`touch`||M.current)return;let e=!g.current.allowSelectedMouseUp&&E,t=!g.current.allowUnselectedMouseUp&&!E;e||t||(M.current=!0,A.current?.click(),M.current=!1)}},te=zr(`div`,e,{ref:[P,t,d.ref,A],state:F,props:[p,L,l,N]}),R=H.useMemo(()=>({selected:E,index:k,textRef:u,selectedByFocus:D}),[E,k,u,D]);return(0,G.jsx)(w9.Provider,{value:R,children:te})})),Hae=H.forwardRef(function(e,t){let{selected:n}=T9();return e.keepMounted||n?(0,G.jsx)(Uae,{...e,ref:t}):null}),Uae=H.memo(H.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=T9(),c=H.useRef(null),{transitionStatus:l,setMounted:u}=Nw(s),d=zr(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:ty});return Fw({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Wae=H.memo(H.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=T9(),{firstItemTextRef:a,selectedItemTextRef:o}=a9(),{render:s,className:c,style:l,...u}=e;return zr(`div`,e,{ref:[H.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]),t,r],props:u})})),E9=H.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=a9(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=h9(),_=kw(l,c?p9.scrollUpArrowVisible:p9.scrollDownArrowVisible),v=kw(l,p9.openMethod),y=_&&v!==`touch`,b=db(),x=c?g:h,{mounted:S,transitionStatus:C,setMounted:w}=Nw(y);Y(()=>(p.current+=1,l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.set(`hasScrollArrows`,!1)}),[l,p]),Fw({open:y,ref:x,onComplete(){y||w(!1)}});let T=zr(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:C},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f(e);let n=DE(e.scrollHeight,e.clientHeight),r=OE(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=Gae(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s],stateAttributesMapping:ty});return S||o?T:null});function Gae(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?OE(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?OE(l.offsetTop+l.offsetHeight-r+i,a):a}var Kae=H.forwardRef(function(e,t){return(0,G.jsx)(E9,{...e,ref:t,direction:`down`})}),qae=H.forwardRef(function(e,t){return(0,G.jsx)(E9,{...e,ref:t,direction:`up`})}),D9=Eae;function O9({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(Aae,{className:W(`relative inline-flex min-h-9 w-full min-w-36 select-none items-center justify-between gap-2 rounded-lg border border-input bg-background bg-clip-padding px-[calc(--spacing(3)-1px)] text-left text-base shadow-xs outline-none ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 focus-visible:border-ring focus-visible:ring-[3px] aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-visible,[aria-invalid],[data-pressed]]:shadow-none`,t===`sm`&&`min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:min-h-7`,t===`lg`&&`min-h-10 sm:min-h-9`,e),"data-slot":`select-trigger`,...r,children:[n,(0,G.jsx)(Nae,{"data-slot":`select-icon`,children:(0,G.jsx)(bt,{className:`-me-1 size-4.5 opacity-80 sm:size-4`})})]})}function k9({className:e,...t}){return(0,G.jsx)(Mae,{className:W(`flex-1 truncate data-placeholder:text-muted-foreground`,e),"data-slot":`select-value`,...t})}function A9({className:e,children:t,sideOffset:n=4,alignItemWithTrigger:r=!0,zIndex:i,...a}){let o=H.useContext(sD);return(0,G.jsx)(Pae,{children:(0,G.jsx)(Iae,{alignItemWithTrigger:r,className:`select-none`,style:{zIndex:i??o},"data-slot":`select-positioner`,sideOffset:n,children:(0,G.jsxs)(Rae,{className:`origin-(--transform-origin) transition-[scale,opacity] has-data-[side=none]:scale-100 has-data-starting-style:scale-98 has-data-starting-style:opacity-0 has-data-[side=none]:transition-none`,"data-slot":`select-popup`,...a,children:[(0,G.jsx)(qae,{className:`top-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[200%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50% before:from-popover`,"data-slot":`select-scroll-up-arrow`,children:(0,G.jsx)(yt,{className:`relative size-4.5 sm:size-4`})}),(0,G.jsx)(`span`,{className:`relative block h-full rounded-lg border bg-popover bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-lg dark:not-in-data-[slot=group]:bg-clip-border`,children:(0,G.jsx)(Bae,{className:W(`max-h-(--available-height) min-w-(--anchor-width) overflow-y-auto p-1`,e),"data-slot":`select-list`,children:t})}),(0,G.jsx)(Kae,{className:`bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[200%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50% before:from-popover`,"data-slot":`select-scroll-down-arrow`,children:(0,G.jsx)(gt,{className:`relative size-4.5 sm:size-4`})})]})})})}function j9({className:e,children:t,...n}){return(0,G.jsxs)(Vae,{className:W(`grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),"data-slot":`select-item`,...n,children:[(0,G.jsx)(Hae,{className:`col-start-1`,children:(0,G.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/1500/svg`,children:(0,G.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})}),(0,G.jsx)(Wae,{className:`col-start-2 min-w-0`,children:t})]})}function Jae(e,t,n){return e.find(e=>e.id===t)?.id??e.find(e=>e.id===n)?.id??e[0]?.id??``}var M9={supervised:`受监督(每步确认)`,"auto-edits":`自动接受编辑`,full:`完全放行`,assistant:`助手代审`},N9={minimal:`极低`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最高`};function Yae({projects:e,providers:t,open:n,preferredProjectId:r,onClose:i,onCreate:a}){let[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(`full`),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(`medium`),[v,y]=(0,H.useState)(n);n!==v&&(y(n),n&&s(null));let b=Jae(e,o,r),x=t.find(e=>e.id===c)??t[0]??{id:``,models:[]},S=x.id,C=x.models.find(e=>e.id===u)?.id??x.models[0]?.id??``,w=!!(b&&S&&C);return(0,G.jsx)(Y7,{open:n,onOpenChange:e=>!e&&i(),children:(0,G.jsxs)(X7,{side:`bottom`,className:`pb-safe`,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(Q7,{children:`新建会话`})}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4 pt-0`,children:[(0,G.jsx)(P9,{label:`项目`,children:(0,G.jsxs)(D9,{items:e.map(e=>({value:e.id,label:G7(e)})),value:b,onValueChange:e=>s(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:e.map(e=>(0,G.jsx)(j9,{value:e.id,children:G7(e)},e.id))})]})}),(0,G.jsx)(P9,{label:`模型服务`,children:(0,G.jsxs)(D9,{items:t.map(e=>({value:e.id,label:e.name})),value:S,onValueChange:e=>{l(e),d(null)},children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:t.map(e=>(0,G.jsx)(j9,{value:e.id,children:e.name},e.id))})]})}),(0,G.jsx)(P9,{label:`模型`,children:(0,G.jsxs)(D9,{items:x.models.map(e=>({value:e.id,label:e.label??e.id})),value:C,onValueChange:e=>d(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:x.models.map(e=>(0,G.jsx)(j9,{value:e.id,children:e.label??e.id},e.id))})]})}),(0,G.jsx)(P9,{label:`审批模式`,children:(0,G.jsxs)(D9,{items:Object.keys(M9).map(e=>({value:e,label:M9[e]})),value:f,onValueChange:e=>p(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:Object.keys(M9).map(e=>(0,G.jsx)(j9,{value:e,children:M9[e]},e))})]})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`推理`}),(0,G.jsx)(gN,{checked:m,onCheckedChange:h})]}),m&&(0,G.jsx)(P9,{label:`推理档位`,children:(0,G.jsxs)(D9,{items:Object.keys(N9).map(e=>({value:e,label:N9[e]})),value:g,onValueChange:e=>_(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:Object.keys(N9).map(e=>(0,G.jsx)(j9,{value:e,children:N9[e]},e))})]})}),e.length===0&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:`桌面端还没有项目,请先在桌面添加。`}),e.length>0&&t.length===0&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:`桌面端没有可用的模型服务。`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,G.jsx)(Ea,{variant:`outline`,onClick:i,children:`取消`}),(0,G.jsx)(Ea,{disabled:!w,onClick:()=>a({projectId:b,providerId:S,modelId:C,approvalMode:f,...m?{reasoningEnabled:m,thinkingLevel:g}:{}}),children:`创建`})]})]})]})})}function P9({label:e,children:t}){return(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e}),t]})}var Xae={pending:`待发送`,sending:`发送中…`,failed:`发送失败`};function Zae({items:e,readOnly:t,onRetry:n,onDiscard:r}){return e.length===0?null:(0,G.jsx)(`div`,{className:`mb-1 space-y-1`,children:e.map(e=>(0,G.jsxs)(`div`,{className:W(`flex flex-wrap items-center gap-2 rounded-xl border px-2.5 py-1.5 text-xs`,e.status===`failed`?`border-destructive/40 bg-destructive/5`:`bg-muted/40`),children:[(0,G.jsx)(`span`,{className:W(`min-w-0 flex-1`,e.status===`failed`?`whitespace-pre-wrap break-words select-text`:`truncate`),children:e.text||(e.images?.length?`[${e.images.length} 张图片]`:``)}),(0,G.jsxs)(`span`,{className:W(`min-w-0 break-words`,e.status===`failed`?`text-destructive`:`text-muted-foreground`),children:[e.error?.startsWith(`outbox-discard`)?`移除消息`:e.error===`delivery-unconfirmed`?`结果未确认`:Xae[e.status],e.status===`failed`&&e.error?`:${qie(e.error)}`:``]}),e.status===`failed`&&!e.error?.startsWith(`outbox-discard`)&&!t&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`重试`,onClick:()=>n(e.deliveryId),className:`shrink-0 rounded p-0.5 text-foreground hover:bg-accent`,children:(0,G.jsx)(Mn,{className:`h-3.5 w-3.5`})}),e.status!==`sending`&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`删除`,disabled:e.error===`outbox-discarding`,onClick:()=>r(e.deliveryId),className:`shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent`,children:(0,G.jsx)(nr,{className:`h-3.5 w-3.5`})})]},e.deliveryId))})}function Qae(){let e=globalThis.BarcodeDetector;if(!e)return null;let t=new e({formats:[`qr_code`]});return{async scan(e){return(await t.detect(e))[0]?.rawValue??null}}}async function $ae(){let{default:t}=await q(async()=>{let{default:t}=await import(`./jsQR-B1eQcpQl.js`).then(t=>e(t.default,1));return{default:t}},__vite__mapDeps([148,1])),n=document.createElement(`canvas`),r=n.getContext(`2d`,{willReadFrequently:!0});return{async scan(e){if(!r||!e.videoWidth)return null;let i=Math.min(1,640/Math.max(e.videoWidth,e.videoHeight));n.width=Math.round(e.videoWidth*i),n.height=Math.round(e.videoHeight*i),r.drawImage(e,0,0,n.width,n.height);let{data:a,width:o,height:s}=r.getImageData(0,0,n.width,n.height);return t(a,o,s,{inversionAttempts:`dontInvert`})?.data??null}}}async function eoe(){return Qae()??await $ae()}function toe(e){try{return Te(e),!0}catch{return!1}}function noe({onPaired:e,autoInvite:t,onCancel:n,notice:r}){let[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1),f=(0,H.useRef)(null),p=(0,H.useRef)(null),m=()=>{for(let e of p.current?.getTracks()??[])e.stop();p.current=null,d(!1)},h=async t=>{s(!0),l(null);try{let n=Te(t),r=/iPhone|iPad|Android/i.exec(navigator.userAgent)?.[0]??`Phone`,i=await Oe(n.relay,n.publicKey,r);e({pairId:i.pairId,token:i.deviceToken,contentKey:btoa(String.fromCharCode(...i.contentKey)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``),deviceName:r,relayUrl:n.relay,pairedAt:Date.now()})}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}},g=(0,H.useRef)(!1);(0,H.useEffect)(()=>{!t||g.current||(g.current=!0,h(t))},[t]);let _=(0,H.useRef)(()=>{});_.current=e=>{m(),h(e)};let v=async()=>{l(null);try{p.current=await navigator.mediaDevices.getUserMedia({video:{facingMode:`environment`}}),d(!0)}catch(e){l(window.isSecureContext?e instanceof DOMException&&e.name===`NotAllowedError`?`摄像头权限被拒绝,请在浏览器设置中允许后重试`:`无法访问摄像头,请粘贴配对码`:`扫码需要 HTTPS 环境,请改用粘贴配对码`),d(!1)}};return(0,H.useEffect)(()=>{if(!u)return;let e=f.current,t=p.current;if(!e||!t)return;let n=!1,r=0;return e.srcObject=t,e.muted=!0,(async()=>{try{await e.play();let t=await eoe(),i=async()=>{if(!(n||!p.current)){try{let n=await t.scan(e);if(n&&toe(n)){_.current(n);return}}catch{}r=requestAnimationFrame(()=>void i())}};await i()}catch{n||l(`无法开始预览,请粘贴配对码`)}})(),()=>{n=!0,cancelAnimationFrame(r)}},[u]),(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-5 px-6 pt-safe pb-safe`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 text-center`,children:[(0,G.jsx)(`span`,{className:`mb-2 flex size-11 items-center justify-center rounded-[13px] border border-brand/20 bg-brand/8 text-brand dark:bg-brand/14`,children:(0,G.jsx)(PN,{className:`size-6`})}),(0,G.jsx)(`h1`,{className:`font-medium text-lg`,children:`连接到 EnsoCode`}),(0,G.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`在桌面端「设置 → 手机」生成配对码,扫码或粘贴。`}),r?(0,G.jsx)(`p`,{role:`status`,className:`mt-2 max-w-sm rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-left text-amber-700 text-xs dark:text-amber-300`,children:r}):null]}),u?(0,G.jsxs)(`div`,{className:`w-full max-w-sm space-y-2`,children:[(0,G.jsx)(`video`,{ref:f,playsInline:!0,muted:!0,className:`aspect-square w-full rounded-lg bg-black object-cover`}),(0,G.jsx)(Ea,{variant:`outline`,className:`w-full`,onClick:m,children:`取消扫码`})]}):(0,G.jsxs)(Ea,{className:`w-full max-w-sm`,onClick:()=>void v(),children:[(0,G.jsx)(mt,{className:`mr-1.5 h-4 w-4`}),`扫描二维码`]}),(0,G.jsxs)(`div`,{className:`flex w-full max-w-sm items-center gap-2`,children:[(0,G.jsx)($W,{value:i,onChange:e=>a(e.target.value),placeholder:`enso://pair?relay=…`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,className:`font-mono text-xs`}),(0,G.jsx)(Ea,{variant:`outline`,className:`shrink-0`,disabled:o||!i.trim(),onClick:()=>void h(i.trim()),children:o?(0,G.jsx)(on,{className:`h-4 w-4 animate-spin`}):`配对`})]}),c&&(0,G.jsx)(`p`,{className:`max-w-sm text-center text-destructive text-xs`,children:c}),n&&(0,G.jsx)(Ea,{variant:`ghost`,className:`w-full max-w-sm`,onClick:n,children:`返回`})]})}var F9={minimal:`极低`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最高`};function roe({providers:e,config:t,open:n,onClose:r,onSetModel:i,onSetReasoning:a,onSetThinking:o}){let s=e.find(e=>e.id===t.providerId),c=t.reasoningEnabled??!1,l=t.thinkingLevel??`medium`;return(0,G.jsx)(Y7,{open:n,onOpenChange:e=>!e&&r(),children:(0,G.jsxs)(X7,{side:`bottom`,className:`pb-safe`,children:[(0,G.jsx)(Z7,{children:(0,G.jsx)(Q7,{children:`会话设置`})}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4 pt-0`,children:[(0,G.jsx)(I9,{label:`模型服务`,children:(0,G.jsxs)(D9,{items:e.map(e=>({value:e.id,label:e.name})),value:t.providerId??``,onValueChange:t=>{let n=e.find(e=>e.id===t),r=n?.models[0]?.id;n&&r&&i(n.id,r)},children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:e.map(e=>(0,G.jsx)(j9,{value:e.id,children:e.name},e.id))})]})}),(0,G.jsx)(I9,{label:`模型`,children:(0,G.jsxs)(D9,{items:(s?.models??[]).map(e=>({value:e.id,label:e.label??e.id})),value:t.modelId??``,onValueChange:e=>{t.providerId&&i(t.providerId,e)},children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:(s?.models??[]).map(e=>(0,G.jsx)(j9,{value:e.id,children:e.label??e.id},e.id))})]})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`推理`}),(0,G.jsx)(gN,{checked:c,onCheckedChange:a})]}),c&&(0,G.jsx)(I9,{label:`推理档位`,children:(0,G.jsxs)(D9,{items:Object.keys(F9).map(e=>({value:e,label:F9[e]})),value:l,onValueChange:e=>o(e),children:[(0,G.jsx)(O9,{className:`w-full`,children:(0,G.jsx)(k9,{})}),(0,G.jsx)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:Object.keys(F9).map(e=>(0,G.jsx)(j9,{value:e,children:F9[e]},e))})]})}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`模型切换对运行中的会话在下次启动时生效;推理档位即时生效。`})]})]})})}function I9({label:e,children:t}){return(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e}),t]})}var L9=`__all__`,ioe=`__ungrouped__`;function R9(e){return new Set(e.map(e=>e.id))}function z9(e,t){return t.includes(e)}function aoe(e,t){let n=e.groupId;return!n||!R9(t).has(n)}function ooe(e,t,n,r){let i=e.filter(e=>!z9(e.id,n));return r===`__all__`||r===`__recent__`?i:r===`__ungrouped__`?i.filter(e=>aoe(e,t)):i.filter(e=>e.groupId===r)}function soe(e,t,n){let r=e.filter(e=>!z9(e.id,n)),i=[...t].sort((e,t)=>e.order-t.order),a=R9(t),o=i.map(e=>({groupId:e.id,group:e,projects:r.filter(t=>t.groupId===e.id)})),s=r.filter(e=>!e.groupId||!a.has(e.groupId));return s.length>0&&o.push({groupId:ioe,projects:s}),o}var coe=`default`;function loe(e,t){return e===`__recent__`?{kind:`all`,fallbackFrom:`recent`}:e===`__ungrouped__`?{kind:`ungrouped`}:e!==`__all__`&&t.some(t=>t.id===e)?{kind:`group`,groupId:e}:{kind:`all`}}var uoe=e=>e?.secretaryOrigin?e.secretaryOrigin.secretaryId??coe:void 0;function doe(e,t,{projects:n,projectGroups:r,conversations:i}){switch(t.kind){case`all`:return[...e];case`secretary`:return e.map(e=>({...e,ids:e.ids.filter(e=>uoe(i[e])===t.secretaryId)})).filter(e=>e.ids.length>0);default:{let i=new Set(r.map(e=>e.id));return e.filter(e=>{let r=n.find(t=>t.id===e.projectId)?.groupId;return t.kind===`group`?r===t.groupId:!r||!i.has(r)})}}}function foe(e){return e.status===`failed`&&!e.spawning?`failed`:e.queued?`queued`:(e.pendingAskCount??0)>0?`waiting`:e.status===`running`||e.spawning||e.hasRunningChild?`running`:e.hasPendingReminder?`reminder`:e.unread?`unread`:`idle`}function B9(e){return[...e].sort((e,t)=>(t.updatedAt??0)-(e.updatedAt??0))}function V9(e){let t=e=>(e.pendingAskCount??0)>0||(e.pendingApprovalCount??0)>0;return[...e.filter(t),...e.filter(e=>!t(e))]}function poe(e,t){let n=B9(e),r=new Map(n.map(e=>[e.id,e])),i=[];for(let e of t){let t=r.get(e);t&&(i.push(t),r.delete(e))}return[...i,...V9([...r.values()])]}function H9(e){return V9([...B9(e.filter(e=>e.pinned)),...B9(e.filter(e=>!e.pinned))])}function U9(e,t){return foe({status:e.queueFailed?`failed`:e.status,unread:e.unread,pendingAskCount:e.pendingAskCount,hasRunningChild:t,queued:e.status===`queued`&&!e.queueFailed||e.parked===`upstream`,hasPendingReminder:e.parked===`reminder`})}function moe(e,t){return U9(e,t)!==`idle`||e.goal?.status===`active`}function hoe(e,t){let n=B9(e.filter(e=>moe(e,t(e.id)))),r=e=>{let n=U9(e,t(e.id));return n===`queued`||n===`reminder`};return[...n.filter(e=>!r(e)),...n.filter(r)]}function W9(e,t){return e<=0?0:Math.min(e,5+Math.max(0,t))}function goe(e,t){return W9(e,t)>=e?0:Math.min(Math.max(0,e-5),t+15)}function _oe(e){return Math.max(0,e-15)}var voe=[{value:`auto`,label:`跟随桌面`},{value:`light`,label:`浅`},{value:`dark`,label:`深`}];function yoe({open:e,docked:t=!1,pinnable:n=!1,onTogglePinned:r,projects:i,groups:a=[],catalog:o,pinnedOrder:s=[],activeId:c,canCreate:l,devices:u,activeDevicePairId:d,remoteDesktop:f,connected:p,connectionLabel:m,pushEnabled:_,pushBusy:v,pushError:y,pushAvailability:b,pushConfigReady:x,onTogglePush:S,onClose:C,onSelect:w,onNewConversation:T,onSwitchDevice:E,onAddDevice:D,onRenameDevice:O,onUnpairDevice:k,botSegment:A}){let j=A?.active===!0,[M,N]=(0,H.useState)({}),[P,F]=(0,H.useState)({}),[I,ee]=(0,H.useState)(!1),[L,te]=(0,H.useState)(!1),[z,re]=(0,H.useState)(null),B=f?u.find(e=>e.pairId===d&&e.scope!==`read`):void 0,[ie,ae]=(0,H.useState)(g),[oe,se]=(0,H.useState)(()=>{try{return localStorage.getItem(`enso-phone-selected-project-group`)??`__all__`}catch{return L9}}),[ce,le]=(0,H.useState)({}),ue=oe===`__all__`||oe===`__ungrouped__`||a.some(e=>e.id===oe)?oe:L9;(0,H.useEffect)(()=>te(!1),[ue]),(0,H.useEffect)(()=>h(()=>ae(g())),[]),(0,H.useEffect)(()=>{e||re(null)},[e]);let[de,fe]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{if(!e)return;fe(Date.now());let t=setInterval(()=>fe(Date.now()),6e4);return()=>clearInterval(t)},[e]);let pe=new Set(i.filter(e=>e.archived).map(e=>e.id)),me=[...pe],he=e=>e.archived||pe.has(e.projectId),ge=ooe(i,a,me,ue),_e=soe(i,a,me),ve=new Set(ge.map(e=>e.id)),ye=o.filter(e=>!e.parentId),be=e=>!e.projectId||ve.has(e.projectId),xe=hoe(ye.filter(e=>!he(e)&&be(e)),e=>o.some(t=>t.parentId===e&&t.status===`running`)),Se=poe(ye.filter(e=>e.pinned&&!he(e)&&be(e)),s),Ce=B9(ye.filter(he)),we=loe(ue,a),Te=new Set(doe(Ce.map(e=>({projectId:e.projectId,ids:[e.id]})),we,{projects:i,projectGroups:a,conversations:{}}).flatMap(e=>e.ids)),Ee=Ce.filter(e=>Te.has(e.id)),De=we.kind!==`all`,Oe=L?Ce:Ee,ke=!De||L?`范围:全部归档`:we.kind===`group`?`范围:分组「${a.find(e=>e.id===we.groupId)?.name??``}」的归档`:`范围:未分组项目的归档`,Ae=ye.filter(e=>!he(e)),je=new Set(i.map(e=>e.id)),Me=H9(Ae.filter(e=>!je.has(e.projectId)));return(0,G.jsxs)(G.Fragment,{children:[!t&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`关闭侧栏`,onClick:C,className:W(`fixed inset-0 z-40 bg-black/40 transition-[opacity,visibility] duration-200`,e?`visible opacity-100`:`invisible pointer-events-none opacity-0`)}),(0,G.jsxs)(`aside`,{className:W(`flex shrink-0 flex-col border-r bg-background`,t?`relative h-full w-72`:W(`fixed inset-y-0 left-0 z-50 w-[82vw] max-w-xs transition-transform duration-200`,e?`translate-x-0`:`-translate-x-full`)),children:[(0,G.jsxs)(`div`,{className:W(`flex h-12 shrink-0 items-center justify-between px-3 pt-safe`,a.length===0&&`border-b`),children:[A?(0,G.jsx)(`span`,{className:`flex rounded-lg bg-muted p-0.5 text-sm`,children:[`项目`,`Bot`].map(e=>{let t=e===`Bot`===A.active;return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>A.onChange(e===`Bot`),className:W(`rounded-md px-3 py-0.5 transition-colors`,t?`bg-background font-medium shadow-xs`:`text-muted-foreground`),children:e},e)})}):(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:`项目`}),t?n&&r?(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`收起侧栏`,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(vn,{className:`h-4 w-4`})}):null:(0,G.jsxs)(`span`,{className:`flex items-center`,children:[n&&r&&(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`固定侧栏`,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(yn,{className:`h-4 w-4`})}),(0,G.jsx)(`button`,{type:`button`,onClick:C,"aria-label":`关闭侧栏`,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(nr,{className:`h-4 w-4`})})]})]}),!j&&a.length>0&&(0,G.jsx)(`div`,{className:`shrink-0 border-b px-3 pb-2`,children:(0,G.jsxs)(D9,{items:[{value:`__all__`,label:`全部`},...a.slice().sort((e,t)=>e.order-t.order).map(e=>({value:e.id,label:`${e.emoji?`${e.emoji} `:``}${e.name}`})),{value:`__ungrouped__`,label:`未分组`}],value:ue,onValueChange:e=>{if(e){se(e);try{localStorage.setItem(`enso-phone-selected-project-group`,e)}catch{}}},children:[(0,G.jsx)(O9,{className:`w-full`,size:`sm`,children:(0,G.jsx)(k9,{})}),(0,G.jsxs)(A9,{zIndex:oD.DROPDOWN_IN_MODAL,children:[(0,G.jsx)(j9,{value:`__all__`,children:`全部`}),a.slice().sort((e,t)=>e.order-t.order).map(e=>(0,G.jsxs)(j9,{value:e.id,children:[e.emoji?`${e.emoji} `:``,e.name]},e.id)),(0,G.jsx)(j9,{value:`__ungrouped__`,children:`未分组`})]})]})}),j?A?.panel:(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:[i.length===0&&(0,G.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-6 text-center text-muted-foreground text-sm`,children:`桌面端还没有项目`}),xe.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`flex items-center gap-1.5 px-2 py-2`,children:(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:`活跃中`})}),(0,G.jsx)(`div`,{className:`flex flex-col gap-y-0.5`,children:xe.map(e=>(0,G.jsx)(G9,{session:e,active:c===e.id,nowTick:de,onSelect:w},e.id))})]}),Se.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-2`,children:[(0,G.jsx)(Cn,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:`置顶`})]}),(0,G.jsx)(`div`,{className:`flex flex-col gap-y-0.5`,children:Se.map(e=>(0,G.jsx)(G9,{session:e,active:c===e.id,nowTick:de,onSelect:w},e.id))})]}),(ue===`__all__`&&a.length>0?_e.flatMap(e=>{let t=ce[e.groupId]===!0;return[{kind:`header`,section:e,folded:t},...t?[]:e.projects.map(e=>({kind:`project`,project:e}))]}):ge.map(e=>({kind:`project`,project:e}))).map(e=>e.kind===`header`?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>le(t=>({...t,[e.section.groupId]:!t[e.section.groupId]})),className:`flex h-7 w-full items-center gap-1 rounded-md px-2 text-left text-xs font-medium text-muted-foreground`,children:[(0,G.jsx)(_t,{className:W(`h-3.5 w-3.5 shrink-0 transition-transform duration-150`,!e.folded&&`rotate-90`)}),e.section.group?.emoji&&(0,G.jsx)(`span`,{className:`shrink-0 text-sm`,children:e.section.group.emoji}),e.section.group?.color&&(0,G.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:e.section.group.color}}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.section.group?.name??`未分组`}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.section.projects.length})]},`hdr-${e.section.groupId}`):(0,G.jsx)(K9,{name:W7(e.project),badge:U7(e.project),sessions:H9(Ae.filter(t=>t.projectId===e.project.id)),folded:M[e.project.id]===!0,revealedExtra:P[e.project.id]??0,activeId:c,nowTick:de,canCreate:l,onToggleFold:()=>N(t=>({...t,[e.project.id]:!t[e.project.id]})),onRevealMore:t=>F(n=>({...n,[e.project.id]:t})),onSelect:w,onNew:()=>T(e.project.id)},e.project.id)),Me.length>0&&(0,G.jsx)(K9,{name:`其他`,sessions:Me,folded:M.__orphan===!0,revealedExtra:P.__orphan??0,activeId:c,nowTick:de,canCreate:!1,onToggleFold:()=>N(e=>({...e,__orphan:!e.__orphan})),onRevealMore:e=>F(t=>({...t,__orphan:e})),onSelect:w})]}),!j&&(0,G.jsxs)(`div`,{className:`shrink-0 border-t p-2`,children:[I&&(0,G.jsxs)(`div`,{className:`mb-0.5 flex max-h-64 flex-col gap-y-0.5 overflow-y-auto`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1`,children:[(0,G.jsx)(`span`,{"data-slot":`archive-scope`,className:`min-w-0 flex-1 truncate text-[11px] text-muted-foreground`,children:ke}),De&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>te(e=>!e),className:`shrink-0 rounded-full border px-2 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60`,children:L?`仅本分组`:`全部归档`})]}),Oe.length===0&&(0,G.jsx)(`p`,{className:`px-2 py-3 text-center text-muted-foreground text-xs`,children:`没有归档会话`}),Oe.map(e=>(0,G.jsx)(G9,{session:e,active:c===e.id,nowTick:de,subtitle:(()=>{let t=i.find(t=>t.id===e.projectId);return t?W7(t):void 0})(),onSelect:w},e.id))]}),(0,G.jsxs)(`button`,{type:`button`,"data-slot":`archived-button`,"data-empty":Ee.length===0||void 0,onClick:()=>ee(e=>!e),className:W(`flex w-full items-center gap-1 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60`,Ee.length===0&&`opacity-55`),children:[(0,G.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,G.jsx)(_t,{className:W(`h-3.5 w-3.5 text-muted-foreground transition-transform duration-200`,I?`-rotate-90`:`rotate-0`)})}),(0,G.jsx)(rt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground text-sm`,children:`已归档`}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:Ee.length})]})]}),(0,G.jsxs)(`div`,{className:`shrink-0 space-y-1 border-t p-2 pb-safe`,children:[!z&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,G.jsx)(_n,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:`主题`}),(0,G.jsx)(`div`,{className:`flex shrink-0 gap-0.5 rounded-md border p-0.5`,children:voe.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>R(e.value),className:W(`rounded px-2 py-1 text-[11px] transition-colors`,ie===e.value?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-accent`),children:e.label},e.value))})]}),!z&&B&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,G.jsx)(mn,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:`界面`}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-0.5 rounded-md border p-0.5`,children:[(0,G.jsx)(`span`,{className:`rounded bg-primary px-2 py-1 text-[11px] text-primary-foreground`,children:`精简`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{window.location.href=ne(B.pairId)},className:`rounded px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent`,children:`完整`})]})]}),!z&&(0,G.jsxs)(`div`,{className:`px-2 py-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(ut,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:`推送通知`}),(0,G.jsx)(gN,{checked:_,disabled:v||b!==`ok`||!p||!x,onCheckedChange:S})]}),V({busy:v,error:y,availability:b,connected:p,configReady:x}).map(e=>(0,G.jsx)(`p`,{className:W(`mt-1 pl-6 text-[11px]`,e.error?`text-destructive`:`text-muted-foreground`),children:e.text},e.text))]}),(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[u.map(e=>{let t=e.pairId===d;return z===e.pairId?(0,G.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-dashed p-3`,children:[(0,G.jsxs)(`p`,{className:`text-xs`,children:[`解绑「`,e.label,`」后需重新扫码才能连接,确定吗?`]}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(Ea,{variant:`outline`,size:`sm`,onClick:()=>re(null),children:`取消`}),(0,G.jsx)(Ea,{variant:`destructive`,size:`sm`,onClick:()=>{re(null),k(e.pairId)},children:`确定解绑`})]})]},e.pairId):(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>E(e.pairId),className:W(`flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-2 text-left text-sm transition-colors hover:bg-muted/60`,t?`text-foreground`:`text-muted-foreground`),children:[(0,G.jsx)(nn,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),t&&(0,G.jsx)(`span`,{className:W(`shrink-0 text-[10px]`,p?`text-muted-foreground`:`text-destructive`),children:m})]}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`重命名 ${e.label}`,onClick:()=>{let t=window.prompt(`给这台电脑起个名:`,e.label);t?.trim()&&O(e.pairId,t)},className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(Sn,{className:`h-3.5 w-3.5`})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`解绑 ${e.label}`,onClick:()=>re(e.pairId),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent hover:text-destructive`,children:(0,G.jsx)(Zn,{className:`h-3.5 w-3.5`})})]},e.pairId)}),(0,G.jsxs)(`button`,{type:`button`,onClick:D,className:`flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-muted-foreground text-sm transition-colors hover:bg-muted/60 hover:text-foreground`,children:[(0,G.jsx)(En,{className:`h-4 w-4 shrink-0`}),(0,G.jsx)(`span`,{children:`配对新电脑`})]})]}),(0,G.jsxs)(`p`,{className:`px-2 pt-0.5 text-center text-[10px] text-muted-foreground/60`,children:[`版本 `,`24b6f13`]})]})]})]})}function G9({session:e,active:t,nowTick:n,subtitle:r,onSelect:i}){return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:W(`flex w-full items-center gap-2 rounded-lg py-2 pr-2 pl-4 text-left text-sm transition-colors`,t?`bg-brand/10 dark:bg-brand/15`:`hover:bg-muted/60`),children:[(0,G.jsx)(boe,{status:e.status,unread:e.unread,conversationId:e.id,queuePosition:e.queuePosition,queueFailed:e.queueFailed}),e.pinned&&(0,G.jsx)(Cn,{className:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-hidden":!0}),e.muted&&(0,G.jsx)(lt,{className:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-label":`静音`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.title||`新对话`,r&&(0,G.jsx)(`span`,{className:`ml-1.5 text-[10px] text-muted-foreground`,children:r})]}),e.updatedAt&&(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/80 tabular-nums`,children:$7(e.updatedAt,`zh`,n)})]})}function K9({name:e,badge:t,sessions:n,folded:r,revealedExtra:i,activeId:a,nowTick:o,canCreate:s,onToggleFold:c,onRevealMore:l,onSelect:u,onNew:d}){let{t:f}=K(),p=W9(n.length,i),m=n.slice(0,p),h=n.length-p;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex w-full items-center gap-1 rounded-lg px-2 py-2 transition-colors hover:bg-muted/60`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:c,className:`flex min-w-0 flex-1 items-center gap-1 text-left`,children:[(0,G.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,G.jsx)(_t,{className:W(`h-3.5 w-3.5 text-muted-foreground transition-transform duration-200`,!r&&`rotate-90`)})}),(0,G.jsx)(Ut,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-sm`,children:[e,t&&(0,G.jsx)(`span`,{className:`ml-1.5 rounded bg-muted px-1 py-0.5 text-[10px] font-normal text-muted-foreground`,children:t})]}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground tabular-nums`,children:n.length})]}),s&&d&&(0,G.jsx)(`button`,{type:`button`,onClick:d,className:`shrink-0 rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,G.jsx)(un,{className:`h-3.5 w-3.5`})})]}),!r&&(0,G.jsxs)(`div`,{className:`mt-0.5 flex flex-col gap-y-0.5`,children:[m.map(e=>(0,G.jsx)(G9,{session:e,active:a===e.id,nowTick:o,onSelect:u},e.id)),n.length>5&&(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[h>0&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(goe(n.length,i)),className:`flex-1 rounded-lg py-1 text-center text-muted-foreground text-xs transition-colors hover:bg-muted/60 hover:text-foreground`,children:f(`Show {{n}} more`,{n:h})}),i>0&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>l(_oe(i)),className:`flex-1 rounded-lg py-1 text-center text-muted-foreground text-xs transition-colors hover:bg-muted/60 hover:text-foreground`,children:f(`Collapse`)})]})]})]})}function boe({status:e,unread:t,conversationId:n,queuePosition:r,queueFailed:i}){let{t:a}=K();if(e===`queued`&&!i){let e=a(`Queued · #{{n}}, starts automatically when a slot opens`,{n:r??1});return(0,G.jsx)(nt,{className:`h-3.5 w-3.5 shrink-0 text-orange-500`,"aria-label":e,title:e,"data-enso":`conversation-queued`,"data-conversation-id":n,"data-tone":`queued`})}let o=e===`running`,s=!o&&(e===`failed`||e===`queued`&&!!i),c=!o&&!s&&t===!0;return(0,G.jsx)(`span`,{title:i,className:W(`h-1.5 w-1.5 shrink-0 rounded-full`,o&&`animate-pulse bg-brand`,s&&`bg-destructive`,c&&`bg-green-500`,!o&&!s&&!c&&`bg-muted-foreground/30`)})}function xoe(e,t){return e?t.some(e=>e.status===`running`||typeof e.pendingAskCount==`number`&&e.pendingAskCount>0||typeof e.pendingApprovalCount==`number`&&e.pendingApprovalCount>0):!1}var q9=null;async function J9(e,t=typeof navigator>`u`?void 0:navigator.wakeLock){if(!e||!t){if(!q9)return;let e=q9;q9=null;try{await e.release()}catch{}return}if(!q9)try{let e=await t.request(`screen`);q9=e,e.addEventListener(`release`,()=>{q9===e&&(q9=null)})}catch{q9=null}}function Soe(){if(!window.location.hash.replace(/^#/,``).includes(`pk=`))return null;let e=window.location.href;return history.replaceState(null,``,window.location.pathname+window.location.search),e}var Y9=`enso-phone-sidebar-pinned`,Coe=te();function woe(){let e=O(window.location.search);if(!e)return null;let t=new URLSearchParams(window.location.search);t.delete(`session`);let n=t.toString();return history.replaceState(null,``,window.location.pathname+(n?`?${n}`:``)),e}function Toe(){return le()?`ok`:/iphone|ipad|ipod/i.test(navigator.userAgent)&&!z()?`needs-install`:`unsupported`}function Eoe(){let[e,t]=(0,H.useState)(P),[n,i]=(0,H.useState)(je),c=b(e,n),[u]=(0,H.useState)(Soe),[f]=(0,H.useState)(_e),[m,h]=(0,H.useState)(f),[g,_]=(0,H.useState)(null),y=c!==null;(0,H.useEffect)(()=>{if(y)return;let e=!1;return r().then(t=>{e||_(S({paired:!1,marked:t,standalone:z()}))}),()=>{e=!0}},[y]);let[x,C]=(0,H.useState)(`connecting`),[w,T]=(0,H.useState)(`relay`),[D,O]=(0,H.useState)(null),[k,j]=(0,H.useState)([]),[N,F]=(0,H.useState)([]),[I,ee]=(0,H.useState)([]),[te,R]=(0,H.useState)([]),[re,ie]=(0,H.useState)([]),[ae]=(0,H.useState)(woe),[se]=(0,H.useState)(()=>d(c?.pairId??null,ae)),[V,ce]=(0,H.useState)(se.activeId),[le,de]=(0,H.useState)(null),[fe,pe]=(0,H.useState)(!1),[me,ge]=(0,H.useState)(new Set),[ve,be]=(0,H.useState)([]),[xe,Se]=(0,H.useState)(!1),Ce=vae(yae),[Te,Ee]=(0,H.useState)(()=>localStorage.getItem(Y9)!==`off`),De=Ce&&Te,Oe=()=>{Ee(e=>(localStorage.setItem(Y9,e?`off`:`on`),!e))},[ke,Ae]=(0,H.useState)(!1),[Me,Ie]=(0,H.useState)(null),[Re,ze]=(0,H.useState)(!1),[Be,Ve]=(0,H.useState)(()=>localStorage.getItem(ue)===`on`),[He,Ue]=(0,H.useState)(!1),[We,Ge]=(0,H.useState)(!1),[qe,Je]=(0,H.useState)(!1),[Ye,Xe]=(0,H.useState)(!1),[Ze,Qe]=(0,H.useState)(!1),[$e,et]=(0,H.useState)(null),[tt,U]=(0,H.useState)(!1),[nt,rt]=(0,H.useState)(!1),[it,at]=(0,H.useState)(!1),ot=(0,H.useRef)(!1),[st,ct]=(0,H.useState)(!1),[lt,ut]=(0,H.useState)(!1),dt=(0,H.useRef)(!1),[ft,pt]=(0,H.useState)([]),[mt,ht]=(0,H.useState)([]),[gt,_t]=(0,H.useState)([]),[vt,yt]=(0,H.useState)(!1),[bt,xt]=(0,H.useState)([]),[St,Ct]=(0,H.useState)({items:[],offset:0}),[wt,Tt]=(0,H.useState)(()=>q7(!0,se.botChatId)),[Et,Dt]=(0,H.useState)(se.botChatId),[Ot,kt]=(0,H.useState)(null),[At,jt]=(0,H.useState)({}),[Mt,Nt]=(0,H.useState)({}),[Pt,Ft]=(0,H.useState)({}),[It,Lt]=(0,H.useState)(null),Rt=(0,H.useRef)(null),zt=(0,H.useMemo)(()=>new Ha(e=>Wt.current?.send(e)),[]),Bt=(0,H.useMemo)(()=>new fs(e=>Wt.current?.send(e)),[]),Vt=(0,H.useMemo)(()=>new ms(e=>Wt.current?.send(e)),[]),[Ht,Ut]=(0,H.useState)([]),Wt=(0,H.useRef)(null),Gt=(0,H.useRef)(V),Kt=(0,H.useRef)(k),qt=(0,H.useRef)(le);Kt.current=k,qt.current=le,Gt.current=V;let Jt=Et?gt.find(e=>e.id===Et):void 0,Yt=Jt?.kind===`group`?Go(Jt,ft):void 0,Xt=Yt?.current??Jt,Zt=Jt?.kind===`direct`?Jt.sessions[Jt.members[0]]?.conversationId??null:null,Qt=Et?Zt??Ot:V,$t=(0,H.useRef)(Qt);$t.current=Qt;let en=(0,H.useRef)(gt);en.current=gt;let tn=(0,H.useRef)(Et);tn.current=Et;let nn=(0,H.useRef)(null);nn.current=Yt?.current.id??null;let rn=(0,H.useRef)(new Set);rn.current=new Set(Yt?Object.values(Yt.current.sessions).map(e=>e.conversationId):[]);let an=(0,H.useRef)(null),on=(0,H.useRef)(new Map),sn=(0,H.useRef)(null),[cn,ln]=(0,H.useState)(!1),un=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(Ne(),!(`serviceWorker`in navigator))return;let e=e=>{let t=e.data;if(t?.type!==`open-session`)return;let n=p(t.sessionId);if(!n)return;let r=en.current.find(e=>Object.values(e.sessions).some(e=>e.conversationId===n));r?(Dt(r.id),kt(null)):(Dt(null),ce(n)),On()};return navigator.serviceWorker.addEventListener(`message`,e),()=>navigator.serviceWorker.removeEventListener(`message`,e)},[]),(0,H.useEffect)(()=>{ka(Da(k))},[k]),(0,H.useEffect)(()=>{let e=()=>{J9(xoe(document.visibilityState===`visible`&&x===`online`,k))};return e(),document.addEventListener(`visibilitychange`,e),document.addEventListener(`pointerdown`,e,{passive:!0}),()=>{document.removeEventListener(`visibilitychange`,e),document.removeEventListener(`pointerdown`,e),J9(!1)}},[k,x]),(0,H.useEffect)(()=>{if(ae){v();return}v().then(e=>{e&&(Dt(null),kt(null),ce(e),On())})},[ae]),(0,H.useEffect)(()=>{u&&e.length>0&&h(!0)},[]),(0,H.useEffect)(()=>{if(!c)return;un.current=null,Ue(!1),ge(new Set),T(`relay`),Ge(!1),Je(!1),Xe(!1),rt(!1),at(!1),ot.current=!1,ct(!1),ut(!1),dt.current=!1;let e=()=>{Ge(!0),Xe(!0)},t=new L(c,{onState:e=>{e!==`online`&&(Rt.current?.interrupted(),zt.reset(),Bt.reset(),Vt.reset(),rt(!1),ct(!1)),C(e)},onBotArtifacts:e=>zt.receive(e),onBotArtifactImage:e=>zt.receiveImage(e),onBotNewSessionResult:t=>{Bt.receive(t),t.error===`read-only`&&e()},onBotThreadResult:t=>{Vt.receive(t),t.error===`read-only`&&e()},onTransport:e=>{T(e),O(null)},onRtt:O,onRemoteDesktop:Je,onReadOnly:e=>{Ge(e),e||Xe(!1)},onCommandRejected:(t,n)=>{n===`read-only`&&e()},onCatalog:(e,t)=>{j(e),F(t??[])},onProjects:(e,t)=>{ee(e),R(t??[])},onProviders:ie,onSession:(e,t)=>{de(n=>e===$t.current?t:n),rn.current.has(e)&&Ft(n=>({...n,[e]:t}))},onBotCatalog:(e,t,n,r)=>{U(e),rt(e&&n),ct(e&&r),ht(t),!e&&(_t([]),pt([]),xt([]),Ct({items:[],offset:0}),Dt(null),kt(null),Tt(!1))},onBotChats:(e,t)=>{_t(e),pt(t),yt(!0)},onBotInbox:xt,onBotActivity:(e,t)=>{for(let t of e)on.current.set(t.conversationId,t.botId);Ct({items:e,offset:t})},onGroupTimeline:e=>{e.beforeSeq!==void 0&&sn.current===`${e.chatId}:${e.beforeSeq}`&&(sn.current=null,ln(!1)),jt(t=>({...t,[e.chatId]:Yo(t[e.chatId],e)}))},onBotChatState:({type:e,chatId:t,...n})=>Nt(e=>({...e,[t]:n})),onBotEvent:e=>{if(e.kind===`model-notice`){e.text&&(e.chatId===tn.current||e.chatId===nn.current)&&Lt(e.text);return}!e.chatId||e.chatId!==nn.current||an.current||(an.current=setTimeout(()=>{an.current=null;let e=nn.current;e&&t.send({type:`bot-chat-open`,chatId:e})},200))},onBotSendResult:t=>{Rt.current?.settle(t.deliveryId,t.ok,t.error),t.error===`read-only`&&e()},onBotRetryResult:e=>{e.chatId===nn.current&&Lt(e.ok?`已开始重试`:`重试失败:${e.error===`session-busy`?`请等当前回复结束`:`该回复已过期或无法恢复,请重新发送需求`}`)},onSync:e=>pe(e===`syncing`),onGhostSession:e=>{e===Gt.current&&ce(null)},onHistoryPending:(e,t)=>{ge(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},onPushConfig:e=>{un.current=e,Ue(!0),localStorage.getItem(`enso-phone-push`)===`on`&&B(e).then(e=>{e.ok&&t.send({type:`push-subscribe`,subscription:e.subscription})})}});Wt.current=t,t.connect();let n=()=>{document.visibilityState===`visible`?(t.nudge(`visibility`),t.send({type:`presence`,visible:!0}),r()):(t.conceal(),t.send({type:`presence`,visible:!1}),t.flushCache())},r=()=>navigator.serviceWorker?.controller?.postMessage({type:`badge-clear`});r();let i=()=>{document.visibilityState===`visible`&&(t.nudge(`online`),t.send({type:`presence`,visible:!0}),r())},a=e=>{document.visibilityState===`visible`&&(t.nudge(e.persisted?`online`:`visibility`),t.send({type:`presence`,visible:!0}),r())},o=()=>{document.visibilityState===`visible`&&t.nudge(`visibility`)},s=()=>{t.conceal(),t.flushCache()};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`online`,i),window.addEventListener(`pageshow`,a),window.addEventListener(`focus`,o),window.addEventListener(`pagehide`,s),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`online`,i),window.removeEventListener(`pageshow`,a),window.removeEventListener(`focus`,o),window.removeEventListener(`pagehide`,s),an.current&&clearTimeout(an.current),an.current=null,t.close(),Wt.current=null,Bt.reset(),Vt.reset()}},[c?.pairId,c?.token,c?.relayUrl,c?.contentKey]);let dn=(0,H.useRef)(new Set);(0,H.useEffect)(()=>{let e=Qt!==null&&dn.current.has(Qt);Wt.current?.subscribe(Qt,{fresh:e});for(let e of dn.current)e!==Qt&&dn.current.delete(e);de(Qt?Wt.current?.getSession(Qt)??null:null)},[Qt,c?.pairId]);let fn=c?.pairId;(0,H.useEffect)(()=>{fn&&he(fn,{activeId:V,botChatId:Et})},[V,Et,fn]),(0,H.useEffect)(()=>{if(!fn)return;let e=new Fe(o,fn);Rt.current=e,Ut([]);let t=e.subscribe(e=>Ut([...e]));return e.restore().catch(()=>Lt(`离线消息读取失败,请勿清除浏览器数据;恢复存储后可重试。`)),()=>{t(),Rt.current===e&&(Rt.current=null)}},[fn]),(0,H.useEffect)(()=>{if(x===`online`)for(let e of Rt.current?.drain()??[])Wt.current?.send({type:`bot-send`,chatId:e.chatId,text:e.text,...e.images?.length?{images:e.images}:{},deliveryId:e.deliveryId})},[x,Ht]),(0,H.useEffect)(()=>{let e=setInterval(()=>Rt.current?.expire(),1e3);return()=>clearInterval(e)},[]);let pn=Yt?.current.id??null;(0,H.useEffect)(()=>{!pn||x!==`online`||(sn.current=null,ln(!1),Wt.current?.send({type:`bot-chat-open`,chatId:pn}))},[pn,x]),(0,H.useEffect)(()=>{if(!cn)return;let e=setTimeout(()=>{sn.current=null,ln(!1),Lt(`历史加载未完成,请点击加载重试。`)},1e4);return()=>clearTimeout(e)},[cn]),(0,H.useEffect)(()=>{let e={};for(let t of rn.current){let n=Wt.current?.getSession(t);n&&(e[t]=n)}Ft(e)},[pn,Yt?.current.sessions]),(0,H.useEffect)(()=>{if(!V||Et)return;let e=gt.find(e=>Object.values(e.sessions).some(e=>e.conversationId===V));e&&(Dt(e.id),ce(null))},[V,Et,gt]),(0,H.useEffect)(()=>{let e=(e,t)=>{let n=Kt.current.find(t=>t.id===e)?.queued,r=Vie(n,e,t,z7(e===Gt.current&&qt.current?[...qt.current.messages.values()]:[]));r&&be(e=>[...e,r])};YN({removeQueuedMessage:(e,t)=>Wt.current?.send({type:`queue-remove`,sessionId:e,messageId:t}),updateQueuedMessage:(e,t,n)=>Wt.current?.send({type:`queue-update`,sessionId:e,messageId:t,text:n}),sendQueuedNow:(t,n)=>{e(t,n),Wt.current?.send({type:`queue-send-now`,sessionId:t,messageId:n})},interruptAndSendQueued:async(t,n)=>{e(t,n),Wt.current?.send({type:`queue-interrupt-send`,sessionId:t,messageId:n})},pauseGoal:e=>Wt.current?.send({type:`goal-pause`,sessionId:e}),resumeGoal:e=>Wt.current?.send({type:`goal-resume`,sessionId:e}),clearGoal:e=>Wt.current?.send({type:`goal-clear`,sessionId:e}),rewind:(e,t,n)=>Wt.current?.send({type:`rewind`,sessionId:e,userIndexFromEnd:t,...n?{restoreFiles:n}:{}}),retry:e=>Wt.current?.send({type:`retry`,sessionId:e})}),Le({stopTask:(e,t)=>Wt.current?.send({type:`task-stop`,sessionId:e,taskId:t}),stopSubagent:(e,t)=>Wt.current?.send({type:`subagent-stop`,sessionId:e,agentId:t})})},[]);let mn=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!V)return;let e=z7(le?[...le.messages.values()]:[]),t=le?.status===`running`,n=mn.current,r=n?.id===V&&n.running&&!t;mn.current={id:V,running:t},be(t=>{let n=Wie(t,V,e,{turnSettled:r});return n.length===t.length&&n.every((e,n)=>e===t[n])?t:n})},[le,V]);let hn=k.find(e=>!e.parentId)?.id;(0,H.useEffect)(()=>{!Et&&!V&&hn&&ce(hn)},[V,Et,hn]);let gn=(0,H.useMemo)(()=>k.find(e=>e.id===V),[k,V]),_n=(0,H.useMemo)(()=>{if(!gn)return;let e=gn.parentId?k.find(e=>e.id===gn.parentId):gn;if(!e)return;let t=k.filter(t=>t.parentId===e.id);return t.length>0?{parent:e,children:t}:void 0},[k,gn]),vn=gn&&!gn.parentId,yn=vn?re.find(e=>e.id===gn.providerId)?.models.find(e=>e.id===gn.modelId)?.label??gn.modelId??`选择模型`:void 0,xn=x===`online`?a(w,D):Pe[x],Sn=e=>{j([]),F([]),ee([]),R([]),ie([]),de(null),pe(!1),be([]),O(null),U(!1),ht([]),_t([]),pt([]),yt(!1),Dt(e.botChatId),Tt(e.botChatId!==null),kt(null),jt({}),Nt({}),Ct({items:[],offset:0}),Ft({}),Lt(null),ce(e.activeId)},Cn=e=>{e!==c?.pairId&&(l(e),i(e),C(`connecting`),Sn(d(e)),On())},wn=n=>{let r=A(e,n);if(E(r),l(n.pairId),f&&n.scope!==`read`){window.location.replace(ne(n.pairId));return}t(r),i(n.pairId),Sn(d(n.pairId)),h(!1)},Tn=n=>{n===c?.pairId&&Wt.current?.close();let{devices:r,fallback:a}=s(e,n,c?.pairId??null);t(r),a!==void 0&&(i(a?.pairId??null),a&&C(`connecting`),Sn(d(a?.pairId??null)),a||On())},En=(n,r)=>{t(M(e,n,r))};if(!c||m)return(0,G.jsx)(noe,{autoInvite:u,onPaired:wn,onCancel:c?()=>{f?window.location.replace(ne(c.pairId)):h(!1)}:void 0,notice:c?null:g});if(x===`unauthorized`){let t=e.length>1;return(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,G.jsx)(Bn,{className:`h-8 w-8 text-muted-foreground`}),(0,G.jsx)(`h1`,{className:`font-medium text-lg`,children:`配对已失效`}),(0,G.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`「`,c.label,`」已解绑此设备,`,t?`可移除它并切到其他电脑。`:`请重新扫码配对。`]}),(0,G.jsx)(Ea,{onClick:()=>Tn(c.pairId),children:t?`移除此配对`:`重新配对`})]})}if(x===`replaced`)return(0,G.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,G.jsx)(Bn,{className:`h-8 w-8 text-muted-foreground`}),(0,G.jsx)(`h1`,{className:`font-medium text-lg`,children:`已在其他页面打开`}),(0,G.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`「`,c.label,`」正被另一个页面连着,同一时间只能有一个页面。`]}),(0,G.jsx)(Ea,{onClick:()=>window.location.reload(),children:`在这个页面重连`})]});let Dn=e=>Wt.current?.send(e),On=()=>{(localStorage.getItem(Y9)===`off`||!window.matchMedia(`(min-width: 900px)`).matches)&&Se(!1)},kn=()=>{Tt(q7(tt,Et)),Se(!0),tt&&Dn({type:`bot-catalog-request`})},An=(e,t,n=[])=>{Lt(null),Rt.current?.enqueue({chatId:e,text:t,images:n})},jn=e=>(0,G.jsx)(Zae,{items:Ht.filter(t=>t.chatId===e),readOnly:We,onRetry:e=>Rt.current?.retry(e),onDiscard:e=>Rt.current?.discard(e)}),Mn=new Map(mt.map(e=>[e.id,e])),Nn=e=>We?`只读设备不能新建会话`:x===`online`?nt?it?`正在新建会话…`:Ht.some(t=>t.chatId===e)?`请先处理待发送消息`:void 0:`请升级桌面端以支持新建会话`:`请先连接桌面端`,Pn=async e=>{if(Nn(e)||ot.current)return;let t=Wt.current;ot.current=!0,at(!0),Lt(null);try{let n=await Bt.start(e,()=>t===Wt.current&&tn.current===e&&window.confirm(`群聊中仍有回复、排队或委派任务。新建会话将停止成员回复,并取消未标记保留的委派。旧消息会保留。继续吗?`));if(t!==Wt.current||tn.current!==e)return;Lt(!n||n.ok?null:n.error===`read-only`?`只读设备不能新建会话`:n.error===`timeout`||n.error===`offline`?`未收到新会话确认,请连接后核对聊天状态,勿重复操作`:`新建会话失败:${n.error??`请稍后重试`}`),n?.ok&&(t?.send({type:`bot-catalog-request`}),t?.send({type:`bot-chat-open`,chatId:e}))}finally{t===Wt.current&&(ot.current=!1,at(!1))}},Fn=We?`只读设备不能切换或新建话题`:x===`online`?lt?`正在处理话题…`:void 0:`请先连接桌面端`,In=async e=>{if(Fn||dt.current)return;let t=Wt.current;dt.current=!0,ut(!0),Lt(null);try{let n=await Vt.request(e);if(t!==Wt.current||tn.current!==e.chatId)return;n.ok?kt(null):Lt(n.error===`read-only`?`只读设备不能切换或新建话题`:n.error===`timeout`||n.error===`offline`?`未收到桌面确认,请连接后核对当前话题`:n.error===`invalid`?`该话题已不存在或群已归档`:`话题操作失败:${n.error??`请稍后重试`}`)}finally{t===Wt.current&&(dt.current=!1,ut(!1))}},Ln=e=>{if(e.kind===`group`&&!Ot){let t=Object.entries(e.sessions).flatMap(([e,{conversationId:t}])=>{let n=Pt[t];return n?[{sessionId:t,botId:e,view:n}]:[]});return(0,G.jsx)(_ae,{chat:e,bots:Mn,timeline:At[e.id],state:Mt[e.id],pending:t,activities:ss(St.items,e.id),clockOffset:St.offset,connState:x,stateLabel:xn,notice:It,outbox:jn(e.id),deviceReadOnly:We,readOnlyRejected:Ye,onOpenDrawer:kn,drawerDocked:De,onNewSession:()=>void Pn(e.id),canCreate:!Nn(e.id),newSessionHint:Nn(e.id),newSessionBusy:it,threads:st&&Yt&&Jt?{entries:Yt.entries,currentId:e.id,rootId:Jt.id,disabledHint:Fn,onSelect:e=>void In({type:`bot-thread-select`,chatId:Jt.id,threadId:e}),onCreate:()=>void In({type:`bot-thread-create`,chatId:Jt.id})}:void 0,onLoadOlder:()=>{let t=At[e.id]?.entries[0]?.seq,n=`${e.id}:${t}`;x!==`online`||t===void 0||sn.current||(sn.current=n,ln(!0),Dn({type:`bot-timeline`,chatId:e.id,beforeSeq:t}))},historyLoading:cn,onJumpLatest:()=>{sn.current=null,ln(!1),jt(t=>{let n={...t};return delete n[e.id],n}),Dn({type:`bot-chat-open`,chatId:e.id})},onSend:(t,n)=>An(e.id,t,n),onStop:()=>Dn({type:`bot-stop`,chatId:e.id}),onRetry:t=>{Lt(`正在请求重试…`),Dn({type:`bot-retry`,chatId:e.id,entryId:t})},onOpenProcess:kt,onApproval:(e,t,n)=>Dn({type:`approval-respond`,sessionId:e,requestId:t,decision:n}),onAsk:(e,t,n)=>Dn({type:`ask-respond`,sessionId:e,requestId:t,answer:n})})}let t=e.kind===`group`,n=At[e.id]?.entries.find(e=>e.kind===`bot`&&e.conversationId===Ot),r=Ot?on.current.get(Ot):void 0,i=Mn.get(t?n?.kind===`bot`?n.botId:r??``:e.members[0]);return(0,G.jsx)(V7,{sessionId:Qt??`bot-chat:${e.id}`,clockOffset:St.offset,title:t?`${i?.name??`成员`} · 过程`:i?.name??e.title,projectName:t?e.title:i?.title??``,view:Qt?le:Coe,connState:x,stateLabel:xn,syncing:fe&&!!Qt,onOpenDrawer:kn,drawerDocked:De,onNewSession:()=>!t&&void Pn(e.id),canCreate:!t&&!Nn(e.id),newSessionHint:Nn(e.id),newSessionBusy:it,hasOlder:!!(Qt&&le&&le.messages.size>0&&Math.min(...le.messages.keys())>0),historyLoading:!!(Qt&&me.has(Qt)),onLoadOlder:()=>Qt&&Wt.current?.requestHistory(Qt),bot:t?{readOnly:!0,onBack:()=>kt(null)}:{chatId:e.id,notice:It,outbox:jn(e.id)},artifacts:!t&&Qt?{chatId:e.id,conversationId:Qt}:void 0,deviceReadOnly:We,readOnlyRejected:Ye,onSend:(t,n)=>An(e.id,t,n),onAbort:()=>Qt&&Dn({type:`abort`,sessionId:Qt}),onApproval:(e,t)=>Qt&&Dn({type:`approval-respond`,sessionId:Qt,requestId:e,decision:t}),onAsk:(e,t)=>Qt&&Dn({type:`ask-respond`,sessionId:Qt,requestId:e,answer:t})})},Rn=async e=>{et(null);let t=oe(Dn);if(!e){Ve(!1),we(t);return}let n=un.current;if(!n)return;Ve(!0),Qe(!0);let r=await ye(n,t);Qe(!1),r.ok||(Ve(!1),et(r.reason))};return(0,G.jsxs)(`div`,{className:`phone-app-root flex h-full min-h-0`,children:[(0,G.jsx)(yoe,{open:De||xe,docked:De,pinnable:Ce,onTogglePinned:Oe,projects:I,groups:te,catalog:k,pinnedOrder:N,activeId:Et?null:V,canCreate:x===`online`&&!We,devices:e,activeDevicePairId:c.pairId,remoteDesktop:qe,connected:x===`online`,connectionLabel:xn,onClose:()=>On(),onSelect:e=>{Dt(null),kt(null),ce(e),On()},onNewConversation:e=>{On(),Ie(e),Ae(!0)},pushEnabled:Be,pushBusy:Ze,pushError:$e,pushAvailability:Toe(),pushConfigReady:He,onTogglePush:e=>void Rn(e),onSwitchDevice:Cn,onAddDevice:()=>{On(),h(!0)},onRenameDevice:En,onUnpairDevice:Tn,botSegment:tt?{active:wt,onChange:e=>{Tt(e),nae(e?`bot`:`code`),e&&Dn({type:`bot-catalog-request`})},panel:(0,G.jsx)(ds,{bots:mt,chats:gt,activeChatId:Et,inbox:bt,activities:St.items,onDismiss:We?void 0:e=>Dn({type:`bot-inbox-dismiss`,key:e}),onSelect:e=>{Dt(e),kt(null),Lt(null),On()}})}:void 0}),(0,G.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col`,children:[Ce&&!De&&!xe&&(0,G.jsx)(`button`,{type:`button`,onClick:kn,"aria-label":`打开会话列表`,className:`fixed top-1/2 left-0 z-40 flex h-16 w-6 -translate-y-1/2 items-center justify-center rounded-r-lg border border-l-0 bg-background/90 text-muted-foreground shadow-sm backdrop-blur transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(bn,{className:`h-4.5 w-4.5`})}),Jt?(0,G.jsx)(Ga.Provider,{value:{port:zt,online:x===`online`},children:Ln(Xt??Jt)}):Et?(0,G.jsxs)(`div`,{className:`relative flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[!De&&(0,G.jsx)(`button`,{type:`button`,onClick:kn,"aria-label":`打开会话列表`,className:`absolute top-2 left-2 flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,G.jsx)(bn,{className:`h-4.5 w-4.5`})}),(0,G.jsx)(`p`,{children:vt?`该 Bot 聊天已不存在或不可用`:`正在恢复 Bot 聊天…`}),(0,G.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:xn}),(0,G.jsx)(Ea,{onClick:kn,children:`选择聊天`})]}):(0,G.jsx)(V7,{sessionId:V,title:gn?.title||(V?`会话`:`EnsoCode`),projectName:gn?.projectName??``,cwd:gn?.cwd,view:le,connState:x,stateLabel:xn,syncing:fe&&!!V,onOpenDrawer:kn,drawerDocked:De,onNewSession:()=>{Ie(null),Ae(!0)},canCreate:x===`online`&&I.length>0&&!We,modelLabel:x===`online`?yn:void 0,onOpenConfig:()=>ze(!0),tabGroup:_n,onSelectTab:ce,hasOlder:!!(V&&le&&le.messages.size>0&&Math.min(...le.messages.keys())>0),historyLoading:!!(V&&me.has(V)),onLoadOlder:()=>V&&Wt.current?.requestHistory(V),queued:Hie(gn?.queued,ve,V??``),echoes:ve,goal:gn?.goal,context:gn?.context,usageTotals:gn?.usageTotals,slashCommands:gn?.slashCommands,deviceReadOnly:We,readOnlyRejected:Ye,onSend:(e,t)=>{if(!V)return;let n=Ke(e);if(n){Dn({type:`compact`,sessionId:V,...n.instructions?{instructions:n.instructions}:{}});return}let r=/^\/goal(?:\s+([\s\S]+))?$/.exec(e.trim());if(r){let e=r[1]?.trim();if(!e)return;Dn(e===`clear`?{type:`goal-clear`,sessionId:V}:e===`pause`?{type:`goal-pause`,sessionId:V}:e===`resume`?{type:`goal-resume`,sessionId:V}:{type:`goal-set`,sessionId:V,text:e});return}Dn({type:le?.status===`running`?`enqueue`:`prompt`,sessionId:V,text:e,...t.length?{images:t}:{}})},onAbort:()=>V&&Dn({type:`abort`,sessionId:V}),onApproval:(e,t)=>V&&Dn({type:`approval-respond`,sessionId:V,requestId:e,decision:t}),onAsk:(e,t)=>V&&Dn({type:`ask-respond`,sessionId:V,requestId:e,answer:t})}),(0,G.jsx)(Yae,{open:ke&&!We,projects:I,providers:re,preferredProjectId:Me,onClose:()=>{Ae(!1),Ie(null)},onCreate:e=>{let t=crypto.randomUUID();Dn({type:`spawn`,sessionId:t,...e}),dn.current.add(t),Ae(!1),Ie(null),Dt(null),kt(null),ce(t)}}),vn&&V&&!We&&(0,G.jsx)(roe,{open:Re,providers:re,config:{providerId:gn.providerId,modelId:gn.modelId,reasoningEnabled:gn.reasoningEnabled,thinkingLevel:gn.thinkingLevel},onClose:()=>ze(!1),onSetModel:(e,t)=>Dn({type:`set-model`,sessionId:V,providerId:e,modelId:t}),onSetReasoning:e=>Dn({type:`set-reasoning`,sessionId:V,enabled:e}),onSetThinking:e=>Dn({type:`set-thinking`,sessionId:V,level:e})})]})]})}function Doe(e){return!e.appleMobile||!e.standalone||e.safeTop<=0||e.innerHeight<=e.innerWidth?!1:e.innerHeight>=Math.max(e.screenWidth,e.screenHeight)-1}function Ooe(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e&&!/^viewport-fit\s*=/i.test(e)).join(`, `)}function koe(){return/iphone|ipad|ipod/i.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function Aoe(){let e=document.querySelector(`meta[name="viewport"]`);if(!e||!koe())return;let t=document.createElement(`div`);t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)`,document.body.appendChild(t);let n=()=>{let r=getComputedStyle(t);if(!Doe({appleMobile:!0,standalone:z(),safeTop:Number.parseFloat(r.paddingTop)||0,innerWidth:window.innerWidth,innerHeight:window.innerHeight,screenWidth:window.screen.width,screenHeight:window.screen.height}))return;let i=Number.parseFloat(r.paddingBottom)||0;document.documentElement.style.setProperty(`--phone-safe-bottom`,`${i}px`),e.content=Ooe(e.content),window.removeEventListener(`resize`,n),document.removeEventListener(`visibilitychange`,n),t.remove()};window.addEventListener(`resize`,n),document.addEventListener(`visibilitychange`,n),n()}var X9=new URLSearchParams(location.search);if(X9.get(`mode`)===`phone`){ie(`phone`),X9.delete(`mode`);let e=X9.toString();history.replaceState(null,``,`${location.pathname}${e?`?${e}`:``}${location.hash}`)}var Z9=P(),Q9=Se(location.search,Ee(),Z9,je());Q9?location.replace(Q9):Z9.length>0&&(pe(),w(!0)),I(),Aoe(),Q9||xe(window),!Q9&&`serviceWorker`in navigator&&De({container:navigator.serviceWorker,doc:document,storage:sessionStorage,canReloadNow:()=>!1,reload:()=>location.reload()});var $9=document.getElementById(`root`);$9&&!Q9&&(0,We.createRoot)($9).render((0,G.jsx)(H.StrictMode,{children:(0,G.jsx)(Eoe,{})}));export{U0 as a,op as c,ec as d,q as f,R2 as i,Du as l,Wa as m,w4 as n,$g as o,K as p,L2 as r,rm as s,t6 as t,Ac as u};