@lovelybunch/api 1.0.77-alpha.1 → 1.0.77-alpha.2

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 (123) hide show
  1. package/dist/lib/auth/clerk-verifier.js +10 -1
  2. package/dist/routes/api/v1/auth/route.js +14 -10
  3. package/package.json +4 -4
  4. package/static/assets/{ActivityPage-DqSj7XDx.js → ActivityPage-BrpfoR1x.js} +1 -1
  5. package/static/assets/{AgentsContextEditPage-C5afMo09.js → AgentsContextEditPage-DD96j1Gu.js} +1 -1
  6. package/static/assets/{AgentsContextPage-IrZGdiYt.js → AgentsContextPage-DbGPK_nF.js} +1 -1
  7. package/static/assets/{ApiKeysSettingsPage-CFBTIYNp.js → ApiKeysSettingsPage-DCRw8BVU.js} +1 -1
  8. package/static/assets/{AuthSettingsPage-LU7DFMG6.js → AuthSettingsPage-BZcuolzF.js} +1 -1
  9. package/static/assets/{CallbackPage-Beg0ZLv4.js → CallbackPage-j_Z5gQid.js} +1 -1
  10. package/static/assets/CoconutCallbackPage-ZEdMiq56.js +1 -0
  11. package/static/assets/{CodePage-C9auBWu3.js → CodePage-LOMEoK8O.js} +1 -1
  12. package/static/assets/{CollapsibleSection-C3uaXDrK.js → CollapsibleSection-iVC3bo9u.js} +1 -1
  13. package/static/assets/{DashboardPage-DK2uEtcQ.js → DashboardPage-CAxisL8l.js} +1 -1
  14. package/static/assets/{GitPage-BgfZ5rXn.js → GitPage-BzVIV2mo.js} +1 -1
  15. package/static/assets/{GitSettingsPage-DIhaZgDD.js → GitSettingsPage-CKWWrG0f.js} +1 -1
  16. package/static/assets/{IdentityPage-6_IEyGmH.js → IdentityPage-IVZ-nvh_.js} +1 -1
  17. package/static/assets/{ImplementationStepsEditor-BXjs77nI.js → ImplementationStepsEditor-IzyUL2cs.js} +1 -1
  18. package/static/assets/{IntegrationsSettingsPage-Cu-C86-i.js → IntegrationsSettingsPage-DvzES04i.js} +1 -1
  19. package/static/assets/{JobDetailPage-BWd0sz7w.js → JobDetailPage-DVKKQ1j7.js} +1 -1
  20. package/static/assets/{KnowledgeDetailPage-Cx0NiVN5.js → KnowledgeDetailPage-jdJGqZT9.js} +1 -1
  21. package/static/assets/{KnowledgeEditPage-Dtp9Ceyp.js → KnowledgeEditPage-C60yLCQf.js} +1 -1
  22. package/static/assets/{KnowledgePage-DRavibOT.js → KnowledgePage-B3G3eWhs.js} +1 -1
  23. package/static/assets/{LoginPage-Bn-55dqi.js → LoginPage-DXRpkMQE.js} +1 -1
  24. package/static/assets/{MailInboxPage-B-mzoocZ.js → MailInboxPage-D4F-yUb2.js} +1 -1
  25. package/static/assets/{MailProcessingModal-B5HFIwxh.js → MailProcessingModal-C5TbdlsX.js} +1 -1
  26. package/static/assets/{MailReadPage-DVVICNmn.js → MailReadPage-Bn6Zw8xJ.js} +1 -1
  27. package/static/assets/{MailSentPage-BmqXLEIF.js → MailSentPage-Bk3jJOzz.js} +1 -1
  28. package/static/assets/{McpSettingsPage-D6hW-2uy.js → McpSettingsPage-D2UXUhK2.js} +1 -1
  29. package/static/assets/{MemoryEditPage-Cw2oWAW2.js → MemoryEditPage-fFwS44vf.js} +1 -1
  30. package/static/assets/{MemoryPage-BKNQlp0x.js → MemoryPage-BTOJoF-z.js} +1 -1
  31. package/static/assets/{NewKnowledgePage-zWnjfGF1.js → NewKnowledgePage-X86yjTVl.js} +1 -1
  32. package/static/assets/{NewSkillPage-eqK5nwnk.js → NewSkillPage-e8dGvY9r.js} +1 -1
  33. package/static/assets/{NewTaskPage-BcOmFrza.js → NewTaskPage-DhUlLdQA.js} +1 -1
  34. package/static/assets/{NotFoundPage-CKcBMXOQ.js → NotFoundPage-BjIfj-6G.js} +1 -1
  35. package/static/assets/{NotificationsSettingsPage-DETz35D7.js → NotificationsSettingsPage-YWyp3_fq.js} +1 -1
  36. package/static/assets/{PromptsSettingsPage-8--L7lw4.js → PromptsSettingsPage-DS-7Hcyy.js} +1 -1
  37. package/static/assets/{ResourceDetailPage-BH-A0yn7.js → ResourceDetailPage-5lxrzduZ.js} +1 -1
  38. package/static/assets/{ResourcesPage-CfdKptfd.js → ResourcesPage-5e8iv04j.js} +1 -1
  39. package/static/assets/{RoleEditPage-DfqF4tLW.js → RoleEditPage-CZl5kzLm.js} +1 -1
  40. package/static/assets/{RolePage-CCwufp_f.js → RolePage-DH1XSfmN.js} +1 -1
  41. package/static/assets/{RulesSettingsPage-dzUPGors.js → RulesSettingsPage-CfHyX5-L.js} +1 -1
  42. package/static/assets/{RunDetailPage-B9I5nrOb.js → RunDetailPage-CKvjq6lg.js} +1 -1
  43. package/static/assets/{SchedulePage-7Ufvzd34.js → SchedulePage-DK3H_i1s.js} +1 -1
  44. package/static/assets/{SkillDetailPage-DCjWVhUE.js → SkillDetailPage-K_CkFQv-.js} +1 -1
  45. package/static/assets/{SkillEditPage-BA-ebFGI.js → SkillEditPage-2X3bZgJ0.js} +1 -1
  46. package/static/assets/{SkillsPage-QqNzKzhn.js → SkillsPage-Ba-7nPAX.js} +1 -1
  47. package/static/assets/{SkillsSettingsPage-DPXiPnWO.js → SkillsSettingsPage-w64_WHIP.js} +1 -1
  48. package/static/assets/{SourceInput-0S84iX2C.js → SourceInput-I-hamu6Q.js} +1 -1
  49. package/static/assets/{TagInput-C_2MLj_1.js → TagInput-DEIDoXAF.js} +1 -1
  50. package/static/assets/{TaskDetailPage-6E7isObV.js → TaskDetailPage-CIzKy_lB.js} +1 -1
  51. package/static/assets/{TaskEditPage-Bd1DFoK3.js → TaskEditPage-DE5iZOlS.js} +1 -1
  52. package/static/assets/{TasksPage-CeWPVVwj.js → TasksPage-XJv3kCi4.js} +1 -1
  53. package/static/assets/{TeamEditPage-CgYsqeq9.js → TeamEditPage-BJYjNG9s.js} +1 -1
  54. package/static/assets/{TeamPage-CEojyLvc.js → TeamPage-8HQl8tJg.js} +1 -1
  55. package/static/assets/{TerminalPage-D-LJMND7.js → TerminalPage-1wX_kSZq.js} +1 -1
  56. package/static/assets/{TerminalSessionPage-BGHgOQhV.js → TerminalSessionPage-C9DF64yx.js} +1 -1
  57. package/static/assets/{UserPreferencesPage-D5nGgztl.js → UserPreferencesPage-soBs08Yv.js} +1 -1
  58. package/static/assets/{UserSettingsPage-Dv6fSWWx.js → UserSettingsPage-oGRL6qzb.js} +1 -1
  59. package/static/assets/{UtilitiesPage-hCM0KDs8.js → UtilitiesPage-CtZZsdkO.js} +1 -1
  60. package/static/assets/{alert-DxBTp_In.js → alert-yfoaxi15.js} +1 -1
  61. package/static/assets/{arrow-down-Be4lZFzF.js → arrow-down-CmC8SDMn.js} +1 -1
  62. package/static/assets/{arrow-left-DzGSl0dC.js → arrow-left-C3PN_VXn.js} +1 -1
  63. package/static/assets/{arrow-up-6HVzdiIw.js → arrow-up-C2_FqbAf.js} +1 -1
  64. package/static/assets/{arrow-up-down-C9lUuyDO.js → arrow-up-down-BxszeBWu.js} +1 -1
  65. package/static/assets/{badge-DyF_7_dv.js → badge-CfOS4AEh.js} +1 -1
  66. package/static/assets/{browser-modal-DKHn0FAC.js → browser-modal-CohGkjjX.js} +1 -1
  67. package/static/assets/{card-DW9yx9FC.js → card-DBbETqHr.js} +1 -1
  68. package/static/assets/{chevron-left-CJjrbO2y.js → chevron-left-CARf1vQR.js} +1 -1
  69. package/static/assets/{chevron-up-BrSqNhfU.js → chevron-up-DPqLVVFe.js} +1 -1
  70. package/static/assets/{chevrons-up-wQrNHZqU.js → chevrons-up-BJsTBH4G.js} +1 -1
  71. package/static/assets/{circle-alert-ByPjREVD.js → circle-alert-DvY6UCZI.js} +1 -1
  72. package/static/assets/{circle-check-D7peX4CI.js → circle-check-D4I1hq5t.js} +1 -1
  73. package/static/assets/{circle-check-big--yqXPZzU.js → circle-check-big-DXkEigqp.js} +1 -1
  74. package/static/assets/{circle-play-C2th8mzN.js → circle-play-Z-LH2XZF.js} +1 -1
  75. package/static/assets/{circle-x-Oj6Gai3s.js → circle-x-Dh-KgkYg.js} +1 -1
  76. package/static/assets/{clipboard-qigxJPlJ.js → clipboard-CME-lfxG.js} +1 -1
  77. package/static/assets/{clock-JhtahL2B.js → clock-CzUgbpxH.js} +1 -1
  78. package/static/assets/{code-DcBDG3ah.js → code-Bf5KtxD0.js} +1 -1
  79. package/static/assets/{download-BBjLPrfj.js → download-RyS06A9x.js} +1 -1
  80. package/static/assets/{external-link-DDneC3kx.js → external-link-BUmaJn8N.js} +1 -1
  81. package/static/assets/{eye-Bl23BbY6.js → eye-B6H1Wnna.js} +1 -1
  82. package/static/assets/{folder-git-2-BBe22u2y.js → folder-git-2-GfrcYXqB.js} +1 -1
  83. package/static/assets/{globe-C3j3aWiD.js → globe-DGJd-BEz.js} +1 -1
  84. package/static/assets/{index-Cbo5QxHl.js → index--3ISLTsV.js} +1 -1
  85. package/static/assets/{index-DaAZbWZV.js → index--Syi3rI6.js} +1 -1
  86. package/static/assets/{index-DFfxOZw8.js → index-2KcfNqV-.js} +1 -1
  87. package/static/assets/{index-DukcrMyC.js → index-3bHY1RZf.js} +1 -1
  88. package/static/assets/{index-DkobSVA-.js → index-7i8CPi9F.js} +1 -1
  89. package/static/assets/{index-QZn_aaqg.js → index-B2zWPdyi.js} +1 -1
  90. package/static/assets/{index-DdSybLsG.js → index-BCEWTKM2.js} +1 -1
  91. package/static/assets/{index-B-9XKFgb.js → index-BMfWq2j7.js} +1 -1
  92. package/static/assets/{index-UM1qitEs.js → index-BMooEqjV.js} +1 -1
  93. package/static/assets/{index-CWt3zgDI.js → index-BMtEpMwG.js} +1 -1
  94. package/static/assets/{index-DdDCTC_d.js → index-D7MExzMq.js} +1 -1
  95. package/static/assets/{index-DgFdrtDt.js → index-D7veMECT.js} +1 -1
  96. package/static/assets/{index-0zkOcODK.js → index-DQyKDJLd.js} +4 -4
  97. package/static/assets/{index-I6ZfnFaA.js → index-DztTpy2B.js} +1 -1
  98. package/static/assets/{index-DuWsaYa4.js → index-Oe08b-EX.js} +1 -1
  99. package/static/assets/{index-r07pPAcM.js → index-ctTeh4My.js} +1 -1
  100. package/static/assets/{index-DUwRskPW.js → index-kIIlr6Bh.js} +1 -1
  101. package/static/assets/{index-xBQb0rMo.js → index-sRKyM1Il.js} +1 -1
  102. package/static/assets/{index-D2rSjJPF.js → index-vmtCSD0U.js} +1 -1
  103. package/static/assets/{info-DWORrO-s.js → info-CHiTEVvq.js} +1 -1
  104. package/static/assets/{label-DyhnItJm.js → label-DZN-TTmJ.js} +1 -1
  105. package/static/assets/{markdown-editor-C8LFQE7K.js → markdown-editor-CjtUzCZF.js} +3 -3
  106. package/static/assets/{message-square-CiISW36v.js → message-square-D8KMCL9-.js} +1 -1
  107. package/static/assets/{paperclip-DRufaOtA.js → paperclip-CsjIUex0.js} +1 -1
  108. package/static/assets/{pause-GqIUdKFa.js → pause-DyIY-Fg6.js} +1 -1
  109. package/static/assets/{play-CkuTY54l.js → play-BsqG0Xxh.js} +1 -1
  110. package/static/assets/{radio-group-ClpV676y.js → radio-group-Cd6D1zWl.js} +1 -1
  111. package/static/assets/{refresh-cw-CYBx0C_n.js → refresh-cw-DvA7rcDs.js} +1 -1
  112. package/static/assets/{search-DxiQuWo1.js → search-BtvwgzIM.js} +1 -1
  113. package/static/assets/{select-D_L7OXwN.js → select-BTiepyTe.js} +1 -1
  114. package/static/assets/{server-CgjJESGe.js → server-DjyRLssO.js} +1 -1
  115. package/static/assets/{switch-DXojpqQ8.js → switch-QFsCjFLp.js} +1 -1
  116. package/static/assets/{tabs-zdz4RlY5.js → tabs-BQcOvpJ3.js} +1 -1
  117. package/static/assets/{tag-CeaYtqPJ.js → tag-ChBxeRYs.js} +1 -1
  118. package/static/assets/{terminal-preview-CspSfoko.js → terminal-preview-Ch9841_B.js} +1 -1
  119. package/static/assets/{triangle-alert-DTdlIh6V.js → triangle-alert-Dj9MnxX5.js} +1 -1
  120. package/static/assets/{use-terminal-DkVoTttR.js → use-terminal-CJ3EJhYK.js} +1 -1
  121. package/static/assets/{video-5zJ0jcFw.js → video-DHNX2nx5.js} +1 -1
  122. package/static/index.html +1 -1
  123. package/static/assets/CoconutCallbackPage-BuBYbeY-.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DK2uEtcQ.js","assets/card-DW9yx9FC.js","assets/badge-DyF_7_dv.js","assets/status-utils-PwF3DXLL.js","assets/label-DyhnItJm.js","assets/select-D_L7OXwN.js","assets/index-xBQb0rMo.js","assets/chevron-up-BrSqNhfU.js","assets/use-terminal-DkVoTttR.js","assets/terminal-preview-CspSfoko.js","assets/xterm-DTxiCjtJ.js","assets/xterm-qxJ8_QYu.css","assets/circle-check-D7peX4CI.js","assets/chevron-left-CJjrbO2y.js","assets/search-DxiQuWo1.js","assets/globe-C3j3aWiD.js","assets/code-DcBDG3ah.js","assets/folder-git-2-BBe22u2y.js","assets/external-link-DDneC3kx.js","assets/play-CkuTY54l.js","assets/clock-JhtahL2B.js","assets/circle-check-big--yqXPZzU.js","assets/LoginPage-Bn-55dqi.js","assets/tabs-zdz4RlY5.js","assets/CallbackPage-Beg0ZLv4.js","assets/circle-x-Oj6Gai3s.js","assets/TasksPage-CeWPVVwj.js","assets/TaskDetailPage-6E7isObV.js","assets/clipboard-B9ndUJKl.js","assets/arrow-left-DzGSl0dC.js","assets/clipboard-qigxJPlJ.js","assets/arrow-up-down-C9lUuyDO.js","assets/info-DWORrO-s.js","assets/message-square-CiISW36v.js","assets/TaskEditPage-Bd1DFoK3.js","assets/markdown-editor-C8LFQE7K.js","assets/markdown-editor-B6HEtSkH.css","assets/CollapsibleSection-C3uaXDrK.js","assets/ImplementationStepsEditor-BXjs77nI.js","assets/TagInput-C_2MLj_1.js","assets/NewTaskPage-BcOmFrza.js","assets/TerminalPage-D-LJMND7.js","assets/refresh-cw-CYBx0C_n.js","assets/chevrons-up-wQrNHZqU.js","assets/circle-play-C2th8mzN.js","assets/terminal-xj47PT8r.css","assets/TerminalSessionPage-BGHgOQhV.js","assets/radio-group-ClpV676y.js","assets/arrow-down-Be4lZFzF.js","assets/pipeline-builders-DrEjlsbH.js","assets/eye-Bl23BbY6.js","assets/server-CgjJESGe.js","assets/UtilitiesPage-hCM0KDs8.js","assets/CodePage-C9auBWu3.js","assets/SkillsPage-QqNzKzhn.js","assets/browser-modal-DKHn0FAC.js","assets/registry-ANRa5WBi.js","assets/SkillDetailPage-DCjWVhUE.js","assets/NewSkillPage-eqK5nwnk.js","assets/SkillEditPage-BA-ebFGI.js","assets/ResourcesPage-CfdKptfd.js","assets/video-5zJ0jcFw.js","assets/download-BBjLPrfj.js","assets/tag-CeaYtqPJ.js","assets/ResourceDetailPage-BH-A0yn7.js","assets/KnowledgePage-DRavibOT.js","assets/arrow-up-6HVzdiIw.js","assets/KnowledgeDetailPage-Cx0NiVN5.js","assets/KnowledgeEditPage-Dtp9Ceyp.js","assets/SourceInput-0S84iX2C.js","assets/NewKnowledgePage-zWnjfGF1.js","assets/RolePage-CCwufp_f.js","assets/RoleEditPage-DfqF4tLW.js","assets/AgentsContextPage-IrZGdiYt.js","assets/AgentsContextEditPage-C5afMo09.js","assets/TeamPage-CEojyLvc.js","assets/TeamEditPage-CgYsqeq9.js","assets/MemoryPage-BKNQlp0x.js","assets/MemoryEditPage-Cw2oWAW2.js","assets/IdentityPage-6_IEyGmH.js","assets/alert-DxBTp_In.js","assets/UserSettingsPage-Dv6fSWWx.js","assets/AuthSettingsPage-LU7DFMG6.js","assets/switch-DXojpqQ8.js","assets/circle-alert-ByPjREVD.js","assets/ApiKeysSettingsPage-CFBTIYNp.js","assets/SkillsSettingsPage-DPXiPnWO.js","assets/IntegrationsSettingsPage-Cu-C86-i.js","assets/GitSettingsPage-DIhaZgDD.js","assets/McpSettingsPage-D6hW-2uy.js","assets/PromptsSettingsPage-8--L7lw4.js","assets/RulesSettingsPage-dzUPGors.js","assets/NotificationsSettingsPage-DETz35D7.js","assets/GitPage-BgfZ5rXn.js","assets/SchedulePage-7Ufvzd34.js","assets/pause-GqIUdKFa.js","assets/JobDetailPage-BWd0sz7w.js","assets/RunDetailPage-B9I5nrOb.js","assets/triangle-alert-DTdlIh6V.js","assets/UserPreferencesPage-D5nGgztl.js","assets/ActivityPage-DqSj7XDx.js","assets/MailInboxPage-B-mzoocZ.js","assets/MailProcessingModal-B5HFIwxh.js","assets/paperclip-DRufaOtA.js","assets/MailReadPage-DVVICNmn.js","assets/MailSentPage-BmqXLEIF.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-CAxisL8l.js","assets/card-DBbETqHr.js","assets/badge-CfOS4AEh.js","assets/status-utils-PwF3DXLL.js","assets/label-DZN-TTmJ.js","assets/select-BTiepyTe.js","assets/index-sRKyM1Il.js","assets/chevron-up-DPqLVVFe.js","assets/use-terminal-CJ3EJhYK.js","assets/terminal-preview-Ch9841_B.js","assets/xterm-DTxiCjtJ.js","assets/xterm-qxJ8_QYu.css","assets/circle-check-D4I1hq5t.js","assets/chevron-left-CARf1vQR.js","assets/search-BtvwgzIM.js","assets/globe-DGJd-BEz.js","assets/code-Bf5KtxD0.js","assets/folder-git-2-GfrcYXqB.js","assets/external-link-BUmaJn8N.js","assets/play-BsqG0Xxh.js","assets/clock-CzUgbpxH.js","assets/circle-check-big-DXkEigqp.js","assets/LoginPage-DXRpkMQE.js","assets/tabs-BQcOvpJ3.js","assets/CallbackPage-j_Z5gQid.js","assets/circle-x-Dh-KgkYg.js","assets/TasksPage-XJv3kCi4.js","assets/TaskDetailPage-CIzKy_lB.js","assets/clipboard-B9ndUJKl.js","assets/arrow-left-C3PN_VXn.js","assets/clipboard-CME-lfxG.js","assets/arrow-up-down-BxszeBWu.js","assets/info-CHiTEVvq.js","assets/message-square-D8KMCL9-.js","assets/TaskEditPage-DE5iZOlS.js","assets/markdown-editor-CjtUzCZF.js","assets/markdown-editor-B6HEtSkH.css","assets/CollapsibleSection-iVC3bo9u.js","assets/ImplementationStepsEditor-IzyUL2cs.js","assets/TagInput-DEIDoXAF.js","assets/NewTaskPage-DhUlLdQA.js","assets/TerminalPage-1wX_kSZq.js","assets/refresh-cw-DvA7rcDs.js","assets/chevrons-up-BJsTBH4G.js","assets/circle-play-Z-LH2XZF.js","assets/terminal-xj47PT8r.css","assets/TerminalSessionPage-C9DF64yx.js","assets/radio-group-Cd6D1zWl.js","assets/arrow-down-CmC8SDMn.js","assets/pipeline-builders-DrEjlsbH.js","assets/eye-B6H1Wnna.js","assets/server-DjyRLssO.js","assets/UtilitiesPage-CtZZsdkO.js","assets/CodePage-LOMEoK8O.js","assets/SkillsPage-Ba-7nPAX.js","assets/browser-modal-CohGkjjX.js","assets/registry-ANRa5WBi.js","assets/SkillDetailPage-K_CkFQv-.js","assets/NewSkillPage-e8dGvY9r.js","assets/SkillEditPage-2X3bZgJ0.js","assets/ResourcesPage-5e8iv04j.js","assets/video-DHNX2nx5.js","assets/download-RyS06A9x.js","assets/tag-ChBxeRYs.js","assets/ResourceDetailPage-5lxrzduZ.js","assets/KnowledgePage-B3G3eWhs.js","assets/arrow-up-C2_FqbAf.js","assets/KnowledgeDetailPage-jdJGqZT9.js","assets/KnowledgeEditPage-C60yLCQf.js","assets/SourceInput-I-hamu6Q.js","assets/NewKnowledgePage-X86yjTVl.js","assets/RolePage-DH1XSfmN.js","assets/RoleEditPage-CZl5kzLm.js","assets/AgentsContextPage-DbGPK_nF.js","assets/AgentsContextEditPage-DD96j1Gu.js","assets/TeamPage-8HQl8tJg.js","assets/TeamEditPage-BJYjNG9s.js","assets/MemoryPage-BTOJoF-z.js","assets/MemoryEditPage-fFwS44vf.js","assets/IdentityPage-IVZ-nvh_.js","assets/alert-yfoaxi15.js","assets/UserSettingsPage-oGRL6qzb.js","assets/AuthSettingsPage-BZcuolzF.js","assets/switch-QFsCjFLp.js","assets/circle-alert-DvY6UCZI.js","assets/ApiKeysSettingsPage-DCRw8BVU.js","assets/SkillsSettingsPage-w64_WHIP.js","assets/IntegrationsSettingsPage-DvzES04i.js","assets/GitSettingsPage-CKWWrG0f.js","assets/McpSettingsPage-D2UXUhK2.js","assets/PromptsSettingsPage-DS-7Hcyy.js","assets/RulesSettingsPage-CfHyX5-L.js","assets/NotificationsSettingsPage-YWyp3_fq.js","assets/GitPage-BzVIV2mo.js","assets/SchedulePage-DK3H_i1s.js","assets/pause-DyIY-Fg6.js","assets/JobDetailPage-DVKKQ1j7.js","assets/RunDetailPage-CKvjq6lg.js","assets/triangle-alert-Dj9MnxX5.js","assets/UserPreferencesPage-soBs08Yv.js","assets/ActivityPage-BrpfoR1x.js","assets/MailInboxPage-D4F-yUb2.js","assets/MailProcessingModal-C5TbdlsX.js","assets/paperclip-CsjIUex0.js","assets/MailReadPage-Bn6Zw8xJ.js","assets/MailSentPage-Bk3jJOzz.js"])))=>i.map(i=>d[i]);
2
2
  function BA(e,n){for(var r=0;r<n.length;r++){const i=n[r];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(i,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();var QU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qd={exports:{}},go={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -58,7 +58,7 @@ Error generating stack: `+l.message+`
58
58
  * @license MIT
59
59
  */var Dx="popstate";function WA(e={}){function n(i,o){let{pathname:s,search:c,hash:f}=i.location;return Uh("",{pathname:s,search:c,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(i,o){return typeof o=="string"?o:jo(o)}return eT(n,r,null,e)}function ft(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function zn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function JA(){return Math.random().toString(36).substring(2,10)}function Ox(e,n){return{usr:e.state,key:e.key,idx:n}}function Uh(e,n,r=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?cl(n):n,state:r,key:n&&n.key||i||JA()}}function jo({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function cl(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(n.search=e.substring(i),e=e.substring(0,i)),e&&(n.pathname=e)}return n}function eT(e,n,r,i={}){let{window:o=document.defaultView,v5Compat:s=!1}=i,c=o.history,f="POP",h=null,d=m();d==null&&(d=0,c.replaceState({...c.state,idx:d},""));function m(){return(c.state||{idx:null}).idx}function y(){f="POP";let A=m(),T=A==null?null:A-d;d=A,h&&h({action:f,location:C.location,delta:T})}function b(A,T){f="PUSH";let N=Uh(C.location,A,T);d=m()+1;let _=Ox(N,d),j=C.createHref(N);try{c.pushState(_,"",j)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(j)}s&&h&&h({action:f,location:C.location,delta:1})}function w(A,T){f="REPLACE";let N=Uh(C.location,A,T);d=m();let _=Ox(N,d),j=C.createHref(N);c.replaceState(_,"",j),s&&h&&h({action:f,location:C.location,delta:0})}function E(A){return tT(A)}let C={get action(){return f},get location(){return e(o,c)},listen(A){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Dx,y),h=A,()=>{o.removeEventListener(Dx,y),h=null}},createHref(A){return n(o,A)},createURL:E,encodeLocation(A){let T=E(A);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:b,replace:w,go(A){return c.go(A)}};return C}function tT(e,n=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),ft(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:jo(e);return i=i.replace(/ $/,"%20"),!n&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function R0(e,n,r="/"){return nT(e,n,r,!1)}function nT(e,n,r,i){let o=typeof n=="string"?cl(n):n,s=Pr(o.pathname||"/",r);if(s==null)return null;let c=_0(e);rT(c);let f=null;for(let h=0;f==null&&h<c.length;++h){let d=pT(s);f=dT(c[h],d,i)}return f}function _0(e,n=[],r=[],i="",o=!1){let s=(c,f,h=o,d)=>{let m={relativePath:d===void 0?c.path||"":d,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&h)return;ft(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let y=zr([i,m.relativePath]),b=r.concat(m);c.children&&c.children.length>0&&(ft(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),_0(c.children,n,b,y,h)),!(c.path==null&&!c.index)&&n.push({path:y,score:cT(y,c.index),routesMeta:b})};return e.forEach((c,f)=>{if(c.path===""||!c.path?.includes("?"))s(c,f);else for(let h of N0(c.path))s(c,f,!0,h)}),n}function N0(e){let n=e.split("/");if(n.length===0)return[];let[r,...i]=n,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(i.length===0)return o?[s,""]:[s];let c=N0(i.join("/")),f=[];return f.push(...c.map(h=>h===""?s:[s,h].join("/"))),o&&f.push(...c),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function rT(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:fT(n.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var aT=/^:[\w-]+$/,iT=3,lT=2,oT=1,sT=10,uT=-2,Lx=e=>e==="*";function cT(e,n){let r=e.split("/"),i=r.length;return r.some(Lx)&&(i+=uT),n&&(i+=lT),r.filter(o=>!Lx(o)).reduce((o,s)=>o+(aT.test(s)?iT:s===""?oT:sT),i)}function fT(e,n){return e.length===n.length&&e.slice(0,-1).every((i,o)=>i===n[o])?e[e.length-1]-n[n.length-1]:0}function dT(e,n,r=!1){let{routesMeta:i}=e,o={},s="/",c=[];for(let f=0;f<i.length;++f){let h=i[f],d=f===i.length-1,m=s==="/"?n:n.slice(s.length)||"/",y=Xu({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},m),b=h.route;if(!y&&d&&r&&!i[i.length-1].route.index&&(y=Xu({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:zr([s,y.pathname]),pathnameBase:vT(zr([s,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(s=zr([s,y.pathnameBase]))}return c}function Xu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=hT(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:i.reduce((d,{paramName:m,isOptional:y},b)=>{if(m==="*"){let E=f[b]||"";c=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const w=f[b];return y&&!w?d[m]=void 0:d[m]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:c,pattern:e}}function hT(e,n=!1,r=!0){zn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h)=>(i.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),i]}function pT(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return zn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Pr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}function mT(e,n="/"){let{pathname:r,search:i="",hash:o=""}=typeof e=="string"?cl(e):e;return{pathname:r?r.startsWith("/")?r:gT(r,n):n,search:xT(i),hash:bT(o)}}function gT(e,n){let r=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function nh(e,n,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yT(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Ep(e){let n=yT(e);return n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase)}function kp(e,n,r,i=!1){let o;typeof e=="string"?o=cl(e):(o={...e},ft(!o.pathname||!o.pathname.includes("?"),nh("?","pathname","search",o)),ft(!o.pathname||!o.pathname.includes("#"),nh("#","pathname","hash",o)),ft(!o.search||!o.search.includes("#"),nh("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,f;if(c==null)f=r;else{let y=n.length-1;if(!i&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),y-=1;o.pathname=b.join("/")}f=y>=0?n[y]:"/"}let h=mT(o,f),d=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(d||m)&&(h.pathname+="/"),h}var zr=e=>e.join("/").replace(/\/\/+/g,"/"),vT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function wT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var M0=["POST","PUT","PATCH","DELETE"];new Set(M0);var ST=["GET",...M0];new Set(ST);var fl=x.createContext(null);fl.displayName="DataRouter";var dc=x.createContext(null);dc.displayName="DataRouterState";x.createContext(!1);var j0=x.createContext({isTransitioning:!1});j0.displayName="ViewTransition";var ET=x.createContext(new Map);ET.displayName="Fetchers";var kT=x.createContext(null);kT.displayName="Await";var Kn=x.createContext(null);Kn.displayName="Navigation";var $o=x.createContext(null);$o.displayName="Location";var Pn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Pn.displayName="Route";var Cp=x.createContext(null);Cp.displayName="RouteError";function CT(e,{relative:n}={}){ft(dl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=x.useContext(Kn),{hash:o,pathname:s,search:c}=Yo(e,{relative:n}),f=s;return r!=="/"&&(f=s==="/"?r:zr([r,s])),i.createHref({pathname:f,search:c,hash:o})}function dl(){return x.useContext($o)!=null}function on(){return ft(dl(),"useLocation() may be used only in the context of a <Router> component."),x.useContext($o).location}var D0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function O0(e){x.useContext(Kn).static||x.useLayoutEffect(e)}function Go(){let{isDataRoute:e}=x.useContext(Pn);return e?BT():AT()}function AT(){ft(dl(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(fl),{basename:n,navigator:r}=x.useContext(Kn),{matches:i}=x.useContext(Pn),{pathname:o}=on(),s=JSON.stringify(Ep(i)),c=x.useRef(!1);return O0(()=>{c.current=!0}),x.useCallback((h,d={})=>{if(zn(c.current,D0),!c.current)return;if(typeof h=="number"){r.go(h);return}let m=kp(h,JSON.parse(s),o,d.relative==="path");e==null&&n!=="/"&&(m.pathname=m.pathname==="/"?n:zr([n,m.pathname])),(d.replace?r.replace:r.push)(m,d.state,d)},[n,r,s,o,e])}var TT=x.createContext(null);function RT(e){let n=x.useContext(Pn).outlet;return n&&x.createElement(TT.Provider,{value:e},n)}function ZU(){let{matches:e}=x.useContext(Pn),n=e[e.length-1];return n?n.params:{}}function Yo(e,{relative:n}={}){let{matches:r}=x.useContext(Pn),{pathname:i}=on(),o=JSON.stringify(Ep(r));return x.useMemo(()=>kp(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function _T(e,n){return L0(e,n)}function L0(e,n,r,i,o){ft(dl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=x.useContext(Kn),{matches:c}=x.useContext(Pn),f=c[c.length-1],h=f?f.params:{},d=f?f.pathname:"/",m=f?f.pathnameBase:"/",y=f&&f.route;{let N=y&&y.path||"";z0(d,!y||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
60
 
61
- Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let b=on(),w;if(n){let N=typeof n=="string"?cl(n):n;ft(m==="/"||N.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${N.pathname}" was given in the \`location\` prop.`),w=N}else w=b;let E=w.pathname||"/",C=E;if(m!=="/"){let N=m.replace(/^\//,"").split("/");C="/"+E.replace(/^\//,"").split("/").slice(N.length).join("/")}let A=R0(e,{pathname:C});zn(y||A!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),zn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=OT(A&&A.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:zr([m,s.encodeLocation?s.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:zr([m,s.encodeLocation?s.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),c,r,i,o);return n&&T?x.createElement($o.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},T):T}function NT(){let e=UT(),n=wT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:s},"ErrorBoundary")," or"," ",x.createElement("code",{style:s},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),r?x.createElement("pre",{style:o},r):null,c)}var MT=x.createElement(NT,null),jT=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.unstable_onError?this.props.unstable_onError(e,n):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?x.createElement(Pn.Provider,{value:this.props.routeContext},x.createElement(Cp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function DT({routeContext:e,match:n,children:r}){let i=x.useContext(fl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Pn.Provider,{value:e},r)}function OT(e,n=[],r=null,i=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,c=r?.errors;if(c!=null){let d=s.findIndex(m=>m.route.id&&c?.[m.route.id]!==void 0);ft(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,d+1))}let f=!1,h=-1;if(r)for(let d=0;d<s.length;d++){let m=s[d];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(h=d),m.route.id){let{loaderData:y,errors:b}=r,w=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||w){f=!0,h>=0?s=s.slice(0,h+1):s=[s[0]];break}}}return s.reduceRight((d,m,y)=>{let b,w=!1,E=null,C=null;r&&(b=c&&m.route.id?c[m.route.id]:void 0,E=m.route.errorElement||MT,f&&(h<0&&y===0?(z0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):h===y&&(w=!0,C=m.route.hydrateFallbackElement||null)));let A=n.concat(s.slice(0,y+1)),T=()=>{let N;return b?N=E:w?N=C:m.route.Component?N=x.createElement(m.route.Component,null):m.route.element?N=m.route.element:N=d,x.createElement(DT,{match:m,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:N})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?x.createElement(jT,{location:r.location,revalidation:r.revalidation,component:E,error:b,children:T(),routeContext:{outlet:null,matches:A,isDataRoute:!0},unstable_onError:i}):T()},null)}function Ap(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function LT(e){let n=x.useContext(fl);return ft(n,Ap(e)),n}function zT(e){let n=x.useContext(dc);return ft(n,Ap(e)),n}function PT(e){let n=x.useContext(Pn);return ft(n,Ap(e)),n}function Tp(e){let n=PT(e),r=n.matches[n.matches.length-1];return ft(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function IT(){return Tp("useRouteId")}function UT(){let e=x.useContext(Cp),n=zT("useRouteError"),r=Tp("useRouteError");return e!==void 0?e:n.errors?.[r]}function BT(){let{router:e}=LT("useNavigate"),n=Tp("useNavigate"),r=x.useRef(!1);return O0(()=>{r.current=!0}),x.useCallback(async(o,s={})=>{zn(r.current,D0),r.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:n,...s}))},[e,n])}var zx={};function z0(e,n,r){!n&&!zx[e]&&(zx[e]=!0,zn(!1,r))}x.memo(HT);function HT({routes:e,future:n,state:r,unstable_onError:i}){return L0(e,void 0,r,i,n)}function P0({to:e,replace:n,state:r,relative:i}){ft(dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=x.useContext(Kn);zn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=x.useContext(Pn),{pathname:c}=on(),f=Go(),h=kp(e,Ep(s),c,i==="path"),d=JSON.stringify(h);return x.useEffect(()=>{f(JSON.parse(d),{replace:n,state:r,relative:i})},[f,d,i,n,r]),null}function Rp(e){return RT(e.context)}function we(e){ft(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function FT({basename:e="/",children:n=null,location:r,navigationType:i="POP",navigator:o,static:s=!1}){ft(!dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=x.useMemo(()=>({basename:c,navigator:o,static:s,future:{}}),[c,o,s]);typeof r=="string"&&(r=cl(r));let{pathname:h="/",search:d="",hash:m="",state:y=null,key:b="default"}=r,w=x.useMemo(()=>{let E=Pr(h,c);return E==null?null:{location:{pathname:E,search:d,hash:m,state:y,key:b},navigationType:i}},[c,h,d,m,y,b,i]);return zn(w!=null,`<Router basename="${c}"> is not able to match the URL "${h}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Kn.Provider,{value:f},x.createElement($o.Provider,{children:n,value:w}))}function qT({children:e,location:n}){return _T(Bh(e),n)}function Bh(e,n=[]){let r=[];return x.Children.forEach(e,(i,o)=>{if(!x.isValidElement(i))return;let s=[...n,o];if(i.type===x.Fragment){r.push.apply(r,Bh(i.props.children,s));return}ft(i.type===we,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ft(!i.props.index||!i.props.children,"An index route cannot have child routes.");let c={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=Bh(i.props.children,s)),r.push(c)}),r}var Pu="get",Iu="application/x-www-form-urlencoded";function hc(e){return e!=null&&typeof e.tagName=="string"}function VT(e){return hc(e)&&e.tagName.toLowerCase()==="button"}function $T(e){return hc(e)&&e.tagName.toLowerCase()==="form"}function GT(e){return hc(e)&&e.tagName.toLowerCase()==="input"}function YT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KT(e,n){return e.button===0&&(!n||n==="_self")&&!YT(e)}function Hh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,r)=>{let i=e[r];return n.concat(Array.isArray(i)?i.map(o=>[r,o]):[[r,i]])},[]))}function XT(e,n){let r=Hh(e);return n&&n.forEach((i,o)=>{r.has(o)||n.getAll(o).forEach(s=>{r.append(o,s)})}),r}var wu=null;function QT(){if(wu===null)try{new FormData(document.createElement("form"),0),wu=!1}catch{wu=!0}return wu}var ZT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rh(e){return e!=null&&!ZT.has(e)?(zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function WT(e,n){let r,i,o,s,c;if($T(e)){let f=e.getAttribute("action");i=f?Pr(f,n):null,r=e.getAttribute("method")||Pu,o=rh(e.getAttribute("enctype"))||Iu,s=new FormData(e)}else if(VT(e)||GT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(i=h?Pr(h,n):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Pu,o=rh(e.getAttribute("formenctype"))||rh(f.getAttribute("enctype"))||Iu,s=new FormData(f,e),!QT()){let{name:d,type:m,value:y}=e;if(m==="image"){let b=d?`${d}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else d&&s.append(d,y)}}else{if(hc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Pu,i=null,o=Iu,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:i,method:r.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _p(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function JT(e,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i.pathname==="/"?i.pathname=`_root.${r}`:n&&Pr(i.pathname,n)==="/"?i.pathname=`${n.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function eR(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tR(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function nR(e,n,r){let i=await Promise.all(e.map(async o=>{let s=n.routes[o.route.id];if(s){let c=await eR(s,r);return c.links?c.links():[]}return[]}));return lR(i.flat(1).filter(tR).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Px(e,n,r,i,o,s){let c=(h,d)=>r[d]?h.route.id!==r[d].route.id:!0,f=(h,d)=>r[d].pathname!==h.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==h.params["*"];return s==="assets"?n.filter((h,d)=>c(h,d)||f(h,d)):s==="data"?n.filter((h,d)=>{let m=i.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,d)||f(h,d))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function rR(e,n,{includeHydrateFallback:r}={}){return aR(e.map(i=>{let o=n.routes[i.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function aR(e){return[...new Set(e)]}function iR(e){let n={},r=Object.keys(e).sort();for(let i of r)n[i]=e[i];return n}function lR(e,n){let r=new Set;return new Set(n),e.reduce((i,o)=>{let s=JSON.stringify(iR(o));return r.has(s)||(r.add(s),i.push({key:s,link:o})),i},[])}function I0(){let e=x.useContext(fl);return _p(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oR(){let e=x.useContext(dc);return _p(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Np=x.createContext(void 0);Np.displayName="FrameworkContext";function U0(){let e=x.useContext(Np);return _p(e,"You must render this element inside a <HydratedRouter> element"),e}function sR(e,n){let r=x.useContext(Np),[i,o]=x.useState(!1),[s,c]=x.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:y}=n,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=T=>{T.forEach(N=>{c(N.isIntersecting)})},A=new IntersectionObserver(C,{threshold:.5});return b.current&&A.observe(b.current),()=>{A.disconnect()}}},[e]),x.useEffect(()=>{if(i){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[i]);let w=()=>{o(!0)},E=()=>{o(!1),c(!1)};return r?e!=="intent"?[s,b,{}]:[s,b,{onFocus:vo(f,w),onBlur:vo(h,E),onMouseEnter:vo(d,w),onMouseLeave:vo(m,E),onTouchStart:vo(y,w)}]:[!1,b,{}]}function vo(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function uR({page:e,...n}){let{router:r}=I0(),i=x.useMemo(()=>R0(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?x.createElement(fR,{page:e,matches:i,...n}):null}function cR(e){let{manifest:n,routeModules:r}=U0(),[i,o]=x.useState([]);return x.useEffect(()=>{let s=!1;return nR(e,n,r).then(c=>{s||o(c)}),()=>{s=!0}},[e,n,r]),i}function fR({page:e,matches:n,...r}){let i=on(),{manifest:o,routeModules:s}=U0(),{basename:c}=I0(),{loaderData:f,matches:h}=oR(),d=x.useMemo(()=>Px(e,n,h,o,i,"data"),[e,n,h,o,i]),m=x.useMemo(()=>Px(e,n,h,o,i,"assets"),[e,n,h,o,i]),y=x.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let E=new Set,C=!1;if(n.forEach(T=>{let N=o.routes[T.route.id];!N||!N.hasLoader||(!d.some(_=>_.route.id===T.route.id)&&T.route.id in f&&s[T.route.id]?.shouldRevalidate||N.hasClientLoader?C=!0:E.add(T.route.id))}),E.size===0)return[];let A=JT(e,c,"data");return C&&E.size>0&&A.searchParams.set("_routes",n.filter(T=>E.has(T.route.id)).map(T=>T.route.id).join(",")),[A.pathname+A.search]},[c,f,i,o,d,n,e,s]),b=x.useMemo(()=>rR(m,o),[m,o]),w=cR(m);return x.createElement(x.Fragment,null,y.map(E=>x.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),b.map(E=>x.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),w.map(({key:E,link:C})=>x.createElement("link",{key:E,nonce:r.nonce,...C})))}function dR(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var B0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{B0&&(window.__reactRouterVersion="7.8.2")}catch{}function hR({basename:e,children:n,window:r}){let i=x.useRef();i.current==null&&(i.current=WA({window:r,v5Compat:!0}));let o=i.current,[s,c]=x.useState({action:o.action,location:o.location}),f=x.useCallback(h=>{x.startTransition(()=>c(h))},[c]);return x.useLayoutEffect(()=>o.listen(f),[o,f]),x.createElement(FT,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:o})}var H0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vn=x.forwardRef(function({onClick:n,discover:r="render",prefetch:i="none",relative:o,reloadDocument:s,replace:c,state:f,target:h,to:d,preventScrollReset:m,viewTransition:y,...b},w){let{basename:E}=x.useContext(Kn),C=typeof d=="string"&&H0.test(d),A,T=!1;if(typeof d=="string"&&C&&(A=d,B0))try{let ee=new URL(window.location.href),P=d.startsWith("//")?new URL(ee.protocol+d):new URL(d),re=Pr(P.pathname,E);P.origin===ee.origin&&re!=null?d=re+P.search+P.hash:T=!0}catch{zn(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let N=CT(d,{relative:o}),[_,j,L]=sR(i,b),O=yR(d,{replace:c,state:f,target:h,preventScrollReset:m,relative:o,viewTransition:y});function $(ee){n&&n(ee),ee.defaultPrevented||O(ee)}let G=x.createElement("a",{...b,...L,href:A||N,onClick:T||s?n:$,ref:dR(w,j),target:h,"data-discover":!C&&r==="render"?"true":void 0});return _&&!C?x.createElement(x.Fragment,null,G,x.createElement(uR,{page:N})):G});Vn.displayName="Link";var pR=x.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:i="",end:o=!1,style:s,to:c,viewTransition:f,children:h,...d},m){let y=Yo(c,{relative:d.relative}),b=on(),w=x.useContext(dc),{navigator:E,basename:C}=x.useContext(Kn),A=w!=null&&SR(y)&&f===!0,T=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,N=b.pathname,_=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(N=N.toLowerCase(),_=_?_.toLowerCase():null,T=T.toLowerCase()),_&&C&&(_=Pr(_,C)||_);const j=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let L=N===T||!o&&N.startsWith(T)&&N.charAt(j)==="/",O=_!=null&&(_===T||!o&&_.startsWith(T)&&_.charAt(T.length)==="/"),$={isActive:L,isPending:O,isTransitioning:A},G=L?n:void 0,ee;typeof i=="function"?ee=i($):ee=[i,L?"active":null,O?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let P=typeof s=="function"?s($):s;return x.createElement(Vn,{...d,"aria-current":G,className:ee,ref:m,style:P,to:c,viewTransition:f},typeof h=="function"?h($):h)});pR.displayName="NavLink";var mR=x.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:i,replace:o,state:s,method:c=Pu,action:f,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:y,...b},w)=>{let E=bR(),C=wR(f,{relative:d}),A=c.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&H0.test(f),N=_=>{if(h&&h(_),_.defaultPrevented)return;_.preventDefault();let j=_.nativeEvent.submitter,L=j?.getAttribute("formmethod")||c;E(j||_.currentTarget,{fetcherKey:n,method:L,navigate:r,replace:o,state:s,relative:d,preventScrollReset:m,viewTransition:y})};return x.createElement("form",{ref:w,method:A,action:C,onSubmit:i?h:N,...b,"data-discover":!T&&e==="render"?"true":void 0})});mR.displayName="Form";function gR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function F0(e){let n=x.useContext(fl);return ft(n,gR(e)),n}function yR(e,{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:c}={}){let f=Go(),h=on(),d=Yo(e,{relative:s});return x.useCallback(m=>{if(KT(m,n)){m.preventDefault();let y=r!==void 0?r:jo(h)===jo(d);f(e,{replace:y,state:i,preventScrollReset:o,relative:s,viewTransition:c})}},[h,f,d,r,i,n,e,o,s,c])}function WU(e){zn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=x.useRef(Hh(e)),r=x.useRef(!1),i=on(),o=x.useMemo(()=>XT(i.search,r.current?null:n.current),[i.search]),s=Go(),c=x.useCallback((f,h)=>{const d=Hh(typeof f=="function"?f(new URLSearchParams(o)):f);r.current=!0,s("?"+d,h)},[s,o]);return[o,c]}var vR=0,xR=()=>`__${String(++vR)}__`;function bR(){let{router:e}=F0("useSubmit"),{basename:n}=x.useContext(Kn),r=IT();return x.useCallback(async(i,o={})=>{let{action:s,method:c,encType:f,formData:h,body:d}=WT(i,n);if(o.navigate===!1){let m=o.fetcherKey||xR();await e.fetch(m,r,o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,flushSync:o.flushSync})}else await e.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,n,r])}function wR(e,{relative:n}={}){let{basename:r}=x.useContext(Kn),i=x.useContext(Pn);ft(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),s={...Yo(e||".",{relative:n})},c=on();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search),h=f.getAll("index");if(h.some(m=>m==="")){f.delete("index"),h.filter(y=>y).forEach(y=>f.append("index",y));let m=f.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:zr([r,s.pathname])),jo(s)}function SR(e,{relative:n}={}){let r=x.useContext(j0);ft(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=F0("useViewTransitionState"),o=Yo(e,{relative:n});if(!r.isTransitioning)return!1;let s=Pr(r.currentLocation.pathname,i)||r.currentLocation.pathname,c=Pr(r.nextLocation.pathname,i)||r.nextLocation.pathname;return Xu(o.pathname,c)!=null||Xu(o.pathname,s)!=null}var pc=T0();const ER=fc(pc);var mc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gc=typeof window>"u"||"Deno"in globalThis;function qn(){}function kR(e,n){return typeof e=="function"?e(n):e}function CR(e){return typeof e=="number"&&e>=0&&e!==1/0}function AR(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Fh(e,n){return typeof e=="function"?e(n):e}function TR(e,n){return typeof e=="function"?e(n):e}function Ix(e,n){const{type:r="all",exact:i,fetchStatus:o,predicate:s,queryKey:c,stale:f}=e;if(c){if(i){if(n.queryHash!==Mp(c,n.options))return!1}else if(!Oo(n.queryKey,c))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof f=="boolean"&&n.isStale()!==f||o&&o!==n.state.fetchStatus||s&&!s(n))}function Ux(e,n){const{exact:r,status:i,predicate:o,mutationKey:s}=e;if(s){if(!n.options.mutationKey)return!1;if(r){if(Do(n.options.mutationKey)!==Do(s))return!1}else if(!Oo(n.options.mutationKey,s))return!1}return!(i&&n.state.status!==i||o&&!o(n))}function Mp(e,n){return(n?.queryKeyHashFn||Do)(e)}function Do(e){return JSON.stringify(e,(n,r)=>qh(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function Oo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>Oo(e[r],n[r])):!1}function q0(e,n){if(e===n)return e;const r=Bx(e)&&Bx(n);if(r||qh(e)&&qh(n)){const i=r?e:Object.keys(e),o=i.length,s=r?n:Object.keys(n),c=s.length,f=r?[]:{},h=new Set(i);let d=0;for(let m=0;m<c;m++){const y=r?m:s[m];(!r&&h.has(y)||r)&&e[y]===void 0&&n[y]===void 0?(f[y]=void 0,d++):(f[y]=q0(e[y],n[y]),f[y]===e[y]&&e[y]!==void 0&&d++)}return o===c&&d===o?e:f}return n}function Bx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qh(e){if(!Hx(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!Hx(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Hx(e){return Object.prototype.toString.call(e)==="[object Object]"}function RR(e){return new Promise(n=>{setTimeout(n,e)})}function _R(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?q0(e,n):n}function NR(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function MR(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}var jp=Symbol();function V0(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===jp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var jR=class extends mc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!gc&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},$0=new jR,DR=class extends mc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!gc&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},Qu=new DR;function OR(){let e,n;const r=new Promise((o,s)=>{e=o,n=s});r.status="pending",r.catch(()=>{});function i(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},r.reject=o=>{i({status:"rejected",reason:o}),n(o)},r}function LR(e){return Math.min(1e3*2**e,3e4)}function G0(e){return(e??"online")==="online"?Qu.isOnline():!0}var Y0=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function K0(e){let n=!1,r=0,i;const o=OR(),s=()=>o.status!=="pending",c=C=>{s()||(b(new Y0(C)),e.abort?.())},f=()=>{n=!0},h=()=>{n=!1},d=()=>$0.isFocused()&&(e.networkMode==="always"||Qu.isOnline())&&e.canRun(),m=()=>G0(e.networkMode)&&e.canRun(),y=C=>{s()||(i?.(),o.resolve(C))},b=C=>{s()||(i?.(),o.reject(C))},w=()=>new Promise(C=>{i=A=>{(s()||d())&&C(A)},e.onPause?.()}).then(()=>{i=void 0,s()||e.onContinue?.()}),E=()=>{if(s())return;let C;const A=r===0?e.initialPromise:void 0;try{C=A??e.fn()}catch(T){C=Promise.reject(T)}Promise.resolve(C).then(y).catch(T=>{if(s())return;const N=e.retry??(gc?0:3),_=e.retryDelay??LR,j=typeof _=="function"?_(r,T):_,L=N===!0||typeof N=="number"&&r<N||typeof N=="function"&&N(r,T);if(n||!L){b(T);return}r++,e.onFail?.(r,T),RR(j).then(()=>d()?void 0:w()).then(()=>{n?b(T):E()})})};return{promise:o,status:()=>o.status,cancel:c,continue:()=>(i?.(),o),cancelRetry:f,continueRetry:h,canStart:m,start:()=>(m()?E():w().then(E),o)}}var zR=e=>setTimeout(e,0);function PR(){let e=[],n=0,r=f=>{f()},i=f=>{f()},o=zR;const s=f=>{n?e.push(f):o(()=>{r(f)})},c=()=>{const f=e;e=[],f.length&&o(()=>{i(()=>{f.forEach(h=>{r(h)})})})};return{batch:f=>{let h;n++;try{h=f()}finally{n--,n||c()}return h},batchCalls:f=>(...h)=>{s(()=>{f(...h)})},schedule:s,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{o=f}}}var Zt=PR(),X0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),CR(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gc?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},IR=class extends X0{#e;#t;#n;#a;#r;#l;#o;constructor(e){super(),this.#o=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#n=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=BR(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#l,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const r=_R(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e,n){this.#i({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(qn).catch(qn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>TR(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Fh(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!AR(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},o=()=>{const f=V0(this.options,n),d=(()=>{const m={client:this.#a,queryKey:this.queryKey,meta:this.meta};return i(m),m})();return this.#o=!1,this.options.persister?this.options.persister(f,d,this):f(d)},c=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return i(f),f})();this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#i({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=K0({initialPromise:n?.initialPromise,fn:c.fetchFn,abort:r.abort.bind(r),onFail:(f,h)=>{this.#i({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof Y0){if(f.silent)return this.#r.promise;if(f.revert){if(this.setState({...this.#t,fetchStatus:"idle"}),this.state.data===void 0)throw f;return this.state.data}}throw this.#i({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...UR(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function UR(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G0(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BR(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var HR=class extends mc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const i=n.queryKey,o=n.queryHash??Mp(i,n);let s=this.get(o);return s||(s=new IR({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Zt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Ix(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Ix(e,r)):n}notify(e){Zt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},FR=class extends X0{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||qR(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(n=>n!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#a({type:"continue"})};this.#n=K0({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#a({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#a({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",i=!this.#n.canStart();try{if(r)n();else{this.#a({type:"pending",variables:e,isPaused:i}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#a({type:"pending",context:s,variables:e,isPaused:i})}const o=await this.#n.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this),await this.options.onSuccess?.(o,e,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,e,this.state.context),this.#a({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,e,this.state.context,this),await this.options.onError?.(o,e,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,e,this.state.context),o}finally{this.#a({type:"error",error:o})}}finally{this.#t.runNext(this)}}#a(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Zt.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function qR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var VR=class extends mc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const i=new FR({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){this.#e.add(e);const n=Su(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Su(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Su(e);if(typeof n=="string"){const i=this.#t.get(n)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const n=Su(e);return typeof n=="string"?this.#t.get(n)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Ux(n,r))}findAll(e={}){return this.getAll().filter(n=>Ux(e,n))}notify(e){Zt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Zt.batch(()=>Promise.all(e.map(n=>n.continue().catch(qn))))}};function Su(e){return e.options.scope?.id}function Fx(e){return{onFetch:(n,r)=>{const i=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,s=n.state.data?.pages||[],c=n.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const d=async()=>{let m=!1;const y=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(n.signal.aborted?m=!0:n.signal.addEventListener("abort",()=>{m=!0}),n.signal)})},b=V0(n.options,n.fetchOptions),w=async(E,C,A)=>{if(m)return Promise.reject();if(C==null&&E.pages.length)return Promise.resolve(E);const N=(()=>{const O={client:n.client,queryKey:n.queryKey,pageParam:C,direction:A?"backward":"forward",meta:n.options.meta};return y(O),O})(),_=await b(N),{maxPages:j}=n.options,L=A?MR:NR;return{pages:L(E.pages,_,j),pageParams:L(E.pageParams,C,j)}};if(o&&s.length){const E=o==="backward",C=E?$R:qx,A={pages:s,pageParams:c},T=C(i,A);f=await w(A,T,E)}else{const E=e??s.length;do{const C=h===0?c[0]??i.initialPageParam:qx(i,f);if(h>0&&C==null)break;f=await w(f,C),h++}while(h<E)}return f};n.options.persister?n.fetchFn=()=>n.options.persister?.(d,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=d}}}function qx(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function $R(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var GR=class{#e;#t;#n;#a;#r;#l;#o;#i;constructor(e={}){this.#e=e.queryCache||new HR,this.#t=e.mutationCache||new VR,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=$0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Qu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Fh(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(i.queryHash)?.state.data,c=kR(n,s);if(c!==void 0)return this.#e.build(this,i).setData(c,{...r,manual:!0})}setQueriesData(e,n,r){return Zt.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Zt.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return Zt.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},i=Zt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(qn).catch(qn)}invalidateQueries(e,n={}){return Zt.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=Zt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(qn)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(i).then(qn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(Fh(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qn).catch(qn)}fetchInfiniteQuery(e){return e.behavior=Fx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qn).catch(qn)}ensureInfiniteQueryData(e){return e.behavior=Fx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#a.set(Do(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#a.values()],r={};return n.forEach(i=>{Oo(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){this.#r.set(Do(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],r={};return n.forEach(i=>{Oo(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Mp(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===jp&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},YR=x.createContext(void 0),KR=({client:e,children:n})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(YR.Provider,{value:e,children:n}));const XR={theme:"system",setTheme:()=>null},Q0=x.createContext(XR);function JU(){const e=x.useContext(Q0);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function QR({children:e,defaultTheme:n="system",storageKey:r="ui-theme",...i}){const[o,s]=x.useState(n);x.useEffect(()=>{const f=localStorage?.getItem(r);f&&s(f)},[r]),x.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark","coconut"),o==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(h);return}f.classList.add(o)},[o]);const c={theme:o,setTheme:f=>{localStorage?.setItem(r,f),s(f)}};return g.jsx(Q0.Provider,{...i,value:c,children:e})}const Et="",eB="https://app.coconut.dev";async function Hi(e,n={}){const r=`${Et}${e}`,i={headers:{"Content-Type":"application/json",...n.headers},...n},o=await fetch(r,i);if(!o.ok)throw new Error(`API request failed: ${o.status} ${o.statusText}`);return o.json()}const tB=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,ZR="coconut.pkce_verifier",Vx="coconut.oauth_return_to",Z0=e=>{let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function WR(e=64){const n=new Uint8Array(e);return crypto.getRandomValues(n),Z0(n).slice(0,e)}async function JR(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n);return Z0(new Uint8Array(r))}async function e_(e){const{clientId:n,issuer:r,returnTo:i,scope:o="email profile offline_access"}=e,s=WR(),c=await JR(s);try{sessionStorage.setItem(ZR,s),i?sessionStorage.setItem(Vx,i):sessionStorage.removeItem(Vx)}catch{}const f=`${window.location.origin}/auth/callback`,h=new URLSearchParams({response_type:"code",client_id:n,redirect_uri:f,scope:o,code_challenge:c,code_challenge_method:"S256"});window.location.href=`${r.replace(/\/$/,"")}/oauth/authorize?${h.toString()}`}async function nB(e){const{issuer:n,clientId:r,code:i,verifier:o}=e,s=`${window.location.origin}/auth/callback`,c=await fetch(`${n.replace(/\/$/,"")}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:i,redirect_uri:s,client_id:r,code_verifier:o}).toString()});if(!c.ok){const f=await c.text().catch(()=>"");throw new Error(`Clerk token exchange failed (${c.status}): ${f||"no body"}`)}return await c.json()}const W0=x.createContext(void 0),Eu={enabled:!1};function t_({children:e}){const[n,r]=x.useState({user:null,isAuthenticated:!1,isLoading:!0,authEnabled:!1,localAuthEnabled:!0,allowRegistration:!0,oauth:Eu}),i=x.useCallback(async()=>{try{const d=await Hi("/api/v1/auth/status");if(!d.success){r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!1,localAuthEnabled:!0,allowRegistration:!0,oauth:Eu});return}const m=d.data?.enabled||!1,y=d.data?.oauth?.enabled?{enabled:!0,clientId:d.data.oauth.clientId,issuer:d.data.oauth.issuer,jwksUrl:d.data.oauth.jwksUrl}:Eu,b=d.data?.config?.providers?.local??!0,w=d.data?.config?.allowRegistration??!0;if(!m){r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!1,localAuthEnabled:b,allowRegistration:w,oauth:y});return}try{const E=await Hi("/api/v1/auth/me");E.success&&E.data?.user?r({user:E.data.user,isAuthenticated:!0,isLoading:!1,authEnabled:!0,localAuthEnabled:b,allowRegistration:w,oauth:y}):r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!0,localAuthEnabled:b,allowRegistration:w,oauth:y})}catch{r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!0,localAuthEnabled:b,allowRegistration:w,oauth:y})}}catch(d){console.error("Failed to check auth status:",d),r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!1,localAuthEnabled:!0,allowRegistration:!0,oauth:Eu})}},[]);x.useEffect(()=>{i()},[i]);const o=x.useCallback(async(d,m)=>{const y=await Hi("/api/v1/auth/login",{method:"POST",body:JSON.stringify({email:d,password:m})});if(!y.success)throw new Error(y.error||"Login failed");r(b=>({...b,user:y.data.user,isAuthenticated:!0,isLoading:!1,authEnabled:!0}))},[]),s=x.useCallback(async(d,m,y)=>{const b=await Hi("/api/v1/auth/register",{method:"POST",body:JSON.stringify({email:d,password:m,name:y})});if(!b.success)throw new Error(b.error||"Registration failed");r(w=>({...w,user:b.data.user,isAuthenticated:!0,isLoading:!1,authEnabled:!0}))},[]),c=x.useCallback(async()=>{await Hi("/api/v1/auth/logout",{method:"POST"}),r(d=>({...d,user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!0}))},[]),f=x.useCallback(async d=>{const m=n.oauth;if(!m.enabled||!m.clientId||!m.issuer)throw new Error("OAuth is not enabled on this coconut");await e_({clientId:m.clientId,issuer:m.issuer,returnTo:d})},[n.oauth]),h=x.useCallback(async()=>{try{const d=await Hi("/api/v1/auth/me");d.success&&d.data?.user&&r(m=>({...m,user:d.data.user,isAuthenticated:!0}))}catch(d){console.error("Failed to refresh user:",d)}},[]);return g.jsx(W0.Provider,{value:{...n,login:o,register:s,logout:c,refreshUser:h,checkAuthStatus:i,loginWithCoconut:f},children:e})}function J0(){const e=x.useContext(W0);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const e1=x.createContext(null);function n_(){const e=x.useContext(e1);if(!e)throw new Error("useSidebarBadges must be used within SidebarBadgeProvider");return e}function r_({children:e,pollInterval:n=1e4}){const[r,i]=x.useState({codeSessions:0,gitChanges:0,terminalSessions:0,runningScheduledJobs:0}),[o,s]=x.useState(!0),c=x.useCallback(async()=>{try{const[h,d,m]=await Promise.allSettled([fetch(`${Et}/api/v1/terminal/sessions`).then(b=>b.json()),fetch(`${Et}/api/v1/git/status`).then(b=>b.json()),fetch(`${Et}/api/v1/jobs`).then(b=>b.json())]),y={codeSessions:0,gitChanges:0,terminalSessions:0,runningScheduledJobs:0};if(h.status==="fulfilled"&&h.value?.sessions){const b=h.value.sessions;y.codeSessions=b.filter(w=>w.taskId?.startsWith("cp-")||w.taskId?.startsWith("sk-")).length,y.terminalSessions=b.filter(w=>!w.taskId?.startsWith("cp-")&&!w.taskId?.startsWith("sk-")).length}if(d.status==="fulfilled"&&d.value?.success&&d.value?.data?.changes&&(y.gitChanges=d.value.data.changes.length),m.status==="fulfilled"&&m.value?.success&&m.value?.data){const b=Array.isArray(m.value.data)?m.value.data:[],w=b.filter(E=>{if(!E.runs||!Array.isArray(E.runs)||E.runs.length===0)return!1;const C=E.runs[0],A=C&&C.status==="running";return A&&console.log("[SidebarBadge] Running job detected:",{name:E.name,status:C.status,startedAt:C.startedAt,finishedAt:C.finishedAt}),A});y.runningScheduledJobs=w.length,(w.length>0||b.length>0)&&console.log("[SidebarBadge] Jobs summary:",{total:b.length,running:w.length,runningJobNames:w.map(E=>E.name)})}i(y)}catch(h){console.error("Failed to fetch sidebar badges:",h)}finally{s(!1)}},[]);x.useEffect(()=>{c()},[c]),x.useEffect(()=>{const h=setInterval(c,n);return()=>clearInterval(h)},[c,n]),x.useEffect(()=>{const h=()=>{console.log("[SidebarBadge] Tab focused, refreshing badges..."),c()};return window.addEventListener("focus",h),()=>window.removeEventListener("focus",h)},[c]);const f={badges:r,loading:o,refresh:c};return g.jsx(e1.Provider,{value:f,children:e})}function a_({children:e}){const[n]=x.useState(()=>new GR({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}}));return g.jsx(KR,{client:n,children:g.jsx(QR,{defaultTheme:"system",storageKey:"coconut-ui-theme",children:g.jsx(t_,{children:g.jsx(r_,{children:e})})})})}const i_=1,l_=1e6;let ah=0;function o_(){return ah=(ah+1)%Number.MAX_SAFE_INTEGER,ah.toString()}const ih=new Map,$x=e=>{if(ih.has(e))return;const n=setTimeout(()=>{ih.delete(e),To({type:"REMOVE_TOAST",toastId:e})},l_);ih.set(e,n)},s_=(e,n)=>{switch(n.type){case"ADD_TOAST":return{...e,toasts:[n.toast,...e.toasts].slice(0,i_)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===n.toast.id?{...r,...n.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=n;return r?$x(r):e.toasts.forEach(i=>{$x(i.id)}),{...e,toasts:e.toasts.map(i=>i.id===r||r===void 0?{...i,open:!1}:i)}}case"REMOVE_TOAST":return n.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==n.toastId)}}},Uu=[];let Bu={toasts:[]};function To(e){Bu=s_(Bu,e),Uu.forEach(n=>{n(Bu)})}function Vh({...e}){const n=o_(),r=o=>To({type:"UPDATE_TOAST",toast:{...o,id:n}}),i=()=>To({type:"DISMISS_TOAST",toastId:n});return To({type:"ADD_TOAST",toast:{...e,id:n,open:!0,onOpenChange:o=>{o||i()}}}),{id:n,dismiss:i,update:r}}function u_(){const[e,n]=x.useState(Bu);return x.useEffect(()=>(Uu.push(n),()=>{const r=Uu.indexOf(n);r>-1&&Uu.splice(r,1)}),[e]),{...e,toast:Vh,dismiss:r=>To({type:"DISMISS_TOAST",toastId:r})}}function me(e,n,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return n?.(o)}}function Gx(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function yc(...e){return n=>{let r=!1;const i=e.map(o=>{const s=Gx(o,n);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<i.length;o++){const s=i[o];typeof s=="function"?s():Gx(e[o],null)}}}}function Qe(...e){return x.useCallback(yc(...e),e)}function c_(e,n){const r=x.createContext(n),i=s=>{const{children:c,...f}=s,h=x.useMemo(()=>f,Object.values(f));return g.jsx(r.Provider,{value:h,children:c})};i.displayName=e+"Provider";function o(s){const c=x.useContext(r);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[i,o]}function Xn(e,n=[]){let r=[];function i(s,c){const f=x.createContext(c),h=r.length;r=[...r,c];const d=y=>{const{scope:b,children:w,...E}=y,C=b?.[e]?.[h]||f,A=x.useMemo(()=>E,Object.values(E));return g.jsx(C.Provider,{value:A,children:w})};d.displayName=s+"Provider";function m(y,b){const w=b?.[e]?.[h]||f,E=x.useContext(w);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${s}\``)}return[d,m]}const o=()=>{const s=r.map(c=>x.createContext(c));return function(f){const h=f?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return o.scopeName=e,[i,f_(o,...n)]}function f_(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=i.reduce((f,{useScope:h,scopeName:d})=>{const y=h(s)[`__scope${d}`];return{...f,...y}},{});return x.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return r.scopeName=n.scopeName,r}function nl(e){const n=d_(e),r=x.forwardRef((i,o)=>{const{children:s,...c}=i,f=x.Children.toArray(s),h=f.find(h_);if(h){const d=h.props.children,m=f.map(y=>y===h?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:y);return g.jsx(n,{...c,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,m):null})}return g.jsx(n,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var hl=nl("Slot");function d_(e){const n=x.forwardRef((r,i)=>{const{children:o,...s}=r;if(x.isValidElement(o)){const c=m_(o),f=p_(s,o.props);return o.type!==x.Fragment&&(f.ref=i?yc(i,c):c),x.cloneElement(o,f)}return x.Children.count(o)>1?x.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var t1=Symbol("radix.slottable");function n1(e){const n=({children:r})=>g.jsx(g.Fragment,{children:r});return n.displayName=`${e}.Slottable`,n.__radixId=t1,n}function h_(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t1}function p_(e,n){const r={...n};for(const i in n){const o=e[i],s=n[i];/^on[A-Z]/.test(i)?o&&s?r[i]=(...f)=>{const h=s(...f);return o(...f),h}:o&&(r[i]=o):i==="style"?r[i]={...o,...s}:i==="className"&&(r[i]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function m_(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Dp(e){const n=e+"CollectionProvider",[r,i]=Xn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:A,children:T}=C,N=ha.useRef(null),_=ha.useRef(new Map).current;return g.jsx(o,{scope:A,itemMap:_,collectionRef:N,children:T})};c.displayName=n;const f=e+"CollectionSlot",h=nl(f),d=ha.forwardRef((C,A)=>{const{scope:T,children:N}=C,_=s(f,T),j=Qe(A,_.collectionRef);return g.jsx(h,{ref:j,children:N})});d.displayName=f;const m=e+"CollectionItemSlot",y="data-radix-collection-item",b=nl(m),w=ha.forwardRef((C,A)=>{const{scope:T,children:N,..._}=C,j=ha.useRef(null),L=Qe(A,j),O=s(m,T);return ha.useEffect(()=>(O.itemMap.set(j,{ref:j,..._}),()=>void O.itemMap.delete(j))),g.jsx(b,{[y]:"",ref:L,children:N})});w.displayName=m;function E(C){const A=s(e+"CollectionConsumer",C);return ha.useCallback(()=>{const N=A.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${y}]`));return Array.from(A.itemMap.values()).sort((O,$)=>_.indexOf(O.ref.current)-_.indexOf($.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:c,Slot:d,ItemSlot:w},E,i]}var g_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fe=g_.reduce((e,n)=>{const r=nl(`Primitive.${n}`),i=x.forwardRef((o,s)=>{const{asChild:c,...f}=o,h=c?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...f,ref:s})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Op(e,n){e&&pc.flushSync(()=>e.dispatchEvent(n))}function kt(e){const n=x.useRef(e);return x.useEffect(()=>{n.current=e}),x.useMemo(()=>(...r)=>n.current?.(...r),[])}function y_(e,n=globalThis?.document){const r=kt(e);x.useEffect(()=>{const i=o=>{o.key==="Escape"&&r(o)};return n.addEventListener("keydown",i,{capture:!0}),()=>n.removeEventListener("keydown",i,{capture:!0})},[r,n])}var v_="DismissableLayer",$h="dismissableLayer.update",x_="dismissableLayer.pointerDownOutside",b_="dismissableLayer.focusOutside",Yx,r1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ko=x.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:f,...h}=e,d=x.useContext(r1),[m,y]=x.useState(null),b=m?.ownerDocument??globalThis?.document,[,w]=x.useState({}),E=Qe(n,$=>y($)),C=Array.from(d.layers),[A]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=C.indexOf(A),N=m?C.indexOf(m):-1,_=d.layersWithOutsidePointerEventsDisabled.size>0,j=N>=T,L=S_($=>{const G=$.target,ee=[...d.branches].some(P=>P.contains(G));!j||ee||(o?.($),c?.($),$.defaultPrevented||f?.())},b),O=E_($=>{const G=$.target;[...d.branches].some(P=>P.contains(G))||(s?.($),c?.($),$.defaultPrevented||f?.())},b);return y_($=>{N===d.layers.size-1&&(i?.($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),x.useEffect(()=>{if(m)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yx=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),Kx(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Yx)}},[m,b,r,d]),x.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),Kx())},[m,d]),x.useEffect(()=>{const $=()=>w({});return document.addEventListener($h,$),()=>document.removeEventListener($h,$)},[]),g.jsx(Fe.div,{...h,ref:E,style:{pointerEvents:_?j?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,O.onFocusCapture),onBlurCapture:me(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,L.onPointerDownCapture)})});Ko.displayName=v_;var w_="DismissableLayerBranch",a1=x.forwardRef((e,n)=>{const r=x.useContext(r1),i=x.useRef(null),o=Qe(n,i);return x.useEffect(()=>{const s=i.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),g.jsx(Fe.div,{...e,ref:o})});a1.displayName=w_;function S_(e,n=globalThis?.document){const r=kt(e),i=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const s=f=>{if(f.target&&!i.current){let h=function(){i1(x_,r,d,{discrete:!0})};const d={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",o.current),o.current=h,n.addEventListener("click",o.current,{once:!0})):h()}else n.removeEventListener("click",o.current);i.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",s),n.removeEventListener("click",o.current)}},[n,r]),{onPointerDownCapture:()=>i.current=!0}}function E_(e,n=globalThis?.document){const r=kt(e),i=x.useRef(!1);return x.useEffect(()=>{const o=s=>{s.target&&!i.current&&i1(b_,r,{originalEvent:s},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Kx(){const e=new CustomEvent($h);document.dispatchEvent(e)}function i1(e,n,r,{discrete:i}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),i?Op(o,s):o.dispatchEvent(s)}var k_=Ko,C_=a1,cr=globalThis?.document?x.useLayoutEffect:()=>{},A_="Portal",Xo=x.forwardRef((e,n)=>{const{container:r,...i}=e,[o,s]=x.useState(!1);cr(()=>s(!0),[]);const c=r||o&&globalThis?.document?.body;return c?ER.createPortal(g.jsx(Fe.div,{...i,ref:n}),c):null});Xo.displayName=A_;function T_(e,n){return x.useReducer((r,i)=>n[r][i]??r,e)}var qt=e=>{const{present:n,children:r}=e,i=R_(n),o=typeof r=="function"?r({present:i.isPresent}):x.Children.only(r),s=Qe(i.ref,__(o));return typeof r=="function"||i.isPresent?x.cloneElement(o,{ref:s}):null};qt.displayName="Presence";function R_(e){const[n,r]=x.useState(),i=x.useRef(null),o=x.useRef(e),s=x.useRef("none"),c=e?"mounted":"unmounted",[f,h]=T_(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ku(i.current);s.current=f==="mounted"?d:"none"},[f]),cr(()=>{const d=i.current,m=o.current;if(m!==e){const b=s.current,w=ku(d);e?h("MOUNT"):w==="none"||d?.display==="none"?h("UNMOUNT"):h(m&&b!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),cr(()=>{if(n){let d;const m=n.ownerDocument.defaultView??window,y=w=>{const C=ku(i.current).includes(CSS.escape(w.animationName));if(w.target===n&&C&&(h("ANIMATION_END"),!o.current)){const A=n.style.animationFillMode;n.style.animationFillMode="forwards",d=m.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=A)})}},b=w=>{w.target===n&&(s.current=ku(i.current))};return n.addEventListener("animationstart",b),n.addEventListener("animationcancel",y),n.addEventListener("animationend",y),()=>{m.clearTimeout(d),n.removeEventListener("animationstart",b),n.removeEventListener("animationcancel",y),n.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[n,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(d=>{i.current=d?getComputedStyle(d):null,r(d)},[])}}function ku(e){return e?.animationName||"none"}function __(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var N_=A0[" useInsertionEffect ".trim().toString()]||cr;function pl({prop:e,defaultProp:n,onChange:r=()=>{},caller:i}){const[o,s,c]=M_({defaultProp:n,onChange:r}),f=e!==void 0,h=f?e:o;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const y=m.current;y!==f&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=f},[f,i])}const d=x.useCallback(m=>{if(f){const y=j_(m)?m(e):m;y!==e&&c.current?.(y)}else s(m)},[f,e,s,c]);return[h,d]}function M_({defaultProp:e,onChange:n}){const[r,i]=x.useState(e),o=x.useRef(r),s=x.useRef(n);return N_(()=>{s.current=n},[n]),x.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,i,s]}function j_(e){return typeof e=="function"}var D_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),O_="VisuallyHidden",vc=x.forwardRef((e,n)=>g.jsx(Fe.span,{...e,ref:n,style:{...D_,...e.style}}));vc.displayName=O_;var L_=vc,Lp="ToastProvider",[zp,z_,P_]=Dp("Toast"),[l1,rB]=Xn("Toast",[P_]),[I_,xc]=l1(Lp),o1=e=>{const{__scopeToast:n,label:r="Notification",duration:i=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:c}=e,[f,h]=x.useState(null),[d,m]=x.useState(0),y=x.useRef(!1),b=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Lp}\`. Expected non-empty \`string\`.`),g.jsx(zp.Provider,{scope:n,children:g.jsx(I_,{scope:n,label:r,duration:i,swipeDirection:o,swipeThreshold:s,toastCount:d,viewport:f,onViewportChange:h,onToastAdd:x.useCallback(()=>m(w=>w+1),[]),onToastRemove:x.useCallback(()=>m(w=>w-1),[]),isFocusedToastEscapeKeyDownRef:y,isClosePausedRef:b,children:c})})};o1.displayName=Lp;var s1="ToastViewport",U_=["F8"],Gh="toast.viewportPause",Yh="toast.viewportResume",u1=x.forwardRef((e,n)=>{const{__scopeToast:r,hotkey:i=U_,label:o="Notifications ({hotkey})",...s}=e,c=xc(s1,r),f=z_(r),h=x.useRef(null),d=x.useRef(null),m=x.useRef(null),y=x.useRef(null),b=Qe(n,y,c.onViewportChange),w=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=c.toastCount>0;x.useEffect(()=>{const A=T=>{i.length!==0&&i.every(_=>T[_]||T.code===_)&&y.current?.focus()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[i]),x.useEffect(()=>{const A=h.current,T=y.current;if(E&&A&&T){const N=()=>{if(!c.isClosePausedRef.current){const O=new CustomEvent(Gh);T.dispatchEvent(O),c.isClosePausedRef.current=!0}},_=()=>{if(c.isClosePausedRef.current){const O=new CustomEvent(Yh);T.dispatchEvent(O),c.isClosePausedRef.current=!1}},j=O=>{!A.contains(O.relatedTarget)&&_()},L=()=>{A.contains(document.activeElement)||_()};return A.addEventListener("focusin",N),A.addEventListener("focusout",j),A.addEventListener("pointermove",N),A.addEventListener("pointerleave",L),window.addEventListener("blur",N),window.addEventListener("focus",_),()=>{A.removeEventListener("focusin",N),A.removeEventListener("focusout",j),A.removeEventListener("pointermove",N),A.removeEventListener("pointerleave",L),window.removeEventListener("blur",N),window.removeEventListener("focus",_)}}},[E,c.isClosePausedRef]);const C=x.useCallback(({tabbingDirection:A})=>{const N=f().map(_=>{const j=_.ref.current,L=[j,...W_(j)];return A==="forwards"?L:L.reverse()});return(A==="forwards"?N.reverse():N).flat()},[f]);return x.useEffect(()=>{const A=y.current;if(A){const T=N=>{const _=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!_){const L=document.activeElement,O=N.shiftKey;if(N.target===A&&O){d.current?.focus();return}const ee=C({tabbingDirection:O?"backwards":"forwards"}),P=ee.findIndex(re=>re===L);lh(ee.slice(P+1))?N.preventDefault():O?d.current?.focus():m.current?.focus()}};return A.addEventListener("keydown",T),()=>A.removeEventListener("keydown",T)}},[f,C]),g.jsxs(C_,{ref:h,role:"region","aria-label":o.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(Kh,{ref:d,onFocusFromOutsideViewport:()=>{const A=C({tabbingDirection:"forwards"});lh(A)}}),g.jsx(zp.Slot,{scope:r,children:g.jsx(Fe.ol,{tabIndex:-1,...s,ref:b})}),E&&g.jsx(Kh,{ref:m,onFocusFromOutsideViewport:()=>{const A=C({tabbingDirection:"backwards"});lh(A)}})]})});u1.displayName=s1;var c1="ToastFocusProxy",Kh=x.forwardRef((e,n)=>{const{__scopeToast:r,onFocusFromOutsideViewport:i,...o}=e,s=xc(c1,r);return g.jsx(vc,{tabIndex:0,...o,ref:n,style:{position:"fixed"},onFocus:c=>{const f=c.relatedTarget;!s.viewport?.contains(f)&&i()}})});Kh.displayName=c1;var Qo="Toast",B_="toast.swipeStart",H_="toast.swipeMove",F_="toast.swipeCancel",q_="toast.swipeEnd",f1=x.forwardRef((e,n)=>{const{forceMount:r,open:i,defaultOpen:o,onOpenChange:s,...c}=e,[f,h]=pl({prop:i,defaultProp:o??!0,onChange:s,caller:Qo});return g.jsx(qt,{present:r||f,children:g.jsx(G_,{open:f,...c,ref:n,onClose:()=>h(!1),onPause:kt(e.onPause),onResume:kt(e.onResume),onSwipeStart:me(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,d=>{const{x:m,y}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${y}px`)}),onSwipeCancel:me(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,d=>{const{x:m,y}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${y}px`),h(!1)})})})});f1.displayName=Qo;var[V_,$_]=l1(Qo,{onClose(){}}),G_=x.forwardRef((e,n)=>{const{__scopeToast:r,type:i="foreground",duration:o,open:s,onClose:c,onEscapeKeyDown:f,onPause:h,onResume:d,onSwipeStart:m,onSwipeMove:y,onSwipeCancel:b,onSwipeEnd:w,...E}=e,C=xc(Qo,r),[A,T]=x.useState(null),N=Qe(n,q=>T(q)),_=x.useRef(null),j=x.useRef(null),L=o||C.duration,O=x.useRef(0),$=x.useRef(L),G=x.useRef(0),{onToastAdd:ee,onToastRemove:P}=C,re=kt(()=>{A?.contains(document.activeElement)&&C.viewport?.focus(),c()}),Q=x.useCallback(q=>{!q||q===1/0||(window.clearTimeout(G.current),O.current=new Date().getTime(),G.current=window.setTimeout(re,q))},[re]);x.useEffect(()=>{const q=C.viewport;if(q){const le=()=>{Q($.current),d?.()},z=()=>{const K=new Date().getTime()-O.current;$.current=$.current-K,window.clearTimeout(G.current),h?.()};return q.addEventListener(Gh,z),q.addEventListener(Yh,le),()=>{q.removeEventListener(Gh,z),q.removeEventListener(Yh,le)}}},[C.viewport,L,h,d,Q]),x.useEffect(()=>{s&&!C.isClosePausedRef.current&&Q(L)},[s,L,C.isClosePausedRef,Q]),x.useEffect(()=>(ee(),()=>P()),[ee,P]);const W=x.useMemo(()=>A?v1(A):null,[A]);return C.viewport?g.jsxs(g.Fragment,{children:[W&&g.jsx(Y_,{__scopeToast:r,role:"status","aria-live":i==="foreground"?"assertive":"polite",children:W}),g.jsx(V_,{scope:r,onClose:re,children:pc.createPortal(g.jsx(zp.ItemSlot,{scope:r,children:g.jsx(k_,{asChild:!0,onEscapeKeyDown:me(f,()=>{C.isFocusedToastEscapeKeyDownRef.current||re(),C.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(Fe.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":C.swipeDirection,...E,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,q=>{q.key==="Escape"&&(f?.(q.nativeEvent),q.nativeEvent.defaultPrevented||(C.isFocusedToastEscapeKeyDownRef.current=!0,re()))}),onPointerDown:me(e.onPointerDown,q=>{q.button===0&&(_.current={x:q.clientX,y:q.clientY})}),onPointerMove:me(e.onPointerMove,q=>{if(!_.current)return;const le=q.clientX-_.current.x,z=q.clientY-_.current.y,K=!!j.current,B=["left","right"].includes(C.swipeDirection),ae=["left","up"].includes(C.swipeDirection)?Math.min:Math.max,k=B?ae(0,le):0,X=B?0:ae(0,z),oe=q.pointerType==="touch"?10:2,M={x:k,y:X},fe={originalEvent:q,delta:M};K?(j.current=M,Cu(H_,y,fe,{discrete:!1})):Xx(M,C.swipeDirection,oe)?(j.current=M,Cu(B_,m,fe,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(le)>oe||Math.abs(z)>oe)&&(_.current=null)}),onPointerUp:me(e.onPointerUp,q=>{const le=j.current,z=q.target;if(z.hasPointerCapture(q.pointerId)&&z.releasePointerCapture(q.pointerId),j.current=null,_.current=null,le){const K=q.currentTarget,B={originalEvent:q,delta:le};Xx(le,C.swipeDirection,C.swipeThreshold)?Cu(q_,w,B,{discrete:!0}):Cu(F_,b,B,{discrete:!0}),K.addEventListener("click",ae=>ae.preventDefault(),{once:!0})}})})})}),C.viewport)})]}):null}),Y_=e=>{const{__scopeToast:n,children:r,...i}=e,o=xc(Qo,n),[s,c]=x.useState(!1),[f,h]=x.useState(!1);return Q_(()=>c(!0)),x.useEffect(()=>{const d=window.setTimeout(()=>h(!0),1e3);return()=>window.clearTimeout(d)},[]),f?null:g.jsx(Xo,{asChild:!0,children:g.jsx(vc,{...i,children:s&&g.jsxs(g.Fragment,{children:[o.label," ",r]})})})},K_="ToastTitle",d1=x.forwardRef((e,n)=>{const{__scopeToast:r,...i}=e;return g.jsx(Fe.div,{...i,ref:n})});d1.displayName=K_;var X_="ToastDescription",h1=x.forwardRef((e,n)=>{const{__scopeToast:r,...i}=e;return g.jsx(Fe.div,{...i,ref:n})});h1.displayName=X_;var p1="ToastAction",m1=x.forwardRef((e,n)=>{const{altText:r,...i}=e;return r.trim()?g.jsx(y1,{altText:r,asChild:!0,children:g.jsx(Pp,{...i,ref:n})}):(console.error(`Invalid prop \`altText\` supplied to \`${p1}\`. Expected non-empty \`string\`.`),null)});m1.displayName=p1;var g1="ToastClose",Pp=x.forwardRef((e,n)=>{const{__scopeToast:r,...i}=e,o=$_(g1,r);return g.jsx(y1,{asChild:!0,children:g.jsx(Fe.button,{type:"button",...i,ref:n,onClick:me(e.onClick,o.onClose)})})});Pp.displayName=g1;var y1=x.forwardRef((e,n)=>{const{__scopeToast:r,altText:i,...o}=e;return g.jsx(Fe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...o,ref:n})});function v1(e){const n=[];return Array.from(e.childNodes).forEach(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent&&n.push(i.textContent),Z_(i)){const o=i.ariaHidden||i.hidden||i.style.display==="none",s=i.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const c=i.dataset.radixToastAnnounceAlt;c&&n.push(c)}else n.push(...v1(i))}}),n}function Cu(e,n,r,{discrete:i}){const o=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),i?Op(o,s):o.dispatchEvent(s)}var Xx=(e,n,r=0)=>{const i=Math.abs(e.x),o=Math.abs(e.y),s=i>o;return n==="left"||n==="right"?s&&i>r:!s&&o>r};function Q_(e=()=>{}){const n=kt(e);cr(()=>{let r=0,i=0;return r=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(n)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(i)}},[n])}function Z_(e){return e.nodeType===e.ELEMENT_NODE}function W_(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function lh(e){const n=document.activeElement;return e.some(r=>r===n?!0:(r.focus(),document.activeElement!==n))}var J_=o1,x1=u1,b1=f1,w1=d1,S1=h1,E1=m1,k1=Pp;function C1(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(r=C1(e[n]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function A1(){for(var e,n,r=0,i="",o=arguments.length;r<o;r++)(e=arguments[r])&&(n=C1(e))&&(i&&(i+=" "),i+=n);return i}const Qx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zx=A1,bc=(e,n)=>r=>{var i;if(n?.variants==null)return Zx(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=n,c=Object.keys(o).map(d=>{const m=r?.[d],y=s?.[d];if(m===null)return null;const b=Qx(m)||Qx(y);return o[d][b]}),f=r&&Object.entries(r).reduce((d,m)=>{let[y,b]=m;return b===void 0||(d[y]=b),d},{}),h=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:y,className:b,...w}=m;return Object.entries(w).every(E=>{let[C,A]=E;return Array.isArray(A)?A.includes({...s,...f}[C]):{...s,...f}[C]===A})?[...d,y,b]:d},[]);return Zx(e,c,h,r?.class,r?.className)};/**
61
+ Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let b=on(),w;if(n){let N=typeof n=="string"?cl(n):n;ft(m==="/"||N.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${N.pathname}" was given in the \`location\` prop.`),w=N}else w=b;let E=w.pathname||"/",C=E;if(m!=="/"){let N=m.replace(/^\//,"").split("/");C="/"+E.replace(/^\//,"").split("/").slice(N.length).join("/")}let A=R0(e,{pathname:C});zn(y||A!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),zn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=OT(A&&A.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:zr([m,s.encodeLocation?s.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:zr([m,s.encodeLocation?s.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),c,r,i,o);return n&&T?x.createElement($o.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},T):T}function NT(){let e=UT(),n=wT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:s},"ErrorBoundary")," or"," ",x.createElement("code",{style:s},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),r?x.createElement("pre",{style:o},r):null,c)}var MT=x.createElement(NT,null),jT=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.unstable_onError?this.props.unstable_onError(e,n):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?x.createElement(Pn.Provider,{value:this.props.routeContext},x.createElement(Cp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function DT({routeContext:e,match:n,children:r}){let i=x.useContext(fl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Pn.Provider,{value:e},r)}function OT(e,n=[],r=null,i=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,c=r?.errors;if(c!=null){let d=s.findIndex(m=>m.route.id&&c?.[m.route.id]!==void 0);ft(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,d+1))}let f=!1,h=-1;if(r)for(let d=0;d<s.length;d++){let m=s[d];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(h=d),m.route.id){let{loaderData:y,errors:b}=r,w=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||w){f=!0,h>=0?s=s.slice(0,h+1):s=[s[0]];break}}}return s.reduceRight((d,m,y)=>{let b,w=!1,E=null,C=null;r&&(b=c&&m.route.id?c[m.route.id]:void 0,E=m.route.errorElement||MT,f&&(h<0&&y===0?(z0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):h===y&&(w=!0,C=m.route.hydrateFallbackElement||null)));let A=n.concat(s.slice(0,y+1)),T=()=>{let N;return b?N=E:w?N=C:m.route.Component?N=x.createElement(m.route.Component,null):m.route.element?N=m.route.element:N=d,x.createElement(DT,{match:m,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:N})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?x.createElement(jT,{location:r.location,revalidation:r.revalidation,component:E,error:b,children:T(),routeContext:{outlet:null,matches:A,isDataRoute:!0},unstable_onError:i}):T()},null)}function Ap(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function LT(e){let n=x.useContext(fl);return ft(n,Ap(e)),n}function zT(e){let n=x.useContext(dc);return ft(n,Ap(e)),n}function PT(e){let n=x.useContext(Pn);return ft(n,Ap(e)),n}function Tp(e){let n=PT(e),r=n.matches[n.matches.length-1];return ft(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function IT(){return Tp("useRouteId")}function UT(){let e=x.useContext(Cp),n=zT("useRouteError"),r=Tp("useRouteError");return e!==void 0?e:n.errors?.[r]}function BT(){let{router:e}=LT("useNavigate"),n=Tp("useNavigate"),r=x.useRef(!1);return O0(()=>{r.current=!0}),x.useCallback(async(o,s={})=>{zn(r.current,D0),r.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:n,...s}))},[e,n])}var zx={};function z0(e,n,r){!n&&!zx[e]&&(zx[e]=!0,zn(!1,r))}x.memo(HT);function HT({routes:e,future:n,state:r,unstable_onError:i}){return L0(e,void 0,r,i,n)}function P0({to:e,replace:n,state:r,relative:i}){ft(dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=x.useContext(Kn);zn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=x.useContext(Pn),{pathname:c}=on(),f=Go(),h=kp(e,Ep(s),c,i==="path"),d=JSON.stringify(h);return x.useEffect(()=>{f(JSON.parse(d),{replace:n,state:r,relative:i})},[f,d,i,n,r]),null}function Rp(e){return RT(e.context)}function we(e){ft(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function FT({basename:e="/",children:n=null,location:r,navigationType:i="POP",navigator:o,static:s=!1}){ft(!dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=x.useMemo(()=>({basename:c,navigator:o,static:s,future:{}}),[c,o,s]);typeof r=="string"&&(r=cl(r));let{pathname:h="/",search:d="",hash:m="",state:y=null,key:b="default"}=r,w=x.useMemo(()=>{let E=Pr(h,c);return E==null?null:{location:{pathname:E,search:d,hash:m,state:y,key:b},navigationType:i}},[c,h,d,m,y,b,i]);return zn(w!=null,`<Router basename="${c}"> is not able to match the URL "${h}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Kn.Provider,{value:f},x.createElement($o.Provider,{children:n,value:w}))}function qT({children:e,location:n}){return _T(Bh(e),n)}function Bh(e,n=[]){let r=[];return x.Children.forEach(e,(i,o)=>{if(!x.isValidElement(i))return;let s=[...n,o];if(i.type===x.Fragment){r.push.apply(r,Bh(i.props.children,s));return}ft(i.type===we,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ft(!i.props.index||!i.props.children,"An index route cannot have child routes.");let c={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=Bh(i.props.children,s)),r.push(c)}),r}var Pu="get",Iu="application/x-www-form-urlencoded";function hc(e){return e!=null&&typeof e.tagName=="string"}function VT(e){return hc(e)&&e.tagName.toLowerCase()==="button"}function $T(e){return hc(e)&&e.tagName.toLowerCase()==="form"}function GT(e){return hc(e)&&e.tagName.toLowerCase()==="input"}function YT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KT(e,n){return e.button===0&&(!n||n==="_self")&&!YT(e)}function Hh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,r)=>{let i=e[r];return n.concat(Array.isArray(i)?i.map(o=>[r,o]):[[r,i]])},[]))}function XT(e,n){let r=Hh(e);return n&&n.forEach((i,o)=>{r.has(o)||n.getAll(o).forEach(s=>{r.append(o,s)})}),r}var wu=null;function QT(){if(wu===null)try{new FormData(document.createElement("form"),0),wu=!1}catch{wu=!0}return wu}var ZT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rh(e){return e!=null&&!ZT.has(e)?(zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function WT(e,n){let r,i,o,s,c;if($T(e)){let f=e.getAttribute("action");i=f?Pr(f,n):null,r=e.getAttribute("method")||Pu,o=rh(e.getAttribute("enctype"))||Iu,s=new FormData(e)}else if(VT(e)||GT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(i=h?Pr(h,n):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Pu,o=rh(e.getAttribute("formenctype"))||rh(f.getAttribute("enctype"))||Iu,s=new FormData(f,e),!QT()){let{name:d,type:m,value:y}=e;if(m==="image"){let b=d?`${d}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else d&&s.append(d,y)}}else{if(hc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Pu,i=null,o=Iu,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:i,method:r.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _p(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function JT(e,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i.pathname==="/"?i.pathname=`_root.${r}`:n&&Pr(i.pathname,n)==="/"?i.pathname=`${n.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function eR(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tR(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function nR(e,n,r){let i=await Promise.all(e.map(async o=>{let s=n.routes[o.route.id];if(s){let c=await eR(s,r);return c.links?c.links():[]}return[]}));return lR(i.flat(1).filter(tR).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Px(e,n,r,i,o,s){let c=(h,d)=>r[d]?h.route.id!==r[d].route.id:!0,f=(h,d)=>r[d].pathname!==h.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==h.params["*"];return s==="assets"?n.filter((h,d)=>c(h,d)||f(h,d)):s==="data"?n.filter((h,d)=>{let m=i.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,d)||f(h,d))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function rR(e,n,{includeHydrateFallback:r}={}){return aR(e.map(i=>{let o=n.routes[i.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function aR(e){return[...new Set(e)]}function iR(e){let n={},r=Object.keys(e).sort();for(let i of r)n[i]=e[i];return n}function lR(e,n){let r=new Set;return new Set(n),e.reduce((i,o)=>{let s=JSON.stringify(iR(o));return r.has(s)||(r.add(s),i.push({key:s,link:o})),i},[])}function I0(){let e=x.useContext(fl);return _p(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oR(){let e=x.useContext(dc);return _p(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Np=x.createContext(void 0);Np.displayName="FrameworkContext";function U0(){let e=x.useContext(Np);return _p(e,"You must render this element inside a <HydratedRouter> element"),e}function sR(e,n){let r=x.useContext(Np),[i,o]=x.useState(!1),[s,c]=x.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:y}=n,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=T=>{T.forEach(N=>{c(N.isIntersecting)})},A=new IntersectionObserver(C,{threshold:.5});return b.current&&A.observe(b.current),()=>{A.disconnect()}}},[e]),x.useEffect(()=>{if(i){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[i]);let w=()=>{o(!0)},E=()=>{o(!1),c(!1)};return r?e!=="intent"?[s,b,{}]:[s,b,{onFocus:vo(f,w),onBlur:vo(h,E),onMouseEnter:vo(d,w),onMouseLeave:vo(m,E),onTouchStart:vo(y,w)}]:[!1,b,{}]}function vo(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function uR({page:e,...n}){let{router:r}=I0(),i=x.useMemo(()=>R0(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?x.createElement(fR,{page:e,matches:i,...n}):null}function cR(e){let{manifest:n,routeModules:r}=U0(),[i,o]=x.useState([]);return x.useEffect(()=>{let s=!1;return nR(e,n,r).then(c=>{s||o(c)}),()=>{s=!0}},[e,n,r]),i}function fR({page:e,matches:n,...r}){let i=on(),{manifest:o,routeModules:s}=U0(),{basename:c}=I0(),{loaderData:f,matches:h}=oR(),d=x.useMemo(()=>Px(e,n,h,o,i,"data"),[e,n,h,o,i]),m=x.useMemo(()=>Px(e,n,h,o,i,"assets"),[e,n,h,o,i]),y=x.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let E=new Set,C=!1;if(n.forEach(T=>{let N=o.routes[T.route.id];!N||!N.hasLoader||(!d.some(_=>_.route.id===T.route.id)&&T.route.id in f&&s[T.route.id]?.shouldRevalidate||N.hasClientLoader?C=!0:E.add(T.route.id))}),E.size===0)return[];let A=JT(e,c,"data");return C&&E.size>0&&A.searchParams.set("_routes",n.filter(T=>E.has(T.route.id)).map(T=>T.route.id).join(",")),[A.pathname+A.search]},[c,f,i,o,d,n,e,s]),b=x.useMemo(()=>rR(m,o),[m,o]),w=cR(m);return x.createElement(x.Fragment,null,y.map(E=>x.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),b.map(E=>x.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),w.map(({key:E,link:C})=>x.createElement("link",{key:E,nonce:r.nonce,...C})))}function dR(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var B0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{B0&&(window.__reactRouterVersion="7.8.2")}catch{}function hR({basename:e,children:n,window:r}){let i=x.useRef();i.current==null&&(i.current=WA({window:r,v5Compat:!0}));let o=i.current,[s,c]=x.useState({action:o.action,location:o.location}),f=x.useCallback(h=>{x.startTransition(()=>c(h))},[c]);return x.useLayoutEffect(()=>o.listen(f),[o,f]),x.createElement(FT,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:o})}var H0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vn=x.forwardRef(function({onClick:n,discover:r="render",prefetch:i="none",relative:o,reloadDocument:s,replace:c,state:f,target:h,to:d,preventScrollReset:m,viewTransition:y,...b},w){let{basename:E}=x.useContext(Kn),C=typeof d=="string"&&H0.test(d),A,T=!1;if(typeof d=="string"&&C&&(A=d,B0))try{let ee=new URL(window.location.href),P=d.startsWith("//")?new URL(ee.protocol+d):new URL(d),re=Pr(P.pathname,E);P.origin===ee.origin&&re!=null?d=re+P.search+P.hash:T=!0}catch{zn(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let N=CT(d,{relative:o}),[_,j,L]=sR(i,b),O=yR(d,{replace:c,state:f,target:h,preventScrollReset:m,relative:o,viewTransition:y});function $(ee){n&&n(ee),ee.defaultPrevented||O(ee)}let G=x.createElement("a",{...b,...L,href:A||N,onClick:T||s?n:$,ref:dR(w,j),target:h,"data-discover":!C&&r==="render"?"true":void 0});return _&&!C?x.createElement(x.Fragment,null,G,x.createElement(uR,{page:N})):G});Vn.displayName="Link";var pR=x.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:i="",end:o=!1,style:s,to:c,viewTransition:f,children:h,...d},m){let y=Yo(c,{relative:d.relative}),b=on(),w=x.useContext(dc),{navigator:E,basename:C}=x.useContext(Kn),A=w!=null&&SR(y)&&f===!0,T=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,N=b.pathname,_=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(N=N.toLowerCase(),_=_?_.toLowerCase():null,T=T.toLowerCase()),_&&C&&(_=Pr(_,C)||_);const j=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let L=N===T||!o&&N.startsWith(T)&&N.charAt(j)==="/",O=_!=null&&(_===T||!o&&_.startsWith(T)&&_.charAt(T.length)==="/"),$={isActive:L,isPending:O,isTransitioning:A},G=L?n:void 0,ee;typeof i=="function"?ee=i($):ee=[i,L?"active":null,O?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let P=typeof s=="function"?s($):s;return x.createElement(Vn,{...d,"aria-current":G,className:ee,ref:m,style:P,to:c,viewTransition:f},typeof h=="function"?h($):h)});pR.displayName="NavLink";var mR=x.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:i,replace:o,state:s,method:c=Pu,action:f,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:y,...b},w)=>{let E=bR(),C=wR(f,{relative:d}),A=c.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&H0.test(f),N=_=>{if(h&&h(_),_.defaultPrevented)return;_.preventDefault();let j=_.nativeEvent.submitter,L=j?.getAttribute("formmethod")||c;E(j||_.currentTarget,{fetcherKey:n,method:L,navigate:r,replace:o,state:s,relative:d,preventScrollReset:m,viewTransition:y})};return x.createElement("form",{ref:w,method:A,action:C,onSubmit:i?h:N,...b,"data-discover":!T&&e==="render"?"true":void 0})});mR.displayName="Form";function gR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function F0(e){let n=x.useContext(fl);return ft(n,gR(e)),n}function yR(e,{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:c}={}){let f=Go(),h=on(),d=Yo(e,{relative:s});return x.useCallback(m=>{if(KT(m,n)){m.preventDefault();let y=r!==void 0?r:jo(h)===jo(d);f(e,{replace:y,state:i,preventScrollReset:o,relative:s,viewTransition:c})}},[h,f,d,r,i,n,e,o,s,c])}function WU(e){zn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=x.useRef(Hh(e)),r=x.useRef(!1),i=on(),o=x.useMemo(()=>XT(i.search,r.current?null:n.current),[i.search]),s=Go(),c=x.useCallback((f,h)=>{const d=Hh(typeof f=="function"?f(new URLSearchParams(o)):f);r.current=!0,s("?"+d,h)},[s,o]);return[o,c]}var vR=0,xR=()=>`__${String(++vR)}__`;function bR(){let{router:e}=F0("useSubmit"),{basename:n}=x.useContext(Kn),r=IT();return x.useCallback(async(i,o={})=>{let{action:s,method:c,encType:f,formData:h,body:d}=WT(i,n);if(o.navigate===!1){let m=o.fetcherKey||xR();await e.fetch(m,r,o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,flushSync:o.flushSync})}else await e.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,n,r])}function wR(e,{relative:n}={}){let{basename:r}=x.useContext(Kn),i=x.useContext(Pn);ft(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),s={...Yo(e||".",{relative:n})},c=on();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search),h=f.getAll("index");if(h.some(m=>m==="")){f.delete("index"),h.filter(y=>y).forEach(y=>f.append("index",y));let m=f.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:zr([r,s.pathname])),jo(s)}function SR(e,{relative:n}={}){let r=x.useContext(j0);ft(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=F0("useViewTransitionState"),o=Yo(e,{relative:n});if(!r.isTransitioning)return!1;let s=Pr(r.currentLocation.pathname,i)||r.currentLocation.pathname,c=Pr(r.nextLocation.pathname,i)||r.nextLocation.pathname;return Xu(o.pathname,c)!=null||Xu(o.pathname,s)!=null}var pc=T0();const ER=fc(pc);var mc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gc=typeof window>"u"||"Deno"in globalThis;function qn(){}function kR(e,n){return typeof e=="function"?e(n):e}function CR(e){return typeof e=="number"&&e>=0&&e!==1/0}function AR(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Fh(e,n){return typeof e=="function"?e(n):e}function TR(e,n){return typeof e=="function"?e(n):e}function Ix(e,n){const{type:r="all",exact:i,fetchStatus:o,predicate:s,queryKey:c,stale:f}=e;if(c){if(i){if(n.queryHash!==Mp(c,n.options))return!1}else if(!Oo(n.queryKey,c))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof f=="boolean"&&n.isStale()!==f||o&&o!==n.state.fetchStatus||s&&!s(n))}function Ux(e,n){const{exact:r,status:i,predicate:o,mutationKey:s}=e;if(s){if(!n.options.mutationKey)return!1;if(r){if(Do(n.options.mutationKey)!==Do(s))return!1}else if(!Oo(n.options.mutationKey,s))return!1}return!(i&&n.state.status!==i||o&&!o(n))}function Mp(e,n){return(n?.queryKeyHashFn||Do)(e)}function Do(e){return JSON.stringify(e,(n,r)=>qh(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function Oo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>Oo(e[r],n[r])):!1}function q0(e,n){if(e===n)return e;const r=Bx(e)&&Bx(n);if(r||qh(e)&&qh(n)){const i=r?e:Object.keys(e),o=i.length,s=r?n:Object.keys(n),c=s.length,f=r?[]:{},h=new Set(i);let d=0;for(let m=0;m<c;m++){const y=r?m:s[m];(!r&&h.has(y)||r)&&e[y]===void 0&&n[y]===void 0?(f[y]=void 0,d++):(f[y]=q0(e[y],n[y]),f[y]===e[y]&&e[y]!==void 0&&d++)}return o===c&&d===o?e:f}return n}function Bx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qh(e){if(!Hx(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!Hx(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Hx(e){return Object.prototype.toString.call(e)==="[object Object]"}function RR(e){return new Promise(n=>{setTimeout(n,e)})}function _R(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?q0(e,n):n}function NR(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function MR(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}var jp=Symbol();function V0(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===jp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var jR=class extends mc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!gc&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},$0=new jR,DR=class extends mc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!gc&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},Qu=new DR;function OR(){let e,n;const r=new Promise((o,s)=>{e=o,n=s});r.status="pending",r.catch(()=>{});function i(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},r.reject=o=>{i({status:"rejected",reason:o}),n(o)},r}function LR(e){return Math.min(1e3*2**e,3e4)}function G0(e){return(e??"online")==="online"?Qu.isOnline():!0}var Y0=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function K0(e){let n=!1,r=0,i;const o=OR(),s=()=>o.status!=="pending",c=C=>{s()||(b(new Y0(C)),e.abort?.())},f=()=>{n=!0},h=()=>{n=!1},d=()=>$0.isFocused()&&(e.networkMode==="always"||Qu.isOnline())&&e.canRun(),m=()=>G0(e.networkMode)&&e.canRun(),y=C=>{s()||(i?.(),o.resolve(C))},b=C=>{s()||(i?.(),o.reject(C))},w=()=>new Promise(C=>{i=A=>{(s()||d())&&C(A)},e.onPause?.()}).then(()=>{i=void 0,s()||e.onContinue?.()}),E=()=>{if(s())return;let C;const A=r===0?e.initialPromise:void 0;try{C=A??e.fn()}catch(T){C=Promise.reject(T)}Promise.resolve(C).then(y).catch(T=>{if(s())return;const N=e.retry??(gc?0:3),_=e.retryDelay??LR,j=typeof _=="function"?_(r,T):_,L=N===!0||typeof N=="number"&&r<N||typeof N=="function"&&N(r,T);if(n||!L){b(T);return}r++,e.onFail?.(r,T),RR(j).then(()=>d()?void 0:w()).then(()=>{n?b(T):E()})})};return{promise:o,status:()=>o.status,cancel:c,continue:()=>(i?.(),o),cancelRetry:f,continueRetry:h,canStart:m,start:()=>(m()?E():w().then(E),o)}}var zR=e=>setTimeout(e,0);function PR(){let e=[],n=0,r=f=>{f()},i=f=>{f()},o=zR;const s=f=>{n?e.push(f):o(()=>{r(f)})},c=()=>{const f=e;e=[],f.length&&o(()=>{i(()=>{f.forEach(h=>{r(h)})})})};return{batch:f=>{let h;n++;try{h=f()}finally{n--,n||c()}return h},batchCalls:f=>(...h)=>{s(()=>{f(...h)})},schedule:s,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{o=f}}}var Zt=PR(),X0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),CR(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gc?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},IR=class extends X0{#e;#t;#n;#a;#r;#l;#o;constructor(e){super(),this.#o=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#n=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=BR(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#l,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const r=_R(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e,n){this.#i({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(qn).catch(qn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>TR(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Fh(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!AR(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},o=()=>{const f=V0(this.options,n),d=(()=>{const m={client:this.#a,queryKey:this.queryKey,meta:this.meta};return i(m),m})();return this.#o=!1,this.options.persister?this.options.persister(f,d,this):f(d)},c=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return i(f),f})();this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#i({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=K0({initialPromise:n?.initialPromise,fn:c.fetchFn,abort:r.abort.bind(r),onFail:(f,h)=>{this.#i({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof Y0){if(f.silent)return this.#r.promise;if(f.revert){if(this.setState({...this.#t,fetchStatus:"idle"}),this.state.data===void 0)throw f;return this.state.data}}throw this.#i({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...UR(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function UR(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G0(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BR(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var HR=class extends mc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const i=n.queryKey,o=n.queryHash??Mp(i,n);let s=this.get(o);return s||(s=new IR({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Zt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Ix(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Ix(e,r)):n}notify(e){Zt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},FR=class extends X0{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||qR(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(n=>n!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#a({type:"continue"})};this.#n=K0({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#a({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#a({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",i=!this.#n.canStart();try{if(r)n();else{this.#a({type:"pending",variables:e,isPaused:i}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#a({type:"pending",context:s,variables:e,isPaused:i})}const o=await this.#n.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this),await this.options.onSuccess?.(o,e,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,e,this.state.context),this.#a({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,e,this.state.context,this),await this.options.onError?.(o,e,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,e,this.state.context),o}finally{this.#a({type:"error",error:o})}}finally{this.#t.runNext(this)}}#a(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Zt.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function qR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var VR=class extends mc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const i=new FR({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){this.#e.add(e);const n=Su(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Su(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Su(e);if(typeof n=="string"){const i=this.#t.get(n)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const n=Su(e);return typeof n=="string"?this.#t.get(n)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Ux(n,r))}findAll(e={}){return this.getAll().filter(n=>Ux(e,n))}notify(e){Zt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Zt.batch(()=>Promise.all(e.map(n=>n.continue().catch(qn))))}};function Su(e){return e.options.scope?.id}function Fx(e){return{onFetch:(n,r)=>{const i=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,s=n.state.data?.pages||[],c=n.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const d=async()=>{let m=!1;const y=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(n.signal.aborted?m=!0:n.signal.addEventListener("abort",()=>{m=!0}),n.signal)})},b=V0(n.options,n.fetchOptions),w=async(E,C,A)=>{if(m)return Promise.reject();if(C==null&&E.pages.length)return Promise.resolve(E);const N=(()=>{const O={client:n.client,queryKey:n.queryKey,pageParam:C,direction:A?"backward":"forward",meta:n.options.meta};return y(O),O})(),_=await b(N),{maxPages:j}=n.options,L=A?MR:NR;return{pages:L(E.pages,_,j),pageParams:L(E.pageParams,C,j)}};if(o&&s.length){const E=o==="backward",C=E?$R:qx,A={pages:s,pageParams:c},T=C(i,A);f=await w(A,T,E)}else{const E=e??s.length;do{const C=h===0?c[0]??i.initialPageParam:qx(i,f);if(h>0&&C==null)break;f=await w(f,C),h++}while(h<E)}return f};n.options.persister?n.fetchFn=()=>n.options.persister?.(d,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=d}}}function qx(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function $R(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var GR=class{#e;#t;#n;#a;#r;#l;#o;#i;constructor(e={}){this.#e=e.queryCache||new HR,this.#t=e.mutationCache||new VR,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=$0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Qu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Fh(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(i.queryHash)?.state.data,c=kR(n,s);if(c!==void 0)return this.#e.build(this,i).setData(c,{...r,manual:!0})}setQueriesData(e,n,r){return Zt.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Zt.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return Zt.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},i=Zt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(qn).catch(qn)}invalidateQueries(e,n={}){return Zt.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=Zt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(qn)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(i).then(qn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(Fh(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qn).catch(qn)}fetchInfiniteQuery(e){return e.behavior=Fx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qn).catch(qn)}ensureInfiniteQueryData(e){return e.behavior=Fx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#a.set(Do(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#a.values()],r={};return n.forEach(i=>{Oo(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){this.#r.set(Do(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],r={};return n.forEach(i=>{Oo(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Mp(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===jp&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},YR=x.createContext(void 0),KR=({client:e,children:n})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(YR.Provider,{value:e,children:n}));const XR={theme:"system",setTheme:()=>null},Q0=x.createContext(XR);function JU(){const e=x.useContext(Q0);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function QR({children:e,defaultTheme:n="system",storageKey:r="ui-theme",...i}){const[o,s]=x.useState(n);x.useEffect(()=>{const f=localStorage?.getItem(r);f&&s(f)},[r]),x.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark","coconut"),o==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(h);return}f.classList.add(o)},[o]);const c={theme:o,setTheme:f=>{localStorage?.setItem(r,f),s(f)}};return g.jsx(Q0.Provider,{...i,value:c,children:e})}const Et="",eB="https://app.coconut.dev";async function Hi(e,n={}){const r=`${Et}${e}`,i={headers:{"Content-Type":"application/json",...n.headers},...n},o=await fetch(r,i);if(!o.ok)throw new Error(`API request failed: ${o.status} ${o.statusText}`);return o.json()}const tB=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,ZR="coconut.pkce_verifier",Vx="coconut.oauth_return_to",Z0=e=>{let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function WR(e=64){const n=new Uint8Array(e);return crypto.getRandomValues(n),Z0(n).slice(0,e)}async function JR(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n);return Z0(new Uint8Array(r))}async function e_(e){const{clientId:n,issuer:r,returnTo:i,scope:o="openid email profile offline_access"}=e,s=WR(),c=await JR(s);try{sessionStorage.setItem(ZR,s),i?sessionStorage.setItem(Vx,i):sessionStorage.removeItem(Vx)}catch{}const f=`${window.location.origin}/auth/callback`,h=new URLSearchParams({response_type:"code",client_id:n,redirect_uri:f,scope:o,code_challenge:c,code_challenge_method:"S256"});window.location.href=`${r.replace(/\/$/,"")}/oauth/authorize?${h.toString()}`}async function nB(e){const{issuer:n,clientId:r,code:i,verifier:o}=e,s=`${window.location.origin}/auth/callback`,c=await fetch(`${n.replace(/\/$/,"")}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:i,redirect_uri:s,client_id:r,code_verifier:o}).toString()});if(!c.ok){const f=await c.text().catch(()=>"");throw new Error(`Clerk token exchange failed (${c.status}): ${f||"no body"}`)}return await c.json()}const W0=x.createContext(void 0),Eu={enabled:!1};function t_({children:e}){const[n,r]=x.useState({user:null,isAuthenticated:!1,isLoading:!0,authEnabled:!1,localAuthEnabled:!0,allowRegistration:!0,oauth:Eu}),i=x.useCallback(async()=>{try{const d=await Hi("/api/v1/auth/status");if(!d.success){r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!1,localAuthEnabled:!0,allowRegistration:!0,oauth:Eu});return}const m=d.data?.enabled||!1,y=d.data?.oauth?.enabled?{enabled:!0,clientId:d.data.oauth.clientId,issuer:d.data.oauth.issuer,jwksUrl:d.data.oauth.jwksUrl}:Eu,b=d.data?.config?.providers?.local??!0,w=d.data?.config?.allowRegistration??!0;if(!m){r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!1,localAuthEnabled:b,allowRegistration:w,oauth:y});return}try{const E=await Hi("/api/v1/auth/me");E.success&&E.data?.user?r({user:E.data.user,isAuthenticated:!0,isLoading:!1,authEnabled:!0,localAuthEnabled:b,allowRegistration:w,oauth:y}):r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!0,localAuthEnabled:b,allowRegistration:w,oauth:y})}catch{r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!0,localAuthEnabled:b,allowRegistration:w,oauth:y})}}catch(d){console.error("Failed to check auth status:",d),r({user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!1,localAuthEnabled:!0,allowRegistration:!0,oauth:Eu})}},[]);x.useEffect(()=>{i()},[i]);const o=x.useCallback(async(d,m)=>{const y=await Hi("/api/v1/auth/login",{method:"POST",body:JSON.stringify({email:d,password:m})});if(!y.success)throw new Error(y.error||"Login failed");r(b=>({...b,user:y.data.user,isAuthenticated:!0,isLoading:!1,authEnabled:!0}))},[]),s=x.useCallback(async(d,m,y)=>{const b=await Hi("/api/v1/auth/register",{method:"POST",body:JSON.stringify({email:d,password:m,name:y})});if(!b.success)throw new Error(b.error||"Registration failed");r(w=>({...w,user:b.data.user,isAuthenticated:!0,isLoading:!1,authEnabled:!0}))},[]),c=x.useCallback(async()=>{await Hi("/api/v1/auth/logout",{method:"POST"}),r(d=>({...d,user:null,isAuthenticated:!1,isLoading:!1,authEnabled:!0}))},[]),f=x.useCallback(async d=>{const m=n.oauth;if(!m.enabled||!m.clientId||!m.issuer)throw new Error("OAuth is not enabled on this coconut");await e_({clientId:m.clientId,issuer:m.issuer,returnTo:d})},[n.oauth]),h=x.useCallback(async()=>{try{const d=await Hi("/api/v1/auth/me");d.success&&d.data?.user&&r(m=>({...m,user:d.data.user,isAuthenticated:!0}))}catch(d){console.error("Failed to refresh user:",d)}},[]);return g.jsx(W0.Provider,{value:{...n,login:o,register:s,logout:c,refreshUser:h,checkAuthStatus:i,loginWithCoconut:f},children:e})}function J0(){const e=x.useContext(W0);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const e1=x.createContext(null);function n_(){const e=x.useContext(e1);if(!e)throw new Error("useSidebarBadges must be used within SidebarBadgeProvider");return e}function r_({children:e,pollInterval:n=1e4}){const[r,i]=x.useState({codeSessions:0,gitChanges:0,terminalSessions:0,runningScheduledJobs:0}),[o,s]=x.useState(!0),c=x.useCallback(async()=>{try{const[h,d,m]=await Promise.allSettled([fetch(`${Et}/api/v1/terminal/sessions`).then(b=>b.json()),fetch(`${Et}/api/v1/git/status`).then(b=>b.json()),fetch(`${Et}/api/v1/jobs`).then(b=>b.json())]),y={codeSessions:0,gitChanges:0,terminalSessions:0,runningScheduledJobs:0};if(h.status==="fulfilled"&&h.value?.sessions){const b=h.value.sessions;y.codeSessions=b.filter(w=>w.taskId?.startsWith("cp-")||w.taskId?.startsWith("sk-")).length,y.terminalSessions=b.filter(w=>!w.taskId?.startsWith("cp-")&&!w.taskId?.startsWith("sk-")).length}if(d.status==="fulfilled"&&d.value?.success&&d.value?.data?.changes&&(y.gitChanges=d.value.data.changes.length),m.status==="fulfilled"&&m.value?.success&&m.value?.data){const b=Array.isArray(m.value.data)?m.value.data:[],w=b.filter(E=>{if(!E.runs||!Array.isArray(E.runs)||E.runs.length===0)return!1;const C=E.runs[0],A=C&&C.status==="running";return A&&console.log("[SidebarBadge] Running job detected:",{name:E.name,status:C.status,startedAt:C.startedAt,finishedAt:C.finishedAt}),A});y.runningScheduledJobs=w.length,(w.length>0||b.length>0)&&console.log("[SidebarBadge] Jobs summary:",{total:b.length,running:w.length,runningJobNames:w.map(E=>E.name)})}i(y)}catch(h){console.error("Failed to fetch sidebar badges:",h)}finally{s(!1)}},[]);x.useEffect(()=>{c()},[c]),x.useEffect(()=>{const h=setInterval(c,n);return()=>clearInterval(h)},[c,n]),x.useEffect(()=>{const h=()=>{console.log("[SidebarBadge] Tab focused, refreshing badges..."),c()};return window.addEventListener("focus",h),()=>window.removeEventListener("focus",h)},[c]);const f={badges:r,loading:o,refresh:c};return g.jsx(e1.Provider,{value:f,children:e})}function a_({children:e}){const[n]=x.useState(()=>new GR({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}}));return g.jsx(KR,{client:n,children:g.jsx(QR,{defaultTheme:"system",storageKey:"coconut-ui-theme",children:g.jsx(t_,{children:g.jsx(r_,{children:e})})})})}const i_=1,l_=1e6;let ah=0;function o_(){return ah=(ah+1)%Number.MAX_SAFE_INTEGER,ah.toString()}const ih=new Map,$x=e=>{if(ih.has(e))return;const n=setTimeout(()=>{ih.delete(e),To({type:"REMOVE_TOAST",toastId:e})},l_);ih.set(e,n)},s_=(e,n)=>{switch(n.type){case"ADD_TOAST":return{...e,toasts:[n.toast,...e.toasts].slice(0,i_)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===n.toast.id?{...r,...n.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=n;return r?$x(r):e.toasts.forEach(i=>{$x(i.id)}),{...e,toasts:e.toasts.map(i=>i.id===r||r===void 0?{...i,open:!1}:i)}}case"REMOVE_TOAST":return n.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==n.toastId)}}},Uu=[];let Bu={toasts:[]};function To(e){Bu=s_(Bu,e),Uu.forEach(n=>{n(Bu)})}function Vh({...e}){const n=o_(),r=o=>To({type:"UPDATE_TOAST",toast:{...o,id:n}}),i=()=>To({type:"DISMISS_TOAST",toastId:n});return To({type:"ADD_TOAST",toast:{...e,id:n,open:!0,onOpenChange:o=>{o||i()}}}),{id:n,dismiss:i,update:r}}function u_(){const[e,n]=x.useState(Bu);return x.useEffect(()=>(Uu.push(n),()=>{const r=Uu.indexOf(n);r>-1&&Uu.splice(r,1)}),[e]),{...e,toast:Vh,dismiss:r=>To({type:"DISMISS_TOAST",toastId:r})}}function me(e,n,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return n?.(o)}}function Gx(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function yc(...e){return n=>{let r=!1;const i=e.map(o=>{const s=Gx(o,n);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<i.length;o++){const s=i[o];typeof s=="function"?s():Gx(e[o],null)}}}}function Qe(...e){return x.useCallback(yc(...e),e)}function c_(e,n){const r=x.createContext(n),i=s=>{const{children:c,...f}=s,h=x.useMemo(()=>f,Object.values(f));return g.jsx(r.Provider,{value:h,children:c})};i.displayName=e+"Provider";function o(s){const c=x.useContext(r);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[i,o]}function Xn(e,n=[]){let r=[];function i(s,c){const f=x.createContext(c),h=r.length;r=[...r,c];const d=y=>{const{scope:b,children:w,...E}=y,C=b?.[e]?.[h]||f,A=x.useMemo(()=>E,Object.values(E));return g.jsx(C.Provider,{value:A,children:w})};d.displayName=s+"Provider";function m(y,b){const w=b?.[e]?.[h]||f,E=x.useContext(w);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${s}\``)}return[d,m]}const o=()=>{const s=r.map(c=>x.createContext(c));return function(f){const h=f?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return o.scopeName=e,[i,f_(o,...n)]}function f_(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=i.reduce((f,{useScope:h,scopeName:d})=>{const y=h(s)[`__scope${d}`];return{...f,...y}},{});return x.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return r.scopeName=n.scopeName,r}function nl(e){const n=d_(e),r=x.forwardRef((i,o)=>{const{children:s,...c}=i,f=x.Children.toArray(s),h=f.find(h_);if(h){const d=h.props.children,m=f.map(y=>y===h?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:y);return g.jsx(n,{...c,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,m):null})}return g.jsx(n,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var hl=nl("Slot");function d_(e){const n=x.forwardRef((r,i)=>{const{children:o,...s}=r;if(x.isValidElement(o)){const c=m_(o),f=p_(s,o.props);return o.type!==x.Fragment&&(f.ref=i?yc(i,c):c),x.cloneElement(o,f)}return x.Children.count(o)>1?x.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var t1=Symbol("radix.slottable");function n1(e){const n=({children:r})=>g.jsx(g.Fragment,{children:r});return n.displayName=`${e}.Slottable`,n.__radixId=t1,n}function h_(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t1}function p_(e,n){const r={...n};for(const i in n){const o=e[i],s=n[i];/^on[A-Z]/.test(i)?o&&s?r[i]=(...f)=>{const h=s(...f);return o(...f),h}:o&&(r[i]=o):i==="style"?r[i]={...o,...s}:i==="className"&&(r[i]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function m_(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Dp(e){const n=e+"CollectionProvider",[r,i]=Xn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:A,children:T}=C,N=ha.useRef(null),_=ha.useRef(new Map).current;return g.jsx(o,{scope:A,itemMap:_,collectionRef:N,children:T})};c.displayName=n;const f=e+"CollectionSlot",h=nl(f),d=ha.forwardRef((C,A)=>{const{scope:T,children:N}=C,_=s(f,T),j=Qe(A,_.collectionRef);return g.jsx(h,{ref:j,children:N})});d.displayName=f;const m=e+"CollectionItemSlot",y="data-radix-collection-item",b=nl(m),w=ha.forwardRef((C,A)=>{const{scope:T,children:N,..._}=C,j=ha.useRef(null),L=Qe(A,j),O=s(m,T);return ha.useEffect(()=>(O.itemMap.set(j,{ref:j,..._}),()=>void O.itemMap.delete(j))),g.jsx(b,{[y]:"",ref:L,children:N})});w.displayName=m;function E(C){const A=s(e+"CollectionConsumer",C);return ha.useCallback(()=>{const N=A.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${y}]`));return Array.from(A.itemMap.values()).sort((O,$)=>_.indexOf(O.ref.current)-_.indexOf($.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:c,Slot:d,ItemSlot:w},E,i]}var g_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fe=g_.reduce((e,n)=>{const r=nl(`Primitive.${n}`),i=x.forwardRef((o,s)=>{const{asChild:c,...f}=o,h=c?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...f,ref:s})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Op(e,n){e&&pc.flushSync(()=>e.dispatchEvent(n))}function kt(e){const n=x.useRef(e);return x.useEffect(()=>{n.current=e}),x.useMemo(()=>(...r)=>n.current?.(...r),[])}function y_(e,n=globalThis?.document){const r=kt(e);x.useEffect(()=>{const i=o=>{o.key==="Escape"&&r(o)};return n.addEventListener("keydown",i,{capture:!0}),()=>n.removeEventListener("keydown",i,{capture:!0})},[r,n])}var v_="DismissableLayer",$h="dismissableLayer.update",x_="dismissableLayer.pointerDownOutside",b_="dismissableLayer.focusOutside",Yx,r1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ko=x.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:f,...h}=e,d=x.useContext(r1),[m,y]=x.useState(null),b=m?.ownerDocument??globalThis?.document,[,w]=x.useState({}),E=Qe(n,$=>y($)),C=Array.from(d.layers),[A]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=C.indexOf(A),N=m?C.indexOf(m):-1,_=d.layersWithOutsidePointerEventsDisabled.size>0,j=N>=T,L=S_($=>{const G=$.target,ee=[...d.branches].some(P=>P.contains(G));!j||ee||(o?.($),c?.($),$.defaultPrevented||f?.())},b),O=E_($=>{const G=$.target;[...d.branches].some(P=>P.contains(G))||(s?.($),c?.($),$.defaultPrevented||f?.())},b);return y_($=>{N===d.layers.size-1&&(i?.($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),x.useEffect(()=>{if(m)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yx=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),Kx(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Yx)}},[m,b,r,d]),x.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),Kx())},[m,d]),x.useEffect(()=>{const $=()=>w({});return document.addEventListener($h,$),()=>document.removeEventListener($h,$)},[]),g.jsx(Fe.div,{...h,ref:E,style:{pointerEvents:_?j?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,O.onFocusCapture),onBlurCapture:me(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,L.onPointerDownCapture)})});Ko.displayName=v_;var w_="DismissableLayerBranch",a1=x.forwardRef((e,n)=>{const r=x.useContext(r1),i=x.useRef(null),o=Qe(n,i);return x.useEffect(()=>{const s=i.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),g.jsx(Fe.div,{...e,ref:o})});a1.displayName=w_;function S_(e,n=globalThis?.document){const r=kt(e),i=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const s=f=>{if(f.target&&!i.current){let h=function(){i1(x_,r,d,{discrete:!0})};const d={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",o.current),o.current=h,n.addEventListener("click",o.current,{once:!0})):h()}else n.removeEventListener("click",o.current);i.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",s),n.removeEventListener("click",o.current)}},[n,r]),{onPointerDownCapture:()=>i.current=!0}}function E_(e,n=globalThis?.document){const r=kt(e),i=x.useRef(!1);return x.useEffect(()=>{const o=s=>{s.target&&!i.current&&i1(b_,r,{originalEvent:s},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Kx(){const e=new CustomEvent($h);document.dispatchEvent(e)}function i1(e,n,r,{discrete:i}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),i?Op(o,s):o.dispatchEvent(s)}var k_=Ko,C_=a1,cr=globalThis?.document?x.useLayoutEffect:()=>{},A_="Portal",Xo=x.forwardRef((e,n)=>{const{container:r,...i}=e,[o,s]=x.useState(!1);cr(()=>s(!0),[]);const c=r||o&&globalThis?.document?.body;return c?ER.createPortal(g.jsx(Fe.div,{...i,ref:n}),c):null});Xo.displayName=A_;function T_(e,n){return x.useReducer((r,i)=>n[r][i]??r,e)}var qt=e=>{const{present:n,children:r}=e,i=R_(n),o=typeof r=="function"?r({present:i.isPresent}):x.Children.only(r),s=Qe(i.ref,__(o));return typeof r=="function"||i.isPresent?x.cloneElement(o,{ref:s}):null};qt.displayName="Presence";function R_(e){const[n,r]=x.useState(),i=x.useRef(null),o=x.useRef(e),s=x.useRef("none"),c=e?"mounted":"unmounted",[f,h]=T_(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ku(i.current);s.current=f==="mounted"?d:"none"},[f]),cr(()=>{const d=i.current,m=o.current;if(m!==e){const b=s.current,w=ku(d);e?h("MOUNT"):w==="none"||d?.display==="none"?h("UNMOUNT"):h(m&&b!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),cr(()=>{if(n){let d;const m=n.ownerDocument.defaultView??window,y=w=>{const C=ku(i.current).includes(CSS.escape(w.animationName));if(w.target===n&&C&&(h("ANIMATION_END"),!o.current)){const A=n.style.animationFillMode;n.style.animationFillMode="forwards",d=m.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=A)})}},b=w=>{w.target===n&&(s.current=ku(i.current))};return n.addEventListener("animationstart",b),n.addEventListener("animationcancel",y),n.addEventListener("animationend",y),()=>{m.clearTimeout(d),n.removeEventListener("animationstart",b),n.removeEventListener("animationcancel",y),n.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[n,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(d=>{i.current=d?getComputedStyle(d):null,r(d)},[])}}function ku(e){return e?.animationName||"none"}function __(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var N_=A0[" useInsertionEffect ".trim().toString()]||cr;function pl({prop:e,defaultProp:n,onChange:r=()=>{},caller:i}){const[o,s,c]=M_({defaultProp:n,onChange:r}),f=e!==void 0,h=f?e:o;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const y=m.current;y!==f&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=f},[f,i])}const d=x.useCallback(m=>{if(f){const y=j_(m)?m(e):m;y!==e&&c.current?.(y)}else s(m)},[f,e,s,c]);return[h,d]}function M_({defaultProp:e,onChange:n}){const[r,i]=x.useState(e),o=x.useRef(r),s=x.useRef(n);return N_(()=>{s.current=n},[n]),x.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,i,s]}function j_(e){return typeof e=="function"}var D_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),O_="VisuallyHidden",vc=x.forwardRef((e,n)=>g.jsx(Fe.span,{...e,ref:n,style:{...D_,...e.style}}));vc.displayName=O_;var L_=vc,Lp="ToastProvider",[zp,z_,P_]=Dp("Toast"),[l1,rB]=Xn("Toast",[P_]),[I_,xc]=l1(Lp),o1=e=>{const{__scopeToast:n,label:r="Notification",duration:i=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:c}=e,[f,h]=x.useState(null),[d,m]=x.useState(0),y=x.useRef(!1),b=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Lp}\`. Expected non-empty \`string\`.`),g.jsx(zp.Provider,{scope:n,children:g.jsx(I_,{scope:n,label:r,duration:i,swipeDirection:o,swipeThreshold:s,toastCount:d,viewport:f,onViewportChange:h,onToastAdd:x.useCallback(()=>m(w=>w+1),[]),onToastRemove:x.useCallback(()=>m(w=>w-1),[]),isFocusedToastEscapeKeyDownRef:y,isClosePausedRef:b,children:c})})};o1.displayName=Lp;var s1="ToastViewport",U_=["F8"],Gh="toast.viewportPause",Yh="toast.viewportResume",u1=x.forwardRef((e,n)=>{const{__scopeToast:r,hotkey:i=U_,label:o="Notifications ({hotkey})",...s}=e,c=xc(s1,r),f=z_(r),h=x.useRef(null),d=x.useRef(null),m=x.useRef(null),y=x.useRef(null),b=Qe(n,y,c.onViewportChange),w=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=c.toastCount>0;x.useEffect(()=>{const A=T=>{i.length!==0&&i.every(_=>T[_]||T.code===_)&&y.current?.focus()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[i]),x.useEffect(()=>{const A=h.current,T=y.current;if(E&&A&&T){const N=()=>{if(!c.isClosePausedRef.current){const O=new CustomEvent(Gh);T.dispatchEvent(O),c.isClosePausedRef.current=!0}},_=()=>{if(c.isClosePausedRef.current){const O=new CustomEvent(Yh);T.dispatchEvent(O),c.isClosePausedRef.current=!1}},j=O=>{!A.contains(O.relatedTarget)&&_()},L=()=>{A.contains(document.activeElement)||_()};return A.addEventListener("focusin",N),A.addEventListener("focusout",j),A.addEventListener("pointermove",N),A.addEventListener("pointerleave",L),window.addEventListener("blur",N),window.addEventListener("focus",_),()=>{A.removeEventListener("focusin",N),A.removeEventListener("focusout",j),A.removeEventListener("pointermove",N),A.removeEventListener("pointerleave",L),window.removeEventListener("blur",N),window.removeEventListener("focus",_)}}},[E,c.isClosePausedRef]);const C=x.useCallback(({tabbingDirection:A})=>{const N=f().map(_=>{const j=_.ref.current,L=[j,...W_(j)];return A==="forwards"?L:L.reverse()});return(A==="forwards"?N.reverse():N).flat()},[f]);return x.useEffect(()=>{const A=y.current;if(A){const T=N=>{const _=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!_){const L=document.activeElement,O=N.shiftKey;if(N.target===A&&O){d.current?.focus();return}const ee=C({tabbingDirection:O?"backwards":"forwards"}),P=ee.findIndex(re=>re===L);lh(ee.slice(P+1))?N.preventDefault():O?d.current?.focus():m.current?.focus()}};return A.addEventListener("keydown",T),()=>A.removeEventListener("keydown",T)}},[f,C]),g.jsxs(C_,{ref:h,role:"region","aria-label":o.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(Kh,{ref:d,onFocusFromOutsideViewport:()=>{const A=C({tabbingDirection:"forwards"});lh(A)}}),g.jsx(zp.Slot,{scope:r,children:g.jsx(Fe.ol,{tabIndex:-1,...s,ref:b})}),E&&g.jsx(Kh,{ref:m,onFocusFromOutsideViewport:()=>{const A=C({tabbingDirection:"backwards"});lh(A)}})]})});u1.displayName=s1;var c1="ToastFocusProxy",Kh=x.forwardRef((e,n)=>{const{__scopeToast:r,onFocusFromOutsideViewport:i,...o}=e,s=xc(c1,r);return g.jsx(vc,{tabIndex:0,...o,ref:n,style:{position:"fixed"},onFocus:c=>{const f=c.relatedTarget;!s.viewport?.contains(f)&&i()}})});Kh.displayName=c1;var Qo="Toast",B_="toast.swipeStart",H_="toast.swipeMove",F_="toast.swipeCancel",q_="toast.swipeEnd",f1=x.forwardRef((e,n)=>{const{forceMount:r,open:i,defaultOpen:o,onOpenChange:s,...c}=e,[f,h]=pl({prop:i,defaultProp:o??!0,onChange:s,caller:Qo});return g.jsx(qt,{present:r||f,children:g.jsx(G_,{open:f,...c,ref:n,onClose:()=>h(!1),onPause:kt(e.onPause),onResume:kt(e.onResume),onSwipeStart:me(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,d=>{const{x:m,y}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${y}px`)}),onSwipeCancel:me(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,d=>{const{x:m,y}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${y}px`),h(!1)})})})});f1.displayName=Qo;var[V_,$_]=l1(Qo,{onClose(){}}),G_=x.forwardRef((e,n)=>{const{__scopeToast:r,type:i="foreground",duration:o,open:s,onClose:c,onEscapeKeyDown:f,onPause:h,onResume:d,onSwipeStart:m,onSwipeMove:y,onSwipeCancel:b,onSwipeEnd:w,...E}=e,C=xc(Qo,r),[A,T]=x.useState(null),N=Qe(n,q=>T(q)),_=x.useRef(null),j=x.useRef(null),L=o||C.duration,O=x.useRef(0),$=x.useRef(L),G=x.useRef(0),{onToastAdd:ee,onToastRemove:P}=C,re=kt(()=>{A?.contains(document.activeElement)&&C.viewport?.focus(),c()}),Q=x.useCallback(q=>{!q||q===1/0||(window.clearTimeout(G.current),O.current=new Date().getTime(),G.current=window.setTimeout(re,q))},[re]);x.useEffect(()=>{const q=C.viewport;if(q){const le=()=>{Q($.current),d?.()},z=()=>{const K=new Date().getTime()-O.current;$.current=$.current-K,window.clearTimeout(G.current),h?.()};return q.addEventListener(Gh,z),q.addEventListener(Yh,le),()=>{q.removeEventListener(Gh,z),q.removeEventListener(Yh,le)}}},[C.viewport,L,h,d,Q]),x.useEffect(()=>{s&&!C.isClosePausedRef.current&&Q(L)},[s,L,C.isClosePausedRef,Q]),x.useEffect(()=>(ee(),()=>P()),[ee,P]);const W=x.useMemo(()=>A?v1(A):null,[A]);return C.viewport?g.jsxs(g.Fragment,{children:[W&&g.jsx(Y_,{__scopeToast:r,role:"status","aria-live":i==="foreground"?"assertive":"polite",children:W}),g.jsx(V_,{scope:r,onClose:re,children:pc.createPortal(g.jsx(zp.ItemSlot,{scope:r,children:g.jsx(k_,{asChild:!0,onEscapeKeyDown:me(f,()=>{C.isFocusedToastEscapeKeyDownRef.current||re(),C.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(Fe.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":C.swipeDirection,...E,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,q=>{q.key==="Escape"&&(f?.(q.nativeEvent),q.nativeEvent.defaultPrevented||(C.isFocusedToastEscapeKeyDownRef.current=!0,re()))}),onPointerDown:me(e.onPointerDown,q=>{q.button===0&&(_.current={x:q.clientX,y:q.clientY})}),onPointerMove:me(e.onPointerMove,q=>{if(!_.current)return;const le=q.clientX-_.current.x,z=q.clientY-_.current.y,K=!!j.current,B=["left","right"].includes(C.swipeDirection),ae=["left","up"].includes(C.swipeDirection)?Math.min:Math.max,k=B?ae(0,le):0,X=B?0:ae(0,z),oe=q.pointerType==="touch"?10:2,M={x:k,y:X},fe={originalEvent:q,delta:M};K?(j.current=M,Cu(H_,y,fe,{discrete:!1})):Xx(M,C.swipeDirection,oe)?(j.current=M,Cu(B_,m,fe,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(le)>oe||Math.abs(z)>oe)&&(_.current=null)}),onPointerUp:me(e.onPointerUp,q=>{const le=j.current,z=q.target;if(z.hasPointerCapture(q.pointerId)&&z.releasePointerCapture(q.pointerId),j.current=null,_.current=null,le){const K=q.currentTarget,B={originalEvent:q,delta:le};Xx(le,C.swipeDirection,C.swipeThreshold)?Cu(q_,w,B,{discrete:!0}):Cu(F_,b,B,{discrete:!0}),K.addEventListener("click",ae=>ae.preventDefault(),{once:!0})}})})})}),C.viewport)})]}):null}),Y_=e=>{const{__scopeToast:n,children:r,...i}=e,o=xc(Qo,n),[s,c]=x.useState(!1),[f,h]=x.useState(!1);return Q_(()=>c(!0)),x.useEffect(()=>{const d=window.setTimeout(()=>h(!0),1e3);return()=>window.clearTimeout(d)},[]),f?null:g.jsx(Xo,{asChild:!0,children:g.jsx(vc,{...i,children:s&&g.jsxs(g.Fragment,{children:[o.label," ",r]})})})},K_="ToastTitle",d1=x.forwardRef((e,n)=>{const{__scopeToast:r,...i}=e;return g.jsx(Fe.div,{...i,ref:n})});d1.displayName=K_;var X_="ToastDescription",h1=x.forwardRef((e,n)=>{const{__scopeToast:r,...i}=e;return g.jsx(Fe.div,{...i,ref:n})});h1.displayName=X_;var p1="ToastAction",m1=x.forwardRef((e,n)=>{const{altText:r,...i}=e;return r.trim()?g.jsx(y1,{altText:r,asChild:!0,children:g.jsx(Pp,{...i,ref:n})}):(console.error(`Invalid prop \`altText\` supplied to \`${p1}\`. Expected non-empty \`string\`.`),null)});m1.displayName=p1;var g1="ToastClose",Pp=x.forwardRef((e,n)=>{const{__scopeToast:r,...i}=e,o=$_(g1,r);return g.jsx(y1,{asChild:!0,children:g.jsx(Fe.button,{type:"button",...i,ref:n,onClick:me(e.onClick,o.onClose)})})});Pp.displayName=g1;var y1=x.forwardRef((e,n)=>{const{__scopeToast:r,altText:i,...o}=e;return g.jsx(Fe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...o,ref:n})});function v1(e){const n=[];return Array.from(e.childNodes).forEach(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent&&n.push(i.textContent),Z_(i)){const o=i.ariaHidden||i.hidden||i.style.display==="none",s=i.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const c=i.dataset.radixToastAnnounceAlt;c&&n.push(c)}else n.push(...v1(i))}}),n}function Cu(e,n,r,{discrete:i}){const o=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});n&&o.addEventListener(e,n,{once:!0}),i?Op(o,s):o.dispatchEvent(s)}var Xx=(e,n,r=0)=>{const i=Math.abs(e.x),o=Math.abs(e.y),s=i>o;return n==="left"||n==="right"?s&&i>r:!s&&o>r};function Q_(e=()=>{}){const n=kt(e);cr(()=>{let r=0,i=0;return r=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(n)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(i)}},[n])}function Z_(e){return e.nodeType===e.ELEMENT_NODE}function W_(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function lh(e){const n=document.activeElement;return e.some(r=>r===n?!0:(r.focus(),document.activeElement!==n))}var J_=o1,x1=u1,b1=f1,w1=d1,S1=h1,E1=m1,k1=Pp;function C1(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(r=C1(e[n]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function A1(){for(var e,n,r=0,i="",o=arguments.length;r<o;r++)(e=arguments[r])&&(n=C1(e))&&(i&&(i+=" "),i+=n);return i}const Qx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zx=A1,bc=(e,n)=>r=>{var i;if(n?.variants==null)return Zx(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=n,c=Object.keys(o).map(d=>{const m=r?.[d],y=s?.[d];if(m===null)return null;const b=Qx(m)||Qx(y);return o[d][b]}),f=r&&Object.entries(r).reduce((d,m)=>{let[y,b]=m;return b===void 0||(d[y]=b),d},{}),h=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:y,className:b,...w}=m;return Object.entries(w).every(E=>{let[C,A]=E;return Array.isArray(A)?A.includes({...s,...f}[C]):{...s,...f}[C]===A})?[...d,y,b]:d},[]);return Zx(e,c,h,r?.class,r?.className)};/**
62
62
  * @license lucide-react v0.542.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
@@ -392,7 +392,7 @@ Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}
392
392
 
393
393
  If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
394
394
 
395
- For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ID="DialogDescriptionWarning",UD=({contentRef:e,descriptionId:n})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ew(ID).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");n&&o&&(document.getElementById(n)||console.warn(i))},[i,e,n]),null},Gp=uw,kw=fw,Yp=hw,Zo=pw,Wo=mw,Jo=yw,es=xw,Ec=ww;const Cw=Gp,BD=Yp,Aw=x.forwardRef(({className:e,...n},r)=>g.jsx(Zo,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:r}));Aw.displayName=Zo.displayName;const HD=bc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kp=x.forwardRef(({side:e="right",className:n,children:r,...i},o)=>g.jsxs(BD,{children:[g.jsx(Aw,{}),g.jsxs(Wo,{ref:o,className:ce(HD({side:e}),n),...i,children:[r,g.jsxs(Ec,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(Zi,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kp.displayName=Wo.displayName;const Xp=({className:e,...n})=>g.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...n});Xp.displayName="SheetHeader";const Qp=x.forwardRef(({className:e,...n},r)=>g.jsx(Jo,{ref:r,className:ce("text-lg font-semibold text-foreground",e),...n}));Qp.displayName=Jo.displayName;const Tw=x.forwardRef(({className:e,...n},r)=>g.jsx(es,{ref:r,className:ce("text-sm text-muted-foreground",e),...n}));Tw.displayName=es.displayName;function mb({className:e,...n}){return g.jsx("div",{className:ce("animate-pulse rounded-md bg-muted",e),...n})}const FD=["top","right","bottom","left"],xa=Math.min,bn=Math.max,ec=Math.round,ju=Math.floor,ur=e=>({x:e,y:e}),qD={left:"right",right:"left",bottom:"top",top:"bottom"},VD={start:"end",end:"start"};function ep(e,n,r){return bn(e,xa(n,r))}function Ir(e,n){return typeof e=="function"?e(n):e}function Ur(e){return e.split("-")[0]}function yl(e){return e.split("-")[1]}function Zp(e){return e==="x"?"y":"x"}function Wp(e){return e==="y"?"height":"width"}const $D=new Set(["top","bottom"]);function sr(e){return $D.has(Ur(e))?"y":"x"}function Jp(e){return Zp(sr(e))}function GD(e,n,r){r===void 0&&(r=!1);const i=yl(e),o=Jp(e),s=Wp(o);let c=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(c=tc(c)),[c,tc(c)]}function YD(e){const n=tc(e);return[tp(e),n,tp(n)]}function tp(e){return e.replace(/start|end/g,n=>VD[n])}const gb=["left","right"],yb=["right","left"],KD=["top","bottom"],XD=["bottom","top"];function QD(e,n,r){switch(e){case"top":case"bottom":return r?n?yb:gb:n?gb:yb;case"left":case"right":return n?KD:XD;default:return[]}}function ZD(e,n,r,i){const o=yl(e);let s=QD(Ur(e),r==="start",i);return o&&(s=s.map(c=>c+"-"+o),n&&(s=s.concat(s.map(tp)))),s}function tc(e){return e.replace(/left|right|bottom|top/g,n=>qD[n])}function WD(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rw(e){return typeof e!="number"?WD(e):{top:e,right:e,bottom:e,left:e}}function nc(e){const{x:n,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:n,right:n+i,bottom:r+o,x:n,y:r}}function vb(e,n,r){let{reference:i,floating:o}=e;const s=sr(n),c=Jp(n),f=Wp(c),h=Ur(n),d=s==="y",m=i.x+i.width/2-o.width/2,y=i.y+i.height/2-o.height/2,b=i[f]/2-o[f]/2;let w;switch(h){case"top":w={x:m,y:i.y-o.height};break;case"bottom":w={x:m,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y};break;case"left":w={x:i.x-o.width,y};break;default:w={x:i.x,y:i.y}}switch(yl(n)){case"start":w[c]-=b*(r&&d?-1:1);break;case"end":w[c]+=b*(r&&d?-1:1);break}return w}const JD=async(e,n,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:c}=r,f=s.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(n));let d=await c.getElementRects({reference:e,floating:n,strategy:o}),{x:m,y}=vb(d,i,h),b=i,w={},E=0;for(let C=0;C<f.length;C++){const{name:A,fn:T}=f[C],{x:N,y:_,data:j,reset:L}=await T({x:m,y,initialPlacement:i,placement:b,strategy:o,middlewareData:w,rects:d,platform:c,elements:{reference:e,floating:n}});m=N??m,y=_??y,w={...w,[A]:{...w[A],...j}},L&&E<=50&&(E++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(d=L.rects===!0?await c.getElementRects({reference:e,floating:n,strategy:o}):L.rects),{x:m,y}=vb(d,b,h)),C=-1)}return{x:m,y,placement:b,strategy:o,middlewareData:w}};async function Lo(e,n){var r;n===void 0&&(n={});const{x:i,y:o,platform:s,rects:c,elements:f,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=Ir(n,e),E=Rw(w),A=f[b?y==="floating"?"reference":"floating":y],T=nc(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(A)))==null||r?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(f.floating)),boundary:d,rootBoundary:m,strategy:h})),N=y==="floating"?{x:i,y:o,width:c.floating.width,height:c.floating.height}:c.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f.floating)),j=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},L=nc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:N,offsetParent:_,strategy:h}):N);return{top:(T.top-L.top+E.top)/j.y,bottom:(L.bottom-T.bottom+E.bottom)/j.y,left:(T.left-L.left+E.left)/j.x,right:(L.right-T.right+E.right)/j.x}}const eO=e=>({name:"arrow",options:e,async fn(n){const{x:r,y:i,placement:o,rects:s,platform:c,elements:f,middlewareData:h}=n,{element:d,padding:m=0}=Ir(e,n)||{};if(d==null)return{};const y=Rw(m),b={x:r,y:i},w=Jp(o),E=Wp(w),C=await c.getDimensions(d),A=w==="y",T=A?"top":"left",N=A?"bottom":"right",_=A?"clientHeight":"clientWidth",j=s.reference[E]+s.reference[w]-b[w]-s.floating[E],L=b[w]-s.reference[w],O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let $=O?O[_]:0;(!$||!await(c.isElement==null?void 0:c.isElement(O)))&&($=f.floating[_]||s.floating[E]);const G=j/2-L/2,ee=$/2-C[E]/2-1,P=xa(y[T],ee),re=xa(y[N],ee),Q=P,W=$-C[E]-re,q=$/2-C[E]/2+G,le=ep(Q,q,W),z=!h.arrow&&yl(o)!=null&&q!==le&&s.reference[E]/2-(q<Q?P:re)-C[E]/2<0,K=z?q<Q?q-Q:q-W:0;return{[w]:b[w]+K,data:{[w]:le,centerOffset:q-le-K,...z&&{alignmentOffset:K}},reset:z}}}),tO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var r,i;const{placement:o,middlewareData:s,rects:c,initialPlacement:f,platform:h,elements:d}=n,{mainAxis:m=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:C=!0,...A}=Ir(e,n);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const T=Ur(o),N=sr(f),_=Ur(f)===f,j=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=b||(_||!C?[tc(f)]:YD(f)),O=E!=="none";!b&&O&&L.push(...ZD(f,C,E,j));const $=[f,...L],G=await Lo(n,A),ee=[];let P=((i=s.flip)==null?void 0:i.overflows)||[];if(m&&ee.push(G[T]),y){const q=GD(o,c,j);ee.push(G[q[0]],G[q[1]])}if(P=[...P,{placement:o,overflows:ee}],!ee.every(q=>q<=0)){var re,Q;const q=(((re=s.flip)==null?void 0:re.index)||0)+1,le=$[q];if(le&&(!(y==="alignment"?N!==sr(le):!1)||P.every(B=>sr(B.placement)===N?B.overflows[0]>0:!0)))return{data:{index:q,overflows:P},reset:{placement:le}};let z=(Q=P.filter(K=>K.overflows[0]<=0).sort((K,B)=>K.overflows[1]-B.overflows[1])[0])==null?void 0:Q.placement;if(!z)switch(w){case"bestFit":{var W;const K=(W=P.filter(B=>{if(O){const ae=sr(B.placement);return ae===N||ae==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ae=>ae>0).reduce((ae,k)=>ae+k,0)]).sort((B,ae)=>B[1]-ae[1])[0])==null?void 0:W[0];K&&(z=K);break}case"initialPlacement":z=f;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function xb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function bb(e){return FD.some(n=>e[n]>=0)}const nO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r}=n,{strategy:i="referenceHidden",...o}=Ir(e,n);switch(i){case"referenceHidden":{const s=await Lo(n,{...o,elementContext:"reference"}),c=xb(s,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:bb(c)}}}case"escaped":{const s=await Lo(n,{...o,altBoundary:!0}),c=xb(s,r.floating);return{data:{escapedOffsets:c,escaped:bb(c)}}}default:return{}}}}},_w=new Set(["left","top"]);async function rO(e,n){const{placement:r,platform:i,elements:o}=e,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),c=Ur(r),f=yl(r),h=sr(r)==="y",d=_w.has(c)?-1:1,m=s&&h?-1:1,y=Ir(n,e);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof E=="number"&&(w=f==="end"?E*-1:E),h?{x:w*m,y:b*d}:{x:b*d,y:w*m}}const aO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:o,y:s,placement:c,middlewareData:f}=n,h=await rO(n,e);return c===((r=f.offset)==null?void 0:r.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:o+h.x,y:s+h.y,data:{...h,placement:c}}}}},iO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:o}=n,{mainAxis:s=!0,crossAxis:c=!1,limiter:f={fn:A=>{let{x:T,y:N}=A;return{x:T,y:N}}},...h}=Ir(e,n),d={x:r,y:i},m=await Lo(n,h),y=sr(Ur(o)),b=Zp(y);let w=d[b],E=d[y];if(s){const A=b==="y"?"top":"left",T=b==="y"?"bottom":"right",N=w+m[A],_=w-m[T];w=ep(N,w,_)}if(c){const A=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=E+m[A],_=E-m[T];E=ep(N,E,_)}const C=f.fn({...n,[b]:w,[y]:E});return{...C,data:{x:C.x-r,y:C.y-i,enabled:{[b]:s,[y]:c}}}}}},lO=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:r,y:i,placement:o,rects:s,middlewareData:c}=n,{offset:f=0,mainAxis:h=!0,crossAxis:d=!0}=Ir(e,n),m={x:r,y:i},y=sr(o),b=Zp(y);let w=m[b],E=m[y];const C=Ir(f,n),A=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const _=b==="y"?"height":"width",j=s.reference[b]-s.floating[_]+A.mainAxis,L=s.reference[b]+s.reference[_]-A.mainAxis;w<j?w=j:w>L&&(w=L)}if(d){var T,N;const _=b==="y"?"width":"height",j=_w.has(Ur(o)),L=s.reference[y]-s.floating[_]+(j&&((T=c.offset)==null?void 0:T[y])||0)+(j?0:A.crossAxis),O=s.reference[y]+s.reference[_]+(j?0:((N=c.offset)==null?void 0:N[y])||0)-(j?A.crossAxis:0);E<L?E=L:E>O&&(E=O)}return{[b]:w,[y]:E}}}},oO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var r,i;const{placement:o,rects:s,platform:c,elements:f}=n,{apply:h=()=>{},...d}=Ir(e,n),m=await Lo(n,d),y=Ur(o),b=yl(o),w=sr(o)==="y",{width:E,height:C}=s.floating;let A,T;y==="top"||y==="bottom"?(A=y,T=b===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(T=y,A=b==="end"?"top":"bottom");const N=C-m.top-m.bottom,_=E-m.left-m.right,j=xa(C-m[A],N),L=xa(E-m[T],_),O=!n.middlewareData.shift;let $=j,G=L;if((r=n.middlewareData.shift)!=null&&r.enabled.x&&(G=_),(i=n.middlewareData.shift)!=null&&i.enabled.y&&($=N),O&&!b){const P=bn(m.left,0),re=bn(m.right,0),Q=bn(m.top,0),W=bn(m.bottom,0);w?G=E-2*(P!==0||re!==0?P+re:bn(m.left,m.right)):$=C-2*(Q!==0||W!==0?Q+W:bn(m.top,m.bottom))}await h({...n,availableWidth:G,availableHeight:$});const ee=await c.getDimensions(f.floating);return E!==ee.width||C!==ee.height?{reset:{rects:!0}}:{}}}};function kc(){return typeof window<"u"}function vl(e){return Nw(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function dr(e){var n;return(n=(Nw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Nw(e){return kc()?e instanceof Node||e instanceof wn(e).Node:!1}function Gn(e){return kc()?e instanceof Element||e instanceof wn(e).Element:!1}function fr(e){return kc()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function wb(e){return!kc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}const sO=new Set(["inline","contents"]);function ts(e){const{overflow:n,overflowX:r,overflowY:i,display:o}=Yn(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!sO.has(o)}const uO=new Set(["table","td","th"]);function cO(e){return uO.has(vl(e))}const fO=[":popover-open",":modal"];function Cc(e){return fO.some(n=>{try{return e.matches(n)}catch{return!1}})}const dO=["transform","translate","scale","rotate","perspective"],hO=["transform","translate","scale","rotate","perspective","filter"],pO=["paint","layout","strict","content"];function em(e){const n=tm(),r=Gn(e)?Yn(e):e;return dO.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!n&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!n&&(r.filter?r.filter!=="none":!1)||hO.some(i=>(r.willChange||"").includes(i))||pO.some(i=>(r.contain||"").includes(i))}function mO(e){let n=ba(e);for(;fr(n)&&!rl(n);){if(em(n))return n;if(Cc(n))return null;n=ba(n)}return null}function tm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gO=new Set(["html","body","#document"]);function rl(e){return gO.has(vl(e))}function Yn(e){return wn(e).getComputedStyle(e)}function Ac(e){return Gn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ba(e){if(vl(e)==="html")return e;const n=e.assignedSlot||e.parentNode||wb(e)&&e.host||dr(e);return wb(n)?n.host:n}function Mw(e){const n=ba(e);return rl(n)?e.ownerDocument?e.ownerDocument.body:e.body:fr(n)&&ts(n)?n:Mw(n)}function zo(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=Mw(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),c=wn(o);if(s){const f=np(c);return n.concat(c,c.visualViewport||[],ts(o)?o:[],f&&r?zo(f):[])}return n.concat(o,zo(o,[],r))}function np(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jw(e){const n=Yn(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=fr(e),s=o?e.offsetWidth:r,c=o?e.offsetHeight:i,f=ec(r)!==s||ec(i)!==c;return f&&(r=s,i=c),{width:r,height:i,$:f}}function nm(e){return Gn(e)?e:e.contextElement}function Ji(e){const n=nm(e);if(!fr(n))return ur(1);const r=n.getBoundingClientRect(),{width:i,height:o,$:s}=jw(n);let c=(s?ec(r.width):r.width)/i,f=(s?ec(r.height):r.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const yO=ur(0);function Dw(e){const n=wn(e);return!tm()||!n.visualViewport?yO:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function vO(e,n,r){return n===void 0&&(n=!1),!r||n&&r!==wn(e)?!1:n}function Ka(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=nm(e);let c=ur(1);n&&(i?Gn(i)&&(c=Ji(i)):c=Ji(e));const f=vO(s,r,i)?Dw(s):ur(0);let h=(o.left+f.x)/c.x,d=(o.top+f.y)/c.y,m=o.width/c.x,y=o.height/c.y;if(s){const b=wn(s),w=i&&Gn(i)?wn(i):i;let E=b,C=np(E);for(;C&&i&&w!==E;){const A=Ji(C),T=C.getBoundingClientRect(),N=Yn(C),_=T.left+(C.clientLeft+parseFloat(N.paddingLeft))*A.x,j=T.top+(C.clientTop+parseFloat(N.paddingTop))*A.y;h*=A.x,d*=A.y,m*=A.x,y*=A.y,h+=_,d+=j,E=wn(C),C=np(E)}}return nc({width:m,height:y,x:h,y:d})}function Tc(e,n){const r=Ac(e).scrollLeft;return n?n.left+r:Ka(dr(e)).left+r}function Ow(e,n){const r=e.getBoundingClientRect(),i=r.left+n.scrollLeft-Tc(e,r),o=r.top+n.scrollTop;return{x:i,y:o}}function xO(e){let{elements:n,rect:r,offsetParent:i,strategy:o}=e;const s=o==="fixed",c=dr(i),f=n?Cc(n.floating):!1;if(i===c||f&&s)return r;let h={scrollLeft:0,scrollTop:0},d=ur(1);const m=ur(0),y=fr(i);if((y||!y&&!s)&&((vl(i)!=="body"||ts(c))&&(h=Ac(i)),fr(i))){const w=Ka(i);d=Ji(i),m.x=w.x+i.clientLeft,m.y=w.y+i.clientTop}const b=c&&!y&&!s?Ow(c,h):ur(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-h.scrollLeft*d.x+m.x+b.x,y:r.y*d.y-h.scrollTop*d.y+m.y+b.y}}function bO(e){return Array.from(e.getClientRects())}function wO(e){const n=dr(e),r=Ac(e),i=e.ownerDocument.body,o=bn(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),s=bn(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let c=-r.scrollLeft+Tc(e);const f=-r.scrollTop;return Yn(i).direction==="rtl"&&(c+=bn(n.clientWidth,i.clientWidth)-o),{width:o,height:s,x:c,y:f}}const Sb=25;function SO(e,n){const r=wn(e),i=dr(e),o=r.visualViewport;let s=i.clientWidth,c=i.clientHeight,f=0,h=0;if(o){s=o.width,c=o.height;const m=tm();(!m||m&&n==="fixed")&&(f=o.offsetLeft,h=o.offsetTop)}const d=Tc(i);if(d<=0){const m=i.ownerDocument,y=m.body,b=getComputedStyle(y),w=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(i.clientWidth-y.clientWidth-w);E<=Sb&&(s-=E)}else d<=Sb&&(s+=d);return{width:s,height:c,x:f,y:h}}const EO=new Set(["absolute","fixed"]);function kO(e,n){const r=Ka(e,!0,n==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,s=fr(e)?Ji(e):ur(1),c=e.clientWidth*s.x,f=e.clientHeight*s.y,h=o*s.x,d=i*s.y;return{width:c,height:f,x:h,y:d}}function Eb(e,n,r){let i;if(n==="viewport")i=SO(e,r);else if(n==="document")i=wO(dr(e));else if(Gn(n))i=kO(n,r);else{const o=Dw(e);i={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return nc(i)}function Lw(e,n){const r=ba(e);return r===n||!Gn(r)||rl(r)?!1:Yn(r).position==="fixed"||Lw(r,n)}function CO(e,n){const r=n.get(e);if(r)return r;let i=zo(e,[],!1).filter(f=>Gn(f)&&vl(f)!=="body"),o=null;const s=Yn(e).position==="fixed";let c=s?ba(e):e;for(;Gn(c)&&!rl(c);){const f=Yn(c),h=em(c);!h&&f.position==="fixed"&&(o=null),(s?!h&&!o:!h&&f.position==="static"&&!!o&&EO.has(o.position)||ts(c)&&!h&&Lw(e,c))?i=i.filter(m=>m!==c):o=f,c=ba(c)}return n.set(e,i),i}function AO(e){let{element:n,boundary:r,rootBoundary:i,strategy:o}=e;const c=[...r==="clippingAncestors"?Cc(n)?[]:CO(n,this._c):[].concat(r),i],f=c[0],h=c.reduce((d,m)=>{const y=Eb(n,m,o);return d.top=bn(y.top,d.top),d.right=xa(y.right,d.right),d.bottom=xa(y.bottom,d.bottom),d.left=bn(y.left,d.left),d},Eb(n,f,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function TO(e){const{width:n,height:r}=jw(e);return{width:n,height:r}}function RO(e,n,r){const i=fr(n),o=dr(n),s=r==="fixed",c=Ka(e,!0,s,n);let f={scrollLeft:0,scrollTop:0};const h=ur(0);function d(){h.x=Tc(o)}if(i||!i&&!s)if((vl(n)!=="body"||ts(o))&&(f=Ac(n)),i){const w=Ka(n,!0,s,n);h.x=w.x+n.clientLeft,h.y=w.y+n.clientTop}else o&&d();s&&!i&&o&&d();const m=o&&!i&&!s?Ow(o,f):ur(0),y=c.left+f.scrollLeft-h.x-m.x,b=c.top+f.scrollTop-h.y-m.y;return{x:y,y:b,width:c.width,height:c.height}}function vh(e){return Yn(e).position==="static"}function kb(e,n){if(!fr(e)||Yn(e).position==="fixed")return null;if(n)return n(e);let r=e.offsetParent;return dr(e)===r&&(r=r.ownerDocument.body),r}function zw(e,n){const r=wn(e);if(Cc(e))return r;if(!fr(e)){let o=ba(e);for(;o&&!rl(o);){if(Gn(o)&&!vh(o))return o;o=ba(o)}return r}let i=kb(e,n);for(;i&&cO(i)&&vh(i);)i=kb(i,n);return i&&rl(i)&&vh(i)&&!em(i)?r:i||mO(e)||r}const _O=async function(e){const n=this.getOffsetParent||zw,r=this.getDimensions,i=await r(e.floating);return{reference:RO(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function NO(e){return Yn(e).direction==="rtl"}const MO={convertOffsetParentRelativeRectToViewportRelativeRect:xO,getDocumentElement:dr,getClippingRect:AO,getOffsetParent:zw,getElementRects:_O,getClientRects:bO,getDimensions:TO,getScale:Ji,isElement:Gn,isRTL:NO};function Pw(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function jO(e,n){let r=null,i;const o=dr(e);function s(){var f;clearTimeout(i),(f=r)==null||f.disconnect(),r=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),s();const d=e.getBoundingClientRect(),{left:m,top:y,width:b,height:w}=d;if(f||n(),!b||!w)return;const E=ju(y),C=ju(o.clientWidth-(m+b)),A=ju(o.clientHeight-(y+w)),T=ju(m),_={rootMargin:-E+"px "+-C+"px "+-A+"px "+-T+"px",threshold:bn(0,xa(1,h))||1};let j=!0;function L(O){const $=O[0].intersectionRatio;if($!==h){if(!j)return c();$?c(!1,$):i=setTimeout(()=>{c(!1,1e-7)},1e3)}$===1&&!Pw(d,e.getBoundingClientRect())&&c(),j=!1}try{r=new IntersectionObserver(L,{..._,root:o.ownerDocument})}catch{r=new IntersectionObserver(L,_)}r.observe(e)}return c(!0),s}function DO(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,d=nm(e),m=o||s?[...d?zo(d):[],...zo(n)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",r,{passive:!0}),s&&T.addEventListener("resize",r)});const y=d&&f?jO(d,r):null;let b=-1,w=null;c&&(w=new ResizeObserver(T=>{let[N]=T;N&&N.target===d&&w&&(w.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=w)==null||_.observe(n)})),r()}),d&&!h&&w.observe(d),w.observe(n));let E,C=h?Ka(e):null;h&&A();function A(){const T=Ka(e);C&&!Pw(C,T)&&r(),C=T,E=requestAnimationFrame(A)}return r(),()=>{var T;m.forEach(N=>{o&&N.removeEventListener("scroll",r),s&&N.removeEventListener("resize",r)}),y?.(),(T=w)==null||T.disconnect(),w=null,h&&cancelAnimationFrame(E)}}const OO=aO,LO=iO,zO=tO,PO=oO,IO=nO,Cb=eO,UO=lO,BO=(e,n,r)=>{const i=new Map,o={platform:MO,...r},s={...o.platform,_c:i};return JD(e,n,{...o,platform:s})};var HO=typeof document<"u",FO=function(){},$u=HO?x.useLayoutEffect:FO;function rc(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,i,o;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(i=r;i--!==0;)if(!rc(e[i],n[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){const s=o[i];if(!(s==="_owner"&&e.$$typeof)&&!rc(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}function Iw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ab(e,n){const r=Iw(e);return Math.round(n*r)/r}function xh(e){const n=x.useRef(e);return $u(()=>{n.current=e}),n}function qO(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:s,floating:c}={},transform:f=!0,whileElementsMounted:h,open:d}=e,[m,y]=x.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[b,w]=x.useState(i);rc(b,i)||w(i);const[E,C]=x.useState(null),[A,T]=x.useState(null),N=x.useCallback(B=>{B!==O.current&&(O.current=B,C(B))},[]),_=x.useCallback(B=>{B!==$.current&&($.current=B,T(B))},[]),j=s||E,L=c||A,O=x.useRef(null),$=x.useRef(null),G=x.useRef(m),ee=h!=null,P=xh(h),re=xh(o),Q=xh(d),W=x.useCallback(()=>{if(!O.current||!$.current)return;const B={placement:n,strategy:r,middleware:b};re.current&&(B.platform=re.current),BO(O.current,$.current,B).then(ae=>{const k={...ae,isPositioned:Q.current!==!1};q.current&&!rc(G.current,k)&&(G.current=k,pc.flushSync(()=>{y(k)}))})},[b,n,r,re,Q]);$u(()=>{d===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,y(B=>({...B,isPositioned:!1})))},[d]);const q=x.useRef(!1);$u(()=>(q.current=!0,()=>{q.current=!1}),[]),$u(()=>{if(j&&(O.current=j),L&&($.current=L),j&&L){if(P.current)return P.current(j,L,W);W()}},[j,L,W,P,ee]);const le=x.useMemo(()=>({reference:O,floating:$,setReference:N,setFloating:_}),[N,_]),z=x.useMemo(()=>({reference:j,floating:L}),[j,L]),K=x.useMemo(()=>{const B={position:r,left:0,top:0};if(!z.floating)return B;const ae=Ab(z.floating,m.x),k=Ab(z.floating,m.y);return f?{...B,transform:"translate("+ae+"px, "+k+"px)",...Iw(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ae,top:k}},[r,f,z.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:W,refs:le,elements:z,floatingStyles:K}),[m,W,le,z,K])}const VO=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:o}=typeof e=="function"?e(r):e;return i&&n(i)?i.current!=null?Cb({element:i.current,padding:o}).fn(r):{}:i?Cb({element:i,padding:o}).fn(r):{}}}},$O=(e,n)=>({...OO(e),options:[e,n]}),GO=(e,n)=>({...LO(e),options:[e,n]}),YO=(e,n)=>({...UO(e),options:[e,n]}),KO=(e,n)=>({...zO(e),options:[e,n]}),XO=(e,n)=>({...PO(e),options:[e,n]}),QO=(e,n)=>({...IO(e),options:[e,n]}),ZO=(e,n)=>({...VO(e),options:[e,n]});var WO="Arrow",Uw=x.forwardRef((e,n)=>{const{children:r,width:i=10,height:o=5,...s}=e;return g.jsx(Fe.svg,{...s,ref:n,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Uw.displayName=WO;var JO=Uw;function Bw(e){const[n,r]=x.useState(void 0);return cr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,f;if("borderBoxSize"in s){const h=s.borderBoxSize,d=Array.isArray(h)?h[0]:h;c=d.inlineSize,f=d.blockSize}else c=e.offsetWidth,f=e.offsetHeight;r({width:c,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),n}var rm="Popper",[Hw,Rc]=Xn(rm),[e4,Fw]=Hw(rm),qw=e=>{const{__scopePopper:n,children:r}=e,[i,o]=x.useState(null);return g.jsx(e4,{scope:n,anchor:i,onAnchorChange:o,children:r})};qw.displayName=rm;var Vw="PopperAnchor",$w=x.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:i,...o}=e,s=Fw(Vw,r),c=x.useRef(null),f=Qe(n,c),h=x.useRef(null);return x.useEffect(()=>{const d=h.current;h.current=i?.current||c.current,d!==h.current&&s.onAnchorChange(h.current)}),i?null:g.jsx(Fe.div,{...o,ref:f})});$w.displayName=Vw;var am="PopperContent",[t4,n4]=Hw(am),Gw=x.forwardRef((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:w="optimized",onPlaced:E,...C}=e,A=Fw(am,r),[T,N]=x.useState(null),_=Qe(n,xe=>N(xe)),[j,L]=x.useState(null),O=Bw(j),$=O?.width??0,G=O?.height??0,ee=i+(s!=="center"?"-"+s:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},re=Array.isArray(d)?d:[d],Q=re.length>0,W={padding:P,boundary:re.filter(a4),altBoundary:Q},{refs:q,floatingStyles:le,placement:z,isPositioned:K,middlewareData:B}=qO({strategy:"fixed",placement:ee,whileElementsMounted:(...xe)=>DO(...xe,{animationFrame:w==="always"}),elements:{reference:A.anchor},middleware:[$O({mainAxis:o+G,alignmentAxis:c}),h&&GO({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?YO():void 0,...W}),h&&KO({...W}),XO({...W,apply:({elements:xe,rects:De,availableWidth:lt,availableHeight:Ze})=>{const{width:dt,height:$t}=De.reference,un=xe.floating.style;un.setProperty("--radix-popper-available-width",`${lt}px`),un.setProperty("--radix-popper-available-height",`${Ze}px`),un.setProperty("--radix-popper-anchor-width",`${dt}px`),un.setProperty("--radix-popper-anchor-height",`${$t}px`)}}),j&&ZO({element:j,padding:f}),i4({arrowWidth:$,arrowHeight:G}),b&&QO({strategy:"referenceHidden",...W})]}),[ae,k]=Xw(z),X=kt(E);cr(()=>{K&&X?.()},[K,X]);const oe=B.arrow?.x,M=B.arrow?.y,fe=B.arrow?.centerOffset!==0,[Ce,de]=x.useState();return cr(()=>{T&&de(window.getComputedStyle(T).zIndex)},[T]),g.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:K?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ce,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(t4,{scope:r,placedSide:ae,onArrowChange:L,arrowX:oe,arrowY:M,shouldHideArrow:fe,children:g.jsx(Fe.div,{"data-side":ae,"data-align":k,...C,ref:_,style:{...C.style,animation:K?void 0:"none"}})})})});Gw.displayName=am;var Yw="PopperArrow",r4={top:"bottom",right:"left",bottom:"top",left:"right"},Kw=x.forwardRef(function(n,r){const{__scopePopper:i,...o}=n,s=n4(Yw,i),c=r4[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(JO,{...o,ref:r,style:{...o.style,display:"block"}})})});Kw.displayName=Yw;function a4(e){return e!==null}var i4=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:i,middlewareData:o}=n,c=o.arrow?.centerOffset!==0,f=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[d,m]=Xw(r),y={start:"0%",center:"50%",end:"100%"}[m],b=(o.arrow?.x??0)+f/2,w=(o.arrow?.y??0)+h/2;let E="",C="";return d==="bottom"?(E=c?y:`${b}px`,C=`${-h}px`):d==="top"?(E=c?y:`${b}px`,C=`${i.floating.height+h}px`):d==="right"?(E=`${-h}px`,C=c?y:`${w}px`):d==="left"&&(E=`${i.floating.width+h}px`,C=c?y:`${w}px`),{data:{x:E,y:C}}}});function Xw(e){const[n,r="center"]=e.split("-");return[n,r]}var Qw=qw,Zw=$w,Ww=Gw,Jw=Kw,[_c,aB]=Xn("Tooltip",[Rc]),Nc=Rc(),eS="TooltipProvider",l4=700,rp="tooltip.open",[o4,im]=_c(eS),tS=e=>{const{__scopeTooltip:n,delayDuration:r=l4,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=x.useRef(!0),f=x.useRef(!1),h=x.useRef(0);return x.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),g.jsx(o4,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,i)},[i]),isPointerInTransitRef:f,onPointerInTransitChange:x.useCallback(d=>{f.current=d},[]),disableHoverableContent:o,children:s})};tS.displayName=eS;var Po="Tooltip",[s4,ns]=_c(Po),nS=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:f}=e,h=im(Po,e.__scopeTooltip),d=Nc(n),[m,y]=x.useState(null),b=Ga(),w=x.useRef(0),E=c??h.disableHoverableContent,C=f??h.delayDuration,A=x.useRef(!1),[T,N]=pl({prop:i,defaultProp:o??!1,onChange:$=>{$?(h.onOpen(),document.dispatchEvent(new CustomEvent(rp))):h.onClose(),s?.($)},caller:Po}),_=x.useMemo(()=>T?A.current?"delayed-open":"instant-open":"closed",[T]),j=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,A.current=!1,N(!0)},[N]),L=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,N(!1)},[N]),O=x.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{A.current=!0,N(!0),w.current=0},C)},[C,N]);return x.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),g.jsx(Qw,{...d,children:g.jsx(s4,{scope:n,contentId:b,open:T,stateAttribute:_,trigger:m,onTriggerChange:y,onTriggerEnter:x.useCallback(()=>{h.isOpenDelayedRef.current?O():j()},[h.isOpenDelayedRef,O,j]),onTriggerLeave:x.useCallback(()=>{E?L():(window.clearTimeout(w.current),w.current=0)},[L,E]),onOpen:j,onClose:L,disableHoverableContent:E,children:r})})};nS.displayName=Po;var ap="TooltipTrigger",rS=x.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=ns(ap,r),s=im(ap,r),c=Nc(r),f=x.useRef(null),h=Qe(n,f,o.onTriggerChange),d=x.useRef(!1),m=x.useRef(!1),y=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),g.jsx(Zw,{asChild:!0,...c,children:g.jsx(Fe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:h,onPointerMove:me(e.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:me(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:me(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:me(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:me(e.onBlur,o.onClose),onClick:me(e.onClick,o.onClose)})})});rS.displayName=ap;var lm="TooltipPortal",[u4,c4]=_c(lm,{forceMount:void 0}),aS=e=>{const{__scopeTooltip:n,forceMount:r,children:i,container:o}=e,s=ns(lm,n);return g.jsx(u4,{scope:n,forceMount:r,children:g.jsx(qt,{present:r||s.open,children:g.jsx(Xo,{asChild:!0,container:o,children:i})})})};aS.displayName=lm;var al="TooltipContent",iS=x.forwardRef((e,n)=>{const r=c4(al,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...s}=e,c=ns(al,e.__scopeTooltip);return g.jsx(qt,{present:i||c.open,children:c.disableHoverableContent?g.jsx(lS,{side:o,...s,ref:n}):g.jsx(f4,{side:o,...s,ref:n})})}),f4=x.forwardRef((e,n)=>{const r=ns(al,e.__scopeTooltip),i=im(al,e.__scopeTooltip),o=x.useRef(null),s=Qe(n,o),[c,f]=x.useState(null),{trigger:h,onClose:d}=r,m=o.current,{onPointerInTransitChange:y}=i,b=x.useCallback(()=>{f(null),y(!1)},[y]),w=x.useCallback((E,C)=>{const A=E.currentTarget,T={x:E.clientX,y:E.clientY},N=m4(T,A.getBoundingClientRect()),_=g4(T,N),j=y4(C.getBoundingClientRect()),L=x4([..._,...j]);f(L),y(!0)},[y]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(h&&m){const E=A=>w(A,m),C=A=>w(A,h);return h.addEventListener("pointerleave",E),m.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",E),m.removeEventListener("pointerleave",C)}}},[h,m,w,b]),x.useEffect(()=>{if(c){const E=C=>{const A=C.target,T={x:C.clientX,y:C.clientY},N=h?.contains(A)||m?.contains(A),_=!v4(T,c);N?b():_&&(b(),d())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[h,m,c,d,b]),g.jsx(lS,{...e,ref:s})}),[d4,h4]=_c(Po,{isInside:!1}),p4=n1("TooltipContent"),lS=x.forwardRef((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...f}=e,h=ns(al,r),d=Nc(r),{onClose:m}=h;return x.useEffect(()=>(document.addEventListener(rp,m),()=>document.removeEventListener(rp,m)),[m]),x.useEffect(()=>{if(h.trigger){const y=b=>{b.target?.contains(h.trigger)&&m()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[h.trigger,m]),g.jsx(Ko,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:m,children:g.jsxs(Ww,{"data-state":h.stateAttribute,...d,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(p4,{children:i}),g.jsx(d4,{scope:r,isInside:!0,children:g.jsx(L_,{id:h.contentId,role:"tooltip",children:o||i})})]})})});iS.displayName=al;var oS="TooltipArrow",sS=x.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=Nc(r);return h4(oS,r).isInside?null:g.jsx(Jw,{...o,...i,ref:n})});sS.displayName=oS;function m4(e,n){const r=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),o=Math.abs(n.right-e.x),s=Math.abs(n.left-e.x);switch(Math.min(r,i,o,s)){case s:return"left";case o:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function g4(e,n,r=5){const i=[];switch(n){case"top":i.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":i.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":i.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":i.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return i}function y4(e){const{top:n,right:r,bottom:i,left:o}=e;return[{x:o,y:n},{x:r,y:n},{x:r,y:i},{x:o,y:i}]}function v4(e,n){const{x:r,y:i}=e;let o=!1;for(let s=0,c=n.length-1;s<n.length;c=s++){const f=n[s],h=n[c],d=f.x,m=f.y,y=h.x,b=h.y;m>i!=b>i&&r<(y-d)*(i-m)/(b-m)+d&&(o=!o)}return o}function x4(e){const n=e.slice();return n.sort((r,i)=>r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0),b4(n)}function b4(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i<e.length;i++){const o=e[i];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}n.pop();const r=[];for(let i=e.length-1;i>=0;i--){const o=e[i];for(;r.length>=2;){const s=r[r.length-1],c=r[r.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))r.pop();else break}r.push(o)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var w4=tS,S4=nS,E4=rS,iB=aS,uS=iS,lB=sS;const k4=w4,C4=S4,A4=E4,cS=x.forwardRef(({className:e,sideOffset:n=4,...r},i)=>g.jsx(uS,{ref:i,sideOffset:n,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));cS.displayName=uS.displayName;const T4="sidebar_state",R4=3600*24*7,_4="16rem",N4="18rem",M4="3rem",j4="b",fS=x.createContext(null);function Mc(){const e=x.useContext(fS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const dS=x.forwardRef(({defaultOpen:e=!0,open:n,onOpenChange:r,className:i,style:o,children:s,...c},f)=>{const h=$1(),[d,m]=x.useState(!1),[y,b]=x.useState(e),w=n??y,E=x.useCallback(N=>{const _=typeof N=="function"?N(w):N;r?r(_):b(_),document.cookie=`${T4}=${_}; path=/; max-age=${R4}`},[r,w]),C=x.useCallback(()=>h?m(N=>!N):E(N=>!N),[h,E,m]);x.useEffect(()=>{const N=_=>{_.key===j4&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),C())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[C]);const A=w?"expanded":"collapsed",T=x.useMemo(()=>({state:A,open:w,setOpen:E,isMobile:h,openMobile:d,setOpenMobile:m,toggleSidebar:C}),[A,w,E,h,d,m,C]);return g.jsx(fS.Provider,{value:T,children:g.jsx(k4,{delayDuration:0,children:g.jsx("div",{style:{"--sidebar-width":_4,"--sidebar-width-icon":M4,...o},className:ce("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",i),ref:f,...c,children:s})})})});dS.displayName="SidebarProvider";const hS=x.forwardRef(({side:e="left",variant:n="sidebar",collapsible:r="offcanvas",className:i,children:o,...s},c)=>{const{isMobile:f,state:h,openMobile:d,setOpenMobile:m}=Mc();return r==="none"?g.jsx("div",{className:ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",i),ref:c,...s,children:o}):f?g.jsx(Cw,{open:d,onOpenChange:m,...s,children:g.jsxs(Kp,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":N4},side:e,children:[g.jsxs(Xp,{className:"sr-only",children:[g.jsx(Qp,{children:"Sidebar"}),g.jsx(Tw,{children:"Displays the mobile sidebar."})]}),g.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):g.jsxs("div",{ref:c,className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?r:"","data-variant":n,"data-side":e,children:[g.jsx("div",{className:ce("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),g.jsx("div",{className:ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...s,children:g.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});hS.displayName="Sidebar";const pS=x.forwardRef(({className:e,onClick:n,...r},i)=>{const{toggleSidebar:o}=Mc();return g.jsxs(pt,{ref:i,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:ce("h-7 w-7",e),onClick:s=>{n?.(s),o()},...r,children:[g.jsx(cM,{}),g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});pS.displayName="SidebarTrigger";const D4=x.forwardRef(({className:e,...n},r)=>{const{toggleSidebar:i}=Mc();return g.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:ce("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...n})});D4.displayName="SidebarRail";const mS=x.forwardRef(({className:e,...n},r)=>g.jsx("main",{ref:r,className:ce("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...n}));mS.displayName="SidebarInset";const O4=x.forwardRef(({className:e,...n},r)=>g.jsx(G1,{ref:r,"data-sidebar":"input",className:ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...n}));O4.displayName="SidebarInput";const gS=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"header",className:ce("flex flex-col gap-2 p-2",e),...n}));gS.displayName="SidebarHeader";const yS=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"footer",className:ce("flex flex-col gap-2 p-2",e),...n}));yS.displayName="SidebarFooter";const L4=x.forwardRef(({className:e,...n},r)=>g.jsx(X1,{ref:r,"data-sidebar":"separator",className:ce("mx-2 w-auto bg-sidebar-border",e),...n}));L4.displayName="SidebarSeparator";const vS=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"content",className:ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n}));vS.displayName="SidebarContent";const ko=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"group",className:ce("relative flex w-full min-w-0 flex-col p-2",e),...n}));ko.displayName="SidebarGroup";const Gu=x.forwardRef(({className:e,asChild:n=!1,...r},i)=>{const o=n?hl:"div";return g.jsx(o,{ref:i,"data-sidebar":"group-label",className:ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Gu.displayName="SidebarGroupLabel";const z4=x.forwardRef(({className:e,asChild:n=!1,...r},i)=>{const o=n?hl:"button";return g.jsx(o,{ref:i,"data-sidebar":"group-action",className:ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});z4.displayName="SidebarGroupAction";const Co=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"group-content",className:ce("w-full text-sm",e),...n}));Co.displayName="SidebarGroupContent";const $a=x.forwardRef(({className:e,...n},r)=>g.jsx("ul",{ref:r,"data-sidebar":"menu",className:ce("flex w-full min-w-0 flex-col gap-1",e),...n}));$a.displayName="SidebarMenu";const ma=x.forwardRef(({className:e,...n},r)=>g.jsx("li",{ref:r,"data-sidebar":"menu-item",className:ce("group/menu-item relative",e),...n}));ma.displayName="SidebarMenuItem";const P4=bc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-active data-[active=true]:font-medium data-[active=true]:text-sidebar-active-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),ga=x.forwardRef(({asChild:e=!1,isActive:n=!1,variant:r="default",size:i="default",tooltip:o,className:s,...c},f)=>{const h=e?hl:"button",{isMobile:d,state:m}=Mc(),y=g.jsx(h,{ref:f,"data-sidebar":"menu-button","data-size":i,"data-active":n,className:ce(P4({variant:r,size:i}),s),...c});return o?(typeof o=="string"&&(o={children:o}),g.jsxs(C4,{children:[g.jsx(A4,{asChild:!0,children:y}),g.jsx(cS,{side:"right",align:"center",hidden:m!=="collapsed"||d,...o})]})):y});ga.displayName="SidebarMenuButton";const I4=x.forwardRef(({className:e,asChild:n=!1,showOnHover:r=!1,...i},o)=>{const s=n?hl:"button";return g.jsx(s,{ref:o,"data-sidebar":"menu-action",className:ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-active-foreground md:opacity-0",e),...i})});I4.displayName="SidebarMenuAction";const ip=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:ce("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-full px-1.5 text-xs font-semibold tabular-nums shadow-sm","transition-all duration-200 ease-in-out hover:scale-110","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...n}));ip.displayName="SidebarMenuBadge";const U4=x.forwardRef(({className:e,showIcon:n=!1,...r},i)=>{const o=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return g.jsxs("div",{ref:i,"data-sidebar":"menu-skeleton",className:ce("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[n&&g.jsx(mb,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),g.jsx(mb,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});U4.displayName="SidebarMenuSkeleton";const xS=x.forwardRef(({className:e,...n},r)=>g.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:ce("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...n}));xS.displayName="SidebarMenuSub";const bS=x.forwardRef(({...e},n)=>g.jsx("li",{ref:n,...e}));bS.displayName="SidebarMenuSubItem";const wS=x.forwardRef(({asChild:e=!1,size:n="md",isActive:r,className:i,...o},s)=>{const c=e?hl:"a";return g.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":n,"data-active":r,className:ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-active data-[active=true]:text-sidebar-active-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...o})});wS.displayName="SidebarMenuSubButton";const B4="1.0.77-alpha.1",H4={version:B4};function F4({className:e}){return g.jsxs("svg",{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",className:e,children:[g.jsx("path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4"}),g.jsx("path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3"}),g.jsx("path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35"}),g.jsx("path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14"})]})}function Fa(e,n){if(n==="/")return e==="/";const r=e.match(/^\/terminal\/([^/]+)/);if(r){const i=r[1];if(n==="/agents")return i.startsWith("cp-")||i.startsWith("sk-");if(n==="/terminal")return!i.startsWith("cp-")&&!i.startsWith("sk-")}return e===n||e.startsWith(n+"/")}const q4=[{title:"Home",url:"/",icon:FN},{title:"Tasks",url:"/tasks",icon:AM},{title:"Skills",url:"/skills",icon:GM},{title:"Mail",url:"/mail",icon:tM}],V4=[{title:"Agents",url:"/agents",icon:Ro},{title:"Jobs",url:"/schedule",icon:hN},{title:"Utilities",url:"/utilities",icon:Xh}],$4=[{title:"Knowledge",url:"/knowledge",icon:Zu},{title:"Resources",url:"/resources",icon:ON}],Tb=[{title:"Role",url:"/context/role",icon:IM},{title:"Agents",url:"/context/agents",icon:kN},{title:"Team",url:"/context/team",icon:FM},{title:"Memory",url:"/context/memory",icon:fN}],G4=[{title:"Source Control",url:"/git",icon:R1},{title:"Terminal",url:"/terminal",icon:jM},{title:"Identity",url:"/identity",icon:VN},{title:"Activity",url:"/activity",icon:lN}],Y4=[{title:"Documentation",url:"https://docs.coconut.dev/studio",icon:sM,external:!0},{title:"Settings",url:"/settings/user",icon:xM}];function K4(){const{badges:e}=n_(),n=on(),[r,i]=x.useState(!1);return x.useEffect(()=>{Tb.some(s=>Fa(n.pathname,s.url))&&i(!0)},[n.pathname]),g.jsxs(hS,{className:"bg-sidebar border-r border-sidebar-border",children:[g.jsx(gS,{children:g.jsx($a,{children:g.jsx(ma,{children:g.jsx(ga,{size:"lg",asChild:!0,className:"[&>svg]:!size-8",children:g.jsxs(Vn,{to:"/",children:[g.jsx(F4,{className:"size-8"}),g.jsxs("div",{className:"flex flex-col gap-0.5",children:[g.jsxs("span",{className:"font-semibold",children:[g.jsx("span",{className:"bg-gradient-to-r from-amber-500 via-orange-500 to-yellow-600 bg-clip-text text-transparent",children:"Coconut"}),g.jsx("span",{children:" Studio"})]}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",H4.version]})]})]})})})})}),g.jsxs(vS,{children:[g.jsx(ko,{children:g.jsx(Co,{children:g.jsx($a,{children:q4.map(o=>g.jsx(ma,{children:g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title))})})}),g.jsxs(ko,{children:[g.jsx(Gu,{children:"Work"}),g.jsx(Co,{children:g.jsx($a,{children:V4.map(o=>{let s=0;return o.title==="Agents"&&e.codeSessions>0?s=e.codeSessions:o.title==="Jobs"&&e.runningScheduledJobs>0&&(s=e.runningScheduledJobs),g.jsxs(ma,{children:[g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})}),s>0&&g.jsx(ip,{className:"bg-blue-600 text-white dark:bg-blue-500",children:s})]},o.title)})})})]}),g.jsxs(ko,{children:[g.jsx(Gu,{children:"Assets"}),g.jsx(Co,{children:g.jsxs($a,{children:[$4.map(o=>g.jsx(ma,{children:g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title)),g.jsxs(ma,{children:[g.jsxs(ga,{onClick:()=>i(o=>!o),"data-state":r?"open":"closed",className:"w-full",children:[g.jsx(zN,{}),g.jsx("span",{children:"Context"}),g.jsx(vN,{className:`ml-auto size-4 shrink-0 transition-transform duration-200 ${r?"rotate-180":""}`})]}),r&&g.jsx(xS,{children:Tb.map(o=>g.jsx(bS,{children:g.jsx(wS,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title))})]})]})})]}),g.jsxs(ko,{children:[g.jsx(Gu,{children:"System"}),g.jsx(Co,{children:g.jsx($a,{children:G4.map(o=>{let s=0;return o.title==="Source Control"&&e.gitChanges>0?s=e.gitChanges:o.title==="Terminal"&&e.terminalSessions>0&&(s=e.terminalSessions),g.jsxs(ma,{children:[g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})}),s>0&&g.jsx(ip,{className:"bg-blue-600 text-white dark:bg-blue-500",children:s})]},o.title)})})})]})]}),g.jsx(yS,{children:g.jsx($a,{children:Y4.map(o=>g.jsx(ma,{children:g.jsx(ga,{asChild:!0,isActive:!o.external&&Fa(n.pathname,o.url==="/settings/user"?"/settings":o.url),children:o.external?g.jsxs("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]}):g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title))})})]})}function X4(e){const n=e.match(/\bres-\d+-[a-z0-9]+\b/g);return n?[...new Set(n)]:[]}const Io=Gp,oB=kw,Q4=Yp,SS=x.forwardRef(({className:e,...n},r)=>g.jsx(Zo,{ref:r,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));SS.displayName=Zo.displayName;const il=x.forwardRef(({className:e,children:n,...r},i)=>g.jsxs(Q4,{children:[g.jsx(SS,{}),g.jsxs(Wo,{ref:i,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[n,g.jsxs(Ec,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx(Zi,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));il.displayName=Wo.displayName;const ll=({className:e,...n})=>g.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});ll.displayName="DialogHeader";const ES=({className:e,...n})=>g.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});ES.displayName="DialogFooter";const ol=x.forwardRef(({className:e,...n},r)=>g.jsx(Jo,{ref:r,className:ce("text-lg font-semibold leading-none tracking-tight",e),...n}));ol.displayName=Jo.displayName;const Qi=x.forwardRef(({className:e,...n},r)=>g.jsx(es,{ref:r,className:ce("text-sm text-muted-foreground",e),...n}));Qi.displayName=es.displayName;function bh({className:e,...n}){return g.jsx("kbd",{"data-slot":"kbd",className:ce("inline-flex h-5 items-center justify-center rounded border border-muted-foreground/30 bg-muted/50 px-1.5 font-sans text-[11px] font-medium text-muted-foreground shadow-sm",e),...n})}function sB({className:e,...n}){return g.jsx("span",{"data-slot":"kbd-group",className:ce("inline-flex items-center gap-0.5",e),...n})}function uB(){}function Z4(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const W4=/[$_\p{ID_Start}]/u,J4=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,eL=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,tL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kS={};function cB(e){return e?W4.test(String.fromCodePoint(e)):!1}function fB(e,n){const i=(n||kS).jsx?eL:J4;return e?i.test(String.fromCodePoint(e)):!1}function Rb(e,n){return(kS.jsx?nL:tL).test(e)}const rL=/[ \t\n\f\r]/g;function aL(e){return typeof e=="object"?e.type==="text"?_b(e.value):!1:_b(e)}function _b(e){return e.replace(rL,"")===""}class rs{constructor(n,r,i){this.normal=r,this.property=n,i&&(this.space=i)}}rs.prototype.normal={};rs.prototype.property={};rs.prototype.space=void 0;function CS(e,n){const r={},i={};for(const o of e)Object.assign(r,o.property),Object.assign(i,o.normal);return new rs(r,i,n)}function lp(e){return e.toLowerCase()}class sn{constructor(n,r){this.attribute=r,this.property=n}}sn.prototype.attribute="";sn.prototype.booleanish=!1;sn.prototype.boolean=!1;sn.prototype.commaOrSpaceSeparated=!1;sn.prototype.commaSeparated=!1;sn.prototype.defined=!1;sn.prototype.mustUseProperty=!1;sn.prototype.number=!1;sn.prototype.overloadedBoolean=!1;sn.prototype.property="";sn.prototype.spaceSeparated=!1;sn.prototype.space=void 0;let iL=0;const Le=Qa(),St=Qa(),op=Qa(),ue=Qa(),ut=Qa(),el=Qa(),xn=Qa();function Qa(){return 2**++iL}const sp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:St,commaOrSpaceSeparated:xn,commaSeparated:el,number:ue,overloadedBoolean:op,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),wh=Object.keys(sp);class om extends sn{constructor(n,r,i,o){let s=-1;if(super(n,r),Nb(this,"space",o),typeof i=="number")for(;++s<wh.length;){const c=wh[s];Nb(this,wh[s],(i&sp[c])===sp[c])}}}om.prototype.defined=!0;function Nb(e,n,r){r&&(e[n]=r)}function xl(e){const n={},r={};for(const[i,o]of Object.entries(e.properties)){const s=new om(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),n[i]=s,r[lp(i)]=i,r[lp(s.attribute)]=i}return new rs(n,r,e.space)}const AS=xl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:St,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:ut,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:ue,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:ut,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:St,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function TS(e,n){return n in e?e[n]:n}function RS(e,n){return TS(e,n.toLowerCase())}const lL=xl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:el,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:ut,autoFocus:Le,autoPlay:Le,blocking:ut,capture:null,charSet:null,checked:Le,cite:null,className:ut,cols:ue,colSpan:null,content:null,contentEditable:St,controls:Le,controlsList:ut,coords:ue|el,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:op,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:ut,height:ue,hidden:op,high:ue,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:ut,itemRef:ut,itemScope:Le,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:ue,pattern:null,ping:ut,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:ut,required:Le,reversed:Le,rows:ue,rowSpan:ue,sandbox:ut,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:St,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:RS}),oL=xl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:ut,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:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:el,g2:el,glyphName:el,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xn,rev:xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xn,requiredFeatures:xn,requiredFonts:xn,requiredFormats:xn,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:TS}),_S=xl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),NS=xl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:RS}),MS=xl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),sL={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"},uL=/[A-Z]/g,Mb=/-[a-z]/g,cL=/^data[-\w.:]+$/i;function fL(e,n){const r=lp(n);let i=n,o=sn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&cL.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(Mb,hL);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!Mb.test(s)){let c=s.replace(uL,dL);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}o=om}return new o(i,n)}function dL(e){return"-"+e.toLowerCase()}function hL(e){return e.charAt(1).toUpperCase()}const pL=CS([AS,lL,_S,NS,MS],"html"),sm=CS([AS,oL,_S,NS,MS],"svg");function mL(e){return e.join(" ").trim()}var Gi={},Sh,jb;function gL(){if(jb)return Sh;jb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
395
+ For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ID="DialogDescriptionWarning",UD=({contentRef:e,descriptionId:n})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ew(ID).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");n&&o&&(document.getElementById(n)||console.warn(i))},[i,e,n]),null},Gp=uw,kw=fw,Yp=hw,Zo=pw,Wo=mw,Jo=yw,es=xw,Ec=ww;const Cw=Gp,BD=Yp,Aw=x.forwardRef(({className:e,...n},r)=>g.jsx(Zo,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:r}));Aw.displayName=Zo.displayName;const HD=bc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kp=x.forwardRef(({side:e="right",className:n,children:r,...i},o)=>g.jsxs(BD,{children:[g.jsx(Aw,{}),g.jsxs(Wo,{ref:o,className:ce(HD({side:e}),n),...i,children:[r,g.jsxs(Ec,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(Zi,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kp.displayName=Wo.displayName;const Xp=({className:e,...n})=>g.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...n});Xp.displayName="SheetHeader";const Qp=x.forwardRef(({className:e,...n},r)=>g.jsx(Jo,{ref:r,className:ce("text-lg font-semibold text-foreground",e),...n}));Qp.displayName=Jo.displayName;const Tw=x.forwardRef(({className:e,...n},r)=>g.jsx(es,{ref:r,className:ce("text-sm text-muted-foreground",e),...n}));Tw.displayName=es.displayName;function mb({className:e,...n}){return g.jsx("div",{className:ce("animate-pulse rounded-md bg-muted",e),...n})}const FD=["top","right","bottom","left"],xa=Math.min,bn=Math.max,ec=Math.round,ju=Math.floor,ur=e=>({x:e,y:e}),qD={left:"right",right:"left",bottom:"top",top:"bottom"},VD={start:"end",end:"start"};function ep(e,n,r){return bn(e,xa(n,r))}function Ir(e,n){return typeof e=="function"?e(n):e}function Ur(e){return e.split("-")[0]}function yl(e){return e.split("-")[1]}function Zp(e){return e==="x"?"y":"x"}function Wp(e){return e==="y"?"height":"width"}const $D=new Set(["top","bottom"]);function sr(e){return $D.has(Ur(e))?"y":"x"}function Jp(e){return Zp(sr(e))}function GD(e,n,r){r===void 0&&(r=!1);const i=yl(e),o=Jp(e),s=Wp(o);let c=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(c=tc(c)),[c,tc(c)]}function YD(e){const n=tc(e);return[tp(e),n,tp(n)]}function tp(e){return e.replace(/start|end/g,n=>VD[n])}const gb=["left","right"],yb=["right","left"],KD=["top","bottom"],XD=["bottom","top"];function QD(e,n,r){switch(e){case"top":case"bottom":return r?n?yb:gb:n?gb:yb;case"left":case"right":return n?KD:XD;default:return[]}}function ZD(e,n,r,i){const o=yl(e);let s=QD(Ur(e),r==="start",i);return o&&(s=s.map(c=>c+"-"+o),n&&(s=s.concat(s.map(tp)))),s}function tc(e){return e.replace(/left|right|bottom|top/g,n=>qD[n])}function WD(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rw(e){return typeof e!="number"?WD(e):{top:e,right:e,bottom:e,left:e}}function nc(e){const{x:n,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:n,right:n+i,bottom:r+o,x:n,y:r}}function vb(e,n,r){let{reference:i,floating:o}=e;const s=sr(n),c=Jp(n),f=Wp(c),h=Ur(n),d=s==="y",m=i.x+i.width/2-o.width/2,y=i.y+i.height/2-o.height/2,b=i[f]/2-o[f]/2;let w;switch(h){case"top":w={x:m,y:i.y-o.height};break;case"bottom":w={x:m,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y};break;case"left":w={x:i.x-o.width,y};break;default:w={x:i.x,y:i.y}}switch(yl(n)){case"start":w[c]-=b*(r&&d?-1:1);break;case"end":w[c]+=b*(r&&d?-1:1);break}return w}const JD=async(e,n,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:c}=r,f=s.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(n));let d=await c.getElementRects({reference:e,floating:n,strategy:o}),{x:m,y}=vb(d,i,h),b=i,w={},E=0;for(let C=0;C<f.length;C++){const{name:A,fn:T}=f[C],{x:N,y:_,data:j,reset:L}=await T({x:m,y,initialPlacement:i,placement:b,strategy:o,middlewareData:w,rects:d,platform:c,elements:{reference:e,floating:n}});m=N??m,y=_??y,w={...w,[A]:{...w[A],...j}},L&&E<=50&&(E++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(d=L.rects===!0?await c.getElementRects({reference:e,floating:n,strategy:o}):L.rects),{x:m,y}=vb(d,b,h)),C=-1)}return{x:m,y,placement:b,strategy:o,middlewareData:w}};async function Lo(e,n){var r;n===void 0&&(n={});const{x:i,y:o,platform:s,rects:c,elements:f,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=Ir(n,e),E=Rw(w),A=f[b?y==="floating"?"reference":"floating":y],T=nc(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(A)))==null||r?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(f.floating)),boundary:d,rootBoundary:m,strategy:h})),N=y==="floating"?{x:i,y:o,width:c.floating.width,height:c.floating.height}:c.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f.floating)),j=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},L=nc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:N,offsetParent:_,strategy:h}):N);return{top:(T.top-L.top+E.top)/j.y,bottom:(L.bottom-T.bottom+E.bottom)/j.y,left:(T.left-L.left+E.left)/j.x,right:(L.right-T.right+E.right)/j.x}}const eO=e=>({name:"arrow",options:e,async fn(n){const{x:r,y:i,placement:o,rects:s,platform:c,elements:f,middlewareData:h}=n,{element:d,padding:m=0}=Ir(e,n)||{};if(d==null)return{};const y=Rw(m),b={x:r,y:i},w=Jp(o),E=Wp(w),C=await c.getDimensions(d),A=w==="y",T=A?"top":"left",N=A?"bottom":"right",_=A?"clientHeight":"clientWidth",j=s.reference[E]+s.reference[w]-b[w]-s.floating[E],L=b[w]-s.reference[w],O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let $=O?O[_]:0;(!$||!await(c.isElement==null?void 0:c.isElement(O)))&&($=f.floating[_]||s.floating[E]);const G=j/2-L/2,ee=$/2-C[E]/2-1,P=xa(y[T],ee),re=xa(y[N],ee),Q=P,W=$-C[E]-re,q=$/2-C[E]/2+G,le=ep(Q,q,W),z=!h.arrow&&yl(o)!=null&&q!==le&&s.reference[E]/2-(q<Q?P:re)-C[E]/2<0,K=z?q<Q?q-Q:q-W:0;return{[w]:b[w]+K,data:{[w]:le,centerOffset:q-le-K,...z&&{alignmentOffset:K}},reset:z}}}),tO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var r,i;const{placement:o,middlewareData:s,rects:c,initialPlacement:f,platform:h,elements:d}=n,{mainAxis:m=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:C=!0,...A}=Ir(e,n);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const T=Ur(o),N=sr(f),_=Ur(f)===f,j=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=b||(_||!C?[tc(f)]:YD(f)),O=E!=="none";!b&&O&&L.push(...ZD(f,C,E,j));const $=[f,...L],G=await Lo(n,A),ee=[];let P=((i=s.flip)==null?void 0:i.overflows)||[];if(m&&ee.push(G[T]),y){const q=GD(o,c,j);ee.push(G[q[0]],G[q[1]])}if(P=[...P,{placement:o,overflows:ee}],!ee.every(q=>q<=0)){var re,Q;const q=(((re=s.flip)==null?void 0:re.index)||0)+1,le=$[q];if(le&&(!(y==="alignment"?N!==sr(le):!1)||P.every(B=>sr(B.placement)===N?B.overflows[0]>0:!0)))return{data:{index:q,overflows:P},reset:{placement:le}};let z=(Q=P.filter(K=>K.overflows[0]<=0).sort((K,B)=>K.overflows[1]-B.overflows[1])[0])==null?void 0:Q.placement;if(!z)switch(w){case"bestFit":{var W;const K=(W=P.filter(B=>{if(O){const ae=sr(B.placement);return ae===N||ae==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ae=>ae>0).reduce((ae,k)=>ae+k,0)]).sort((B,ae)=>B[1]-ae[1])[0])==null?void 0:W[0];K&&(z=K);break}case"initialPlacement":z=f;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function xb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function bb(e){return FD.some(n=>e[n]>=0)}const nO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r}=n,{strategy:i="referenceHidden",...o}=Ir(e,n);switch(i){case"referenceHidden":{const s=await Lo(n,{...o,elementContext:"reference"}),c=xb(s,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:bb(c)}}}case"escaped":{const s=await Lo(n,{...o,altBoundary:!0}),c=xb(s,r.floating);return{data:{escapedOffsets:c,escaped:bb(c)}}}default:return{}}}}},_w=new Set(["left","top"]);async function rO(e,n){const{placement:r,platform:i,elements:o}=e,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),c=Ur(r),f=yl(r),h=sr(r)==="y",d=_w.has(c)?-1:1,m=s&&h?-1:1,y=Ir(n,e);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof E=="number"&&(w=f==="end"?E*-1:E),h?{x:w*m,y:b*d}:{x:b*d,y:w*m}}const aO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:o,y:s,placement:c,middlewareData:f}=n,h=await rO(n,e);return c===((r=f.offset)==null?void 0:r.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:o+h.x,y:s+h.y,data:{...h,placement:c}}}}},iO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:o}=n,{mainAxis:s=!0,crossAxis:c=!1,limiter:f={fn:A=>{let{x:T,y:N}=A;return{x:T,y:N}}},...h}=Ir(e,n),d={x:r,y:i},m=await Lo(n,h),y=sr(Ur(o)),b=Zp(y);let w=d[b],E=d[y];if(s){const A=b==="y"?"top":"left",T=b==="y"?"bottom":"right",N=w+m[A],_=w-m[T];w=ep(N,w,_)}if(c){const A=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=E+m[A],_=E-m[T];E=ep(N,E,_)}const C=f.fn({...n,[b]:w,[y]:E});return{...C,data:{x:C.x-r,y:C.y-i,enabled:{[b]:s,[y]:c}}}}}},lO=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:r,y:i,placement:o,rects:s,middlewareData:c}=n,{offset:f=0,mainAxis:h=!0,crossAxis:d=!0}=Ir(e,n),m={x:r,y:i},y=sr(o),b=Zp(y);let w=m[b],E=m[y];const C=Ir(f,n),A=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const _=b==="y"?"height":"width",j=s.reference[b]-s.floating[_]+A.mainAxis,L=s.reference[b]+s.reference[_]-A.mainAxis;w<j?w=j:w>L&&(w=L)}if(d){var T,N;const _=b==="y"?"width":"height",j=_w.has(Ur(o)),L=s.reference[y]-s.floating[_]+(j&&((T=c.offset)==null?void 0:T[y])||0)+(j?0:A.crossAxis),O=s.reference[y]+s.reference[_]+(j?0:((N=c.offset)==null?void 0:N[y])||0)-(j?A.crossAxis:0);E<L?E=L:E>O&&(E=O)}return{[b]:w,[y]:E}}}},oO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var r,i;const{placement:o,rects:s,platform:c,elements:f}=n,{apply:h=()=>{},...d}=Ir(e,n),m=await Lo(n,d),y=Ur(o),b=yl(o),w=sr(o)==="y",{width:E,height:C}=s.floating;let A,T;y==="top"||y==="bottom"?(A=y,T=b===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(T=y,A=b==="end"?"top":"bottom");const N=C-m.top-m.bottom,_=E-m.left-m.right,j=xa(C-m[A],N),L=xa(E-m[T],_),O=!n.middlewareData.shift;let $=j,G=L;if((r=n.middlewareData.shift)!=null&&r.enabled.x&&(G=_),(i=n.middlewareData.shift)!=null&&i.enabled.y&&($=N),O&&!b){const P=bn(m.left,0),re=bn(m.right,0),Q=bn(m.top,0),W=bn(m.bottom,0);w?G=E-2*(P!==0||re!==0?P+re:bn(m.left,m.right)):$=C-2*(Q!==0||W!==0?Q+W:bn(m.top,m.bottom))}await h({...n,availableWidth:G,availableHeight:$});const ee=await c.getDimensions(f.floating);return E!==ee.width||C!==ee.height?{reset:{rects:!0}}:{}}}};function kc(){return typeof window<"u"}function vl(e){return Nw(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function dr(e){var n;return(n=(Nw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Nw(e){return kc()?e instanceof Node||e instanceof wn(e).Node:!1}function Gn(e){return kc()?e instanceof Element||e instanceof wn(e).Element:!1}function fr(e){return kc()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function wb(e){return!kc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}const sO=new Set(["inline","contents"]);function ts(e){const{overflow:n,overflowX:r,overflowY:i,display:o}=Yn(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!sO.has(o)}const uO=new Set(["table","td","th"]);function cO(e){return uO.has(vl(e))}const fO=[":popover-open",":modal"];function Cc(e){return fO.some(n=>{try{return e.matches(n)}catch{return!1}})}const dO=["transform","translate","scale","rotate","perspective"],hO=["transform","translate","scale","rotate","perspective","filter"],pO=["paint","layout","strict","content"];function em(e){const n=tm(),r=Gn(e)?Yn(e):e;return dO.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!n&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!n&&(r.filter?r.filter!=="none":!1)||hO.some(i=>(r.willChange||"").includes(i))||pO.some(i=>(r.contain||"").includes(i))}function mO(e){let n=ba(e);for(;fr(n)&&!rl(n);){if(em(n))return n;if(Cc(n))return null;n=ba(n)}return null}function tm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gO=new Set(["html","body","#document"]);function rl(e){return gO.has(vl(e))}function Yn(e){return wn(e).getComputedStyle(e)}function Ac(e){return Gn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ba(e){if(vl(e)==="html")return e;const n=e.assignedSlot||e.parentNode||wb(e)&&e.host||dr(e);return wb(n)?n.host:n}function Mw(e){const n=ba(e);return rl(n)?e.ownerDocument?e.ownerDocument.body:e.body:fr(n)&&ts(n)?n:Mw(n)}function zo(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=Mw(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),c=wn(o);if(s){const f=np(c);return n.concat(c,c.visualViewport||[],ts(o)?o:[],f&&r?zo(f):[])}return n.concat(o,zo(o,[],r))}function np(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jw(e){const n=Yn(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=fr(e),s=o?e.offsetWidth:r,c=o?e.offsetHeight:i,f=ec(r)!==s||ec(i)!==c;return f&&(r=s,i=c),{width:r,height:i,$:f}}function nm(e){return Gn(e)?e:e.contextElement}function Ji(e){const n=nm(e);if(!fr(n))return ur(1);const r=n.getBoundingClientRect(),{width:i,height:o,$:s}=jw(n);let c=(s?ec(r.width):r.width)/i,f=(s?ec(r.height):r.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const yO=ur(0);function Dw(e){const n=wn(e);return!tm()||!n.visualViewport?yO:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function vO(e,n,r){return n===void 0&&(n=!1),!r||n&&r!==wn(e)?!1:n}function Ka(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=nm(e);let c=ur(1);n&&(i?Gn(i)&&(c=Ji(i)):c=Ji(e));const f=vO(s,r,i)?Dw(s):ur(0);let h=(o.left+f.x)/c.x,d=(o.top+f.y)/c.y,m=o.width/c.x,y=o.height/c.y;if(s){const b=wn(s),w=i&&Gn(i)?wn(i):i;let E=b,C=np(E);for(;C&&i&&w!==E;){const A=Ji(C),T=C.getBoundingClientRect(),N=Yn(C),_=T.left+(C.clientLeft+parseFloat(N.paddingLeft))*A.x,j=T.top+(C.clientTop+parseFloat(N.paddingTop))*A.y;h*=A.x,d*=A.y,m*=A.x,y*=A.y,h+=_,d+=j,E=wn(C),C=np(E)}}return nc({width:m,height:y,x:h,y:d})}function Tc(e,n){const r=Ac(e).scrollLeft;return n?n.left+r:Ka(dr(e)).left+r}function Ow(e,n){const r=e.getBoundingClientRect(),i=r.left+n.scrollLeft-Tc(e,r),o=r.top+n.scrollTop;return{x:i,y:o}}function xO(e){let{elements:n,rect:r,offsetParent:i,strategy:o}=e;const s=o==="fixed",c=dr(i),f=n?Cc(n.floating):!1;if(i===c||f&&s)return r;let h={scrollLeft:0,scrollTop:0},d=ur(1);const m=ur(0),y=fr(i);if((y||!y&&!s)&&((vl(i)!=="body"||ts(c))&&(h=Ac(i)),fr(i))){const w=Ka(i);d=Ji(i),m.x=w.x+i.clientLeft,m.y=w.y+i.clientTop}const b=c&&!y&&!s?Ow(c,h):ur(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-h.scrollLeft*d.x+m.x+b.x,y:r.y*d.y-h.scrollTop*d.y+m.y+b.y}}function bO(e){return Array.from(e.getClientRects())}function wO(e){const n=dr(e),r=Ac(e),i=e.ownerDocument.body,o=bn(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),s=bn(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let c=-r.scrollLeft+Tc(e);const f=-r.scrollTop;return Yn(i).direction==="rtl"&&(c+=bn(n.clientWidth,i.clientWidth)-o),{width:o,height:s,x:c,y:f}}const Sb=25;function SO(e,n){const r=wn(e),i=dr(e),o=r.visualViewport;let s=i.clientWidth,c=i.clientHeight,f=0,h=0;if(o){s=o.width,c=o.height;const m=tm();(!m||m&&n==="fixed")&&(f=o.offsetLeft,h=o.offsetTop)}const d=Tc(i);if(d<=0){const m=i.ownerDocument,y=m.body,b=getComputedStyle(y),w=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(i.clientWidth-y.clientWidth-w);E<=Sb&&(s-=E)}else d<=Sb&&(s+=d);return{width:s,height:c,x:f,y:h}}const EO=new Set(["absolute","fixed"]);function kO(e,n){const r=Ka(e,!0,n==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,s=fr(e)?Ji(e):ur(1),c=e.clientWidth*s.x,f=e.clientHeight*s.y,h=o*s.x,d=i*s.y;return{width:c,height:f,x:h,y:d}}function Eb(e,n,r){let i;if(n==="viewport")i=SO(e,r);else if(n==="document")i=wO(dr(e));else if(Gn(n))i=kO(n,r);else{const o=Dw(e);i={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return nc(i)}function Lw(e,n){const r=ba(e);return r===n||!Gn(r)||rl(r)?!1:Yn(r).position==="fixed"||Lw(r,n)}function CO(e,n){const r=n.get(e);if(r)return r;let i=zo(e,[],!1).filter(f=>Gn(f)&&vl(f)!=="body"),o=null;const s=Yn(e).position==="fixed";let c=s?ba(e):e;for(;Gn(c)&&!rl(c);){const f=Yn(c),h=em(c);!h&&f.position==="fixed"&&(o=null),(s?!h&&!o:!h&&f.position==="static"&&!!o&&EO.has(o.position)||ts(c)&&!h&&Lw(e,c))?i=i.filter(m=>m!==c):o=f,c=ba(c)}return n.set(e,i),i}function AO(e){let{element:n,boundary:r,rootBoundary:i,strategy:o}=e;const c=[...r==="clippingAncestors"?Cc(n)?[]:CO(n,this._c):[].concat(r),i],f=c[0],h=c.reduce((d,m)=>{const y=Eb(n,m,o);return d.top=bn(y.top,d.top),d.right=xa(y.right,d.right),d.bottom=xa(y.bottom,d.bottom),d.left=bn(y.left,d.left),d},Eb(n,f,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function TO(e){const{width:n,height:r}=jw(e);return{width:n,height:r}}function RO(e,n,r){const i=fr(n),o=dr(n),s=r==="fixed",c=Ka(e,!0,s,n);let f={scrollLeft:0,scrollTop:0};const h=ur(0);function d(){h.x=Tc(o)}if(i||!i&&!s)if((vl(n)!=="body"||ts(o))&&(f=Ac(n)),i){const w=Ka(n,!0,s,n);h.x=w.x+n.clientLeft,h.y=w.y+n.clientTop}else o&&d();s&&!i&&o&&d();const m=o&&!i&&!s?Ow(o,f):ur(0),y=c.left+f.scrollLeft-h.x-m.x,b=c.top+f.scrollTop-h.y-m.y;return{x:y,y:b,width:c.width,height:c.height}}function vh(e){return Yn(e).position==="static"}function kb(e,n){if(!fr(e)||Yn(e).position==="fixed")return null;if(n)return n(e);let r=e.offsetParent;return dr(e)===r&&(r=r.ownerDocument.body),r}function zw(e,n){const r=wn(e);if(Cc(e))return r;if(!fr(e)){let o=ba(e);for(;o&&!rl(o);){if(Gn(o)&&!vh(o))return o;o=ba(o)}return r}let i=kb(e,n);for(;i&&cO(i)&&vh(i);)i=kb(i,n);return i&&rl(i)&&vh(i)&&!em(i)?r:i||mO(e)||r}const _O=async function(e){const n=this.getOffsetParent||zw,r=this.getDimensions,i=await r(e.floating);return{reference:RO(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function NO(e){return Yn(e).direction==="rtl"}const MO={convertOffsetParentRelativeRectToViewportRelativeRect:xO,getDocumentElement:dr,getClippingRect:AO,getOffsetParent:zw,getElementRects:_O,getClientRects:bO,getDimensions:TO,getScale:Ji,isElement:Gn,isRTL:NO};function Pw(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function jO(e,n){let r=null,i;const o=dr(e);function s(){var f;clearTimeout(i),(f=r)==null||f.disconnect(),r=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),s();const d=e.getBoundingClientRect(),{left:m,top:y,width:b,height:w}=d;if(f||n(),!b||!w)return;const E=ju(y),C=ju(o.clientWidth-(m+b)),A=ju(o.clientHeight-(y+w)),T=ju(m),_={rootMargin:-E+"px "+-C+"px "+-A+"px "+-T+"px",threshold:bn(0,xa(1,h))||1};let j=!0;function L(O){const $=O[0].intersectionRatio;if($!==h){if(!j)return c();$?c(!1,$):i=setTimeout(()=>{c(!1,1e-7)},1e3)}$===1&&!Pw(d,e.getBoundingClientRect())&&c(),j=!1}try{r=new IntersectionObserver(L,{..._,root:o.ownerDocument})}catch{r=new IntersectionObserver(L,_)}r.observe(e)}return c(!0),s}function DO(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,d=nm(e),m=o||s?[...d?zo(d):[],...zo(n)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",r,{passive:!0}),s&&T.addEventListener("resize",r)});const y=d&&f?jO(d,r):null;let b=-1,w=null;c&&(w=new ResizeObserver(T=>{let[N]=T;N&&N.target===d&&w&&(w.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=w)==null||_.observe(n)})),r()}),d&&!h&&w.observe(d),w.observe(n));let E,C=h?Ka(e):null;h&&A();function A(){const T=Ka(e);C&&!Pw(C,T)&&r(),C=T,E=requestAnimationFrame(A)}return r(),()=>{var T;m.forEach(N=>{o&&N.removeEventListener("scroll",r),s&&N.removeEventListener("resize",r)}),y?.(),(T=w)==null||T.disconnect(),w=null,h&&cancelAnimationFrame(E)}}const OO=aO,LO=iO,zO=tO,PO=oO,IO=nO,Cb=eO,UO=lO,BO=(e,n,r)=>{const i=new Map,o={platform:MO,...r},s={...o.platform,_c:i};return JD(e,n,{...o,platform:s})};var HO=typeof document<"u",FO=function(){},$u=HO?x.useLayoutEffect:FO;function rc(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,i,o;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(i=r;i--!==0;)if(!rc(e[i],n[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){const s=o[i];if(!(s==="_owner"&&e.$$typeof)&&!rc(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}function Iw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ab(e,n){const r=Iw(e);return Math.round(n*r)/r}function xh(e){const n=x.useRef(e);return $u(()=>{n.current=e}),n}function qO(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:s,floating:c}={},transform:f=!0,whileElementsMounted:h,open:d}=e,[m,y]=x.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[b,w]=x.useState(i);rc(b,i)||w(i);const[E,C]=x.useState(null),[A,T]=x.useState(null),N=x.useCallback(B=>{B!==O.current&&(O.current=B,C(B))},[]),_=x.useCallback(B=>{B!==$.current&&($.current=B,T(B))},[]),j=s||E,L=c||A,O=x.useRef(null),$=x.useRef(null),G=x.useRef(m),ee=h!=null,P=xh(h),re=xh(o),Q=xh(d),W=x.useCallback(()=>{if(!O.current||!$.current)return;const B={placement:n,strategy:r,middleware:b};re.current&&(B.platform=re.current),BO(O.current,$.current,B).then(ae=>{const k={...ae,isPositioned:Q.current!==!1};q.current&&!rc(G.current,k)&&(G.current=k,pc.flushSync(()=>{y(k)}))})},[b,n,r,re,Q]);$u(()=>{d===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,y(B=>({...B,isPositioned:!1})))},[d]);const q=x.useRef(!1);$u(()=>(q.current=!0,()=>{q.current=!1}),[]),$u(()=>{if(j&&(O.current=j),L&&($.current=L),j&&L){if(P.current)return P.current(j,L,W);W()}},[j,L,W,P,ee]);const le=x.useMemo(()=>({reference:O,floating:$,setReference:N,setFloating:_}),[N,_]),z=x.useMemo(()=>({reference:j,floating:L}),[j,L]),K=x.useMemo(()=>{const B={position:r,left:0,top:0};if(!z.floating)return B;const ae=Ab(z.floating,m.x),k=Ab(z.floating,m.y);return f?{...B,transform:"translate("+ae+"px, "+k+"px)",...Iw(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ae,top:k}},[r,f,z.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:W,refs:le,elements:z,floatingStyles:K}),[m,W,le,z,K])}const VO=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:o}=typeof e=="function"?e(r):e;return i&&n(i)?i.current!=null?Cb({element:i.current,padding:o}).fn(r):{}:i?Cb({element:i,padding:o}).fn(r):{}}}},$O=(e,n)=>({...OO(e),options:[e,n]}),GO=(e,n)=>({...LO(e),options:[e,n]}),YO=(e,n)=>({...UO(e),options:[e,n]}),KO=(e,n)=>({...zO(e),options:[e,n]}),XO=(e,n)=>({...PO(e),options:[e,n]}),QO=(e,n)=>({...IO(e),options:[e,n]}),ZO=(e,n)=>({...VO(e),options:[e,n]});var WO="Arrow",Uw=x.forwardRef((e,n)=>{const{children:r,width:i=10,height:o=5,...s}=e;return g.jsx(Fe.svg,{...s,ref:n,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Uw.displayName=WO;var JO=Uw;function Bw(e){const[n,r]=x.useState(void 0);return cr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,f;if("borderBoxSize"in s){const h=s.borderBoxSize,d=Array.isArray(h)?h[0]:h;c=d.inlineSize,f=d.blockSize}else c=e.offsetWidth,f=e.offsetHeight;r({width:c,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),n}var rm="Popper",[Hw,Rc]=Xn(rm),[e4,Fw]=Hw(rm),qw=e=>{const{__scopePopper:n,children:r}=e,[i,o]=x.useState(null);return g.jsx(e4,{scope:n,anchor:i,onAnchorChange:o,children:r})};qw.displayName=rm;var Vw="PopperAnchor",$w=x.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:i,...o}=e,s=Fw(Vw,r),c=x.useRef(null),f=Qe(n,c),h=x.useRef(null);return x.useEffect(()=>{const d=h.current;h.current=i?.current||c.current,d!==h.current&&s.onAnchorChange(h.current)}),i?null:g.jsx(Fe.div,{...o,ref:f})});$w.displayName=Vw;var am="PopperContent",[t4,n4]=Hw(am),Gw=x.forwardRef((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:w="optimized",onPlaced:E,...C}=e,A=Fw(am,r),[T,N]=x.useState(null),_=Qe(n,xe=>N(xe)),[j,L]=x.useState(null),O=Bw(j),$=O?.width??0,G=O?.height??0,ee=i+(s!=="center"?"-"+s:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},re=Array.isArray(d)?d:[d],Q=re.length>0,W={padding:P,boundary:re.filter(a4),altBoundary:Q},{refs:q,floatingStyles:le,placement:z,isPositioned:K,middlewareData:B}=qO({strategy:"fixed",placement:ee,whileElementsMounted:(...xe)=>DO(...xe,{animationFrame:w==="always"}),elements:{reference:A.anchor},middleware:[$O({mainAxis:o+G,alignmentAxis:c}),h&&GO({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?YO():void 0,...W}),h&&KO({...W}),XO({...W,apply:({elements:xe,rects:De,availableWidth:lt,availableHeight:Ze})=>{const{width:dt,height:$t}=De.reference,un=xe.floating.style;un.setProperty("--radix-popper-available-width",`${lt}px`),un.setProperty("--radix-popper-available-height",`${Ze}px`),un.setProperty("--radix-popper-anchor-width",`${dt}px`),un.setProperty("--radix-popper-anchor-height",`${$t}px`)}}),j&&ZO({element:j,padding:f}),i4({arrowWidth:$,arrowHeight:G}),b&&QO({strategy:"referenceHidden",...W})]}),[ae,k]=Xw(z),X=kt(E);cr(()=>{K&&X?.()},[K,X]);const oe=B.arrow?.x,M=B.arrow?.y,fe=B.arrow?.centerOffset!==0,[Ce,de]=x.useState();return cr(()=>{T&&de(window.getComputedStyle(T).zIndex)},[T]),g.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:K?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ce,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(t4,{scope:r,placedSide:ae,onArrowChange:L,arrowX:oe,arrowY:M,shouldHideArrow:fe,children:g.jsx(Fe.div,{"data-side":ae,"data-align":k,...C,ref:_,style:{...C.style,animation:K?void 0:"none"}})})})});Gw.displayName=am;var Yw="PopperArrow",r4={top:"bottom",right:"left",bottom:"top",left:"right"},Kw=x.forwardRef(function(n,r){const{__scopePopper:i,...o}=n,s=n4(Yw,i),c=r4[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(JO,{...o,ref:r,style:{...o.style,display:"block"}})})});Kw.displayName=Yw;function a4(e){return e!==null}var i4=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:i,middlewareData:o}=n,c=o.arrow?.centerOffset!==0,f=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[d,m]=Xw(r),y={start:"0%",center:"50%",end:"100%"}[m],b=(o.arrow?.x??0)+f/2,w=(o.arrow?.y??0)+h/2;let E="",C="";return d==="bottom"?(E=c?y:`${b}px`,C=`${-h}px`):d==="top"?(E=c?y:`${b}px`,C=`${i.floating.height+h}px`):d==="right"?(E=`${-h}px`,C=c?y:`${w}px`):d==="left"&&(E=`${i.floating.width+h}px`,C=c?y:`${w}px`),{data:{x:E,y:C}}}});function Xw(e){const[n,r="center"]=e.split("-");return[n,r]}var Qw=qw,Zw=$w,Ww=Gw,Jw=Kw,[_c,aB]=Xn("Tooltip",[Rc]),Nc=Rc(),eS="TooltipProvider",l4=700,rp="tooltip.open",[o4,im]=_c(eS),tS=e=>{const{__scopeTooltip:n,delayDuration:r=l4,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=x.useRef(!0),f=x.useRef(!1),h=x.useRef(0);return x.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),g.jsx(o4,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,i)},[i]),isPointerInTransitRef:f,onPointerInTransitChange:x.useCallback(d=>{f.current=d},[]),disableHoverableContent:o,children:s})};tS.displayName=eS;var Po="Tooltip",[s4,ns]=_c(Po),nS=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:f}=e,h=im(Po,e.__scopeTooltip),d=Nc(n),[m,y]=x.useState(null),b=Ga(),w=x.useRef(0),E=c??h.disableHoverableContent,C=f??h.delayDuration,A=x.useRef(!1),[T,N]=pl({prop:i,defaultProp:o??!1,onChange:$=>{$?(h.onOpen(),document.dispatchEvent(new CustomEvent(rp))):h.onClose(),s?.($)},caller:Po}),_=x.useMemo(()=>T?A.current?"delayed-open":"instant-open":"closed",[T]),j=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,A.current=!1,N(!0)},[N]),L=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,N(!1)},[N]),O=x.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{A.current=!0,N(!0),w.current=0},C)},[C,N]);return x.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),g.jsx(Qw,{...d,children:g.jsx(s4,{scope:n,contentId:b,open:T,stateAttribute:_,trigger:m,onTriggerChange:y,onTriggerEnter:x.useCallback(()=>{h.isOpenDelayedRef.current?O():j()},[h.isOpenDelayedRef,O,j]),onTriggerLeave:x.useCallback(()=>{E?L():(window.clearTimeout(w.current),w.current=0)},[L,E]),onOpen:j,onClose:L,disableHoverableContent:E,children:r})})};nS.displayName=Po;var ap="TooltipTrigger",rS=x.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=ns(ap,r),s=im(ap,r),c=Nc(r),f=x.useRef(null),h=Qe(n,f,o.onTriggerChange),d=x.useRef(!1),m=x.useRef(!1),y=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),g.jsx(Zw,{asChild:!0,...c,children:g.jsx(Fe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:h,onPointerMove:me(e.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:me(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:me(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:me(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:me(e.onBlur,o.onClose),onClick:me(e.onClick,o.onClose)})})});rS.displayName=ap;var lm="TooltipPortal",[u4,c4]=_c(lm,{forceMount:void 0}),aS=e=>{const{__scopeTooltip:n,forceMount:r,children:i,container:o}=e,s=ns(lm,n);return g.jsx(u4,{scope:n,forceMount:r,children:g.jsx(qt,{present:r||s.open,children:g.jsx(Xo,{asChild:!0,container:o,children:i})})})};aS.displayName=lm;var al="TooltipContent",iS=x.forwardRef((e,n)=>{const r=c4(al,e.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...s}=e,c=ns(al,e.__scopeTooltip);return g.jsx(qt,{present:i||c.open,children:c.disableHoverableContent?g.jsx(lS,{side:o,...s,ref:n}):g.jsx(f4,{side:o,...s,ref:n})})}),f4=x.forwardRef((e,n)=>{const r=ns(al,e.__scopeTooltip),i=im(al,e.__scopeTooltip),o=x.useRef(null),s=Qe(n,o),[c,f]=x.useState(null),{trigger:h,onClose:d}=r,m=o.current,{onPointerInTransitChange:y}=i,b=x.useCallback(()=>{f(null),y(!1)},[y]),w=x.useCallback((E,C)=>{const A=E.currentTarget,T={x:E.clientX,y:E.clientY},N=m4(T,A.getBoundingClientRect()),_=g4(T,N),j=y4(C.getBoundingClientRect()),L=x4([..._,...j]);f(L),y(!0)},[y]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(h&&m){const E=A=>w(A,m),C=A=>w(A,h);return h.addEventListener("pointerleave",E),m.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",E),m.removeEventListener("pointerleave",C)}}},[h,m,w,b]),x.useEffect(()=>{if(c){const E=C=>{const A=C.target,T={x:C.clientX,y:C.clientY},N=h?.contains(A)||m?.contains(A),_=!v4(T,c);N?b():_&&(b(),d())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[h,m,c,d,b]),g.jsx(lS,{...e,ref:s})}),[d4,h4]=_c(Po,{isInside:!1}),p4=n1("TooltipContent"),lS=x.forwardRef((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...f}=e,h=ns(al,r),d=Nc(r),{onClose:m}=h;return x.useEffect(()=>(document.addEventListener(rp,m),()=>document.removeEventListener(rp,m)),[m]),x.useEffect(()=>{if(h.trigger){const y=b=>{b.target?.contains(h.trigger)&&m()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[h.trigger,m]),g.jsx(Ko,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:m,children:g.jsxs(Ww,{"data-state":h.stateAttribute,...d,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(p4,{children:i}),g.jsx(d4,{scope:r,isInside:!0,children:g.jsx(L_,{id:h.contentId,role:"tooltip",children:o||i})})]})})});iS.displayName=al;var oS="TooltipArrow",sS=x.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,o=Nc(r);return h4(oS,r).isInside?null:g.jsx(Jw,{...o,...i,ref:n})});sS.displayName=oS;function m4(e,n){const r=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),o=Math.abs(n.right-e.x),s=Math.abs(n.left-e.x);switch(Math.min(r,i,o,s)){case s:return"left";case o:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function g4(e,n,r=5){const i=[];switch(n){case"top":i.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":i.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":i.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":i.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return i}function y4(e){const{top:n,right:r,bottom:i,left:o}=e;return[{x:o,y:n},{x:r,y:n},{x:r,y:i},{x:o,y:i}]}function v4(e,n){const{x:r,y:i}=e;let o=!1;for(let s=0,c=n.length-1;s<n.length;c=s++){const f=n[s],h=n[c],d=f.x,m=f.y,y=h.x,b=h.y;m>i!=b>i&&r<(y-d)*(i-m)/(b-m)+d&&(o=!o)}return o}function x4(e){const n=e.slice();return n.sort((r,i)=>r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0),b4(n)}function b4(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i<e.length;i++){const o=e[i];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}n.pop();const r=[];for(let i=e.length-1;i>=0;i--){const o=e[i];for(;r.length>=2;){const s=r[r.length-1],c=r[r.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))r.pop();else break}r.push(o)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var w4=tS,S4=nS,E4=rS,iB=aS,uS=iS,lB=sS;const k4=w4,C4=S4,A4=E4,cS=x.forwardRef(({className:e,sideOffset:n=4,...r},i)=>g.jsx(uS,{ref:i,sideOffset:n,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));cS.displayName=uS.displayName;const T4="sidebar_state",R4=3600*24*7,_4="16rem",N4="18rem",M4="3rem",j4="b",fS=x.createContext(null);function Mc(){const e=x.useContext(fS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const dS=x.forwardRef(({defaultOpen:e=!0,open:n,onOpenChange:r,className:i,style:o,children:s,...c},f)=>{const h=$1(),[d,m]=x.useState(!1),[y,b]=x.useState(e),w=n??y,E=x.useCallback(N=>{const _=typeof N=="function"?N(w):N;r?r(_):b(_),document.cookie=`${T4}=${_}; path=/; max-age=${R4}`},[r,w]),C=x.useCallback(()=>h?m(N=>!N):E(N=>!N),[h,E,m]);x.useEffect(()=>{const N=_=>{_.key===j4&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),C())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[C]);const A=w?"expanded":"collapsed",T=x.useMemo(()=>({state:A,open:w,setOpen:E,isMobile:h,openMobile:d,setOpenMobile:m,toggleSidebar:C}),[A,w,E,h,d,m,C]);return g.jsx(fS.Provider,{value:T,children:g.jsx(k4,{delayDuration:0,children:g.jsx("div",{style:{"--sidebar-width":_4,"--sidebar-width-icon":M4,...o},className:ce("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",i),ref:f,...c,children:s})})})});dS.displayName="SidebarProvider";const hS=x.forwardRef(({side:e="left",variant:n="sidebar",collapsible:r="offcanvas",className:i,children:o,...s},c)=>{const{isMobile:f,state:h,openMobile:d,setOpenMobile:m}=Mc();return r==="none"?g.jsx("div",{className:ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",i),ref:c,...s,children:o}):f?g.jsx(Cw,{open:d,onOpenChange:m,...s,children:g.jsxs(Kp,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":N4},side:e,children:[g.jsxs(Xp,{className:"sr-only",children:[g.jsx(Qp,{children:"Sidebar"}),g.jsx(Tw,{children:"Displays the mobile sidebar."})]}),g.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):g.jsxs("div",{ref:c,className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?r:"","data-variant":n,"data-side":e,children:[g.jsx("div",{className:ce("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),g.jsx("div",{className:ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...s,children:g.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});hS.displayName="Sidebar";const pS=x.forwardRef(({className:e,onClick:n,...r},i)=>{const{toggleSidebar:o}=Mc();return g.jsxs(pt,{ref:i,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:ce("h-7 w-7",e),onClick:s=>{n?.(s),o()},...r,children:[g.jsx(cM,{}),g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});pS.displayName="SidebarTrigger";const D4=x.forwardRef(({className:e,...n},r)=>{const{toggleSidebar:i}=Mc();return g.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:ce("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...n})});D4.displayName="SidebarRail";const mS=x.forwardRef(({className:e,...n},r)=>g.jsx("main",{ref:r,className:ce("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...n}));mS.displayName="SidebarInset";const O4=x.forwardRef(({className:e,...n},r)=>g.jsx(G1,{ref:r,"data-sidebar":"input",className:ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...n}));O4.displayName="SidebarInput";const gS=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"header",className:ce("flex flex-col gap-2 p-2",e),...n}));gS.displayName="SidebarHeader";const yS=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"footer",className:ce("flex flex-col gap-2 p-2",e),...n}));yS.displayName="SidebarFooter";const L4=x.forwardRef(({className:e,...n},r)=>g.jsx(X1,{ref:r,"data-sidebar":"separator",className:ce("mx-2 w-auto bg-sidebar-border",e),...n}));L4.displayName="SidebarSeparator";const vS=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"content",className:ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n}));vS.displayName="SidebarContent";const ko=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"group",className:ce("relative flex w-full min-w-0 flex-col p-2",e),...n}));ko.displayName="SidebarGroup";const Gu=x.forwardRef(({className:e,asChild:n=!1,...r},i)=>{const o=n?hl:"div";return g.jsx(o,{ref:i,"data-sidebar":"group-label",className:ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Gu.displayName="SidebarGroupLabel";const z4=x.forwardRef(({className:e,asChild:n=!1,...r},i)=>{const o=n?hl:"button";return g.jsx(o,{ref:i,"data-sidebar":"group-action",className:ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});z4.displayName="SidebarGroupAction";const Co=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"group-content",className:ce("w-full text-sm",e),...n}));Co.displayName="SidebarGroupContent";const $a=x.forwardRef(({className:e,...n},r)=>g.jsx("ul",{ref:r,"data-sidebar":"menu",className:ce("flex w-full min-w-0 flex-col gap-1",e),...n}));$a.displayName="SidebarMenu";const ma=x.forwardRef(({className:e,...n},r)=>g.jsx("li",{ref:r,"data-sidebar":"menu-item",className:ce("group/menu-item relative",e),...n}));ma.displayName="SidebarMenuItem";const P4=bc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-active data-[active=true]:font-medium data-[active=true]:text-sidebar-active-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),ga=x.forwardRef(({asChild:e=!1,isActive:n=!1,variant:r="default",size:i="default",tooltip:o,className:s,...c},f)=>{const h=e?hl:"button",{isMobile:d,state:m}=Mc(),y=g.jsx(h,{ref:f,"data-sidebar":"menu-button","data-size":i,"data-active":n,className:ce(P4({variant:r,size:i}),s),...c});return o?(typeof o=="string"&&(o={children:o}),g.jsxs(C4,{children:[g.jsx(A4,{asChild:!0,children:y}),g.jsx(cS,{side:"right",align:"center",hidden:m!=="collapsed"||d,...o})]})):y});ga.displayName="SidebarMenuButton";const I4=x.forwardRef(({className:e,asChild:n=!1,showOnHover:r=!1,...i},o)=>{const s=n?hl:"button";return g.jsx(s,{ref:o,"data-sidebar":"menu-action",className:ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-active-foreground md:opacity-0",e),...i})});I4.displayName="SidebarMenuAction";const ip=x.forwardRef(({className:e,...n},r)=>g.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:ce("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-full px-1.5 text-xs font-semibold tabular-nums shadow-sm","transition-all duration-200 ease-in-out hover:scale-110","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...n}));ip.displayName="SidebarMenuBadge";const U4=x.forwardRef(({className:e,showIcon:n=!1,...r},i)=>{const o=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return g.jsxs("div",{ref:i,"data-sidebar":"menu-skeleton",className:ce("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[n&&g.jsx(mb,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),g.jsx(mb,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});U4.displayName="SidebarMenuSkeleton";const xS=x.forwardRef(({className:e,...n},r)=>g.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:ce("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...n}));xS.displayName="SidebarMenuSub";const bS=x.forwardRef(({...e},n)=>g.jsx("li",{ref:n,...e}));bS.displayName="SidebarMenuSubItem";const wS=x.forwardRef(({asChild:e=!1,size:n="md",isActive:r,className:i,...o},s)=>{const c=e?hl:"a";return g.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":n,"data-active":r,className:ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-active data-[active=true]:text-sidebar-active-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...o})});wS.displayName="SidebarMenuSubButton";const B4="1.0.77-alpha.2",H4={version:B4};function F4({className:e}){return g.jsxs("svg",{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",className:e,children:[g.jsx("path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4"}),g.jsx("path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3"}),g.jsx("path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35"}),g.jsx("path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14"})]})}function Fa(e,n){if(n==="/")return e==="/";const r=e.match(/^\/terminal\/([^/]+)/);if(r){const i=r[1];if(n==="/agents")return i.startsWith("cp-")||i.startsWith("sk-");if(n==="/terminal")return!i.startsWith("cp-")&&!i.startsWith("sk-")}return e===n||e.startsWith(n+"/")}const q4=[{title:"Home",url:"/",icon:FN},{title:"Tasks",url:"/tasks",icon:AM},{title:"Skills",url:"/skills",icon:GM},{title:"Mail",url:"/mail",icon:tM}],V4=[{title:"Agents",url:"/agents",icon:Ro},{title:"Jobs",url:"/schedule",icon:hN},{title:"Utilities",url:"/utilities",icon:Xh}],$4=[{title:"Knowledge",url:"/knowledge",icon:Zu},{title:"Resources",url:"/resources",icon:ON}],Tb=[{title:"Role",url:"/context/role",icon:IM},{title:"Agents",url:"/context/agents",icon:kN},{title:"Team",url:"/context/team",icon:FM},{title:"Memory",url:"/context/memory",icon:fN}],G4=[{title:"Source Control",url:"/git",icon:R1},{title:"Terminal",url:"/terminal",icon:jM},{title:"Identity",url:"/identity",icon:VN},{title:"Activity",url:"/activity",icon:lN}],Y4=[{title:"Documentation",url:"https://docs.coconut.dev/studio",icon:sM,external:!0},{title:"Settings",url:"/settings/user",icon:xM}];function K4(){const{badges:e}=n_(),n=on(),[r,i]=x.useState(!1);return x.useEffect(()=>{Tb.some(s=>Fa(n.pathname,s.url))&&i(!0)},[n.pathname]),g.jsxs(hS,{className:"bg-sidebar border-r border-sidebar-border",children:[g.jsx(gS,{children:g.jsx($a,{children:g.jsx(ma,{children:g.jsx(ga,{size:"lg",asChild:!0,className:"[&>svg]:!size-8",children:g.jsxs(Vn,{to:"/",children:[g.jsx(F4,{className:"size-8"}),g.jsxs("div",{className:"flex flex-col gap-0.5",children:[g.jsxs("span",{className:"font-semibold",children:[g.jsx("span",{className:"bg-gradient-to-r from-amber-500 via-orange-500 to-yellow-600 bg-clip-text text-transparent",children:"Coconut"}),g.jsx("span",{children:" Studio"})]}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",H4.version]})]})]})})})})}),g.jsxs(vS,{children:[g.jsx(ko,{children:g.jsx(Co,{children:g.jsx($a,{children:q4.map(o=>g.jsx(ma,{children:g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title))})})}),g.jsxs(ko,{children:[g.jsx(Gu,{children:"Work"}),g.jsx(Co,{children:g.jsx($a,{children:V4.map(o=>{let s=0;return o.title==="Agents"&&e.codeSessions>0?s=e.codeSessions:o.title==="Jobs"&&e.runningScheduledJobs>0&&(s=e.runningScheduledJobs),g.jsxs(ma,{children:[g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})}),s>0&&g.jsx(ip,{className:"bg-blue-600 text-white dark:bg-blue-500",children:s})]},o.title)})})})]}),g.jsxs(ko,{children:[g.jsx(Gu,{children:"Assets"}),g.jsx(Co,{children:g.jsxs($a,{children:[$4.map(o=>g.jsx(ma,{children:g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title)),g.jsxs(ma,{children:[g.jsxs(ga,{onClick:()=>i(o=>!o),"data-state":r?"open":"closed",className:"w-full",children:[g.jsx(zN,{}),g.jsx("span",{children:"Context"}),g.jsx(vN,{className:`ml-auto size-4 shrink-0 transition-transform duration-200 ${r?"rotate-180":""}`})]}),r&&g.jsx(xS,{children:Tb.map(o=>g.jsx(bS,{children:g.jsx(wS,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title))})]})]})})]}),g.jsxs(ko,{children:[g.jsx(Gu,{children:"System"}),g.jsx(Co,{children:g.jsx($a,{children:G4.map(o=>{let s=0;return o.title==="Source Control"&&e.gitChanges>0?s=e.gitChanges:o.title==="Terminal"&&e.terminalSessions>0&&(s=e.terminalSessions),g.jsxs(ma,{children:[g.jsx(ga,{asChild:!0,isActive:Fa(n.pathname,o.url),children:g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})}),s>0&&g.jsx(ip,{className:"bg-blue-600 text-white dark:bg-blue-500",children:s})]},o.title)})})})]})]}),g.jsx(yS,{children:g.jsx($a,{children:Y4.map(o=>g.jsx(ma,{children:g.jsx(ga,{asChild:!0,isActive:!o.external&&Fa(n.pathname,o.url==="/settings/user"?"/settings":o.url),children:o.external?g.jsxs("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]}):g.jsxs(Vn,{to:o.url,children:[g.jsx(o.icon,{}),g.jsx("span",{children:o.title})]})})},o.title))})})]})}function X4(e){const n=e.match(/\bres-\d+-[a-z0-9]+\b/g);return n?[...new Set(n)]:[]}const Io=Gp,oB=kw,Q4=Yp,SS=x.forwardRef(({className:e,...n},r)=>g.jsx(Zo,{ref:r,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));SS.displayName=Zo.displayName;const il=x.forwardRef(({className:e,children:n,...r},i)=>g.jsxs(Q4,{children:[g.jsx(SS,{}),g.jsxs(Wo,{ref:i,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[n,g.jsxs(Ec,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx(Zi,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));il.displayName=Wo.displayName;const ll=({className:e,...n})=>g.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});ll.displayName="DialogHeader";const ES=({className:e,...n})=>g.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});ES.displayName="DialogFooter";const ol=x.forwardRef(({className:e,...n},r)=>g.jsx(Jo,{ref:r,className:ce("text-lg font-semibold leading-none tracking-tight",e),...n}));ol.displayName=Jo.displayName;const Qi=x.forwardRef(({className:e,...n},r)=>g.jsx(es,{ref:r,className:ce("text-sm text-muted-foreground",e),...n}));Qi.displayName=es.displayName;function bh({className:e,...n}){return g.jsx("kbd",{"data-slot":"kbd",className:ce("inline-flex h-5 items-center justify-center rounded border border-muted-foreground/30 bg-muted/50 px-1.5 font-sans text-[11px] font-medium text-muted-foreground shadow-sm",e),...n})}function sB({className:e,...n}){return g.jsx("span",{"data-slot":"kbd-group",className:ce("inline-flex items-center gap-0.5",e),...n})}function uB(){}function Z4(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const W4=/[$_\p{ID_Start}]/u,J4=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,eL=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,tL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kS={};function cB(e){return e?W4.test(String.fromCodePoint(e)):!1}function fB(e,n){const i=(n||kS).jsx?eL:J4;return e?i.test(String.fromCodePoint(e)):!1}function Rb(e,n){return(kS.jsx?nL:tL).test(e)}const rL=/[ \t\n\f\r]/g;function aL(e){return typeof e=="object"?e.type==="text"?_b(e.value):!1:_b(e)}function _b(e){return e.replace(rL,"")===""}class rs{constructor(n,r,i){this.normal=r,this.property=n,i&&(this.space=i)}}rs.prototype.normal={};rs.prototype.property={};rs.prototype.space=void 0;function CS(e,n){const r={},i={};for(const o of e)Object.assign(r,o.property),Object.assign(i,o.normal);return new rs(r,i,n)}function lp(e){return e.toLowerCase()}class sn{constructor(n,r){this.attribute=r,this.property=n}}sn.prototype.attribute="";sn.prototype.booleanish=!1;sn.prototype.boolean=!1;sn.prototype.commaOrSpaceSeparated=!1;sn.prototype.commaSeparated=!1;sn.prototype.defined=!1;sn.prototype.mustUseProperty=!1;sn.prototype.number=!1;sn.prototype.overloadedBoolean=!1;sn.prototype.property="";sn.prototype.spaceSeparated=!1;sn.prototype.space=void 0;let iL=0;const Le=Qa(),St=Qa(),op=Qa(),ue=Qa(),ut=Qa(),el=Qa(),xn=Qa();function Qa(){return 2**++iL}const sp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:St,commaOrSpaceSeparated:xn,commaSeparated:el,number:ue,overloadedBoolean:op,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),wh=Object.keys(sp);class om extends sn{constructor(n,r,i,o){let s=-1;if(super(n,r),Nb(this,"space",o),typeof i=="number")for(;++s<wh.length;){const c=wh[s];Nb(this,wh[s],(i&sp[c])===sp[c])}}}om.prototype.defined=!0;function Nb(e,n,r){r&&(e[n]=r)}function xl(e){const n={},r={};for(const[i,o]of Object.entries(e.properties)){const s=new om(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),n[i]=s,r[lp(i)]=i,r[lp(s.attribute)]=i}return new rs(n,r,e.space)}const AS=xl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:St,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:ut,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:ue,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:ut,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:St,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function TS(e,n){return n in e?e[n]:n}function RS(e,n){return TS(e,n.toLowerCase())}const lL=xl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:el,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:ut,autoFocus:Le,autoPlay:Le,blocking:ut,capture:null,charSet:null,checked:Le,cite:null,className:ut,cols:ue,colSpan:null,content:null,contentEditable:St,controls:Le,controlsList:ut,coords:ue|el,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:op,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:ut,height:ue,hidden:op,high:ue,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:ut,itemRef:ut,itemScope:Le,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:ue,pattern:null,ping:ut,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:ut,required:Le,reversed:Le,rows:ue,rowSpan:ue,sandbox:ut,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:St,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:RS}),oL=xl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:ut,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:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:el,g2:el,glyphName:el,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xn,rev:xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xn,requiredFeatures:xn,requiredFonts:xn,requiredFormats:xn,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:TS}),_S=xl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),NS=xl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:RS}),MS=xl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),sL={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"},uL=/[A-Z]/g,Mb=/-[a-z]/g,cL=/^data[-\w.:]+$/i;function fL(e,n){const r=lp(n);let i=n,o=sn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&cL.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(Mb,hL);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!Mb.test(s)){let c=s.replace(uL,dL);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}o=om}return new o(i,n)}function dL(e){return"-"+e.toLowerCase()}function hL(e){return e.charAt(1).toUpperCase()}const pL=CS([AS,lL,_S,NS,MS],"html"),sm=CS([AS,oL,_S,NS,MS],"svg");function mL(e){return e.join(" ").trim()}var Gi={},Sh,jb;function gL(){if(jb)return Sh;jb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
396
396
  `,d="/",m="*",y="",b="comment",w="declaration";Sh=function(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var T=1,N=1;function _(W){var q=W.match(n);q&&(T+=q.length);var le=W.lastIndexOf(h);N=~le?W.length-le:N+W.length}function j(){var W={line:T,column:N};return function(q){return q.position=new L(W),G(),q}}function L(W){this.start=W,this.end={line:T,column:N},this.source=A.source}L.prototype.content=C;function O(W){var q=new Error(A.source+":"+T+":"+N+": "+W);if(q.reason=W,q.filename=A.source,q.line=T,q.column=N,q.source=C,!A.silent)throw q}function $(W){var q=W.exec(C);if(q){var le=q[0];return _(le),C=C.slice(le.length),q}}function G(){$(r)}function ee(W){var q;for(W=W||[];q=P();)q!==!1&&W.push(q);return W}function P(){var W=j();if(!(d!=C.charAt(0)||m!=C.charAt(1))){for(var q=2;y!=C.charAt(q)&&(m!=C.charAt(q)||d!=C.charAt(q+1));)++q;if(q+=2,y===C.charAt(q-1))return O("End of comment missing");var le=C.slice(2,q-2);return N+=2,_(le),C=C.slice(q),N+=2,W({type:b,comment:le})}}function re(){var W=j(),q=$(i);if(q){if(P(),!$(o))return O("property missing ':'");var le=$(s),z=W({type:w,property:E(q[0].replace(e,y)),value:le?E(le[0].replace(e,y)):y});return $(c),z}}function Q(){var W=[];ee(W);for(var q;q=re();)q!==!1&&(W.push(q),ee(W));return W}return G(),Q()};function E(C){return C?C.replace(f,y):y}return Sh}var Db;function yL(){if(Db)return Gi;Db=1;var e=Gi&&Gi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=r;var n=e(gL());function r(i,o){var s=null;if(!i||typeof i!="string")return s;var c=(0,n.default)(i),f=typeof o=="function";return c.forEach(function(h){if(h.type==="declaration"){var d=h.property,m=h.value;f?o(d,m,h):m&&(s=s||{},s[d]=m)}}),s}return Gi}var bo={},Ob;function vL(){if(Ob)return bo;Ob=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(d){return!d||r.test(d)||e.test(d)},c=function(d,m){return m.toUpperCase()},f=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),s(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(o,f):d=d.replace(i,f),d.replace(n,c))};return bo.camelCase=h,bo}var wo,Lb;function xL(){if(Lb)return wo;Lb=1;var e=wo&&wo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(yL()),r=vL();function i(o,s){var c={};return!o||typeof o!="string"||(0,n.default)(o,function(f,h){f&&h&&(c[(0,r.camelCase)(f,s)]=h)}),c}return i.default=i,wo=i,wo}var bL=xL();const wL=fc(bL),jS=DS("end"),um=DS("start");function DS(e){return n;function n(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function OS(e){const n=um(e),r=jS(e);if(n&&r)return{start:n,end:r}}function _o(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?zb(e.position):"start"in e||"end"in e?zb(e):"line"in e||"column"in e?up(e):""}function up(e){return Pb(e&&e.line)+":"+Pb(e&&e.column)}function zb(e){return up(e&&e.start)+"-"+up(e&&e.end)}function Pb(e){return e&&typeof e=="number"?e:1}class Vt extends Error{constructor(n,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let o="",s={},c=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof n=="string"?o=n:!s.cause&&n&&(c=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?s.ruleId=i:(s.source=i.slice(0,h),s.ruleId=i.slice(h+1))}if(!s.place&&s.ancestors&&s.ancestors){const h=s.ancestors[s.ancestors.length-1];h&&(s.place=h.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=_o(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vt.prototype.file="";Vt.prototype.name="";Vt.prototype.reason="";Vt.prototype.message="";Vt.prototype.stack="";Vt.prototype.column=void 0;Vt.prototype.line=void 0;Vt.prototype.ancestors=void 0;Vt.prototype.cause=void 0;Vt.prototype.fatal=void 0;Vt.prototype.place=void 0;Vt.prototype.ruleId=void 0;Vt.prototype.source=void 0;const cm={}.hasOwnProperty,SL=new Map,EL=/[A-Z]/g,kL=new Set(["table","tbody","thead","tfoot","tr"]),CL=new Set(["td","th"]),LS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AL(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let i;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=OL(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=DL(r,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:i,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?sm:pL,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=zS(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function zS(e,n,r){if(n.type==="element")return TL(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return RL(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return NL(e,n,r);if(n.type==="mdxjsEsm")return _L(e,n);if(n.type==="root")return ML(e,n,r);if(n.type==="text")return jL(e,n)}function TL(e,n,r){const i=e.schema;let o=i;n.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=sm,e.schema=o),e.ancestors.push(n);const s=IS(e,n.tagName,!1),c=LL(e,n);let f=dm(e,n);return kL.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!aL(h):!0})),PS(e,c,s,n),fm(c,f),e.ancestors.pop(),e.schema=i,e.create(n,s,c,r)}function RL(e,n){if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Uo(e,n.position)}function _L(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Uo(e,n.position)}function NL(e,n,r){const i=e.schema;let o=i;n.name==="svg"&&i.space==="html"&&(o=sm,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:IS(e,n.name,!0),c=zL(e,n),f=dm(e,n);return PS(e,c,s,n),fm(c,f),e.ancestors.pop(),e.schema=i,e.create(n,s,c,r)}function ML(e,n,r){const i={};return fm(i,dm(e,n)),e.create(n,e.Fragment,i,r)}function jL(e,n){return n.value}function PS(e,n,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=i)}function fm(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function DL(e,n,r){return i;function i(o,s,c,f){const d=Array.isArray(c.children)?r:n;return f?d(s,c,f):d(s,c)}}function OL(e,n){return r;function r(i,o,s,c){const f=Array.isArray(s.children),h=um(i);return n(o,s,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function LL(e,n){const r={};let i,o;for(o in n.properties)if(o!=="children"&&cm.call(n.properties,o)){const s=PL(e,o,n.properties[o]);if(s){const[c,f]=s;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&CL.has(n.tagName)?i=f:r[c]=f}}if(i){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function zL(e,n){const r={};for(const i of n.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const c=s.expression;c.type;const f=c.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Uo(e,n.position);else{const o=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else Uo(e,n.position);else s=i.value===null?!0:i.value;r[o]=s}return r}function dm(e,n){const r=[];let i=-1;const o=e.passKeys?new Map:SL;for(;++i<n.children.length;){const s=n.children[i];let c;if(e.passKeys){const h=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(h){const d=o.get(h)||0;c=h+"-"+d,o.set(h,d+1)}}const f=zS(e,s,c);f!==void 0&&r.push(f)}return r}function PL(e,n,r){const i=fL(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?Z4(r):mL(r)),i.property==="style"){let o=typeof r=="object"?r:IL(e,String(r));return e.stylePropertyNameCase==="css"&&(o=UL(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?sL[i.property]||i.property:i.attribute,r]}}function IL(e,n){try{return wL(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,o=new Vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=LS+"#cannot-parse-style-attribute",o}}function IS(e,n,r){let i;if(!r)i={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,c;for(;++s<o.length;){const f=Rb(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}i=c}else i=Rb(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(i.type==="Literal"){const o=i.value;return cm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Uo(e)}function Uo(e,n){const r=new Vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=LS+"#cannot-handle-mdx-estrees-without-createevaluater",r}function UL(e){const n={};let r;for(r in e)cm.call(e,r)&&(n[BL(r)]=e[r]);return n}function BL(e){let n=e.replace(EL,HL);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function HL(e){return"-"+e.toLowerCase()}const Eh={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"]},FL={};function hm(e,n){const r=FL,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return US(e,i,o)}function US(e,n,r){if(qL(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ib(e.children,n,r)}return Array.isArray(e)?Ib(e,n,r):""}function Ib(e,n,r){const i=[];let o=-1;for(;++o<e.length;)i[o]=US(e[o],n,r);return i.join("")}function qL(e){return!!(e&&typeof e=="object")}const Ub=document.createElement("i");function pm(e){const n="&"+e+";";Ub.innerHTML=n;const r=Ub.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function Sn(e,n,r,i){const o=e.length;let s=0,c;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,r=r>0?r:0,i.length<1e4)c=Array.from(i),c.unshift(n,r),e.splice(...c);else for(r&&e.splice(n,r);s<i.length;)c=i.slice(s,s+1e4),c.unshift(n,0),e.splice(...c),s+=1e4,n+=1e4}function On(e,n){return e.length>0?(Sn(e,e.length,0,n),e):n}const Bb={}.hasOwnProperty;function BS(e){const n={};let r=-1;for(;++r<e.length;)VL(n,e[r]);return n}function VL(e,n){let r;for(r in n){const o=(Bb.call(e,r)?e[r]:void 0)||(e[r]={}),s=n[r];let c;if(s)for(c in s){Bb.call(o,c)||(o[c]=[]);const f=s[c];$L(o[c],Array.isArray(f)?f:f?[f]:[])}}}function $L(e,n){let r=-1;const i=[];for(;++r<n.length;)(n[r].add==="after"?e:i).push(n[r]);Sn(e,0,0,i)}function HS(e,n){const r=Number.parseInt(e,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function $n(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wt=wa(/[A-Za-z]/),Ft=wa(/[\dA-Za-z]/),GL=wa(/[#-'*+\--9=?A-Z^-~]/);function ac(e){return e!==null&&(e<32||e===127)}const cp=wa(/\d/),YL=wa(/[\dA-Fa-f]/),KL=wa(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const jc=wa(new RegExp("\\p{P}|\\p{S}","u")),Xa=wa(/\s/);function wa(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function bl(e){const n=[];let r=-1,i=0,o=0;for(;++r<e.length;){const s=e.charCodeAt(r);let c="";if(s===37&&Ft(e.charCodeAt(r+1))&&Ft(e.charCodeAt(r+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(r+1);s<56320&&f>56319&&f<57344?(c=String.fromCharCode(s,f),o=1):c="�"}else c=String.fromCharCode(s);c&&(n.push(e.slice(i,r),encodeURIComponent(c)),i=r+o+1,c=""),o&&(r+=o,o=0)}return n.join("")+e.slice(i)}function Ve(e,n,r,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(h){return He(h)?(e.enter(r),f(h)):n(h)}function f(h){return He(h)&&s++<o?(e.consume(h),f):(e.exit(r),n(h))}}const XL={tokenize:QL};function QL(e){const n=e.attempt(this.parser.constructs.contentInitial,i,o);let r;return n;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ve(e,n,"linePrefix")}function o(f){return e.enter("paragraph"),s(f)}function s(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Te(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),c)}}const ZL={tokenize:WL},Hb={tokenize:JL};function WL(e){const n=this,r=[];let i=0,o,s,c;return f;function f(_){if(i<r.length){const j=r[i];return n.containerState=j[1],e.attempt(j[0].continuation,h,d)(_)}return d(_)}function h(_){if(i++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&N();const j=n.events.length;let L=j,O;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){O=n.events[L][1].end;break}T(i);let $=j;for(;$<n.events.length;)n.events[$][1].end={...O},$++;return Sn(n.events,L+1,0,n.events.slice(j)),n.events.length=$,d(_)}return f(_)}function d(_){if(i===r.length){if(!o)return b(_);if(o.currentConstruct&&o.currentConstruct.concrete)return E(_);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Hb,m,y)(_)}function m(_){return o&&N(),T(i),b(_)}function y(_){return n.parser.lazy[n.now().line]=i!==r.length,c=n.now().offset,E(_)}function b(_){return n.containerState={},e.attempt(Hb,w,E)(_)}function w(_){return i++,r.push([n.currentConstruct,n.containerState]),b(_)}function E(_){if(_===null){o&&N(),T(0),e.consume(_);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),C(_)}function C(_){if(_===null){A(e.exit("chunkFlow"),!0),T(0),e.consume(_);return}return Te(_)?(e.consume(_),A(e.exit("chunkFlow")),i=0,n.interrupt=void 0,f):(e.consume(_),C)}function A(_,j){const L=n.sliceStream(_);if(j&&L.push(null),_.previous=s,s&&(s.next=_),s=_,o.defineSkip(_.start),o.write(L),n.parser.lazy[_.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<c&&(!o.events[O][1].end||o.events[O][1].end.offset>c))return;const $=n.events.length;let G=$,ee,P;for(;G--;)if(n.events[G][0]==="exit"&&n.events[G][1].type==="chunkFlow"){if(ee){P=n.events[G][1].end;break}ee=!0}for(T(i),O=$;O<n.events.length;)n.events[O][1].end={...P},O++;Sn(n.events,G+1,0,n.events.slice($)),n.events.length=O}}function T(_){let j=r.length;for(;j-- >_;){const L=r[j];n.containerState=L[1],L[0].exit.call(n,e)}r.length=_}function N(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function JL(e,n,r){return Ve(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sl(e){if(e===null||it(e)||Xa(e))return 1;if(jc(e))return 2}function Dc(e,n,r){const i=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!i.includes(s)&&(n=s(n,r),i.push(s))}return n}const fp={name:"attention",resolveAll:e3,tokenize:t3};function e3(e,n){let r=-1,i,o,s,c,f,h,d,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&n.sliceSerialize(e[i][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const y={...e[i][1].end},b={...e[r][1].start};Fb(y,-h),Fb(b,h),c={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[i][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:b},s={type:h>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[i][1].end={...c.start},e[r][1].start={...f.end},d=[],e[i][1].end.offset-e[i][1].start.offset&&(d=On(d,[["enter",e[i][1],n],["exit",e[i][1],n]])),d=On(d,[["enter",o,n],["enter",c,n],["exit",c,n],["enter",s,n]]),d=On(d,Dc(n.parser.constructs.insideSpan.null,e.slice(i+1,r),n)),d=On(d,[["exit",s,n],["enter",f,n],["exit",f,n],["exit",o,n]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,d=On(d,[["enter",e[r][1],n],["exit",e[r][1],n]])):m=0,Sn(e,i-1,r-i+3,d),r=i+d.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function t3(e,n){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,o=sl(i);let s;return c;function c(h){return s=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===s)return e.consume(h),f;const d=e.exit("attentionSequence"),m=sl(h),y=!m||m===2&&o||r.includes(h),b=!o||o===2&&m||r.includes(i);return d._open=!!(s===42?y:y&&(o||!b)),d._close=!!(s===42?b:b&&(m||!y)),n(h)}}function Fb(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const n3={name:"autolink",tokenize:r3};function r3(e,n,r){let i=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(w){return Wt(w)?(e.consume(w),c):w===64?r(w):d(w)}function c(w){return w===43||w===45||w===46||Ft(w)?(i=1,f(w)):d(w)}function f(w){return w===58?(e.consume(w),i=0,h):(w===43||w===45||w===46||Ft(w))&&i++<32?(e.consume(w),f):(i=0,d(w))}function h(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),n):w===null||w===32||w===60||ac(w)?r(w):(e.consume(w),h)}function d(w){return w===64?(e.consume(w),m):GL(w)?(e.consume(w),d):r(w)}function m(w){return Ft(w)?y(w):r(w)}function y(w){return w===46?(e.consume(w),i=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),n):b(w)}function b(w){if((w===45||Ft(w))&&i++<63){const E=w===45?b:y;return e.consume(w),E}return r(w)}}const as={partial:!0,tokenize:a3};function a3(e,n,r){return i;function i(s){return He(s)?Ve(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Te(s)?n(s):r(s)}}const FS={continuation:{tokenize:l3},exit:o3,name:"blockQuote",tokenize:i3};function i3(e,n,r){const i=this;return o;function o(c){if(c===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),s}return r(c)}function s(c){return He(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function l3(e,n,r){const i=this;return o;function o(c){return He(c)?Ve(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return e.attempt(FS,n,r)(c)}}function o3(e){e.exit("blockQuote")}const qS={name:"characterEscape",tokenize:s3};function s3(e,n,r){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return KL(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(s)}}const VS={name:"characterReference",tokenize:u3};function u3(e,n,r){const i=this;let o=0,s,c;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,c=Ft,m(y))}function d(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,c=YL,m):(e.enter("characterReferenceValue"),s=7,c=cp,m(y))}function m(y){if(y===59&&o){const b=e.exit("characterReferenceValue");return c===Ft&&!pm(i.sliceSerialize(b))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(y)&&o++<s?(e.consume(y),m):r(y)}}const qb={partial:!0,tokenize:f3},Vb={concrete:!0,name:"codeFenced",tokenize:c3};function c3(e,n,r){const i=this,o={partial:!0,tokenize:L};let s=0,c=0,f;return h;function h(O){return d(O)}function d(O){const $=i.events[i.events.length-1];return s=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===f?(c++,e.consume(O),m):c<3?r(O):(e.exit("codeFencedFenceSequence"),He(O)?Ve(e,y,"whitespace")(O):y(O))}function y(O){return O===null||Te(O)?(e.exit("codeFencedFence"),i.interrupt?n(O):e.check(qb,C,j)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Te(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(O)):He(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ve(e,w,"whitespace")(O)):O===96&&O===f?r(O):(e.consume(O),b)}function w(O){return O===null||Te(O)?y(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(O))}function E(O){return O===null||Te(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(O)):O===96&&O===f?r(O):(e.consume(O),E)}function C(O){return e.attempt(o,j,A)(O)}function A(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),T}function T(O){return s>0&&He(O)?Ve(e,N,"linePrefix",s+1)(O):N(O)}function N(O){return O===null||Te(O)?e.check(qb,C,j)(O):(e.enter("codeFlowValue"),_(O))}function _(O){return O===null||Te(O)?(e.exit("codeFlowValue"),N(O)):(e.consume(O),_)}function j(O){return e.exit("codeFenced"),n(O)}function L(O,$,G){let ee=0;return P;function P(le){return O.enter("lineEnding"),O.consume(le),O.exit("lineEnding"),re}function re(le){return O.enter("codeFencedFence"),He(le)?Ve(O,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(le):Q(le)}function Q(le){return le===f?(O.enter("codeFencedFenceSequence"),W(le)):G(le)}function W(le){return le===f?(ee++,O.consume(le),W):ee>=c?(O.exit("codeFencedFenceSequence"),He(le)?Ve(O,q,"whitespace")(le):q(le)):G(le)}function q(le){return le===null||Te(le)?(O.exit("codeFencedFence"),$(le)):G(le)}}}function f3(e,n,r){const i=this;return o;function o(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s)}function s(c){return i.parser.lazy[i.now().line]?r(c):n(c)}}const kh={name:"codeIndented",tokenize:h3},d3={partial:!0,tokenize:p3};function h3(e,n,r){const i=this;return o;function o(d){return e.enter("codeIndented"),Ve(e,s,"linePrefix",5)(d)}function s(d){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(d):r(d)}function c(d){return d===null?h(d):Te(d)?e.attempt(d3,c,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Te(d)?(e.exit("codeFlowValue"),c(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function p3(e,n,r){const i=this;return o;function o(c){return i.parser.lazy[i.now().line]?r(c):Te(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):Ve(e,s,"linePrefix",5)(c)}function s(c){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):Te(c)?o(c):r(c)}}const m3={name:"codeText",previous:y3,resolve:g3,tokenize:v3};function g3(e){let n=e.length-4,r=3,i,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(i=r;++i<n;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(i=r-1,n++;++i<=n;)o===void 0?i!==n&&e[i][1].type!=="lineEnding"&&(o=i):(i===n||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),n-=i-o-2,i=o+2),o=void 0);return e}function y3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function v3(e,n,r){let i=0,o,s;return c;function c(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),i++,f):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?r(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(s=e.enter("codeTextSequence"),o=0,m(y)):Te(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(y))}function d(y){return y===null||y===32||y===96||Te(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),d)}function m(y){return y===96?(e.consume(y),o++,m):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),n(y)):(s.type="codeTextData",d(y))}}class x3{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(n,i):n>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(n,r,i){const o=r||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&So(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),So(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),So(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);So(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);So(this.left,r.reverse())}}}function So(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function $S(e){const n={};let r=-1,i,o,s,c,f,h,d;const m=new x3(e);for(;++r<m.length;){for(;r in n;)r=n[r];if(i=m.get(r),r&&i[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=i[1]._tokenizer.events,s=0,s<h.length&&h[s][1].type==="lineEndingBlank"&&(s+=2),s<h.length&&h[s][1].type==="content"))for(;++s<h.length&&h[s][1].type!=="content";)h[s][1].type==="chunkText"&&(h[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(n,b3(m,r)),r=n[r],d=!0);else if(i[1]._container){for(s=r,o=void 0;s--;)if(c=m.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(i[1].end={...m.get(o)[1].start},f=m.slice(o,r),f.unshift(i),m.splice(o,r-o+1,f))}}return Sn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function b3(e,n){const r=e.get(n)[1],i=e.get(n)[2];let o=n-1;const s=[];let c=r._tokenizer;c||(c=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],d={};let m,y,b=-1,w=r,E=0,C=0;const A=[C];for(;w;){for(;e.get(++o)[1]!==w;);s.push(o),w._tokenizer||(m=i.sliceStream(w),w.next||m.push(null),y&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),y=w,w=w.next}for(w=r;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(C=b+1,A.push(C),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):A.pop(),b=A.length;b--;){const T=f.slice(A[b],A[b+1]),N=s.pop();h.push([N,N+T.length-1]),e.splice(N,2,T)}for(h.reverse(),b=-1;++b<h.length;)d[E+h[b][0]]=E+h[b][1],E+=h[b][1]-h[b][0]-1;return d}const w3={resolve:E3,tokenize:k3},S3={partial:!0,tokenize:C3};function E3(e){return $S(e),e}function k3(e,n){let r;return i;function i(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?s(f):Te(f)?e.check(S3,c,s)(f):(e.consume(f),o)}function s(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function c(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function C3(e,n,r){const i=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ve(e,s,"linePrefix")}function s(c){if(c===null||Te(c))return r(c);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):e.interrupt(i.parser.constructs.flow,r,n)(c)}}function GS(e,n,r,i,o,s,c,f,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return y;function y(T){return T===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(T),e.exit(s),b):T===null||T===32||T===41||ac(T)?r(T):(e.enter(i),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(T))}function b(T){return T===62?(e.enter(s),e.consume(T),e.exit(s),e.exit(o),e.exit(i),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===62?(e.exit("chunkString"),e.exit(f),b(T)):T===null||T===60||Te(T)?r(T):(e.consume(T),T===92?E:w)}function E(T){return T===60||T===62||T===92?(e.consume(T),w):w(T)}function C(T){return!m&&(T===null||T===41||it(T))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(i),n(T)):m<d&&T===40?(e.consume(T),m++,C):T===41?(e.consume(T),m--,C):T===null||T===32||T===40||ac(T)?r(T):(e.consume(T),T===92?A:C)}function A(T){return T===40||T===41||T===92?(e.consume(T),C):C(T)}}function YS(e,n,r,i,o,s){const c=this;let f=0,h;return d;function d(w){return e.enter(i),e.enter(o),e.consume(w),e.exit(o),e.enter(s),m}function m(w){return f>999||w===null||w===91||w===93&&!h||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?r(w):w===93?(e.exit(s),e.enter(o),e.consume(w),e.exit(o),e.exit(i),n):Te(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===null||w===91||w===93||Te(w)||f++>999?(e.exit("chunkString"),m(w)):(e.consume(w),h||(h=!He(w)),w===92?b:y)}function b(w){return w===91||w===92||w===93?(e.consume(w),f++,y):y(w)}}function KS(e,n,r,i,o,s){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(i),e.enter(o),e.consume(b),e.exit(o),c=b===40?41:b,h):r(b)}function h(b){return b===c?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),n):(e.enter(s),d(b))}function d(b){return b===c?(e.exit(s),h(c)):b===null?r(b):Te(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Ve(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===c||b===null||Te(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?y:m)}function y(b){return b===c||b===92?(e.consume(b),m):m(b)}}function No(e,n){let r;return i;function i(o){return Te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,i):He(o)?Ve(e,i,r?"linePrefix":"lineSuffix")(o):n(o)}}const A3={name:"definition",tokenize:R3},T3={partial:!0,tokenize:_3};function R3(e,n,r){const i=this;let o;return s;function s(w){return e.enter("definition"),c(w)}function c(w){return YS.call(i,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return o=$n(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),h):r(w)}function h(w){return it(w)?No(e,d)(w):d(w)}function d(w){return GS(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(T3,y,y)(w)}function y(w){return He(w)?Ve(e,b,"whitespace")(w):b(w)}function b(w){return w===null||Te(w)?(e.exit("definition"),i.parser.defined.push(o),n(w)):r(w)}}function _3(e,n,r){return i;function i(f){return it(f)?No(e,o)(f):r(f)}function o(f){return KS(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return He(f)?Ve(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Te(f)?n(f):r(f)}}const N3={name:"hardBreakEscape",tokenize:M3};function M3(e,n,r){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Te(s)?(e.exit("hardBreakEscape"),n(s)):r(s)}}const j3={name:"headingAtx",resolve:D3,tokenize:O3};function D3(e,n){let r=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},s={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},Sn(e,i,r-i+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function O3(e,n,r){let i=0;return o;function o(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&i++<6?(e.consume(m),c):m===null||it(m)?(e.exit("atxHeadingSequence"),f(m)):r(m)}function f(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Te(m)?(e.exit("atxHeading"),n(m)):He(m)?Ve(e,f,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),f(m))}function d(m){return m===null||m===35||it(m)?(e.exit("atxHeadingText"),f(m)):(e.consume(m),d)}}const L3=["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"],$b=["pre","script","style","textarea"],z3={concrete:!0,name:"htmlFlow",resolveTo:U3,tokenize:B3},P3={partial:!0,tokenize:F3},I3={partial:!0,tokenize:H3};function U3(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B3(e,n,r){const i=this;let o,s,c,f,h;return d;function d(M){return m(M)}function m(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),y}function y(M){return M===33?(e.consume(M),b):M===47?(e.consume(M),s=!0,C):M===63?(e.consume(M),o=3,i.interrupt?n:k):Wt(M)?(e.consume(M),c=String.fromCharCode(M),A):r(M)}function b(M){return M===45?(e.consume(M),o=2,w):M===91?(e.consume(M),o=5,f=0,E):Wt(M)?(e.consume(M),o=4,i.interrupt?n:k):r(M)}function w(M){return M===45?(e.consume(M),i.interrupt?n:k):r(M)}function E(M){const fe="CDATA[";return M===fe.charCodeAt(f++)?(e.consume(M),f===fe.length?i.interrupt?n:Q:E):r(M)}function C(M){return Wt(M)?(e.consume(M),c=String.fromCharCode(M),A):r(M)}function A(M){if(M===null||M===47||M===62||it(M)){const fe=M===47,Ce=c.toLowerCase();return!fe&&!s&&$b.includes(Ce)?(o=1,i.interrupt?n(M):Q(M)):L3.includes(c.toLowerCase())?(o=6,fe?(e.consume(M),T):i.interrupt?n(M):Q(M)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(M):s?N(M):_(M))}return M===45||Ft(M)?(e.consume(M),c+=String.fromCharCode(M),A):r(M)}function T(M){return M===62?(e.consume(M),i.interrupt?n:Q):r(M)}function N(M){return He(M)?(e.consume(M),N):P(M)}function _(M){return M===47?(e.consume(M),P):M===58||M===95||Wt(M)?(e.consume(M),j):He(M)?(e.consume(M),_):P(M)}function j(M){return M===45||M===46||M===58||M===95||Ft(M)?(e.consume(M),j):L(M)}function L(M){return M===61?(e.consume(M),O):He(M)?(e.consume(M),L):_(M)}function O(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),h=M,$):He(M)?(e.consume(M),O):G(M)}function $(M){return M===h?(e.consume(M),h=null,ee):M===null||Te(M)?r(M):(e.consume(M),$)}function G(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||it(M)?L(M):(e.consume(M),G)}function ee(M){return M===47||M===62||He(M)?_(M):r(M)}function P(M){return M===62?(e.consume(M),re):r(M)}function re(M){return M===null||Te(M)?Q(M):He(M)?(e.consume(M),re):r(M)}function Q(M){return M===45&&o===2?(e.consume(M),z):M===60&&o===1?(e.consume(M),K):M===62&&o===4?(e.consume(M),X):M===63&&o===3?(e.consume(M),k):M===93&&o===5?(e.consume(M),ae):Te(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(P3,oe,W)(M)):M===null||Te(M)?(e.exit("htmlFlowData"),W(M)):(e.consume(M),Q)}function W(M){return e.check(I3,q,oe)(M)}function q(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),le}function le(M){return M===null||Te(M)?W(M):(e.enter("htmlFlowData"),Q(M))}function z(M){return M===45?(e.consume(M),k):Q(M)}function K(M){return M===47?(e.consume(M),c="",B):Q(M)}function B(M){if(M===62){const fe=c.toLowerCase();return $b.includes(fe)?(e.consume(M),X):Q(M)}return Wt(M)&&c.length<8?(e.consume(M),c+=String.fromCharCode(M),B):Q(M)}function ae(M){return M===93?(e.consume(M),k):Q(M)}function k(M){return M===62?(e.consume(M),X):M===45&&o===2?(e.consume(M),k):Q(M)}function X(M){return M===null||Te(M)?(e.exit("htmlFlowData"),oe(M)):(e.consume(M),X)}function oe(M){return e.exit("htmlFlow"),n(M)}}function H3(e,n,r){const i=this;return o;function o(c){return Te(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):r(c)}function s(c){return i.parser.lazy[i.now().line]?r(c):n(c)}}function F3(e,n,r){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(as,n,r)}}const q3={name:"htmlText",tokenize:V3};function V3(e,n,r){const i=this;let o,s,c;return f;function f(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),h}function h(k){return k===33?(e.consume(k),d):k===47?(e.consume(k),L):k===63?(e.consume(k),_):Wt(k)?(e.consume(k),G):r(k)}function d(k){return k===45?(e.consume(k),m):k===91?(e.consume(k),s=0,E):Wt(k)?(e.consume(k),N):r(k)}function m(k){return k===45?(e.consume(k),w):r(k)}function y(k){return k===null?r(k):k===45?(e.consume(k),b):Te(k)?(c=y,K(k)):(e.consume(k),y)}function b(k){return k===45?(e.consume(k),w):y(k)}function w(k){return k===62?z(k):k===45?b(k):y(k)}function E(k){const X="CDATA[";return k===X.charCodeAt(s++)?(e.consume(k),s===X.length?C:E):r(k)}function C(k){return k===null?r(k):k===93?(e.consume(k),A):Te(k)?(c=C,K(k)):(e.consume(k),C)}function A(k){return k===93?(e.consume(k),T):C(k)}function T(k){return k===62?z(k):k===93?(e.consume(k),T):C(k)}function N(k){return k===null||k===62?z(k):Te(k)?(c=N,K(k)):(e.consume(k),N)}function _(k){return k===null?r(k):k===63?(e.consume(k),j):Te(k)?(c=_,K(k)):(e.consume(k),_)}function j(k){return k===62?z(k):_(k)}function L(k){return Wt(k)?(e.consume(k),O):r(k)}function O(k){return k===45||Ft(k)?(e.consume(k),O):$(k)}function $(k){return Te(k)?(c=$,K(k)):He(k)?(e.consume(k),$):z(k)}function G(k){return k===45||Ft(k)?(e.consume(k),G):k===47||k===62||it(k)?ee(k):r(k)}function ee(k){return k===47?(e.consume(k),z):k===58||k===95||Wt(k)?(e.consume(k),P):Te(k)?(c=ee,K(k)):He(k)?(e.consume(k),ee):z(k)}function P(k){return k===45||k===46||k===58||k===95||Ft(k)?(e.consume(k),P):re(k)}function re(k){return k===61?(e.consume(k),Q):Te(k)?(c=re,K(k)):He(k)?(e.consume(k),re):ee(k)}function Q(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),o=k,W):Te(k)?(c=Q,K(k)):He(k)?(e.consume(k),Q):(e.consume(k),q)}function W(k){return k===o?(e.consume(k),o=void 0,le):k===null?r(k):Te(k)?(c=W,K(k)):(e.consume(k),W)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||it(k)?ee(k):(e.consume(k),q)}function le(k){return k===47||k===62||it(k)?ee(k):r(k)}function z(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),n):r(k)}function K(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),B}function B(k){return He(k)?Ve(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):ae(k)}function ae(k){return e.enter("htmlTextData"),c(k)}}const mm={name:"labelEnd",resolveAll:K3,resolveTo:X3,tokenize:Q3},$3={tokenize:Z3},G3={tokenize:W3},Y3={tokenize:J3};function K3(e){let n=-1;const r=[];for(;++n<e.length;){const i=e[n][1];if(r.push(e[n]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",n+=o}}return e.length!==r.length&&Sn(e,0,e.length,r),e}function X3(e,n){let r=e.length,i=0,o,s,c,f;for(;r--;)if(o=e[r][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=r,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(c=r);const h={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[c][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=On(f,e.slice(s+1,s+i+3)),f=On(f,[["enter",m,n]]),f=On(f,Dc(n.parser.constructs.insideSpan.null,e.slice(s+i+4,c-3),n)),f=On(f,[["exit",m,n],e[c-2],e[c-1],["exit",d,n]]),f=On(f,e.slice(c+1)),f=On(f,[["exit",h,n]]),Sn(e,s,e.length,f),e}function Q3(e,n,r){const i=this;let o=i.events.length,s,c;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){s=i.events[o][1];break}return f;function f(b){return s?s._inactive?y(b):(c=i.parser.defined.includes($n(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):r(b)}function h(b){return b===40?e.attempt($3,m,c?m:y)(b):b===91?e.attempt(G3,m,c?d:y)(b):c?m(b):y(b)}function d(b){return e.attempt(Y3,m,y)(b)}function m(b){return n(b)}function y(b){return s._balanced=!0,r(b)}}function Z3(e,n,r){return i;function i(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),o}function o(y){return it(y)?No(e,s)(y):s(y)}function s(y){return y===41?m(y):GS(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function c(y){return it(y)?No(e,h)(y):m(y)}function f(y){return r(y)}function h(y){return y===34||y===39||y===40?KS(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):m(y)}function d(y){return it(y)?No(e,m)(y):m(y)}function m(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),n):r(y)}}function W3(e,n,r){const i=this;return o;function o(f){return YS.call(i,e,s,c,"reference","referenceMarker","referenceString")(f)}function s(f){return i.parser.defined.includes($n(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?n(f):r(f)}function c(f){return r(f)}}function J3(e,n,r){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):r(s)}}const ez={name:"labelStartImage",resolveAll:mm.resolveAll,tokenize:tz};function tz(e,n,r){const i=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),s}function s(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):r(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(f):n(f)}}const nz={name:"labelStartLink",resolveAll:mm.resolveAll,tokenize:rz};function rz(e,n,r){const i=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):n(c)}}const Ch={name:"lineEnding",tokenize:az};function az(e,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ve(e,n,"linePrefix")}}const Yu={name:"thematicBreak",tokenize:iz};function iz(e,n,r){let i=0,o;return s;function s(d){return e.enter("thematicBreak"),c(d)}function c(d){return o=d,f(d)}function f(d){return d===o?(e.enter("thematicBreakSequence"),h(d)):i>=3&&(d===null||Te(d))?(e.exit("thematicBreak"),n(d)):r(d)}function h(d){return d===o?(e.consume(d),i++,h):(e.exit("thematicBreakSequence"),He(d)?Ve(e,f,"whitespace")(d):f(d))}}const ln={continuation:{tokenize:uz},exit:fz,name:"list",tokenize:sz},lz={partial:!0,tokenize:dz},oz={partial:!0,tokenize:cz};function sz(e,n,r){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return f;function f(w){const E=i.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!i.containerState.marker||w===i.containerState.marker:cp(w)){if(i.containerState.type||(i.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Yu,r,d)(w):d(w);if(!i.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(w)}return r(w)}function h(w){return cp(w)&&++c<10?(e.consume(w),h):(!i.interrupt||c<2)&&(i.containerState.marker?w===i.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),d(w)):r(w)}function d(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||w,e.check(as,i.interrupt?r:m,e.attempt(lz,b,y))}function m(w){return i.containerState.initialBlankLine=!0,s++,b(w)}function y(w){return He(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),b):r(w)}function b(w){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(w)}}function uz(e,n,r){const i=this;return i.containerState._closeFlow=void 0,e.check(as,o,s);function o(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ve(e,n,"listItemIndent",i.containerState.size+1)(f)}function s(f){return i.containerState.furtherBlankLines||!He(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,c(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(oz,n,c)(f))}function c(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ve(e,e.attempt(ln,n,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function cz(e,n,r){const i=this;return Ve(e,o,"listItemIndent",i.containerState.size+1);function o(s){const c=i.events[i.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===i.containerState.size?n(s):r(s)}}function fz(e){e.exit(this.containerState.type)}function dz(e,n,r){const i=this;return Ve(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const c=i.events[i.events.length-1];return!He(s)&&c&&c[1].type==="listItemPrefixWhitespace"?n(s):r(s)}}const Gb={name:"setextUnderline",resolveTo:hz,tokenize:pz};function hz(e,n){let r=e.length,i,o,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const c={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",c,n]),e.splice(s+1,0,["exit",e[i][1],n]),e[i][1].end={...e[s][1].end}):e[i][1]=c,e.push(["exit",c,n]),e}function pz(e,n,r){const i=this;let o;return s;function s(d){let m=i.events.length,y;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){y=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||y)?(e.enter("setextHeadingLine"),o=d,c(d)):r(d)}function c(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===o?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),He(d)?Ve(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Te(d)?(e.exit("setextHeadingLine"),n(d)):r(d)}}const mz={tokenize:gz};function gz(e){const n=this,r=e.attempt(as,i,e.attempt(this.parser.constructs.flowInitial,o,Ve(e,e.attempt(this.parser.constructs.flow,o,e.attempt(w3,o)),"linePrefix")));return r;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const yz={resolveAll:QS()},vz=XS("string"),xz=XS("text");function XS(e){return{resolveAll:QS(e==="text"?bz:void 0),tokenize:n};function n(r){const i=this,o=this.parser.constructs[e],s=r.attempt(o,c,f);return c;function c(m){return d(m)?s(m):f(m)}function f(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return d(m)?(r.exit("data"),s(m)):(r.consume(m),h)}function d(m){if(m===null)return!0;const y=o[m];let b=-1;if(y)for(;++b<y.length;){const w=y[b];if(!w.previous||w.previous.call(i,i.previous))return!0}return!1}}}function QS(e){return n;function n(r,i){let o=-1,s;for(;++o<=r.length;)s===void 0?r[o]&&r[o][1].type==="data"&&(s=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==s+2&&(r[s][1].end=r[o-1][1].end,r.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(r,i):r}}function bz(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],o=n.sliceStream(i);let s=o.length,c=-1,f=0,h;for(;s--;){const d=o[s];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(d===-2)h=!0,f++;else if(d!==-1){s++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:i.start._bufferIndex+c,_index:i.start._index+s,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):(e.splice(r,0,["enter",d,n],["exit",d,n]),r+=2)}r++}return e}const wz={42:ln,43:ln,45:ln,48:ln,49:ln,50:ln,51:ln,52:ln,53:ln,54:ln,55:ln,56:ln,57:ln,62:FS},Sz={91:A3},Ez={[-2]:kh,[-1]:kh,32:kh},kz={35:j3,42:Yu,45:[Gb,Yu],60:z3,61:Gb,95:Yu,96:Vb,126:Vb},Cz={38:VS,92:qS},Az={[-5]:Ch,[-4]:Ch,[-3]:Ch,33:ez,38:VS,42:fp,60:[n3,q3],91:nz,92:[N3,qS],93:mm,95:fp,96:m3},Tz={null:[fp,yz]},Rz={null:[42,95]},_z={null:[]},Nz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Rz,contentInitial:Sz,disable:_z,document:wz,flow:kz,flowInitial:Ez,insideSpan:Tz,string:Cz,text:Az},Symbol.toStringTag,{value:"Module"}));function Mz(e,n,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},s=[];let c=[],f=[];const h={attempt:$(L),check:$(O),consume:N,enter:_,exit:j,interrupt:$(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:E,parser:e,previous:null,sliceSerialize:b,sliceStream:w,write:y};let m=n.tokenize.call(d,h);return n.resolveAll&&s.push(n),d;function y(re){return c=On(c,re),A(),c[c.length-1]!==null?[]:(G(n,0),d.events=Dc(s,d.events,d),d.events)}function b(re,Q){return Dz(w(re),Q)}function w(re){return jz(c,re)}function E(){const{_bufferIndex:re,_index:Q,line:W,column:q,offset:le}=i;return{_bufferIndex:re,_index:Q,line:W,column:q,offset:le}}function C(re){o[re.line]=re.column,P()}function A(){let re;for(;i._index<c.length;){const Q=c[i._index];if(typeof Q=="string")for(re=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===re&&i._bufferIndex<Q.length;)T(Q.charCodeAt(i._bufferIndex));else T(Q)}}function T(re){m=m(re)}function N(re){Te(re)?(i.line++,i.column=1,i.offset+=re===-3?2:1,P()):re!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===c[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=re}function _(re,Q){const W=Q||{};return W.type=re,W.start=E(),d.events.push(["enter",W,d]),f.push(W),W}function j(re){const Q=f.pop();return Q.end=E(),d.events.push(["exit",Q,d]),Q}function L(re,Q){G(re,Q.from)}function O(re,Q){Q.restore()}function $(re,Q){return W;function W(q,le,z){let K,B,ae,k;return Array.isArray(q)?oe(q):"tokenize"in q?oe([q]):X(q);function X(de){return xe;function xe(De){const lt=De!==null&&de[De],Ze=De!==null&&de.null,dt=[...Array.isArray(lt)?lt:lt?[lt]:[],...Array.isArray(Ze)?Ze:Ze?[Ze]:[]];return oe(dt)(De)}}function oe(de){return K=de,B=0,de.length===0?z:M(de[B])}function M(de){return xe;function xe(De){return k=ee(),ae=de,de.partial||(d.currentConstruct=de),de.name&&d.parser.constructs.disable.null.includes(de.name)?Ce():de.tokenize.call(Q?Object.assign(Object.create(d),Q):d,h,fe,Ce)(De)}}function fe(de){return re(ae,k),le}function Ce(de){return k.restore(),++B<K.length?M(K[B]):z}}}function G(re,Q){re.resolveAll&&!s.includes(re)&&s.push(re),re.resolve&&Sn(d.events,Q,d.events.length-Q,re.resolve(d.events.slice(Q),d)),re.resolveTo&&(d.events=re.resolveTo(d.events,d))}function ee(){const re=E(),Q=d.previous,W=d.currentConstruct,q=d.events.length,le=Array.from(f);return{from:q,restore:z};function z(){i=re,d.previous=Q,d.currentConstruct=W,d.events.length=q,f=le,P()}}function P(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function jz(e,n){const r=n.start._index,i=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let c;if(r===o)c=[e[r].slice(i,s)];else{if(c=e.slice(r,o),i>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(i):c.shift()}s>0&&c.push(e[o].slice(0,s))}return c}function Dz(e,n){let r=-1;const i=[];let o;for(;++r<e.length;){const s=e[r];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
397
397
  `;break}case-3:{c=`\r
398
398
  `;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&o)continue;c=" ";break}default:c=String.fromCharCode(s)}o=s===-2,i.push(c)}return i.join("")}function Oz(e){const i={constructs:BS([Nz,...(e||{}).extensions||[]]),content:o(XL),defined:[],document:o(ZL),flow:o(mz),lazy:{},string:o(vz),text:o(xz)};return i;function o(s){return c;function c(f){return Mz(i,s,f)}}}function Lz(e){for(;!$S(e););return e}const Yb=/[\0\t\n\r]/g;function zz(){let e=1,n="",r=!0,i;return o;function o(s,c,f){const h=[];let d,m,y,b,w;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),y=0,n="",r&&(s.charCodeAt(0)===65279&&y++,r=void 0);y<s.length;){if(Yb.lastIndex=y,d=Yb.exec(s),b=d&&d.index!==void 0?d.index:s.length,w=s.charCodeAt(b),!d){n=s.slice(y);break}if(w===10&&y===b&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),y<b&&(h.push(s.slice(y,b)),e+=b-y),w){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}y=b+1}return f&&(i&&h.push(-5),n&&h.push(n),h.push(null)),h}}const Pz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Iz(e){return e.replace(Pz,Uz)}function Uz(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),s=o===120||o===88;return HS(r.slice(s?2:1),s?16:10)}return pm(r)||e}const ZS={}.hasOwnProperty;function Bz(e,n,r){return typeof n!="string"&&(r=n,n=void 0),Hz(r)(Lz(Oz(r).document().write(zz()(e,n,!0))))}function Hz(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(vr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:s(gr),blockQuote:s(Ze),characterEscape:ee,characterReference:ee,codeFenced:s(dt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(dt,c),codeText:s($t,c),codeTextData:ee,data:ee,codeFlowValue:ee,definition:s(un),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(mr),hardBreakEscape:s(Ja),hardBreakTrailing:s(Ja),htmlFlow:s(Ct,c),htmlFlowData:ee,htmlText:s(Ct,c),htmlTextData:ee,image:s(yr),label:c,link:s(vr),listItem:s(Gt),listItemValue:b,listOrdered:s(Zn,y),listUnordered:s(Zn),paragraph:s(Wn),reference:M,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s(gr),strong:s(Sa),thematicBreak:s(ti)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:lt,autolinkProtocol:De,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:de,characterReference:xe,codeFenced:h(A),codeFencedFence:C,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:P,codeIndented:h(T),codeText:h(le),codeTextData:P,data:P,definition:h(),definitionDestinationString:j,definitionLabelString:N,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(Q),hardBreakTrailing:h(Q),htmlFlow:h(W),htmlFlowData:P,htmlText:h(q),htmlTextData:P,image:h(K),label:ae,labelText:B,lineEnding:re,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:fe,resourceDestinationString:k,resourceTitleString:X,resource:oe,setextHeading:h(G),setextHeadingLineSequence:$,setextHeadingText:O,strong:h(),thematicBreak:h()}};WS(n,(e||{}).mdastExtensions||[]);const r={};return i;function i(J){let se={type:"root",children:[]};const Ee={stack:[se],tokenStack:[],config:n,enter:f,exit:d,buffer:c,resume:m,data:r},Ae=[];let Ge=-1;for(;++Ge<J.length;)if(J[Ge][1].type==="listOrdered"||J[Ge][1].type==="listUnordered")if(J[Ge][0]==="enter")Ae.push(Ge);else{const Yt=Ae.pop();Ge=o(J,Yt,Ge)}for(Ge=-1;++Ge<J.length;){const Yt=n[J[Ge][0]];ZS.call(Yt,J[Ge][1].type)&&Yt[J[Ge][1].type].call(Object.assign({sliceSerialize:J[Ge][2].sliceSerialize},Ee),J[Ge][1])}if(Ee.tokenStack.length>0){const Yt=Ee.tokenStack[Ee.tokenStack.length-1];(Yt[1]||Kb).call(Ee,void 0,Yt[0])}for(se.position={start:da(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:da(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<n.transforms.length;)se=n.transforms[Ge](se)||se;return se}function o(J,se,Ee){let Ae=se-1,Ge=-1,Yt=!1,Un,It,En,Kt;for(;++Ae<=Ee;){const yt=J[Ae];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?Ge++:Ge--,Kt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(Un&&!Kt&&!Ge&&!En&&(En=Ae),Kt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kt=void 0}if(!Ge&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||Ge===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(Un){let Ut=Ae;for(It=void 0;Ut--;){const en=J[Ut];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;It&&(J[It][1].type="lineEndingBlank",Yt=!0),en[1].type="lineEnding",It=Ut}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}En&&(!It||En<It)&&(Un._spread=!0),Un.end=Object.assign({},It?J[It][1].start:yt[1].end),J.splice(It||Ae,0,["exit",Un,yt[2]]),Ae++,Ee++}if(yt[1].type==="listItemPrefix"){const Ut={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};Un=Ut,J.splice(Ae,0,["enter",Ut,yt[2]]),Ae++,Ee++,En=void 0,Kt=!0}}}return J[se][1]._spread=Yt,Ee}function s(J,se){return Ee;function Ee(Ae){f.call(this,J(Ae),Ae),se&&se.call(this,Ae)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(J,se,Ee){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([se,Ee||void 0]),J.position={start:da(se.start),end:void 0}}function h(J){return se;function se(Ee){J&&J.call(this,Ee),d.call(this,Ee)}}function d(J,se){const Ee=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==J.type&&(se?se.call(this,J,Ae[0]):(Ae[1]||Kb).call(this,J,Ae[0]));else throw new Error("Cannot close `"+J.type+"` ("+_o({start:J.start,end:J.end})+"): it’s not open");Ee.position.end=da(J.end)}function m(){return hm(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(J){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function w(){const J=this.resume(),se=this.stack[this.stack.length-1];se.lang=J}function E(){const J=this.resume(),se=this.stack[this.stack.length-1];se.meta=J}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const J=this.resume(),se=this.stack[this.stack.length-1];se.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const J=this.resume(),se=this.stack[this.stack.length-1];se.value=J.replace(/(\r?\n|\r)$/g,"")}function N(J){const se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=se,Ee.identifier=$n(this.sliceSerialize(J)).toLowerCase()}function _(){const J=this.resume(),se=this.stack[this.stack.length-1];se.title=J}function j(){const J=this.resume(),se=this.stack[this.stack.length-1];se.url=J}function L(J){const se=this.stack[this.stack.length-1];if(!se.depth){const Ee=this.sliceSerialize(J).length;se.depth=Ee}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function $(J){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(J){const Ee=this.stack[this.stack.length-1].children;let Ae=Ee[Ee.length-1];(!Ae||Ae.type!=="text")&&(Ae=ei(),Ae.position={start:da(J.start),end:void 0},Ee.push(Ae)),this.stack.push(Ae)}function P(J){const se=this.stack.pop();se.value+=this.sliceSerialize(J),se.position.end=da(J.end)}function re(J){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=se.children[se.children.length-1];Ee.position.end=da(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(se.type)&&(ee.call(this,J),P.call(this,J))}function Q(){this.data.atHardBreak=!0}function W(){const J=this.resume(),se=this.stack[this.stack.length-1];se.value=J}function q(){const J=this.resume(),se=this.stack[this.stack.length-1];se.value=J}function le(){const J=this.resume(),se=this.stack[this.stack.length-1];se.value=J}function z(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=se,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function K(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=se,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function B(J){const se=this.sliceSerialize(J),Ee=this.stack[this.stack.length-2];Ee.label=Iz(se),Ee.identifier=$n(se).toLowerCase()}function ae(){const J=this.stack[this.stack.length-1],se=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ae=J.children;Ee.children=Ae}else Ee.alt=se}function k(){const J=this.resume(),se=this.stack[this.stack.length-1];se.url=J}function X(){const J=this.resume(),se=this.stack[this.stack.length-1];se.title=J}function oe(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function fe(J){const se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=se,Ee.identifier=$n(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function Ce(J){this.data.characterReferenceType=J.type}function de(J){const se=this.sliceSerialize(J),Ee=this.data.characterReferenceType;let Ae;Ee?(Ae=HS(se,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=pm(se);const Ge=this.stack[this.stack.length-1];Ge.value+=Ae}function xe(J){const se=this.stack.pop();se.position.end=da(J.end)}function De(J){P.call(this,J);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(J)}function lt(J){P.call(this,J);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(J)}function Ze(){return{type:"blockquote",children:[]}}function dt(){return{type:"code",lang:null,meta:null,value:""}}function $t(){return{type:"inlineCode",value:""}}function un(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mr(){return{type:"emphasis",children:[]}}function gr(){return{type:"heading",depth:0,children:[]}}function Ja(){return{type:"break"}}function Ct(){return{type:"html",value:""}}function yr(){return{type:"image",title:null,url:"",alt:null}}function vr(){return{type:"link",title:null,url:"",children:[]}}function Zn(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function Gt(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function Wn(){return{type:"paragraph",children:[]}}function Sa(){return{type:"strong",children:[]}}function ei(){return{type:"text",value:""}}function ti(){return{type:"thematicBreak"}}}function da(e){return{line:e.line,column:e.column,offset:e.offset}}function WS(e,n){let r=-1;for(;++r<n.length;){const i=n[r];Array.isArray(i)?WS(e,i):Fz(e,i)}}function Fz(e,n){let r;for(r in n)if(ZS.call(n,r))switch(r){case"canContainEols":{const i=n[r];i&&e[r].push(...i);break}case"transforms":{const i=n[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=n[r];i&&Object.assign(e[r],i);break}}}function Kb(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+_o({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+_o({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+_o({start:n.start,end:n.end})+") is still open")}function qz(e){const n=this;n.parser=r;function r(i){return Bz(i,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Vz(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function $z(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
@@ -494,4 +494,4 @@ ${K.content||""}`;i(B)}else i(null)}catch(le){console.error("Error fetching task
494
494
  ${o}`,r&&`=== TASK CONTENT ===
495
495
  ${r}`].filter(Boolean),K=z.length>0?z.join(`
496
496
 
497
- `):null;return{type:A.includes("/edit")?"tasks-edit":"tasks-view",content:K,displayId:W,contextFiles:le}}return{type:"tasks",content:o,contextFiles:"role.md"}}return A.includes("/context")?A.includes("/knowledge")?{type:"context-knowledge",content:null}:{type:"context",content:null}:A.includes("/settings")?A.includes("/skills")?{type:"settings-skills",content:null}:A.includes("/integrations")?{type:"settings-integrations",content:null}:A.includes("/prompts")?{type:"settings-prompts",content:null}:A.includes("/rules")?{type:"settings-rules",content:null}:A.includes("/user")?{type:"settings-user",content:null}:{type:"settings",content:null}:A.includes("/terminal")?{type:"terminal",content:null}:{type:"dashboard",content:null}};return g.jsx(dS,{defaultOpen:!L,children:g.jsxs("div",{className:"flex min-h-screen w-full overflow-hidden",children:[g.jsx(K4,{}),g.jsxs(mS,{className:ce("flex-1 min-w-0 transition-all duration-300 ease-in-out",e&&"mr-96"),children:[g.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b border-content-border px-4 bg-background",children:[g.jsx(pS,{className:"-ml-1"}),g.jsxs("div",{className:"flex items-center justify-between flex-1",children:[g.jsx("h1",{className:"text-lg font-semibold",children:c||"Coconut"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(pt,{onClick:ee,size:"icon",className:"h-8 w-8 rounded-full",children:g.jsx(Fu,{className:"h-4 w-4"})}),_&&T&&g.jsxs(q8,{children:[g.jsx(V8,{asChild:!0,children:g.jsx(pt,{size:"icon",variant:"outline",className:"h-8 w-8 rounded-full",children:g.jsx(BM,{className:"h-4 w-4"})})}),g.jsxs(RC,{align:"end",children:[g.jsx(NC,{children:g.jsxs("div",{className:"flex flex-col space-y-1",children:[g.jsx("p",{className:"text-sm font-medium leading-none",children:T.name}),g.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:T.email})]})}),g.jsx(MC,{}),g.jsxs(_C,{onClick:P,children:[g.jsx(ZN,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})]})]}),g.jsx("main",{className:"flex flex-1 flex-col gap-4 p-4 overflow-auto bg-content-background",children:g.jsx(Rp,{})})]}),g.jsx(w9,{isOpen:e,onToggle:ee,contextInfo:re(),discussDocument:h,onDiscussDocumentHandled:()=>d(null),pendingPrompt:m,onPendingPromptHandled:()=>y(null),openInFullScreen:b,onFullScreenHandled:()=>w(!1),fullScreenNoEscape:G})]})})}const Q8=[{title:"Coconut Profile",href:"/settings/user",icon:zM,description:"Manage the Coconut's profile information."},{title:"User Preferences",href:"/settings/preferences",icon:EM,description:"Configure individual workspace preferences"},{title:"Authentication",href:"/settings/authentication",icon:wM,description:"Configure authentication and user access"},{title:"API Keys",href:"/settings/api-keys",icon:KN,description:"Manage API keys for programmatic access"},{title:"Symlinks",href:"/settings/rules",icon:Zu,description:"Manage symlinks for easy access to project rules and configurations"},{title:"AI & LLM",href:"/settings/integrations",icon:dM,description:"Connect Coconut to LLM providers and automation hooks"},{title:"Git",href:"/settings/git",icon:R1,description:"Configure repository defaults like worktree paths"},{title:"MCP",href:"/settings/mcp",icon:lM,description:"Model Context Protocol configuration and settings"},{title:"Notifications",href:"/settings/notifications",icon:sN,description:"Configure Slack notifications for Coconut events"}];function Z8(){const e=on();return g.jsxs("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0",children:[g.jsx("aside",{className:"lg:w-1/5",children:g.jsx("nav",{className:"flex overflow-x-auto pb-2 gap-1 lg:flex-col lg:gap-0 lg:space-y-1 lg:overflow-visible lg:pb-0",children:Q8.map(n=>g.jsxs(Vn,{to:n.href,className:ce("inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground h-9 px-2 sm:px-3 lg:px-4 py-2 hover:bg-accent justify-start flex-shrink-0",e.pathname===n.href?"bg-accent text-accent-foreground":"text-muted-foreground"),children:[g.jsx(n.icon,{className:"h-4 w-4 lg:mr-2"}),g.jsx("span",{className:"hidden lg:inline",children:n.title})]},n.href))})}),g.jsx("div",{className:"flex-1 lg:max-w-2xl",children:g.jsx("div",{className:"space-y-6",children:g.jsx(Rp,{})})})]})}const W8=[{title:"Inbox",href:"/mail/inbox",icon:GN,description:"Incoming emails"},{title:"Read",href:"/mail/read",icon:JN,description:"Emails you've already read"},{title:"Sent",href:"/mail/sent",icon:_1,description:"Emails you've sent"}];function J8(){const e=on();return g.jsxs("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0",children:[g.jsx("aside",{className:"lg:w-1/5",children:g.jsx("nav",{className:"flex overflow-x-auto pb-2 gap-1 lg:flex-col lg:gap-0 lg:space-y-1 lg:overflow-visible lg:pb-0",children:W8.map(n=>g.jsxs(Vn,{to:n.href,className:ce("inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground h-9 px-2 sm:px-3 lg:px-4 py-2 hover:bg-accent justify-start flex-shrink-0",e.pathname===n.href?"bg-accent text-accent-foreground":"text-muted-foreground"),children:[g.jsx(n.icon,{className:"h-4 w-4 lg:mr-2"}),g.jsx("span",{className:"hidden lg:inline",children:n.title})]},n.href))})}),g.jsx("div",{className:"flex-1",children:g.jsx("div",{className:"space-y-6",children:g.jsx(Rp,{})})})]})}const eU=x.lazy(()=>_e(()=>import("./DashboardPage-DK2uEtcQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),tU=x.lazy(()=>_e(()=>import("./LoginPage-Bn-55dqi.js"),__vite__mapDeps([22,4,1,23]))),nU=x.lazy(()=>_e(()=>import("./CallbackPage-Beg0ZLv4.js"),__vite__mapDeps([24,12,25]))),rU=x.lazy(()=>_e(()=>import("./CoconutCallbackPage-BuBYbeY-.js"),[])),aU=x.lazy(()=>_e(()=>import("./TasksPage-CeWPVVwj.js"),__vite__mapDeps([26,1,2,5,6,7,3,14,13]))),iU=x.lazy(()=>_e(()=>import("./TaskDetailPage-6E7isObV.js"),__vite__mapDeps([27,28,1,2,4,5,6,7,3,29,30,31,32,19,20,33]))),lU=x.lazy(()=>_e(()=>import("./TaskEditPage-Bd1DFoK3.js"),__vite__mapDeps([34,4,5,6,7,1,35,36,37,38,39,2,29])).then(e=>({default:e.TaskEditPage}))),oU=x.lazy(()=>_e(()=>import("./NewTaskPage-BcOmFrza.js"),__vite__mapDeps([40,1,4,35,6,36,5,7,37,38,39,2,29])).then(e=>({default:e.NewTaskPage}))),sU=x.lazy(()=>_e(()=>import("./TerminalPage-D-LJMND7.js"),__vite__mapDeps([41,1,8,9,10,11,42,43,7,19,44,45]))),uU=x.lazy(()=>_e(()=>import("./TerminalSessionPage-BGHgOQhV.js"),__vite__mapDeps([46,1,2,5,6,7,47,37,4,8,10,11,48,49,16,42,19,50,51,33,45]))),cU=x.lazy(()=>_e(()=>import("./UtilitiesPage-hCM0KDs8.js"),__vite__mapDeps([52,1,8,44,19]))),fU=x.lazy(()=>_e(()=>import("./CodePage-C9auBWu3.js"),__vite__mapDeps([53,1,2,8,9,10,11,5,6,7,49,42,43,19,16,51]))),dU=x.lazy(()=>_e(()=>import("./SkillsPage-QqNzKzhn.js"),__vite__mapDeps([54,1,28,55,2,56,14]))),hU=x.lazy(()=>_e(()=>import("./SkillDetailPage-DCjWVhUE.js"),__vite__mapDeps([57,1,2,29]))),pU=x.lazy(()=>_e(()=>import("./NewSkillPage-eqK5nwnk.js"),__vite__mapDeps([58,1,4,2,28,29,30]))),mU=x.lazy(()=>_e(()=>import("./SkillEditPage-BA-ebFGI.js"),__vite__mapDeps([59,1,4,2,28,29,30]))),gU=x.lazy(()=>_e(()=>import("./ResourcesPage-CfdKptfd.js"),__vite__mapDeps([60,1,4,2,28,5,6,7,56,61,62,13,63,14]))),yU=x.lazy(()=>_e(()=>import("./ResourceDetailPage-BH-A0yn7.js"),__vite__mapDeps([64,2,28,29,61,62,63]))),vU=x.lazy(()=>_e(()=>import("./KnowledgePage-DRavibOT.js"),__vite__mapDeps([65,1,2,28,55,56,14,31,66,48]))),xU=x.lazy(()=>_e(()=>import("./KnowledgeDetailPage-Cx0NiVN5.js"),__vite__mapDeps([67,1,2,28,29,63,18]))),bU=x.lazy(()=>_e(()=>import("./KnowledgeEditPage-Dtp9Ceyp.js"),__vite__mapDeps([68,1,4,35,6,36,39,2,69,18,29]))),wU=x.lazy(()=>_e(()=>import("./NewKnowledgePage-zWnjfGF1.js"),__vite__mapDeps([70,1,4,35,6,36,39,2,69,18,29]))),SU=x.lazy(()=>_e(()=>import("./RolePage-CCwufp_f.js"),__vite__mapDeps([71,1,28]))),EU=x.lazy(()=>_e(()=>import("./RoleEditPage-DfqF4tLW.js"),__vite__mapDeps([72,1,4,5,6,7,35,36,29,21]))),kU=x.lazy(()=>_e(()=>import("./AgentsContextPage-IrZGdiYt.js"),__vite__mapDeps([73,1,28]))),CU=x.lazy(()=>_e(()=>import("./AgentsContextEditPage-C5afMo09.js"),__vite__mapDeps([74,1,35,6,36,29,21]))),AU=x.lazy(()=>_e(()=>import("./TeamPage-CEojyLvc.js"),__vite__mapDeps([75,1,28]))),TU=x.lazy(()=>_e(()=>import("./TeamEditPage-CgYsqeq9.js"),__vite__mapDeps([76,1,35,6,36,29,21]))),RU=x.lazy(()=>_e(()=>import("./MemoryPage-BKNQlp0x.js"),__vite__mapDeps([77,1,28]))),_U=x.lazy(()=>_e(()=>import("./MemoryEditPage-Cw2oWAW2.js"),__vite__mapDeps([78,1,35,6,36,29,21]))),NU=x.lazy(()=>_e(()=>import("./IdentityPage-6_IEyGmH.js"),__vite__mapDeps([79,1,4,2,5,6,7,80,23,50,30]))),k0=x.lazy(()=>_e(()=>import("./UserSettingsPage-Dv6fSWWx.js"),__vite__mapDeps([81,1,4,30]))),MU=x.lazy(()=>_e(()=>import("./AuthSettingsPage-LU7DFMG6.js"),__vite__mapDeps([82,1,4,5,6,7,83,2,84]))),jU=x.lazy(()=>_e(()=>import("./ApiKeysSettingsPage-CFBTIYNp.js"),__vite__mapDeps([85,1,4,2,80,32,84]))),DU=x.lazy(()=>_e(()=>import("./SkillsSettingsPage-DPXiPnWO.js"),__vite__mapDeps([86,1,18]))),OU=x.lazy(()=>_e(()=>import("./IntegrationsSettingsPage-Cu-C86-i.js"),__vite__mapDeps([87,1,4,5,6,7,15]))),LU=x.lazy(()=>_e(()=>import("./GitSettingsPage-DIhaZgDD.js"),__vite__mapDeps([88,1,4,47,42,18,12,25]))),zU=x.lazy(()=>_e(()=>import("./McpSettingsPage-D6hW-2uy.js"),__vite__mapDeps([89,1,4,2,83,80,55,56,14,84,21]))),PU=x.lazy(()=>_e(()=>import("./PromptsSettingsPage-8--L7lw4.js"),__vite__mapDeps([90,1,4,5,6,7,2,50,62]))),IU=x.lazy(()=>_e(()=>import("./RulesSettingsPage-dzUPGors.js"),__vite__mapDeps([91,1,4,2]))),UU=x.lazy(()=>_e(()=>import("./NotificationsSettingsPage-DETz35D7.js"),__vite__mapDeps([92,1,4,83,5,6,7,33,12,25,42]))),BU=x.lazy(()=>_e(()=>import("./GitPage-BgfZ5rXn.js"),__vite__mapDeps([93,1,4,23,12,25,48,66,42,84,7,17]))),HU=x.lazy(()=>_e(()=>import("./SchedulePage-7Ufvzd34.js"),__vite__mapDeps([94,1,2,5,6,7,4,83,23,42,19,95,20,51]))),FU=x.lazy(()=>_e(()=>import("./JobDetailPage-BWd0sz7w.js"),__vite__mapDeps([96,28,1,2,29,19,30,51,42,95,20]))),qU=x.lazy(()=>_e(()=>import("./RunDetailPage-B9I5nrOb.js"),__vite__mapDeps([97,1,2,29,98,20]))),VU=x.lazy(()=>_e(()=>import("./UserPreferencesPage-D5nGgztl.js"),__vite__mapDeps([99,1,4,5,6,7]))),$U=x.lazy(()=>_e(()=>import("./ActivityPage-DqSj7XDx.js"),__vite__mapDeps([100,1,2,42]))),GU=x.lazy(()=>_e(()=>import("./MailInboxPage-B-mzoocZ.js"),__vite__mapDeps([101,1,2,102,98,20,42,103,7]))),YU=x.lazy(()=>_e(()=>import("./MailReadPage-DVVICNmn.js"),__vite__mapDeps([104,1,2,102,98,20,42,103,7]))),KU=x.lazy(()=>_e(()=>import("./MailSentPage-BmqXLEIF.js"),__vite__mapDeps([105,1,2,42,103,7]))),C0=x.lazy(()=>_e(()=>import("./NotFoundPage-CKcBMXOQ.js"),[]));function XU(){return g.jsxs(a_,{children:[g.jsx(hR,{children:g.jsx(x.Suspense,{fallback:g.jsx(jj,{}),children:g.jsxs(qT,{children:[g.jsx(we,{path:"/login",element:g.jsx(tU,{})}),g.jsx(we,{path:"/auth/github/callback",element:g.jsx(nU,{})}),g.jsx(we,{path:"/auth/callback",element:g.jsx(rU,{})}),g.jsxs(we,{path:"/",element:g.jsx(Mj,{children:g.jsx(X8,{})}),children:[g.jsx(we,{index:!0,element:g.jsx(eU,{})}),g.jsx(we,{path:"tasks",element:g.jsx(aU,{})}),g.jsx(we,{path:"tasks/new",element:g.jsx(oU,{})}),g.jsx(we,{path:"tasks/:id",element:g.jsx(iU,{})}),g.jsx(we,{path:"tasks/:id/edit",element:g.jsx(lU,{})}),g.jsx(we,{path:"agents",element:g.jsx(fU,{})}),g.jsx(we,{path:"utilities",element:g.jsx(cU,{})}),g.jsx(we,{path:"terminal",element:g.jsx(sU,{})}),g.jsx(we,{path:"terminal/:taskId",element:g.jsx(uU,{})}),g.jsx(we,{path:"git",element:g.jsx(BU,{})}),g.jsx(we,{path:"schedule",element:g.jsx(HU,{})}),g.jsx(we,{path:"schedule/:id",element:g.jsx(FU,{})}),g.jsx(we,{path:"schedule/:id/run/:runId",element:g.jsx(qU,{})}),g.jsx(we,{path:"identity",element:g.jsx(NU,{})}),g.jsx(we,{path:"skills",element:g.jsx(dU,{})}),g.jsx(we,{path:"skills/new",element:g.jsx(pU,{})}),g.jsx(we,{path:"skills/:id",element:g.jsx(hU,{})}),g.jsx(we,{path:"skills/:id/edit",element:g.jsx(mU,{})}),g.jsx(we,{path:"activity",element:g.jsx($U,{})}),g.jsx(we,{path:"resources",element:g.jsx(gU,{})}),g.jsx(we,{path:"resources/:id",element:g.jsx(yU,{})}),g.jsx(we,{path:"context/role",element:g.jsx(SU,{})}),g.jsx(we,{path:"context/role/edit",element:g.jsx(EU,{})}),g.jsx(we,{path:"context/agents",element:g.jsx(kU,{})}),g.jsx(we,{path:"context/agents/edit",element:g.jsx(CU,{})}),g.jsx(we,{path:"context/team",element:g.jsx(AU,{})}),g.jsx(we,{path:"context/team/edit",element:g.jsx(TU,{})}),g.jsx(we,{path:"context/memory",element:g.jsx(RU,{})}),g.jsx(we,{path:"context/memory/edit",element:g.jsx(_U,{})}),g.jsx(we,{path:"knowledge",element:g.jsx(vU,{})}),g.jsx(we,{path:"knowledge/new",element:g.jsx(wU,{})}),g.jsx(we,{path:"knowledge/:filename",element:g.jsx(xU,{})}),g.jsx(we,{path:"knowledge/:filename/edit",element:g.jsx(bU,{})}),g.jsxs(we,{path:"mail",element:g.jsx(J8,{}),children:[g.jsx(we,{index:!0,element:g.jsx(P0,{to:"inbox",replace:!0})}),g.jsx(we,{path:"inbox",element:g.jsx(GU,{})}),g.jsx(we,{path:"read",element:g.jsx(YU,{})}),g.jsx(we,{path:"sent",element:g.jsx(KU,{})})]}),g.jsxs(we,{path:"settings",element:g.jsx(Z8,{}),children:[g.jsx(we,{index:!0,element:g.jsx(k0,{})}),g.jsx(we,{path:"user",element:g.jsx(k0,{})}),g.jsx(we,{path:"preferences",element:g.jsx(VU,{})}),g.jsx(we,{path:"authentication",element:g.jsx(MU,{})}),g.jsx(we,{path:"api-keys",element:g.jsx(jU,{})}),g.jsx(we,{path:"skills",element:g.jsx(DU,{})}),g.jsx(we,{path:"integrations",element:g.jsx(OU,{})}),g.jsx(we,{path:"git",element:g.jsx(LU,{})}),g.jsx(we,{path:"mcp",element:g.jsx(zU,{})}),g.jsx(we,{path:"prompts",element:g.jsx(PU,{})}),g.jsx(we,{path:"rules",element:g.jsx(IU,{})}),g.jsx(we,{path:"notifications",element:g.jsx(UU,{})})]}),g.jsx(we,{path:"*",element:g.jsx(C0,{})})]}),g.jsx(we,{path:"*",element:g.jsx(C0,{})})]})})}),g.jsx(Nj,{})]})}XA.createRoot(document.getElementById("root")).render(g.jsx(x.StrictMode,{children:g.jsx(XU,{})}));export{ak as $,Et as A,pt as B,bN as C,Io as D,Hi as E,Zu as F,R1 as G,ZU as H,G1 as I,VI as J,sB as K,Vn as L,oh as M,$I as N,Vx as O,pM as P,OM as Q,JE as R,Fo as S,jM as T,ek as U,nk as V,rk as W,Zi as X,tk as Y,GM as Z,ik as _,u_ as a,pc as a$,oB as a0,ES as a1,RM as a2,os as a3,BM as a4,gM as a5,_j as a6,tB as a7,q8 as a8,V8 as a9,FM as aA,t6 as aB,s6 as aC,Iz as aD,Ho as aE,J5 as aF,wE as aG,ha as aH,pm as aI,c0 as aJ,Vt as aK,uB as aL,_o as aM,Sn as aN,Dc as aO,sl as aP,Te as aQ,He as aR,Ve as aS,it as aT,Xa as aU,cB as aV,fB as aW,Bz as aX,V5 as aY,sI as aZ,q5 as a_,RC as aa,NC as ab,MC as ac,Y8 as ad,Ku as ae,Xh as af,n_ as ag,Ip as ah,AN as ai,pl as aj,Xn as ak,Dp as al,me as am,Fe as an,Qe as ao,Tm as ap,JI as aq,Bw as ar,YI as as,Jx as at,s5 as au,MI as av,wI as aw,_C as ax,ON as ay,kN as az,il as b,fc as b0,P6 as b1,gI as b2,z6 as b3,Rc as b4,Qw as b5,Ga as b6,Zw as b7,qt as b8,Xo as b9,tM as bA,X1 as bB,bc as bC,cr as bD,D_ as bE,kt as bF,SN as bG,KN as bH,_1 as bI,sN as bJ,eB as bK,hN as bL,BN as bM,lN as bN,mb as bO,GN as bP,JN as bQ,NM as bR,Jw as ba,lw as bb,Fp as bc,nl as bd,Z1 as be,Hp as bf,Ko as bg,Ww as bh,Nk as bi,D9 as bj,j9 as bk,K1 as bl,L6 as bm,dI as bn,_6 as bo,or as bp,_e as bq,w4 as br,S4 as bs,E4 as bt,iB as bu,uS as bv,lB as bw,QU as bx,JU as by,lM as bz,ke as c,ll as d,ce as e,ol as f,Qi as g,Fu as h,wM as i,g as j,Ro as k,xM as l,mN as m,vN as n,Rk as o,bh as p,fN as q,x as r,on as s,J0 as t,Go as u,Wu as v,Vh as w,WU as x,ZR as y,nB as z};
497
+ `):null;return{type:A.includes("/edit")?"tasks-edit":"tasks-view",content:K,displayId:W,contextFiles:le}}return{type:"tasks",content:o,contextFiles:"role.md"}}return A.includes("/context")?A.includes("/knowledge")?{type:"context-knowledge",content:null}:{type:"context",content:null}:A.includes("/settings")?A.includes("/skills")?{type:"settings-skills",content:null}:A.includes("/integrations")?{type:"settings-integrations",content:null}:A.includes("/prompts")?{type:"settings-prompts",content:null}:A.includes("/rules")?{type:"settings-rules",content:null}:A.includes("/user")?{type:"settings-user",content:null}:{type:"settings",content:null}:A.includes("/terminal")?{type:"terminal",content:null}:{type:"dashboard",content:null}};return g.jsx(dS,{defaultOpen:!L,children:g.jsxs("div",{className:"flex min-h-screen w-full overflow-hidden",children:[g.jsx(K4,{}),g.jsxs(mS,{className:ce("flex-1 min-w-0 transition-all duration-300 ease-in-out",e&&"mr-96"),children:[g.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b border-content-border px-4 bg-background",children:[g.jsx(pS,{className:"-ml-1"}),g.jsxs("div",{className:"flex items-center justify-between flex-1",children:[g.jsx("h1",{className:"text-lg font-semibold",children:c||"Coconut"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(pt,{onClick:ee,size:"icon",className:"h-8 w-8 rounded-full",children:g.jsx(Fu,{className:"h-4 w-4"})}),_&&T&&g.jsxs(q8,{children:[g.jsx(V8,{asChild:!0,children:g.jsx(pt,{size:"icon",variant:"outline",className:"h-8 w-8 rounded-full",children:g.jsx(BM,{className:"h-4 w-4"})})}),g.jsxs(RC,{align:"end",children:[g.jsx(NC,{children:g.jsxs("div",{className:"flex flex-col space-y-1",children:[g.jsx("p",{className:"text-sm font-medium leading-none",children:T.name}),g.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:T.email})]})}),g.jsx(MC,{}),g.jsxs(_C,{onClick:P,children:[g.jsx(ZN,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})]})]}),g.jsx("main",{className:"flex flex-1 flex-col gap-4 p-4 overflow-auto bg-content-background",children:g.jsx(Rp,{})})]}),g.jsx(w9,{isOpen:e,onToggle:ee,contextInfo:re(),discussDocument:h,onDiscussDocumentHandled:()=>d(null),pendingPrompt:m,onPendingPromptHandled:()=>y(null),openInFullScreen:b,onFullScreenHandled:()=>w(!1),fullScreenNoEscape:G})]})})}const Q8=[{title:"Coconut Profile",href:"/settings/user",icon:zM,description:"Manage the Coconut's profile information."},{title:"User Preferences",href:"/settings/preferences",icon:EM,description:"Configure individual workspace preferences"},{title:"Authentication",href:"/settings/authentication",icon:wM,description:"Configure authentication and user access"},{title:"API Keys",href:"/settings/api-keys",icon:KN,description:"Manage API keys for programmatic access"},{title:"Symlinks",href:"/settings/rules",icon:Zu,description:"Manage symlinks for easy access to project rules and configurations"},{title:"AI & LLM",href:"/settings/integrations",icon:dM,description:"Connect Coconut to LLM providers and automation hooks"},{title:"Git",href:"/settings/git",icon:R1,description:"Configure repository defaults like worktree paths"},{title:"MCP",href:"/settings/mcp",icon:lM,description:"Model Context Protocol configuration and settings"},{title:"Notifications",href:"/settings/notifications",icon:sN,description:"Configure Slack notifications for Coconut events"}];function Z8(){const e=on();return g.jsxs("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0",children:[g.jsx("aside",{className:"lg:w-1/5",children:g.jsx("nav",{className:"flex overflow-x-auto pb-2 gap-1 lg:flex-col lg:gap-0 lg:space-y-1 lg:overflow-visible lg:pb-0",children:Q8.map(n=>g.jsxs(Vn,{to:n.href,className:ce("inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground h-9 px-2 sm:px-3 lg:px-4 py-2 hover:bg-accent justify-start flex-shrink-0",e.pathname===n.href?"bg-accent text-accent-foreground":"text-muted-foreground"),children:[g.jsx(n.icon,{className:"h-4 w-4 lg:mr-2"}),g.jsx("span",{className:"hidden lg:inline",children:n.title})]},n.href))})}),g.jsx("div",{className:"flex-1 lg:max-w-2xl",children:g.jsx("div",{className:"space-y-6",children:g.jsx(Rp,{})})})]})}const W8=[{title:"Inbox",href:"/mail/inbox",icon:GN,description:"Incoming emails"},{title:"Read",href:"/mail/read",icon:JN,description:"Emails you've already read"},{title:"Sent",href:"/mail/sent",icon:_1,description:"Emails you've sent"}];function J8(){const e=on();return g.jsxs("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0",children:[g.jsx("aside",{className:"lg:w-1/5",children:g.jsx("nav",{className:"flex overflow-x-auto pb-2 gap-1 lg:flex-col lg:gap-0 lg:space-y-1 lg:overflow-visible lg:pb-0",children:W8.map(n=>g.jsxs(Vn,{to:n.href,className:ce("inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground h-9 px-2 sm:px-3 lg:px-4 py-2 hover:bg-accent justify-start flex-shrink-0",e.pathname===n.href?"bg-accent text-accent-foreground":"text-muted-foreground"),children:[g.jsx(n.icon,{className:"h-4 w-4 lg:mr-2"}),g.jsx("span",{className:"hidden lg:inline",children:n.title})]},n.href))})}),g.jsx("div",{className:"flex-1",children:g.jsx("div",{className:"space-y-6",children:g.jsx(Rp,{})})})]})}const eU=x.lazy(()=>_e(()=>import("./DashboardPage-CAxisL8l.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),tU=x.lazy(()=>_e(()=>import("./LoginPage-DXRpkMQE.js"),__vite__mapDeps([22,4,1,23]))),nU=x.lazy(()=>_e(()=>import("./CallbackPage-j_Z5gQid.js"),__vite__mapDeps([24,12,25]))),rU=x.lazy(()=>_e(()=>import("./CoconutCallbackPage-ZEdMiq56.js"),[])),aU=x.lazy(()=>_e(()=>import("./TasksPage-XJv3kCi4.js"),__vite__mapDeps([26,1,2,5,6,7,3,14,13]))),iU=x.lazy(()=>_e(()=>import("./TaskDetailPage-CIzKy_lB.js"),__vite__mapDeps([27,28,1,2,4,5,6,7,3,29,30,31,32,19,20,33]))),lU=x.lazy(()=>_e(()=>import("./TaskEditPage-DE5iZOlS.js"),__vite__mapDeps([34,4,5,6,7,1,35,36,37,38,39,2,29])).then(e=>({default:e.TaskEditPage}))),oU=x.lazy(()=>_e(()=>import("./NewTaskPage-DhUlLdQA.js"),__vite__mapDeps([40,1,4,35,6,36,5,7,37,38,39,2,29])).then(e=>({default:e.NewTaskPage}))),sU=x.lazy(()=>_e(()=>import("./TerminalPage-1wX_kSZq.js"),__vite__mapDeps([41,1,8,9,10,11,42,43,7,19,44,45]))),uU=x.lazy(()=>_e(()=>import("./TerminalSessionPage-C9DF64yx.js"),__vite__mapDeps([46,1,2,5,6,7,47,37,4,8,10,11,48,49,16,42,19,50,51,33,45]))),cU=x.lazy(()=>_e(()=>import("./UtilitiesPage-CtZZsdkO.js"),__vite__mapDeps([52,1,8,44,19]))),fU=x.lazy(()=>_e(()=>import("./CodePage-LOMEoK8O.js"),__vite__mapDeps([53,1,2,8,9,10,11,5,6,7,49,42,43,19,16,51]))),dU=x.lazy(()=>_e(()=>import("./SkillsPage-Ba-7nPAX.js"),__vite__mapDeps([54,1,28,55,2,56,14]))),hU=x.lazy(()=>_e(()=>import("./SkillDetailPage-K_CkFQv-.js"),__vite__mapDeps([57,1,2,29]))),pU=x.lazy(()=>_e(()=>import("./NewSkillPage-e8dGvY9r.js"),__vite__mapDeps([58,1,4,2,28,29,30]))),mU=x.lazy(()=>_e(()=>import("./SkillEditPage-2X3bZgJ0.js"),__vite__mapDeps([59,1,4,2,28,29,30]))),gU=x.lazy(()=>_e(()=>import("./ResourcesPage-5e8iv04j.js"),__vite__mapDeps([60,1,4,2,28,5,6,7,56,61,62,13,63,14]))),yU=x.lazy(()=>_e(()=>import("./ResourceDetailPage-5lxrzduZ.js"),__vite__mapDeps([64,2,28,29,61,62,63]))),vU=x.lazy(()=>_e(()=>import("./KnowledgePage-B3G3eWhs.js"),__vite__mapDeps([65,1,2,28,55,56,14,31,66,48]))),xU=x.lazy(()=>_e(()=>import("./KnowledgeDetailPage-jdJGqZT9.js"),__vite__mapDeps([67,1,2,28,29,63,18]))),bU=x.lazy(()=>_e(()=>import("./KnowledgeEditPage-C60yLCQf.js"),__vite__mapDeps([68,1,4,35,6,36,39,2,69,18,29]))),wU=x.lazy(()=>_e(()=>import("./NewKnowledgePage-X86yjTVl.js"),__vite__mapDeps([70,1,4,35,6,36,39,2,69,18,29]))),SU=x.lazy(()=>_e(()=>import("./RolePage-DH1XSfmN.js"),__vite__mapDeps([71,1,28]))),EU=x.lazy(()=>_e(()=>import("./RoleEditPage-CZl5kzLm.js"),__vite__mapDeps([72,1,4,5,6,7,35,36,29,21]))),kU=x.lazy(()=>_e(()=>import("./AgentsContextPage-DbGPK_nF.js"),__vite__mapDeps([73,1,28]))),CU=x.lazy(()=>_e(()=>import("./AgentsContextEditPage-DD96j1Gu.js"),__vite__mapDeps([74,1,35,6,36,29,21]))),AU=x.lazy(()=>_e(()=>import("./TeamPage-8HQl8tJg.js"),__vite__mapDeps([75,1,28]))),TU=x.lazy(()=>_e(()=>import("./TeamEditPage-BJYjNG9s.js"),__vite__mapDeps([76,1,35,6,36,29,21]))),RU=x.lazy(()=>_e(()=>import("./MemoryPage-BTOJoF-z.js"),__vite__mapDeps([77,1,28]))),_U=x.lazy(()=>_e(()=>import("./MemoryEditPage-fFwS44vf.js"),__vite__mapDeps([78,1,35,6,36,29,21]))),NU=x.lazy(()=>_e(()=>import("./IdentityPage-IVZ-nvh_.js"),__vite__mapDeps([79,1,4,2,5,6,7,80,23,50,30]))),k0=x.lazy(()=>_e(()=>import("./UserSettingsPage-oGRL6qzb.js"),__vite__mapDeps([81,1,4,30]))),MU=x.lazy(()=>_e(()=>import("./AuthSettingsPage-BZcuolzF.js"),__vite__mapDeps([82,1,4,5,6,7,83,2,84]))),jU=x.lazy(()=>_e(()=>import("./ApiKeysSettingsPage-DCRw8BVU.js"),__vite__mapDeps([85,1,4,2,80,32,84]))),DU=x.lazy(()=>_e(()=>import("./SkillsSettingsPage-w64_WHIP.js"),__vite__mapDeps([86,1,18]))),OU=x.lazy(()=>_e(()=>import("./IntegrationsSettingsPage-DvzES04i.js"),__vite__mapDeps([87,1,4,5,6,7,15]))),LU=x.lazy(()=>_e(()=>import("./GitSettingsPage-CKWWrG0f.js"),__vite__mapDeps([88,1,4,47,42,18,12,25]))),zU=x.lazy(()=>_e(()=>import("./McpSettingsPage-D2UXUhK2.js"),__vite__mapDeps([89,1,4,2,83,80,55,56,14,84,21]))),PU=x.lazy(()=>_e(()=>import("./PromptsSettingsPage-DS-7Hcyy.js"),__vite__mapDeps([90,1,4,5,6,7,2,50,62]))),IU=x.lazy(()=>_e(()=>import("./RulesSettingsPage-CfHyX5-L.js"),__vite__mapDeps([91,1,4,2]))),UU=x.lazy(()=>_e(()=>import("./NotificationsSettingsPage-YWyp3_fq.js"),__vite__mapDeps([92,1,4,83,5,6,7,33,12,25,42]))),BU=x.lazy(()=>_e(()=>import("./GitPage-BzVIV2mo.js"),__vite__mapDeps([93,1,4,23,12,25,48,66,42,84,7,17]))),HU=x.lazy(()=>_e(()=>import("./SchedulePage-DK3H_i1s.js"),__vite__mapDeps([94,1,2,5,6,7,4,83,23,42,19,95,20,51]))),FU=x.lazy(()=>_e(()=>import("./JobDetailPage-DVKKQ1j7.js"),__vite__mapDeps([96,28,1,2,29,19,30,51,42,95,20]))),qU=x.lazy(()=>_e(()=>import("./RunDetailPage-CKvjq6lg.js"),__vite__mapDeps([97,1,2,29,98,20]))),VU=x.lazy(()=>_e(()=>import("./UserPreferencesPage-soBs08Yv.js"),__vite__mapDeps([99,1,4,5,6,7]))),$U=x.lazy(()=>_e(()=>import("./ActivityPage-BrpfoR1x.js"),__vite__mapDeps([100,1,2,42]))),GU=x.lazy(()=>_e(()=>import("./MailInboxPage-D4F-yUb2.js"),__vite__mapDeps([101,1,2,102,98,20,42,103,7]))),YU=x.lazy(()=>_e(()=>import("./MailReadPage-Bn6Zw8xJ.js"),__vite__mapDeps([104,1,2,102,98,20,42,103,7]))),KU=x.lazy(()=>_e(()=>import("./MailSentPage-Bk3jJOzz.js"),__vite__mapDeps([105,1,2,42,103,7]))),C0=x.lazy(()=>_e(()=>import("./NotFoundPage-BjIfj-6G.js"),[]));function XU(){return g.jsxs(a_,{children:[g.jsx(hR,{children:g.jsx(x.Suspense,{fallback:g.jsx(jj,{}),children:g.jsxs(qT,{children:[g.jsx(we,{path:"/login",element:g.jsx(tU,{})}),g.jsx(we,{path:"/auth/github/callback",element:g.jsx(nU,{})}),g.jsx(we,{path:"/auth/callback",element:g.jsx(rU,{})}),g.jsxs(we,{path:"/",element:g.jsx(Mj,{children:g.jsx(X8,{})}),children:[g.jsx(we,{index:!0,element:g.jsx(eU,{})}),g.jsx(we,{path:"tasks",element:g.jsx(aU,{})}),g.jsx(we,{path:"tasks/new",element:g.jsx(oU,{})}),g.jsx(we,{path:"tasks/:id",element:g.jsx(iU,{})}),g.jsx(we,{path:"tasks/:id/edit",element:g.jsx(lU,{})}),g.jsx(we,{path:"agents",element:g.jsx(fU,{})}),g.jsx(we,{path:"utilities",element:g.jsx(cU,{})}),g.jsx(we,{path:"terminal",element:g.jsx(sU,{})}),g.jsx(we,{path:"terminal/:taskId",element:g.jsx(uU,{})}),g.jsx(we,{path:"git",element:g.jsx(BU,{})}),g.jsx(we,{path:"schedule",element:g.jsx(HU,{})}),g.jsx(we,{path:"schedule/:id",element:g.jsx(FU,{})}),g.jsx(we,{path:"schedule/:id/run/:runId",element:g.jsx(qU,{})}),g.jsx(we,{path:"identity",element:g.jsx(NU,{})}),g.jsx(we,{path:"skills",element:g.jsx(dU,{})}),g.jsx(we,{path:"skills/new",element:g.jsx(pU,{})}),g.jsx(we,{path:"skills/:id",element:g.jsx(hU,{})}),g.jsx(we,{path:"skills/:id/edit",element:g.jsx(mU,{})}),g.jsx(we,{path:"activity",element:g.jsx($U,{})}),g.jsx(we,{path:"resources",element:g.jsx(gU,{})}),g.jsx(we,{path:"resources/:id",element:g.jsx(yU,{})}),g.jsx(we,{path:"context/role",element:g.jsx(SU,{})}),g.jsx(we,{path:"context/role/edit",element:g.jsx(EU,{})}),g.jsx(we,{path:"context/agents",element:g.jsx(kU,{})}),g.jsx(we,{path:"context/agents/edit",element:g.jsx(CU,{})}),g.jsx(we,{path:"context/team",element:g.jsx(AU,{})}),g.jsx(we,{path:"context/team/edit",element:g.jsx(TU,{})}),g.jsx(we,{path:"context/memory",element:g.jsx(RU,{})}),g.jsx(we,{path:"context/memory/edit",element:g.jsx(_U,{})}),g.jsx(we,{path:"knowledge",element:g.jsx(vU,{})}),g.jsx(we,{path:"knowledge/new",element:g.jsx(wU,{})}),g.jsx(we,{path:"knowledge/:filename",element:g.jsx(xU,{})}),g.jsx(we,{path:"knowledge/:filename/edit",element:g.jsx(bU,{})}),g.jsxs(we,{path:"mail",element:g.jsx(J8,{}),children:[g.jsx(we,{index:!0,element:g.jsx(P0,{to:"inbox",replace:!0})}),g.jsx(we,{path:"inbox",element:g.jsx(GU,{})}),g.jsx(we,{path:"read",element:g.jsx(YU,{})}),g.jsx(we,{path:"sent",element:g.jsx(KU,{})})]}),g.jsxs(we,{path:"settings",element:g.jsx(Z8,{}),children:[g.jsx(we,{index:!0,element:g.jsx(k0,{})}),g.jsx(we,{path:"user",element:g.jsx(k0,{})}),g.jsx(we,{path:"preferences",element:g.jsx(VU,{})}),g.jsx(we,{path:"authentication",element:g.jsx(MU,{})}),g.jsx(we,{path:"api-keys",element:g.jsx(jU,{})}),g.jsx(we,{path:"skills",element:g.jsx(DU,{})}),g.jsx(we,{path:"integrations",element:g.jsx(OU,{})}),g.jsx(we,{path:"git",element:g.jsx(LU,{})}),g.jsx(we,{path:"mcp",element:g.jsx(zU,{})}),g.jsx(we,{path:"prompts",element:g.jsx(PU,{})}),g.jsx(we,{path:"rules",element:g.jsx(IU,{})}),g.jsx(we,{path:"notifications",element:g.jsx(UU,{})})]}),g.jsx(we,{path:"*",element:g.jsx(C0,{})})]}),g.jsx(we,{path:"*",element:g.jsx(C0,{})})]})})}),g.jsx(Nj,{})]})}XA.createRoot(document.getElementById("root")).render(g.jsx(x.StrictMode,{children:g.jsx(XU,{})}));export{ak as $,Et as A,pt as B,bN as C,Io as D,Hi as E,Zu as F,R1 as G,ZU as H,G1 as I,VI as J,sB as K,Vn as L,oh as M,$I as N,Vx as O,pM as P,OM as Q,JE as R,Fo as S,jM as T,ek as U,nk as V,rk as W,Zi as X,tk as Y,GM as Z,ik as _,u_ as a,pc as a$,oB as a0,ES as a1,RM as a2,os as a3,BM as a4,gM as a5,_j as a6,tB as a7,q8 as a8,V8 as a9,FM as aA,t6 as aB,s6 as aC,Iz as aD,Ho as aE,J5 as aF,wE as aG,ha as aH,pm as aI,c0 as aJ,Vt as aK,uB as aL,_o as aM,Sn as aN,Dc as aO,sl as aP,Te as aQ,He as aR,Ve as aS,it as aT,Xa as aU,cB as aV,fB as aW,Bz as aX,V5 as aY,sI as aZ,q5 as a_,RC as aa,NC as ab,MC as ac,Y8 as ad,Ku as ae,Xh as af,n_ as ag,Ip as ah,AN as ai,pl as aj,Xn as ak,Dp as al,me as am,Fe as an,Qe as ao,Tm as ap,JI as aq,Bw as ar,YI as as,Jx as at,s5 as au,MI as av,wI as aw,_C as ax,ON as ay,kN as az,il as b,fc as b0,P6 as b1,gI as b2,z6 as b3,Rc as b4,Qw as b5,Ga as b6,Zw as b7,qt as b8,Xo as b9,tM as bA,X1 as bB,bc as bC,cr as bD,D_ as bE,kt as bF,SN as bG,KN as bH,_1 as bI,sN as bJ,eB as bK,hN as bL,BN as bM,lN as bN,mb as bO,GN as bP,JN as bQ,NM as bR,Jw as ba,lw as bb,Fp as bc,nl as bd,Z1 as be,Hp as bf,Ko as bg,Ww as bh,Nk as bi,D9 as bj,j9 as bk,K1 as bl,L6 as bm,dI as bn,_6 as bo,or as bp,_e as bq,w4 as br,S4 as bs,E4 as bt,iB as bu,uS as bv,lB as bw,QU as bx,JU as by,lM as bz,ke as c,ll as d,ce as e,ol as f,Qi as g,Fu as h,wM as i,g as j,Ro as k,xM as l,mN as m,vN as n,Rk as o,bh as p,fN as q,x as r,on as s,J0 as t,Go as u,Wu as v,Vh as w,WU as x,ZR as y,nB as z};