@tickernelz/wardmote-ui 2026.1114.1 → 2026.1114.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 (124) hide show
  1. package/dist/assets/{ActiveAgentsPanel-CKzCe8AC.js → ActiveAgentsPanel-Budj8e9v.js} +1 -1
  2. package/dist/assets/{AdapterManager-DFPaPUUr.js → AdapterManager-DhiW44Eo.js} +1 -1
  3. package/dist/assets/{AdvancedToolsRoute-CN5fWS4T.js → AdvancedToolsRoute-CICI1XRd.js} +1 -1
  4. package/dist/assets/{AgentActionButtons-a9LacJPP.js → AgentActionButtons-DIhpv51Y.js} +1 -1
  5. package/dist/assets/{AgentChat-D5FDUYuV.js → AgentChat-CeuGtMXr.js} +1 -1
  6. package/dist/assets/{AgentChats-TN5SE_gN.js → AgentChats-CmDtTrMa.js} +1 -1
  7. package/dist/assets/{AgentDefaults-CiVVS_pQ.js → AgentDefaults-DpYaMGkf.js} +1 -1
  8. package/dist/assets/{AgentDetail-bCAmWRXs.js → AgentDetail-DFTeFc4-.js} +1 -1
  9. package/dist/assets/{AgentTodoCard-BpmvHEsm.js → AgentTodoCard-DRXZ7hmU.js} +1 -1
  10. package/dist/assets/{Agents-CToMMxGu.js → Agents-CClUUMUq.js} +3 -3
  11. package/dist/assets/{AppDetail-P807ou0a.js → AppDetail-DfHLFOtj.js} +1 -1
  12. package/dist/assets/{AppNotConnected-DuA4PukX.js → AppNotConnected-CcmXbFtD.js} +1 -1
  13. package/dist/assets/{ApprovalCard-BDdZDBMj.js → ApprovalCard-uT_9D_uH.js} +1 -1
  14. package/dist/assets/{ApprovalDetail-CVgy1uNi.js → ApprovalDetail-CE41WFbd.js} +1 -1
  15. package/dist/assets/{ApprovalPayload-H5zW6yQ4.js → ApprovalPayload-_zU9bukt.js} +1 -1
  16. package/dist/assets/{Approvals-DL6kx45P.js → Approvals-BXrjqpKc.js} +1 -1
  17. package/dist/assets/{AppsReview-Bf7oB0ES.js → AppsReview-C0Y3SxmZ.js} +1 -1
  18. package/dist/assets/{ArtifactCard-Cp4KPgZl.js → ArtifactCard-DKUUBZ0K.js} +1 -1
  19. package/dist/assets/{Artifacts-Dz3eHCaQ.js → Artifacts-Bsv5m0aU.js} +1 -1
  20. package/dist/assets/{AssistantConnection-5Y4fBVXq.js → AssistantConnection-Dm2PaSeU.js} +1 -1
  21. package/dist/assets/{AttentionInteractionResolver-DlP6a6AG.js → AttentionInteractionResolver-CBjNuhYo.js} +1 -1
  22. package/dist/assets/{AuditHub-Dz2UXl0c.js → AuditHub-DbUni0O_.js} +1 -1
  23. package/dist/assets/{BoardChat-DsMVXf5M.js → BoardChat-CgzCuFIL.js} +1 -1
  24. package/dist/assets/{BootstrapSetupUxLab-CWWisaHp.js → BootstrapSetupUxLab-D-niQCV5.js} +1 -1
  25. package/dist/assets/{Browse-Be6aSv-F.js → Browse-0bmB5mqw.js} +1 -1
  26. package/dist/assets/{BudgetPolicyCard-Dka022-Z.js → BudgetPolicyCard-CqFUHqOj.js} +1 -1
  27. package/dist/assets/{CaseDetail-DdJrlm0m.js → CaseDetail-DakrB2jI.js} +1 -1
  28. package/dist/assets/{Cases-Da1szfrr.js → Cases-DXbr4HJt.js} +1 -1
  29. package/dist/assets/{ChatEndpointDetail-DSOH-zfs.js → ChatEndpointDetail-BdDKo-Gq.js} +1 -1
  30. package/dist/assets/{ChatEndpointSetup-J23lq-xi.js → ChatEndpointSetup-BX3iDH7N.js} +1 -1
  31. package/dist/assets/{ChoiceControls-B9yrYshK.js → ChoiceControls-Bu-fd6qI.js} +1 -1
  32. package/dist/assets/{Companies-BkHWSxdB.js → Companies-FcUNLIkt.js} +1 -1
  33. package/dist/assets/{CompanyAccess-BaiGlxY1.js → CompanyAccess-BUcTNg7_.js} +1 -1
  34. package/dist/assets/{CompanyActivity-CMBXXwCw.js → CompanyActivity-ScpRBz1G.js} +1 -1
  35. package/dist/assets/{CompanyConnections-CVzsivTW.js → CompanyConnections-DMEwbZv7.js} +1 -1
  36. package/dist/assets/{CompanyEnvironments-K7piWRrx.js → CompanyEnvironments-EqXhVruZ.js} +1 -1
  37. package/dist/assets/{CompanyExport-Bo8tUPaY.js → CompanyExport-DQ9ffuua.js} +1 -1
  38. package/dist/assets/{CompanyImport-CBVjSXPA.js → CompanyImport-BhuZu4oc.js} +1 -1
  39. package/dist/assets/{CompanySettings-CuU9qSp5.js → CompanySettings-BSkg4ahA.js} +1 -1
  40. package/dist/assets/{CompanySettingsPluginPage-59_bMQQ3.js → CompanySettingsPluginPage-BzZkZqh-.js} +1 -1
  41. package/dist/assets/{CompanySkills-GBJMThWx.js → CompanySkills-BbA4RKIw.js} +1 -1
  42. package/dist/assets/{ConfigureBuiltInAgentModal-D8Xnl51H.js → ConfigureBuiltInAgentModal-BUJPbmWc.js} +1 -1
  43. package/dist/assets/{CopyableGatewayUrl-GuvA-DoQ.js → CopyableGatewayUrl-BZyE_jT9.js} +1 -1
  44. package/dist/assets/{Dashboard-Cgj9BeTt.js → Dashboard--lTwxjV-.js} +1 -1
  45. package/dist/assets/{DashboardLive-Ku1cHAj9.js → DashboardLive-BYyTgF5d.js} +1 -1
  46. package/dist/assets/{DecisionDateChips-Z97mgInq.js → DecisionDateChips-vXwAFdua.js} +1 -1
  47. package/dist/assets/{DecisionQueuePage-D8cyKm4V.js → DecisionQueuePage-BaaKuZBi.js} +1 -1
  48. package/dist/assets/{DesignGuide-DvO3NaE-.js → DesignGuide-DS6MuXWY.js} +1 -1
  49. package/dist/assets/{EmailEndpointSetup-Cm_KKjjw.js → EmailEndpointSetup-CJFYu2G0.js} +1 -1
  50. package/dist/assets/{ExecutionWorkspaceDetail-CVB4ZY8I.js → ExecutionWorkspaceDetail-CuD5xWOB.js} +1 -1
  51. package/dist/assets/{GatewayDetail-DB1J44bF.js → GatewayDetail-xNVOxSIs.js} +1 -1
  52. package/dist/assets/{GatewaysList-CKSwMmOi.js → GatewaysList-DsSKLm1h.js} +1 -1
  53. package/dist/assets/{GoalDetail-Bscma2qU.js → GoalDetail-oN5pyUUY.js} +1 -1
  54. package/dist/assets/{GoalTree-jEFB788p.js → GoalTree-DaFizciF.js} +1 -1
  55. package/dist/assets/{Goals-jLNZ4UKT.js → Goals-xgGKfQZi.js} +1 -1
  56. package/dist/assets/{ImageGalleryModal-CghUxjQC.js → ImageGalleryModal-CjHED0Lb.js} +1 -1
  57. package/dist/assets/{Inbox-DHwNNh-Z.js → Inbox-wHhHozfr.js} +1 -1
  58. package/dist/assets/{InstanceAdvanced-C5IIPBwh.js → InstanceAdvanced-Bdf2a4c_.js} +1 -1
  59. package/dist/assets/{InviteLanding-BHmCRaWY.js → InviteLanding-McBYpNeW.js} +1 -1
  60. package/dist/assets/{IssueChatLongThreadPerf-JH8rtLk0.js → IssueChatLongThreadPerf-DD3RLbBo.js} +1 -1
  61. package/dist/assets/{IssueChatThread-ByTyrsxz.js → IssueChatThread-BN-_8hT8.js} +1 -1
  62. package/dist/assets/{IssueDetail-BIif8Swu.js → IssueDetail-CsaD311l.js} +1 -1
  63. package/dist/assets/{IssueOutputSection-CFE6aU9L.js → IssueOutputSection-CDIMRaF0.js} +1 -1
  64. package/dist/assets/{IssueRecoveryActionCard-DBgE7aMm.js → IssueRecoveryActionCard-C9qJAHes.js} +1 -1
  65. package/dist/assets/{IssueThreadInteractionCard-C3LFe8cu.js → IssueThreadInteractionCard-BbigJB2U.js} +1 -1
  66. package/dist/assets/{Issues-B5QG33RC.js → Issues-BWoc80Y9.js} +1 -1
  67. package/dist/assets/{LiveNowTodoLine-D52WDE8-.js → LiveNowTodoLine-B9oTH2L0.js} +1 -1
  68. package/dist/assets/{ManagedAiConnectionDetails-C9nV0oIT.js → ManagedAiConnectionDetails-B0aWUPkf.js} +1 -1
  69. package/dist/assets/{McpConnect-Bk8Qskqw.js → McpConnect-Dzf7W2K6.js} +1 -1
  70. package/dist/assets/{MembershipAction-DjdBY6Bk.js → MembershipAction-oiLtxQm3.js} +1 -1
  71. package/dist/assets/{ModelsAndProviders-BtbhNxf_.js → ModelsAndProviders-BEb4Z38S.js} +1 -1
  72. package/dist/assets/{NewAgent-C4JqnMkp.js → NewAgent-C3MxIRJj.js} +1 -1
  73. package/dist/assets/{OmpAllSettings-aHENTYf5.js → OmpAllSettings-DBtL1qDL.js} +1 -1
  74. package/dist/assets/{PipelineSettings-CCoxV9Es.js → PipelineSettings-BcAtsehE.js} +1 -1
  75. package/dist/assets/{Pipelines-DaQPh688.js → Pipelines-CkiYUQS-.js} +1 -1
  76. package/dist/assets/{PixelsOffice-D1X7mdpk.js → PixelsOffice-BSlctoug.js} +1 -1
  77. package/dist/assets/{PluginPage-B4kdPADI.js → PluginPage-C6Qnf9ka.js} +1 -1
  78. package/dist/assets/{PluginSettings-yP8NX-sM.js → PluginSettings-Do37r6Zu.js} +1 -1
  79. package/dist/assets/{ProfileDetailRoute-DMdAvFmb.js → ProfileDetailRoute-DRFQNId6.js} +1 -1
  80. package/dist/assets/{ProfileSettings-DVm3Tqzs.js → ProfileSettings-BMwLBQDB.js} +1 -1
  81. package/dist/assets/{ProfileWizardRoute-CijS7-aN.js → ProfileWizardRoute-XnnvzH9S.js} +1 -1
  82. package/dist/assets/{ProjectDetail-DeLSGbmz.js → ProjectDetail-BW6Lr4Iq.js} +1 -1
  83. package/dist/assets/{ProjectWorkspaceDetail-DPajDjA-.js → ProjectWorkspaceDetail-DR4JCa1b.js} +1 -1
  84. package/dist/assets/{ProjectWorkspacesContent-BCATCcZI.js → ProjectWorkspacesContent-CadPZn0k.js} +1 -1
  85. package/dist/assets/{Projects-DPmo6PFV.js → Projects-DLBFbxcj.js} +1 -1
  86. package/dist/assets/{PublicIssueSharePage-B_W1Qpy_.js → PublicIssueSharePage-C9yRZOdP.js} +1 -1
  87. package/dist/assets/{ReviewQueueCard-DhfCjwYP.js → ReviewQueueCard-CIkiY-Lm.js} +1 -1
  88. package/dist/assets/{RichWorkProductCard-rJC8tWnB.js → RichWorkProductCard-JGHGU_RI.js} +1 -1
  89. package/dist/assets/{RoutineDetail-Cb0oYk5B.js → RoutineDetail-izWzADvA.js} +1 -1
  90. package/dist/assets/{RoutineRunVariablesDialog-CWNUGmiH.js → RoutineRunVariablesDialog-DiT_o5Dm.js} +1 -1
  91. package/dist/assets/{Routines-Ct6W3Ht-.js → Routines-CHtabiYj.js} +1 -1
  92. package/dist/assets/{ScrollToBottom-BvL4b3BQ.js → ScrollToBottom-pyHLjOjY.js} +1 -1
  93. package/dist/assets/{Search-CXiBakEC.js → Search-yNNB6kys.js} +1 -1
  94. package/dist/assets/{Secrets-XUpMCMhK.js → Secrets-BOyOk5BF.js} +1 -1
  95. package/dist/assets/{SkillSourceTree-Brg47aIX.js → SkillSourceTree-M58QwBFF.js} +1 -1
  96. package/dist/assets/{SkillSources-C3kuN9Hz.js → SkillSources-Cw4PU-Bz.js} +1 -1
  97. package/dist/assets/{SkillStudio-DVVVKjdn.js → SkillStudio-Cj_M3ZJa.js} +1 -1
  98. package/dist/assets/{SourceTrustBadge-D-MXuX_l.js → SourceTrustBadge-BZBQe5No.js} +1 -1
  99. package/dist/assets/{StatusCards-BmNOGr1d.js → StatusCards-DaJdQUN5.js} +1 -1
  100. package/dist/assets/{SummarySlotCard-DiTaQ4km.js → SummarySlotCard-DlSmN6PL.js} +1 -1
  101. package/dist/assets/{TaskChatLab-fOJfHKjI.js → TaskChatLab-CU5eA7nX.js} +1 -1
  102. package/dist/assets/{TaskChatMarker-Cgyrmeab.js → TaskChatMarker-wBVUFL3u.js} +1 -1
  103. package/dist/assets/{TaskChatProtocolCard-DrIe_IYV.js → TaskChatProtocolCard-D-Dwy2EL.js} +1 -1
  104. package/dist/assets/{TaskChatThreadView-DKqNA1fZ.js → TaskChatThreadView-Crlf9I05.js} +1 -1
  105. package/dist/assets/{TaskDetailRelationsPanel-C9mJfMvL.js → TaskDetailRelationsPanel-CkktN1EC.js} +1 -1
  106. package/dist/assets/{TaskTreeControls-B1CSnDVK.js → TaskTreeControls-B_ulMOi1.js} +1 -1
  107. package/dist/assets/{Terminal-CGmILZtz.js → Terminal-Bo-WuezO.js} +1 -1
  108. package/dist/assets/{TerminalView-BqCU9Vc3.js → TerminalView-AkFY5bLC.js} +1 -1
  109. package/dist/assets/{TrustPresetSection-D4qB_VZo.js → TrustPresetSection-DTc1Rj4q.js} +1 -1
  110. package/dist/assets/{UserProfile-Cavc3nhB.js → UserProfile-C6q55R0Q.js} +1 -1
  111. package/dist/assets/{WhatNeedsMe-B7BSt_wb.js → WhatNeedsMe-1igJA4gL.js} +1 -1
  112. package/dist/assets/{Workspaces-CDTiwIHd.js → Workspaces-rtQKliW0.js} +1 -1
  113. package/dist/assets/{connection-owner-Cx9obLlP.js → connection-owner-CZwxTEuM.js} +1 -1
  114. package/dist/assets/{index-B7mmhFG7.js → index-DDoARkPG.js} +3 -3
  115. package/dist/assets/{issue-properties-C_y5-tny.js → issue-properties-lmRBaUTG.js} +1 -1
  116. package/dist/assets/{issue-workspace-selection-ChtddJZC.js → issue-workspace-selection-4JI2Uh9p.js} +1 -1
  117. package/dist/assets/{pipeline-stage-presentation-jxAxpF6f.js → pipeline-stage-presentation-BSuBql6K.js} +1 -1
  118. package/dist/assets/{shared-hwt7Xn4W.js → shared-DDwmHbeD.js} +1 -1
  119. package/dist/assets/{tool-taxonomy-6170LibQ.js → tool-taxonomy-DR7Q8sVs.js} +1 -1
  120. package/dist/assets/{transcript-adapter-C9uEslxp.js → transcript-adapter-wiFIjKfq.js} +1 -1
  121. package/dist/assets/{useSummaryDraftStream-BulT3Wwh.js → useSummaryDraftStream-CWOQt25o.js} +1 -1
  122. package/dist/index.html +1 -1
  123. package/dist/sw.js +1 -1
  124. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prod-COP_vZWu.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/TaskChatLab-fOJfHKjI.js","assets/createLucideIcon-DJi9suAC.js","assets/check-Ctsrlfa-.js","assets/circle-IAHLDvLO.js","assets/copy-_wvZOjTe.js","assets/button-CMwV3L1P.js","assets/dist-BuHnL0GV.js","assets/dist-CtvMIwRC.js","assets/minus-WOgDAWiC.js","assets/pause-CJSwJvLv.js","assets/play-CJNuUj69.js","assets/plus-C6fnr28l.js","assets/rotate-ccw-CQEJ4ewP.js","assets/TaskChatThreadView-DKqNA1fZ.js","assets/star-BZgQbzhV.js","assets/preload-helper-CceJXRIF.js","assets/ArtifactCard-Cp4KPgZl.js","assets/router-2UfGeejU.js","assets/queryKeys-DYV5MhM_.js","assets/CompanyContext-CSrVsSze.js","assets/companies-query-D9PxIiMT.js","assets/popover-BhYHYj7q.js","assets/dist-Bm2igrAN.js","assets/dist-SzpVz8Pd.js","assets/dist-CClcSLHe.js","assets/es2015-C3hhXnTu.js","assets/boxes-fV98p9-r.js","assets/circle-dot-zr8GONq2.js","assets/package-CYC5MDhY.js","assets/search-04O7m-IF.js","assets/shield-BhaVQdWV.js","assets/terminal-C0CKe_Zz.js","assets/external-link-nl1b263c.js","assets/attachment-icon-4xDiQblX.js","assets/use-copy-action-D5dEzo6L.js","assets/ToastContext-DMdt9oTd.js","assets/clipboard-CTLKYvRL.js","assets/arrow-down-Dg4PKbmt.js","assets/chevron-down-BCvxsWfI.js","assets/chevron-right-s7L6hXXq.js","assets/tool-taxonomy-6170LibQ.js","assets/circle-question-mark-B1jR2is9.js","assets/file-pen-line-DX6PZQXR.js","assets/RichWorkProductCard-rJC8tWnB.js","assets/file-text-Cw7ntqRx.js","assets/file-N19tC0jj.js","assets/maximize-2-DgliXYEr.js","assets/server-DIhG4RDC.js","assets/github-icon-Bbgf67tg.js","assets/ImageGalleryModal-CghUxjQC.js","assets/dist-DC4EOH0g.js","assets/chevron-left-DP4zwC0G.js","assets/x-DRDFdlYE.js","assets/issue-output-CU3gasZ1.js","assets/network-RCsafDTP.js","assets/shield-check-B0HVjzM_.js","assets/MarkdownBody-BTjuUgFa.js","assets/mention-chips-D8856Q0_.js","assets/agent-avatar-url-C-slYk2A.js","assets/color-contrast-BHHcEMtO.js","assets/archive-CTfe4zq5.js","assets/circle-x-CFlSbYzD.js","assets/clock-CzrJT_cP.js","assets/file-code-corner-CmZ_RihF.js","assets/folder-open-8WDYv4mw.js","assets/git-pull-request-CdCSG7CL.js","assets/key-round-0RqEOB_C.js","assets/octagon-alert-CeNhknXC.js","assets/agents-DmlgUVso.js","assets/usePrefersReducedMotion-Dw81-akd.js","assets/ThemeContext-DYRUK81c.js","assets/StatusIcon-0GcYXDdN.js","assets/task-chat-attachments-jZNCAKd4.js","assets/TaskChatMarker-Cgyrmeab.js","assets/bot-C9arfJWx.js","assets/flag-R0AVTKGk.js","assets/info-DXpx_HA2.js","assets/octagon-x-CBcXy1zJ.js","assets/TaskChatProtocolCard-DrIe_IYV.js","assets/QuestionForm-B8-PWz3B.js","assets/MarkdownEditor-DXD-Cu3u.js","assets/dist-DTFX_1D6.js","assets/dist-DOIzg2vq.js","assets/dist-DcOFbG-W.js","assets/dist-DMg_vOQs.js","assets/dist-CvHBQVAC.js","assets/dist-BNOqBr2U.js","assets/calendar-clock-BVFltraz.js","assets/user-Ccom_Ph0.js","assets/AgentAvatar-DgGEobSY.js","assets/Identity-Cv_2a9qJ.js","assets/avatar-UO226cef.js","assets/routines-KPtwxuS7.js","assets/activity-BVYJmFzR.js","assets/dist-BhxPxuMy.js","assets/message-square-plus-yRlSBxPl.js","assets/input-DobnTAyB.js","assets/TaskChatComposerTakeoverContext-BJAHPHve.js","assets/triangle-alert-CBVKiaXB.js","assets/dialog-CKUblzlR.js","assets/textarea-BRPEfJ-g.js","assets/square-B2aH51tE.js","assets/users-DyKzwIh4.js","assets/presentation-mode-Bk6TnKr9.js","assets/list-todo-BmObdeVq.js","assets/shield-question-mark-D1_en6pn.js","assets/shield-x-D-Ice3nf.js","assets/system-notice-comment-CL_SWj_f.js","assets/label-BPz3pg9_.js","assets/heartbeats-DOyojsaN.js","assets/email-BNu4jmOH.js","assets/transcript-adapter-C9uEslxp.js","assets/AgentBubbleActionRow-DIr3TdR9.js","assets/dropdown-menu-CqRAF7Oj.js","assets/ellipsis-BTiLRUn4.js","assets/thumbs-down-C2BkjZOy.js","assets/thumbs-up-OW2IsTL7.js","assets/tooltip-B5WQ3lq5.js","assets/Cases-Da1szfrr.js","assets/checkbox-BHQhs41k.js","assets/arrow-up-down-Bpe9xqCo.js","assets/columns-3-CqC5nP-p.js","assets/funnel-DWwD2WCu.js","assets/badge-DuA2EgZC.js","assets/projects-mixWrT5q.js","assets/BreadcrumbContext-BVZDZoC0.js","assets/cases-m9RZ5Cym.js","assets/CaseIdentifierKey-D8Xi16PS.js","assets/FilterBar-5ta25FCb.js","assets/CaseDetail-DdJrlm0m.js","assets/IssueDocumentAnnotations-BVdH4RTa.js","assets/sheet-jd7y5x4-.js","assets/tabs-B2Os_leL.js","assets/ellipsis-vertical-DWXPf6Ow.js","assets/issue-properties-C_y5-tny.js","assets/issue-attribution-DfN_3u2W.js","assets/WorkspaceRuntimeControls-T4YUoZvK.js","assets/activity-CB9AQzZO.js","assets/useManagedSandboxOnly-CO01cDK4.js","assets/instanceSettings-D8g_QlS-.js","assets/archive-restore-DeLPtKS0.js","assets/arrow-right-BL5kYtCZ.js","assets/arrow-up-right-BLYWl-we.js","assets/repeat-DGPKlc5I.js","assets/inboxArchiveCache-D8QGdg49.js","assets/access-GAosX22P.js","assets/assignees-DkQNbPzi.js","assets/AgentIdentity-I_kB4rMX.js","assets/recent-selections-BnN_nb6Y.js","assets/recent-assignees-DmalYaLf.js","assets/InlineEntitySelector-v2Q4C8oT.js","assets/useMobileEntityPickerViewportStyle-C3R37KtS.js","assets/issue-blockers-DLfa24KC.js","assets/eye-DRS7RbEp.js","assets/refresh-cw-B_Oki9wZ.js","assets/TaskDetailRelationsPanel-C9mJfMvL.js","assets/query-placeholder-data-Bg4z2kcq.js","assets/SourceTrustBadge-D-MXuX_l.js","assets/badge-check-Bd7IYIB2.js","assets/circle-alert-C-L4OsHh.js","assets/shield-alert-Be9GuMrS.js","assets/InlineBanner-VQ5mstsR.js","assets/runRetryState-BdjK4QQj.js","assets/IssueReferencePill-DAEplgLd.js","assets/review-policy-BL48kYvb.js","assets/user-check-BoBa1Xs_.js","assets/user-minus-B4F-9ccK.js","assets/separator-B2LFqBpM.js","assets/issue-workspace-selection-ChtddJZC.js","assets/list-filter-h7_mdWEH.js","assets/trash-D7zTaHTj.js","assets/select-V0Hm_q4f.js","assets/chevron-up-rFDQGA-7.js","assets/chip-DsDe6yck.js","assets/card-Bru3x_SJ.js","assets/useAutosaveIndicator-DttGFwx7.js","assets/FoldCurtain-DUAOdtCt.js","assets/line-diff-DAcZgvm2.js","assets/DocumentFrameHeader-DTSqcw4Q.js","assets/Dashboard-Cgj9BeTt.js","assets/flask-conical-CEYKkO5k.js","assets/layout-dashboard-DClZjSaR.js","assets/MootMark-DZAfkwdv.js","assets/useSharedPolling-D4Xn8mY2.js","assets/slots-Dw517dxP.js","assets/SidebarContext-CF3RWLxh.js","assets/plugins-CF2QITJB.js","assets/instance-settings-QXUWVmQs.js","assets/IssueReferenceActivitySummary-CbpSjmdV.js","assets/activity-format-zP89NM00.js","assets/MetricCard-DaAh5x_N.js","assets/ActiveAgentsPanel-CKzCe8AC.js","assets/useQueries-BIJ7zVTy.js","assets/IssueChatThread-ByTyrsxz.js","assets/ConnectionSetupFlow-DKjP5RBZ.js","assets/connection-identity-YKZfppDS.js","assets/queryClient-BOli2vjj.js","assets/collapsible-CqjPlqOa.js","assets/alert-dialog-Blls2GnU.js","assets/PathInstructionsModal-D4GUYKIT.js","assets/arrow-left-Ce_LIut0.js","assets/SearchableSelect-CIJ5K8ih.js","assets/command-Ca3v36Mu.js","assets/searchable-select-fvMNMcqm.js","assets/environment-variables-editor-CCxeFKKk.js","assets/eye-off-CVVA-EWh.js","assets/save-CJ1Iqyew.js","assets/user-round-CGxsJ0K8.js","assets/model-DidtFy-U.js","assets/proposal-review-kucrRJgS.js","assets/server-cog-DV4ua9lY.js","assets/secrets-CZifgF0J.js","assets/inbox-C08arfF_.js","assets/link-2-CND-9QZ2.js","assets/SetupWizard-C8qzkJn1.js","assets/skeleton-Bv_lQagE.js","assets/tools-B-L_sU_9.js","assets/AppLogo-CZr1Y48O.js","assets/assets-TRDkBfss.js","assets/toggle-switch-BHxNtSq9.js","assets/model-picker-fields-235ien8Z.js","assets/arrow-up-D_YoSnQD.js","assets/AgentMultiSelect-DsJfZtR2.js","assets/radio-card-DVZaXlw0.js","assets/JsonSchemaForm-ixDd6e-N.js","assets/schema-config-fields-DggSrP5S.js","assets/agent-config-primitives-BsZUnbf2.js","assets/adapter-display-registry-Bk0KWAHT.js","assets/environments-BLQs1ScE.js","assets/AgentSetupPrompt-DYBB5Med.js","assets/managed-sandbox-environment-B8DewKvK.js","assets/dynamic-loader-ehitOaJV.js","assets/adapters-Dp0USyWg.js","assets/use-adapter-capabilities-Bu8XkVZ9.js","assets/AgentCharacter-BTEn5MBu.js","assets/app-connect-policy-CUzbEnhU.js","assets/responsible-user-denial-Dyl0BwU5.js","assets/ComposerAddMenu-D9z2INup.js","assets/IssueThreadInteractionCard-C3LFe8cu.js","assets/plug-VjpaJcMq.js","assets/interaction-card-visibility-DcyO470L.js","assets/interaction-audience-BRS_4X7S.js","assets/AgentMailCredentialField-L4T0REEW.js","assets/run-log-chunks-ZnzOvrXs.js","assets/useSecondTick-Gige2l0t.js","assets/IssueRecoveryActionCard-DBgE7aMm.js","assets/execution-projection-BGI5f3kX.js","assets/workspace-restore-Dz-CzQw6.js","assets/CommentAttributionChip-fz5Mn0RW.js","assets/LiveNowTodoLine-D52WDE8-.js","assets/AgentTodoCard-BpmvHEsm.js","assets/smoke-lab-matrix-0BhnGQeo.js","assets/DashboardLive-Ku1cHAj9.js","assets/Companies-BkHWSxdB.js","assets/Agents-CToMMxGu.js","assets/useAgentChatEnabled-Chi_JXJj.js","assets/useHiddenSettings-CcaZfHLD.js","assets/health-DF7yrggW.js","assets/AgentRoleEditor-DTKNKZXs.js","assets/EntityRow-BIfupmlZ.js","assets/AgentDetail-bCAmWRXs.js","assets/useInfiniteQuery-B28xptxn.js","assets/ScrollToBottom-BvL4b3BQ.js","assets/scroll-area-P1KpIQWe.js","assets/braces-BEVhwPeU.js","assets/chatEndpoints-BKsIHowE.js","assets/ConfigureBuiltInAgentModal-D8Xnl51H.js","assets/model-fallback-X_YvC3rj.js","assets/ResponsibleUserDenialNotice-DKNk1-BK.js","assets/user-x-CRO9YVVi.js","assets/omp-settings-model-uqWvMNr2.js","assets/ChoiceControls-B9yrYshK.js","assets/SkillCardIcon-BTCafp8l.js","assets/CopyText-Cr673_Kx.js","assets/MembershipAction-DjdBY6Bk.js","assets/log-in-nSyhNjrD.js","assets/AgentActionButtons-a9LacJPP.js","assets/TrustPresetSection-D4qB_VZo.js","assets/EnforcementBanner-DWPluRU0.js","assets/shared-hwt7Xn4W.js","assets/OmpAllSettings-aHENTYf5.js","assets/Projects-DPmo6PFV.js","assets/ProjectDetail-DeLSGbmz.js","assets/link-BITB8yRp.js","assets/BudgetPolicyCard-Dka022-Z.js","assets/AccessSelectIdentity-Dp--1kWe.js","assets/InlineEditor-BKBqNA21.js","assets/SummarySlotCard-DiTaQ4km.js","assets/useSummaryDraftStream-BulT3Wwh.js","assets/budgets-DvML2uxG.js","assets/ProjectWorkspacesContent-BCATCcZI.js","assets/ProjectWorkspaceDetail-DPajDjA-.js","assets/MissingPluginTabPlaceholder-DT47WyQq.js","assets/Workspaces-CDTiwIHd.js","assets/Issues-B5QG33RC.js","assets/Inbox-DHwNNh-Z.js","assets/issue-filters-BO9xiK0c.js","assets/ApprovalPayload-H5zW6yQ4.js","assets/scroll-text-BpkOrME3.js","assets/Search-CXiBakEC.js","assets/file-question-mark-CTomlKBX.js","assets/IssueDetail-BIif8Swu.js","assets/IssueWriteDenialNotice-BCJ74Czu.js","assets/TerminalView-BqCU9Vc3.js","assets/clipboard-paste-D9rNPVFj.js","assets/rotate-cw-DnCrcS38.js","assets/terminal-font-B-qtwS34.js","assets/cloud-BktKFMPI.js","assets/file-search-DZpRLS-j.js","assets/folder-search-D0WkVTZt.js","assets/radio-DnDOdgWd.js","assets/settings-DuZndeX2.js","assets/browser-use-D2HTf8rD.js","assets/TaskTreeControls-B1CSnDVK.js","assets/code-xml-BWc3OvMt.js","assets/issueActiveRun-s6f-GUHq.js","assets/ApprovalCard-BDdZDBMj.js","assets/issue-share-j9E_vLuf.js","assets/artifacts-9HWeqVeB.js","assets/AgentChats-TN5SE_gN.js","assets/recent-agent-chats-DIU_z_qg.js","assets/AgentChat-D5FDUYuV.js","assets/agentChats-CjHr739f.js","assets/IssueChatLongThreadPerf-JH8rtLk0.js","assets/Routines-Ct6W3Ht-.js","assets/audit-navigation-IalprBz0.js","assets/FolderControls-B7TWghGc.js","assets/RoutineRunVariablesDialog-CWNUGmiH.js","assets/Pipelines-DaQPh688.js","assets/pipeline-stage-presentation-jxAxpF6f.js","assets/folder-git-2-D2Hz-CeQ.js","assets/pipelines-vN196fc4.js","assets/PipelineSettings-CCoxV9Es.js","assets/RoutineVariablesEditor-0dQ10yPY.js","assets/StatusCards-BmNOGr1d.js","assets/wand-sparkles-BqnbLKl3.js","assets/PixelsOffice-D1X7mdpk.js","assets/coins-C6QoCoLN.js","assets/AttentionInteractionResolver-DlP6a6AG.js","assets/RoutineDetail-Cb0oYk5B.js","assets/pen-line-CxWwoiP_.js","assets/webhook-BVBCKjlU.js","assets/WebhookUrlWarning-D0GLAS0A.js","assets/RoutineActivityRow-B69N6Hcy.js","assets/UserProfile-Cavc3nhB.js","assets/ExecutionWorkspaceDetail-CVB4ZY8I.js","assets/Goals-jLNZ4UKT.js","assets/GoalTree-jEFB788p.js","assets/Artifacts-Dz3eHCaQ.js","assets/GoalDetail-Bscma2qU.js","assets/Approvals-DL6kx45P.js","assets/ApprovalDetail-CVgy1uNi.js","assets/CompanyActivity-CMBXXwCw.js","assets/AuditHub-Dz2UXl0c.js","assets/arrow-down-left-C8jhGqM0.js","assets/decision-models-CD2AFC2a.js","assets/fast-responses-DZodQpLv.js","assets/QuotaBar-_ok6Pek4.js","assets/WhatNeedsMe-B7BSt_wb.js","assets/DecisionDateChips-Z97mgInq.js","assets/sun-_NIddwh7.js","assets/DecisionQueuePage-D8cyKm4V.js","assets/BoardChat-DsMVXf5M.js","assets/circle-slash-Bx5HrFMb.js","assets/send-mNwfi_F1.js","assets/CompanySettings-CuU9qSp5.js","assets/DecisionModelSettings-NrNERkaW.js","assets/CompanyConnections-CVzsivTW.js","assets/CompanyEnvironments-K7piWRrx.js","assets/BootstrapSetupUxLab-CWWisaHp.js","assets/ResponsibleUserDenialUxLab-Bt9vnHJz.js","assets/CrossIssueCollaborationUxLab-CEh5B2iJ.js","assets/CompanySettingsPluginPage-59_bMQQ3.js","assets/CompanyAccess-BaiGlxY1.js","assets/AdvancedToolsRoute-CN5fWS4T.js","assets/power-B3xsPeS4.js","assets/profile-summary-unutni_7.js","assets/useProfilesData-2L3_71Ql.js","assets/ProfileWizardRoute-CijS7-aN.js","assets/ToolsAdminGate-BI5-WYC3.js","assets/ProfileDetailRoute-DMdAvFmb.js","assets/Browse-Be6aSv-F.js","assets/ManagedAiConnectionDetails-C9nV0oIT.js","assets/retired-composio-DrxhEOpx.js","assets/connection-owner-Cx9obLlP.js","assets/AssistantConnection-5Y4fBVXq.js","assets/AppsConnect-DH7aSjtS.js","assets/skill-source-connect-return-C3vV7DQP.js","assets/ChatEndpointSetup-J23lq-xi.js","assets/EmailEndpointSetup-Cm_KKjjw.js","assets/OpenwaGatewayManager-DH3bF7fa.js","assets/ChatEndpointDetail-DSOH-zfs.js","assets/EmailConnectionAccess-DAFMofYX.js","assets/ChatIdentityConfirm-DCI5BnWo.js","assets/AppsReview-Bf7oB0ES.js","assets/ReviewQueueCard-DhfCjwYP.js","assets/AppDetail-P807ou0a.js","assets/AppNotConnected-DuA4PukX.js","assets/GatewaysList-CKSwMmOi.js","assets/CopyableGatewayUrl-GuvA-DoQ.js","assets/GatewayDetail-DB1J44bF.js","assets/CompanySkills-GBJMThWx.js","assets/SkillBinaryFile-DNe-MmCv.js","assets/company-skill-routes-D5LJ1l8M.js","assets/SkillSources-C3kuN9Hz.js","assets/SkillSourceTree-Brg47aIX.js","assets/SkillStudio-DVVVKjdn.js","assets/AgentIconPicker-D87bSkxE.js","assets/resizable-panels-Qjbo0P05.js","assets/IssueOutputSection-CFE6aU9L.js","assets/Secrets-XUpMCMhK.js","assets/CompanyImport-CBVjSXPA.js","assets/agent-order-BE-pAWdx.js","assets/sidebarPreferences-vEHBC54I.js","assets/portable-files-CloN_vbk.js","assets/DesignGuide-DvO3NaE-.js","assets/RepositoryEditor-CFt-HPgf.js","assets/ThemeToggle-BWFlFnSX.js","assets/InstanceFeatures-DUQnBkxy.js","assets/useInstanceFeatureSettings-CEK6Xn3o.js","assets/AgentDefaults-CiVVS_pQ.js","assets/ModelsAndProviders-BtbhNxf_.js","assets/InstanceAdvanced-C5IIPBwh.js","assets/InstanceAccess-Ns2rAmva.js","assets/ProfileSettings-DVm3Tqzs.js","assets/PluginManager-4rrrAOLG.js","assets/PluginSettings-yP8NX-sM.js","assets/AdapterManager-DFPaPUUr.js","assets/PluginPage-B4kdPADI.js","assets/NewAgent-C4JqnMkp.js","assets/Auth-_P9t1YSS.js","assets/invite-memory-CHGcQdLs.js","assets/BoardClaim-CsomHmd6.js","assets/McpConnect-Bk8Qskqw.js","assets/CliAuth-CRG0c0EH.js","assets/InviteLanding-BHmCRaWY.js","assets/PublicIssueSharePage-B_W1Qpy_.js","assets/JoinRequestQueue-ZZq3jWW-.js","assets/CompanyExport-Bo8tUPaY.js","assets/Terminal-CGmILZtz.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prod-COP_vZWu.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/TaskChatLab-CU5eA7nX.js","assets/createLucideIcon-DJi9suAC.js","assets/check-Ctsrlfa-.js","assets/circle-IAHLDvLO.js","assets/copy-_wvZOjTe.js","assets/button-CMwV3L1P.js","assets/dist-BuHnL0GV.js","assets/dist-CtvMIwRC.js","assets/minus-WOgDAWiC.js","assets/pause-CJSwJvLv.js","assets/play-CJNuUj69.js","assets/plus-C6fnr28l.js","assets/rotate-ccw-CQEJ4ewP.js","assets/TaskChatThreadView-Crlf9I05.js","assets/star-BZgQbzhV.js","assets/preload-helper-CceJXRIF.js","assets/ArtifactCard-DKUUBZ0K.js","assets/router-2UfGeejU.js","assets/queryKeys-DYV5MhM_.js","assets/CompanyContext-CSrVsSze.js","assets/companies-query-D9PxIiMT.js","assets/popover-BhYHYj7q.js","assets/dist-Bm2igrAN.js","assets/dist-SzpVz8Pd.js","assets/dist-CClcSLHe.js","assets/es2015-C3hhXnTu.js","assets/boxes-fV98p9-r.js","assets/circle-dot-zr8GONq2.js","assets/package-CYC5MDhY.js","assets/search-04O7m-IF.js","assets/shield-BhaVQdWV.js","assets/terminal-C0CKe_Zz.js","assets/external-link-nl1b263c.js","assets/attachment-icon-4xDiQblX.js","assets/use-copy-action-D5dEzo6L.js","assets/ToastContext-DMdt9oTd.js","assets/clipboard-CTLKYvRL.js","assets/arrow-down-Dg4PKbmt.js","assets/chevron-down-BCvxsWfI.js","assets/chevron-right-s7L6hXXq.js","assets/tool-taxonomy-DR7Q8sVs.js","assets/circle-question-mark-B1jR2is9.js","assets/file-pen-line-DX6PZQXR.js","assets/RichWorkProductCard-JGHGU_RI.js","assets/file-text-Cw7ntqRx.js","assets/file-N19tC0jj.js","assets/maximize-2-DgliXYEr.js","assets/server-DIhG4RDC.js","assets/github-icon-Bbgf67tg.js","assets/ImageGalleryModal-CjHED0Lb.js","assets/dist-DC4EOH0g.js","assets/chevron-left-DP4zwC0G.js","assets/x-DRDFdlYE.js","assets/issue-output-CU3gasZ1.js","assets/network-RCsafDTP.js","assets/shield-check-B0HVjzM_.js","assets/MarkdownBody-BTjuUgFa.js","assets/mention-chips-D8856Q0_.js","assets/agent-avatar-url-C-slYk2A.js","assets/color-contrast-BHHcEMtO.js","assets/archive-CTfe4zq5.js","assets/circle-x-CFlSbYzD.js","assets/clock-CzrJT_cP.js","assets/file-code-corner-CmZ_RihF.js","assets/folder-open-8WDYv4mw.js","assets/git-pull-request-CdCSG7CL.js","assets/key-round-0RqEOB_C.js","assets/octagon-alert-CeNhknXC.js","assets/agents-DmlgUVso.js","assets/usePrefersReducedMotion-Dw81-akd.js","assets/ThemeContext-DYRUK81c.js","assets/StatusIcon-0GcYXDdN.js","assets/task-chat-attachments-jZNCAKd4.js","assets/TaskChatMarker-wBVUFL3u.js","assets/bot-C9arfJWx.js","assets/flag-R0AVTKGk.js","assets/info-DXpx_HA2.js","assets/octagon-x-CBcXy1zJ.js","assets/TaskChatProtocolCard-D-Dwy2EL.js","assets/QuestionForm-B8-PWz3B.js","assets/MarkdownEditor-DXD-Cu3u.js","assets/dist-DTFX_1D6.js","assets/dist-DOIzg2vq.js","assets/dist-DcOFbG-W.js","assets/dist-DMg_vOQs.js","assets/dist-CvHBQVAC.js","assets/dist-BNOqBr2U.js","assets/calendar-clock-BVFltraz.js","assets/user-Ccom_Ph0.js","assets/AgentAvatar-DgGEobSY.js","assets/Identity-Cv_2a9qJ.js","assets/avatar-UO226cef.js","assets/routines-KPtwxuS7.js","assets/activity-BVYJmFzR.js","assets/dist-BhxPxuMy.js","assets/message-square-plus-yRlSBxPl.js","assets/input-DobnTAyB.js","assets/TaskChatComposerTakeoverContext-BJAHPHve.js","assets/triangle-alert-CBVKiaXB.js","assets/dialog-CKUblzlR.js","assets/textarea-BRPEfJ-g.js","assets/square-B2aH51tE.js","assets/users-DyKzwIh4.js","assets/presentation-mode-Bk6TnKr9.js","assets/list-todo-BmObdeVq.js","assets/shield-question-mark-D1_en6pn.js","assets/shield-x-D-Ice3nf.js","assets/system-notice-comment-CL_SWj_f.js","assets/label-BPz3pg9_.js","assets/heartbeats-DOyojsaN.js","assets/email-BNu4jmOH.js","assets/transcript-adapter-wiFIjKfq.js","assets/AgentBubbleActionRow-DIr3TdR9.js","assets/dropdown-menu-CqRAF7Oj.js","assets/ellipsis-BTiLRUn4.js","assets/thumbs-down-C2BkjZOy.js","assets/thumbs-up-OW2IsTL7.js","assets/tooltip-B5WQ3lq5.js","assets/Cases-DXbr4HJt.js","assets/checkbox-BHQhs41k.js","assets/arrow-up-down-Bpe9xqCo.js","assets/columns-3-CqC5nP-p.js","assets/funnel-DWwD2WCu.js","assets/badge-DuA2EgZC.js","assets/projects-mixWrT5q.js","assets/BreadcrumbContext-BVZDZoC0.js","assets/cases-m9RZ5Cym.js","assets/CaseIdentifierKey-D8Xi16PS.js","assets/FilterBar-5ta25FCb.js","assets/CaseDetail-DakrB2jI.js","assets/IssueDocumentAnnotations-BVdH4RTa.js","assets/sheet-jd7y5x4-.js","assets/tabs-B2Os_leL.js","assets/ellipsis-vertical-DWXPf6Ow.js","assets/issue-properties-lmRBaUTG.js","assets/issue-attribution-DfN_3u2W.js","assets/WorkspaceRuntimeControls-T4YUoZvK.js","assets/activity-CB9AQzZO.js","assets/useManagedSandboxOnly-CO01cDK4.js","assets/instanceSettings-D8g_QlS-.js","assets/archive-restore-DeLPtKS0.js","assets/arrow-right-BL5kYtCZ.js","assets/arrow-up-right-BLYWl-we.js","assets/repeat-DGPKlc5I.js","assets/inboxArchiveCache-D8QGdg49.js","assets/access-GAosX22P.js","assets/assignees-DkQNbPzi.js","assets/AgentIdentity-I_kB4rMX.js","assets/recent-selections-BnN_nb6Y.js","assets/recent-assignees-DmalYaLf.js","assets/InlineEntitySelector-v2Q4C8oT.js","assets/useMobileEntityPickerViewportStyle-C3R37KtS.js","assets/issue-blockers-DLfa24KC.js","assets/eye-DRS7RbEp.js","assets/refresh-cw-B_Oki9wZ.js","assets/TaskDetailRelationsPanel-CkktN1EC.js","assets/query-placeholder-data-Bg4z2kcq.js","assets/SourceTrustBadge-BZBQe5No.js","assets/badge-check-Bd7IYIB2.js","assets/circle-alert-C-L4OsHh.js","assets/shield-alert-Be9GuMrS.js","assets/InlineBanner-VQ5mstsR.js","assets/runRetryState-BdjK4QQj.js","assets/IssueReferencePill-DAEplgLd.js","assets/review-policy-BL48kYvb.js","assets/user-check-BoBa1Xs_.js","assets/user-minus-B4F-9ccK.js","assets/separator-B2LFqBpM.js","assets/issue-workspace-selection-4JI2Uh9p.js","assets/list-filter-h7_mdWEH.js","assets/trash-D7zTaHTj.js","assets/select-V0Hm_q4f.js","assets/chevron-up-rFDQGA-7.js","assets/chip-DsDe6yck.js","assets/card-Bru3x_SJ.js","assets/useAutosaveIndicator-DttGFwx7.js","assets/FoldCurtain-DUAOdtCt.js","assets/line-diff-DAcZgvm2.js","assets/DocumentFrameHeader-DTSqcw4Q.js","assets/Dashboard--lTwxjV-.js","assets/flask-conical-CEYKkO5k.js","assets/layout-dashboard-DClZjSaR.js","assets/MootMark-DZAfkwdv.js","assets/useSharedPolling-D4Xn8mY2.js","assets/slots-Dw517dxP.js","assets/SidebarContext-CF3RWLxh.js","assets/plugins-CF2QITJB.js","assets/instance-settings-QXUWVmQs.js","assets/IssueReferenceActivitySummary-CbpSjmdV.js","assets/activity-format-zP89NM00.js","assets/MetricCard-DaAh5x_N.js","assets/ActiveAgentsPanel-Budj8e9v.js","assets/useQueries-BIJ7zVTy.js","assets/IssueChatThread-BN-_8hT8.js","assets/ConnectionSetupFlow-DKjP5RBZ.js","assets/connection-identity-YKZfppDS.js","assets/queryClient-BOli2vjj.js","assets/collapsible-CqjPlqOa.js","assets/alert-dialog-Blls2GnU.js","assets/PathInstructionsModal-D4GUYKIT.js","assets/arrow-left-Ce_LIut0.js","assets/SearchableSelect-CIJ5K8ih.js","assets/command-Ca3v36Mu.js","assets/searchable-select-fvMNMcqm.js","assets/environment-variables-editor-CCxeFKKk.js","assets/eye-off-CVVA-EWh.js","assets/save-CJ1Iqyew.js","assets/user-round-CGxsJ0K8.js","assets/model-DidtFy-U.js","assets/proposal-review-kucrRJgS.js","assets/server-cog-DV4ua9lY.js","assets/secrets-CZifgF0J.js","assets/inbox-C08arfF_.js","assets/link-2-CND-9QZ2.js","assets/SetupWizard-C8qzkJn1.js","assets/skeleton-Bv_lQagE.js","assets/tools-B-L_sU_9.js","assets/AppLogo-CZr1Y48O.js","assets/assets-TRDkBfss.js","assets/toggle-switch-BHxNtSq9.js","assets/model-picker-fields-235ien8Z.js","assets/arrow-up-D_YoSnQD.js","assets/AgentMultiSelect-DsJfZtR2.js","assets/radio-card-DVZaXlw0.js","assets/JsonSchemaForm-ixDd6e-N.js","assets/schema-config-fields-DggSrP5S.js","assets/agent-config-primitives-BsZUnbf2.js","assets/adapter-display-registry-Bk0KWAHT.js","assets/environments-BLQs1ScE.js","assets/AgentSetupPrompt-DYBB5Med.js","assets/managed-sandbox-environment-B8DewKvK.js","assets/dynamic-loader-ehitOaJV.js","assets/adapters-Dp0USyWg.js","assets/use-adapter-capabilities-Bu8XkVZ9.js","assets/AgentCharacter-BTEn5MBu.js","assets/app-connect-policy-CUzbEnhU.js","assets/responsible-user-denial-Dyl0BwU5.js","assets/ComposerAddMenu-D9z2INup.js","assets/IssueThreadInteractionCard-BbigJB2U.js","assets/plug-VjpaJcMq.js","assets/interaction-card-visibility-DcyO470L.js","assets/interaction-audience-BRS_4X7S.js","assets/AgentMailCredentialField-L4T0REEW.js","assets/run-log-chunks-ZnzOvrXs.js","assets/useSecondTick-Gige2l0t.js","assets/IssueRecoveryActionCard-C9qJAHes.js","assets/execution-projection-BGI5f3kX.js","assets/workspace-restore-Dz-CzQw6.js","assets/CommentAttributionChip-fz5Mn0RW.js","assets/LiveNowTodoLine-B9oTH2L0.js","assets/AgentTodoCard-DRXZ7hmU.js","assets/smoke-lab-matrix-0BhnGQeo.js","assets/DashboardLive-BYyTgF5d.js","assets/Companies-FcUNLIkt.js","assets/Agents-CClUUMUq.js","assets/useAgentChatEnabled-Chi_JXJj.js","assets/useHiddenSettings-CcaZfHLD.js","assets/health-DF7yrggW.js","assets/AgentRoleEditor-DTKNKZXs.js","assets/EntityRow-BIfupmlZ.js","assets/AgentDetail-DFTeFc4-.js","assets/useInfiniteQuery-B28xptxn.js","assets/ScrollToBottom-pyHLjOjY.js","assets/scroll-area-P1KpIQWe.js","assets/braces-BEVhwPeU.js","assets/chatEndpoints-BKsIHowE.js","assets/ConfigureBuiltInAgentModal-BUJPbmWc.js","assets/model-fallback-X_YvC3rj.js","assets/ResponsibleUserDenialNotice-DKNk1-BK.js","assets/user-x-CRO9YVVi.js","assets/omp-settings-model-uqWvMNr2.js","assets/ChoiceControls-Bu-fd6qI.js","assets/SkillCardIcon-BTCafp8l.js","assets/CopyText-Cr673_Kx.js","assets/MembershipAction-oiLtxQm3.js","assets/log-in-nSyhNjrD.js","assets/AgentActionButtons-DIhpv51Y.js","assets/TrustPresetSection-DTc1Rj4q.js","assets/EnforcementBanner-DWPluRU0.js","assets/shared-DDwmHbeD.js","assets/OmpAllSettings-DBtL1qDL.js","assets/Projects-DLBFbxcj.js","assets/ProjectDetail-BW6Lr4Iq.js","assets/link-BITB8yRp.js","assets/BudgetPolicyCard-CqFUHqOj.js","assets/AccessSelectIdentity-Dp--1kWe.js","assets/InlineEditor-BKBqNA21.js","assets/SummarySlotCard-DlSmN6PL.js","assets/useSummaryDraftStream-CWOQt25o.js","assets/budgets-DvML2uxG.js","assets/ProjectWorkspacesContent-CadPZn0k.js","assets/ProjectWorkspaceDetail-DR4JCa1b.js","assets/MissingPluginTabPlaceholder-DT47WyQq.js","assets/Workspaces-rtQKliW0.js","assets/Issues-BWoc80Y9.js","assets/Inbox-wHhHozfr.js","assets/issue-filters-BO9xiK0c.js","assets/ApprovalPayload-_zU9bukt.js","assets/scroll-text-BpkOrME3.js","assets/Search-yNNB6kys.js","assets/file-question-mark-CTomlKBX.js","assets/IssueDetail-CsaD311l.js","assets/IssueWriteDenialNotice-BCJ74Czu.js","assets/TerminalView-AkFY5bLC.js","assets/clipboard-paste-D9rNPVFj.js","assets/rotate-cw-DnCrcS38.js","assets/terminal-font-B-qtwS34.js","assets/cloud-BktKFMPI.js","assets/file-search-DZpRLS-j.js","assets/folder-search-D0WkVTZt.js","assets/radio-DnDOdgWd.js","assets/settings-DuZndeX2.js","assets/browser-use-D2HTf8rD.js","assets/TaskTreeControls-B_ulMOi1.js","assets/code-xml-BWc3OvMt.js","assets/issueActiveRun-s6f-GUHq.js","assets/ApprovalCard-uT_9D_uH.js","assets/issue-share-j9E_vLuf.js","assets/artifacts-9HWeqVeB.js","assets/AgentChats-CmDtTrMa.js","assets/recent-agent-chats-DIU_z_qg.js","assets/AgentChat-CeuGtMXr.js","assets/agentChats-CjHr739f.js","assets/IssueChatLongThreadPerf-DD3RLbBo.js","assets/Routines-CHtabiYj.js","assets/audit-navigation-IalprBz0.js","assets/FolderControls-B7TWghGc.js","assets/RoutineRunVariablesDialog-DiT_o5Dm.js","assets/Pipelines-CkiYUQS-.js","assets/pipeline-stage-presentation-BSuBql6K.js","assets/folder-git-2-D2Hz-CeQ.js","assets/pipelines-vN196fc4.js","assets/PipelineSettings-BcAtsehE.js","assets/RoutineVariablesEditor-0dQ10yPY.js","assets/StatusCards-DaJdQUN5.js","assets/wand-sparkles-BqnbLKl3.js","assets/PixelsOffice-BSlctoug.js","assets/coins-C6QoCoLN.js","assets/AttentionInteractionResolver-CBjNuhYo.js","assets/RoutineDetail-izWzADvA.js","assets/pen-line-CxWwoiP_.js","assets/webhook-BVBCKjlU.js","assets/WebhookUrlWarning-D0GLAS0A.js","assets/RoutineActivityRow-B69N6Hcy.js","assets/UserProfile-C6q55R0Q.js","assets/ExecutionWorkspaceDetail-CuD5xWOB.js","assets/Goals-xgGKfQZi.js","assets/GoalTree-DaFizciF.js","assets/Artifacts-Bsv5m0aU.js","assets/GoalDetail-oN5pyUUY.js","assets/Approvals-BXrjqpKc.js","assets/ApprovalDetail-CE41WFbd.js","assets/CompanyActivity-ScpRBz1G.js","assets/AuditHub-DbUni0O_.js","assets/arrow-down-left-C8jhGqM0.js","assets/decision-models-CD2AFC2a.js","assets/fast-responses-DZodQpLv.js","assets/QuotaBar-_ok6Pek4.js","assets/WhatNeedsMe-1igJA4gL.js","assets/DecisionDateChips-vXwAFdua.js","assets/sun-_NIddwh7.js","assets/DecisionQueuePage-BaaKuZBi.js","assets/BoardChat-CgzCuFIL.js","assets/circle-slash-Bx5HrFMb.js","assets/send-mNwfi_F1.js","assets/CompanySettings-BSkg4ahA.js","assets/DecisionModelSettings-NrNERkaW.js","assets/CompanyConnections-DMEwbZv7.js","assets/CompanyEnvironments-EqXhVruZ.js","assets/BootstrapSetupUxLab-D-niQCV5.js","assets/ResponsibleUserDenialUxLab-Bt9vnHJz.js","assets/CrossIssueCollaborationUxLab-CEh5B2iJ.js","assets/CompanySettingsPluginPage-BzZkZqh-.js","assets/CompanyAccess-BUcTNg7_.js","assets/AdvancedToolsRoute-CICI1XRd.js","assets/power-B3xsPeS4.js","assets/profile-summary-unutni_7.js","assets/useProfilesData-2L3_71Ql.js","assets/ProfileWizardRoute-XnnvzH9S.js","assets/ToolsAdminGate-BI5-WYC3.js","assets/ProfileDetailRoute-DRFQNId6.js","assets/Browse-0bmB5mqw.js","assets/ManagedAiConnectionDetails-B0aWUPkf.js","assets/retired-composio-DrxhEOpx.js","assets/connection-owner-CZwxTEuM.js","assets/AssistantConnection-Dm2PaSeU.js","assets/AppsConnect-DH7aSjtS.js","assets/skill-source-connect-return-C3vV7DQP.js","assets/ChatEndpointSetup-BX3iDH7N.js","assets/EmailEndpointSetup-CJFYu2G0.js","assets/OpenwaGatewayManager-DH3bF7fa.js","assets/ChatEndpointDetail-BdDKo-Gq.js","assets/EmailConnectionAccess-DAFMofYX.js","assets/ChatIdentityConfirm-DCI5BnWo.js","assets/AppsReview-C0Y3SxmZ.js","assets/ReviewQueueCard-CIkiY-Lm.js","assets/AppDetail-DfHLFOtj.js","assets/AppNotConnected-CcmXbFtD.js","assets/GatewaysList-DsSKLm1h.js","assets/CopyableGatewayUrl-BZyE_jT9.js","assets/GatewayDetail-xNVOxSIs.js","assets/CompanySkills-BbA4RKIw.js","assets/SkillBinaryFile-DNe-MmCv.js","assets/company-skill-routes-D5LJ1l8M.js","assets/SkillSources-Cw4PU-Bz.js","assets/SkillSourceTree-M58QwBFF.js","assets/SkillStudio-Cj_M3ZJa.js","assets/AgentIconPicker-D87bSkxE.js","assets/resizable-panels-Qjbo0P05.js","assets/IssueOutputSection-CDIMRaF0.js","assets/Secrets-BOyOk5BF.js","assets/CompanyImport-BhuZu4oc.js","assets/agent-order-BE-pAWdx.js","assets/sidebarPreferences-vEHBC54I.js","assets/portable-files-CloN_vbk.js","assets/DesignGuide-DS6MuXWY.js","assets/RepositoryEditor-CFt-HPgf.js","assets/ThemeToggle-BWFlFnSX.js","assets/InstanceFeatures-DUQnBkxy.js","assets/useInstanceFeatureSettings-CEK6Xn3o.js","assets/AgentDefaults-DpYaMGkf.js","assets/ModelsAndProviders-BEb4Z38S.js","assets/InstanceAdvanced-Bdf2a4c_.js","assets/InstanceAccess-Ns2rAmva.js","assets/ProfileSettings-BMwLBQDB.js","assets/PluginManager-4rrrAOLG.js","assets/PluginSettings-Do37r6Zu.js","assets/AdapterManager-DhiW44Eo.js","assets/PluginPage-C6Qnf9ka.js","assets/NewAgent-C3MxIRJj.js","assets/Auth-_P9t1YSS.js","assets/invite-memory-CHGcQdLs.js","assets/BoardClaim-CsomHmd6.js","assets/McpConnect-Dzf7W2K6.js","assets/CliAuth-CRG0c0EH.js","assets/InviteLanding-McBYpNeW.js","assets/PublicIssueSharePage-C9yRZOdP.js","assets/JoinRequestQueue-ZZq3jWW-.js","assets/CompanyExport-DQ9ffuua.js","assets/Terminal-Bo-WuezO.js"])))=>i.map(i=>d[i]);
2
2
  var L_=Object.defineProperty;var r=(e,t)=>L_(e,"name",{value:t,configurable:!0});import{i as Qg,n as z_,t as Xl}from"./rolldown-runtime-ZpX3ckPj.js";import{Ar as P_,At as U_,Bi as $_,C as Rk,Ei as B_,Fr as zh,Ir as K_,Lt as q_,Mi as Gg,Nr as F_,Or as H_,Ot as V_,P as W_,Pi as Ic,Pr as Dk,Qt as Yg,Ti as Q_,Vi as yy,_ as G_,_n as Y_,ei as Mk,i as jd,kr as X_,kt as Ok,l as X,n as Lk,na as Xg,ni as zk,r as ar,rr as Z_,t as Je,ta as J_,ti as Qa,vn as eE,w as jy,x as tE,zt as Ed}from"./createLucideIcon-DJi9suAC.js";import{l as Pk}from"./dist-SzpVz8Pd.js";import{t as ke}from"./preload-helper-CceJXRIF.js";import{_ as nE,a as Ph,c as sE,d as Zl,f as L,h as vn,n as Uh,p as aE,r as wi,s as iE,t as Zg,v as La,y as Uk}from"./star-BZgQbzhV.js";import{J as Jg,X as wn,Y as rE,_ as Kt,c as Tr,d as e0,f as lE,g as $k,h as ff,n as Si,r as we,t as U,u as oE,v as ge}from"./queryKeys-DYV5MhM_.js";import{t as mf}from"./queryClient-BOli2vjj.js";import{t as t0}from"./useQueries-BIJ7zVTy.js";import{a as cE,c as uE,i as n0,l as dE,o as Zn,u as wy}from"./companies-query-D9PxIiMT.js";import{N as ky,dt as fE,f as mE,ft as pE,k as hE,n as gE,p as xE,pt as bE,z as Bk}from"./ConnectionSetupFlow-DKjP5RBZ.js";import{t as Kk}from"./issue-attribution-DfN_3u2W.js";import{t as vE}from"./execution-projection-BGI5f3kX.js";import{C as qk,D as yE,O as jE,T as wE,d as Fk,f as s0,k as $h,w as Hk}from"./connection-identity-YKZfppDS.js";import{n as vt,r as kE,t as SE}from"./CompanyContext-CSrVsSze.js";import{A as NE,B as Id,Bt as CE,C as AE,Ct as _E,E as EE,G as a0,H as IE,J as TE,Jt as Bh,L as Wu,O as RE,Q as Vk,Qt as DE,Rt as ME,Ut as Td,Yt as i0,Z as Sy,an as OE,b as LE,dt as Wk,f as Rd,i as zE,in as PE,n as Qk,nt as Pp,o as bs,ot as ac,p as pf,q as r0,r as Qe,t as gn,tt as hf,u as Gk,ut as Yk,v as Xk,zt as hn}from"./router-2UfGeejU.js";import{t as UE}from"./dist-BuHnL0GV.js";import{n as Zk,r as $E,t as Jk}from"./collapsible-CqjPlqOa.js";import{a as eS,c as tS,i as nS,l as BE,n as sS,o as aS,r as iS,s as rS,t as lS}from"./alert-dialog-Blls2GnU.js";import{a as Dd,n as Md,t as Od}from"./avatar-UO226cef.js";import{t as vi}from"./checkbox-BHQhs41k.js";import{a as oS,c as ki,i as Cn,n as Ny,o as KE,p as Wr,r as Qr,s as qE,t as Gr}from"./dropdown-menu-CqRAF7Oj.js";import{t as FE}from"./scroll-area-P1KpIQWe.js";import{i as HE,r as VE,t as WE}from"./tabs-B2Os_leL.js";import{a as QE,o as GE,r as YE,s as XE,t as cS}from"./MarkdownEditor-DXD-Cu3u.js";import{o as xa,r as ba,t as va}from"./popover-BhYHYj7q.js";import{t as l0}from"./activity-CB9AQzZO.js";import{n as ZE}from"./PathInstructionsModal-D4GUYKIT.js";import{t as uS}from"./archive-CTfe4zq5.js";import{t as JE}from"./arrow-down-Dg4PKbmt.js";import{t as o0}from"./arrow-left-Ce_LIut0.js";import{t as eI}from"./arrow-right-BL5kYtCZ.js";import{t as tI}from"./arrow-up-down-Bpe9xqCo.js";import{t as nI}from"./arrow-up-right-BLYWl-we.js";import{t as dS}from"./arrow-up-D_YoSnQD.js";import{t as hc}from"./bot-C9arfJWx.js";import{t as fS}from"./boxes-fV98p9-r.js";import{t as sI}from"./braces-BEVhwPeU.js";import{t as aI}from"./calendar-clock-BVFltraz.js";import{t as Ta}from"./check-Ctsrlfa-.js";import{t as Br}from"./chevron-down-BCvxsWfI.js";import{t as mS}from"./chevron-left-DP4zwC0G.js";import{t as nr}from"./chevron-right-s7L6hXXq.js";import{t as iI}from"./chevron-up-rFDQGA-7.js";import{n as pS,t as rI}from"./SearchableSelect-CIJ5K8ih.js";import{t as hS}from"./circle-alert-C-L4OsHh.js";import{t as Ld}from"./circle-dot-zr8GONq2.js";import{t as Cy}from"./circle-question-mark-B1jR2is9.js";import{t as lI}from"./circle-IAHLDvLO.js";import{t as Kh}from"./AgentIconPicker-D87bSkxE.js";import{a as oI,c as cI,d as qh,i as Ay,l as uI,n as dI,o as gS,r as fI,s as mI,t as pI,u as Qu}from"./ComposerAddMenu-D9z2INup.js";import{t as hI}from"./clipboard-paste-D9rNPVFj.js";import{t as gI}from"./clock-CzrJT_cP.js";import{C as xI,D as bI,F as vI,O as xS,P as _y,k as yI,t as jI,w as wI}from"./MarkdownBody-BTjuUgFa.js";import{t as kI}from"./columns-3-CqC5nP-p.js";import{t as SI}from"./copy-_wvZOjTe.js";import{n as NI,t as CI}from"./package-CYC5MDhY.js";import{t as gf}from"./ellipsis-BTiLRUn4.js";import{t as bS}from"./external-link-nl1b263c.js";import{a as AI,d as _I,f as EI,g as II,h as TI,i as RI,l as DI,m as MI,p as OI,u as LI}from"./task-chat-attachments-jZNCAKd4.js";import{t as vS}from"./file-code-corner-CmZ_RihF.js";import{t as yS}from"./file-text-Cw7ntqRx.js";import{t as c0}from"./flag-R0AVTKGk.js";import{t as zI}from"./flask-conical-CEYKkO5k.js";import{t as jS}from"./folder-open-8WDYv4mw.js";import{t as PI}from"./funnel-DWwD2WCu.js";import{t as UI}from"./git-pull-request-CdCSG7CL.js";import{t as u0}from"./inbox-C08arfF_.js";import{t as d0}from"./key-round-0RqEOB_C.js";import{t as f0}from"./layout-dashboard-DClZjSaR.js";import{t as $I}from"./link-2-CND-9QZ2.js";import{r as As,t as le}from"./button-CMwV3L1P.js";import{t as BI}from"./RepositoryEditor-CFt-HPgf.js";import{t as wS}from"./maximize-2-DgliXYEr.js";import{t as KI}from"./minus-WOgDAWiC.js";import{n as Ra,t as qI}from"./ThemeToggle-BWFlFnSX.js";import{t as FI}from"./network-RCsafDTP.js";import{t as m0}from"./play-CJNuUj69.js";import{t as Js}from"./plus-C6fnr28l.js";import{t as Yr}from"./refresh-cw-B_Oki9wZ.js";import{t as kS}from"./repeat-DGPKlc5I.js";import{t as ic}from"./rotate-ccw-CQEJ4ewP.js";import{t as HI}from"./scroll-text-BpkOrME3.js";import{t as Kr}from"./search-04O7m-IF.js";import{t as VI}from"./send-mNwfi_F1.js";import{t as SS}from"./settings-DuZndeX2.js";import{t as WI}from"./shield-alert-Be9GuMrS.js";import{t as zd}from"./shield-check-B0HVjzM_.js";import{t as QI}from"./shield-question-mark-D1_en6pn.js";import{t as GI}from"./shield-BhaVQdWV.js";import{t as YI}from"./square-B2aH51tE.js";import{t as XI}from"./terminal-C0CKe_Zz.js";import{t as Fh}from"./trash-D7zTaHTj.js";import{t as Ja}from"./triangle-alert-CBVKiaXB.js";import{t as ZI}from"./user-round-CGxsJ0K8.js";import{t as Kl}from"./user-Ccom_Ph0.js";import{t as qr}from"./users-DyKzwIh4.js";import{t as is}from"./x-DRDFdlYE.js";import{a as JI,i as e3,n as t3,r as n3}from"./SetupWizard-C8qzkJn1.js";import{i as s3,n as a3,r as Jn,t as i3}from"./SidebarContext-CF3RWLxh.js";import{t as p0}from"./MootMark-DZAfkwdv.js";import{a as xf,c as r3,i as l3,n as Ge,o as Ey,r as o3,s as c3,t as NS}from"./SidebarNavItem-DV9nmC7O.js";import{n as Vl,t as er}from"./primary-sidebar-styles-BdMiagDc.js";import{i as _a,n as Ea,r as u3,t as Ia}from"./tooltip-B5WQ3lq5.js";import{t as Bn}from"./badge-DuA2EgZC.js";import{n as d3,t as Hh}from"./Identity-Cv_2a9qJ.js";import{t as ir}from"./AgentAvatar-DgGEobSY.js";import{a as Ni,n as bf,o as f3,r as m3,t as p3}from"./ToastContext-DMdt9oTd.js";import{t as $s}from"./agents-DmlgUVso.js";import{t as vf}from"./heartbeats-DOyojsaN.js";import{t as fs}from"./instanceSettings-D8g_QlS-.js";import{a as Up,c as h3,i as g3,l as x3,n as Iy,o as $p,r as b3,s as Vh,t as Ty}from"./agent-order-BE-pAWdx.js";import{n as gc,t as xc}from"./useSharedPolling-D4Xn8mY2.js";import{m as v3,s as y3}from"./inboxArchiveCache-D8QGdg49.js";import{n as Ry,t as rr}from"./projects-mixWrT5q.js";import{t as yf}from"./useAgentChatEnabled-Chi_JXJj.js";import{a as Jl,i as jf,n as za,o as j3,r as eo,s as Da,t as ya}from"./dialog-CKUblzlR.js";import{t as Wn}from"./input-DobnTAyB.js";import{t as Xa}from"./access-GAosX22P.js";import{a as w3,c as Wh,d as k3,f as Dy,h as Qi,i as S3,l as N3,m as My,n as C3,o as A3,p as Bp,r as CS,s as Qh,t as AS,u as Pd}from"./issue-filters-BO9xiK0c.js";import{a as ql,n as _S,r as Ur,t as Or}from"./assignees-DkQNbPzi.js";import{t as h0}from"./plugins-CF2QITJB.js";import{n as _3,r as E3,t as Yi}from"./instance-settings-QXUWVmQs.js";import{a as I3,c as g0,d as T3,f as R3,i as Oy,l as D3,m as M3,n as Gh,o as Tc,p as O3,r as L3,s as z3,t as x0,u as P3}from"./slots-Dw517dxP.js";import{t as Rc}from"./health-DF7yrggW.js";import{t as lr}from"./useHiddenSettings-CcaZfHLD.js";import{t as Ud}from"./sidebarPreferences-vEHBC54I.js";import{t as lt}from"./skeleton-Bv_lQagE.js";import{t as ES}from"./chatEndpoints-BKsIHowE.js";import{t as Ml}from"./tools-B-L_sU_9.js";import{t as U3}from"./AppLogo-CZr1Y48O.js";import{r as $3}from"./audit-navigation-IalprBz0.js";import{t as B3}from"./routines-KPtwxuS7.js";import{t as K3}from"./github-icon-Bbgf67tg.js";import{n as IS,t as q3}from"./BreadcrumbContext-BVZDZoC0.js";import{a as b0,c as Xi,i as Wa,l as F3,n as H3,o as jn,r as v0,s as y0,t as TS}from"./command-Ca3v36Mu.js";import{t as Wl}from"./AgentIdentity-I_kB4rMX.js";import{t as Yh}from"./secrets-CZifgF0J.js";import{t as RS}from"./textarea-BRPEfJ-g.js";import{t as DS}from"./assets-TRDkBfss.js";import{n as V3,r as W3}from"./recent-selections-BnN_nb6Y.js";import{a as $d,i as Bd,n as Xh,r as MS,t as Q3}from"./recent-assignees-DmalYaLf.js";import{t as G3}from"./attachment-icon-4xDiQblX.js";import{t as OS}from"./toggle-switch-BHxNtSq9.js";import{n as Y3,t as X3}from"./presentation-mode-Bk6TnKr9.js";import{a as Kp,c as Ly,d as Rr,g as Gu,h as zy,m as yi,o as Z3,s as Py,t as J3,v as Uy}from"./TaskChatComposerTakeoverContext-BJAHPHve.js";import{t as eT}from"./interaction-card-visibility-DcyO470L.js";import{r as tT}from"./useMobileEntityPickerViewportStyle-C3R37KtS.js";import{i as $y,n as nT,t as sT}from"./color-contrast-BHHcEMtO.js";import{t as j0}from"./InlineEntitySelector-v2Q4C8oT.js";import{r as aT}from"./searchable-select-fvMNMcqm.js";import{t as By}from"./InlineBanner-VQ5mstsR.js";import{t as Zh}from"./select-V0Hm_q4f.js";import{t as iT}from"./chip-DsDe6yck.js";import{t as rT}from"./environments-BLQs1ScE.js";import{t as w0}from"./clipboard-CTLKYvRL.js";import{n as lT,r as oT,t as cT}from"./AgentSetupPrompt-DYBB5Med.js";import{t as k0}from"./usePrefersReducedMotion-Dw81-akd.js";import{t as uT}from"./use-copy-action-D5dEzo6L.js";import{i as dT}from"./app-connect-policy-CUzbEnhU.js";import{t as Dc}from"./card-Bru3x_SJ.js";import{t as LS}from"./agentChats-CjHr739f.js";import{t as fT}from"./ThemeContext-DYRUK81c.js";import{t as Ya}from"./StatusIcon-0GcYXDdN.js";import{a as mT,d as pT,i as hT,l as gT,s as xT,t as bT}from"./issue-blockers-DLfa24KC.js";r((function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&l(m)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}r(i,"getFetchOpts");function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}r(l,"processPreload")}),"polyfill")();var vT="__wardmote_no_template__",Ky=/^paperclip(?=[:.])/,yT="skillStudio.runTemplate.",jT="__paperclip_no_template__";function wT(e){const t=[],i=[];for(let l=0;l<e.length;l+=1){const c=e.key(l);c!==null&&(Ky.test(c)&&t.push(c),c.startsWith(yT)&&i.push(c))}for(const l of t){const c=e.getItem(l),u=l.replace(Ky,"wardmote");c!==null&&e.getItem(u)===null&&e.setItem(u,c),e.removeItem(l)}for(const l of i)e.getItem(l)===jT&&e.setItem(l,vT)}r(wT,"migrateRetiredStorageKeys");for(const e of[()=>window.localStorage,()=>window.sessionStorage])try{wT(e())}catch{continue}function zS(e){return(typeof e=="string"?e:e?.name??"").trim()}r(zS,"rawNameOf");function PS(e){const t=e.toLowerCase();return!!(t.includes("://")||t==="localhost"||t.startsWith("localhost:")||/^\d{1,3}(\.\d{1,3}){3}(:\d+)?$/.test(t)||/^[a-z0-9.-]+:\d+$/.test(t))}r(PS,"looksLikeNetworkAddress");function Jh(e){return e.split(/[\s._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}r(Jh,"titleCaseIdentifier");function kT(e){const t=/^plugin:\s*(.+)$/i.exec(e);if(!t)return null;let i=t[1].trim();return i=i.slice(i.lastIndexOf(".")+1),i=i.replace(/^plugin[-_]/i,""),Jh(i)||"Custom app"}r(kT,"pluginPackageLabel");function ST(e,t={}){const i=t.title?.trim();if(i)return i;const l=zS(e);if(!l||PS(l))return"Custom app";const c=kT(l);if(c)return c;if(l.includes(":")&&!l.includes("://")){const u=l.slice(l.lastIndexOf(":")+1).trim();if(u)return Jh(u)}return/\s/.test(l)||/[A-Z]/.test(l)?l:/[._-]/.test(l)?Jh(l):l}r(ST,"humanizeConnectionDisplayName");function YW(e){const t=zS(e);return t&&PS(t)?`hosted at ${t}`:null}r(YW,"connectionDisplaySecondaryHint");var NT=864e5;function Ol(e){return e?.phase==="waiting"||e?.phase==="installing"}r(Ol,"isUpdateJobActive");function CT(e){return e+3*NT}r(CT,"updateNoticeHiddenUntil");function AT(e,t){return typeof e=="number"&&Number.isFinite(e)&&t<e}r(AT,"isUpdateNoticeHidden");var US={name:"badge-dollar-sign",size:24,node:[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]};US.node;var _T=Je(US),$S={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};$S.node;var ET=Je($S),BS={name:"book-open-text",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M16 13h2",key:"weia3s"}],["path",{d:"M16 9h2",key:"1n7gjm"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}],["path",{d:"M6 13h2",key:"1cckiz"}],["path",{d:"M6 9h2",key:"1k7j9f"}]]};BS.node;var IT=Je(BS),KS={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};KS.node;var TT=Je(KS),qS={name:"circle-arrow-up",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],aliases:["arrow-up-circle"]};qS.node;var qy=Je(qS),FS={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};FS.node;var HS=Je(FS),VS={name:"circle-play",size:24,node:[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["play-circle"]};VS.node;var WS=Je(VS),QS={name:"circle-slash-2",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]],aliases:["circle-slashed"]};QS.node;var RT=Je(QS),GS={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};GS.node;var DT=Je(GS),YS={name:"cloud-download",size:24,node:[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],aliases:["download-cloud"]};YS.node;var MT=Je(YS),XS={name:"dollar-sign",size:24,node:[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]};XS.node;var ZS=Je(XS),JS={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};JS.node;var eg=Je(JS),e1={name:"file-diff",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]};e1.node;var OT=Je(e1),t1={name:"file-terminal",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]]};t1.node;var LT=Je(t1),n1={name:"gamepad-2",size:24,node:[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]};n1.node;var zT=Je(n1),s1={name:"git-branch-plus",size:24,node:[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]};s1.node;var PT=Je(s1),a1={name:"git-commit-horizontal",size:24,node:[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],aliases:["git-commit"]};a1.node;var UT=Je(a1),i1={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};i1.node;var $T=Je(i1),r1={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};r1.node;var BT=Je(r1),l1={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};l1.node;var KT=Je(l1),o1={name:"library",size:24,node:[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]};o1.node;var tg=Je(o1),c1={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};c1.node;var qT=Je(c1),u1={name:"list-collapse",size:24,node:[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]]};u1.node;var FT=Je(u1),d1={name:"list-tree",size:24,node:[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]};d1.node;var f1=Je(d1),m1={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};m1.node;var HT=Je(m1),p1={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};p1.node;var wf=Je(p1),h1={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};h1.node;var g1=Je(h1),x1={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};x1.node;var ng=Je(x1),b1={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};b1.node;var VT=Je(b1),v1={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};v1.node;var y1=Je(v1),j1={name:"monitor-cog",size:24,node:[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]};j1.node;var WT=Je(j1),w1={name:"panel-right-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]};w1.node;var k1=Je(w1),S1={name:"panel-right-open",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]};S1.node;var N1=Je(S1),C1={name:"panel-top-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"m9 16 3-3 3 3",key:"1idcnm"}]]};C1.node;var QT=Je(C1),A1={name:"pencil-ruler",size:24,node:[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};A1.node;var GT=Je(A1),_1={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};_1.node;var S0=Je(_1),E1={name:"receipt-text",size:24,node:[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]]};E1.node;var YT=Je(E1),I1={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};I1.node;var N0=Je(I1),T1={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};T1.node;var XT=Je(T1),R1={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};R1.node;var ZT=Je(R1),D1={name:"share",size:24,node:[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]]};D1.node;var JT=Je(D1),M1={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};M1.node;var O1=Je(M1),L1={name:"square-kanban",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]],aliases:["kanban-square"]};L1.node;var eR=Je(L1),z1={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};z1.node;var C0=Je(z1),P1={name:"square-plus",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-square"]};P1.node;var tR=Je(P1),U1={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};U1.node;var nR=Je(U1),$1={name:"store",size:24,node:[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]};$1.node;var sR=Je($1),B1={name:"timer-reset",size:24,node:[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]]};B1.node;var aR=Je(B1),K1={name:"toggle-right",size:24,node:[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]};K1.node;var q1=Je(K1),F1={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};F1.node;var iR=Je(F1),H1={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};H1.node;var rR=Je(H1),V1={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};V1.node;var W1=Je(V1),Q1={name:"user-round-pen",size:24,node:[["path",{d:"M2 21a8 8 0 0 1 10.821-7.487",key:"1c8h7z"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}]]};Q1.node;var lR=Je(Q1),G1={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};G1.node;var oR=Je(G1),Ll=Qg(Pk()),x=Qg(Xg(),1),Y1="wardmote.staleChunkReload";function cR(){try{return window.sessionStorage}catch{return null}}r(cR,"sessionStore");function uR(e){try{e?.removeItem(Y1)}catch{return}}r(uR,"clearReloadMark");function dR(e,t){if(!e)return!1;try{return e.getItem("wardmote.staleChunkReload")===t?!1:(e.setItem(Y1,t),!0)}catch{return!1}}r(dR,"markReloadOnce");function Ne(e,t={}){const i=t.reload??(()=>window.location.reload()),l=t.path??(()=>window.location.pathname);return(0,x.lazy)(async()=>{const c=t.storage===void 0?cR():t.storage;try{const u=await e();return uR(c),{default:u}}catch(u){if(!dR(c,l()))throw u;return i(),new Promise(()=>{})}})}r(Ne,"lazyPage");var st=r(e=>typeof e=="string","isString$1"),Zo=r(()=>{let e,t;const i=new Promise((l,c)=>{e=l,t=c});return i.resolve=e,i.reject=t,i},"defer"),qp=r(e=>e==null?"":String(e),"makeString"),fR=r((e,t,i)=>{e.forEach(l=>{t[l]&&(i[l]=t[l])})},"copy"),mR=/###/g,Fy=r(e=>e&&e.includes("###")?e.replace(mR,"."):e,"cleanKey"),Hy=r(e=>!e||st(e),"canNotTraverseDeeper"),rc=r((e,t,i)=>{const l=st(t)?t.split("."):t;let c=0;for(;c<l.length-1;){if(Hy(e))return{};const u=Fy(l[c]);!e[u]&&i&&(e[u]=new i),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={},++c}return Hy(e)?{}:{obj:e,k:Fy(l[c])}},"getLastOfPath"),Vy=r((e,t,i)=>{const{obj:l,k:c}=rc(e,t,Object);if(l!==void 0||t.length===1){l[c]=i;return}let u=t[t.length-1],m=t.slice(0,t.length-1),f=rc(e,m,Object);for(;f.obj===void 0&&m.length;)u=`${m[m.length-1]}.${u}`,m=m.slice(0,m.length-1),f=rc(e,m,Object),f?.obj&&typeof f.obj[`${f.k}.${u}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${u}`]=i},"setPath"),pR=r((e,t,i,l)=>{const{obj:c,k:u}=rc(e,t,Object);c[u]=c[u]||[],c[u].push(i)},"pushPath"),Kd=r((e,t)=>{const{obj:i,k:l}=rc(e,t);if(i&&Object.prototype.hasOwnProperty.call(i,l))return i[l]},"getPath"),hR=r((e,t,i)=>{const l=Kd(e,i);return l!==void 0?l:Kd(t,i)},"getPathWithDefaults"),X1=r((e,t,i)=>{for(const l in t)l!=="__proto__"&&l!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,l)?st(e[l])||e[l]instanceof String||st(t[l])||t[l]instanceof String?i&&(e[l]=t[l]):X1(e[l],t[l],i):e[l]=t[l]);return e},"deepExtend"),ji=r(e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),"regexEscape"),gR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},xR=r(e=>st(e)?e.replace(/[&<>"'\/]/g,t=>gR[t]):e,"escape"),bR=class{static{r(this,"RegExpCache")}constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}},vR=[" ",",","?","!",";"],yR=new bR(20),jR=r((e,t,i)=>{t=t||"",i=i||"";const l=vR.filter(m=>!t.includes(m)&&!i.includes(m));if(l.length===0)return!0;const c=yR.getRegExp(`(${l.map(m=>m==="?"?"\\?":m).join("|")})`);let u=!c.test(e);if(!u){const m=e.indexOf(i);m>0&&!c.test(e.substring(0,m))&&(u=!0)}return u},"looksLikeObjectPath"),sg=r((e,t,i=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const l=t.split(i);let c=e;for(let u=0;u<l.length;){if(!c||typeof c!="object")return;let m,f="";for(let h=u;h<l.length;++h)if(h!==u&&(f+=i),f+=l[h],m=c[f],m!==void 0){if(["string","number","boolean"].includes(typeof m)&&h<l.length-1)continue;u+=h-u+1;break}c=m}return c},"deepFind"),bc=r(e=>e?.replace(/_/g,"-"),"getCleanedCode"),wR={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}},kR=class ag{static{r(this,"Logger")}constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||wR,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,l,c){return c&&!this.debug?null:(t=t.map(u=>st(u)?u.replace(/[\r\n\x00-\x1F\x7F]/g," "):u),st(t[0])&&(t[0]=`${l}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new ag(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ag(this.logger,t)}},Ga=new kR,kf=class{static{r(this,"EventEmitter")}constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const l=this.observers[i].get(t)||0;this.observers[i].set(t,l+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const i=r((...l)=>{t(...l),this.off(e,i)},"wrapper");return this.on(e,i),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,l])=>{for(let c=0;c<l;c++)i(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,l])=>{for(let c=0;c<l;c++)i(e,...t)})}},Wy=class extends kf{static{r(this,"ResourceStore")}constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i,l={}){const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;e.includes(".")?m=e.split("."):(m=[e,t],i&&(Array.isArray(i)?m.push(...i):st(i)&&c?m.push(...i.split(c)):m.push(i)));const f=Kd(this.data,m);return!f&&!t&&!i&&e.includes(".")&&(e=m[0],t=m[1],i=m.slice(2).join(".")),f||!u||!st(i)?f:sg(this.data?.[e]?.[t],i,c)}addResource(e,t,i,l,c={silent:!1}){const u=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let m=[e,t];i&&(m=m.concat(u?i.split(u):i)),e.includes(".")&&(m=e.split("."),l=t,t=m[1]),this.addNamespaces(t),Vy(this.data,m,l),c.silent||this.emit("added",e,t,i,l)}addResources(e,t,i,l={silent:!1}){for(const c in i)(st(i[c])||Array.isArray(i[c]))&&this.addResource(e,t,c,i[c],{silent:!0});l.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,l,c,u={silent:!1,skipCopy:!1}){let m=[e,t];e.includes(".")&&(m=e.split("."),l=i,i=t,t=m[1]),this.addNamespaces(t);let f=Kd(this.data,m)||{};u.skipCopy||(i=JSON.parse(JSON.stringify(i))),l?X1(f,i,c):f={...f,...i},Vy(this.data,m,f),u.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}},Z1={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,l,c){return e.forEach(u=>{t=this.processors[u]?.process(t,i,l,c)??t}),t}},J1=Symbol("i18next/PATH_KEY");function SR(){const e=[],t=Object.create(null);let i;return t.get=(l,c)=>(i?.revoke?.(),c===J1?e:(e.push(c),i=Proxy.revocable(l,t),i.proxy)),Proxy.revocable(Object.create(null),t).proxy}r(SR,"createProxy");function Fl(e,t){const{[J1]:i}=e(SR()),l=t?.keySeparator??".",c=t?.nsSeparator??":",u=t?.enableSelector==="strict";if(i.length>1&&c){const m=t?.ns,f=u?Array.isArray(m)?m:m?[m]:null:Array.isArray(m)?m:null;if(f&&(u?f:f.length>1?f.slice(1):[]).includes(i[0]))return`${i[0]}${c}${i.slice(1).join(l)}`}return i.join(l)}r(Fl,"keysFromSelector");var Fp=r(e=>!st(e)&&typeof e!="boolean"&&typeof e!="number","shouldHandleAsObject"),Qy=class eN extends kf{static{r(this,"Translator")}constructor(t,i={}){super(),fR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ga.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const l={...i};if(t==null)return!1;const c=this.resolve(t,l);if(c?.res===void 0)return!1;const u=Fp(c.res);return!(l.returnObjects===!1&&u)}extractFromKey(t,i){let l=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let u=i.ns||this.options.defaultNS||[];const m=l&&t.includes(l),f=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!jR(t,l,c);if(m&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:st(u)?[u]:u};const g=t.split(l);(l!==c||l===c&&this.options.ns.includes(g[0]))&&(u=g.shift()),t=g.join(c)}return{key:t,namespaces:st(u)?[u]:u}}translate(t,i,l){let c=typeof i=="object"?{...i}:i;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),t==null)return"";typeof t=="function"&&(t=Fl(t,{...this.options,...c})),Array.isArray(t)||(t=[String(t)]),t=t.map(Y=>typeof Y=="function"?Fl(Y,{...this.options,...c}):String(Y));const u=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,m=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:f,namespaces:h}=this.extractFromKey(t[t.length-1],c),g=h[h.length-1];let v=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const y=c.lng||this.language,j=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return j?u?{res:`${g}${v}${f}`,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:g,usedParams:this.getUsedParamsDetails(c)}:`${g}${v}${f}`:u?{res:f,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:g,usedParams:this.getUsedParamsDetails(c)}:f;const k=this.resolve(t,c);let S=k?.res;const N=k?.usedKey||f,_=k?.exactUsedKey||f,I=["[object Number]","[object Function]","[object RegExp]"],D=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,C=c.count!==void 0&&!st(c.count),M=eN.hasDefaultValue(c),z=C?this.pluralResolver.getSuffix(y,c.count,c):"",K=c.ordinal&&C?this.pluralResolver.getSuffix(y,c.count,{ordinal:!1}):"",P=C&&!c.ordinal&&c.count===0,A=P&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${z}`]||c[`defaultValue${K}`]||c.defaultValue;let B=S;T&&!S&&M&&(B=A);const O=Fp(B),W=Object.prototype.toString.apply(B);if(T&&B&&O&&!I.includes(W)&&!(st(D)&&Array.isArray(B))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,B,{...c,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return u?(k.res=Y,k.usedParams=this.getUsedParamsDetails(c),k):Y}if(m){const Y=Array.isArray(B),ce=Y?[]:{},oe=Y?_:N;for(const $ in B)if(Object.prototype.hasOwnProperty.call(B,$)){const R=`${oe}${m}${$}`;M&&!S?ce[$]=this.translate(R,{...c,defaultValue:Fp(A)?A[$]:void 0,joinArrays:!1,ns:h}):ce[$]=this.translate(R,{...c,joinArrays:!1,ns:h}),ce[$]===R&&(ce[$]=B[$])}S=ce}}else if(T&&st(D)&&Array.isArray(S))S=S.join(D),S&&(S=this.extendTranslation(S,t,c,l));else{let Y=!1,ce=!1;!this.isValidLookup(S)&&M&&(Y=!0,S=A),this.isValidLookup(S)||(ce=!0,S=f);const oe=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ce?void 0:S,$=M&&A!==S&&this.options.updateMissing;if(ce||Y||$){if(this.logger.log($?"updateKey":"missingKey",y,g,C&&!$?`${f}${this.pluralResolver.getSuffix(y,c.count,c)}`:f,$?A:S),m){const ae=this.resolve(f,{...c,keySeparator:!1});ae&&ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let R=[];const ne=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ne&&ne[0])for(let ae=0;ae<ne.length;ae++)R.push(ne[ae]);else this.options.saveMissingTo==="all"?R=this.languageUtils.toResolveHierarchy(c.lng||this.language):R.push(c.lng||this.language);const ue=r((ae,Ee,fe)=>{const Ae=M&&fe!==S?fe:oe;this.options.missingKeyHandler?this.options.missingKeyHandler(ae,g,Ee,Ae,$,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ae,g,Ee,Ae,$,c),this.emit("missingKey",ae,g,Ee,S)},"send");this.options.saveMissing&&(this.options.saveMissingPlurals&&C?R.forEach(ae=>{const Ee=this.pluralResolver.getSuffixes(ae,c);P&&c[`defaultValue${this.options.pluralSeparator}zero`]&&!Ee.includes(`${this.options.pluralSeparator}zero`)&&Ee.push(`${this.options.pluralSeparator}zero`),Ee.forEach(fe=>{ue([ae],f+fe,c[`defaultValue${fe}`]||A)})}):ue(R,f,A))}S=this.extendTranslation(S,t,c,k,l),ce&&S===f&&this.options.appendNamespaceToMissingKey&&(S=`${g}${v}${f}`),(ce||Y)&&this.options.parseMissingKeyHandler&&(S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${v}${f}`:f,Y?S:void 0,c))}return u?(k.res=S,k.usedParams=this.getUsedParamsDetails(c),k):S}extendTranslation(t,i,l,c,u){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...l},l.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!l.skipInterpolation){l.interpolation&&this.interpolator.init({...l,interpolation:{...this.options.interpolation,...l.interpolation}});const h=st(t)&&(l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(h){const y=t.match(this.interpolator.nestingRegexp);g=y&&y.length}let v=l.replace&&!st(l.replace)?l.replace:l;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,l.lng||this.language||c.usedLng,l),h){const y=t.match(this.interpolator.nestingRegexp),j=y&&y.length;g<j&&(l.nest=!1)}!l.lng&&c&&c.res&&(l.lng=this.language||c.usedLng),l.nest!==!1&&(t=this.interpolator.nest(t,(...y)=>u?.[0]===y[0]&&!l.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${i[0]}`),null):this.translate(...y,i),l)),l.interpolation&&this.interpolator.reset()}const m=l.postProcess||this.options.postProcess,f=st(m)?[m]:m;return t!=null&&f?.length&&l.applyPostProcessor!==!1&&(t=Z1.handle(f,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(l)},...l}:l,this)),t}resolve(t,i={}){let l,c,u,m,f;return st(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(h=>typeof h=="function"?Fl(h,{...this.options,...i}):h)),t.forEach(h=>{if(this.isValidLookup(l))return;const g=this.extractFromKey(h,i),v=g.key;c=v;let y=g.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const j=i.count!==void 0&&!st(i.count),k=j&&!i.ordinal&&i.count===0,S=i.context!==void 0&&(st(i.context)||typeof i.context=="number")&&i.context!=="",N=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);y.forEach(_=>{this.isValidLookup(l)||(f=_,!this.checkedLoadedFor[`${N[0]}-${_}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&(this.checkedLoadedFor[`${N[0]}-${_}`]=!0,this.logger.warn(`key "${c}" for languages "${N.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),N.forEach(I=>{if(this.isValidLookup(l))return;m=I;const D=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(D,v,I,_,i);else{let C;j&&(C=this.pluralResolver.getSuffix(I,i.count,i));const M=`${this.options.pluralSeparator}zero`,z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(j&&(i.ordinal&&C.startsWith(z)&&D.push(v+C.replace(z,this.options.pluralSeparator)),D.push(v+C),k&&D.push(v+M)),S){const K=`${v}${this.options.contextSeparator||"_"}${i.context}`;D.push(K),j&&(i.ordinal&&C.startsWith(z)&&D.push(K+C.replace(z,this.options.pluralSeparator)),D.push(K+C),k&&D.push(K+M))}}let T;for(;T=D.pop();)this.isValidLookup(l)||(u=T,l=this.getResource(I,_,T,i))}))})}),{res:l,usedKey:c,exactUsedKey:u,usedLng:m,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,l,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,l,c):this.resourceStore.getResource(t,i,l,c)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],l=t.replace&&!st(t.replace);let c=l?t.replace:t;if(l&&typeof t.count<"u"&&(c={...c,count:t.count}),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!l){c={...c};for(const u of i)delete c[u]}return c}static hasDefaultValue(t){const i="defaultValue";for(const l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&l.startsWith(i)&&t[l]!==void 0)return!0;return!1}},Gy=class{static{r(this,"LanguageUtil")}constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ga.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=bc(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=bc(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(st(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;const l=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(l))&&(t=l)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const l=this.getScriptPartFromCode(i);if(this.isSupportedCode(l))return t=l;const c=this.getLanguagePartFromCode(i);if(this.isSupportedCode(c))return t=c;t=this.options.supportedLngs.find(u=>u===c?!0:!u.includes("-")&&!c.includes("-")?!1:!!(u.includes("-")&&!c.includes("-")&&u.slice(0,u.indexOf("-"))===c||u.startsWith(c)&&c.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),st(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.options.fallbackLng,l=Array.isArray(i)?i.join("|"):i;l!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=l);const c=t===void 0||t===!1||st(t),u=t===void 0&&typeof this.options.fallbackLng=="function",m=st(e)&&c&&!u;let f=null;if(m){let y;t===void 0?y="undefined":t===!1?y="boolean:false":y=`string:${t}`,f=`${e.length}:${e}|${y}`}if(f!==null){const y=this.resolveHierarchyCache[f];if(y!==void 0)return y.slice()}const h=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),g=[],v=r(y=>{y&&(this.isSupportedCode(y)?g.push(y):this.logger.warn(`rejecting language code not found in supportedLngs: ${y}`))},"addCode");return st(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&v(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&v(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&v(this.getLanguagePartFromCode(e))):st(e)&&v(this.formatLanguageCode(e)),h.forEach(y=>{g.includes(y)||v(this.formatLanguageCode(y))}),f!==null?(this.resolveHierarchyCache[f]=g,g.slice()):g}},Yy={zero:0,one:1,two:2,few:3,many:4,other:5},Xy={select:r(e=>e===1?"one":"other","select"),resolvedOptions:r(()=>({pluralCategories:["one","other"]}),"resolvedOptions")},NR=class{static{r(this,"PluralResolver")}constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ga.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const i=bc(e==="dev"?"en":e),l=t.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:i,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let u;try{u=new Intl.PluralRules(i,{type:l})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Xy;if(!e.match(/-|_/))return Xy;const f=this.languageUtils.getLanguagePartFromCode(e);u=this.getRule(f,t)}return this.pluralRulesCache[c]=u,u}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(l=>`${t}${l}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((l,c)=>Yy[l]-Yy[c]).map(l=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(e,t,i={}){const l=this.getRule(e,i);return l?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${l.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}},Zy=r((e,t,i,l=".",c=!0)=>{let u=hR(e,t,i);return!u&&c&&st(i)&&(u=sg(e,i,l),u===void 0&&(u=sg(t,i,l))),u},"deepFindWithDefaults"),Jy=r(e=>e.replace(/\$/g,"$$$$"),"regexSafe"),ej=class{static{r(this,"Interpolator")}constructor(e={}){this.logger=Ga.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:l,prefix:c,prefixEscaped:u,suffix:m,suffixEscaped:f,formatSeparator:h,unescapeSuffix:g,unescapePrefix:v,nestingPrefix:y,nestingPrefixEscaped:j,nestingSuffix:k,nestingSuffixEscaped:S,nestingOptionsSeparator:N,maxReplaces:_,alwaysFormat:I}=e.interpolation;this.escape=t!==void 0?t:xR,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?ji(c):u||"{{",this.suffix=m?ji(m):f||"}}",this.formatSeparator=h||",",this.unescapePrefix=g?"":v?ji(v):"-",this.unescapeSuffix=this.unescapePrefix?"":g?ji(g):"",this.nestingPrefix=y?ji(y):j||ji("$t("),this.nestingSuffix=k?ji(k):S||ji(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=_||1e3,this.alwaysFormat=I!==void 0?I:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=r((t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g"),"getOrResetRegExp");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,i,l){let c,u,m;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=r(y=>{if(!y.includes(this.formatSeparator)){const N=Zy(t,f,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,i,{...l,...t,interpolationkey:y}):N}const j=y.split(this.formatSeparator),k=j.shift().trim(),S=j.join(this.formatSeparator).trim();return this.format(Zy(t,f,k,this.options.keySeparator,this.options.ignoreJSONStructure),S,i,{...l,...t,interpolationkey:k})},"handleFormat");this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const g=l?.missingInterpolationHandler||this.options.missingInterpolationHandler,v=l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:r(y=>y,"safeValue")},{regex:this.regexp,safeValue:r(y=>this.escapeValue?this.escape(y):y,"safeValue")}].forEach(y=>{for(m=0;c=y.regex.exec(e);){const j=c[1].trim();if(u=h(j),u===void 0)if(typeof g=="function"){const S=g(e,c,l);u=st(S)?S:""}else if(l&&Object.prototype.hasOwnProperty.call(l,j))u="";else if(v){u=c[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${e}`),u="";else!st(u)&&!this.useRawValueToEscape&&(u=qp(u));const k=y.safeValue(u);if(e=e.replace(c[0],Jy(k)),v?(y.regex.lastIndex+=k.length,y.regex.lastIndex-=c[0].length):y.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),e}nest(e,t,i={}){let l,c,u;const m=r((f,h)=>{const g=this.nestingOptionsSeparator;if(!f.includes(g))return f;const v=f.split(new RegExp(`${ji(g)}[ ]*{`));let y=`{${v[1]}`;f=v[0],y=this.interpolate(y,u);const j=y.match(/'/g),k=y.match(/"/g);((j?.length??0)%2===0&&!k||(k?.length??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{u=JSON.parse(y),h&&(u={...h,...u})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,S),`${f}${g}${y}`}return u.defaultValue&&u.defaultValue.includes(this.prefix)&&delete u.defaultValue,f},"handleHasOptions");for(;l=this.nestingRegexp.exec(e);){let f=[];u={...i},u=u.replace&&!st(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const h=/{.*}/s.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(h!==-1&&(f=l[1].slice(h).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),l[1]=l[1].slice(0,h)),c=t(m.call(this,l[1].trim(),u),u),c&&l[0]===e&&!st(c))return c;st(c)||(c=qp(c)),c||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${e}`),c=""),f.length&&(c=f.reduce((g,v)=>this.format(g,v,i.lng,{...i,interpolationkey:l[1].trim()}),c.trim())),e=e.replace(l[0],Jy(qp(c))),this.regexp.lastIndex=0}return e}},CR=r(e=>{let t=e.toLowerCase().trim();const i={};if(e.includes("(")){const l=e.split("(");t=l[0].toLowerCase().trim();const c=l[1].slice(0,-1);t==="currency"&&!c.includes(":")?i.currency||(i.currency=c.trim()):t==="relativetime"&&!c.includes(":")?i.range||(i.range=c.trim()):c.split(";").forEach(u=>{if(u){const[m,...f]=u.split(":"),h=f.join(":").trim().replace(/^'+|'+$/g,""),g=m.trim();i[g]||(i[g]=h),h==="false"&&(i[g]=!1),h==="true"&&(i[g]=!0),isNaN(h)||(i[g]=parseInt(h,10))}})}return{formatName:t,formatOptions:i}},"parseFormatStr"),tj=r(e=>{const t={};return(i,l,c)=>{let u=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(u={...u,[c.interpolationkey]:void 0});const m=l+JSON.stringify(u);let f=t[m];return f||(f=e(bc(l),c),t[m]=f),f(i)}},"createCachedFormatter"),AR=r(e=>(t,i,l)=>e(bc(i),l)(t),"createNonCachedFormatter"),_R=class{static{r(this,"Formatter")}constructor(e={}){this.logger=Ga.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const i=t.cacheInBuiltFormats?tj:AR;this.formats={number:i((l,c)=>{const u=new Intl.NumberFormat(l,{...c});return m=>u.format(m)}),currency:i((l,c)=>{const u=new Intl.NumberFormat(l,{...c,style:"currency"});return m=>u.format(m)}),datetime:i((l,c)=>{const u=new Intl.DateTimeFormat(l,{...c});return m=>u.format(m)}),relativetime:i((l,c)=>{const u=new Intl.RelativeTimeFormat(l,{...c});return m=>u.format(m,c.range||"day")}),list:i((l,c)=>{const u=new Intl.ListFormat(l,{...c});return m=>u.format(m)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=tj(t)}format(e,t,i,l={}){if(!t||e==null)return e;const c=t.split(this.formatSeparator),u=[];for(let m=0;m<c.length;m++){let f=c[m];for(;f.indexOf("(")>-1&&!f.includes(")")&&m+1<c.length;)f=`${f}${this.formatSeparator}${c[++m]}`;u.push(f)}return u.reduce((m,f)=>{const{formatName:h,formatOptions:g}=CR(f);if(this.formats[h]){let v=m;try{const y=l?.formatParams?.[l.interpolationkey]||{},j=y.locale||y.lng||l.locale||l.lng||i;v=this.formats[h](m,j,{...g,...l,...y})}catch(y){this.logger.warn(y)}return v}else this.logger.warn(`there was no format function for ${h}`);return m},e)}},ER=r((e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},"removePending"),IR=class extends kf{static{r(this,"Connector")}constructor(e,t,i,l={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=l,this.logger=Ga.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,l.backend,l)}queueLoad(e,t,i,l){const c={},u={},m={},f={};return e.forEach(h=>{let g=!0;t.forEach(v=>{const y=`${h}|${v}`;!i.reload&&this.store.hasResourceBundle(h,v)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?u[y]===void 0&&(u[y]=!0):(this.state[y]=1,g=!1,u[y]===void 0&&(u[y]=!0),c[y]===void 0&&(c[y]=!0),f[v]===void 0&&(f[v]=!0)))}),g||(m[h]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(f)}}loaded(e,t,i){const l=e.split("|"),c=l[0],u=l[1];t&&this.emit("failedLoading",c,u,t),!t&&i&&this.store.addResourceBundle(c,u,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const m={};this.queue.forEach(f=>{pR(f.loaded,[c],u),ER(f,e),t&&f.errors.push(t),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(h=>{m[h]||(m[h]={});const g=f.loaded[h];g.length&&g.forEach(v=>{m[h][v]===void 0&&(m[h][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(f=>!f.done)}read(e,t,i,l=0,c=this.retryTimeout,u){if(!e.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:l,wait:c,callback:u});return}this.readingCalls++;const m=r((h,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(h&&g&&l<this.maxRetries){setTimeout(()=>{this.read(e,t,i,l+1,c*2,u)},c);return}u(h,g)},"resolver"),f=this.backend[i].bind(this.backend);if(f.length===2){try{const h=f(e,t);h&&typeof h.then=="function"?h.then(g=>m(null,g)).catch(m):m(null,h)}catch(h){m(h)}return}return f(e,t,m)}prepareLoading(e,t,i={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();st(e)&&(e=this.languageUtils.toResolveHierarchy(e)),st(t)&&(t=[t]);const c=this.queueLoad(e,t,i,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(u=>{this.loadOne(u)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){const i=e.split("|"),l=i[0],c=i[1];this.read(l,c,"read",void 0,void 0,(u,m)=>{u&&this.logger.warn(`${t}loading namespace ${c} for language ${l} failed`,u),!u&&m&&this.logger.log(`${t}loaded namespace ${c} for language ${l}`,m),this.loaded(e,u,m)})}saveMissing(e,t,i,l,c,u={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const f={...u,isUpdate:c},h=this.backend.create.bind(this.backend);if(h.length<6)try{let g;h.length===5?g=h(e,t,i,l,f):g=h(e,t,i,l),g&&typeof g.then=="function"?g.then(v=>m(null,v)).catch(m):m(null,g)}catch(g){m(g)}else h(e,t,i,l,m,f)}!e||!e[0]||this.store.addResource(e[0],t,i,l)}}},Hp=r(()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r(e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),st(e[1])&&(t.defaultValue=e[1]),st(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(l=>{t[l]=i[l]})}return t},"overloadTranslationOptionHandler"),interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),"get"),nj=r(e=>(st(e.ns)&&(e.ns=[e.ns]),st(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),st(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),"transformOptions"),Yu=r(()=>{},"noop$1"),TR=r(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})},"bindMemberFunctions"),RR=class wd extends kf{static{r(this,"I18n")}constructor(t={},i){if(super(),this.options=nj(t),this.services={},this.logger=Ga,this.modules={external:[]},TR(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(t={},i){this.isInitializing=!0,typeof t=="function"&&(i=t,t={}),t.defaultNS==null&&t.ns&&(st(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const l=Hp();this.options={...l,...this.options,...nj(t)},this.options.interpolation={...l.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=l.overloadTranslationOptionHandler);const c=r(f=>f?typeof f=="function"?new f:f:null,"createClassOnDemand");if(!this.options.isClone){this.modules.logger?Ga.init(c(this.modules.logger),this.options):Ga.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=_R;const h=new Gy(this.options);this.store=new Wy(this.options.resources,this.options);const g=this.services;g.logger=Ga,g.resourceStore=this.store,g.languageUtils=h,g.pluralResolver=new NR(h,{prepend:this.options.pluralSeparator}),f&&(g.formatter=c(f),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new ej(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new IR(c(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(v,...y)=>{this.emit(v,...y)}),this.modules.languageDetector&&(g.languageDetector=c(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=c(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new Qy(this.services,this.options),this.translator.on("*",(v,...y)=>{this.emit(v,...y)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,i||(i=Yu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...h)=>this.store[f](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...h)=>(this.store[f](...h),this)});const u=Zo(),m=r(()=>{const f=r((h,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(g),i(h,g)},"finish");if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)},"load");return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),u}loadResources(t,i=Yu){let l=i;const c=st(t)?t:this.language;if(typeof t=="function"&&(l=t),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return l();const u=[],m=r(f=>{f&&f!=="cimode"&&this.services.languageUtils.toResolveHierarchy(f).forEach(h=>{h!=="cimode"&&(u.includes(h)||u.push(h))})},"append");c?m(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>m(f)),this.options.preload?.forEach?.(f=>m(f)),this.services.backendConnector.load(u,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),l(f)})}else l(null)}reloadResources(t,i,l){const c=Zo();return typeof t=="function"&&(l=t,t=void 0),typeof i=="function"&&(l=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),l||(l=Yu),this.services.backendConnector.reload(t,i,u=>{c.resolve(),l(u)}),c}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Z1.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let i=0;i<this.languages.length;i++){const l=this.languages[i];if(!["cimode","dev"].includes(l)&&this.store.hasLanguageSomeTranslations(l)){this.resolvedLanguage=l;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const l=Zo();this.emit("languageChanging",t);const c=r(f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},"setLngProps"),u=r((f,h)=>{h?this.isLanguageChangingTo===t&&(c(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,l.resolve((...g)=>this.t(...g)),i&&i(f,(...g)=>this.t(...g))},"done"),m=r(f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=st(f)?f:f&&f[0],g=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(st(f)?[f]:f);g&&(this.language||c(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,v=>{u(v,g)})},"setLng");return!t&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(t),l}getFixedT(t,i,l,c){const u=c?.scopeNs,m=r((f,h,...g)=>{let v;typeof h!="object"?v=this.options.overloadTranslationOptionHandler([f,h].concat(g)):v={...h},v.lng=v.lng||m.lng,v.lngs=v.lngs||m.lngs;const y=v.ns!==void 0&&v.ns!==null;v.ns=v.ns||m.ns,v.keyPrefix!==""&&(v.keyPrefix=v.keyPrefix||l||m.keyPrefix);const j={...this.options,...v};Array.isArray(u)&&!y&&(j.ns=u),typeof v.keyPrefix=="function"&&(v.keyPrefix=Fl(v.keyPrefix,j));const k=this.options.keySeparator||".";let S;return v.keyPrefix&&Array.isArray(f)?S=f.map(N=>(typeof N=="function"&&(N=Fl(N,j)),`${v.keyPrefix}${k}${N}`)):(typeof f=="function"&&(f=Fl(f,j)),S=v.keyPrefix?`${v.keyPrefix}${k}${f}`:f),this.t(S,v)},"fixedT");return st(t)?m.lng=t:m.lngs=t,m.ns=i,m.keyPrefix=l,m}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const l=i.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;const m=r((f,h)=>{const g=this.services.backendConnector.state[`${f}|${h}`];return g===-1||g===0||g===2},"loadNotPending");if(i.precheck){const f=i.precheck(this,m);if(f!==void 0)return f}return!!(this.hasResourceBundle(l,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(l,t)&&(!c||m(u,t)))}loadNamespaces(t,i){const l=Zo();return this.options.ns?(st(t)&&(t=[t]),t.forEach(c=>{this.options.ns.includes(c)||this.options.ns.push(c)}),this.loadResources(c=>{l.resolve(),i&&i(c)}),l):(i&&i(),Promise.resolve())}loadLanguages(t,i){const l=Zo();st(t)&&(t=[t]);const c=this.options.preload||[],u=t.filter(m=>!c.includes(m)&&this.services.languageUtils.isSupportedCode(m));return u.length?(this.options.preload=c.concat(u),this.loadResources(m=>{l.resolve(),i&&i(m)}),l):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const u=c.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],l=this.services?.languageUtils||new Gy(Hp());return t.toLowerCase().indexOf("-latn")>1?"ltr":i.includes(l.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const l=new wd(t,i);return l.createInstance=wd.createInstance,l}cloneInstance(t={},i=Yu){const l=t.forkResourceStore;l&&delete t.forkResourceStore;const c={...this.options,...t,isClone:!0},u=new wd(c);if((t.debug!==void 0||t.prefix!==void 0)&&(u.logger=u.logger.clone(t)),["store","services","language"].forEach(m=>{u[m]=this[m]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},l){const m=Object.keys(this.store.data).reduce((f,h)=>(f[h]={...this.store.data[h]},f[h]=Object.keys(f[h]).reduce((g,v)=>(g[v]={...f[h][v]},g),f[h]),f),{});u.store=new Wy(m,c),u.services.resourceStore=u.store}if(t.interpolation){const m={...Hp().interpolation,...this.options.interpolation,...t.interpolation},f={...c,interpolation:m};u.services.interpolator=new ej(f)}return u.translator=new Qy(u.services,c),u.translator.on("*",(m,...f)=>{u.emit(m,...f)}),u.init(c,i),u.translator.options=c,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},_s=RR.createInstance(),XW=_s.createInstance,ZW=_s.dir,JW=_s.init,eQ=_s.loadResources,tQ=_s.reloadResources,nQ=_s.use,sQ=_s.changeLanguage,aQ=_s.getFixedT,iQ=_s.t,rQ=_s.exists,lQ=_s.setDefaultNamespace,oQ=_s.hasLoadedNamespace,cQ=_s.loadNamespaces,uQ=_s.loadLanguages,DR=r((e,t,i,l)=>{const c=[i,{code:t,...l||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(c,"warn","react-i18next::",!0);Fr(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),e?.services?.logger?.warn&&e.services.logger.warn(...c)},"warn"),sj={},kd=r((e,t,i,l)=>{Fr(i)&&sj[i]||(Fr(i)&&(sj[i]=new Date),DR(e,t,i,l))},"warnOnce"),tN=r((e,t)=>()=>{if(e.isInitialized)t();else{const i=r(()=>{setTimeout(()=>{e.off("initialized",i)},0),t()},"initialized");e.on("initialized",i)}},"loadedClb"),ig=r((e,t,i)=>{e.loadNamespaces(t,tN(e,i))},"loadNamespaces"),aj=r((e,t,i,l)=>{if(Fr(i)&&(i=[i]),e.options.preload&&e.options.preload.indexOf(t)>-1)return ig(e,i,l);i.forEach(c=>{e.options.ns.indexOf(c)<0&&e.options.ns.push(c)}),e.loadLanguages(t,tN(e,l))},"loadLanguages"),MR=r((e,t,i={})=>!t.languages||!t.languages.length?(kd(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:i.lng,precheck:r((l,c)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&l.services.backendConnector.backend&&l.isLanguageChangingTo&&!c(l.isLanguageChangingTo,e))return!1},"precheck")}),"hasLoadedNamespace"),Fr=r(e=>typeof e=="string","isString"),OR=r(e=>typeof e=="object"&&e!==null,"isObject"),LR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zR={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},PR=r(e=>zR[e],"unescapeHtmlEntity"),UR=r(e=>e.replace(LR,PR),"unescape"),rg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:UR,transDefaultProps:void 0},$R=r((e={})=>{rg={...rg,...e}},"setDefaults"),BR=r(()=>rg,"getDefaults"),nN,KR=r(e=>{nN=e},"setI18n"),qR=r(()=>nN,"getI18n"),FR={type:"3rdParty",init(e){$R(e.options.react),KR(e)}},HR=(0,x.createContext)(),VR=class{static{r(this,"ReportNamespaces")}constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},WR=Xl((e=>{var t=Xg();function i(j,k){return j===k&&(j!==0||1/j===1/k)||j!==j&&k!==k}r(i,"is");var l=typeof Object.is=="function"?Object.is:i,c=t.useState,u=t.useEffect,m=t.useLayoutEffect,f=t.useDebugValue;function h(j,k){var S=k(),N=c({inst:{value:S,getSnapshot:k}}),_=N[0].inst,I=N[1];return m(function(){_.value=S,_.getSnapshot=k,g(_)&&I({inst:_})},[j,S,k]),u(function(){return g(_)&&I({inst:_}),j(function(){g(_)&&I({inst:_})})},[j]),f(S),S}r(h,"useSyncExternalStore$2");function g(j){var k=j.getSnapshot;j=j.value;try{var S=k();return!l(j,S)}catch{return!0}}r(g,"checkIfSnapshotChanged");function v(j,k){return k()}r(v,"useSyncExternalStore$1");var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v:h;e.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y})),QR=Xl(((e,t)=>{t.exports=WR()})),GR=QR(),YR=r((e,t)=>{if(Fr(t))return t;if(OR(t)&&Fr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const i=e[e.length-1];return typeof i=="function"?"":i}return e},"notReadyT"),XR={t:YR,ready:!1},ZR=r(()=>()=>{},"dummySubscribe"),JR=r((e,t={})=>{const{i18n:i}=t,{i18n:l,defaultNS:c}=(0,x.useContext)(HR)||{},u=i||l||qR();u&&!u.reportNamespaces&&(u.reportNamespaces=new VR),u||kd(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const m=(0,x.useMemo)(()=>({...BR(),...u?.options?.react,...t}),[u,t]),{useSuspense:f,keyPrefix:h}=m,g=e||c||u?.options?.defaultNS,v=Fr(g)?[g]:g||["translation"],y=(0,x.useMemo)(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(y);const j=(0,x.useRef)(0),k=(0,x.useCallback)(B=>{if(!u)return ZR;const{bindI18n:O,bindI18nStore:W}=m,Y=r(()=>{j.current+=1,B()},"wrappedCallback");return O&&u.on(O,Y),W&&u.store.on(W,Y),()=>{O&&O.split(" ").forEach(ce=>u.off(ce,Y)),W&&W.split(" ").forEach(ce=>u.store.off(ce,Y))}},[u,m]),S=(0,x.useRef)(),N=(0,x.useCallback)(()=>{if(!u)return XR;const B=!!(u.isInitialized||u.initializedStoreOnce)&&y.every(oe=>MR(oe,u,m)),O=t.lng||u.language,W=j.current,Y=S.current;if(Y&&Y.ready===B&&Y.lng===O&&Y.keyPrefix===h&&Y.revision===W)return Y;const ce={t:u.getFixedT(O,m.nsMode==="fallback"?y:y[0],h,{scopeNs:y}),ready:B,lng:O,keyPrefix:h,revision:W};return S.current=ce,ce},[u,y,h,m,t.lng]),[_,I]=(0,x.useState)(0),{t:D,ready:T}=(0,GR.useSyncExternalStore)(k,N,N);(0,x.useEffect)(()=>{if(u&&!T&&!f){const B=r(()=>I(O=>O+1),"onLoaded");t.lng?aj(u,t.lng,y,B):ig(u,y,B)}},[u,t.lng,y,T,f,_]);const C=u||{},M=(0,x.useRef)(null),z=(0,x.useRef)(),K=r(B=>`${B.language}|${B.resolvedLanguage}|${B.languages?.join(",")}`,"languageKey"),P=r(B=>{const O=Object.getOwnPropertyDescriptors(B);O.__original&&delete O.__original;const W=Object.create(Object.getPrototypeOf(B),O);if(!Object.prototype.hasOwnProperty.call(W,"__original"))try{Object.defineProperty(W,"__original",{value:B,writable:!1,enumerable:!1,configurable:!1})}catch{}return W},"createI18nWrapper"),A=(0,x.useMemo)(()=>{const B=C,O=B&&K(B);let W=B;B&&(M.current&&M.current.__original===B?z.current!==O?(W=P(B),M.current=W,z.current=O):W=M.current:(W=P(B),M.current=W,z.current=O));const Y=!T&&!f?(...oe)=>(kd(u,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),D(...oe)):D,ce=[Y,W,T];return ce.t=Y,ce.i18n=W,ce.ready=T,ce},[D,C,T,C.resolvedLanguage,C.language,C.languages]);if(u&&f&&!T){let B=!1;try{B=!1}catch{}throw B&&kd(u,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(O=>{const W=r(()=>O(),"onLoaded");t.lng?aj(u,t.lng,y,W):ig(u,y,W)})}return A},"useTranslation$1"),eD={noCompanies:{title:"أنشئ شركتك الأولى",description:"ابدأ بإنشاء شركة.",newCompany:"شركة جديدة"}},tD={app:eD},nD={noCompanies:{title:"আপনার প্রথম কোম্পানি তৈরি করুন",description:"একটি কোম্পানি তৈরি করে শুরু করুন।",newCompany:"নতুন কোম্পানি"}},sD={app:nD},aD={noCompanies:{title:"Vytvořte svou první společnost",description:"Začněte vytvořením společnosti.",newCompany:"Nová společnost"}},iD={app:aD},rD={noCompanies:{title:"Opret din første virksomhed",description:"Kom i gang ved at oprette en virksomhed.",newCompany:"Ny virksomhed"}},lD={app:rD},oD={noCompanies:{title:"Erstellen Sie Ihr erstes Unternehmen",description:"Beginnen Sie, indem Sie ein Unternehmen erstellen.",newCompany:"Neues Unternehmen"}},cD={app:oD},uD={noCompanies:{title:"Δημιουργήστε την πρώτη σας εταιρεία",description:"Ξεκινήστε δημιουργώντας μια εταιρεία.",newCompany:"Νέα εταιρεία"}},dD={app:uD},fD={noCompanies:{title:"Create your first organization",description:"Get started by creating an organization.",newCompany:"New Organization"}},A0={app:fD},mD={noCompanies:{title:"Crea tu primera empresa",description:"Comienza creando una empresa.",newCompany:"Nueva empresa"}},pD={app:mD},hD={noCompanies:{title:"اولین شرکت خود را ایجاد کنید",description:"با ایجاد یک شرکت شروع کنید.",newCompany:"شرکت جدید"}},gD={app:hD},xD={noCompanies:{title:"Luo ensimmäinen yrityksesi",description:"Aloita luomalla yritys.",newCompany:"Uusi yritys"}},bD={app:xD},vD={noCompanies:{title:"Gumawa ng iyong unang kumpanya",description:"Magsimula sa paggawa ng kumpanya.",newCompany:"Bagong Kumpanya"}},yD={app:vD},jD={noCompanies:{title:"Créez votre première entreprise",description:"Commencez par créer une entreprise.",newCompany:"Nouvelle entreprise"}},wD={app:jD},kD={noCompanies:{title:"צרו את החברה הראשונה שלכם",description:"התחילו ביצירת חברה.",newCompany:"חברה חדשה"}},SD={app:kD},ND={noCompanies:{title:"अपनी पहली कंपनी बनाएं",description:"कंपनी बनाकर शुरुआत करें.",newCompany:"नई कंपनी"}},CD={app:ND},AD={noCompanies:{title:"Hozza létre első vállalatát",description:"Kezdje egy vállalat létrehozásával.",newCompany:"Új vállalat"}},_D={app:AD},ED={noCompanies:{title:"Buat perusahaan pertama Anda",description:"Mulai dengan membuat perusahaan.",newCompany:"Perusahaan Baru"}},ID={app:ED},TD={noCompanies:{title:"Crea la tua prima azienda",description:"Inizia creando un'azienda.",newCompany:"Nuova azienda"}},RD={app:TD},DD={noCompanies:{title:"最初の会社を作成",description:"会社を作成して始めましょう。",newCompany:"新しい会社"}},MD={app:DD},OD={noCompanies:{title:"첫 회사를 만드세요",description:"회사를 만들어 시작하세요.",newCompany:"새 회사"}},LD={app:OD},zD={noCompanies:{title:"तुमची पहिली कंपनी तयार करा",description:"कंपनी तयार करून सुरुवात करा.",newCompany:"नवीन कंपनी"}},PD={app:zD},UD={noCompanies:{title:"Cipta syarikat pertama anda",description:"Mulakan dengan mencipta syarikat.",newCompany:"Syarikat Baharu"}},$D={app:UD},BD={noCompanies:{title:"Opprett ditt første selskap",description:"Kom i gang ved å opprette et selskap.",newCompany:"Nytt selskap"}},KD={app:BD},qD={noCompanies:{title:"Maak uw eerste bedrijf aan",description:"Begin door een bedrijf aan te maken.",newCompany:"Nieuw bedrijf"}},FD={app:qD},HD={noCompanies:{title:"ਆਪਣੀ ਪਹਿਲੀ ਕੰਪਨੀ ਬਣਾਓ",description:"ਕੰਪਨੀ ਬਣਾਕੇ ਸ਼ੁਰੂ ਕਰੋ।",newCompany:"ਨਵੀਂ ਕੰਪਨੀ"}},VD={app:HD},WD={noCompanies:{title:"Utwórz swoją pierwszą firmę",description:"Zacznij od utworzenia firmy.",newCompany:"Nowa firma"}},QD={app:WD},GD={noCompanies:{title:"Crie sua primeira empresa",description:"Comece criando uma empresa.",newCompany:"Nova empresa"}},YD={app:GD},XD={noCompanies:{title:"Crie a sua primeira empresa",description:"Comece por criar uma empresa.",newCompany:"Nova empresa"}},ZD={app:XD},JD={noCompanies:{title:"Creați prima companie",description:"Începeți prin crearea unei companii.",newCompany:"Companie nouă"}},eM={app:JD},tM={noCompanies:{title:"Создайте свою первую компанию",description:"Начните с создания компании.",newCompany:"Новая компания"}},nM={app:tM},sM={noCompanies:{title:"Skapa ditt första företag",description:"Kom igång genom att skapa ett företag.",newCompany:"Nytt företag"}},aM={app:sM},iM={noCompanies:{title:"Unda kampuni yako ya kwanza",description:"Anza kwa kuunda kampuni.",newCompany:"Kampuni Mpya"}},rM={app:iM},lM={noCompanies:{title:"உங்கள் முதல் நிறுவனத்தை உருவாக்குங்கள்",description:"ஒரு நிறுவனத்தை உருவாக்கி தொடங்குங்கள்.",newCompany:"புதிய நிறுவனம்"}},oM={app:lM},cM={noCompanies:{title:"మీ మొదటి కంపెనీని సృష్టించండి",description:"కంపెనీని సృష్టించడం ద్వారా ప్రారంభించండి.",newCompany:"కొత్త కంపెనీ"}},uM={app:cM},dM={noCompanies:{title:"สร้างบริษัทแรกของคุณ",description:"เริ่มต้นด้วยการสร้างบริษัท",newCompany:"บริษัทใหม่"}},fM={app:dM},mM={noCompanies:{title:"İlk şirketinizi oluşturun",description:"Bir şirket oluşturarak başlayın.",newCompany:"Yeni Şirket"}},pM={app:mM},hM={noCompanies:{title:"Створіть свою першу компанію",description:"Почніть зі створення компанії.",newCompany:"Нова компанія"}},gM={app:hM},xM={noCompanies:{title:"اپنی پہلی کمپنی بنائیں",description:"کمپنی بنا کر شروع کریں۔",newCompany:"نئی کمپنی"}},bM={app:xM},vM={noCompanies:{title:"Tạo công ty đầu tiên của bạn",description:"Bắt đầu bằng cách tạo một công ty.",newCompany:"Công ty mới"}},yM={app:vM},jM={noCompanies:{title:"创建您的第一家公司",description:"通过创建公司开始。",newCompany:"新公司"}},wM={app:jM},kM={noCompanies:{title:"建立您的第一家公司",description:"從建立公司開始。",newCompany:"新公司"}},SM={app:kM},NM=2e3;function ij(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}r(ij,"isPlainObject");function Ji(e){return e.length>0?e.join("."):"<root>"}r(Ji,"formatPath");function rj(e){return Array.from(e.matchAll(/{{\s*([A-Za-z0-9_.-]+)\s*}}/g),t=>t[1]).sort()}r(rj,"interpolationPlaceholders");function lj(e){return/<\/?[A-Za-z][A-Za-z0-9:-]*(?:\s[^>]*)?>/.test(e)}r(lj,"hasRawHtml");function oj(e){return/\son[A-Za-z]+\s*=/i.test(e)}r(oj,"hasEventHandlerAttribute");function cj(e){return Array.from(e.matchAll(/\bhttps?:\/\/[^\s<>"')]+/gi),t=>t[0]).sort()}r(cj,"urlsIn");function CM(e,t){const i=[[/<script\b/i.test(e),/<script\b/i.test(t),"<script"],[oj(e),oj(t),"event-handler attribute"],[/\bjavascript\s*:/i.test(e),/\bjavascript\s*:/i.test(t),"javascript:"],[/\bdata\s*:/i.test(e),/\bdata\s*:/i.test(t),"data:"],[lj(e),lj(t),"raw HTML tag"]].filter(([c,u])=>c&&!u).map(([,,c])=>c),l=new Set(cj(t));return cj(e).find(c=>!l.has(c))&&i.push("unexpected URL"),i}r(CM,"hasBlockedData");function AM(e,t,i,l){const c=rj(t),u=rj(i);c.join("\0")!==u.join("\0")&&l.push(`${Ji(e)} interpolation placeholders must match English exactly: expected ${JSON.stringify(u)}, received ${JSON.stringify(c)}`);for(const h of CM(t,i))l.push(`${Ji(e)} contains disallowed ${h}`);const m=Math.max(i.length*4+64,i.length+128),f=Math.min(NM,m);t.length>f&&l.push(`${Ji(e)} is too long: ${t.length} characters exceeds ${f}`)}r(AM,"validateString");function sN(e,t,i,l){if(typeof i=="string"){if(typeof t!="string"){l.push(`${Ji(e)} must be a string`);return}AM(e,t,i,l);return}if(!ij(i)){l.push(`${Ji(e)} has unsupported English reference type`);return}if(!ij(t)){l.push(`${Ji(e)} must be an object`);return}const c=Object.keys(i).sort(),u=Object.keys(t).sort(),m=c.filter(h=>!u.includes(h)),f=u.filter(h=>!c.includes(h));for(const h of m)l.push(`${Ji([...e,h])} is missing`);for(const h of f)l.push(`${Ji([...e,h])} is not defined in English`);for(const h of c)h in t&&sN([...e,h],t[h],i[h],l)}r(sN,"validateNode");function _M(e,t=A0){const i=[];return sN([],e,t,i),i}r(_M,"validateLocaleMessages");function EM(e,t=A0){const i=_M(e,t);if(i.length>0)throw new Error(`Invalid locale messages:
3
3
  ${i.join(`
4
4
  `)}`)}r(EM,"assertValidLocaleMessages");var IM=Object.assign({"./locales/ar.json":tD,"./locales/bn.json":sD,"./locales/cs.json":iD,"./locales/da.json":lD,"./locales/de.json":cD,"./locales/el.json":dD,"./locales/en.json":A0,"./locales/es.json":pD,"./locales/fa.json":gD,"./locales/fi.json":bD,"./locales/fil.json":yD,"./locales/fr.json":wD,"./locales/he.json":SD,"./locales/hi.json":CD,"./locales/hu.json":_D,"./locales/id.json":ID,"./locales/it.json":RD,"./locales/ja.json":MD,"./locales/ko.json":LD,"./locales/mr.json":PD,"./locales/ms.json":$D,"./locales/nb.json":KD,"./locales/nl.json":FD,"./locales/pa.json":VD,"./locales/pl.json":QD,"./locales/pt-BR.json":YD,"./locales/pt-PT.json":ZD,"./locales/ro.json":eM,"./locales/ru.json":nM,"./locales/sv.json":aM,"./locales/sw.json":rM,"./locales/ta.json":oM,"./locales/te.json":uM,"./locales/th.json":fM,"./locales/tr.json":pM,"./locales/uk.json":gM,"./locales/ur.json":bM,"./locales/vi.json":yM,"./locales/zh-CN.json":wM,"./locales/zh-TW.json":SM}),Sf=Object.fromEntries(Object.entries(IM).map(([e,t])=>{const i=e.match(/\/([A-Za-z0-9_-]+)\.json$/)?.[1];if(!i)throw new Error(`Invalid locale file path: ${e}`);return[i,t]}));if(!("en"in Sf))throw new Error("Missing default locale messages for en");for(const[e,t]of Object.entries(Sf))try{EM(t)}catch(i){const l=i instanceof Error?i.message:String(i);throw new Error(`Invalid ${e} locale messages: ${l}`)}var TM=Object.keys(Sf),RM=Object.fromEntries(Object.entries(Sf).map(([e,t])=>[e,{translation:t}])),DM={resources:RM,lng:"en",fallbackLng:"en",supportedLngs:TM,defaultNS:"translation",interpolation:{escapeValue:!1},returnObjects:!1,initAsync:!1};_s.use(FR).init(DM).catch(e=>{});var aN=JR,s=Qg(J_(),1);function uj({collapsible:e,headerAction:t,label:i,menu:l}){const{isMobile:c}=Jn(),[u,m]=(0,x.useState)(!1),f=!!(l&&((l.actions?.length??0)>0||(l.radioChoices?.length??0)>0)),h="text-(length:--text-nano) font-medium uppercase tracking-widest font-mono text-ink-3/60",g=c?"opacity-100":"opacity-0 group-hover/sidebar-section:opacity-100 group-focus-within/sidebar-section:opacity-100",v=X("h-3 w-3 shrink-0 text-ink-3/60 transition-all",g,e?.open&&"rotate-90",u&&"opacity-100"),y=X("h-5 w-5 shrink-0 text-ink-3/60 transition-opacity hover:text-ink data-[state=open]:opacity-100",g),j=(0,s.jsx)("span",{className:h,children:i}),k=t?.icon,S=f?(0,s.jsxs)(Gr,{open:u,onOpenChange:m,children:[(0,s.jsx)(Wr,{asChild:!0,children:(0,s.jsx)("button",{type:"button","data-slot":"icon-button",className:X("inline-flex min-w-0 max-w-full items-center rounded-md px-1 py-0.5 text-left outline-none transition-colors","hover:bg-bg-3/50 focus-visible:bg-bg-3/50 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-1",u&&"bg-bg-3/50"),"aria-label":l?.ariaLabel??`${i} actions`,children:j})}),(0,s.jsxs)(Qr,{align:"start",className:"w-48",children:[l?.actions?.map((N,_)=>{if(N.type==="separator")return(0,s.jsx)(ki,{},`separator-${_}`);const I=N.icon,D=(0,s.jsxs)(s.Fragment,{children:[I?(0,s.jsx)(I,{className:"size-4"}):null,(0,s.jsx)("span",{children:N.label})]});return N.href?(0,s.jsx)(Cn,{asChild:!0,children:(0,s.jsx)(gn,{to:N.href,children:D})},`${N.label}-${_}`):(0,s.jsx)(Cn,{onSelect:N.onSelect,children:D},`${N.label}-${_}`)}),l?.radioChoices&&l.radioChoices.length>0?(0,s.jsx)(KE,{value:l.radioValue,onValueChange:l.onRadioValueChange,"aria-label":l.radioLabel,children:l.radioChoices.map(N=>(0,s.jsx)(qE,{value:N.value,children:N.label},N.value))}):null]})]}):(0,s.jsx)("div",{className:"inline-flex min-w-0 max-w-full items-center px-1 py-0.5",children:j});return(0,s.jsx)("div",{className:"group/sidebar-section px-3 py-1.5 pointer-coarse:py-1",children:(0,s.jsxs)("div",{className:"relative flex min-h-6 min-w-0 items-center gap-1",children:[e?(0,s.jsx)($E,{asChild:!0,children:(0,s.jsx)("button",{type:"button","data-slot":"icon-button",className:"absolute -left-4 flex h-5 w-5 items-center justify-center rounded-sm outline-none transition-colors hover:bg-bg-3 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-1","aria-label":e.open?`Collapse ${i}`:`Expand ${i}`,children:(0,s.jsx)(nr,{className:v,"aria-hidden":"true"})})}):null,S,t&&k?(0,s.jsx)(le,{variant:"ghost",size:"icon-xs",className:y,"aria-label":t.ariaLabel,onClick:t.onClick,children:(0,s.jsx)(k,{className:"h-3.5 w-3.5"})}):null]})})}r(uj,"SidebarSectionHeader");function qd({label:e,children:t,collapsible:i,menu:l,headerAction:c}){const{collapsed:u,peeking:m}=Jn(),f=o3(),h=u&&!m&&!f,g=(0,s.jsx)("div",{className:"flex flex-col gap-0.5 mt-0.5",children:t});return h?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"px-3 py-1.5 pointer-coarse:py-1",children:(0,s.jsxs)("div",{className:"flex min-h-6 items-center",children:[(0,s.jsx)("span",{className:"sr-only",children:e}),(0,s.jsx)("div",{className:"h-px w-full bg-line/60","aria-hidden":"true"})]})}),g]}):i?(0,s.jsxs)(Jk,{open:i.open,onOpenChange:i.onOpenChange,children:[(0,s.jsx)(uj,{label:e,collapsible:i,menu:l,headerAction:c}),(0,s.jsx)(Zk,{children:g})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(uj,{label:e,menu:l,headerAction:c}),g]})}r(qd,"SidebarSection");var iN=(0,x.createContext)(null),MM=iN.Provider;function Nf(e){const t=(0,x.useContext)(iN);return t&&(!e||t.companyId===e)?t:null}r(Nf,"usePrimaryAgentPresentation");function dQ({agentId:e,companyId:t}){const i=Nf(t);return!i||i.loading||i.primaryAgentId!==e?null:(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("span",{role:"img","aria-label":"My primary agent",className:"inline-flex shrink-0 text-accent",children:(0,s.jsx)(Yk,{"aria-hidden":"true",className:"size-3.5"})})}),(0,s.jsx)(Ea,{children:"My primary agent"})]})}r(dQ,"PrimaryAgentIndicator");function fQ({agent:e}){const t=Nf(e.companyId);if(!t||e.status==="terminated"||e.status==="pending_approval")return null;if(t.error)return(0,s.jsx)(le,{type:"button",variant:"danger",size:"sm",onClick:t.onRetry,className:"h-auto justify-start p-0 text-xs",children:"Retry loading primary agent"});const i=t.primaryAgentId===e.id,l=t.pendingAgentId===e.id;if(i&&!l&&!t.loading)return null;const c=t.primaryAgent?.id===t.primaryAgentId?t.primaryAgent:null,u=t.loading||!!(t.primaryAgentId&&!c),m=u||!!t.pendingAgentId,f=(0,s.jsxs)(le,{type:"button",variant:"link",size:"sm",disabled:m,onClick:t.primaryAgentId?void 0:()=>t.onChange(e.id),className:"h-auto justify-start p-0 text-xs",children:[l||u?(0,s.jsx)(As,{"aria-hidden":"true",className:"size-3 motion-safe:animate-spin"}):null,u?"Loading primary…":l?"Setting primary…":"Set as my primary"]});return c?(0,s.jsxs)(lS,{children:[(0,s.jsx)(BE,{asChild:!0,children:f}),(0,s.jsxs)(nS,{children:[(0,s.jsxs)("div",{className:"flex items-start justify-center gap-5 pt-2",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col items-center gap-2 text-center",children:[(0,s.jsx)(ir,{agent:c,size:64,label:`${c.name} avatar`}),(0,s.jsx)("span",{className:"max-w-full break-words text-sm font-medium",children:c.name})]}),(0,s.jsx)(eI,{"aria-hidden":"true",className:"mt-5 size-6 shrink-0 text-ink-3"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col items-center gap-2 text-center",children:[(0,s.jsx)(ir,{agent:e,size:64,label:`${e.name} avatar`,className:"rounded-xl ring-1 ring-accent ring-offset-2 ring-offset-bg"}),(0,s.jsxs)("span",{className:"flex max-w-full items-center justify-center gap-1.5 text-sm font-medium",children:[(0,s.jsx)("span",{className:"min-w-0 break-words",children:e.name}),(0,s.jsx)("span",{role:"img","aria-label":"New primary agent",className:"inline-flex shrink-0 text-accent",children:(0,s.jsx)(Yk,{"aria-hidden":"true",className:"size-3.5"})})]})]})]}),(0,s.jsxs)(rS,{children:[(0,s.jsx)(tS,{children:"Change your primary agent?"}),(0,s.jsxs)(eS,{className:"break-words",children:["This will make ",e.name," your primary agent, do you want to do this?"]})]}),(0,s.jsxs)(aS,{className:"flex-row justify-between sm:justify-between",children:[(0,s.jsx)(iS,{children:"Cancel"}),(0,s.jsx)(sS,{disabled:m,onClick:r(()=>t.onChange(e.id),"onClick"),children:"Set as my primary"})]})]})]},c.id):f}r(fQ,"SetPrimaryAgentButton");var rN=(0,x.createContext)(null),lN=(0,x.createContext)(null);function OM({children:e}){const[t,i]=(0,x.useState)(!1),[l,c]=(0,x.useState)({}),[u,m]=(0,x.useState)(!1),[f,h]=(0,x.useState)(!1),[g,v]=(0,x.useState)({}),[y,j]=(0,x.useState)(!1),[k,S]=(0,x.useState)(!1),[N,_]=(0,x.useState)({}),[I,D]=(0,x.useState)(!1),T=(0,x.useCallback)((oe={})=>{c(oe),i(!0)},[]),C=(0,x.useCallback)(()=>{i(!1),c({})},[]),M=(0,x.useCallback)(()=>{m(!0)},[]),z=(0,x.useCallback)(()=>{m(!1)},[]),K=(0,x.useCallback)((oe={})=>{v(oe),h(!0)},[]),P=(0,x.useCallback)(()=>{h(!1),v({})},[]),A=(0,x.useCallback)(()=>{j(!0)},[]),B=(0,x.useCallback)(()=>{j(!1)},[]),O=(0,x.useCallback)((oe={})=>{_(oe),S(!0)},[]),W=(0,x.useCallback)(()=>{S(!1),_({})},[]),Y=(0,x.useMemo)(()=>({newIssueOpen:t,newIssueDefaults:l,newProjectOpen:u,newGoalOpen:f,newGoalDefaults:g,newAgentOpen:y,onboardingOpen:k,onboardingOptions:N,onboardingRouteDismissed:I}),[t,l,u,f,g,y,k,N,I]),ce=(0,x.useMemo)(()=>({openNewIssue:T,closeNewIssue:C,openNewProject:M,closeNewProject:z,openNewGoal:K,closeNewGoal:P,openNewAgent:A,closeNewAgent:B,openOnboarding:O,closeOnboarding:W,setOnboardingRouteDismissed:D}),[T,C,M,z,K,P,A,B,O,W,D]);return(0,s.jsx)(lN.Provider,{value:ce,children:(0,s.jsx)(rN.Provider,{value:Y,children:e})})}r(OM,"DialogProvider");function Pa(){const e=(0,x.useContext)(lN);if(!e)throw new Error("useDialogActions must be used within DialogProvider");return e}r(Pa,"useDialogActions");function Cf(){const e=(0,x.useContext)(rN);if(!e)throw new Error("useDialogState must be used within DialogProvider");return e}r(Cf,"useDialogState");function Mc(){return{...Cf(),...Pa()}}r(Mc,"useDialog");var LM={list:r(e=>we.get(`/companies/${e}/built-in-agents`),"list"),provision:r((e,t,i={})=>we.post(`/companies/${e}/built-in-agents/${t}/provision`,i),"provision"),reset:r((e,t,i)=>we.post(`/companies/${e}/built-in-agents/${t}/reset`,i?{resources:i}:{}),"reset"),reconcile:r((e,t)=>we.post(`/companies/${e}/built-in-agents/${t}/reconcile`,{}),"reconcile"),runRoutine:r((e,t,i)=>we.post(`/companies/${e}/built-in-agents/${t}/routines/${i}/run`,{}),"runRoutine"),enableRoutineSchedule:r((e,t,i)=>we.post(`/companies/${e}/built-in-agents/${t}/routines/${i}/enable`,{}),"enableRoutineSchedule"),disableRoutineSchedule:r((e,t,i)=>we.post(`/companies/${e}/built-in-agents/${t}/routines/${i}/disable`,{}),"disableRoutineSchedule")};function zM({status:e,compact:t=!1,className:i}){if(e!=="needs_setup"&&e!=="pending_approval")return null;const l=e==="pending_approval";return(0,s.jsx)(Bn,{variant:"outline",className:X(EE.amber,t&&"px-1.5 py-0 text-(length:--text-nano)",i),title:l?"Waiting on board hire approval before the feature can run":"Needs adapter/model setup before the feature can run",children:l?t?"Approval":"Pending approval":t?"Setup":"Needs setup"})}r(zM,"BuiltInLifecycleChip");function Vp(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0}r(Vp,"areEqual$2");function Wp(e,t,i){return Vh(e,t,i).map(l=>l.id)}r(Wp,"buildOrderIds$2");function PM({agents:e,companyId:t,userId:i}){const l=(0,x.useMemo)(()=>({leadershipFirst:!0}),[]),c=(0,x.useMemo)(()=>t?b3(t,i):null,[t,i]),[u,m]=(0,x.useState)(()=>c?Wp(e,Up(c),l):e.map(f=>f.id));return(0,x.useEffect)(()=>{const f=c?Wp(e,Up(c),l):e.map(h=>h.id);m(h=>Vp(h,f)?h:f)},[e,c,l]),(0,x.useEffect)(()=>{if(!c)return;const f=r(v=>{const y=Wp(e,v,l);m(j=>Vp(j,y)?j:y)},"syncFromIds"),h=r(v=>{v.key===c&&f(Up(c))},"onStorage"),g=r(v=>{const y=v.detail;!y||y.storageKey!==c||f(y.orderedIds)},"onCustomEvent");return window.addEventListener("storage",h),window.addEventListener(Ty,g),()=>{window.removeEventListener("storage",h),window.removeEventListener(Ty,g)}},[e,c,l]),{orderedAgents:(0,x.useMemo)(()=>Vh(e,u,l),[e,u,l]),orderedIds:u,persistOrder:(0,x.useCallback)(f=>{const h=new Set(e.map(v=>v.id)),g=f.filter(v=>h.has(v));for(const v of Vh(e,[],l))g.includes(v.id)||g.push(v.id);m(v=>Vp(v,g)?v:g),c&&h3(c,g)},[e,c,l])}}r(PM,"useAgentOrder");var lg={listMine:r(e=>we.get(`/companies/${e}/resource-memberships/me`),"listMine"),updateProject:r((e,t,i)=>we.put(`/companies/${e}/resource-memberships/me/projects/${t}`,i),"updateProject"),updateAgent:r((e,t,i)=>we.put(`/companies/${e}/resource-memberships/me/agents/${t}`,i),"updateAgent")};function UM(){return{projectMemberships:{},agentMemberships:{},starredProjectIds:[],starredAgentIds:[],starredDocumentIds:[],projectStarredAt:{},agentStarredAt:{},documentStarredAt:{},updatedAt:null}}r(UM,"emptyMemberships");function $M(e){return e==="project"?{ids:"starredProjectIds",at:"projectStarredAt",state:"projectMemberships"}:{ids:"starredAgentIds",at:"agentStarredAt",state:"agentMemberships"}}r($M,"starKeys");function dj(e,t,i,l){const c=e??UM(),u=$M(t),m=c[u.state]??{},f=m[i]==="left"?"left":"joined",h=l.starred===!0?"joined":l.state??f,g=c[u.ids]??[],v={...c[u.at]??{}},y=g.includes(i),j=h==="left"?!1:l.starred===!0?!0:l.starred===!1?!1:y;let k=g;return j&&!y?(k=[i,...g],v[i]=new Date):!j&&y&&(k=g.filter(S=>S!==i),delete v[i]),{...c,[u.state]:{...m,[i]:h},[u.ids]:k,[u.at]:v,updatedAt:new Date}}r(dj,"applyMembershipChange");function oN(e,t,i){return(t==="project"?e?.projectMemberships[i]:e?.agentMemberships[i])==="left"?"left":"joined"}r(oN,"resourceMembershipState");function cN(e,t,i){const l=t==="project"?e?.starredProjectIds:t==="agent"?e?.starredAgentIds:e?.starredDocumentIds;return Array.isArray(l)&&l.includes(i)}r(cN,"isStarred");function uN(e,t){const i=t==="project"?e?.starredProjectIds:t==="agent"?e?.starredAgentIds:e?.starredDocumentIds;return Array.isArray(i)?i:[]}r(uN,"starredResourceIds");function _0(e){return ge({queryKey:U.resourceMemberships.mine(e??"__none__"),queryFn:r(()=>lg.listMine(e),"queryFn"),enabled:!!e})}r(_0,"useResourceMemberships");function dN(e){const t=wn(),{pushToast:i}=Ni(),l=U.resourceMemberships.mine(e??"__none__");return Kt({mutationFn:r(c=>{if(!e)throw new Error("Select an organization first.");const u={state:c.state,starred:c.starred};return c.resourceType==="project"?lg.updateProject(e,c.resourceId,u):lg.updateAgent(e,c.resourceId,u)},"mutationFn"),onMutate:r(async c=>{await t.cancelQueries({queryKey:l});const u=t.getQueryData(l);return t.setQueryData(l,dj(u,c.resourceType,c.resourceId,{state:c.state,starred:c.starred})),{previous:u}},"onMutate"),onError:r((c,u,m)=>{m?.previous&&t.setQueryData(l,m.previous);const f=u.starred!==void 0?u.starred?"star":"unstar":u.state==="left"?"leave":"join";i({title:`Couldn't ${f} ${u.resourceName}.`,body:c instanceof Error?c.message:"Try again.",tone:"error"})},"onError"),onSuccess:r((c,u)=>{t.setQueryData(l,m=>dj(m,u.resourceType,c.resourceId,{state:c.state,starred:c.starredAt!=null}))},"onSuccess"),onSettled:r(()=>{t.invalidateQueries({queryKey:["primary-agent",e]}),t.invalidateQueries({queryKey:l})},"onSettled")})}r(dN,"useResourceMembershipMutation");var BM={healthy:"bg-emerald-500/90 text-white",warning:"bg-amber-500/95 text-amber-950",critical:"bg-red-500/90 text-white"},KM={healthy:"Budget healthy",warning:"Budget warning",critical:"Paused by budget"};function fN({title:e,level:t="critical"}){const i=e??KM[t];return(0,s.jsx)("span",{title:i,"aria-label":i,className:`ml-auto inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full shadow-(--shadow-extract-3) ${BM[t]}`,children:(0,s.jsx)(ZS,{className:"h-3 w-3"})})}r(fN,"BudgetSidebarMarker");var qM="opacity-100 sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100";function mN({starred:e,resourceName:t,pending:i=!1,error:l=!1,size:c="row",onToggle:u,quiet:m=!1,className:f,revealClassName:h}){const g=e?`Unstar ${t}`:`Star ${t}`,v=i?As:Zg;function y(j){j.preventDefault(),j.stopPropagation(),!i&&u(!e)}return r(y,"handleClick"),c==="button"?(0,s.jsx)(le,{type:"button",size:"icon-sm",variant:"ghost","aria-label":g,"aria-pressed":e,"aria-busy":i?"true":void 0,disabled:i,onClick:y,title:l?"Couldn't save — retry":void 0,className:f,children:(0,s.jsx)(v,{className:X("h-4 w-4",i&&"motion-safe:animate-spin",!i&&l&&"text-bad",!i&&e&&!l&&"fill-amber-500 text-amber-500",!i&&l&&"text-red-500")})}):(0,s.jsx)(le,{type:"button",size:"icon-xs",variant:"ghost","aria-label":g,"aria-pressed":e,"aria-busy":i?"true":void 0,disabled:i,onClick:y,title:l?"Couldn't save — retry":void 0,className:X("h-6 w-6 shrink-0",l||i||e&&!m?"opacity-100":h??qM,f),children:(0,s.jsx)(v,{className:X("h-3.5 w-3.5",i&&"motion-safe:animate-spin",!i&&l&&"text-red-500",!i&&!l&&e&&"fill-amber-500 text-amber-500",!i&&!l&&!e&&"text-ink-3")})})}r(mN,"StarToggle");var FM=3,fj=12e4,HM=[{value:"top",label:"Top"},{value:"alphabetical",label:"Alphabetical"},{value:"recent",label:"Recent"}];function _l(e,t){const i=e[t];if(!i)return 0;const l=new Date(i).getTime();return Number.isFinite(l)?l:0}r(_l,"agentTimestamp");function mj(e,t){if(t==="top")return e;const i=[...e];return t==="alphabetical"?(i.sort((l,c)=>l.name.localeCompare(c.name,void 0,{sensitivity:"base"})),i):(i.sort((l,c)=>{const u=_l(c,"lastHeartbeatAt")-_l(l,"lastHeartbeatAt");if(u!==0)return u;const m=_l(c,"updatedAt")-_l(l,"updatedAt");if(m!==0)return m;const f=_l(c,"createdAt")-_l(l,"createdAt");return f!==0?f:l.name.localeCompare(c.name,void 0,{sensitivity:"base"})}),i)}r(mj,"sortAgents");var VM="opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-within/agent:opacity-100";function WM({activeAgentId:e,activeTab:t,agent:i,disabled:l,isMobile:c,leaving:u,onLeaveAgent:m,onPauseResume:f,rail:h,runCount:g,setSidebarOpen:v,builtInStatus:y,starred:j=!1,onToggleStar:k,starPending:S=!1}){const N=ar(i),_=t?`${jd(i)}/${t}`:jd(i),I=`${jd(i)}/configuration`,D=e===N,T=i.status==="paused",C=T&&i.pauseReason==="budget",M=i.orgChainHealth?.status==="invalid_org_chain",z=T?"Resume agent":"Pause agent",K=l||i.status==="pending_approval"||C||T&&M,P=l?"Updating...":C?"Budget paused":T&&M?"Invalid org chain":z,A=y==="needs_setup"||y==="pending_approval",B=[A?`Built-in agent ${y.replace(/_/g," ")}`:null,M?"Invalid reporting chain":null].filter(Boolean).join(", ")||void 0,O=(0,s.jsx)(Ge,{to:_,label:i.name,iconNode:(0,s.jsx)(ir,{agent:i,size:16,className:"shrink-0 h-4 w-4"}),active:D,liveCount:g,labelClassName:A?"min-w-(--sz-4_5rem) flex-initial":void 0,className:X("min-w-0 flex-1",j&&!c?"pr-14":"pr-8"),trailing:A||M?(0,s.jsxs)("span",{className:"ml-1 flex shrink-0 items-center gap-1",children:[A?(0,s.jsx)(zM,{status:y,compact:!0}):null,M?(0,s.jsx)(Ja,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):null]}):void 0,trailingLabel:B,liveAccessory:i.pauseReason==="budget"?(0,s.jsx)(fN,{title:"Agent paused by budget"}):void 0});return h?O:(0,s.jsxs)("div",{className:"group/agent relative flex items-center",children:[O,j&&!c&&k?(0,s.jsx)("span",{className:"absolute right-10 top-1/2 -translate-y-1/2",children:(0,s.jsx)(mN,{size:"row",quiet:!0,starred:!0,pending:S,resourceName:i.name,onToggle:r(()=>k(i,!1),"onToggle"),revealClassName:VM})}):null,(0,s.jsxs)(Gr,{children:[(0,s.jsx)(Wr,{asChild:!0,children:(0,s.jsx)(le,{variant:"ghost",size:"icon-xs",className:X("absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 transition-opacity data-[state=open]:pointer-events-auto data-[state=open]:opacity-100",c?"opacity-100":"pointer-events-none opacity-0 group-hover/agent:pointer-events-auto group-hover/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:opacity-100"),"aria-label":`Open actions for ${i.name}`,children:(0,s.jsx)(gf,{className:"h-3.5 w-3.5"})})}),(0,s.jsxs)(Qr,{align:"end",className:"w-48",children:[k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Cn,{onClick:r(()=>{S||k(i,!j)},"onClick"),disabled:S,children:[S?(0,s.jsx)(As,{className:"size-4 motion-safe:animate-spin"}):(0,s.jsx)(Zg,{className:X("size-4",j&&"fill-amber-500 text-amber-500")}),(0,s.jsx)("span",{children:j?"Remove from starred":"Star agent"})]}),(0,s.jsx)(ki,{})]}):null,(0,s.jsx)(Cn,{asChild:!0,children:(0,s.jsxs)(gn,{to:I,onClick:r(()=>{c&&v(!1)},"onClick"),children:[(0,s.jsx)(S0,{className:"size-4"}),(0,s.jsx)("span",{children:"Edit agent"})]})}),(0,s.jsx)(ki,{}),(0,s.jsxs)(Cn,{onClick:r(()=>{K||f(i,T?"resume":"pause")},"onClick"),disabled:K,title:C?"Agent was paused by budget limits":void 0,children:[T?(0,s.jsx)(WS,{className:"size-4"}):(0,s.jsx)(HS,{className:"size-4"}),(0,s.jsx)("span",{children:P})]}),(0,s.jsx)(ki,{}),(0,s.jsxs)(Cn,{onClick:r(()=>{u||m(i)},"onClick"),disabled:u,children:[u?(0,s.jsx)(As,{className:"size-4 motion-safe:animate-spin"}):(0,s.jsx)(wf,{className:"size-4"}),(0,s.jsx)("span",{children:u?"Leaving...":"Leave agent"})]})]})]})]})}r(WM,"SidebarAgentItem");function QM({streamlined:e=!1}={}){const[t,i]=(0,x.useState)(!0),[l,c]=(0,x.useState)(()=>new Set),[u,m]=(0,x.useState)(0),f=(0,x.useRef)(new Map),h=wn(),{selectedCompanyId:g}=vt(),v=Nf(g),{openNewAgent:y}=Pa(),{isMobile:j,setSidebarOpen:k,collapsed:S,peeking:N}=Jn(),_=S&&!N,{pushToast:I}=Ni(),D=vn(),{data:T}=ge({queryKey:U.agents.list(g),queryFn:r(()=>$s.list(g),"queryFn"),enabled:!!g}),{data:C}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn"),enabled:!!g}),M=C?.enableBuiltInAgents===!0,{data:z}=ge({queryKey:U.builtInAgents.list(g),queryFn:r(()=>LM.list(g),"queryFn"),enabled:!!g&&M}),K=(0,x.useMemo)(()=>{const je=new Map;if(!M)return je;for(const $e of z??[])$e.agentId&&je.set($e.agentId,$e.status);return je},[z,M]),{data:P}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),A=_0(g),B=dN(g),O=U.liveRuns(g),W=gc({companyId:g,resourceKey:"live-runs",queryKey:O,enabled:!!g,refetchInterval:!1,leaderOnly:!0}),{data:Y,dataUpdatedAt:ce}=ge({queryKey:O,queryFn:r(()=>vf.liveRunsForCompany(g),"queryFn"),enabled:W.enabled,refetchInterval:W.refetchInterval});xc(W,Y,ce);const oe=(0,x.useMemo)(()=>{const je=new Map;for(const $e of Y??[])je.set($e.agentId,(je.get($e.agentId)??0)+1);return je},[Y]),$=(0,x.useMemo)(()=>{const je=new Set;for(const[$e,He]of oe)He>0&&je.add($e);return je},[oe]),R=(0,x.useMemo)(()=>(T??[]).filter(je=>je.status!=="terminated"&&(!A.isSuccess||oN(A.data,"agent",je.id)!=="left")),[T,A.data,A.isSuccess]),ne=P?.user?.id??P?.session?.userId??null,ue=(0,x.useMemo)(()=>g?g3(g,ne):null,[ne,g]),[ae,Ee]=(0,x.useState)(()=>ue?$p(ue):"top"),{orderedAgents:fe}=PM({agents:R,companyId:g,userId:ne}),Ae=(0,x.useMemo)(()=>mj(fe,ae),[fe,ae]),Ce=(0,x.useMemo)(()=>new Set(Ae.map(je=>je.id)),[Ae]);(0,x.useEffect)(()=>{const je=Date.now();for(const $e of $)f.current.set($e,je);for(const $e of f.current.keys())Ce.has($e)||f.current.delete($e)},[$,Ce]);const Se=(0,x.useMemo)(()=>{const je=Date.now(),$e=f.current;return Ae.filter(He=>{if((oe.get(He.id)??0)>0)return!0;const mt=$e.get(He.id);return mt!==void 0&&je-mt<=fj})},[oe,u,Ae]),he=Se.length>0,De=e?he?Se:Ae.slice(0,FM):Ae,Ye=e&&Ae.length>0,ze=D.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/),ve=ze?.[1]??null,ft=ze?.[2]??null;(0,x.useEffect)(()=>{if(!ue){Ee("top");return}Ee($p(ue))},[ue]),(0,x.useEffect)(()=>{if(!ue)return;const je=r(He=>{He.key===ue&&Ee($p(ue))},"onStorage"),$e=r(He=>{const mt=He.detail;!mt||mt.storageKey!==ue||Ee(mt.sortMode)},"onCustomEvent");return window.addEventListener("storage",je),window.addEventListener(Iy,$e),()=>{window.removeEventListener("storage",je),window.removeEventListener(Iy,$e)}},[ue]),(0,x.useEffect)(()=>{if(!e)return;const je=Date.now();let $e=null;for(const mt of Ae){if((oe.get(mt.id)??0)>0)continue;const it=f.current.get(mt.id);if(it===void 0)continue;const Qt=it+fj;Qt<je||($e=$e===null?Qt:Math.min($e,Qt))}if($e===null)return;const He=window.setTimeout(()=>{m(mt=>mt+1)},Math.max(0,$e-je+1));return()=>{window.clearTimeout(He)}},[e,Ae,oe,u]);const At=(0,x.useCallback)(je=>{const $e=je==="alphabetical"||je==="recent"?je:"top";Ee($e),ue&&x3(ue,$e)},[ue]),xt=Kt({mutationFn:r(({agent:je,action:$e})=>$e==="pause"?$s.pause(je.id,g??void 0):$s.resume(je.id,g??void 0),"mutationFn"),onMutate:r(({agent:je})=>{c($e=>{const He=new Set($e);return He.add(je.id),He})},"onMutate"),onSuccess:r(async(je,{agent:$e,action:He})=>{g&&await Promise.all([h.invalidateQueries({queryKey:U.agents.list(g)}),h.invalidateQueries({queryKey:U.liveRuns(g)}),h.invalidateQueries({queryKey:U.dashboard(g)})]),await Promise.all([h.invalidateQueries({queryKey:U.agents.detail($e.id)}),h.invalidateQueries({queryKey:U.agents.detail(ar($e))})]),I({title:He==="pause"?"Agent paused":"Agent resumed",body:$e.name,tone:"success"})},"onSuccess"),onError:r((je,{agent:$e,action:He})=>{I({title:He==="pause"?"Could not pause agent":"Could not resume agent",body:je instanceof Error?je.message:$e.name,tone:"error"})},"onError"),onSettled:r((je,$e,{agent:He})=>{c(mt=>{const it=new Set(mt);return it.delete(He.id),it})},"onSettled")}),Pt=(0,x.useCallback)(je=>B.mutate({resourceType:"agent",resourceId:je.id,resourceName:je.name,state:"left"}),[B]),de=(0,x.useCallback)(je=>B.isPending&&B.variables?.resourceType==="agent"&&B.variables.resourceId===je.id,[B.isPending,B.variables]),Oe=(0,x.useCallback)((je,$e)=>B.mutate({resourceType:"agent",resourceId:je.id,resourceName:je.name,starred:$e}),[B]),qe=(0,x.useCallback)(je=>B.isPending&&B.variables?.resourceType==="agent"&&B.variables.resourceId===je.id&&B.variables.starred!==void 0,[B.isPending,B.variables]),ut=(0,x.useMemo)(()=>new Set(uN(A.data,"agent")),[A.data]),Vt=(0,x.useMemo)(()=>mj(R.filter(je=>ut.has(je.id)),"alphabetical"),[R,ut]),Wt=(0,x.useMemo)(()=>De.filter(je=>!ut.has(je.id)),[De,ut]),H=v&&!v.loading?R.find(je=>je.id===v.primaryAgentId):void 0,rn=r((je,$e)=>(0,s.jsx)(WM,{activeAgentId:ve,activeTab:ft,agent:je,disabled:l.has(je.id),isMobile:j,leaving:de(je),onLeaveAgent:Pt,onPauseResume:r((He,mt)=>xt.mutate({agent:He,action:mt}),"onPauseResume"),rail:_,runCount:oe.get(je.id)??0,setSidebarOpen:k,builtInStatus:K.get(je.id),starred:$e||cN(A.data,"agent",je.id),onToggleStar:Oe,starPending:qe(je)},je.id),"renderAgentRow");return(0,s.jsxs)(qd,{label:"Agents",collapsible:{open:t,onOpenChange:i},headerAction:{ariaLabel:"New agent",icon:Js,onClick:y},menu:{ariaLabel:"Agents section actions",actions:[{type:"item",label:"Browse agents",icon:qr,href:"/agents/all"},{type:"separator"}],radioLabel:"Agent sort",radioChoices:HM,radioValue:ae,onRadioValueChange:At},children:[[...H?[H]:[],...Vt.filter(je=>je.id!==H?.id),...Wt.filter(je=>je.id!==H?.id)].map(je=>rn(je,ut.has(je.id))),Ye&&(()=>{const je=(0,s.jsxs)(gn,{to:"/agents/all",state:xf,"aria-label":_?"See all agents":void 0,onClick:r(()=>{j&&k(!1)},"onClick"),className:"flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink",children:[(0,s.jsx)(qr,{className:"shrink-0 h-4 w-4"}),(0,s.jsx)("span",{className:_?"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none":void 0,children:"See all agents"})]});return _?(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:je}),(0,s.jsx)(Ea,{side:"right",children:"See all agents"})]}):je})()]})}r(QM,"SidebarAgents");var GM="opacity-0 transition-opacity group-hover/starred-project:opacity-100 group-focus-within/starred-project:opacity-100";function YM(){const{selectedCompanyId:e}=vt(),{isMobile:t,setSidebarOpen:i,collapsed:l,peeking:c}=Jn(),u=l&&!c,m=vn(),{data:f}=ge({queryKey:U.projects.list(e),queryFn:r(()=>rr.list(e),"queryFn"),enabled:!!e}),h=_0(e),g=dN(e),v=m.pathname.match(/^\/(?:[^/]+\/)?projects\/([^/]+)/)?.[1]??null,y=(0,x.useMemo)(()=>{if(!h.isSuccess)return[];const N=new Set(uN(h.data,"project"));if(N.size===0)return[];const _=new Map((f??[]).map(I=>[I.id,I]));return Array.from(N).map(I=>_.get(I)).filter(I=>!!I).sort((I,D)=>I.name.localeCompare(D.name,void 0,{sensitivity:"base"}))},[h.data,h.isSuccess,f]),j=(0,x.useCallback)(N=>g.mutate({resourceType:"project",resourceId:N.id,resourceName:N.name,starred:!1}),[g]),k=(0,x.useCallback)(N=>g.mutate({resourceType:"project",resourceId:N.id,resourceName:N.name,state:"left"}),[g]),S=(0,x.useCallback)(N=>g.isPending&&g.variables?.resourceType==="project"&&g.variables.resourceId===N.id,[g.isPending,g.variables]);return!h.isSuccess||y.length===0?null:(0,s.jsx)("div",{className:"flex flex-col gap-0.5","aria-label":"Starred projects",children:y.map(N=>{const _=Rk(N),I=v===_||v===N.id,D=S(N),T=D&&g.variables?.starred===!1,C=D&&g.variables?.state==="left",M=cN(h.data,"project",N.id),z=(0,s.jsx)(XM,{project:N,active:I,rail:u,onNavigate:r(()=>{t&&i(!1)},"onNavigate")});return(0,s.jsxs)("div",{className:"group/starred-project relative flex items-center",children:[u?(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("div",{className:"min-w-0 flex-1",children:z})}),(0,s.jsx)(Ea,{side:"right",children:N.name})]}):z,!u&&!t?(0,s.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,s.jsx)(mN,{size:"row",quiet:!0,starred:M,pending:T,resourceName:N.name,onToggle:r(()=>j(N),"onToggle"),revealClassName:GM})}):null,!u&&t?(0,s.jsxs)(Gr,{children:[(0,s.jsx)(Wr,{asChild:!0,children:(0,s.jsx)(le,{variant:"ghost",size:"icon-xs",className:"absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 opacity-100","aria-label":`Open actions for ${N.name}`,children:(0,s.jsx)(gf,{className:"h-3.5 w-3.5"})})}),(0,s.jsxs)(Qr,{align:"end",className:"w-48",children:[(0,s.jsxs)(Cn,{onClick:r(()=>{D||j(N)},"onClick"),disabled:D,children:[T?(0,s.jsx)(As,{className:"size-4 motion-safe:animate-spin"}):(0,s.jsx)(Zg,{className:"size-4 fill-amber-500 text-amber-500"}),(0,s.jsx)("span",{children:"Remove from starred"})]}),(0,s.jsx)(ki,{}),(0,s.jsxs)(Cn,{onClick:r(()=>{D||k(N)},"onClick"),disabled:D,children:[C?(0,s.jsx)(As,{className:"size-4 motion-safe:animate-spin"}):(0,s.jsx)(wf,{className:"size-4"}),(0,s.jsx)("span",{children:"Leave project"})]})]})]}):null]},N.id)})})}r(YM,"SidebarStarredProjects");function XM({project:e,active:t,rail:i,onNavigate:l}){return(0,s.jsxs)(gn,{to:`/projects/${Rk(e)}/issues`,state:xf,"aria-current":t?"page":void 0,onClick:l,className:X("flex min-w-0 flex-1 items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium transition-colors",!i&&"pl-6 pr-8",t?Vl.active:X(Vl.rest,"text-ink/80")),children:[(0,s.jsx)(Xk,{color:e.color??null,icon:e.icon??null,size:"xs"}),(0,s.jsx)("span",{className:i?Lk:"flex-1 truncate",children:e.name}),!i&&e.visibility==="private"?(0,s.jsx)(Uh,{className:"size-3.5 shrink-0 text-ink-3","aria-label":"Private project"}):null,!i&&e.pauseReason==="budget"?(0,s.jsx)(fN,{title:"Project paused by budget"}):null]})}r(XM,"SidebarStarredProjectLink");var og="wardmote:recent-tasks-updated",pN="wardmote.recentTasks.v2:",ZM="wardmote.recentTasks:";function hN(e,t){return`${pN}${e}:${t??"__local_board__"}`}r(hN,"getRecentTasksStorageKey");function JM(e,t){if(!e||typeof e!="object")return!1;const i=e;return i.companyId===t&&typeof i.id=="string"&&i.id.length>0&&typeof i.title=="string"&&(i.identifier===null||typeof i.identifier=="string")&&typeof i.status=="string"&&typeof i.recordedAt=="number"&&Number.isFinite(i.recordedAt)&&(i.snapshotUpdatedAt===void 0||typeof i.snapshotUpdatedAt=="number"&&Number.isFinite(i.snapshotUpdatedAt))}r(JM,"isRecentTaskEntry");function $r(e,t){if(typeof window>"u")return[];try{const i=e.startsWith(pN)?ZM+e.slice(24):e,l=window.localStorage.getItem(e)??window.localStorage.getItem(i),c=JSON.parse(l??"[]");return Array.isArray(c)?gN(c.filter(u=>JM(u,t))):[]}catch{return[]}}r($r,"readRecentTasks");function eO(e,t){if(!(typeof window>"u")){try{if(window.localStorage.getItem(e)!==null)return}catch{return}Af(e,$r(e,t))}}r(eO,"migrateRecentTasks");function gN(e){const t=new Set;return[...e].sort((i,l)=>l.recordedAt-i.recordedAt).filter(i=>t.has(i.id)?!1:(t.add(i.id),!0)).slice(0,5)}r(gN,"normalizeRecentTasks");function tO(e,t){typeof window>"u"||window.dispatchEvent(new CustomEvent(og,{detail:{storageKey:e,entries:t}}))}r(tO,"publishRecentTasks");function Af(e,t){if(typeof window>"u")return;const i=gN(t);try{const l=JSON.stringify(i);if(window.localStorage.getItem(e)===l)return;window.localStorage.setItem(e,l)}catch{}tO(e,i)}r(Af,"writeRecentTasks");function E0(e,t){if(e.id!==t.id||e.companyId!==t.companyId)return e;const i=new Date(t.updatedAt).getTime();return!Number.isFinite(i)||e.snapshotUpdatedAt!==void 0&&i<e.snapshotUpdatedAt?e:i===e.snapshotUpdatedAt?t.externalConversationState!==void 0&&t.externalConversationState!==e.externalConversationState?{...e,status:t.status,externalConversationState:t.externalConversationState}:e:{...e,title:t.title,identifier:t.identifier,status:t.status,externalConversationState:t.externalConversationState,snapshotUpdatedAt:i,recordedAt:Math.max(e.recordedAt,i)}}r(E0,"mergeRecentTaskSnapshot");function nO(e,t,i=new Date(e.updatedAt).getTime()){if(e.conversationAgentId)return;const l=hN(e.companyId,t),c=$r(l,e.companyId),u=c.find(v=>v.id===e.id),m=Number.isFinite(i)?i:u?.recordedAt??Date.now(),f=new Date(e.updatedAt).getTime(),h=u?E0(u,e):{id:e.id,companyId:e.companyId,title:e.title,identifier:e.identifier,status:e.status,externalConversationState:e.externalConversationState,recordedAt:m,...Number.isFinite(f)?{snapshotUpdatedAt:f}:{}},g={...h,recordedAt:Math.max(m,h.recordedAt)};u&&u.title===g.title&&u.identifier===g.identifier&&u.status===g.status&&u.externalConversationState===g.externalConversationState&&u.recordedAt===g.recordedAt&&u.snapshotUpdatedAt===g.snapshotUpdatedAt||Af(l,u?c.map(v=>v.id===e.id?g:v):[g,...c])}r(nO,"recordRecentTask");function sO(e,t,i){if(i.size===0)return;const l=$r(e,t),c=l.filter(u=>!i.has(u.id));c.length!==l.length&&Af(e,c)}r(sO,"pruneRecentTasks");function xN(e,t,i){const l=new Map(i.map(f=>[f.id,f])),c=$r(e,t);let u=!1;const m=c.map(f=>{const h=l.get(f.id);if(!h||h.companyId!==t)return f;const g=E0(f,h);return g!==f&&(u=!0),g});u&&Af(e,m)}r(xN,"updateRecentTaskSnapshots");var aO=1e3;function iO({companyId:e,userId:t}){const i=(0,x.useMemo)(()=>e?hN(e,t):null,[e,t]),[l,c]=(0,x.useState)(()=>i&&e?$r(i,e):[]);(0,x.useEffect)(()=>{i&&e&&eO(i,e),c(i&&e?$r(i,e):[])},[e,i]),(0,x.useEffect)(()=>{if(!i||!e)return;const N=r(()=>c($r(i,e)),"sync"),_=r(D=>{D.key===i&&N()},"onStorage"),I=r(D=>{const T=D.detail;T?.storageKey===i&&c(T.entries)},"onRecentTasksUpdated");return window.addEventListener("storage",_),window.addEventListener(og,I),()=>{window.removeEventListener("storage",_),window.removeEventListener(og,I)}},[e,i]);const u=[...l].sort((N,_)=>N.id.localeCompare(_.id)),m=JSON.stringify(u.map(N=>N.id)),f=t0({queries:u.map(N=>({queryKey:U.issues.detail(N.id),queryFn:r(()=>hn.get(N.id),"queryFn"),retry:!1,staleTime:3e4}))}),h=new Map(f.flatMap(N=>N.data?[[N.data.id,N.data]]:[])),g=l.map(N=>{const _=h.get(N.id);return!_||_.companyId!==e||_.hiddenAt?N:E0(N,_)}),v=f.map(N=>`${N.dataUpdatedAt}:${N.errorUpdatedAt}:${N.status}`).join("|");(0,x.useEffect)(()=>{if(!i||!e||f.length===0)return;const N=[],_=new Set;f.forEach((I,D)=>{const T=u[D];T&&(I.data?I.data.companyId!==e||I.data.hiddenAt?_.add(T.id):N.push(I.data):I.error instanceof Si&&[403,404].includes(I.error.status)&&_.add(T.id))}),xN(i,e,N),sO(i,e,_)},[e,m,v,i]);const[y,j]=(0,x.useState)(()=>l.map(N=>N.id)),k=JSON.stringify(l.map(N=>[N.id,N.recordedAt]));(0,x.useEffect)(()=>{const N=JSON.parse(k).map(([I])=>I);if(JSON.stringify([...y].sort((I,D)=>I.localeCompare(D)))!==m){j(N);return}if(N.every((I,D)=>I===y[D]))return;const _=window.setTimeout(()=>j(N),aO);return()=>window.clearTimeout(_)},[k,m,y,i]);const S=new Map(g.map(N=>[N.id,N]));return{entries:y.length===l.length&&y.every(N=>S.has(N))?y.map(N=>S.get(N)):g,storageKey:i}}r(iO,"useRecentTasks");var Qp="h-(--profile-popover-row-height) gap-(--profile-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) focus:bg-bg-3/50 focus:text-ink",rO=":restart-wake-retry";function lO(e,t){return`wardmote.recentTasks:${e}:${t??"__local_board__"}${rO}`}r(lO,"restartWakeRetryStorageKey");function bN(e){if(!e)return new Set;try{const t=JSON.parse(window.localStorage.getItem(e)??"[]");return new Set(Array.isArray(t)?t.filter(i=>typeof i=="string"):[])}catch{return new Set}}r(bN,"readRestartWakeRetryIssueIds");function Gp(e,t,i){if(!e)return;const l=bN(e);i?l.add(t):l.delete(t);try{l.size>0?window.localStorage.setItem(e,JSON.stringify([...l])):window.localStorage.removeItem(e)}catch{}}r(Gp,"setRestartWakeRetryPending");function Yp(e,t){return e instanceof Error&&e.message.trim()?e.message:t}r(Yp,"errorMessage$2");function oO({companyId:e,liveIssueIds:t}){const{collapsed:i,peeking:l}=Jn(),c=i&&!l,{data:u,isPending:m}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1});if(!e||m)return null;const f=u?.user?.id??u?.session?.userId??null;return(0,s.jsx)(cO,{companyId:e,userId:f,liveIssueIds:t,rail:c},`${e}:${f??"__local_board__"}`)}r(oO,"SidebarRecentTasks");function cO({companyId:e,userId:t,liveIssueIds:i,rail:l}){const{entries:c,storageKey:u}=iO({companyId:e,userId:t}),m=wn(),f=bf(),[h,g]=(0,x.useState)(null),[v,y]=(0,x.useState)(""),[j,k]=(0,x.useState)(null),S=lO(e,t);if(c.length===0)return null;const N=r(async C=>{await Promise.all([m.invalidateQueries({queryKey:U.issues.detail(C)}),m.invalidateQueries({queryKey:U.issues.list(e)}),m.invalidateQueries({queryKey:U.issues.activity(C)})])},"refreshIssueQueries"),_=r(C=>{g(C),y(C.title)},"beginRename"),I=r(async C=>{C.preventDefault();const M=v.trim();if(!h||!M||M===h.title){g(null);return}k("rename");try{const z=await hn.update(h.id,{title:M});m.setQueryData(U.issues.detail(h.id),z),u&&xN(u,e,[z]),await N(h.id),g(null),f?.pushToast({title:"Task renamed",tone:"success"})}catch(z){f?.pushToast({title:"Task rename failed",body:Yp(z,"Unable to rename this task."),tone:"error"})}finally{k(null)}},"submitRename"),D=r(async C=>{k("archive");try{await hn.archiveFromInbox(C.id),await N(C.id),await m.invalidateQueries({queryKey:U.sidebarBadges(e)}),f?.pushToast({title:"Task archived from inbox",tone:"success"})}catch(M){f?.pushToast({title:"Task archive failed",body:Yp(M,"Unable to archive this task from the inbox."),tone:"error"})}finally{k(null)}},"archiveTask"),T=r(async C=>{k("pause");try{const M=await hn.getTreeControlState(C.id);if(M.activePauseHold?.isRoot){const z=await hn.get(C.id);if(Gp(S,C.id,!0),await hn.releaseTreeHold(C.id,M.activePauseHold.holdId,{reason:"Restarted from Recent Tasks."}),z.assigneeAgentId){const K=await $s.wakeup(z.assigneeAgentId,{source:"assignment",triggerDetail:"manual",reason:"recent_task_restart",payload:{issueId:z.id}},z.companyId);if(!("id"in K))throw new Error(K.message??"The assignee wake was skipped.")}Gp(S,C.id,!1),f?.pushToast({title:"Task restarted",tone:"success"})}else{if(M.activePauseHold)throw new Error("This task is paused by a parent task. Restart it from the pause root.");if(bN(S).has(C.id)){const z=await hn.get(C.id);if(z.assigneeAgentId){const K=await $s.wakeup(z.assigneeAgentId,{source:"assignment",triggerDetail:"manual",reason:"recent_task_restart_retry",payload:{issueId:z.id}},z.companyId);if(!("id"in K))throw new Error(K.message??"The assignee wake was skipped.")}Gp(S,C.id,!1),f?.pushToast({title:"Task restarted",tone:"success"})}else await hn.createTreeHold(C.id,{mode:"pause",reason:"Paused from Recent Tasks.",releasePolicy:{strategy:"manual"}}),f?.pushToast({title:"Task paused",tone:"success"})}await m.invalidateQueries({queryKey:["issues","tree-control-state",C.id]})}catch(M){f?.pushToast({title:"Task pause update failed",body:Yp(M,"Unable to pause or restart this task."),tone:"error"})}finally{k(null)}},"toggleTaskPause");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(qd,{label:"Recent Tasks",children:c.map(C=>(0,s.jsxs)("div",{className:"sidebar-action-row group/recent-task relative",children:[(0,s.jsx)(Ge,{to:`/issues/${C.id}`,label:C.title,trailing:C.status==="in_review"&&C.externalConversationState==="waiting"?(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Idle"}):void 0,trailingLabel:C.status==="in_review"&&C.externalConversationState==="waiting"?"Idle":void 0,className:l?void 0:"sidebar-action-link pointer-coarse:pr-8 [.sidebar-action-row:is(:hover,:focus-within)_&]:text-ink [.sidebar-action-row:has(.sidebar-action-menu[data-state=open])_&]:text-ink",liveCount:i.has(C.id)?1:void 0}),l?null:(0,s.jsxs)(Gr,{children:[(0,s.jsx)(Wr,{asChild:!0,children:(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`More actions for ${C.title}`,className:"sidebar-action-menu absolute right-2 top-(--pct-50) z-10 -translate-y-(--pct-50) pointer-events-none opacity-0 transition-opacity focus-visible:pointer-events-auto focus-visible:opacity-100 pointer-coarse:pointer-events-auto pointer-coarse:opacity-100 pointer-coarse:before:hidden group-hover/recent-task:pointer-events-auto group-hover/recent-task:opacity-100 group-focus-within/recent-task:pointer-events-auto group-focus-within/recent-task:opacity-100 data-[state=open]:pointer-events-auto data-[state=open]:opacity-100",children:(0,s.jsx)(gf,{"aria-hidden":"true"})})}),(0,s.jsxs)(Qr,{side:"right",align:"start",className:"w-(--profile-popover-width) rounded-xl p-1.5 shadow-(--shadow-profile-popover)",children:[(0,s.jsxs)(Cn,{className:Qp,onSelect:r(()=>_(C),"onSelect"),children:[(0,s.jsx)(S0,{"aria-hidden":"true"}),"Rename"]}),(0,s.jsxs)(Cn,{className:Qp,disabled:j!==null,onSelect:r(()=>{D(C)},"onSelect"),children:[(0,s.jsx)(uS,{"aria-hidden":"true"}),"Archive"]}),(0,s.jsxs)(Cn,{className:Qp,disabled:j!==null,onSelect:r(()=>{T(C)},"onSelect"),children:[(0,s.jsx)(Yr,{"aria-hidden":"true"}),"Pause/Restart"]})]})]})]},C.id))}),(0,s.jsx)(ya,{open:h!==null,onOpenChange:r(C=>{!C&&j!=="rename"&&g(null)},"onOpenChange"),children:(0,s.jsx)(za,{className:"sm:max-w-md",children:(0,s.jsxs)("form",{className:"grid gap-4",onSubmit:r(C=>{I(C)},"onSubmit"),children:[(0,s.jsxs)(Jl,{children:[(0,s.jsx)(Da,{children:"Rename task"}),(0,s.jsx)(eo,{children:"Choose a short, clear name for this task."})]}),(0,s.jsx)(Wn,{autoFocus:!0,"aria-label":"Task name",value:v,disabled:j==="rename",onChange:r(C=>y(C.target.value),"onChange")}),(0,s.jsxs)(jf,{children:[(0,s.jsx)(le,{type:"button",variant:"secondary",disabled:j==="rename",onClick:r(()=>g(null),"onClick"),children:"Cancel"}),(0,s.jsx)(le,{type:"submit",disabled:j==="rename"||!v.trim(),children:j==="rename"?"Saving...":"Save"})]})]})})})]})}r(cO,"RecentTasksList");var uO={list:r((e,t={})=>{const i=new URLSearchParams;t.includeDismissed&&i.set("includeDismissed","true"),t.archived&&i.set("archived","true"),t.all&&i.set("all","true"),t.activitySince&&i.set("activitySince",t.activitySince),t.activityUntil&&i.set("activityUntil",t.activityUntil),t.queue&&i.set("queue",t.queue),t.sort&&i.set("sort",t.sort),t.cursor&&i.set("cursor",t.cursor),t.limit!==void 0&&i.set("limit",String(t.limit));const l=i.toString();return we.get(`/companies/${e}/attention${l?`?${l}`:""}`)},"list"),count:r(e=>we.get(`/companies/${e}/attention/count`),"count")},Xu={list:r(e=>we.get(`/companies/${e}/inbox-dismissals`),"list"),dismiss:r((e,t)=>we.post(`/companies/${e}/inbox-dismissals`,{itemKey:t}),"dismiss"),snooze:r((e,t,i)=>we.post(`/companies/${e}/inbox-dismissals`,{itemKey:t,kind:"snooze",snoozedUntil:i}),"snooze"),restore:r((e,t)=>we.delete(`/companies/${e}/inbox-dismissals/${encodeURIComponent(t)}`),"restore")},vN={list:r((e,t)=>we.get(`/companies/${e}/approvals${t?`?status=${encodeURIComponent(t)}`:""}`),"list"),create:r((e,t)=>we.post(`/companies/${e}/approvals`,t),"create"),get:r(e=>we.get(`/approvals/${e}`),"get"),approve:r((e,t)=>we.post(`/approvals/${e}/approve`,{decisionNote:t}),"approve"),reject:r((e,t)=>we.post(`/approvals/${e}/reject`,{decisionNote:t}),"reject"),requestRevision:r((e,t)=>we.post(`/approvals/${e}/request-revision`,{decisionNote:t}),"requestRevision"),resubmit:r((e,t)=>we.post(`/approvals/${e}/resubmit`,{payload:t}),"resubmit"),listComments:r(e=>we.get(`/approvals/${e}/comments`),"listComments"),addComment:r((e,t)=>we.post(`/approvals/${e}/comments`,{body:t}),"addComment"),listIssues:r(e=>we.get(`/approvals/${e}/issues`),"listIssues")},dO={summary:r(e=>we.get(`/companies/${e}/dashboard`),"summary")},yN={get:r(e=>we.get(`/companies/${e}/sidebar-badges`),"get")};var fO=new Set(["failed","timed_out"]),Fd=new Set(["pending","revision_requested"]),jN="wardmote:inbox:dismissed",wN="wardmote:inbox:read-items",kN="wardmote:inbox:last-tab",mQ="wardmote:inbox:issue-columns",SN="wardmote:inbox:nesting",NN="wardmote:inbox:group-by",pQ="wardmote:inbox:filters",mO="wardmote:inbox:collapsed-groups",pO="wardmote:inbox:collapsed-parents",cg=["status","id","assignee","kickedOffBy","project","workspace","parent","labels","updated"],CN=["status","id","updated"];function AN(e){return e?`${mO}:${e}`:null}r(AN,"getInboxCollapsedGroupsStorageKey");function _N(e){return e?`${pO}:${e}`:null}r(_N,"getInboxCollapsedParentsStorageKey");function hQ(e){const t=AN(e);if(!t)return new Set;try{const i=localStorage.getItem(t);if(!i)return new Set;const l=JSON.parse(i);return new Set(Array.isArray(l)?l.filter(c=>typeof c=="string"):[])}catch{return new Set}}r(hQ,"loadCollapsedInboxGroupKeys");function gQ(e,t){const i=AN(e);if(i)try{localStorage.setItem(i,JSON.stringify([...t]))}catch{}}r(gQ,"saveCollapsedInboxGroupKeys");function xQ(e){const t=_N(e);if(!t)return new Set;try{const i=localStorage.getItem(t);if(!i)return new Set;const l=JSON.parse(i);return new Set(Array.isArray(l)?l.filter(c=>typeof c=="string"):[])}catch{return new Set}}r(xQ,"loadCollapsedInboxParentIds");function bQ(e,t){const i=_N(e);if(i)try{localStorage.setItem(i,JSON.stringify([...t]))}catch{}}r(bQ,"saveCollapsedInboxParentIds");function pj(){try{const e=localStorage.getItem(jN);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(i=>typeof i=="string"&&i.startsWith("alert:"))):new Set}catch{return new Set}}r(pj,"loadDismissedInboxAlerts");function hO(e){try{localStorage.setItem(jN,JSON.stringify([...e]))}catch{}}r(hO,"saveDismissedInboxAlerts");function gO(e){return new Map(e.map(t=>[t.itemKey,ea(t.dismissedAt)]))}r(gO,"buildInboxDismissedAtByKey");function hj(e,t,i){const l=e.get(t);return l==null?!1:l>=ea(i)}r(hj,"isInboxEntityDismissed");function gj(){try{const e=localStorage.getItem(wN);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}r(gj,"loadReadInboxItems");function xj(e){try{localStorage.setItem(wN,JSON.stringify([...e]))}catch{}}r(xj,"saveReadInboxItems");function EN(e){const t=new Set(e);return cg.filter(i=>t.has(i))}r(EN,"normalizeInboxIssueColumns");function xO(e){return e?[...cg]:cg.filter(t=>t!=="workspace")}r(xO,"getAvailableInboxIssueColumns");function vQ(){try{const e=localStorage.getItem(NN);return e==="type"||e==="assignee"||e==="project"||e==="workspace"?e:"none"}catch{return"none"}}r(vQ,"loadInboxWorkItemGroupBy");function yQ(e){try{localStorage.setItem(NN,e)}catch{}}r(yQ,"saveInboxWorkItemGroupBy");function jQ(e,t,i){return i&&e==="workspace"&&!t}r(jQ,"shouldResetInboxWorkspaceGrouping");function bO(e,t,{isolatedWorkspacesEnabled:i=!1,executionWorkspaceById:l,projectWorkspaceById:c,defaultProjectWorkspaceIdByProjectId:u}={}){const m=t.trim().toLowerCase();return!m||e.title.toLowerCase().includes(m)||e.identifier?.toLowerCase().includes(m)||e.description?.toLowerCase().includes(m)?!0:i?IN(e,{executionWorkspaceById:l,projectWorkspaceById:c,defaultProjectWorkspaceIdByProjectId:u})?.toLowerCase().includes(m)??!1:!1}r(bO,"matchesInboxIssueSearch");function wQ({visibleIssues:e,searchableIssues:t,query:i,isolatedWorkspacesEnabled:l=!1,executionWorkspaceById:c,projectWorkspaceById:u,defaultProjectWorkspaceIdByProjectId:m}){const f=i.trim();if(!f)return[];const h=new Set(e.map(g=>g.id));return t.filter(g=>!h.has(g.id)).filter(g=>bO(g,f,{isolatedWorkspacesEnabled:l,executionWorkspaceById:c,projectWorkspaceById:u,defaultProjectWorkspaceIdByProjectId:m})).sort(vc)}r(wQ,"getArchivedInboxSearchIssues");function kQ({query:e,filteredWorkItems:t,archivedSearchIssues:i,remoteIssues:l,issueFilters:c,currentUserId:u,enableRoutineVisibilityFilter:m=!1,liveIssueIds:f,issueFilterContext:h={}}){if(!e.trim())return[];const g=new Set([...t.filter(v=>v.kind==="issue").map(v=>v.issue.id),...i.map(v=>v.id)]);return AS(l,c,u,m,f,h).filter(v=>!g.has(v.id))}r(kQ,"getInboxSearchSupplementIssues");function vO(e){const t=e?.trim();return t?`${t} (default)`:"Default workspace"}r(vO,"formatDefaultWorkspaceGroupLabel");function yO(e,{projectWorkspaceById:t,defaultProjectWorkspaceIdByProjectId:i}){if(!e.projectId)return null;const l=i?.get(e.projectId)??null;return l?{id:l,label:vO(t?.get(l)?.name)}:null}r(yO,"resolveDefaultProjectWorkspaceInfo");function IN(e,{executionWorkspaceById:t,projectWorkspaceById:i,defaultProjectWorkspaceIdByProjectId:l}){const c=e.projectId?l?.get(e.projectId)??null:null;if(e.executionWorkspaceId){const u=t?.get(e.executionWorkspaceId)??null,m=u?.projectWorkspaceId??e.projectWorkspaceId??null;if(u?.mode==="shared_workspace"&&m===c)return null;const f=u?.name;if(f)return f}if(e.projectWorkspaceId){if(e.projectWorkspaceId===c)return null;const u=i?.get(e.projectWorkspaceId)?.name;if(u)return u}return null}r(IN,"resolveIssueWorkspaceName");function jO(e,{executionWorkspaceById:t,projectWorkspaceById:i,defaultProjectWorkspaceIdByProjectId:l}={}){const c=yO(e,{projectWorkspaceById:i,defaultProjectWorkspaceIdByProjectId:l});if(e.executionWorkspaceId){const u=t?.get(e.executionWorkspaceId)??null,m=u?.projectWorkspaceId??e.projectWorkspaceId??null;if(u?.mode==="shared_workspace"&&m!=null&&m===c?.id&&c)return{key:`workspace:project:${c.id}`,label:c.label};const f=u?.name?.trim();if(f)return{key:`workspace:execution:${e.executionWorkspaceId}`,label:f}}if(e.projectWorkspaceId){if(e.projectWorkspaceId===c?.id)return{key:`workspace:project:${c.id}`,label:c.label};const u=i?.get(e.projectWorkspaceId)?.name?.trim();if(u)return{key:`workspace:project:${e.projectWorkspaceId}`,label:u}}return c?{key:`workspace:project:${c.id}`,label:c.label}:{key:"workspace:none",label:"No workspace"}}r(jO,"resolveIssueWorkspaceGroup");function SQ(){try{return localStorage.getItem(SN)!=="false"}catch{return!0}}r(SQ,"loadInboxNesting");function NQ(e){try{localStorage.setItem(SN,String(e))}catch{}}r(NQ,"saveInboxNesting");function CQ(e,t){return e&&!t}r(CQ,"resolveInboxNestingEnabled");function bj(){try{const e=localStorage.getItem(kN);return e==="all"||e==="unread"||e==="recent"||e==="mine"||e==="blocked"?e:"mine"}catch{return"mine"}}r(bj,"loadLastInboxTab");function AQ(e){try{localStorage.setItem(kN,e)}catch{}}r(AQ,"saveLastInboxTab");function _Q(e){return e==="mine"}r(_Q,"isMineInboxTab");function EQ(e){return e==="all"}r(EQ,"shouldShowCompanyAlerts");function IQ(e,t){return t===0||e<0?-1:Math.min(e,t-1)}r(IQ,"resolveInboxSelectionIndex");function wO(e,t,i){return t===0?-1:e<0?0:i==="next"?Math.min(e+1,t-1):Math.max(e-1,0)}r(wO,"getInboxKeyboardSelectionIndex");function TQ(e){const t=[...e].sort((l,c)=>new Date(c.createdAt).getTime()-new Date(l.createdAt).getTime()),i=new Map;for(const l of t)i.has(l.agentId)||i.set(l.agentId,l);return Array.from(i.values()).filter(l=>fO.has(l.status))}r(TQ,"getLatestFailedRunsByAgent");function ea(e){if(!e)return 0;const t=new Date(e).getTime();return Number.isFinite(t)?t:0}r(ea,"normalizeTimestamp");function Hd(e){const t=ea(e.lastActivityAt);if(t>0)return t;const i=ea(e.lastExternalCommentAt);return i>0?i:ea(e.updatedAt)}r(Hd,"issueLastActivityTimestamp");function vc(e,t){const i=Hd(t)-Hd(e);return i!==0?i:ea(t.updatedAt)-ea(e.updatedAt)}r(vc,"sortIssuesByMostRecentActivity");function kO(e){return[...e].sort(vc).slice(0,100)}r(kO,"getRecentTouchedIssues");function RQ(e,t,i,l){const c=[...e].sort((u,m)=>ea(m.updatedAt)-ea(u.updatedAt));return t==="mine"?c.filter(u=>TN(u,l)):t==="recent"?c:t==="unread"?c.filter(u=>Fd.has(u.status)):i==="all"?c:c.filter(u=>{const m=Fd.has(u.status);return i==="actionable"?m:!m})}r(RQ,"getApprovalsForTab");function TN(e,t){return Fd.has(e.status)?!0:t?e.requestedByUserId===t||e.decidedByUserId===t:!1}r(TN,"isApprovalVisibleInMine");function Xp(e){const t=ea(e.updatedAt);return t>0?t:ea(e.createdAt)}r(Xp,"approvalActivityTimestamp");function DQ({issues:e,approvals:t,failedRuns:i=[],joinRequests:l=[]}){return[...e.map(c=>({kind:"issue",timestamp:Hd(c),issue:c})),...t.map(c=>({kind:"approval",timestamp:Xp(c),approval:c})),...i.map(c=>({kind:"failed_run",timestamp:ea(c.createdAt),run:c})),...l.map(c=>({kind:"join_request",timestamp:ea(c.createdAt),joinRequest:c}))].sort((c,u)=>{const m=u.timestamp-c.timestamp;return m!==0?m:c.kind==="issue"&&u.kind==="issue"?vc(c.issue,u.issue):c.kind==="approval"&&u.kind==="approval"?Xp(u.approval)-Xp(c.approval):c.kind==="approval"?-1:1})}r(DQ,"getInboxWorkItems");var SO=["issue","approval","failed_run","join_request"],RN={issue:"Tasks",approval:"Approvals",failed_run:"Failed runs",join_request:"Join requests"};function NO(e,{agentById:t,currentUserId:i,userLabelById:l}){if(e.assigneeAgentId){const c=t?.get(e.assigneeAgentId)?.trim();return{key:`assignee:agent:${e.assigneeAgentId}`,label:c||e.assigneeAgentId.slice(0,8)}}return e.assigneeUserId?{key:`assignee:user:${e.assigneeUserId}`,label:Ur(e.assigneeUserId,i,l)??"User"}:{key:"assignee:none",label:"Unassigned"}}r(NO,"resolveIssueAssigneeGroup");function CO(e,{projectById:t}){if(!e.projectId)return{key:"project:none",label:"No project"};const i=t?.get(e.projectId)?.name?.trim();return{key:`project:${e.projectId}`,label:i||e.projectId.slice(0,8)}}r(CO,"resolveIssueProjectGroup");function Zp(e,t){const i=new Map;for(const l of e){const c=l.kind==="issue"?t(l.issue):{key:`kind:${l.kind}`,label:RN[l.kind]},u=i.get(c.key);u?(u.items.push(l),u.latestTimestamp=Math.max(u.latestTimestamp,l.timestamp)):i.set(c.key,{label:c.label,items:[l],latestTimestamp:l.timestamp})}return[...i.entries()].map(([l,c])=>({key:l,label:c.label,items:c.items,latestTimestamp:c.latestTimestamp})).sort((l,c)=>{const u=c.latestTimestamp-l.latestTimestamp;return u!==0?u:l.label.localeCompare(c.label)}).map(({key:l,label:c,items:u})=>({key:l,label:c,items:u}))}r(Zp,"groupInboxWorkItemsByIssueGroup");function AO(e,t,i={}){if(t==="none")return[{key:"__all",label:null,items:e}];if(t==="workspace")return Zp(e,u=>jO(u,i));if(t==="assignee")return Zp(e,u=>NO(u,i));if(t==="project")return Zp(e,u=>CO(u,i));const l=new Map;for(const u of e){const m=l.get(u.kind)??[];m.push(u),l.set(u.kind,m)}const c=[];for(const u of SO){const m=l.get(u)??[];m.length!==0&&c.push({key:u,label:RN[u],items:m})}return c}r(AO,"groupInboxWorkItems");function _O(e){return e.replace(/^archived-search:/,"").replace(/^other-search:/,"")}r(_O,"stripInboxSearchGroupPrefix");function EO(e){return e.find(t=>t.kind==="issue")?.issue??null}r(EO,"firstIssueFromInboxWorkItems");function vj(e,t,i){return e?t.projectWorkspaceById?.get(e)?.projectId??(i?.projectWorkspaceId===e?i.projectId:null):i?.projectId??null}r(vj,"projectIdForProjectWorkspace");function MQ(e,t,i,l={}){const c=EO(i);if(!c)return null;const u=_O(e);if(t==="project"){if(!u.startsWith("project:"))return{};const m=u.slice(8);return m&&m!=="none"?{projectId:m}:{}}if(t==="assignee"){if(u.startsWith("assignee:agent:")){const m=u.slice(15);return m?{assigneeAgentId:m}:{}}if(u.startsWith("assignee:user:")){const m=u.slice(14);return m?{assigneeUserId:m}:{}}return{}}if(t==="workspace"){if(u.startsWith("workspace:execution:")){const m=u.slice(20);if(!m)return{};const f=l.executionWorkspaceById?.get(m)??null,h=f?.projectWorkspaceId??(c.executionWorkspaceId===m?c.projectWorkspaceId:null),g=f?.projectId??vj(h,l,c);return{executionWorkspaceId:m,executionWorkspaceMode:"reuse_existing",...g?{projectId:g}:{},...h?{projectWorkspaceId:h}:{}}}if(u.startsWith("workspace:project:")){const m=u.slice(18);if(!m)return{};const f=vj(m,l,c);return{...f?{projectId:f}:{},projectWorkspaceId:m}}}return{}}r(MQ,"buildInboxIssueGroupCreateDefaults");function IO(e){const t=[],i=[];for(const f of e)f.kind==="issue"?t.push(f):i.push(f);const l=new Set(t.map(f=>f.issue.id)),c=new Map,u=new Set;for(const f of t){const{issue:h}=f;if(h.parentId&&l.has(h.parentId)){u.add(h.id);const g=c.get(h.parentId)??[];g.push(h),c.set(h.parentId,g)}}const m=r((f,h=new Set)=>{const g=Hd(f);if(h.has(f.id))return g;const v=new Set(h);v.add(f.id);const y=c.get(f.id)??[];return y.length===0?g:Math.max(g,...y.map(j=>m(j,v)))},"subtreeActivityTimestamp");for(const f of c.values())f.sort((h,g)=>{const v=m(g)-m(h);return v!==0?v:vc(h,g)});return{displayItems:[...t.filter(f=>!u.has(f.issue.id)).map(f=>{const h=c.get(f.issue.id);if(!h?.length)return f;const g=Math.max(...h.map(v=>m(v)));return{...f,timestamp:Math.max(f.timestamp,g)}}),...i].sort((f,h)=>{const g=h.timestamp-f.timestamp;return g!==0?g:f.kind==="issue"&&h.kind==="issue"?vc(f.issue,h.issue):0}),childrenByIssueId:c}}r(IO,"buildInboxNesting");function OQ(e,t,i,l){const c=l?.keyPrefix??"",u=l?.searchSection??"none",m=l?.nestingEnabled??!1;return u!=="none"&&e.length===0?[]:AO(e,t,i).map(f=>{const h=m&&f.items.some(g=>g.kind==="issue")?IO(f.items):{displayItems:f.items,childrenByIssueId:new Map};return{key:`${c}${f.key}`,label:f.label,displayItems:h.displayItems,childrenByIssueId:h.childrenByIssueId,searchSection:u}})}r(OQ,"buildGroupedInboxSections");function TO(e){return e.kind==="issue"?`issue:${e.issue.id}`:e.kind==="approval"?`approval:${e.approval.id}`:e.kind==="failed_run"?`run:${e.run.id}`:`join:${e.joinRequest.id}`}r(TO,"getInboxWorkItemKey");function LQ(e,t,i){const l=[];for(const c of e){const u=t.has(c.key);if(c.label&&l.push({type:"group",groupKey:c.key,label:c.label,collapsed:u}),u)continue;const m=r((f,h)=>{const g=c.childrenByIssueId.get(f);if(!(!g?.length||i.has(f)))for(const v of g){if(h.has(v.id))continue;const y=new Set(h);y.add(v.id),l.push({type:"child",issueId:v.id,issue:v}),m(v.id,y)}},"addIssueChildren");for(const f of c.displayItems)l.push({type:"top",itemKey:`${c.key}:${TO(f)}`,item:f}),f.kind==="issue"&&m(f.issue.id,new Set([f.issue.id]))}return l}r(LQ,"buildInboxKeyboardNavEntries");function zQ({tab:e,hasItems:t,showOnMine:i,showOnRecent:l,showOnUnread:c,showOnAll:u}){return t?e==="mine"?i:e==="recent"?l:e==="unread"?c:u:!1}r(zQ,"shouldShowInboxSection");function RO({approvals:e,joinRequests:t,dashboard:i,failedRuns:l,mineIssues:c,dismissedAlerts:u,dismissedAtByKey:m,currentUserId:f}){const h=e.filter(I=>TN(I,f)&&Fd.has(I.status)&&!hj(m,`approval:${I.id}`,I.updatedAt)).length,g=t.filter(I=>!hj(m,`join:${I.id}`,I.updatedAt??I.createdAt)).length,v=c.filter(I=>I.isUnreadForMe).length,y=i?.agents.error??0,j=i?.costs.monthBudgetCents??0,k=i?.costs.monthUtilizationPercent??0,S=y>0&&l===0&&!u.has("alert:agent-errors"),N=j>0&&k>=80&&!u.has("alert:budget"),_=Number(S)+Number(N);return{inbox:h+g+l+v,approvals:h,failedRuns:l,joinRequests:g,mineIssues:v,alerts:_}}r(RO,"computeInboxBadgeData");var DO="backlog,todo,in_progress,in_review,blocked,done",MO=500,OO=3e4;function LO(){const[e,t]=(0,x.useState)(pj);return(0,x.useEffect)(()=>{const l=r(c=>{c.key==="wardmote:inbox:dismissed"&&t(pj())},"handleStorage");return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]),{dismissed:e,dismiss:r(l=>{t(c=>{const u=new Set(c);return u.add(l),hO(u),u})},"dismiss")}}r(LO,"useDismissedInboxAlerts");function zO(e){const t=wn(),i=e?U.inboxDismissals(e):["inbox-dismissals","__disabled__"],{data:l=[]}=ge({queryKey:i,queryFn:r(()=>Xu.list(e),"queryFn"),enabled:!!e}),c=Kt({mutationFn:r(({itemKey:j})=>Xu.dismiss(e,j),"mutationFn"),onMutate:r(async({itemKey:j})=>{if(!e)return{previous:[]};await t.cancelQueries({queryKey:i});const k=t.getQueryData(i)??[],S=new Date;return t.setQueryData(i,[{id:`optimistic:${j}`,companyId:e,userId:"me",itemKey:j,dismissedAt:S,createdAt:S,updatedAt:S},...k.filter(N=>N.itemKey!==j)]),{previous:k}},"onMutate"),onError:r((j,k,S)=>{S&&t.setQueryData(i,S.previous)},"onError"),onSettled:r(()=>{e&&u()},"onSettled")});function u(){e&&(t.invalidateQueries({queryKey:i}),t.invalidateQueries({queryKey:U.sidebarBadges(e)}),t.invalidateQueries({queryKey:U.attention(e)}))}r(u,"invalidateDismissalConsumers");const m=Kt({mutationFn:r(({itemKey:j,snoozedUntil:k})=>Xu.snooze(e,j,k),"mutationFn"),onSettled:u}),f=Kt({mutationFn:r(({itemKey:j})=>Xu.restore(e,j),"mutationFn"),onSettled:u}),h=(0,x.useMemo)(()=>gO(l),[l]),g=c.mutate,v=m.mutate,y=f.mutate;return{dismissals:l,dismissedAtByKey:h,dismiss:(0,x.useCallback)(j=>g({itemKey:j}),[g]),snooze:(0,x.useCallback)((j,k)=>v({itemKey:j,snoozedUntil:k}),[v]),restore:(0,x.useCallback)(j=>y({itemKey:j}),[y]),isPending:c.isPending||m.isPending||f.isPending}}r(zO,"useInboxDismissals");function PQ(){const[e,t]=(0,x.useState)(gj);return(0,x.useEffect)(()=>{const c=r(u=>{u.key==="wardmote:inbox:read-items"&&t(gj())},"handleStorage");return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[]),{readItems:e,markRead:r(c=>{t(u=>{const m=new Set(u);return m.add(c),xj(m),m})},"markRead"),markUnread:r(c=>{t(u=>{const m=new Set(u);return m.delete(c),xj(m),m})},"markUnread")}}r(PQ,"useReadInboxItems");function I0(e){const t=v3(e),{dismissed:i}=LO(),{dismissedAtByKey:l}=zO(e),{data:c}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),{data:u=[]}=ge({queryKey:U.approvals.list(e),queryFn:r(()=>vN.list(e),"queryFn"),enabled:!!e}),{data:m=[]}=ge({queryKey:U.access.joinRequests(e),queryFn:r(async()=>{try{return await Xa.listJoinRequests(e,"pending_approval")}catch(T){if(T instanceof Si&&(T.status===401||T.status===403))return[];throw T}},"queryFn"),enabled:!!e,retry:!1}),f=U.dashboard(e),h=gc({companyId:e,resourceKey:"dashboard",queryKey:f,enabled:!!e}),{data:g,dataUpdatedAt:v}=ge({queryKey:f,queryFn:r(()=>dO.summary(e),"queryFn"),enabled:!!e});xc(h,g,v);const y=U.issues.listMineByMe(e),j=gc({companyId:e,resourceKey:"inbox-badge:mine-issues",queryKey:y,enabled:!!e}),{data:k=[],dataUpdatedAt:S}=ge({queryKey:y,queryFn:r(()=>hn.listCompact(e,{touchedByUserId:"me",inboxArchivedByUserId:"me",status:DO,limit:MO}).then(T=>T),"queryFn"),enabled:!!e,refetchOnWindowFocus:!1,staleTime:OO});xc(j,k,S);const N=(0,x.useMemo)(()=>kO(y3(e,k)),[e,t,k]),_=c?.user.id??c?.session.userId??null,{data:I}=ge({queryKey:e?U.sidebarBadges(e):["sidebar-badges","__disabled__"],queryFn:r(async()=>{try{return await yN.get(e)}catch(T){if(T instanceof Si&&(T.status===401||T.status===403))return null;throw T}},"queryFn"),enabled:!!e,retry:!1}),D=I?.failedRuns??0;return(0,x.useMemo)(()=>RO({approvals:u,joinRequests:m,dashboard:g,failedRuns:D,mineIssues:N,dismissedAlerts:i,dismissedAtByKey:l,currentUserId:_}),[u,m,g,D,N,i,l,_])}r(I0,"useInboxBadge");var PO=new Set(["detailTab","taskDetailView","contextMenuItem","commentAnnotation","commentContextMenuItem","projectSidebarItem","toolbarButton"]),DN=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),UO=1e3,$O=new Set($_),MN=(0,x.createContext)(null);function BO(e){return e instanceof Error&&e.message?e.message:"Unknown error"}r(BO,"getErrorMessage");function KO(e,t,i){return{companyId:e.companyId??null,companyPrefix:e.companyPrefix??null,projectId:e.projectId??(e.entityType==="project"?e.entityId??null:null),entityId:e.entityId??null,entityType:e.entityType??null,userId:i,renderEnvironment:t}}r(KO,"buildLauncherHostContext");function qO(e){if(!e)return;const t=e.querySelector(DN);if(t){t.focus();return}e.focus()}r(qO,"focusFirstElement");function yj(e,t){if(/^https?:\/\//.test(e)||e.startsWith("/")||e.startsWith("#")||e.startsWith(".")||e.startsWith("?"))return e;const i=t.companyPrefix?.trim();return i?`/${i}/${e}`:e}r(yj,"resolveLauncherNavigationTarget");function FO(e){if(e.action.type!=="navigate"&&e.action.type!=="deepLink"||/^https?:\/\//.test(e.action.target))return null;const[t]=e.action.target.split(/[?#]/,1),i=t?.split("/").filter(Boolean).at(-1);return i?i.toLowerCase():null}r(FO,"launcherRoutePath");function HO(e,t){if(e.placementZone!=="sidebar"||!t)return e.displayName;const i=FO(e);return i?t.slots.find(l=>l.type==="routeSidebar"&&l.routePath?.toLowerCase()===i)?.displayName??e.displayName:e.displayName}r(HO,"launcherDisplayName");function VO(e,t){if(t.key!=="Tab")return;const i=Array.from(e.querySelectorAll(DN)).filter(m=>!m.hasAttribute("disabled")&&m.tabIndex!==-1);if(i.length===0){t.preventDefault(),e.focus();return}const l=i[0],c=i[i.length-1],u=document.activeElement;if(t.shiftKey&&u===l){t.preventDefault(),c.focus();return}!t.shiftKey&&u===c&&(t.preventDefault(),l.focus())}r(VO,"trapFocus");function WO(e){switch(e){case"projectSidebarItem":return"justify-start h-auto px-3 py-1 text-[12px] font-normal text-ink-3 hover:text-ink";case"contextMenuItem":case"commentContextMenuItem":return"justify-start h-7 w-full px-2 text-xs font-normal";case"sidebar":case"sidebarPanel":return"justify-start h-8 w-full";case"toolbarButton":case"globalToolbarButton":return"h-8";default:return"h-8"}}r(WO,"launcherTriggerClassName");function ON(e){switch(e){case"compact":return{width:"min(28rem, calc(100vw - 2rem))"};case"wide":return{width:"min(64rem, calc(100vw - 2rem))"};case"full":return{width:"calc(100vw - 2rem)",height:"calc(100vh - 2rem)"};case"inline":return{width:"min(24rem, calc(100vw - 2rem))"};default:return{width:"min(40rem, calc(100vw - 2rem))"}}}r(ON,"launcherShellBoundsStyle");function QO(e){const t=e.sourceRect,i=ON(e.bounds).width??"min(24rem, calc(100vw - 2rem))";return t?{width:i,maxHeight:"min(70vh, 36rem)",top:Math.min(t.bottom+8,window.innerHeight-32),left:Math.min(Math.max(t.left,16),Math.max(16,window.innerWidth-360))}:{width:i,maxHeight:"min(70vh, 36rem)",top:"4rem",left:"50%",transform:"translateX(-50%)"}}r(QO,"launcherPopoverStyle");function GO(e){return typeof e=="string"&&$O.has(e)}r(GO,"isPluginLauncherBounds");function LN(e){const t=e.enabled??!0,{data:i,isLoading:l,error:c}=ge({queryKey:U.plugins.uiContributions,queryFn:r(()=>h0.listUiContributions(),"queryFn"),enabled:t}),u=(0,x.useMemo)(()=>[...e.placementZones].sort().join("|"),[e.placementZones]),m=(0,x.useMemo)(()=>{const f=new Map;for(const h of i??[])f.set(h.pluginId,h);return f},[i]);return{launchers:(0,x.useMemo)(()=>{const f=new Set(u.split("|").filter(Boolean)),h=[];for(const g of i??[])for(const v of g.launchers)f.has(v.placementZone)&&(PO.has(v.placementZone)&&(!e.entityType||!v.entityTypes?.includes(e.entityType))||h.push({...v,pluginId:g.pluginId,pluginKey:g.pluginKey,pluginDisplayName:g.displayName,pluginVersion:g.version,uiEntryFile:g.uiEntryFile}));return h.sort((g,v)=>{const y=g.order??Number.MAX_SAFE_INTEGER,j=v.order??Number.MAX_SAFE_INTEGER;if(y!==j)return y-j;const k=g.pluginDisplayName.localeCompare(v.pluginDisplayName);return k!==0?k:g.displayName.localeCompare(v.displayName)}),h},[i,e.entityType,u]),contributionsByPluginId:m,isLoading:t&&l,errorMessage:c?BO(c):null}}r(LN,"usePluginLaunchers");async function YO(e,t){const i=t.action.target,l=Oy(t.pluginKey,i);return l||(await L3(e),Oy(t.pluginKey,i))}r(YO,"resolveLauncherComponent");function XO({pluginId:e,hostContext:t,children:i}){const l=(0,x.useMemo)(()=>({pluginId:e,hostContext:t}),[e,t]);return(0,s.jsx)(z3.Provider,{value:l,children:i})}r(XO,"PluginLauncherBridgeScope");var ZO=class extends x.Component{static{r(this,"LauncherErrorBoundary")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?(0,s.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 p-3 text-sm text-bad",children:[this.props.launcher.pluginDisplayName,": failed to render"]}):this.props.children}};function JO({instance:e,renderEnvironment:t}){const i=e.component,{data:l}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),c=l?.user?.id??l?.session?.userId??null,u=(0,x.useMemo)(()=>KO(e.hostContext,t,c),[e.hostContext,t,c]);if(!i)return t.environment==="iframe"?(0,s.jsx)("iframe",{src:`/_plugins/${encodeURIComponent(e.launcher.pluginId)}/ui/${e.launcher.action.target}`,title:`${e.launcher.pluginDisplayName} ${e.launcher.displayName}`,className:"h-full min-h-[24rem] w-full rounded-md border border-line bg-bg"}):(0,s.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 p-3 text-sm text-bad",children:[e.launcher.pluginDisplayName,': could not resolve launcher target "',e.launcher.action.target,'".']});if(i.kind==="web-component")return(0,x.createElement)(i.tagName,{className:"block w-full",pluginLauncher:e.launcher,pluginContext:u});const m=(0,x.createElement)(i.component,{launcher:e.launcher,context:u});return(0,s.jsx)(ZO,{launcher:e.launcher,children:(0,s.jsx)(XO,{pluginId:e.launcher.pluginId,hostContext:u,children:m})})}r(JO,"LauncherRenderContent");function e5({instance:e,stackIndex:t,isTopmost:i,requestBounds:l,closeLauncher:c}){const u=(0,x.useRef)(null),m=(0,x.useId)();(0,x.useEffect)(()=>{if(!i)return;const y=requestAnimationFrame(()=>{qO(u.current)});return()=>cancelAnimationFrame(y)},[i]),(0,x.useEffect)(()=>{if(!i)return;const y=r(j=>{if(u.current){if(j.key==="Escape"){j.preventDefault(),c(e.key,{reason:"escapeKey",nativeEvent:j});return}VO(u.current,j)}},"handleKeyDown");return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c,e.key,i]);const f=(0,x.useMemo)(()=>({environment:e.launcher.render?.environment??"hostOverlay",launcherId:e.launcher.id,bounds:e.bounds,requestModalBounds:r(y=>l(e.key,y),"requestModalBounds"),closeLifecycle:{onBeforeClose:r(y=>(e.beforeCloseHandlers.add(y),()=>e.beforeCloseHandlers.delete(y)),"onBeforeClose"),onClose:r(y=>(e.closeHandlers.add(y),()=>e.closeHandlers.delete(y)),"onClose")}}),[e,l]),h=UO+t*20,g=e.launcher.action.type,v=g==="openPopover"?QO(e):ON(e.bounds);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 bg-black/45",style:{zIndex:h},"aria-hidden":"true",onMouseDown:r(y=>{i&&y.target===y.currentTarget&&c(e.key,{reason:"backdrop",nativeEvent:y})},"onMouseDown")}),(0,s.jsxs)("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":m,tabIndex:-1,className:g==="openDrawer"?"fixed right-0 top-0 h-full max-w-[min(44rem,100vw)] overflow-hidden border-l border-line bg-bg shadow-2xl":g==="openPopover"?"fixed overflow-hidden rounded-xl border border-line bg-bg shadow-2xl":"fixed left-1/2 top-1/2 max-h-[calc(100vh-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border border-line bg-bg shadow-2xl",style:{zIndex:h+1,...g==="openDrawer"?{width:v.width??"min(44rem, 100vw)"}:v},onMouseDown:r(y=>y.stopPropagation(),"onMouseDown"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-line px-4 py-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{id:m,className:"truncate text-sm font-semibold",children:e.launcher.displayName}),(0,s.jsx)("p",{className:"truncate text-xs text-ink-3",children:e.launcher.pluginDisplayName})]}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"sm",className:"ml-auto",onClick:r(()=>{c(e.key,{reason:"programmatic"})},"onClick"),children:"Close"})]}),(0,s.jsx)("div",{className:X("overflow-auto p-4",g==="openDrawer"?"h-[calc(100%-3.5rem)]":"max-h-[calc(100vh-7rem)]"),children:(0,s.jsx)(JO,{instance:e,renderEnvironment:f})})]})]})}r(e5,"LauncherModalShell");function t5({children:e}){const[t,i]=(0,x.useState)([]),l=(0,x.useRef)(t);l.current=t;const c=vn(),u=bs(),m=(0,x.useCallback)(async(v,y)=>{const j=l.current.find(k=>k.key===v);if(j){for(const k of[...j.beforeCloseHandlers])await k(y);i(k=>k.filter(S=>S.key!==v)),queueMicrotask(()=>{for(const k of[...j.closeHandlers])k(y);j.sourceElement&&document.contains(j.sourceElement)&&j.sourceElement.focus()})}},[]);(0,x.useEffect)(()=>{t.length!==0&&Promise.all(t.map(v=>m(v.key,{reason:"hostNavigation"})))},[c.key]);const f=(0,x.useCallback)(async(v,y)=>{GO(y.bounds)&&i(j=>j.map(k=>k.key===v?{...k,bounds:y.bounds}:k))},[]),h=(0,x.useCallback)(async(v,y,j,k)=>{switch(v.action.type){case"navigate":u(yj(v.action.target,y));return;case"deepLink":/^https?:\/\//.test(v.action.target)?window.open(v.action.target,"_blank","noopener,noreferrer"):u(yj(v.action.target,y));return;case"performAction":await h0.bridgePerformAction(v.pluginId,v.action.target,v.action.params,y.companyId??null);return;case"openModal":case"openDrawer":case"openPopover":{const S=await YO(j,v),N=k?.getBoundingClientRect()??null,_={key:`${v.pluginId}:${v.id}:${Date.now()}:${Math.random().toString(36).slice(2,8)}`,launcher:v,hostContext:y,contribution:j,component:S,sourceElement:k??null,sourceRect:N,bounds:v.render?.bounds??"default",beforeCloseHandlers:new Set,closeHandlers:new Set};i(I=>[...I,_]);return}}},[u]),g=(0,x.useMemo)(()=>({activateLauncher:h}),[h]);return(0,s.jsxs)(MN.Provider,{value:g,children:[e,t.map((v,y)=>(0,s.jsx)(e5,{instance:v,stackIndex:y,isTopmost:y===t.length-1,requestBounds:f,closeLauncher:m},v.key))]})}r(t5,"PluginLauncherProvider");function n5(){const e=(0,x.useContext)(MN);if(!e)throw new Error("usePluginLauncherRuntime must be used within PluginLauncherProvider");return e}r(n5,"usePluginLauncherRuntime");function s5({displayName:e,launcher:t,placementZone:i,onClick:l}){return(0,s.jsx)(le,{type:"button",variant:i==="toolbarButton"||i==="globalToolbarButton"?"secondary":"ghost",size:"sm",className:WO(i),onClick:l,children:e??t.displayName})}r(s5,"DefaultLauncherTrigger");function zN({placementZones:e,context:t,entityType:i,className:l,itemClassName:c,errorClassName:u,errorBehavior:m="inline"}){const{activateLauncher:f}=n5(),{launchers:h,contributionsByPluginId:g,errorMessage:v}=LN({placementZones:e,entityType:i,companyId:t.companyId,enabled:!!t.companyId});return v&&m==="inline"?(0,s.jsxs)("div",{className:X("rounded-md border border-bad/30 bg-bad/5 px-2 py-1 text-xs text-bad",u),children:["Plugin launchers unavailable: ",v]}):h.length===0?null:(0,s.jsx)("div",{className:l,children:h.map(y=>(0,s.jsx)("div",{className:c,children:(0,s.jsx)(s5,{displayName:HO(y,g.get(y.pluginId)),launcher:y,placementZone:y.placementZone,onClick:r(j=>{const k=g.get(y.pluginId);k&&f(y,t,k,j.currentTarget)},"onClick")})},`${y.pluginKey}:${y.id}`))})}r(zN,"PluginLauncherOutlet");function a5(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return(0,x.useMemo)(()=>l=>{t.forEach(c=>c(l))},t)}r(a5,"useCombinedRefs");var _f=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function to(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}r(to,"isWindow");function T0(e){return"nodeType"in e}r(T0,"isNode");function Es(e){var t,i;return e?to(e)?e:T0(e)&&(t=(i=e.ownerDocument)==null?void 0:i.defaultView)!=null?t:window:window}r(Es,"getWindow");function R0(e){const{Document:t}=Es(e);return e instanceof t}r(R0,"isDocument");function Oc(e){return to(e)?!1:e instanceof Es(e).HTMLElement}r(Oc,"isHTMLElement");function PN(e){return e instanceof Es(e).SVGElement}r(PN,"isSVGElement");function no(e){return e?to(e)?e.document:T0(e)?R0(e)?e:Oc(e)||PN(e)?e.ownerDocument:document:document:document}r(no,"getOwnerDocument");var Ma=_f?x.useLayoutEffect:x.useEffect;function Ef(e){const t=(0,x.useRef)(e);return Ma(()=>{t.current=e}),(0,x.useCallback)(function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return t.current==null?void 0:t.current(...l)},[])}r(Ef,"useEvent");function i5(){const e=(0,x.useRef)(null);return[(0,x.useCallback)((t,i)=>{e.current=setInterval(t,i)},[]),(0,x.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}r(i5,"useInterval");function yc(e,t){t===void 0&&(t=[e]);const i=(0,x.useRef)(e);return Ma(()=>{i.current!==e&&(i.current=e)},t),i}r(yc,"useLatestValue");function Lc(e,t){const i=(0,x.useRef)();return(0,x.useMemo)(()=>{const l=e(i.current);return i.current=l,l},[...t])}r(Lc,"useLazyMemo");function Vd(e){const t=Ef(e),i=(0,x.useRef)(null);return[i,(0,x.useCallback)(l=>{l!==i.current&&t?.(l,i.current),i.current=l},[])]}r(Vd,"useNodeRef");function Wd(e){const t=(0,x.useRef)();return(0,x.useEffect)(()=>{t.current=e},[e]),t.current}r(Wd,"usePrevious");var Jp={};function zc(e,t){return(0,x.useMemo)(()=>{if(t)return t;const i=Jp[e]==null?0:Jp[e]+1;return Jp[e]=i,e+"-"+i},[e,t])}r(zc,"useUniqueId");function UN(e){return function(t){for(var i=arguments.length,l=new Array(i>1?i-1:0),c=1;c<i;c++)l[c-1]=arguments[c];return l.reduce((u,m)=>{const f=Object.entries(m);for(const[h,g]of f){const v=u[h];v!=null&&(u[h]=v+e*g)}return u},{...t})}}r(UN,"createAdjustmentFn");var Hl=UN(1),jc=UN(-1);function r5(e){return"clientX"in e&&"clientY"in e}r(r5,"hasViewportRelativeCoordinates");function If(e){if(!e)return!1;const{KeyboardEvent:t}=Es(e.target);return t&&e instanceof t}r(If,"isKeyboardEvent");function l5(e){if(!e)return!1;const{TouchEvent:t}=Es(e.target);return t&&e instanceof t}r(l5,"isTouchEvent");function Qd(e){if(l5(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:i}=e.touches[0];return{x:t,y:i}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:i}=e.changedTouches[0];return{x:t,y:i}}}return r5(e)?{x:e.clientX,y:e.clientY}:null}r(Qd,"getEventCoordinates");var Za=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:i}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(i?Math.round(i):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:i}=e;return"scaleX("+t+") scaleY("+i+")"}},Transform:{toString(e){if(e)return[Za.Translate.toString(e),Za.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:i,easing:l}=e;return t+" "+i+"ms "+l}}}),jj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function o5(e){return e.matches(jj)?e:e.querySelector(jj)}r(o5,"findFirstFocusableNode");var c5={display:"none"};function u5(e){let{id:t,value:i}=e;return x.createElement("div",{id:t,style:c5},i)}r(u5,"HiddenText");function d5(e){let{id:t,announcement:i,ariaLiveType:l="assertive"}=e;return x.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":l,"aria-atomic":!0},i)}r(d5,"LiveRegion");function f5(){const[e,t]=(0,x.useState)("");return{announce:(0,x.useCallback)(i=>{i!=null&&t(i)},[]),announcement:e}}r(f5,"useAnnouncement$1");var $N=(0,x.createContext)(null);function m5(e){const t=(0,x.useContext)($N);(0,x.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}r(m5,"useDndMonitor");function p5(){const[e]=(0,x.useState)(()=>new Set),t=(0,x.useCallback)(i=>(e.add(i),()=>e.delete(i)),[e]);return[(0,x.useCallback)(i=>{let{type:l,event:c}=i;e.forEach(u=>{var m;return(m=u[l])==null?void 0:m.call(u,c)})},[e]),t]}r(p5,"useDndMonitorProvider");var h5={draggable:`
@@ -51,11 +51,11 @@ ${W_}
51
51
  `}r(iU,"buildAgentOnboardingPrompt");function rU(e){const t=(e.connectionCandidates??[]).map(u=>u.trim()).filter(Boolean),i=new Set;let l=null;try{l=new URL(e.onboardingTextUrl),i.add(l.toString())}catch{const u=e.onboardingTextUrl.trim();u&&i.add(u)}if(!l){for(const u of t)i.add(u);return Array.from(i)}const c=`${l.pathname}${l.search}`;for(const u of t)try{const m=new URL(u);i.add(`${m.origin}${c}`)}catch{i.add(u)}return Array.from(i)}r(rU,"buildCandidateOnboardingUrls");function lU(e){const t=e.testResolutionUrl?.trim();if(t)return t;try{const i=new URL(e.onboardingTextUrl),l=i.pathname.replace(/\/onboarding\.txt$/,"/test-resolution");return`${i.origin}${l}`}catch{return null}}r(lU,"buildResolutionTestUrl");function oU({children:e,className:t,...i}){const[l,c]=(0,x.useState)(null),u=(0,x.useRef)(null),m=k0();return(0,x.useLayoutEffect)(()=>{const f=l,h=u.current;if(!f||!h||typeof ResizeObserver>"u")return;let g,v;const y=new ResizeObserver(()=>{const j=getComputedStyle(f),k=h.getBoundingClientRect().height+parseFloat(j.borderTopWidth)+parseFloat(j.borderBottomWidth);if(k===g)return;const S=v?.playState==="running"?f.getBoundingClientRect().height:g;if(v?.cancel(),g=k,S===void 0||m||typeof f.animate!="function")return;const N=lT("--motion-ease-out-expo");v=f.animate([{height:`${S}px`},{height:`${k}px`}],{duration:oT("--onboarding-motion-step"),easing:Array.isArray(N)?`cubic-bezier(${N.join(",")})`:N})});return y.observe(h),()=>{y.disconnect(),v?.cancel()}},[l,m]),(0,s.jsx)(za,{...i,ref:c,className:X("overflow-hidden p-0",t),children:(0,s.jsx)("div",{ref:u,className:"flex max-h-(--sz-calc-18) shrink-0 flex-col",children:e})})}r(oU,"AnimatedDialogContent");var FC=[{id:"dot",name:"Dot",adapter:"openai_dot",description:"Your Dot in ChatGPT"},{id:"other",name:"Other",adapter:"http",description:"Any agent that can connect to Wardmote"}];function cU({onSelect:e,dotDisabledReason:t}){return(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:FC.map(i=>(0,s.jsxs)("button",{type:"button",onClick:r(()=>e(i.id),"onClick"),disabled:i.id==="dot"&&!!t,title:i.id==="dot"?t:void 0,className:"flex aspect-square flex-col items-center justify-center gap-3 rounded-lg border border-line bg-bg-2 px-3 py-4 text-center transition-colors disabled:opacity-50 hover:bg-bg-3/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,s.jsx)(Bk,{type:i.adapter,className:"size-8"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:i.name}),(0,s.jsx)("span",{className:"sr-only",children:i.description})]},i.id))})}r(cU,"ExternalAgentPresetPicker");var uU=[{title:"Connected to Wardmote",description:"Your Dot has connected to this agent."},{title:"Task updates enabled",description:"Your Dot is subscribed to new assignments and messages."},{title:"Test event confirmed",description:"Your Dot received our test and replied to Wardmote."}];function dU({state:e}){const t={waiting:0,connected:1,subscribed:2,testing:2,finishing:3,ready:3}[e.phase],i=e.problem==="agent_unavailable"?"Connection checks passed, but this agent cannot receive tasks. Resolve the agent’s setup blocker in Wardmote.":e.problem==="offline"?"Connection updates paused. Reconnect to check the latest status.":e.problem==="prompt_unavailable"?"This setup prompt was replaced in another window. Create a fresh prompt to continue.":e.problem==="event_timeout"?"Your Dot connected, but hasn’t confirmed the test event. Ask it to check Wardmote, then retry.":e.phase==="finishing"?"Your Dot confirmed the test event. Wardmote is finishing agent setup.":e.phase==="ready"?"Your Dot is ready for tasks. Messages can travel both ways.":e.phase==="waiting"?"Watching for your Dot. Updates will appear here automatically.":e.phase==="connected"?"Your Dot connected. Waiting for it to enable task updates.":"Waiting for your Dot to confirm a test event. No task will be created.";return(0,s.jsxs)("section",{"aria-label":"Dot connection checks",className:"space-y-4",children:[(0,s.jsx)("ol",{className:"space-y-4",children:uU.map((l,c)=>{const u=c<t,m=c===t&&e.problem==="event_timeout",f=c===t&&!e.problem,h=u?Ta:m?hS:f?As:lI;return(0,s.jsxs)("li",{className:"flex items-start gap-3","aria-current":f?"step":void 0,children:[(0,s.jsx)("span",{className:X("flex size-6 shrink-0 items-center justify-center rounded-full",u?"bg-bg-3 text-ink":m?"text-bad":"text-ink-3"),children:(0,s.jsx)(h,{className:X("size-4",f&&"animate-spin motion-reduce:animate-none")})}),(0,s.jsxs)("div",{className:"min-w-0 pt-0.5",children:[(0,s.jsxs)("p",{className:X("text-sm",u||f||m?"font-medium":"text-ink-3"),children:[l.title,(0,s.jsx)("span",{className:"sr-only",children:u?": complete":m?": needs attention":f?": in progress":": waiting"})]}),u&&(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-ink-3",children:l.description})]})]},l.title)})}),(0,s.jsx)("p",{role:e.problem&&e.problem!=="prompt_unavailable"?"alert":"status","aria-live":"polite",className:X("text-sm leading-relaxed",e.problem&&e.problem!=="prompt_unavailable"?"text-bad":"text-ink-3"),children:i})]})}r(dU,"DotConnectionChecks");function fU({preset:e,prompt:t,companyName:i,connection:l,onSelect:c,onBack:u,onClose:m,onCopied:f,onRetry:h,onNewPrompt:g,dotDisabledReason:v,busy:y=!1,error:j,approvalHref:k}){const S=FC.find(T=>T.id===e),N=e==="dot",_=N&&l.phase==="ready"&&!l.problem,I=N&&l.phase!=="waiting",D=l.problem==="agent_unavailable"?"Agent unavailable":l.problem==="offline"?"Updates paused":l.problem==="event_timeout"?"Needs attention":l.phase==="finishing"?"Finishing setup…":l.phase==="connected"?"Connecting…":"Confirming connection…";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"min-h-0 space-y-6 overflow-y-auto px-6 pb-6 pt-8 sm:px-8",children:[(0,s.jsxs)("div",{className:"space-y-3 pr-5",children:[S&&(0,s.jsx)(Bk,{type:S.adapter,className:"size-10"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(Da,{className:"text-xl font-semibold tracking-tight",children:S?N?_?"Your Dot is connected":"Connect your Dot":"Invite your agent":"Invite an external agent"}),(0,s.jsx)(eo,{className:"text-sm leading-relaxed",children:S?_?`Your Dot can now receive assignments and work with ${i}.`:l.problem==="agent_unavailable"?"Your Dot is connected. This agent must be available in Wardmote before it can receive assignments.":l.phase==="finishing"?"Your Dot has connected and confirmed task updates. Wardmote is preparing it for assignments.":I?"Your Dot has connected. We’re checking that task updates can travel both ways.":N?"Copy the setup prompt and send it to your Dot in ChatGPT. Your Dot will connect itself; we’ll watch for it here.":"Copy the invitation prompt and send it to your agent. Approve its join request in Wardmote when it’s ready.":`Bring an agent you already use into ${i}.`})]})]}),j&&(0,s.jsxs)("div",{role:"alert",className:"space-y-3 text-sm text-bad",children:[(0,s.jsx)("p",{children:j}),(0,s.jsx)(le,{variant:"secondary",disabled:y,onClick:h,children:"Try again"})]}),S?k?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"An organization admin needs to approve this agent before Dot can connect. This page will update after approval."}):y&&!t&&l.phase==="waiting"?(0,s.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Preparing your invitation…"}):N?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"border-t pt-6",children:[(0,s.jsx)(dU,{state:l}),l.phase==="waiting"&&(0,s.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Dot uses your OpenAI account. Provider usage and cost aren’t reported to Wardmote."})]}),l.problem==="event_timeout"&&(0,s.jsx)(le,{variant:"secondary",disabled:y,onClick:h,children:"Retry test event"}),l.problem==="offline"&&(0,s.jsx)(le,{variant:"secondary",disabled:y,onClick:h,children:"Reconnect updates"})]}):(0,s.jsxs)("p",{className:"text-sm leading-relaxed text-ink-3",children:["The invitation includes everything your agent needs to join ",i,". You can review its request before granting access."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(cU,{onSelect:c,dotDisabledReason:v}),v&&(0,s.jsx)("p",{className:"text-sm text-ink-3",children:v})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t px-6 py-4 sm:px-8",children:[(0,s.jsxs)(le,{variant:"ghost",onClick:S?u:m,children:[S&&(0,s.jsx)(o0,{className:"size-4"}),S?"Back":"Cancel"]}),S&&(k?(0,s.jsx)(le,{asChild:!0,children:(0,s.jsx)(gn,{to:k,onClick:m,children:"Review approval"})}):_?(0,s.jsx)(le,{onClick:m,children:"Done"}):I?(0,s.jsxs)(le,{disabled:!0,"aria-live":"polite",children:[!l.problem&&(0,s.jsx)(As,{className:"size-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),D]}):N&&l.problem==="prompt_unavailable"?(0,s.jsx)(le,{disabled:y,onClick:g,children:"Create a new prompt"}):!t||y?(0,s.jsx)(le,{disabled:!0,children:y?"Preparing…":"Waiting for Dot…"}):(0,s.jsx)(cT,{prompt:t,label:N?"Copy setup prompt":"Copy invitation prompt",title:N?"Connect your Dot":"Invite your agent",description:N?"Send this whole prompt to your Dot in ChatGPT.":"Send this whole prompt to your agent.",agent:N?{name:"Dot",src:"/brands/adapters/openai-dot.svg"}:void 0,align:"end",className:"min-w-0 shrink",onCopied:f},e))]})]})}r(fU,"ExternalAgentInviteContent");function mU({companyId:e,onClose:t,onBack:i}){const l=wn(),{selectedCompany:c}=vt(),[u,m]=(0,x.useState)(null),[f,h]=(0,x.useState)(null),[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),[k,S]=(0,x.useState)(""),N=(0,x.useRef)(!1),_=ge({queryKey:U.instance.experimentalSettings,queryFn:fs.getExperimental}),I=_.isPending?"Loading available agents…":_.error?"Unable to load feature settings. Try again after refreshing.":!_.data?.enableOpenAiDot||!_.data.enablePublicMcp?"Turn on OpenAI Dot and Assistant connections in Settings > Features.":void 0,D=["dot-binding",e,f?.agent.id],T=ge({queryKey:D,queryFn:r(({signal:ue})=>ad.connection(e,f.agent.id,ue),"queryFn"),enabled:u==="dot"&&!!f,retry:!1,staleTime:0,refetchInterval:r(ue=>ue.state.error||ue.state.data?.agentLifecycleState==="ready"&&ue.state.data.canConfigureConnection&&ue.state.data.binding?.status==="ready"&&ue.state.data.binding.subscriptionVerified?!1:2500,"refetchInterval")}),C=Kt({mutationFn:r(async ue=>{if(ue==="dot"){const Ae=await ad.create(e);h(Ae),await l.invalidateQueries({queryKey:U.agents.list(e)});return}const ae=await Xa.createCompanyInvite(e,{allowedJoinTypes:"agent",humanRole:null,agentMessage:null});l.invalidateQueries({queryKey:U.access.invites(e,"all",5)});const Ee=ae.onboardingTextUrl??ae.onboardingTextPath??`/api/invites/${ae.token}/onboarding.txt`,fe=await Xa.getInviteOnboarding(ae.token).catch(()=>null);S(iU({onboardingTextUrl:new URL(Ee,window.location.origin).href,connectionCandidates:fe?.onboarding.connectivity?.connectionCandidates??null,testResolutionUrl:fe?.onboarding.connectivity?.testResolutionEndpoint?.url??null}))},"mutationFn"),gcTime:0}),M=Kt({mutationFn:r(async ue=>{const ae=await ad.pair(e,f.agent.id,ue);v(ae),j(null)},"mutationFn"),onSuccess:r(()=>{l.invalidateQueries({queryKey:D})},"onSuccess"),onError:r(()=>{T.refetch()},"onError"),gcTime:0}),z=Kt({mutationFn:r(()=>ad.retry(e,f.agent.id,T.data.binding.id),"mutationFn"),onSuccess:r(()=>{l.invalidateQueries({queryKey:D})},"onSuccess")}),K=T.data?.binding,P=u==="dot"&&T.data?.enabled&&!!T.data.resourceUrl&&T.data.canConfigureConnection&&(!K||K.status==="pairing")&&!g&&!T.error&&!M.isError&&!N.current&&(!y||K?.id===y);(0,x.useEffect)(()=>{P&&T.isFetchedAfterMount&&!T.isFetching&&!M.isPending&&(N.current=!0,M.mutate(K?.id))},[P,T.isFetchedAfterMount,T.isFetching,M.isPending,M.mutate,K?.id]),(0,x.useEffect)(()=>{if(!g)return;const ue=window.setTimeout(()=>{N.current=!1,j(g.bindingId),v(null)},Math.max(0,Date.parse(g.expiresAt)-Date.now()));return()=>window.clearTimeout(ue)},[g]);const A=K?.status==="ready"&&K.subscriptionVerified,B=T.data?.agentLifecycleState==="ready"&&T.data.canConfigureConnection,O=["preparing","verifying"].includes(T.data?.agentLifecycleState??"")&&T.data?.canConfigureConnection,W={phase:A?B?"ready":O?"finishing":"ready":K?.hasPendingChallenge?"testing":K?.subscriptionVerified?"subscribed":K?.connected?"connected":"waiting",problem:T.error?"offline":A&&!B&&!O?"agent_unavailable":K?.status==="pairing"&&!P&&!M.isPending&&!T.isFetching&&!M.isError&&g?.bindingId!==K.id?"prompt_unavailable":K?.challengeExpiresAt&&!K.hasPendingChallenge&&K.status!=="ready"?"event_timeout":void 0},Y=(T.data?.agentStatus??f?.agent.status)==="pending_approval",ce=T.data&&!T.data.canConfigureConnection&&!Y,oe=u==="dot"?g&&g.bindingId===K?.id&&T.data?.resourceUrl&&f?hE({companyId:e,agentId:f.agent.id,resourceUrl:T.data.resourceUrl,...g}):"":k,$=(C.variables===u?C.error:null)??(u==="dot"?(K?.connected?null:M.error)??z.error:null),R=C.isPending||M.isPending||z.isPending||P||u==="dot"&&!!f&&(T.isPending||!oe&&T.isFetching),ne=r(()=>{if(ce){T.refetch();return}if(T.error){T.refetch();return}if(C.error||!f){u&&C.mutate(u);return}if(M.error&&!K?.connected){M.mutate(K?.status==="pairing"?K.id:void 0);return}z.mutate()},"retry");return(0,s.jsx)(ya,{open:!0,onOpenChange:r(ue=>{ue||t()},"onOpenChange"),children:(0,s.jsx)(oU,{className:"sm:max-w-(--sz-560px)",children:(0,s.jsx)(fU,{preset:u,prompt:oe,companyName:c?.name??"your organization",connection:W,dotDisabledReason:I,busy:R,error:$?.message??(ce?T.data?.agentLifecycleState==="terminated"?"This agent was terminated. Invite another agent to connect Dot.":"Resume this agent before connecting Dot.":void 0),approvalHref:Y&&f?.approvalId?`/approvals/${f.approvalId}`:void 0,onSelect:r(ue=>{m(ue),(ue==="dot"?!f:!k)&&C.mutate(ue)},"onSelect"),onBack:r(()=>m(null),"onBack"),onClose:u?t:i,onCopied:r(()=>{u==="dot"&&T.refetch()},"onCopied"),onRetry:ne,onNewPrompt:r(()=>M.mutate(K?.id),"onNewPrompt")})})})}r(mU,"ExternalAgentInviteDialog");function pU(){const{newAgentOpen:e,closeNewAgent:t}=Mc(),{selectedCompanyId:i}=vt();return e?(0,s.jsx)(hU,{companyId:i,onClose:t},i):null}r(pU,"NewAgentDialog");function hU({companyId:e,onClose:t}){const i=bs(),[l,c]=(0,x.useState)(!1);return l&&e?(0,s.jsx)(mU,{companyId:e,onClose:t,onBack:r(()=>c(!1),"onBack")}):(0,s.jsx)(mE,{open:!0,onClose:t,onInvite:e?()=>c(!0):void 0,onContinue:r(u=>{t(),i(`/agents/new?${xE(u)}`)},"onContinue")})}r(hU,"NewAgentDialogContent");var gU=[{title:"Inbox",shortcuts:[{keys:["j"],label:"Move down"},{keys:["↓"],label:"Move down"},{keys:["k"],label:"Move up"},{keys:["↑"],label:"Move up"},{keys:["←"],label:"Collapse selected group"},{keys:["→"],label:"Expand selected group"},{keys:["Enter"],label:"Open selected item"},{keys:["a"],label:"Archive item"},{keys:["y"],label:"Archive item"},{keys:["r"],label:"Mark as read"},{keys:["U"],label:"Mark as unread"}]},{title:"Task detail",shortcuts:[{keys:["y"],label:"Quick-archive back to inbox"},{keys:["g","i"],label:"Go to inbox"},{keys:["g","c"],label:"Focus comment composer"}]},{title:"Decisions",shortcuts:[{keys:["j"],label:"Move down"},{keys:["↓"],label:"Move down"},{keys:["k"],label:"Move up"},{keys:["↑"],label:"Move up"},{keys:["Enter"],label:"Open or close selected decision"},{keys:["x"],label:"Dismiss selected decision"}]},{title:"Global",shortcuts:[{keys:["/"],label:"Search current page or quick search"},{keys:["c"],label:"New task"},{keys:["["],label:"Toggle sidebar"},{keys:["]"],label:"Toggle panel"},{keys:["?"],label:"Show keyboard shortcuts"}]}];function ow({children:e}){return(0,s.jsx)("kbd",{className:"inline-flex h-6 min-w-6 items-center justify-center rounded border border-line bg-bg-3 px-1.5 font-mono text-xs font-medium text-ink shadow-(--shadow-extract-10)",children:e})}r(ow,"KeyCap");function xU(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"divide-y divide-line border-t border-line",children:gU.map(e=>(0,s.jsxs)("div",{className:"px-5 py-3",children:[(0,s.jsx)("h3",{className:"mb-2 text-(length:--text-micro) font-semibold uppercase tracking-wider text-ink-3",children:e.title}),(0,s.jsx)("div",{className:"space-y-1.5",children:e.shortcuts.map(t=>(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"text-sm text-ink/90",children:t.label}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:t.keys.map((i,l)=>(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[l>0&&(0,s.jsx)("span",{className:"text-xs text-ink-3",children:t.combo?"+":"then"}),(0,s.jsx)(ow,{children:i})]},i))})]},t.label+t.keys.join()))})]},e.title))}),(0,s.jsx)("div",{className:"border-t border-line px-5 py-3",children:(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Press ",(0,s.jsx)(ow,{children:"Esc"})," to close · Shortcuts are disabled in text fields"]})})]})}r(xU,"KeyboardShortcutsCheatsheetContent");function bU({open:e,onOpenChange:t}){return(0,s.jsx)(ya,{open:e,onOpenChange:t,children:(0,s.jsxs)(za,{className:"sm:max-w-md gap-0 p-0 overflow-hidden",showCloseButton:!1,children:[(0,s.jsx)(Jl,{className:"px-5 pt-5 pb-3",children:(0,s.jsx)(Da,{className:"text-base",children:"Keyboard shortcuts"})}),(0,s.jsx)(xU,{})]})})}r(bU,"KeyboardShortcutsCheatsheet");var vU={info:"border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-500/25 dark:bg-sky-950/60 dark:text-sky-100",success:"border-emerald-300 bg-emerald-50 text-emerald-900 dark:border-emerald-500/25 dark:bg-emerald-950/60 dark:text-emerald-100",warn:"border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-500/25 dark:bg-amber-950/60 dark:text-amber-100",error:"border-red-300 bg-red-50 text-red-900 dark:border-red-500/30 dark:bg-red-950/60 dark:text-red-100"},yU={info:"bg-sky-500 dark:bg-sky-400",success:"bg-emerald-500 dark:bg-emerald-400",warn:"bg-amber-500 dark:bg-amber-400",error:"bg-red-500 dark:bg-red-400"};function jU({toast:e,onDismiss:t}){const[i,l]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{const c=requestAnimationFrame(()=>l(!0));return()=>cancelAnimationFrame(c)},[]),(0,s.jsx)("li",{className:X("pointer-events-auto rounded-sm border shadow-lg backdrop-blur-xl transition-(--tp-transform-opacity) duration-200 ease-out",i?"translate-y-0 opacity-100":"translate-y-3 opacity-0",vU[e.tone]),children:(0,s.jsxs)("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[e.actor?.type==="agent"?(0,s.jsx)(ir,{agent:{id:e.actor.id,name:e.actor.name,appearance:e.actor.appearance},size:24}):e.actor?.type==="user"?(0,s.jsxs)(Od,{size:"sm","aria-hidden":"true",children:[e.actor.image&&(0,s.jsx)(Dd,{src:e.actor.image,alt:""}),(0,s.jsx)(Md,{children:d3(e.actor.name)})]}):(0,s.jsx)("span",{className:X("mt-1 h-2 w-2 shrink-0 rounded-full",yU[e.tone])}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-semibold leading-5",children:e.title}),e.body&&(0,s.jsx)("p",{className:"mt-1 text-xs leading-4 opacity-70",children:e.body}),e.action&&(e.action.onClick?(0,s.jsx)("button",{type:"button",onClick:r(()=>{e.action?.onClick?.(),t(e.id)},"onClick"),className:"mt-2 inline-flex text-xs font-medium underline underline-offset-4 hover:opacity-90",children:e.action.label}):e.action.href?(0,s.jsx)(gn,{to:e.action.href,onClick:r(()=>t(e.id),"onClick"),className:"mt-2 inline-flex text-xs font-medium underline underline-offset-4 hover:opacity-90",children:e.action.label}):null)]}),(0,s.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:r(()=>t(e.id),"onClick"),className:"mt-0.5 shrink-0 rounded p-1 opacity-50 hover:bg-black/10 hover:opacity-100 dark:hover:bg-white/10",children:(0,s.jsx)(is,{className:"h-3.5 w-3.5"})})]})})}r(jU,"AnimatedToast");function wU(){const e=f3(),{dismissToast:t}=Ni();return e.length===0?null:(0,s.jsx)("aside",{"aria-live":"polite","aria-atomic":"false",className:"pointer-events-none fixed bottom-3 left-3 z-(--z-120) w-full max-w-sm px-1",children:(0,s.jsx)("ol",{className:"flex w-full flex-col-reverse gap-2",children:e.map(i=>(0,s.jsx)(jU,{toast:i,onDismiss:t},i.id))})})}r(wU,"ToastViewport");async function cw(e,t){const i=await fetch(`/api/announcements/${e}`,{credentials:"same-origin",cache:"no-store",...t});if(!i.ok)throw new Si("Announcement request failed",i.status,null);return i}r(cw,"request");var uw={async current(e){const t=await(await cw("current",{signal:e})).json();return t===null?null:U_.parse(t)},async dismiss(e,t,i){await cw(`${encodeURIComponent(e)}/dismiss`,{method:"POST",signal:i,headers:{"Content-Type":"application/json"},body:JSON.stringify({companyId:t})})}},hg=new Map;function G0(e){return`wardmote.announcement-dismissals.v1:${encodeURIComponent(e)}:`}r(G0,"announcementStoragePrefix");function id(e){const t=G0(e),i=new Map;try{for(let l=0;l<localStorage.length;l++){const c=localStorage.key(l);if(!c?.startsWith(t))continue;const u=c.slice(t.length),m=localStorage.getItem(c);Ok.safeParse(u).success&&(m==="pending"||m==="synced")&&hg.set(c,m==="pending")}}catch{}for(const[l,c]of hg)l.startsWith(t)&&i.set(l.slice(t.length),c);return i}r(id,"readAnnouncementDismissals");function ch(e,t,i){const l=`${G0(e)}${t}`;hg.set(l,i);try{return localStorage.setItem(l,i?"pending":"synced"),!0}catch{return!1}}r(ch,"saveAnnouncementDismissal");var kU=3e3;function SU(e){const{userId:t,enabled:i}=e,l=(0,x.useRef)(e);l.current=e;const[c,u]=(0,x.useState)(null),m=(0,x.useRef)(()=>{});(0,x.useEffect)(()=>{if(u(null),!t||!i)return;let h=!1,g=0,v=null,y;const j=new Map,k=new Set,S=G0(t);let N=null;try{N=new BroadcastChannel(S)}catch{}const _=r(()=>!h&&l.current.userId===t&&l.current.enabled,"active");async function I(A,B=!0){if(!_()||j.has(A)||!l.current.companyId)return;const O=new AbortController;j.set(A,O);const W=setTimeout(()=>O.abort(),1e4);try{await uw.dismiss(A,l.current.companyId,O.signal),_()&&ch(t,A,!1)}catch{_()&&!k.has(A)&&(k.add(A),l.current.onSaveFailure(B))}finally{clearTimeout(W),j.delete(A)}}r(I,"sync");async function D(){for(const[A,B]of id(t)){if(!_())return;B&&await I(A)}}r(D,"flush");function T(){g++,clearTimeout(y),v?.abort(),v=null,u(null)}r(T,"suspend");function C(){if(!_()||document.visibilityState==="hidden")return;T();const A=g,B=new AbortController;v=B;const O=r(()=>_()&&g===A&&!B.signal.aborted,"stillCurrent");let W=!1,Y=!1,ce=null;const oe=r(()=>{!O()||!W||!Y||ce&&!id(t).has(ce.id)&&(!ce.expiresAt||Date.parse(ce.expiresAt)>Date.now())&&u({userId:t,announcement:ce})},"show");y=setTimeout(()=>{W=!0,oe()},kU),D(),uw.current(B.signal).then($=>{ce=$,Y=!0,oe()}).catch(()=>{})}r(C,"resume");function M(){const A=id(t);u(B=>B?.userId===t&&A.has(B.announcement.id)?null:B)}r(M,"receive");function z(A){A.key?.startsWith(S)&&M()}r(z,"onStorage");function K(){document.visibilityState==="hidden"?T():C()}r(K,"onVisibility");function P(){D()}return r(P,"onOnline"),N&&(N.onmessage=A=>{const B=Ok.safeParse(A.data);B.success&&(id(t).has(B.data)||ch(t,B.data,!0),M())}),m.current=A=>{if(!_())return;const B=ch(t,A,!0);u(null),g++,v?.abort();try{N?.postMessage(A)}catch{}I(A,B)},document.addEventListener("visibilitychange",K),window.addEventListener("online",P),window.addEventListener("storage",z),C(),()=>{h=!0,g++,clearTimeout(y),v?.abort();for(const A of j.values())A.abort();N?.close(),document.removeEventListener("visibilitychange",K),window.removeEventListener("online",P),window.removeEventListener("storage",z),m.current=()=>{}}},[t,i]);const f=i&&c?.userId===t?c.announcement:null;return(0,x.useEffect)(()=>{if(!f?.expiresAt)return;let h;const g=r(()=>{const v=Date.parse(f.expiresAt)-Date.now();v<=0?u(null):h=setTimeout(g,Math.min(v,2147483647))},"check");return g(),()=>clearTimeout(h)},[f]),{announcement:f,dismiss:(0,x.useCallback)(h=>m.current(h),[])}}r(SU,"useAnnouncement");function NU(e,t){const i=k0(),l=t??`/api/announcements/${encodeURIComponent(e.id)}/animation`,c=`${l}:${e.animation?.path??""}`,[u,m]=(0,x.useState)(null),f=!!e.animation&&!i;return(0,x.useEffect)(()=>{if(!f)return;const h=new AbortController,g=setTimeout(()=>h.abort(),5e3);return(async()=>{try{const v=await fetch(l,{credentials:"same-origin",cache:"no-store",redirect:"error",referrerPolicy:"no-referrer",signal:h.signal});if(!v.ok||v.headers.get("content-type")?.split(";")[0]!=="text/html")return;const y=await v.text();h.signal.aborted||m({key:c,document:`<meta http-equiv="Content-Security-Policy" content="${V_}">${y}`})}catch{}finally{clearTimeout(g)}})(),()=>{h.abort(),clearTimeout(g)}},[f,c,l]),f&&u?.key===c?u.document:null}r(NU,"useAnnouncementAnimation");function dw({action:e,primary:t,onClick:i}){const l=(0,s.jsxs)(s.Fragment,{children:[e.label,!t&&e.kind==="external"&&(0,s.jsx)(nI,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}),c=r(u=>{u.button===1&&i()},"onAuxClick");return(0,s.jsx)(le,{asChild:!0,variant:t?"primary":"ghost",size:"sm",className:"h-auto min-h-9 min-w-0 whitespace-normal py-2 text-left",children:e.kind==="external"?(0,s.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:i,onAuxClick:c,children:l}):(0,s.jsx)(gn,{to:e.path,onClick:i,onAuxClick:c,children:l})})}r(dw,"Action");function CU({announcement:e,onDismiss:t,imageSrc:i,animationSrc:l,className:c}){const u=(0,x.useId)(),[m,f]=(0,x.useState)(null),h=i??`/api/announcements/${encodeURIComponent(e.id)}/image`,g=!!(e.image&&m!==h),v=NU(e,l),y=!!v;return(0,s.jsxs)(Dc,{role:"region","aria-labelledby":u,className:X("relative w-full max-w-(--announcement-width) gap-0 overflow-hidden rounded-xl p-0 shadow-sm",c),onKeyDown:r(j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),t())},"onKeyDown"),children:[(g||v)&&(0,s.jsxs)("div",{className:"relative h-(--announcement-image-mobile-height) w-full shrink-0 overflow-hidden bg-bg-3 md:h-(--announcement-image-height)",children:[g&&(0,s.jsx)("img",{src:h,alt:y?"":e.image.alt,referrerPolicy:"no-referrer",onError:r(()=>f(h),"onError"),className:"h-full w-full object-cover"}),y&&(0,s.jsx)("div",{role:"img","aria-label":e.animation.alt,className:"pointer-events-none absolute inset-0",children:(0,s.jsx)("iframe",{title:e.animation.alt,"aria-hidden":"true",tabIndex:-1,sandbox:"",referrerPolicy:"no-referrer",srcDoc:v,className:"h-full w-full border-0"})})]}),(0,s.jsx)(le,{variant:"secondary",size:"icon","aria-label":"Dismiss announcement",onClick:t,className:"absolute right-2 top-2 z-10 size-8 rounded-full shadow-sm",children:(0,s.jsx)(is,{className:"size-4","aria-hidden":"true"})}),(0,s.jsxs)("div",{className:X("flex flex-col gap-1 px-4 py-4",!g&&!v&&"pr-12"),children:[(0,s.jsx)("p",{className:"text-xs text-ink-3",children:e.eyebrow}),(0,s.jsx)("h2",{id:u,className:"break-words text-base font-semibold leading-snug",children:e.title}),(0,s.jsx)("p",{className:"break-words text-sm leading-snug text-ink-3",children:e.description})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t px-3 py-2",children:[e.secondaryLink&&(0,s.jsx)(dw,{action:e.secondaryLink,onClick:t}),(0,s.jsx)("div",{className:"ml-auto min-w-0 max-w-full",children:(0,s.jsx)(dw,{action:e.primaryAction,primary:!0,onClick:t})})]})]})}r(CU,"AnnouncementCard");var AU='[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"], [aria-modal="true"]:not([data-state="closed"]), dialog[open]';function _U(e){const[t,i]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(!e)return;const l=r(()=>i(!!document.querySelector(AU)),"scan");l();const c=new MutationObserver(l);return c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","aria-modal","open"]}),()=>c.disconnect()},[e]),t}r(_U,"useModalOpen");function EU({health:e}){const{userId:t,settled:i}=n0(),{selectedCompanyId:l,loading:c}=vt(),{onboardingOpen:u}=Cf(),m=bf(),f=m3(),h=e?.deploymentMode==="local_trusted"?"local-board":i?t:null,{announcement:g,dismiss:v}=SU({userId:h,companyId:l,enabled:!!(h&&!c&&l&&!u),onSaveFailure:r(j=>m?.pushToast({title:j?"Dismissed in this browser":"Dismissed for this visit",body:"Couldn’t save across devices. We’ll retry when you reconnect or return.",tone:"info",dedupeKey:"announcement-dismissal-sync"}),"onSaveFailure")}),y=_U(!!g);return!g||y||(f?.length??0)>0?null:(0,s.jsx)("aside",{"aria-label":"Wardmote announcements",className:"announcement-well fixed left-3 bottom-(--announcement-mobile-bottom) z-40 w-(--announcement-available-width) max-w-(--announcement-width) max-h-(--announcement-mobile-max-height) overflow-y-auto md:bottom-3 md:max-h-(--announcement-max-height)",children:(0,s.jsx)(CU,{announcement:g,onDismiss:r(()=>v(g.id),"onDismiss")},g.id)})}r(EU,"AnnouncementWell");function zf(e){const t=e.split("/").filter(Boolean);return t.length===1?t[0]?.toLowerCase()==="onboarding":t.length===2?t[1]?.toLowerCase()==="onboarding":!1}r(zf,"isOnboardingPath");function IU(e){const t=e.split("/").filter(Boolean);if(t.length===2&&t[1]?.toLowerCase()==="onboarding")return t[0]}r(IU,"companyPrefixFromOnboardingPath");function HC(){return 3}r(HC,"onboardingStepForCompany");function TU(e){const{pathname:t,companyPrefix:i,companies:l}=e;if(!zf(t))return null;if(!i)return{initialStep:1};const c=l.find(u=>u.issuePrefix.toUpperCase()===i.toUpperCase())??null;return c?{initialStep:HC(),companyId:c.id}:{initialStep:1}}r(TU,"resolveRouteOnboardingOptions");function gG(e){return!e.agentsLoaded||e.agentsRefreshing||e.agentCount>0?!1:!zf(e.pathname)}r(gG,"shouldRouteAgentlessCompanyToOnboarding");function Y0(e){return!e.hasCompanies&&!zf(e.pathname)}r(Y0,"shouldRedirectCompanylessRouteToOnboarding");function RU(e){return e.onboardingOpen||!e.routeDismissed}r(RU,"isOnboardingWizardActive");function DU({context:e}){const{slots:t,errorMessage:i}=Tc({slotTypes:["appShellOverlay"],companyId:e.companyId});return i||t.length===0?null:(0,s.jsx)("aside",{className:"plugin-app-shell-overlays","aria-label":"Application extensions",children:t.map(l=>(0,s.jsx)(x0,{slot:l,context:e,className:"plugin-app-shell-overlay"},`${l.pluginId}:${l.pluginVersion}:${l.id}`))})}r(DU,"AppShellEntries");function MU({localTrusted:e=!1}){const{userId:t,settled:i}=n0(),{selectedCompanyId:l,selectedCompany:c,loading:u}=vt(),{onboardingOpen:m,onboardingRouteDismissed:f}=Cf(),{pathname:h}=vn(),g=i?t??(e?"local-board":null):null,v=m||!f&&zf(h);if(!g||u||v)return null;const y={companyId:l,companyPrefix:c?.issuePrefix??null,projectId:null,entityId:null,entityType:null,parentEntityId:null,userId:t};return(0,s.jsx)(DU,{context:y},JSON.stringify([g,l]))}r(MU,"PluginAppShellOverlays");var fw="relative flex min-h-(--sz-calc-11) min-w-0 flex-col items-center justify-center gap-1 rounded-md text-(length:--text-nano) font-medium transition-colors";function OU({visible:e}){const{selectedCompanyId:t}=vt(),{sidebarOpen:i,setSidebarOpen:l}=Jn(),c=I0(t),{enabled:u}=yf(),{enabled:m}=Of(),f=(0,x.useMemo)(()=>[{to:"/dashboard",label:"Home",icon:BT},...m?[]:[{to:"/inbox",label:"Inbox",icon:u0,badge:c.inbox}],{to:"/issues",label:"Tasks",icon:Ph,badge:m?c.inbox:void 0},...u?[{to:"/chats",label:"Chat",icon:ng}]:[]],[c.inbox,u,m]);return(0,s.jsx)("nav",{className:"mobile-bottom-nav fixed inset-x-0 bottom-0 z-30 bg-bg-3 pb-(--sz-safe-bottom)","data-visible":e,inert:!e,"aria-label":"Mobile navigation",children:(0,s.jsxs)("div",{className:"grid h-16 px-1",style:{gridTemplateColumns:`repeat(${f.length+1}, minmax(0, 1fr))`},children:[f.map(h=>{const g=h.icon;return(0,s.jsx)(Qk,{to:h.to,state:xf,className:r(({isActive:v})=>X(fw,v?"text-ink":"text-ink-3"),"className"),children:r(({isActive:v})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"relative",children:[(0,s.jsx)(g,{className:X("h-(--sz-18px) w-(--sz-18px)",v&&"stroke-(length:--sw-2_3)")}),h.badge!=null&&h.badge>0&&(0,s.jsx)(Bn,{variant:"ghost",className:"absolute -end-2 -top-2 bg-accent px-1.5 text-(length:--text-nano) leading-none text-accent-ink",children:h.badge>99?"99+":h.badge})]}),(0,s.jsx)("span",{className:"truncate",children:h.label})]}),"children")},h.label)}),(0,s.jsxs)("button",{type:"button","aria-expanded":i,onClick:r(()=>l(!0),"onClick"),className:X(fw,i?"text-ink":"text-ink-3"),children:[(0,s.jsx)(g1,{className:"h-(--sz-18px) w-(--sz-18px)"}),(0,s.jsx)("span",{className:"truncate",children:"More"})]})]})})}r(OU,"MobileBottomNav");function zl(e){if(typeof document>"u")return null;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content")?.trim();return t||null}r(zl,"readMetaContent");function gg(e){if(!e)return null;const t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]{3}$/.test(t)?`#${t.split("").map(i=>`${i}${i}`).join("").toLowerCase()}`:/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:null}r(gg,"normalizeHexColor");function LU(e){const t=gg(e)??"#000000";return{r:Number.parseInt(t.slice(1,3),16),g:Number.parseInt(t.slice(3,5),16),b:Number.parseInt(t.slice(5,7),16)}}r(LU,"hexToRgb");function uh(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}r(uh,"relativeLuminanceChannel");function zU(e){const{r:t,g:i,b:l}=LU(e),c=.2126*uh(t)+.7152*uh(i)+.0722*uh(l);return 1.05/(c+.05)>=(c+.05)/.05?nT:sT}r(zU,"pickReadableTextColor");function xG(){return zl("wardmote-worktree-enabled")==="true"}r(xG,"isWorktreeRuntime");function bG(){return zl("wardmote-instance-id")}r(bG,"getWorktreeInstanceId");function PU(){if(zl("wardmote-worktree-enabled")!=="true")return null;const e=zl("wardmote-worktree-name"),t=gg(zl("wardmote-worktree-color"));return!e||!t?null:{enabled:!0,name:e,color:t,textColor:gg(zl("wardmote-worktree-text-color"))??zU(t)}}r(PU,"getWorktreeUiBranding");function UU(){const e=PU(),{copied:t,failed:i,copy:l}=uT(),c=(0,x.useCallback)(()=>{e&&l(e.name)},[e,l]);return e?(0,s.jsx)("div",{className:"relative overflow-hidden border-b px-3 py-1.5 text-(length:--text-micro) font-medium tracking-(--tracking-caps) uppercase",style:{backgroundColor:e.color,color:e.textColor,borderColor:`${e.textColor}22`,boxShadow:`inset 0 -1px 0 ${e.textColor}18`,backgroundImage:`linear-gradient(90deg, ${e.textColor}14, transparent 28%, transparent 72%, ${e.textColor}12), repeating-linear-gradient(135deg, transparent 0 10px, ${e.textColor}08 10px 20px)`},children:(0,s.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden whitespace-nowrap",children:[(0,s.jsx)("span",{className:"shrink-0 opacity-70",children:"Worktree"}),(0,s.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-70","aria-hidden":"true"}),(0,s.jsx)("button",{type:"button",onClick:c,title:"Click to copy worktree name",className:"truncate font-semibold tracking-(--tracking-eyebrow) cursor-pointer hover:opacity-80 transition-opacity bg-transparent border-none p-0 text-current uppercase text-(length:--text-micro)",children:t?"Copied!":i?"Copy failed":e.name})]})}):null}r(UU,"WorktreeBanner");var $U=3e4;function BU(e){if(!e)return null;const t=new Date(e).getTime();if(Number.isNaN(t))return null;const i=Date.now()-t;if(i<6e4)return"just now";const l=Math.round(i/6e4);if(l<60)return`${l}m ago`;const c=Math.round(l/60);return c<24?`${c}h ago`:`${Math.round(c/24)}d ago`}r(BU,"formatRelativeTimestamp");function KU(e){return e.reason==="backend_changes_and_pending_migrations"?"backend files changed and migrations are pending":e.reason==="pending_migrations"?"pending migrations need a fresh boot":"backend files changed since this server booted"}r(KU,"describeReason");function qU({devServer:e}){const[t,i]=(0,x.useState)(!1);if((0,x.useEffect)(()=>{if(!t)return;const h=window.setTimeout(()=>{i(!1)},$U);return()=>window.clearTimeout(h)},[t]),!e?.enabled||!e.restartRequired)return null;const l=e,c=BU(e.lastChangedAt),u=e.changedPathsSample.slice(0,3),m=`${e.activeRunCount} live run${e.activeRunCount===1?"":"s"}`;async function f(){const h=l.activeRunCount>0?`Restart Wardmote now? This may interrupt ${m}.`:"Restart Wardmote now?";if(window.confirm(h)){i(!0);try{await Rc.requestDevServerRestart()}catch(g){i(!1),window.alert(g instanceof Error?g.message:"Failed to request restart")}}}return r(f,"requestRestartNow"),(0,s.jsx)("div",{className:"border-b border-amber-300/60 bg-amber-50 text-amber-950 dark:border-amber-500/25 dark:bg-amber-500/10 dark:text-amber-100",children:(0,s.jsxs)("div",{className:"flex flex-col gap-3 px-3 py-2.5 md:flex-row md:items-center md:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-(--tracking-caps)",children:[(0,s.jsx)(Ja,{className:"h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("span",{children:"Restart Required"}),e.autoRestartEnabled?(0,s.jsx)(Bn,{variant:"ghost",className:"bg-amber-900/10 text-(length:--text-nano) tracking-(--tracking-eyebrow) dark:bg-amber-100/10",children:"Auto-Restart On"}):null]}),(0,s.jsxs)("p",{className:"mt-1 text-sm",children:[KU(e),c?` · updated ${c}`:""]}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-amber-900/80 dark:text-amber-100/75",children:[u.length>0?(0,s.jsxs)("span",{children:["Changed: ",u.join(", "),e.changedPathCount>u.length?` +${e.changedPathCount-u.length} more`:""]}):null,e.pendingMigrations.length>0?(0,s.jsxs)("span",{children:["Pending migrations: ",e.pendingMigrations.slice(0,2).join(", "),e.pendingMigrations.length>2?` +${e.pendingMigrations.length-2} more`:""]}):null]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs font-medium md:justify-end",children:[e.waitingForIdle?(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-amber-900/10 px-3 py-1.5 dark:bg-amber-100/10",children:[(0,s.jsx)(aR,{className:"h-3.5 w-3.5"}),(0,s.jsxs)("span",{children:["Waiting for ",m," to finish"]})]}):e.autoRestartEnabled?(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-amber-900/10 px-3 py-1.5 dark:bg-amber-100/10",children:[(0,s.jsx)(ic,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:"Auto-restart will trigger when the instance is idle"})]}):(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-amber-900/10 px-3 py-1.5 dark:bg-amber-100/10",children:[(0,s.jsx)(ic,{className:"h-3.5 w-3.5"}),(0,s.jsxs)("span",{children:["Restart ",(0,s.jsx)("code",{children:"pnpm dev:once"})," after the active work is safe to interrupt"]})]}),(0,s.jsxs)(le,{variant:"primary",size:"sm",type:"button",onClick:r(()=>{f()},"onClick"),disabled:t,children:[(0,s.jsx)(ic,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:t?"Restart requested":"Restart now"})]})]})]})})}r(qU,"DevRestartBanner");var FU=new Set(["disk_space_low","database_backup_skipped_low_disk"]);function HU({diskSpace:e,warnings:t}){const i=(t??[]).filter(u=>FU.has(u.code)),l=e?.level==="emergency",c=l?"Disk space critical":"Disk space low";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"sr-only","aria-live":l?"assertive":"polite","aria-atomic":"true",children:i.length>0?`${c}. ${i.map(u=>u.message).join(" ")}`:""}),i.length>0&&(0,s.jsx)("section",{"aria-label":c,className:l?"border-b border-red-300/60 bg-red-50 text-red-950 dark:border-red-500/25 dark:bg-red-500/10 dark:text-red-100":"border-b border-amber-300/60 bg-amber-50 text-amber-950 dark:border-amber-500/25 dark:bg-amber-500/10 dark:text-amber-100",children:(0,s.jsxs)("div",{className:"px-3 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-(--tracking-caps)",children:[(0,s.jsx)(Ja,{className:"h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("span",{children:c})]}),i.map(u=>(0,s.jsx)("p",{className:"mt-1 text-sm",children:u.message},u.code))]})})]})}r(HU,"DiskSpaceBanner");var Pl={getStatus:r(()=>we.get("/instance/updates"),"getStatus"),getInstall:r(()=>we.get("/instance/updates/install",{cache:"no-store"}),"getInstall"),liveRuns:r(()=>we.get("/instance/live-runs",{cache:"no-store"}),"liveRuns"),startInstall:r((e,t)=>we.post("/instance/updates/install",{version:e,mode:t}),"startInstall"),forceInstall:r(()=>we.post("/instance/updates/install/force",{}),"forceInstall"),cancelInstall:r(()=>we.delete("/instance/updates/install"),"cancelInstall")};function xg(e,t){return`${e} ${t}${e===1?"":"s"}`}r(xg,"plural");function VU(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}r(VU,"formatTime$1");function WU({job:e,serverReachable:t}){switch(e.phase){case"waiting":return(0,s.jsxs)("p",{children:["Waiting for ",xg(e.liveRuns,"run")," to finish. New runs wait until the update is done.",e.waitDeadline?` Gives up at ${VU(e.waitDeadline)} without changing anything.`:""]});case"installing":return(0,s.jsx)("p",{children:t?`Installing Wardmote ${e.toVersion}: database backup, install, then a restart. Database migrations can take a few minutes.`:"The server is restarting. This page reconnects by itself."});case"succeeded":return(0,s.jsxs)("p",{children:["Wardmote ",e.installedVersion??e.toVersion," is installed and running."]});case"cancelled":return(0,s.jsx)("p",{children:e.error??"The update was cancelled. Nothing was installed."});case"failed":return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{children:e.rolledBackTo?`Updating to ${e.toVersion} failed and Wardmote was rolled back to ${e.rolledBackTo}.`:`Updating to ${e.toVersion} failed.`}),e.error?(0,s.jsx)("p",{className:"text-ink-3",children:e.error}):null,e.logHint?(0,s.jsxs)("p",{className:"text-ink-3",children:["Log: ",(0,s.jsx)("code",{className:"rounded bg-bg-3 px-1 py-0.5 text-xs",children:e.logHint})]}):null]})}}r(WU,"UpdateJobSummary");function QU({open:e,onOpenChange:t,status:i,job:l,serverReachable:c,showResult:u=!1}){const m=wn(),[f,h]=(0,x.useState)(null),[g,v]=(0,x.useState)(null);(0,x.useEffect)(()=>{Ol(l)&&v(l.id)},[l]);const y=l!==null&&(Ol(l)||u||l.id===g),j=ge({queryKey:[...U.instance.updates,"live-runs"],queryFn:r(()=>Pl.liveRuns(),"queryFn"),enabled:e&&!y,staleTime:0,refetchInterval:e&&!y?3e3:!1}),k=r(({job:C})=>{h(null),v(C.id),m.setQueryData([...U.instance.updates,"install"],{job:C})},"onJob"),S=r(C=>h(C instanceof Error?C.message:String(C)),"onError"),N=Kt({mutationFn:r(C=>Pl.startInstall(i.latestVersion,C),"mutationFn"),onSuccess:k,onError:S}),_=Kt({mutationFn:r(()=>Pl.forceInstall(),"mutationFn"),onSuccess:k,onError:S}),I=Kt({mutationFn:r(()=>Pl.cancelInstall(),"mutationFn"),onSuccess:k,onError:S}),D=N.isPending||_.isPending||I.isPending,T=j.data?j.data.count+j.data.pendingWakes:null;return(0,s.jsx)(ya,{open:e,onOpenChange:t,children:(0,s.jsxs)(za,{"data-testid":"update-install-dialog",children:[(0,s.jsxs)(Jl,{children:[(0,s.jsxs)(Da,{children:["Update Wardmote to ",l&&y?l.toVersion:i.latestVersion]}),(0,s.jsxs)(eo,{children:["Installed ",i.currentVersion,". The update backs up the database, installs the new version and restarts the server. If the new version fails its health check, Wardmote rolls back automatically."]})]}),(0,s.jsxs)("div",{className:"text-sm text-ink","aria-live":"polite",children:[y&&l?(0,s.jsx)(WU,{job:l,serverReachable:c}):T===null?(0,s.jsx)("p",{children:j.isError?"Could not count the active runs.":"Counting active runs..."}):T>0?(0,s.jsx)("p",{children:T===1?"1 run is active now. Stopping it restarts it from its last checkpoint after the update; waiting lets it finish first.":`${T} runs are active now. Stopping them restarts each from its last checkpoint after the update; waiting lets them finish first.`}):(0,s.jsx)("p",{children:"No runs are active. The server restarts briefly."}),f?(0,s.jsx)("p",{role:"alert",className:"mt-2 text-bad",children:f}):null]}),(0,s.jsx)(jf,{children:y&&l?l.phase==="waiting"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(le,{type:"button",variant:"secondary",disabled:D,onClick:r(()=>I.mutate(),"onClick"),children:"Cancel update"}),(0,s.jsxs)(le,{type:"button",variant:"danger",disabled:D,onClick:r(()=>_.mutate(),"onClick"),children:["Stop ",xg(l.liveRuns,"run")," and update now"]})]}):l.phase==="succeeded"?(0,s.jsx)(le,{type:"button",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload"}):(0,s.jsx)(le,{type:"button",variant:"secondary",onClick:r(()=>t(!1),"onClick"),children:"Close"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(le,{type:"button",variant:"secondary",disabled:D,onClick:r(()=>t(!1),"onClick"),children:"Cancel"}),T!==null&&T>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(le,{type:"button",variant:"secondary",disabled:D,onClick:r(()=>N.mutate("wait"),"onClick"),children:"Wait for runs to finish"}),(0,s.jsxs)(le,{type:"button",variant:"primary",autoFocus:!0,disabled:D,onClick:r(()=>N.mutate("force"),"onClick"),children:["Update and stop ",xg(T,"run")]})]}):(0,s.jsx)(le,{type:"button",variant:"primary",autoFocus:!0,disabled:D||T===null,onClick:r(()=>N.mutate("wait"),"onClick"),children:"Update now"})]})})]})})}r(QU,"UpdateInstallDialog");var VC="wardmote.updateNotice.hiddenUntil",mw="wardmote.updateNotice.seenJob",pw=36e5,GU=2e3,YU=864e5;function XU(e){return e?.source==="local_implicit"||e?.source==="session"&&e.isInstanceAdmin===!0}r(XU,"canSeeUpdateNotice");function WC(e){try{return window.localStorage.getItem(e)}catch{return null}}r(WC,"readStored$1");function hw(e,t){try{window.localStorage.setItem(e,t)}catch{}}r(hw,"writeStored");function gw(){const e=Number(WC(VC));return Number.isFinite(e)&&e>0?e:null}r(gw,"readHiddenUntil");var xw="flex min-w-0 items-center gap-2 border-b border-line bg-accent-soft px-3 py-1.5 text-sm text-ink";function ZU({now:e=Date.now}){const t=XU(ge({queryKey:U.access.currentBoardAccess,queryFn:r(()=>Xa.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4}).data),i=ge({queryKey:U.instance.updates,queryFn:r(()=>Pl.getStatus(),"queryFn"),enabled:t,retry:!1,staleTime:pw,refetchInterval:pw}),l=i.data?.install.canInstall===!0,c=ge({queryKey:[...U.instance.updates,"install"],queryFn:r(()=>Pl.getInstall(),"queryFn"),enabled:t&&l,retry:!1,refetchInterval:r(C=>Ol(C.state.data?.job)||C.state.status==="error"?GU:!1,"refetchInterval")}),u=c.data?.job??null,m=!c.isError,[f,h]=(0,x.useState)(null),[g,v]=(0,x.useState)(gw),[y,j]=(0,x.useState)(()=>WC(mw)),k=AT(g,e());(0,x.useEffect)(()=>{if(!k||g===null)return;const C=window.setTimeout(()=>v(gw()),Math.max(0,g-e())+1e3);return()=>window.clearTimeout(C)},[k,g,e]);const S=i.data;if(!t||!S)return null;const N=u?.finishedAt?e()-Date.parse(u.finishedAt)<YU&&y!==u.id:!1,_=u?.phase==="succeeded"?!S.updateAvailable:u?.phase==="failed"&&S.latestVersion===u.toVersion,I=u!==null&&(Ol(u)||N&&_),D=l?(0,s.jsx)(QU,{open:f!==null,onOpenChange:r(C=>h(C?f??"start":null),"onOpenChange"),status:S,job:u,serverReachable:m,showResult:f==="result"}):null;if(I&&u){const C=u.trigger==="auto"?"Automatic update":"Update",M=u.phase==="waiting"?`${C} to ${u.toVersion} is waiting for ${u.liveRuns} run${u.liveRuns===1?"":"s"} to finish`:u.phase==="installing"?m?`Installing Wardmote ${u.toVersion}...`:"Wardmote is restarting...":u.phase==="succeeded"?`Wardmote ${u.installedVersion??u.toVersion} is installed`:u.rolledBackTo?`${C} to ${u.toVersion} failed and was rolled back to ${u.rolledBackTo}`:`${C} to ${u.toVersion} failed`,z=r(()=>{hw(mw,u.id),j(u.id)},"dismiss");return(0,s.jsxs)("section",{"aria-label":"Wardmote update","data-testid":"update-notice","data-phase":u.phase,className:xw,children:[Ol(u)?(0,s.jsx)(As,{className:"size-4 shrink-0 animate-spin text-accent","aria-hidden":"true"}):(0,s.jsx)(qy,{className:`size-4 shrink-0 ${u.phase==="failed"?"text-bad":"text-accent"}`,"aria-hidden":"true"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 truncate font-semibold",role:"status",children:M}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"xs",onClick:r(()=>h("result"),"onClick"),children:"Details"}),Ol(u)?null:(0,s.jsx)(le,{type:"button",variant:"ghost",size:"xs",onClick:z,children:"Dismiss"}),D]})}if(!S.updateAvailable||!S.latestVersion||k)return null;const T=r(()=>{const C=CT(e());hw(VC,String(C)),v(C)},"hide");return(0,s.jsxs)("section",{"aria-label":"Wardmote update available","data-testid":"update-notice",className:xw,children:[(0,s.jsx)(qy,{className:"size-4 shrink-0 text-accent","aria-hidden":"true"}),(0,s.jsxs)("p",{className:"min-w-0 flex-1 truncate",title:`Installed ${S.currentVersion}. ${S.install.command}`,children:[(0,s.jsxs)("b",{className:"font-semibold",children:["Wardmote ",S.latestVersion,(0,s.jsx)("span",{className:"hidden sm:inline",children:" is available"})]}),(0,s.jsxs)("span",{className:"hidden sm:inline",children:[" · installed ",S.currentVersion]}),l?null:(0,s.jsxs)("span",{className:"hidden lg:inline",children:[" · ",(0,s.jsx)("code",{className:"rounded bg-bg px-1 py-0.5 text-xs",children:S.install.command})]})]}),S.releaseNotesUrl?(0,s.jsxs)("a",{href:S.releaseNotesUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-sm font-medium text-accent underline-offset-2 hover:underline",children:[(0,s.jsx)("span",{className:"sm:hidden",children:"Notes"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Release notes"})]}):null,l?(0,s.jsx)(le,{type:"button",variant:"primary",size:"xs",onClick:r(()=>h("start"),"onClick"),children:"Update now"}):null,(0,s.jsx)(le,{type:"button",variant:"ghost",size:"xs",onClick:T,title:"Hide for 3 days","aria-label":"Hide the update notice for 3 days",children:"Hide"}),D]})}r(ZU,"UpdateNotice");var QC=["standalone","fullscreen","window-controls-overlay"];function JU(e){return`(display-mode: ${e})`}r(JU,"displayModeQuery");function e$(){if(!(typeof window>"u"||typeof window.matchMedia!="function"))return window.matchMedia.bind(window)}r(e$,"defaultMatchMedia");function bg(e=e$(),t=typeof navigator>"u"?void 0:navigator.standalone){return t===!0?!0:e?QC.some(i=>e(JU(i)).matches):!1}r(bg,"isChromelessDisplayMode");function rd({label:e,children:t,onClick:i}){return(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm",className:"size-8","aria-label":e,onClick:r(()=>{i()},"onClick"),children:t})}),(0,s.jsx)(Ea,{children:e})]})}r(rd,"ControlButton");function t$(e=typeof window>"u"?null:window.history.state){const t=e?.idx;return typeof t=="number"&&t>0}r(t$,"hasInAppHistory");function n$(){const[e,t]=(0,x.useState)(()=>typeof window<"u"?bg():!1);return(0,x.useEffect)(()=>{if(typeof window>"u")return;const i=r(()=>t(bg()),"update");if(i(),typeof window.matchMedia!="function")return;const l=QC.map(c=>window.matchMedia(`(display-mode: ${c})`));return l.every(c=>typeof c.addEventListener=="function")?(l.forEach(c=>c.addEventListener("change",i)),()=>l.forEach(c=>c.removeEventListener("change",i))):(l.forEach(c=>c.addListener(i)),()=>l.forEach(c=>c.removeListener(i)))},[]),e}r(n$,"useChromeless");function bw({mobile:e,onNavigateHome:t}){const i=n$(),l=bf(),c=(0,x.useCallback)(()=>{if(t$()){window.history.back();return}t?t():window.location.assign("/dashboard")},[t]),u=(0,x.useCallback)(()=>{window.location.reload()},[]),m=(0,x.useCallback)(async()=>{const h=window.location.href;try{if(navigator.share){await navigator.share({title:document.title||"Wardmote",url:h});return}await w0(h),l?.pushToast({title:"Link copied",tone:"success"})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;l?.pushToast({title:"Share failed",body:"Try opening the page in your browser.",tone:"error"})}},[l]),f=(0,x.useCallback)(()=>{window.open(window.location.href,"_blank","noopener,noreferrer")},[]);return i?(0,s.jsxs)("div",{className:X("flex items-center gap-1",e?"h-10 border-b border-line bg-bg/95 px-3 backdrop-blur supports-[backdrop-filter]:bg-bg/85":"h-9 border-b border-line px-2"),children:[(0,s.jsx)(rd,{label:"Back",onClick:c,children:(0,s.jsx)(o0,{className:"h-4 w-4"})}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)(rd,{label:"Refresh",onClick:u,children:(0,s.jsx)(Yr,{className:"h-4 w-4"})}),(0,s.jsx)(rd,{label:"Share",onClick:m,children:(0,s.jsx)(ZT,{className:"h-4 w-4"})}),(0,s.jsx)(rd,{label:"Open in Browser",onClick:f,children:(0,s.jsx)(bS,{className:"h-4 w-4"})})]}):null}r(bw,"StandaloneBrowserControls");function s$(e){return e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}r(s$,"formatTime");function a$(){const e=e0(),[t,i]=(0,x.useState)(null);return(0,x.useEffect)(()=>{if(!e){i(null);return}let l=!1;const c=new Date;return dE().then(u=>{l||i(u&&u<c?u:c)}),()=>{l=!0}},[e]),e?(0,s.jsxs)("div",{role:"status",className:"flex items-start gap-2 border-b border-line bg-warn-soft px-4 py-2 text-sm text-ink",children:[(0,s.jsx)(oR,{className:"mt-0.5 size-4 shrink-0 text-warn","aria-hidden":"true"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{className:"font-semibold",children:"You are offline."})," ",t?`Showing what was loaded at ${s$(t)}. `:"Showing what was already loaded. ","Approvals and replies wait until you are back."]})]}):null}r(a$,"OfflineBanner");function GC(){return typeof navigator>"u"?null:navigator.windowControlsOverlay??null}r(GC,"overlay");function i$(e){const t=GC();return t?.addEventListener("geometrychange",e),()=>t?.removeEventListener("geometrychange",e)}r(i$,"subscribe$2");function r$(){return(0,x.useSyncExternalStore)(i$,()=>GC()?.visible===!0,()=>!1)}r(r$,"useWindowControlsOverlayVisible");var l$={WebkitAppRegion:"drag",appRegion:"drag"},o$={WebkitAppRegion:"no-drag",appRegion:"no-drag"};function c$(){const{selectedCompanyId:e}=vt(),{inbox:t}=I0(e);return(0,s.jsxs)("div",{"data-slot":"window-titlebar",className:"flex shrink-0 items-center gap-2 border-b border-line bg-bg px-3 text-xs text-ink-2",style:{...l$,marginLeft:"env(titlebar-area-x, 0px)",width:"env(titlebar-area-width, 100%)",height:"env(titlebar-area-height, 33px)"},children:[(0,s.jsx)(p0,{className:"size-4 shrink-0 text-ink","aria-hidden":"true"}),(0,s.jsx)("span",{className:"font-semibold text-ink",children:"Wardmote"}),(0,s.jsxs)(gn,{to:"/inbox",style:o$,className:"ml-1 inline-flex items-center gap-1 rounded-(--r-sm) px-1.5 py-0.5 hover:bg-bg-3 hover:text-ink","aria-label":t>0?`Inbox, ${t} waiting`:"Inbox",children:["Inbox",t>0?(0,s.jsx)("span",{className:"rounded-(--r-pill) bg-accent px-1.5 text-(length:--text-micro) font-semibold text-accent-ink tabular-nums",children:t}):null]})]})}r(c$,"TitleBarContent");function u$(){return r$()?(0,s.jsx)(c$,{}):null}r(u$,"WindowTitleBar");var d$=16384,f$=40;function m$(e){if(!e)return;const t=[];for(const i of e.slice(0,d$).split(`
52
52
  `).slice(0,41)){const l=/^\s*(?:at|in) ([A-Za-z_$][\w$.-]{0,99})(?:\s|$)/.exec(i)?.[1]??/^([A-Za-z_$][\w$.-]{0,99})@/.exec(i)?.[1];if(l&&t.push(` at ${l}`),t.length===f$)break}return t.length?`
53
53
  ${t.join(`
54
- `)}`:void 0}r(m$,"sanitizeComponentStack");function YC(){const e={};if(typeof document<"u"){try{const t=document.readyState;(t==="loading"||t==="interactive"||t==="complete")&&(e.ready_state=t)}catch{}try{const t=document.visibilityState;(t==="visible"||t==="hidden")&&(e.visibility_state=t)}catch{}try{const t=document.documentElement.classList;e.translation_marker=t.contains("translated-ltr")||t.contains("translated-rtl")}catch{}}return e}r(YC,"readBrowserErrorState");function p$(e){const t=m$(e.componentStack);return{tags:{react_error_boundary:e.boundary},contexts:{react:t?{componentStack:t}:{},browser_state:YC()}}}r(p$,"buildBrowserErrorContext");var vw=Promise.resolve();function X0(e){const t=vw.then(e);return vw=t.catch(()=>{}),t}r(X0,"enqueue");var Yl=null;function h$(e,t){return X0(async()=>{if(!Yl)try{const i=await ke(()=>import("./prod-COP_vZWu.js"),__vite__mapDeps([0,1]));i.init(x$(e,t)),Yl=i}catch{}})}r(h$,"initBrowserErrorMonitoring");function g$(){return X0(async()=>{const e=Yl;if(Yl=null,!e)return;const t=e.getClient();try{e.getCurrentScope().setClient(void 0)}catch{}try{await t?.close(2e3)}catch{}})}r(g$,"teardownBrowserErrorMonitoring");function XC(e,t){let i;try{t&&(i=p$(t))}catch{}X0(async()=>{try{i?Yl?.captureException(e,i):Yl?.captureException(e)}catch{}})}r(XC,"captureBrowserException");function x$(e,t){return{dsn:e,environment:t??void 0,release:"23788ac36a64829bdd51a23ca02d1a329205ccb4",tracesSampleRate:0,sendDefaultPii:!1,beforeSend:r((i,l)=>{try{if(i.contexts={...i.contexts,browser_state:i.contexts?.browser_state??YC()},i.tags={...i.tags,browser_build_mode:"production"},i.exception?.values?.some(c=>c.mechanism?.type==="onunhandledrejection"||c.mechanism?.type==="auto.browser.global_handlers.onunhandledrejection")){const c=l.originalException;i.tags.browser_rejection_kind=c===null?"null":typeof c}}catch{}return i},"beforeSend"),integrations:r(i=>i.filter(l=>l.name!=="HttpContext"&&l.name!=="Breadcrumbs"),"integrations")}}r(x$,"buildBrowserSentryInitOptions");var b$=class extends x.Component{static{r(this,"RouteErrorBoundaryInner")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){XC(e,{boundary:"route",componentStack:t.componentStack})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){const{error:e}=this.state;return e?(0,s.jsxs)("div",{className:"mx-auto max-w-2xl space-y-4 px-4 py-10",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold",children:"This page hit an error"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while rendering this page. You can go back and try again, or reload."})]}),(0,s.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:this.props.onReset,children:"Go back"}),(0,s.jsx)(le,{size:"sm",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})]})]}):this.props.children}};function v$({children:e}){const t=vn(),i=bs(),l=`${t.pathname}${t.search}`;return(0,s.jsx)(b$,{resetKey:l,onReset:r(()=>i(-1),"onReset"),children:e})}r(v$,"RouteErrorBoundary");function y$({open:e,onOpenChange:t,...i}){return(0,s.jsx)(ya,{open:e,onOpenChange:t,children:(0,s.jsxs)(za,{"aria-describedby":void 0,className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[(0,s.jsxs)("div",{className:"px-4 pt-4 pb-3",children:[(0,s.jsx)(Da,{children:"Chat with an agent"}),i.existingChatAgentIds&&(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"One conversation per agent. Pick up where you left off."})]}),(0,s.jsx)(j$,{...i,onComplete:r(()=>t(!1),"onComplete")},String(e))]})})}r(y$,"AgentChatPicker");function j$({agents:e,onSelect:t,onComplete:i,loading:l,error:c,onRetry:u,existingChatAgentIds:m,renderAgentIcon:f}){const h=(0,x.useRef)(!1),g=(0,x.useRef)(null);(0,x.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current?.abort()}),[]);const[v,y]=(0,x.useState)(""),[j,k]=(0,x.useState)(null),[S,N]=(0,x.useState)(null);async function _(I){if(j)return;k(I.id),N(null);const D=new AbortController;g.current=D;try{await t(I,D.signal),h.current&&i()}catch(T){N(T instanceof Error?T.message:"Couldn’t open chat. Try again.")}finally{k(null)}}return r(_,"selectAgent"),(0,s.jsxs)(TS,{children:[(0,s.jsx)(b0,{"aria-label":"Search agents by name or role",placeholder:"Search by name or role…",value:v,onValueChange:y}),S&&(0,s.jsx)("p",{role:"alert",className:"px-4 py-3 text-sm text-bad",children:S}),j&&(0,s.jsx)("p",{role:"status",className:"sr-only",children:"Opening conversation…"}),c?(0,s.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 p-4 text-sm",children:[(0,s.jsx)("p",{children:"Couldn’t load agents. Try again."}),u&&(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:u,children:"Retry"})]}):l?(0,s.jsx)("p",{role:"status",className:"p-4 text-sm text-ink-3",children:"Loading agents…"}):(0,s.jsxs)(y0,{children:[(0,s.jsx)(v0,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 px-4",children:[(0,s.jsx)("span",{children:e.length?`No agents match “${v}”`:"No agents yet."}),e.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Try another name or role."}),(0,s.jsx)(le,{variant:"ghost",size:"sm",onClick:r(()=>y(""),"onClick"),children:"Clear search"})]}):(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Create an agent from the Agents page to start chatting."})]})}),(0,s.jsx)(Wa,{children:e.map(I=>(0,s.jsxs)(jn,{value:I.id,keywords:[I.name,I.title??"",I.role],onSelect:r(()=>{_(I)},"onSelect"),disabled:j!==null,className:"gap-3 px-3 py-3",children:[f?f(I):(0,s.jsx)(Kh,{icon:I.icon,className:"size-4 shrink-0"}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"truncate font-medium",children:I.name}),(0,s.jsx)("span",{className:"truncate text-xs text-ink-3",children:I.title??I.role})]}),m&&(0,s.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:m.includes(I.id)?"Open chat":"New chat"}),I.status==="paused"&&(0,s.jsx)("span",{className:"text-xs text-(--status-agent-paused)",children:"Paused"}),I.status==="terminated"&&(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Terminated"}),I.status==="pending_approval"&&(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Awaiting approval"})]},I.id))})]})]})}r(j$,"AgentChatPickerResults");function w$({agents:e,existingChatAgentIds:t,availableAgents:i=e,activeId:l,previews:c={},loading:u=!1,error:m,onRetry:f,initialSearch:h="",onSelect:g,onBrowse:v,onAddChat:y,historyLoading:j,historyError:k,onRetryHistory:S}){const N=bs(),[_,I]=(0,x.useState)(!1),[D,T]=(0,x.useState)(h),C=(0,x.useRef)(null),M=(0,x.useId)(),z=D.trim().toLocaleLowerCase(),K=e.filter(A=>`${A.name} ${A.title??""} ${A.role}`.toLocaleLowerCase().includes(z));function P(){T(""),C.current?.focus()}return r(P,"focusSearch"),(0,s.jsxs)("aside",{"aria-labelledby":M,className:"flex h-full min-h-0 flex-col border-r border-line bg-bg",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col gap-4 px-3 pb-4 pt-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("h2",{id:M,className:"text-sm font-semibold",children:"Chat"}),(0,s.jsx)(le,{variant:"secondary",size:"icon-sm","aria-label":"Add chat",title:"Add chat",onClick:r(()=>I(!0),"onClick"),children:(0,s.jsx)(Js,{className:"size-4"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(Kr,{"aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-ink-3"}),(0,s.jsx)(Wn,{ref:C,"aria-label":"Search agents",placeholder:"Find an agent",value:D,onChange:r(A=>T(A.target.value),"onChange"),onKeyDown:r(A=>{A.key==="Escape"&&(A.stopPropagation(),T(""))},"onKeyDown"),className:"h-8 pl-8 pr-8 text-xs md:text-xs"}),D&&(0,s.jsx)(le,{variant:"ghost",size:"icon-xs","aria-label":"Clear search",className:"absolute right-1 top-1/2 -translate-y-1/2",onClick:P,children:(0,s.jsx)(is,{className:"size-3"})})]})]}),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pb-3 scrollbar-auto-hide",children:[(0,s.jsx)("p",{className:"px-2 text-(length:--text-micro) font-medium uppercase tracking-widest text-ink-3",children:z?"Search results":"Teammates"}),(0,s.jsx)("span",{role:"status",className:"sr-only",children:u?"Loading agents":`${K.length} ${K.length===1?"agent":"agents"}`}),j&&(0,s.jsx)("p",{role:"status",className:"px-2 text-xs text-ink-3",children:"Loading chat history…"}),k&&(0,s.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-3",children:[(0,s.jsx)("p",{className:"text-xs text-ink-3",children:"Some chat history couldn’t load."}),(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:S,children:"Retry chat history"})]}),m?(0,s.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,s.jsx)("p",{className:"text-sm",children:"Couldn’t load your chats."}),(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:f,children:"Try again"})]}):u?(0,s.jsx)("div",{"aria-hidden":"true",className:"flex flex-col gap-1",children:[0,1,2,3].map(A=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-md px-2 py-3 motion-safe:animate-pulse",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg bg-bg-3"}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,s.jsx)("div",{className:"h-3 w-2/3 rounded-sm bg-bg-3"}),(0,s.jsx)("div",{className:"h-2 w-full rounded-sm bg-bg-3"})]})]},A))}):K.length?(0,s.jsx)("nav",{"aria-label":"Agent conversations",className:"flex flex-col gap-1",children:K.map(A=>(0,s.jsxs)(gn,{to:`/chats/${encodeURIComponent(A.status==="terminated"?A.id:ar(A))}`,"aria-current":l===A.id?"page":void 0,title:`${A.name}${A.title?` · ${A.title}`:""}`,onClick:r(B=>{g&&(B.preventDefault(),g(A))},"onClick"),className:X("flex min-w-0 items-center gap-3 rounded-md px-2 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus",l===A.id?Vl.active:Vl.rest),children:[(0,s.jsx)(ir,{agent:A,size:32}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium",children:A.name}),(0,s.jsx)("span",{className:"truncate text-xs text-ink-3",children:A.status==="terminated"?"Terminated":A.status==="paused"?"Paused":c[A.id]??A.title??"Start a conversation"})]})]},A.id))}):!e.length&&(j||k)?null:(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.length?"No agents found":"No chats yet"}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-ink-3",children:e.length?"Try another name or role.":"Choose an agent to start a conversation."}),!e.length&&(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:r(()=>I(!0),"onClick"),children:"Choose an agent"}),e.length>0&&(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:P,children:"Clear search"})]})]}),(0,s.jsx)("div",{className:"shrink-0 px-3 py-4",children:(0,s.jsx)(le,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2 px-2",asChild:!v,onClick:v,children:v?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(qr,{className:"size-4"}),"Browse all agents"]}):(0,s.jsxs)(gn,{to:"/agents/all",children:[(0,s.jsx)(qr,{className:"size-4"}),"Browse all agents"]})})}),(0,s.jsx)(y$,{agents:i,open:_,onOpenChange:I,existingChatAgentIds:t??e.map(A=>A.id),loading:u,error:m,onRetry:f,renderAgentIcon:r(A=>(0,s.jsx)(ir,{agent:A,size:32}),"renderAgentIcon"),onSelect:r(async(A,B)=>{y?await y(A,B):g?await g(A,B):N(`/chats/${encodeURIComponent(ar(A))}`),B?.aborted||T("")},"onSelect")})]})}r(w$,"AgentConversationSidebar");function k$(){const{selectedCompanyId:e}=vt(),{enabled:t,loaded:i}=yf(),l=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),c=l.data?.user?.id??l.data?.session?.userId??null;return{companyId:e,userId:c,enabled:t,loaded:i,agents:ge({queryKey:U.agents.list(e),queryFn:r(()=>$s.list(e),"queryFn"),enabled:t&&!!e}),chats:ge({queryKey:U.agentChats.list(e,c),queryFn:r(()=>LS.list(e),"queryFn"),enabled:t&&!!e&&l.isSuccess}),session:l}}r(k$,"useAgentChatNavigation");function S$(e,t){const i=wn(),l=bs(),{isMobile:c,setSidebarOpen:u}=Jn(),m=(0,x.useRef)({companyId:e,userId:t,mounted:!0});return(0,x.useEffect)(()=>{const f={companyId:e,userId:t,mounted:!0};return m.current=f,()=>{f.mounted=!1}},[e,t]),(0,x.useCallback)(async(f,h)=>{if(!e||f.companyId!==e)throw new Error("Choose an agent from this company.");const g=m.current,v=await LS.ensure(e,f.id);i.setQueryData(U.agentChats.detail(e,t,f.id),v),i.setQueryData(U.issues.detail(v.id),v),i.setQueryData(U.agentChats.list(e,t),y=>[v,...(y??[]).filter(j=>j.id!==v.id)].sort((j,k)=>new Date(k.updatedAt).getTime()-new Date(j.updatedAt).getTime()||k.id.localeCompare(j.id))),!(!g.mounted||m.current!==g||h?.aborted)&&(l(`/chats/${encodeURIComponent(ar(f))}`),c&&u(!1))},[i,e,t,l,c,u])}r(S$,"useOpenAgentChat");function N$(){const{companyId:e,userId:t,agents:i,chats:l,session:c}=k$(),u=S$(e,t),m=bs(),f=_0(e),{isMobile:h,setSidebarOpen:g}=Jn(),{pathname:v}=vn(),y=v.split("/chats/")[1]?.split("/")[0],j=i.data??[],k=i.isSuccess?[...new Set((l.data??[]).flatMap(M=>M.conversationAgentId&&!j.some(z=>z.id===M.conversationAgentId)?[M.conversationAgentId]:[]))]:[],S=t0({queries:k.map(M=>({queryKey:U.agents.detail(M),queryFn:r(()=>$s.get(M,e),"queryFn")}))}),N=new Map(j.map(M=>[M.id,M]));for(const M of S)M.data&&N.set(M.data.id,M.data);const _=[...N.values()].find(M=>M.id===y||M.status!=="terminated"&&encodeURIComponent(ar(M))===y),I=(l.data??[]).flatMap(M=>{const z=M.conversationAgentId?N.get(M.conversationAgentId):void 0;return z?[z]:[]});_&&!I.some(M=>M.id===_.id)&&I.unshift(_);const D=new Set(I.map(M=>M.id)),T=j.filter(M=>!D.has(M.id)&&M.status!=="terminated"&&(!f.isSuccess||oN(f.data,"agent",M.id)!=="left")).sort((M,z)=>M.name.localeCompare(z.name,void 0,{sensitivity:"base"})),C=Object.fromEntries((l.data??[]).filter(M=>M.conversationState==="active").map(M=>[M.conversationAgentId,"Working…"]));return(0,s.jsx)(w$,{agents:[...I,...T],availableAgents:j,existingChatAgentIds:I.map(M=>M.id),activeId:_?.id,previews:C,loading:i.isPending||l.isPending||c.isPending,error:i.error??l.error??c.error,onRetry:r(()=>{i.refetch(),l.refetch(),c.refetch()},"onRetry"),historyLoading:S.some(M=>M.isPending),historyError:S.find(M=>M.error)?.error,onRetryHistory:r(()=>{S.filter(M=>M.isError).forEach(M=>{M.refetch()})},"onRetryHistory"),onAddChat:u,onSelect:r(M=>{m(`/chats/${encodeURIComponent(M.status==="terminated"?M.id:ar(M))}`),h&&g(!1)},"onSelect")},`${e}:${t}`)}r(N$,"AgentConversationsSidebar");var ld=232,vg=208,yg=420,yw=16;function tf(e){return Math.min(yg,Math.max(vg,e))}r(tf,"clampSidebarWidth");function jw(e){if(typeof window>"u")return ld;try{const t=window.localStorage.getItem(e);if(!t)return ld;const i=Number.parseInt(t,10);return Number.isFinite(i)?tf(i):ld}catch{return ld}}r(jw,"readStoredSidebarWidth");function ww(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(tf(t)))}catch{}}r(ww,"writeStoredSidebarWidth");function C$({children:e,open:t,collapsed:i=!1,peeking:l=!1,resizable:c=!1,storageKey:u="wardmote.sidebar.width",className:m,onPanelMouseEnter:f,onPanelMouseLeave:h,onPanelFocusCapture:g,onPanelBlurCapture:v}){const[y,j]=(0,x.useState)(()=>jw(u)),[k,S]=(0,x.useState)(!1),N=(0,x.useRef)(y),_=(0,x.useRef)(null);(0,x.useEffect)(()=>{const Y=jw(u);N.current=Y,j(Y)},[u]);const I=t?y:0,D=t?i?72:I:0,T=t?i&&!l?72:I:0,C=T>D,M=c&&t&&!i,z=(0,x.useMemo)(()=>({width:`${D}px`}),[D]),K=(0,x.useMemo)(()=>({width:`${T}px`}),[T]),P=(0,x.useCallback)(Y=>{const ce=tf(Y);N.current=ce,j(ce),ww(u,ce)},[u]),A=(0,x.useCallback)(Y=>{M&&(Y.preventDefault(),Y.currentTarget.setPointerCapture(Y.pointerId),_.current={startX:Y.clientX,startWidth:N.current},S(!0))},[M]),B=(0,x.useCallback)(Y=>{if(!_.current)return;const ce=tf(_.current.startWidth+Y.clientX-_.current.startX);N.current=ce,j(ce)},[]),O=(0,x.useCallback)(()=>{_.current&&(_.current=null,S(!1),ww(u,N.current))},[u]),W=(0,x.useCallback)(Y=>{M&&(Y.key==="ArrowLeft"?(Y.preventDefault(),P(y-yw)):Y.key==="ArrowRight"?(Y.preventDefault(),P(y+yw)):Y.key==="Home"?(Y.preventDefault(),P(vg)):Y.key==="End"&&(Y.preventDefault(),P(yg)))},[M,P,y]);return(0,s.jsxs)("div",{className:X("relative h-full shrink-0",m),style:z,children:[(0,s.jsx)("div",{className:X("absolute inset-y-0 left-0 flex flex-col overflow-hidden",C?"z-30 border-r border-line bg-bg shadow-lg":"z-0"),style:K,"data-sidebar-overlay":C?"":void 0,onMouseEnter:f,onMouseLeave:h,onFocusCapture:g,onBlurCapture:v,children:e}),M?(0,s.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":vg,"aria-valuemax":yg,"aria-valuenow":y,tabIndex:0,"data-dragging":k?"":void 0,className:"group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none",style:{right:-4,width:8},onPointerDown:A,onPointerMove:B,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,onKeyDown:W,children:(0,s.jsx)("div",{className:X("mx-auto h-full w-0.5 transition-colors",k?"bg-focus":"bg-transparent group-hover:bg-focus group-focus-visible:bg-focus")})}):null]})}r(C$,"SidebarShell");function od({children:e,className:t}){return(0,s.jsx)("div",{"data-secondary-sidebar":"",className:X("h-full w-full min-w-0 overflow-hidden",t),children:(0,s.jsx)(NS,{children:e})})}r(od,"SecondarySidebar");function A$(e,t){if(!t)return!1;if(t.source==="local_implicit"||t.isInstanceAdmin)return!0;if(!e)return!1;const i=t.memberships?.find(l=>l.companyId===e&&l.status==="active");return i?.membershipRole==="owner"||i?.membershipRole==="admin"||i?.membershipRole==="operator"||i?.membershipRole==="member"}r(A$,"canInviteCompanyMembers");function _$(){const e=kE(),t=ge({queryKey:U.access.currentBoardAccess,queryFn:r(()=>Xa.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4});return A$(e?.selectedCompanyId,t.data)}r(_$,"useCanInviteCompanyMembers");function E$(e){return e?.trim().toLowerCase().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||null}r(E$,"slugifyUserPart");function I$(e){const t=[e?.id,e?.name,e?.email?.split("@")[0],e?.email];for(const i of t){const l=E$(i);if(l)return`/u/${l}`}return"/u/me"}r(I$,"userProfilePath");var Cc=null,ZC=!1,jg=!1,wg=new Set;function Ac(){for(const e of wg)e()}r(Ac,"emit");function T$(e=typeof navigator>"u"?"":navigator.userAgent,t=typeof navigator>"u"?0:navigator.maxTouchPoints){return/iPhone|iPad|iPod/i.test(e)?!0:/Macintosh/i.test(e)&&t>1}r(T$,"isIosSafariLike");function R$(e=window){const t=r(l=>{l.preventDefault(),Cc=l,Ac()},"onPrompt"),i=r(()=>{Cc=null,ZC=!0,Ac()},"onInstalled");return e.addEventListener("beforeinstallprompt",t),e.addEventListener("appinstalled",i),()=>{e.removeEventListener("beforeinstallprompt",t),e.removeEventListener("appinstalled",i)}}r(R$,"captureInstallPrompt");function D$(){return ZC||bg()?"installed":Cc?"prompt":T$()?"ios-manual":"unavailable"}r(D$,"installAvailability");async function M$(){const e=Cc;if(!e)return"unavailable";Cc=null,Ac(),await e.prompt();const{outcome:t}=await e.userChoice;return t}r(M$,"promptInstall");function kg(e){jg!==e&&(jg=e,Ac())}r(kg,"setIosInstallHelpOpen");function O$(){return jg}r(O$,"iosInstallHelpOpen");function L$(){return(0,x.useSyncExternalStore)(Z0,O$,()=>!1)}r(L$,"useIosInstallHelpOpen");function Z0(e){return wg.add(e),()=>{wg.delete(e)}}r(Z0,"subscribe$1");function JC(){return(0,x.useSyncExternalStore)(Z0,D$,()=>"unavailable")}r(JC,"useInstallAvailability");function vG(e){const t=JC();return(0,x.useSyncExternalStore)(Z0,()=>U$(t,e),()=>!1)}r(vG,"useInstallNudgeVisible");var z$=2592e6,Sg="wardmote.install.visits",kw="wardmote.install.visit-counted",eA="wardmote.install.snoozed-until";function Ng(e,t){const i=Number(e.getItem(t));return Number.isFinite(i)?i:0}r(Ng,"readNumber");function P$(e=window.localStorage,t=window.sessionStorage){try{if(t.getItem(kw))return;t.setItem(kw,"1"),e.setItem(Sg,String(Ng(e,Sg)+1))}catch{return}}r(P$,"recordAppVisit");function U$(e,t,i=Date.now(),l=window.localStorage){if(e!=="prompt"&&e!=="ios-manual"||/^\/(?:[^/]+\/)?onboarding(?:\/|$)/.test(t))return!1;try{return Ng(l,Sg)>=3&&Ng(l,eA)<=i}catch{return!1}}r(U$,"installNudgeVisible");function yG(e=Date.now(),t=window.localStorage){try{t.setItem(eA,String(e+z$))}catch{return}finally{Ac()}}r(yG,"snoozeInstallNudge");var Sw="Install app",$$="Add Wardmote to your home screen or dock.";function B$({variant:e,onAfterAction:t}){const i=JC();if(i==="installed"||i==="unavailable")return null;const l=r(()=>{i==="ios-manual"?kg(!0):M$(),t?.()},"handleClick");return e==="compact-menu-action"?(0,s.jsxs)("button",{type:"button",className:"flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",onClick:l,children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,s.jsx)(eg,{className:"size-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Sw})]}):(0,s.jsxs)("button",{type:"button",className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-bg-3/60",onClick:l,children:[(0,s.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,s.jsx)(eg,{className:"size-4"})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-ink",children:Sw}),(0,s.jsx)("span",{className:"block text-xs text-ink-3",children:$$})]})]})}r(B$,"InstallAppMenuAction");function K$(){const e=L$();return(0,s.jsx)(ya,{open:e,onOpenChange:kg,children:(0,s.jsxs)(za,{children:[(0,s.jsxs)(Jl,{children:[(0,s.jsx)(Da,{children:"Install Wardmote"}),(0,s.jsx)(eo,{children:"Add Wardmote to your Home Screen from Safari."})]}),(0,s.jsxs)("ol",{className:"space-y-3 text-sm text-ink",children:[(0,s.jsxs)(dh,{index:1,icon:(0,s.jsx)(JT,{className:"size-4"}),children:["Tap ",(0,s.jsx)("strong",{children:"Share"})," in the Safari toolbar."]}),(0,s.jsxs)(dh,{index:2,icon:(0,s.jsx)(tR,{className:"size-4"}),children:["Choose ",(0,s.jsx)("strong",{children:"Add to Home Screen"}),"."]}),(0,s.jsxs)(dh,{index:3,children:["Keep ",(0,s.jsx)("strong",{children:"Open as Web App"})," on, then tap ",(0,s.jsx)("strong",{children:"Add"}),"."]})]}),(0,s.jsx)(jf,{children:(0,s.jsx)(le,{type:"button",onClick:r(()=>kg(!1),"onClick"),children:"Done"})})]})})}r(K$,"IosInstallHelpDialog");function dh({index:e,icon:t,children:i}){return(0,s.jsxs)("li",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-line text-xs font-semibold text-ink-3",children:e}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t?(0,s.jsx)("span",{className:"text-ink-3",children:t}):null,(0,s.jsx)("span",{children:i})]})]})}r(dh,"InstallStep");function q$(e){if(!e)return"Unavailable";const t=new Date(e);return Number.isNaN(t.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(t)}r(q$,"formatTimestamp");function F$(e){return!!e&&!Number.isNaN(new Date(e).getTime())}r(F$,"isValidTimestamp");function H$(e){return e?.devServer?.lastRestartAt??e?.serverInfo?.processStartedAt??null}r(H$,"restartTimestamp");function V$(e){const t=e?.serverInfo?.git;return t?.available?`${t.shortSha} · ${t.subject}`:"Commit unavailable"}r(V$,"commitLabel");function W$(e){const t=e?.serverInfo?.git;if(!t?.available)return"Unavailable";const i=t.localChanges;if(!i||!i.available)return"Change status unavailable";if(!i.hasLocalChanges)return"Clean checkout";const l=[[i.stagedFileCount,"staged"],[i.unstagedFileCount,"unstaged"],[i.untrackedFileCount,"untracked"]].filter(([c])=>Number(c)>0).map(([c,u])=>`${c} ${u}`);return l.length>0?`Local changes present (${l.join(", ")})`:"Local changes present"}r(W$,"localChangesLabel");function fh({icon:e,label:t,value:i,dateTime:l}){return(0,s.jsxs)("div",{className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left",children:[(0,s.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,s.jsx)(e,{className:"size-4"})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-ink",children:t}),l?(0,s.jsx)("time",{dateTime:l,className:"block break-words text-xs text-ink-3",children:i}):(0,s.jsx)("span",{className:"block break-words text-xs text-ink-3",children:i})]})]})}r(fh,"ServerInfoRow");function Q$(){const e=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")}).data?.enableServerInfoDebugView===!0,t=ge({queryKey:U.health,queryFn:r(()=>Rc.get(),"queryFn"),enabled:e,refetchOnMount:"always",refetchInterval:r(v=>v.state.data?.devServer?.enabled?2e3:!1,"refetchInterval")});if(!e)return null;const i=t.data,l=t.isLoading&&!i,c=t.isError,u=H$(i),m=F$(u),f=c?"Health unavailable":l?"Loading...":q$(u),h=c?"Health unavailable":l?"Loading...":V$(i),g=c?"Health unavailable":l?"Loading...":W$(i);return(0,s.jsxs)("div",{className:"mt-2 border-t border-line pt-2",children:[(0,s.jsx)("p",{className:"px-3 pb-1 pt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"Server"}),(0,s.jsx)(fh,{icon:DT,label:"Last restarted",value:f,dateTime:!c&&!l&&m?u:null}),(0,s.jsx)(fh,{icon:UT,label:"Running commit",value:h}),(0,s.jsx)(fh,{icon:OT,label:"Checkout state",value:g})]})}r(Q$,"SidebarServerInfo");var G$="/company/settings/members?tab=invites",Y$="https://github.com/tickernelz/wardmote/tree/main/docs",X$="https://github.com/tickernelz/wardmote/issues";function Z$(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length>=2?`${t[0]?.[0]??""}${t[t.length-1]?.[0]??""}`.toUpperCase():e.slice(0,2).toUpperCase()}r(Z$,"deriveInitials");function mh({label:e,icon:t,onClick:i,href:l,external:c=!1}){const u="flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",m=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,s.jsx)(t,{className:"size-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})]});return l?c?(0,s.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",className:u,onClick:i,children:m}):(0,s.jsx)(gn,{to:l,className:u,onClick:i,children:m}):(0,s.jsx)("button",{type:"button",className:u,onClick:i,children:m})}r(mh,"MenuAction");function Nw({deploymentMode:e,open:t,onOpenChange:i,forceExpanded:l=!1}){const{hidden:c,loaded:u}=lr(),m=_$()?G$:null,f=u&&m!==null&&!Ed(c,"company.members")&&!Ed(c,"company.invites"),[h,g]=(0,x.useState)(!1),{isMobile:v,setSidebarOpen:y,collapsed:j,peeking:k}=Jn(),S=j&&!k&&!l,N=t??h,_=i??g,{data:I}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),D=K0({onSignedOut:K}),T=I?.user.name?.trim()||"Board",C=I?.user.email?.trim()||(e==="authenticated"?"Signed in":"Local workspace board"),M=Z$(T),z=I$(I?.user);function K(){_(!1),v&&y(!1)}r(K,"closeNavigationChrome");function P(){D.mutate()}return r(P,"handleSignOut"),(0,s.jsx)("div",{className:"bg-line/50 px-3 py-2 dark:bg-bg-3",children:(0,s.jsxs)("div",{className:X("flex items-center gap-0.5",!S&&"px-2"),children:[(0,s.jsxs)(va,{open:N,onOpenChange:_,children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",className:X("flex min-w-0 items-center gap-2.5 rounded-lg text-left text-(length:--text-compact) font-medium text-ink/80 transition-colors hover:bg-bg-3 hover:text-ink",S?"w-full px-3 py-2":"flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,s.jsxs)(Od,{size:"sm",children:[I?.user.image?(0,s.jsx)(Dd,{src:I.user.image,alt:T}):null,(0,s.jsx)(Md,{children:M})]}),(0,s.jsx)("span",{className:X("min-w-0 flex-1 truncate",S&&"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none"),children:T})]})}),(0,s.jsxs)(ba,{side:"top",align:"start",sideOffset:10,className:"min-h-(--profile-popover-min-height) w-(--profile-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-line bg-bg-2 p-0 shadow-(--shadow-profile-popover)",children:[(0,s.jsxs)("div",{className:"relative flex h-(--profile-popover-header-height) shrink-0 items-center gap-2.5 px-3.5",children:[(0,s.jsx)(gn,{to:z,"aria-label":"View profile",onClick:K,className:"absolute inset-0 transition-colors hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus"}),(0,s.jsxs)(Od,{className:"pointer-events-none relative size-9",children:[I?.user.image?(0,s.jsx)(Dd,{src:I.user.image,alt:T}):null,(0,s.jsx)(Md,{className:"text-xs text-ink",children:M})]}),(0,s.jsxs)("div",{className:"pointer-events-none relative min-w-0 flex-1",children:[(0,s.jsx)("h2",{className:"truncate text-sm font-semibold leading-(--profile-popover-label-line-height) text-ink",children:T}),(0,s.jsx)("p",{className:"truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-ink-3",children:C})]})]}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-0.5 border-t border-line px-2.5 pb-2.5 pt-2",children:[(0,s.jsx)(mh,{label:"Settings",icon:SS,href:"/company/settings",onClick:K}),f&&m?(0,s.jsx)(mh,{label:"Invite",icon:W1,href:m,onClick:K}):null,(0,s.jsx)(mh,{label:"Documentation",icon:ET,href:Y$,external:!0,onClick:r(()=>_(!1),"onClick")}),(0,s.jsx)(qI,{variant:"compact-menu-action",onAfterToggle:r(()=>_(!1),"onAfterToggle")}),(0,s.jsx)(B$,{variant:"compact-menu-action",onAfterAction:r(()=>_(!1),"onAfterAction")}),e==="authenticated"?(0,s.jsxs)("button",{type:"button",className:X("flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bad/10",D.isPending&&"cursor-not-allowed opacity-60"),onClick:P,disabled:D.isPending,children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,s.jsx)(wf,{className:"size-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:D.isPending?"Signing out...":"Sign out"})]}):null,(0,s.jsx)(Q$,{})]})]})]}),S?null:(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("a",{href:X$,target:"_blank",rel:"noreferrer","aria-label":"Share feedback",className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-ink-3/50 transition-colors hover:bg-bg-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,s.jsx)(c0,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,s.jsx)(Ea,{side:"top",children:"Share feedback"})]})]})})}r(Nw,"SidebarAccountMenu");var J$=["input","textarea","select","[contenteditable='true']","[contenteditable='plaintext-only']","[role='textbox']","[role='combobox']"].join(", "),eB="[data-page-search-target='true']",tB=new Set(["Shift","Meta","Control","Alt"]);function ao(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(J$):!1}r(ao,"isKeyboardShortcutTextInputTarget");function Cg(e=document){return!!e.querySelector("[role='dialog'][aria-modal='true']")}r(Cg,"hasBlockingShortcutDialog");function nB(e){if(!e.isConnected||"disabled"in e&&typeof e.disabled=="boolean"&&e.disabled||e.closest("[hidden], [aria-hidden='true'], [inert]")||e.closest("[role='dialog'][aria-modal='true']"))return!1;const t=window.getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"?!1:e.getClientRects().length>0||e===document.activeElement}r(nB,"isVisibleShortcutTarget");function sB(e=document){return Array.from(e.querySelectorAll(eB)).find(t=>nB(t))??null}r(sB,"findPageSearchShortcutTarget");function aB(e=document){const t=sB(e);return t?(t.focus(),(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select(),!0):!1}r(aB,"focusPageSearchShortcutTarget");function iB({key:e,isComposing:t}){return e==="Enter"&&!t}r(iB,"shouldBlurPageSearchOnEnter");function rB({key:e,isComposing:t,currentValue:i}){return e==="Escape"&&!t&&i.length===0}r(rB,"shouldBlurPageSearchOnEscape");function Pf(e){return tB.has(e)}r(Pf,"isModifierOnlyKey");function jG({defaultPrevented:e,key:t,metaKey:i,ctrlKey:l,altKey:c,target:u,hasOpenDialog:m,hasSelection:f}){if(e||i||l||c||Pf(t)||m||ao(u))return"ignore";switch(t){case"j":case"ArrowDown":return"next";case"k":case"ArrowUp":return"previous";case"Enter":return f?"toggle":"ignore";case"x":return f?"dismiss":"ignore";default:return"ignore"}}r(jG,"resolveAttentionQueueKeyAction");function wG({armed:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:u,target:m,hasOpenDialog:f}){return!e||t||l||c||u||Pf(i)||f||ao(m)?"ignore":i.toLowerCase()==="y"?"archive":"ignore"}r(wG,"resolveInboxQuickArchiveKeyAction");function kG({hasUndoableArchive:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:u,target:m,hasOpenDialog:f}){return!e||t||l||c||u||Pf(i)||f||ao(m)?"ignore":i==="u"?"undo_archive":"ignore"}r(kG,"resolveInboxUndoArchiveKeyAction");function lB({armed:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:u,target:m,hasOpenDialog:f}){if(t)return e?"disarm":"ignore";if(l||c||u||Pf(i))return"ignore";if(f||ao(m))return e?"disarm":"ignore";const h=i.toLowerCase();return e?h==="i"?"navigate_inbox":h==="c"?"focus_comment":h==="f"?"open_file_viewer":h==="g"?"arm":"disarm":h==="g"?"arm":"ignore"}r(lB,"resolveIssueDetailGoKeyAction");function oB({onNewIssue:e,onSearch:t,onToggleSidebar:i,onTogglePanel:l,onShowShortcuts:c,onGoToInbox:u}){(0,x.useEffect)(()=>{let m=!1,f=null;const h=r(()=>{f!==null&&(window.clearTimeout(f),f=null)},"clearGoChordTimeout"),g=r(()=>{m=!1,h()},"disarmGoChord"),v=r(()=>{m=!0,h(),f=window.setTimeout(()=>{m=!1,f=null},1200)},"armGoChord");function y(S){if(S.defaultPrevented){g();return}if(u){const N=lB({armed:m,defaultPrevented:S.defaultPrevented,key:S.key,metaKey:S.metaKey,ctrlKey:S.ctrlKey,altKey:S.altKey,target:S.target,hasOpenDialog:Cg()});if(N==="arm"){v();return}if(N==="navigate_inbox"){g(),S.preventDefault(),u();return}if(N==="focus_comment"||N==="open_file_viewer"){g(),S.preventDefault();return}N==="disarm"&&g()}if(!ao(S.target)&&!Cg()){if(S.key==="/"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),aB()||t?.();return}if(S.key==="?"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),c?.();return}S.key==="c"&&!S.metaKey&&!S.ctrlKey&&!S.altKey&&(S.preventDefault(),e?.()),S.key==="["&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),i?.()),S.key==="]"&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),l?.())}}r(y,"handleKeyDown");const j=r(()=>g(),"handlePointerDown"),k=r(S=>{S.target instanceof HTMLElement&&S.target!==document.body&&g()},"handleFocusIn");return document.addEventListener("pointerdown",j,!0),document.addEventListener("focusin",k,!0),document.addEventListener("keydown",y),()=>{g(),document.removeEventListener("pointerdown",j,!0),document.removeEventListener("focusin",k,!0),document.removeEventListener("keydown",y)}},[e,t,i,l,c,u])}r(oB,"useKeyboardShortcuts");var cB=new Set(["auth","invite","board-claim","cli-auth","docs","s"]);function tA(e){const t=(e.split("?")[0]??"").split("/").filter(Boolean);if(t.length===0)return!0;const[i]=t;return!cB.has(i)}r(tA,"isRememberableCompanyPath");function uB(e){const t=Rd(e.companyPrefix);return e.companies.find(i=>Rd(i.issuePrefix)===t)??null}r(uB,"findCompanyByPrefix");function dB(e){const t=Gk(e.pathname);return t?uB({companies:e.companies,companyPrefix:t})?.id??null:e.fallbackCompanyId}r(dB,"getRememberedPathOwnerCompanyId");function fB(e){const t=e.path?pf(e.path):"/dashboard";if(!tA(t))return"/dashboard";const[i,l]=(t.split("?")[0]??"").split("/").filter(Boolean);if(i==="issues"&&l){const c=/^([A-Za-z]+)-\d+$/.exec(l);if(c&&Rd(c[1]??"")!==Rd(e.companyPrefix))return"/dashboard"}return t}r(fB,"sanitizeRememberedPathForCompany");var nA="wardmote.companyPaths";function sA(){try{const e=localStorage.getItem(nA);if(e)return JSON.parse(e)}catch{}return{}}r(sA,"getCompanyPaths");function mB(e,t){const i=sA();i[e]=t,localStorage.setItem(nA,JSON.stringify(i))}r(mB,"saveCompanyPath");function pB(){const{companies:e,selectedCompanyId:t,selectedCompany:i,selectionSource:l}=vt(),c=vn(),u=bs(),m=(0,x.useRef)(t),f=(0,x.useMemo)(()=>dB({companies:e,pathname:c.pathname,fallbackCompanyId:m.current}),[e,c.pathname]),h=c.pathname+c.search;(0,x.useEffect)(()=>{const g=f,v=pf(h);g&&tA(v)&&mB(g,v)},[h,f]),(0,x.useEffect)(()=>{if(t){if(m.current!==null&&t!==m.current&&l!=="route_sync"&&i){const g=sA(),v=fB({path:g[t],companyPrefix:i.issuePrefix});u(`/${i.issuePrefix}${v}`,{replace:!0})}m.current=t}},[i,t,l,u])}r(pB,"useCompanyPageMemory");var hB=class{static{r(this,"MobileNavScrollTracker")}options;lastTop;lastMaxTop;visible=!0;direction=0;distance=0;constructor(e,t,i){this.options=e,this.lastTop=t,this.lastMaxTop=i}update(e,t){const i=Math.max(0,Math.min(e,t)),l=i-Math.max(this.lastTop,this.options.topZone),c=t!==this.lastMaxTop;if(this.lastTop=i,this.lastMaxTop=t,i<=this.options.topZone)this.visible=!0,this.direction=0,this.distance=0;else if(c)this.direction=0,this.distance=0;else if(l!==0){const u=Math.sign(l);u!==this.direction&&(this.distance=0),this.direction=u,this.distance+=Math.abs(l);const m=u>0?this.options.hideDistance:this.options.showDistance;this.distance>=m&&(this.visible=u<0,this.distance=0)}return this.visible}};function gB(e,t){const[i,l]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{if(l(!0),!e)return;const c=getComputedStyle(document.documentElement),u=r(y=>Number.parseFloat(c.getPropertyValue(y))||0,"distance"),m=r(()=>{const y=document.scrollingElement??document.documentElement;return{top:window.scrollY||y.scrollTop||0,max:Math.max(0,y.scrollHeight-y.clientHeight)}},"scrollBounds"),f=m(),h=new hB({topZone:u("--mobile-nav-scroll-top-zone"),hideDistance:u("--mobile-nav-scroll-hide-distance"),showDistance:u("--mobile-nav-scroll-show-distance")},f.top,f.max);let g=null;const v=r(()=>{g===null&&(g=requestAnimationFrame(()=>{g=null;const{top:y,max:j}=m(),k=h.visible,S=h.update(y,j);S!==k&&l(S)}))},"onScroll");return window.addEventListener("scroll",v,{passive:!0}),()=>{window.removeEventListener("scroll",v),g!==null&&cancelAnimationFrame(g)}},[e,t]),i}r(gB,"useMobileNavVisibility");function xB(e){const{matchedCompany:t,selectedCompanyId:i,companies:l}=e;return!t||t.status!=="archived"||i===t.id?null:l.find(c=>c.id===i&&c.status!=="archived")??l.find(c=>c.status!=="archived")??null}r(xB,"resolveArchivedCompanyBounce");function SG(e){const{archivedCompanyId:t,companies:i}=e,l=i.find(c=>c.id!==t&&c.status!=="archived");return l?{kind:"company",company:l}:{kind:"companies_list"}}r(SG,"resolveCompanyArchiveDeparture");function bB(e){const{selectionSource:t,selectedCompanyId:i,routeCompanyId:l}=e;return!(i===l||t==="manual"&&i)}r(bB,"shouldSyncCompanySelectionFromRoute");function vB(e,t){return e instanceof HTMLElement?!(t instanceof HTMLElement)||!document.contains(t)||t===document.body||t===document.documentElement?!0:!e.contains(t):!1}r(vB,"shouldFocusMainContentAfterNavigation");function yB(e){if(!(e instanceof HTMLElement))return()=>{};const t=window.requestAnimationFrame(()=>{vB(e,document.activeElement)&&e.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(t)}r(yB,"scheduleMainContentFocus");function jB(e=document,t=window){const i=r(()=>{e.documentElement.scrollTop!==0&&(e.documentElement.scrollTop=0),e.body.scrollTop!==0&&(e.body.scrollTop=0)},"onScroll");return t.addEventListener("scroll",i,{capture:!0}),()=>t.removeEventListener("scroll",i,{capture:!0})}r(jB,"pinDocumentScrollToZero");var wB=z_({NotFoundPage:r(()=>sr,"NotFoundPage")});function sr({scope:e="global",requestedPrefix:t}){const i=vn(),{setBreadcrumbs:l}=IS(),{companies:c,selectedCompany:u}=vt();(0,x.useEffect)(()=>{l([{label:"Not Found"}])},[l]);const m=u??c[0]??null,f=m?`/${m.issuePrefix}/dashboard`:"/",h=`${i.pathname}${i.search}${i.hash}`,g=t?.toUpperCase(),v=e==="invalid_company_prefix"?"Organization not found":"Page not found",y=e==="invalid_company_prefix"?`No organization matches prefix "${g??"unknown"}".`:"This route does not exist.";return(0,s.jsx)("div",{className:"mx-auto max-w-2xl py-10",children:(0,s.jsxs)(Dc,{className:"block p-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"rounded-md border border-bad/20 bg-bad/10 p-2",children:(0,s.jsx)(Ja,{className:"h-5 w-5 text-bad"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:v}),(0,s.jsx)("p",{className:"text-sm text-ink-3",children:y})]})]}),(0,s.jsxs)("div",{className:"mt-4 rounded-md border border-line bg-bg-3/20 px-3 py-2 text-xs text-ink-3",children:["Requested path: ",(0,s.jsx)("code",{className:"font-mono",children:h})]}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap gap-2",children:[(0,s.jsx)(le,{asChild:!0,children:(0,s.jsxs)(gn,{to:f,children:[(0,s.jsx)(Wk,{className:"mr-1.5 h-4 w-4"}),"Open dashboard"]})}),(0,s.jsx)(le,{variant:"secondary",asChild:!0,children:(0,s.jsx)(gn,{to:"/",children:"Go home"})})]})]})})}r(sr,"NotFoundPage$1");function kB(e,t){return yC(e,t)[0]?.toLowerCase()??null}r(kB,"getCompanyRouteSegment");var SB=new Set(["browse","connections","assistant-connection","connect","chat","vercel-connect","review","attention","gateways","advanced","app"]);function NB(e){const t=(0,x.useRef)(null);return(0,x.useLayoutEffect)(()=>{const i=t.current,l=i?.parentElement;if(!e||!i||!l)return;const c=r(()=>l.style.setProperty("--mobile-topbar-h",`${i.offsetHeight}px`),"apply");if(c(),typeof ResizeObserver>"u")return()=>l.style.removeProperty("--mobile-topbar-h");const u=new ResizeObserver(c);return u.observe(i),()=>{u.disconnect(),l.style.removeProperty("--mobile-topbar-h")}},[e]),t}r(NB,"useMobileTopbarHeightVar");function CB({sidebarSections:e}){const{sidebarOpen:t,setSidebarOpen:i,toggleSidebar:l,collapsed:c,peeking:u,setPeeking:m,isMobile:f,isTablet:h}=Jn(),g=NB(f),{openNewIssue:v,openOnboarding:y}=Pa(),{togglePanelVisible:j}=q0(),k=bf()?.pushToast??null,{companies:S,loading:N,selectedCompany:_,selectedCompanyId:I,selectionSource:D,setSelectedCompanyId:T}=vt(),{companyPrefix:C,pluginRoutePath:M,agentId:z,routineId:K}=La(),P=bs(),A=vn(),B=nE(),O=c4(A.pathname,C),W=O.builtInContextualSurface==="settings",Y=O.companySegments,ce=O.isTaskDetail,{enabled:oe}=yf(),$=oe&&Y[0]?.toLowerCase()==="chats",R=ce||$,ne=Y[0]?.toLowerCase()==="tools",ue=Y[0]?.toLowerCase()==="apps",ae=ue&&Y[1]&&!SB.has(Y[1].toLowerCase())?Y[1]:null,Ee=ue&&Y[1]?.toLowerCase()==="app"&&Y[2]?Y[2]:null,fe=(0,x.useRef)(!1),Ae=(0,x.useRef)(null),Ce=(0,x.useRef)(null),Se=(0,x.useRef)(new l3),he=(0,x.useRef)(A.key),De=gB(f&&!ce,A.pathname),[Ye,ze]=(0,x.useState)(!1),ve=(0,x.useMemo)(()=>{if(!C)return null;const Re=C.toUpperCase();return S.find(Me=>Me.issuePrefix.toUpperCase()===Re)??null},[S,C]),ft=!!C&&!N&&S.length>0&&!ve,At=(0,x.useMemo)(()=>M?.toLowerCase()??kB(A.pathname,C),[C,A.pathname,M]),xt=ve?.id??null,Pt=ve?.issuePrefix??null,{slots:de}=Tc({slotTypes:["page","routeSidebar"],companyId:xt,enabled:!!(xt&&At)}),Oe=(0,x.useMemo)(()=>I3(de,At),[At,de]),qe=(0,x.useMemo)(()=>({companyId:xt,companyPrefix:Pt}),[xt,Pt]),ut=W?(0,s.jsx)(m4,{}):ae?(0,s.jsx)($j,{kind:"connection",connectionId:ae}):Ee?(0,s.jsx)($j,{kind:"application",applicationId:Ee}):ue||ne?(0,s.jsx)(A4,{}):Oe?(0,s.jsx)(Uc,{surface:`plugin:${Oe.id}`,title:Oe.displayName,children:(0,s.jsx)(x0,{slot:Oe,context:qe,className:"min-h-0 flex-1",missingBehavior:"placeholder"})}):null,Vt=$?(0,s.jsx)(N$,{}):O.builtInContextualSurface==="agent"&&z?(0,s.jsx)(L4,{agentRef:z}):O.builtInContextualSurface==="routine"&&K?(0,s.jsx)(e3,{children:(0,s.jsx)($4,{routineId:K})}):O.builtInContextualSurface==="skills"?(0,s.jsx)(q4,{}):ut,Wt=Vt!=null,H=Wt&&($||O.builtInContextualSurface==="skills"||O.builtInContextualSurface==="agent"||O.builtInContextualSurface==="routine"||ue||ne),rn=W&&(f||h),je=Wt&&!H&&!(h&&W),$e=H,He=Wt?Oe&&!O.builtInContextualSurface?`plugin:${Oe.id}`:O.builtInContextualSurface:null,mt=(0,x.useRef)(null),{data:it}=ge({queryKey:U.health,queryFn:r(()=>Rc.get(),"queryFn"),retry:!1,refetchInterval:r(Re=>Re.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,x.useEffect)(()=>{const Re=mt.current;He&&C&&Re&&Re.surface!==He&&Re.pathname!==A.pathname&&u4({surface:He,companyPrefix:C,previousPathname:Re.pathname}),mt.current={pathname:A.pathname,surface:He}},[C,He,A.pathname]),(0,x.useEffect)(()=>{N||fe.current||it?.deploymentMode!=="authenticated"&&S.length===0&&(fe.current=!0,y())},[S,N,y,it?.deploymentMode]),(0,x.useEffect)(()=>{if(!C||N||S.length===0)return;if(!ve){const Me=(I?S.find(Fe=>Fe.id===I):null)??S[0]??null;Me&&I!==Me.id&&T(Me.id,{source:"route_sync"});return}if(C!==ve.issuePrefix){const Me=A.pathname.replace(/^\/[^/]+/,"");P(`/${ve.issuePrefix}${Me}${A.search}`,{replace:!0});return}const Re=xB({matchedCompany:ve,selectedCompanyId:I,companies:S});if(Re){k?.({title:`${ve.name} is archived`,body:`Switched to ${Re.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${ve.id}`}),T(Re.id,{source:"route_sync"}),P(`/${Re.issuePrefix}/dashboard`,{replace:!0});return}bB({selectionSource:D,selectedCompanyId:I,routeCompanyId:ve.id})&&T(ve.id,{source:"route_sync"})},[C,S,N,ve,A.pathname,A.search,P,k,D,I,T]);const Qt=j,Rn=(0,x.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]),Gt=(0,x.useRef)(null),Tt=(0,x.useRef)(!1),Jt=(0,x.useRef)(!1),kt=(0,x.useCallback)(()=>{Gt.current!==null&&(window.clearTimeout(Gt.current),Gt.current=null)},[]),Qn=(0,x.useCallback)(()=>{kt(),Gt.current=window.setTimeout(()=>m(!0),50)},[kt,m]),pt=(0,x.useCallback)(()=>{kt(),m(!0)},[kt,m]),dn=(0,x.useCallback)(()=>{kt(),Gt.current=window.setTimeout(()=>m(!1),120)},[kt,m]),Rt=(0,x.useCallback)(()=>{Tt.current=!0,c&&!Jt.current&&Qn()},[c,Qn]),ln=(0,x.useCallback)(()=>{Tt.current=!1,Jt.current=!1,dn()},[dn]),Dt=(0,x.useCallback)(()=>{Jt.current||pt()},[pt]),ht=(0,x.useCallback)(()=>{Tt.current||dn()},[dn]);(0,x.useEffect)(()=>kt,[kt]);const Mt=(0,x.useRef)(c);return(0,x.useEffect)(()=>{c!==Mt.current&&(c?(kt(),m(!1),Jt.current=Tt.current):Jt.current=!1,Mt.current=c)},[c,kt,m]),(0,x.useEffect)(()=>{if(!u)return;const Re=r(Me=>{Me.key==="Escape"&&(kt(),m(!1))},"onKeyDown");return window.addEventListener("keydown",Re),()=>window.removeEventListener("keydown",Re)},[u,kt,m]),pB(),oB({onNewIssue:r(()=>v(),"onNewIssue"),onSearch:Rn,onToggleSidebar:l,onTogglePanel:Qt,onShowShortcuts:r(()=>ze(!0),"onShowShortcuts"),onGoToInbox:r(()=>P("/inbox"),"onGoToInbox")}),(0,x.useEffect)(()=>{if(!f)return;const Re=30,Me=50,Fe=75;let St=0,at=0;const Ot=r(Ut=>{const en=Ut.touches[0];St=en.clientX,at=en.clientY},"onTouchStart"),on=r(Ut=>{const en=Ut.changedTouches[0],tn=en.clientX-St;if(!(Math.abs(en.clientY-at)>Fe)){if(!t&&St<Re&&tn>Me){i(!0);return}t&&tn<-50&&i(!1)}},"onTouchEnd");return document.addEventListener("touchstart",Ot,{passive:!0}),document.addEventListener("touchend",on,{passive:!0}),()=>{document.removeEventListener("touchstart",Ot),document.removeEventListener("touchend",on)}},[f,t,i]),(0,x.useEffect)(()=>{const Re=document.body.style.overflow;return document.body.style.overflow=f?"visible":"clip",()=>{document.body.style.overflow=Re}},[f]),(0,x.useEffect)(()=>{if(!f)return jB()},[f]),(0,x.useEffect)(()=>{if(typeof document>"u")return;const Re=Ce.current;return yB(Re)},[A.pathname]),(0,x.useEffect)(()=>{const Re=Ce.current;if(!Re)return;const Me=r(()=>{Se.current.remember(he.current,Re.scrollTop)},"recordScroll");return Re.addEventListener("scroll",Me,{passive:!0}),()=>Re.removeEventListener("scroll",Me)},[]),(0,x.useLayoutEffect)(()=>{const Re=Ce.current,Me=r3({previousPathname:Ae.current,pathname:A.pathname,navigationType:B,state:A.state});Ae.current=A.pathname;const Fe=B==="POP",St=Fe?Se.current.recall(A.key):0;if(he.current=A.key,Fe){Ey(Re,St);const at=requestAnimationFrame(()=>Ey(Re,St));return()=>cancelAnimationFrame(at)}Me&&c3(Re)},[A.key,A.pathname,A.state,B]),(0,s.jsx)(JI,{children:(0,s.jsxs)("div",{"data-app-shell":"",className:X("bg-bg text-ink pt-(--sz-safe-top)",f?"min-h-dvh overflow-x-clip":"flex h-dvh flex-col overflow-clip"),children:[(0,s.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-bg focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:"Skip to Main Content"}),(0,s.jsx)(u$,{}),(0,s.jsx)(UU,{}),(0,s.jsx)(qU,{devServer:it?.devServer}),(0,s.jsx)(HU,{diskSpace:it?.diskSpace,warnings:it?.warnings}),(0,s.jsx)(ZU,{}),(0,s.jsx)(a$,{}),(0,s.jsxs)("div",{className:X("min-h-0 flex-1",f?"w-full":"flex overflow-clip"),children:[f&&t&&(0,s.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/50",onClick:r(()=>i(!1),"onClick"),"aria-label":"Close sidebar"}),f?(0,s.jsxs)("div",{className:X("fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",t?"translate-x-0":"-translate-x-full"),children:[(0,s.jsx)("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:(0,s.jsx)("div",{className:"w-60 shrink-0 overflow-hidden",children:Wt?(0,s.jsx)(od,{children:Vt}):(0,s.jsx)(Pj,{children:e})})}),(0,s.jsx)(Nw,{deploymentMode:it?.deploymentMode,forceExpanded:je})]}):(0,s.jsxs)(C$,{open:t,collapsed:je?!1:c,peeking:je?!1:u,resizable:!0,onPanelMouseEnter:je?void 0:Rt,onPanelMouseLeave:je?void 0:ln,onPanelFocusCapture:!je&&c?Dt:void 0,onPanelBlurCapture:!je&&c?ht:void 0,children:[(0,s.jsx)("div",{className:"flex flex-1 min-h-0",children:je?(0,s.jsx)(od,{children:Vt}):(0,s.jsx)(Pj,{children:e})}),(0,s.jsx)(Nw,{deploymentMode:it?.deploymentMode,forceExpanded:je})]}),!f&&$e&&!H?(0,s.jsx)(od,{className:"w-60 shrink-0",children:Vt}):null,(0,s.jsxs)("div",{className:X("flex min-w-0 flex-col",f?"w-full":"h-full flex-1"),children:[(0,s.jsxs)("div",{ref:g,"data-slot":f?"mobile-topbar":void 0,className:X(!f&&R&&"hidden",f&&"sticky top-0 z-20 bg-bg/95 backdrop-blur supports-[backdrop-filter]:bg-bg/85"),children:[(0,s.jsx)(bw,{mobile:f,onNavigateHome:r(()=>P("/dashboard"),"onNavigateHome")}),(0,s.jsx)(qj,{}),rn?(0,s.jsx)("div",{className:"border-b border-line px-4 pb-3",children:(0,s.jsx)(b4,{})}):null]}),(0,s.jsxs)("div",{className:X(f?"block":"relative flex flex-1 min-h-0",!f&&R&&"streamlined-task-detail-surface"),children:[!f&&H?(0,s.jsx)(od,{className:"w-60 shrink-0 bg-bg",children:Vt}):null,(0,s.jsxs)("div",{className:X(!f&&R?"flex min-w-0 flex-1 flex-col":"contents"),children:[!f&&R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(bw,{mobile:!1,onNavigateHome:r(()=>P("/dashboard"),"onNavigateHome")}),(0,s.jsx)(qj,{taskDetailLayout:!0})]}):null,(0,s.jsx)("main",{id:"main-content",ref:Ce,tabIndex:-1,style:f?{"--tc-composer-bottom":"var(--sz-calc-14)"}:void 0,className:X("flex-1 p-4 outline-none md:p-6",!f&&R&&"pt-0 md:pt-0",f?"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:ft?(0,s.jsx)(sr,{scope:"invalid_company_prefix",requestedPrefix:C??_?.issuePrefix}):(0,s.jsx)(v$,{children:(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:(0,s.jsx)(Zl,{})})})})]}),(0,s.jsx)(oz,{taskDetailLayout:!f&&R})]})]})]}),f&&(0,s.jsx)(OU,{visible:De}),(0,s.jsx)(Zz,{}),(0,s.jsx)(ZP,{}),(0,s.jsx)(eU,{}),(0,s.jsx)(aU,{}),(0,s.jsx)(pU,{}),(0,s.jsx)(bU,{open:Ye,onOpenChange:ze}),(0,s.jsx)(wU,{}),(0,s.jsx)(EU,{health:it}),(0,s.jsx)(MU,{localTrusted:it?.deploymentMode==="local_trusted"})]})})}r(CB,"Layout");var Cw=null;function AB(){return Cw??=new mf,Cw}r(AB,"getDetachedClient");function _B(){const e=(0,x.useContext)(Jg),{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn"),enabled:e!=null},e??AB());return e?{enabled:t?.enableConferenceRoomChat===!0,loaded:i}:{enabled:!1,loaded:!0}}r(_B,"useConferenceRoomChatEnabled");function EB(){const{enabled:e,loaded:t}=_B();return t?e?(0,s.jsx)(Zl,{}):(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):null}r(EB,"ConferenceRoomChatGate");function Gi({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enablePipelines!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(Gi,"PipelinesExperimentalGate");function Aw({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enableCases!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(Aw,"CasesExperimentalGate");function _w({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enableStatusCards!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(_w,"StatusCardsExperimentalGate");function IB({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enablePixelsOffice!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(IB,"PixelsOfficeExperimentalGate");function Aa({pageKey:e}){const{hidden:t,loaded:i}=lr();return i?t.has(e)?(0,s.jsx)(Qe,{to:"/company/settings",replace:!0}):(0,s.jsx)(Zl,{}):null}r(Aa,"HiddenSettingsPageGate");function ph(){const{data:e,isFetched:t}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return t?e?.enableIsolatedWorkspaces!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(Zl,{}):null}r(ph,"IsolatedWorkspacesRouteGate");function Il(){const e=vn(),{workspaceId:t}=La(),{companies:i,loading:l}=vt(),c=ge({queryKey:U.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Lf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t)return(0,s.jsx)(sr,{scope:"global"});if(l||c.isPending)return(0,s.jsx)(Ra,{});if(c.isError)return(0,s.jsx)(sr,{scope:"global"});const u=i.find(m=>m.id===c.data.companyId);return u?(0,s.jsx)(Qe,{to:`/${u.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):(0,s.jsx)(sr,{scope:"global"})}r(Il,"UnprefixedExecutionWorkspaceRedirect");function TB(){const{companyPrefix:e,workspaceId:t}=La(),{companies:i,loading:l}=vt(),c=ge({queryKey:U.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Lf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t||!e)return(0,s.jsx)(sr,{scope:"global"});if(l||c.isPending)return(0,s.jsx)(Ra,{});if(c.isError)return(0,s.jsx)(sr,{scope:"global"});const u=i.find(m=>m.issuePrefix.toUpperCase()===e.toUpperCase());return!u||u.id!==c.data.companyId?(0,s.jsx)(sr,{scope:"global"}):(0,s.jsx)(Zl,{})}r(TB,"ExecutionWorkspaceCompanyGate");var xs={status:r((e={})=>{const t=new URLSearchParams;e.command&&t.set("command",e.command),e.network&&t.set("network","1");const i=t.toString();return we.get(`/onboarding/omp${i?`?${i}`:""}`)},"status"),browse:r(e=>we.get(`/onboarding/omp/browse${e?`?path=${encodeURIComponent(e)}`:""}`),"browse"),loginProviders:r((e=!1)=>we.get(`/onboarding/omp/login/providers${e?"?refresh=1":""}`),"loginProviders"),startLogin:r(e=>we.post("/onboarding/omp/login",{provider:e}),"startLogin"),login:r(e=>we.get(`/onboarding/omp/login/${encodeURIComponent(e)}`),"login"),answerLogin:r((e,t)=>we.post(`/onboarding/omp/login/${encodeURIComponent(e)}/input`,{value:t}),"answerLogin"),cancelLogin:r(e=>we.delete(`/onboarding/omp/login/${encodeURIComponent(e)}`),"cancelLogin"),customProviders:r(()=>we.get("/onboarding/omp/custom-providers"),"customProviders"),saveCustomProvider:r((e,t)=>we.put(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`,t),"saveCustomProvider"),removeCustomProvider:r(e=>we.delete(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`),"removeCustomProvider"),fetchCustomProviderModels:r(e=>we.post("/onboarding/omp/custom-providers/models",e),"fetchCustomProviderModels"),probeCustomProvider:r(e=>we.post("/onboarding/omp/custom-providers/probe",e),"probeCustomProvider"),remote:r(e=>we.post("/onboarding/omp/remote",{address:e}),"remote")};function RB(e){return{heartbeat:{enabled:e?.heartbeatEnabled??ky.heartbeatEnabled,intervalSec:e?.intervalSec??ky.intervalSec,wakeOnDemand:!0,skipTimerWhenNoActionableWork:!0,cooldownSec:10,maxConcurrentRuns:20}}}r(RB,"buildNewAgentRuntimeConfig");function DB({className:e,...t}){return(0,s.jsx)("div",{role:"group","data-slot":"segmented",className:X("inline-flex items-center gap-0.5 rounded-md border border-line-strong bg-bg-2 p-0.5",e),...t})}r(DB,"Segmented");function MB({selected:e=!1,className:t,type:i="button",...l}){return(0,s.jsx)("button",{type:i,"data-slot":"segmented-item","aria-pressed":e,className:X("inline-flex h-7 items-center justify-center gap-1.5 whitespace-nowrap rounded-sm px-2.5 text-(length:--t-13) font-medium text-ink-2 transition-(--tp-color-background-color-border-color-box-shadow-opacity) outline-hidden hover:bg-bg-3 hover:text-ink focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:pointer-events-none disabled:text-ink-3 aria-pressed:bg-ink aria-pressed:text-bg-2 aria-pressed:hover:bg-ink aria-pressed:hover:text-bg-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}r(MB,"SegmentedItem");var OB="input:not([type=hidden]):not(:disabled), select:not(:disabled), textarea:not(:disabled)",LB="Discard your unsaved changes?",zB=2/3;function PB(e,t){const[i,l]=(0,x.useState)(null),c=(0,x.useRef)(!1),u=(0,x.useRef)(new Map),m=(0,x.useRef)(e);m.current=e;const f=(0,x.useRef)(i);f.current=i;const h=(0,x.useId)(),g=i===null?null:e(i),v=(0,x.useCallback)(D=>`${h}-row-editor-${D.replace(/\s+/g,"_")}`,[h]),y=r(()=>!c.current||window.confirm(LB),"mayDiscard"),j=(0,x.useCallback)((D=!0)=>{const T=f.current;if(c.current=!1,l(null),T===null||!D)return;const C=m.current(T);requestAnimationFrame(()=>{const M=u.current.get(C);(M?.isConnected?M:t?.current)?.focus()})},[t]),k=r(D=>g===e(D)?!0:g!==null&&!y()?!1:(c.current=!1,l(D),!0),"request"),S=r(D=>{if(g!==e(D)){k(D);return}y()&&j()},"toggle"),N=r(()=>{y()&&j()},"dismiss"),_=(0,x.useCallback)(D=>{c.current=D},[]);return{open:i,openKey:g,request:k,toggle:S,close:j,dismiss:N,setDirty:_,triggerProps:r(D=>({ref:r(T=>{T?u.current.set(D,T):u.current.delete(D)},"ref"),"aria-expanded":g===D,"aria-controls":g===D?v(D):void 0}),"triggerProps"),panelId:v}}r(PB,"useInlineRowEditor");function Ew({id:e,onEscape:t,className:i,children:l}){const c=(0,x.useRef)(null);(0,x.useEffect)(()=>{const m=c.current;if(!m)return;m.querySelector(OB)?.focus({preventScroll:!0});const f=m.getBoundingClientRect().top;if(f>=0&&f<=window.innerHeight*zB)return;const h=m.parentElement?.tagName==="LI"?m.previousElementSibling:null;h?h.scrollIntoView?.({block:"center"}):m.scrollIntoView?.({block:"start"})},[]);const u=r(m=>{m.key!=="Escape"||m.defaultPrevented||(m.preventDefault(),m.stopPropagation(),t())},"onKeyDown");return(0,s.jsx)("div",{ref:c,id:e,className:X("scroll-mt-16",i),onKeyDown:u,children:l})}r(Ew,"InlineRowEditorPanel");var UB=2e3,Iw=["omp","login-providers"];function hh(e){return e instanceof Error?e.message:"Something went wrong"}r(hh,"errorText");function Cs({tone:e,children:t}){return(0,s.jsx)("div",{role:e==="bad"?"alert":"status",className:X("rounded-md border px-3 py-2 text-sm",e==="bad"?"border-bad text-ink":e==="ok"?"border-ok text-ink":"border-line text-ink-2"),children:t})}r(Cs,"OmpNote");function $B({onSignedIn:e,autoFocus:t=!1}){const i=wn(),l=ge({queryKey:Iw,queryFn:r(()=>xs.loginProviders(),"queryFn"),staleTime:6e5}),[c,u]=(0,x.useState)(""),[m,f]=(0,x.useState)(null),[h,g]=(0,x.useState)(""),v=c||l.data?.providers[0]||"",y=Kt({mutationFn:r(C=>xs.startLogin(C.name),"mutationFn"),onSuccess:r((C,{popup:M})=>{g(""),f(C),M&&C.url&&C.state==="waiting"?M.location.href=C.url:M?.close()},"onSuccess"),onError:r((C,{popup:M})=>M?.close(),"onError")}),j=Kt({mutationFn:r(C=>xs.answerLogin(m.id,C),"mutationFn"),onSuccess:r(C=>{g(""),f(C)},"onSuccess")}),k=Kt({mutationFn:r(C=>xs.cancelLogin(C),"mutationFn"),onSettled:r(()=>f(null),"onSettled")}),S=m?.state==="waiting",N=ge({queryKey:["omp","login",m?.id??""],queryFn:r(()=>xs.login(m.id),"queryFn"),enabled:S,refetchInterval:UB});(0,x.useEffect)(()=>{N.data&&N.data.id===m?.id&&f(N.data)},[N.data,m?.id]);const _=(0,x.useRef)(null),I=(0,x.useRef)(e);I.current=e;const D=m?.state==="succeeded"?m.id:null;(0,x.useEffect)(()=>{!D||_.current===D||(_.current=D,i.invalidateQueries({queryKey:["agents"]}),I.current?.())},[D,i]);function T(C){C.preventDefault(),h.trim()&&j.mutate(h.trim())}return r(T,"submitAnswer"),l.isLoading?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Asking OMP which providers it can sign in to..."}):l.error?(0,s.jsxs)(Cs,{tone:"bad",children:[hh(l.error)," ",(0,s.jsx)(le,{type:"button",variant:"link",size:"xs",onClick:r(()=>{l.refetch()},"onClick"),children:"Try again"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[!m||!S?(0,s.jsxs)("form",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",onSubmit:r(C=>{C.preventDefault(),v&&y.mutate({name:v,popup:window.open("about:blank","_blank")})},"onSubmit"),children:[(0,s.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:["Provider",(0,s.jsx)(Zh,{value:v,onChange:r(C=>u(C.target.value),"onChange"),autoFocus:t,className:"w-full",children:l.data?.providers.map(C=>(0,s.jsx)("option",{value:C,children:C},C))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(le,{type:"submit",disabled:!v||y.isPending,className:"flex-1 sm:flex-none",children:y.isPending?"Starting...":"Sign in"}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon","aria-label":"Reload provider list",title:"Reload provider list",onClick:r(()=>{xs.loginProviders(!0).then(C=>i.setQueryData(Iw,C))},"onClick"),children:(0,s.jsx)(Yr,{"aria-hidden":"true"})})]})]}):null,y.error?(0,s.jsx)(Cs,{tone:"bad",children:hh(y.error)}):null,m?(0,s.jsxs)("section",{"aria-label":`Sign-in to ${m.provider}`,className:"flex flex-col gap-3 rounded-lg border border-line bg-bg-2 px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("b",{className:"text-sm font-semibold",children:m.provider}),S?(0,s.jsx)(le,{type:"button",variant:"ghost",size:"xs",disabled:k.isPending,onClick:r(()=>k.mutate(m.id),"onClick"),children:"Cancel"}):null]}),S&&m.url?(0,s.jsxs)("ol",{className:"flex list-decimal flex-col gap-1.5 ps-5 text-sm text-ink-2",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-medium text-accent underline underline-offset-4",children:["Open the sign-in page ",(0,s.jsx)(bS,{"aria-hidden":"true",className:"size-3.5"})]})," ","(already opened in a new tab unless the browser blocked it) and approve access."]}),m.prompt&&!m.prompt.secret?(0,s.jsx)("li",{children:"If the page ends on an address that does not load (it starts with http://localhost), copy that whole address from the browser bar and paste it below. On the machine that runs Wardmote this step finishes by itself."}):(0,s.jsx)("li",{children:"Enter the code OMP shows below if the page asks for one. This panel moves on by itself once you approve."})]}):null,S&&m.prompt?(0,s.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,s.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:[m.prompt.label.replace(/:$/,""),(0,s.jsx)(Wn,{value:h,onChange:r(C=>g(C.target.value),"onChange"),type:m.prompt.secret?"password":"text",autoComplete:"off",spellCheck:!1,autoFocus:!m.url})]}),(0,s.jsx)(le,{type:"submit",disabled:!h.trim()||j.isPending,children:j.isPending?"Sending...":"Send"})]}):null,S&&!m.prompt&&!m.url?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Waiting for OMP..."}):null,S&&m.message?(0,s.jsx)(Cs,{tone:"bad",children:m.message}):null,j.error?(0,s.jsx)(Cs,{tone:"bad",children:hh(j.error)}):null,m.state==="succeeded"?(0,s.jsxs)(Cs,{tone:"ok",children:[m.message??"Signed in",". Models from this provider are ready."]}):null,m.state==="failed"?(0,s.jsxs)(Cs,{tone:"bad",children:[m.message??"Sign-in failed",". Check the account on the provider's page, then press Sign in again."]}):null,S&&!m.prompt&&m.lines.length?(0,s.jsx)("pre",{"aria-label":"OMP output",className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-bg-3 px-3 py-2 font-mono text-xs text-ink-2",children:m.lines.join(`
54
+ `)}`:void 0}r(m$,"sanitizeComponentStack");function YC(){const e={};if(typeof document<"u"){try{const t=document.readyState;(t==="loading"||t==="interactive"||t==="complete")&&(e.ready_state=t)}catch{}try{const t=document.visibilityState;(t==="visible"||t==="hidden")&&(e.visibility_state=t)}catch{}try{const t=document.documentElement.classList;e.translation_marker=t.contains("translated-ltr")||t.contains("translated-rtl")}catch{}}return e}r(YC,"readBrowserErrorState");function p$(e){const t=m$(e.componentStack);return{tags:{react_error_boundary:e.boundary},contexts:{react:t?{componentStack:t}:{},browser_state:YC()}}}r(p$,"buildBrowserErrorContext");var vw=Promise.resolve();function X0(e){const t=vw.then(e);return vw=t.catch(()=>{}),t}r(X0,"enqueue");var Yl=null;function h$(e,t){return X0(async()=>{if(!Yl)try{const i=await ke(()=>import("./prod-COP_vZWu.js"),__vite__mapDeps([0,1]));i.init(x$(e,t)),Yl=i}catch{}})}r(h$,"initBrowserErrorMonitoring");function g$(){return X0(async()=>{const e=Yl;if(Yl=null,!e)return;const t=e.getClient();try{e.getCurrentScope().setClient(void 0)}catch{}try{await t?.close(2e3)}catch{}})}r(g$,"teardownBrowserErrorMonitoring");function XC(e,t){let i;try{t&&(i=p$(t))}catch{}X0(async()=>{try{i?Yl?.captureException(e,i):Yl?.captureException(e)}catch{}})}r(XC,"captureBrowserException");function x$(e,t){return{dsn:e,environment:t??void 0,release:"ca3530c2cd340bb91f7264481abe63b7aa2c429c",tracesSampleRate:0,sendDefaultPii:!1,beforeSend:r((i,l)=>{try{if(i.contexts={...i.contexts,browser_state:i.contexts?.browser_state??YC()},i.tags={...i.tags,browser_build_mode:"production"},i.exception?.values?.some(c=>c.mechanism?.type==="onunhandledrejection"||c.mechanism?.type==="auto.browser.global_handlers.onunhandledrejection")){const c=l.originalException;i.tags.browser_rejection_kind=c===null?"null":typeof c}}catch{}return i},"beforeSend"),integrations:r(i=>i.filter(l=>l.name!=="HttpContext"&&l.name!=="Breadcrumbs"),"integrations")}}r(x$,"buildBrowserSentryInitOptions");var b$=class extends x.Component{static{r(this,"RouteErrorBoundaryInner")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){XC(e,{boundary:"route",componentStack:t.componentStack})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){const{error:e}=this.state;return e?(0,s.jsxs)("div",{className:"mx-auto max-w-2xl space-y-4 px-4 py-10",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold",children:"This page hit an error"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while rendering this page. You can go back and try again, or reload."})]}),(0,s.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:this.props.onReset,children:"Go back"}),(0,s.jsx)(le,{size:"sm",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})]})]}):this.props.children}};function v$({children:e}){const t=vn(),i=bs(),l=`${t.pathname}${t.search}`;return(0,s.jsx)(b$,{resetKey:l,onReset:r(()=>i(-1),"onReset"),children:e})}r(v$,"RouteErrorBoundary");function y$({open:e,onOpenChange:t,...i}){return(0,s.jsx)(ya,{open:e,onOpenChange:t,children:(0,s.jsxs)(za,{"aria-describedby":void 0,className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[(0,s.jsxs)("div",{className:"px-4 pt-4 pb-3",children:[(0,s.jsx)(Da,{children:"Chat with an agent"}),i.existingChatAgentIds&&(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"One conversation per agent. Pick up where you left off."})]}),(0,s.jsx)(j$,{...i,onComplete:r(()=>t(!1),"onComplete")},String(e))]})})}r(y$,"AgentChatPicker");function j$({agents:e,onSelect:t,onComplete:i,loading:l,error:c,onRetry:u,existingChatAgentIds:m,renderAgentIcon:f}){const h=(0,x.useRef)(!1),g=(0,x.useRef)(null);(0,x.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current?.abort()}),[]);const[v,y]=(0,x.useState)(""),[j,k]=(0,x.useState)(null),[S,N]=(0,x.useState)(null);async function _(I){if(j)return;k(I.id),N(null);const D=new AbortController;g.current=D;try{await t(I,D.signal),h.current&&i()}catch(T){N(T instanceof Error?T.message:"Couldn’t open chat. Try again.")}finally{k(null)}}return r(_,"selectAgent"),(0,s.jsxs)(TS,{children:[(0,s.jsx)(b0,{"aria-label":"Search agents by name or role",placeholder:"Search by name or role…",value:v,onValueChange:y}),S&&(0,s.jsx)("p",{role:"alert",className:"px-4 py-3 text-sm text-bad",children:S}),j&&(0,s.jsx)("p",{role:"status",className:"sr-only",children:"Opening conversation…"}),c?(0,s.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 p-4 text-sm",children:[(0,s.jsx)("p",{children:"Couldn’t load agents. Try again."}),u&&(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:u,children:"Retry"})]}):l?(0,s.jsx)("p",{role:"status",className:"p-4 text-sm text-ink-3",children:"Loading agents…"}):(0,s.jsxs)(y0,{children:[(0,s.jsx)(v0,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 px-4",children:[(0,s.jsx)("span",{children:e.length?`No agents match “${v}”`:"No agents yet."}),e.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Try another name or role."}),(0,s.jsx)(le,{variant:"ghost",size:"sm",onClick:r(()=>y(""),"onClick"),children:"Clear search"})]}):(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Create an agent from the Agents page to start chatting."})]})}),(0,s.jsx)(Wa,{children:e.map(I=>(0,s.jsxs)(jn,{value:I.id,keywords:[I.name,I.title??"",I.role],onSelect:r(()=>{_(I)},"onSelect"),disabled:j!==null,className:"gap-3 px-3 py-3",children:[f?f(I):(0,s.jsx)(Kh,{icon:I.icon,className:"size-4 shrink-0"}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"truncate font-medium",children:I.name}),(0,s.jsx)("span",{className:"truncate text-xs text-ink-3",children:I.title??I.role})]}),m&&(0,s.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:m.includes(I.id)?"Open chat":"New chat"}),I.status==="paused"&&(0,s.jsx)("span",{className:"text-xs text-(--status-agent-paused)",children:"Paused"}),I.status==="terminated"&&(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Terminated"}),I.status==="pending_approval"&&(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Awaiting approval"})]},I.id))})]})]})}r(j$,"AgentChatPickerResults");function w$({agents:e,existingChatAgentIds:t,availableAgents:i=e,activeId:l,previews:c={},loading:u=!1,error:m,onRetry:f,initialSearch:h="",onSelect:g,onBrowse:v,onAddChat:y,historyLoading:j,historyError:k,onRetryHistory:S}){const N=bs(),[_,I]=(0,x.useState)(!1),[D,T]=(0,x.useState)(h),C=(0,x.useRef)(null),M=(0,x.useId)(),z=D.trim().toLocaleLowerCase(),K=e.filter(A=>`${A.name} ${A.title??""} ${A.role}`.toLocaleLowerCase().includes(z));function P(){T(""),C.current?.focus()}return r(P,"focusSearch"),(0,s.jsxs)("aside",{"aria-labelledby":M,className:"flex h-full min-h-0 flex-col border-r border-line bg-bg",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col gap-4 px-3 pb-4 pt-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("h2",{id:M,className:"text-sm font-semibold",children:"Chat"}),(0,s.jsx)(le,{variant:"secondary",size:"icon-sm","aria-label":"Add chat",title:"Add chat",onClick:r(()=>I(!0),"onClick"),children:(0,s.jsx)(Js,{className:"size-4"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(Kr,{"aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-ink-3"}),(0,s.jsx)(Wn,{ref:C,"aria-label":"Search agents",placeholder:"Find an agent",value:D,onChange:r(A=>T(A.target.value),"onChange"),onKeyDown:r(A=>{A.key==="Escape"&&(A.stopPropagation(),T(""))},"onKeyDown"),className:"h-8 pl-8 pr-8 text-xs md:text-xs"}),D&&(0,s.jsx)(le,{variant:"ghost",size:"icon-xs","aria-label":"Clear search",className:"absolute right-1 top-1/2 -translate-y-1/2",onClick:P,children:(0,s.jsx)(is,{className:"size-3"})})]})]}),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pb-3 scrollbar-auto-hide",children:[(0,s.jsx)("p",{className:"px-2 text-(length:--text-micro) font-medium uppercase tracking-widest text-ink-3",children:z?"Search results":"Teammates"}),(0,s.jsx)("span",{role:"status",className:"sr-only",children:u?"Loading agents":`${K.length} ${K.length===1?"agent":"agents"}`}),j&&(0,s.jsx)("p",{role:"status",className:"px-2 text-xs text-ink-3",children:"Loading chat history…"}),k&&(0,s.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-3",children:[(0,s.jsx)("p",{className:"text-xs text-ink-3",children:"Some chat history couldn’t load."}),(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:S,children:"Retry chat history"})]}),m?(0,s.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,s.jsx)("p",{className:"text-sm",children:"Couldn’t load your chats."}),(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:f,children:"Try again"})]}):u?(0,s.jsx)("div",{"aria-hidden":"true",className:"flex flex-col gap-1",children:[0,1,2,3].map(A=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-md px-2 py-3 motion-safe:animate-pulse",children:[(0,s.jsx)("div",{className:"size-8 shrink-0 rounded-lg bg-bg-3"}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,s.jsx)("div",{className:"h-3 w-2/3 rounded-sm bg-bg-3"}),(0,s.jsx)("div",{className:"h-2 w-full rounded-sm bg-bg-3"})]})]},A))}):K.length?(0,s.jsx)("nav",{"aria-label":"Agent conversations",className:"flex flex-col gap-1",children:K.map(A=>(0,s.jsxs)(gn,{to:`/chats/${encodeURIComponent(A.status==="terminated"?A.id:ar(A))}`,"aria-current":l===A.id?"page":void 0,title:`${A.name}${A.title?` · ${A.title}`:""}`,onClick:r(B=>{g&&(B.preventDefault(),g(A))},"onClick"),className:X("flex min-w-0 items-center gap-3 rounded-md px-2 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus",l===A.id?Vl.active:Vl.rest),children:[(0,s.jsx)(ir,{agent:A,size:32}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium",children:A.name}),(0,s.jsx)("span",{className:"truncate text-xs text-ink-3",children:A.status==="terminated"?"Terminated":A.status==="paused"?"Paused":c[A.id]??A.title??"Start a conversation"})]})]},A.id))}):!e.length&&(j||k)?null:(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.length?"No agents found":"No chats yet"}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-ink-3",children:e.length?"Try another name or role.":"Choose an agent to start a conversation."}),!e.length&&(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:r(()=>I(!0),"onClick"),children:"Choose an agent"}),e.length>0&&(0,s.jsx)(le,{variant:"secondary",size:"sm",onClick:P,children:"Clear search"})]})]}),(0,s.jsx)("div",{className:"shrink-0 px-3 py-4",children:(0,s.jsx)(le,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2 px-2",asChild:!v,onClick:v,children:v?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(qr,{className:"size-4"}),"Browse all agents"]}):(0,s.jsxs)(gn,{to:"/agents/all",children:[(0,s.jsx)(qr,{className:"size-4"}),"Browse all agents"]})})}),(0,s.jsx)(y$,{agents:i,open:_,onOpenChange:I,existingChatAgentIds:t??e.map(A=>A.id),loading:u,error:m,onRetry:f,renderAgentIcon:r(A=>(0,s.jsx)(ir,{agent:A,size:32}),"renderAgentIcon"),onSelect:r(async(A,B)=>{y?await y(A,B):g?await g(A,B):N(`/chats/${encodeURIComponent(ar(A))}`),B?.aborted||T("")},"onSelect")})]})}r(w$,"AgentConversationSidebar");function k$(){const{selectedCompanyId:e}=vt(),{enabled:t,loaded:i}=yf(),l=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),c=l.data?.user?.id??l.data?.session?.userId??null;return{companyId:e,userId:c,enabled:t,loaded:i,agents:ge({queryKey:U.agents.list(e),queryFn:r(()=>$s.list(e),"queryFn"),enabled:t&&!!e}),chats:ge({queryKey:U.agentChats.list(e,c),queryFn:r(()=>LS.list(e),"queryFn"),enabled:t&&!!e&&l.isSuccess}),session:l}}r(k$,"useAgentChatNavigation");function S$(e,t){const i=wn(),l=bs(),{isMobile:c,setSidebarOpen:u}=Jn(),m=(0,x.useRef)({companyId:e,userId:t,mounted:!0});return(0,x.useEffect)(()=>{const f={companyId:e,userId:t,mounted:!0};return m.current=f,()=>{f.mounted=!1}},[e,t]),(0,x.useCallback)(async(f,h)=>{if(!e||f.companyId!==e)throw new Error("Choose an agent from this company.");const g=m.current,v=await LS.ensure(e,f.id);i.setQueryData(U.agentChats.detail(e,t,f.id),v),i.setQueryData(U.issues.detail(v.id),v),i.setQueryData(U.agentChats.list(e,t),y=>[v,...(y??[]).filter(j=>j.id!==v.id)].sort((j,k)=>new Date(k.updatedAt).getTime()-new Date(j.updatedAt).getTime()||k.id.localeCompare(j.id))),!(!g.mounted||m.current!==g||h?.aborted)&&(l(`/chats/${encodeURIComponent(ar(f))}`),c&&u(!1))},[i,e,t,l,c,u])}r(S$,"useOpenAgentChat");function N$(){const{companyId:e,userId:t,agents:i,chats:l,session:c}=k$(),u=S$(e,t),m=bs(),f=_0(e),{isMobile:h,setSidebarOpen:g}=Jn(),{pathname:v}=vn(),y=v.split("/chats/")[1]?.split("/")[0],j=i.data??[],k=i.isSuccess?[...new Set((l.data??[]).flatMap(M=>M.conversationAgentId&&!j.some(z=>z.id===M.conversationAgentId)?[M.conversationAgentId]:[]))]:[],S=t0({queries:k.map(M=>({queryKey:U.agents.detail(M),queryFn:r(()=>$s.get(M,e),"queryFn")}))}),N=new Map(j.map(M=>[M.id,M]));for(const M of S)M.data&&N.set(M.data.id,M.data);const _=[...N.values()].find(M=>M.id===y||M.status!=="terminated"&&encodeURIComponent(ar(M))===y),I=(l.data??[]).flatMap(M=>{const z=M.conversationAgentId?N.get(M.conversationAgentId):void 0;return z?[z]:[]});_&&!I.some(M=>M.id===_.id)&&I.unshift(_);const D=new Set(I.map(M=>M.id)),T=j.filter(M=>!D.has(M.id)&&M.status!=="terminated"&&(!f.isSuccess||oN(f.data,"agent",M.id)!=="left")).sort((M,z)=>M.name.localeCompare(z.name,void 0,{sensitivity:"base"})),C=Object.fromEntries((l.data??[]).filter(M=>M.conversationState==="active").map(M=>[M.conversationAgentId,"Working…"]));return(0,s.jsx)(w$,{agents:[...I,...T],availableAgents:j,existingChatAgentIds:I.map(M=>M.id),activeId:_?.id,previews:C,loading:i.isPending||l.isPending||c.isPending,error:i.error??l.error??c.error,onRetry:r(()=>{i.refetch(),l.refetch(),c.refetch()},"onRetry"),historyLoading:S.some(M=>M.isPending),historyError:S.find(M=>M.error)?.error,onRetryHistory:r(()=>{S.filter(M=>M.isError).forEach(M=>{M.refetch()})},"onRetryHistory"),onAddChat:u,onSelect:r(M=>{m(`/chats/${encodeURIComponent(M.status==="terminated"?M.id:ar(M))}`),h&&g(!1)},"onSelect")},`${e}:${t}`)}r(N$,"AgentConversationsSidebar");var ld=232,vg=208,yg=420,yw=16;function tf(e){return Math.min(yg,Math.max(vg,e))}r(tf,"clampSidebarWidth");function jw(e){if(typeof window>"u")return ld;try{const t=window.localStorage.getItem(e);if(!t)return ld;const i=Number.parseInt(t,10);return Number.isFinite(i)?tf(i):ld}catch{return ld}}r(jw,"readStoredSidebarWidth");function ww(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(tf(t)))}catch{}}r(ww,"writeStoredSidebarWidth");function C$({children:e,open:t,collapsed:i=!1,peeking:l=!1,resizable:c=!1,storageKey:u="wardmote.sidebar.width",className:m,onPanelMouseEnter:f,onPanelMouseLeave:h,onPanelFocusCapture:g,onPanelBlurCapture:v}){const[y,j]=(0,x.useState)(()=>jw(u)),[k,S]=(0,x.useState)(!1),N=(0,x.useRef)(y),_=(0,x.useRef)(null);(0,x.useEffect)(()=>{const Y=jw(u);N.current=Y,j(Y)},[u]);const I=t?y:0,D=t?i?72:I:0,T=t?i&&!l?72:I:0,C=T>D,M=c&&t&&!i,z=(0,x.useMemo)(()=>({width:`${D}px`}),[D]),K=(0,x.useMemo)(()=>({width:`${T}px`}),[T]),P=(0,x.useCallback)(Y=>{const ce=tf(Y);N.current=ce,j(ce),ww(u,ce)},[u]),A=(0,x.useCallback)(Y=>{M&&(Y.preventDefault(),Y.currentTarget.setPointerCapture(Y.pointerId),_.current={startX:Y.clientX,startWidth:N.current},S(!0))},[M]),B=(0,x.useCallback)(Y=>{if(!_.current)return;const ce=tf(_.current.startWidth+Y.clientX-_.current.startX);N.current=ce,j(ce)},[]),O=(0,x.useCallback)(()=>{_.current&&(_.current=null,S(!1),ww(u,N.current))},[u]),W=(0,x.useCallback)(Y=>{M&&(Y.key==="ArrowLeft"?(Y.preventDefault(),P(y-yw)):Y.key==="ArrowRight"?(Y.preventDefault(),P(y+yw)):Y.key==="Home"?(Y.preventDefault(),P(vg)):Y.key==="End"&&(Y.preventDefault(),P(yg)))},[M,P,y]);return(0,s.jsxs)("div",{className:X("relative h-full shrink-0",m),style:z,children:[(0,s.jsx)("div",{className:X("absolute inset-y-0 left-0 flex flex-col overflow-hidden",C?"z-30 border-r border-line bg-bg shadow-lg":"z-0"),style:K,"data-sidebar-overlay":C?"":void 0,onMouseEnter:f,onMouseLeave:h,onFocusCapture:g,onBlurCapture:v,children:e}),M?(0,s.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":vg,"aria-valuemax":yg,"aria-valuenow":y,tabIndex:0,"data-dragging":k?"":void 0,className:"group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none",style:{right:-4,width:8},onPointerDown:A,onPointerMove:B,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,onKeyDown:W,children:(0,s.jsx)("div",{className:X("mx-auto h-full w-0.5 transition-colors",k?"bg-focus":"bg-transparent group-hover:bg-focus group-focus-visible:bg-focus")})}):null]})}r(C$,"SidebarShell");function od({children:e,className:t}){return(0,s.jsx)("div",{"data-secondary-sidebar":"",className:X("h-full w-full min-w-0 overflow-hidden",t),children:(0,s.jsx)(NS,{children:e})})}r(od,"SecondarySidebar");function A$(e,t){if(!t)return!1;if(t.source==="local_implicit"||t.isInstanceAdmin)return!0;if(!e)return!1;const i=t.memberships?.find(l=>l.companyId===e&&l.status==="active");return i?.membershipRole==="owner"||i?.membershipRole==="admin"||i?.membershipRole==="operator"||i?.membershipRole==="member"}r(A$,"canInviteCompanyMembers");function _$(){const e=kE(),t=ge({queryKey:U.access.currentBoardAccess,queryFn:r(()=>Xa.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4});return A$(e?.selectedCompanyId,t.data)}r(_$,"useCanInviteCompanyMembers");function E$(e){return e?.trim().toLowerCase().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||null}r(E$,"slugifyUserPart");function I$(e){const t=[e?.id,e?.name,e?.email?.split("@")[0],e?.email];for(const i of t){const l=E$(i);if(l)return`/u/${l}`}return"/u/me"}r(I$,"userProfilePath");var Cc=null,ZC=!1,jg=!1,wg=new Set;function Ac(){for(const e of wg)e()}r(Ac,"emit");function T$(e=typeof navigator>"u"?"":navigator.userAgent,t=typeof navigator>"u"?0:navigator.maxTouchPoints){return/iPhone|iPad|iPod/i.test(e)?!0:/Macintosh/i.test(e)&&t>1}r(T$,"isIosSafariLike");function R$(e=window){const t=r(l=>{l.preventDefault(),Cc=l,Ac()},"onPrompt"),i=r(()=>{Cc=null,ZC=!0,Ac()},"onInstalled");return e.addEventListener("beforeinstallprompt",t),e.addEventListener("appinstalled",i),()=>{e.removeEventListener("beforeinstallprompt",t),e.removeEventListener("appinstalled",i)}}r(R$,"captureInstallPrompt");function D$(){return ZC||bg()?"installed":Cc?"prompt":T$()?"ios-manual":"unavailable"}r(D$,"installAvailability");async function M$(){const e=Cc;if(!e)return"unavailable";Cc=null,Ac(),await e.prompt();const{outcome:t}=await e.userChoice;return t}r(M$,"promptInstall");function kg(e){jg!==e&&(jg=e,Ac())}r(kg,"setIosInstallHelpOpen");function O$(){return jg}r(O$,"iosInstallHelpOpen");function L$(){return(0,x.useSyncExternalStore)(Z0,O$,()=>!1)}r(L$,"useIosInstallHelpOpen");function Z0(e){return wg.add(e),()=>{wg.delete(e)}}r(Z0,"subscribe$1");function JC(){return(0,x.useSyncExternalStore)(Z0,D$,()=>"unavailable")}r(JC,"useInstallAvailability");function vG(e){const t=JC();return(0,x.useSyncExternalStore)(Z0,()=>U$(t,e),()=>!1)}r(vG,"useInstallNudgeVisible");var z$=2592e6,Sg="wardmote.install.visits",kw="wardmote.install.visit-counted",eA="wardmote.install.snoozed-until";function Ng(e,t){const i=Number(e.getItem(t));return Number.isFinite(i)?i:0}r(Ng,"readNumber");function P$(e=window.localStorage,t=window.sessionStorage){try{if(t.getItem(kw))return;t.setItem(kw,"1"),e.setItem(Sg,String(Ng(e,Sg)+1))}catch{return}}r(P$,"recordAppVisit");function U$(e,t,i=Date.now(),l=window.localStorage){if(e!=="prompt"&&e!=="ios-manual"||/^\/(?:[^/]+\/)?onboarding(?:\/|$)/.test(t))return!1;try{return Ng(l,Sg)>=3&&Ng(l,eA)<=i}catch{return!1}}r(U$,"installNudgeVisible");function yG(e=Date.now(),t=window.localStorage){try{t.setItem(eA,String(e+z$))}catch{return}finally{Ac()}}r(yG,"snoozeInstallNudge");var Sw="Install app",$$="Add Wardmote to your home screen or dock.";function B$({variant:e,onAfterAction:t}){const i=JC();if(i==="installed"||i==="unavailable")return null;const l=r(()=>{i==="ios-manual"?kg(!0):M$(),t?.()},"handleClick");return e==="compact-menu-action"?(0,s.jsxs)("button",{type:"button",className:"flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",onClick:l,children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,s.jsx)(eg,{className:"size-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Sw})]}):(0,s.jsxs)("button",{type:"button",className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-bg-3/60",onClick:l,children:[(0,s.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,s.jsx)(eg,{className:"size-4"})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-ink",children:Sw}),(0,s.jsx)("span",{className:"block text-xs text-ink-3",children:$$})]})]})}r(B$,"InstallAppMenuAction");function K$(){const e=L$();return(0,s.jsx)(ya,{open:e,onOpenChange:kg,children:(0,s.jsxs)(za,{children:[(0,s.jsxs)(Jl,{children:[(0,s.jsx)(Da,{children:"Install Wardmote"}),(0,s.jsx)(eo,{children:"Add Wardmote to your Home Screen from Safari."})]}),(0,s.jsxs)("ol",{className:"space-y-3 text-sm text-ink",children:[(0,s.jsxs)(dh,{index:1,icon:(0,s.jsx)(JT,{className:"size-4"}),children:["Tap ",(0,s.jsx)("strong",{children:"Share"})," in the Safari toolbar."]}),(0,s.jsxs)(dh,{index:2,icon:(0,s.jsx)(tR,{className:"size-4"}),children:["Choose ",(0,s.jsx)("strong",{children:"Add to Home Screen"}),"."]}),(0,s.jsxs)(dh,{index:3,children:["Keep ",(0,s.jsx)("strong",{children:"Open as Web App"})," on, then tap ",(0,s.jsx)("strong",{children:"Add"}),"."]})]}),(0,s.jsx)(jf,{children:(0,s.jsx)(le,{type:"button",onClick:r(()=>kg(!1),"onClick"),children:"Done"})})]})})}r(K$,"IosInstallHelpDialog");function dh({index:e,icon:t,children:i}){return(0,s.jsxs)("li",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-line text-xs font-semibold text-ink-3",children:e}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t?(0,s.jsx)("span",{className:"text-ink-3",children:t}):null,(0,s.jsx)("span",{children:i})]})]})}r(dh,"InstallStep");function q$(e){if(!e)return"Unavailable";const t=new Date(e);return Number.isNaN(t.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(t)}r(q$,"formatTimestamp");function F$(e){return!!e&&!Number.isNaN(new Date(e).getTime())}r(F$,"isValidTimestamp");function H$(e){return e?.devServer?.lastRestartAt??e?.serverInfo?.processStartedAt??null}r(H$,"restartTimestamp");function V$(e){const t=e?.serverInfo?.git;return t?.available?`${t.shortSha} · ${t.subject}`:"Commit unavailable"}r(V$,"commitLabel");function W$(e){const t=e?.serverInfo?.git;if(!t?.available)return"Unavailable";const i=t.localChanges;if(!i||!i.available)return"Change status unavailable";if(!i.hasLocalChanges)return"Clean checkout";const l=[[i.stagedFileCount,"staged"],[i.unstagedFileCount,"unstaged"],[i.untrackedFileCount,"untracked"]].filter(([c])=>Number(c)>0).map(([c,u])=>`${c} ${u}`);return l.length>0?`Local changes present (${l.join(", ")})`:"Local changes present"}r(W$,"localChangesLabel");function fh({icon:e,label:t,value:i,dateTime:l}){return(0,s.jsxs)("div",{className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left",children:[(0,s.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,s.jsx)(e,{className:"size-4"})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-ink",children:t}),l?(0,s.jsx)("time",{dateTime:l,className:"block break-words text-xs text-ink-3",children:i}):(0,s.jsx)("span",{className:"block break-words text-xs text-ink-3",children:i})]})]})}r(fh,"ServerInfoRow");function Q$(){const e=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")}).data?.enableServerInfoDebugView===!0,t=ge({queryKey:U.health,queryFn:r(()=>Rc.get(),"queryFn"),enabled:e,refetchOnMount:"always",refetchInterval:r(v=>v.state.data?.devServer?.enabled?2e3:!1,"refetchInterval")});if(!e)return null;const i=t.data,l=t.isLoading&&!i,c=t.isError,u=H$(i),m=F$(u),f=c?"Health unavailable":l?"Loading...":q$(u),h=c?"Health unavailable":l?"Loading...":V$(i),g=c?"Health unavailable":l?"Loading...":W$(i);return(0,s.jsxs)("div",{className:"mt-2 border-t border-line pt-2",children:[(0,s.jsx)("p",{className:"px-3 pb-1 pt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"Server"}),(0,s.jsx)(fh,{icon:DT,label:"Last restarted",value:f,dateTime:!c&&!l&&m?u:null}),(0,s.jsx)(fh,{icon:UT,label:"Running commit",value:h}),(0,s.jsx)(fh,{icon:OT,label:"Checkout state",value:g})]})}r(Q$,"SidebarServerInfo");var G$="/company/settings/members?tab=invites",Y$="https://github.com/tickernelz/wardmote/tree/main/docs",X$="https://github.com/tickernelz/wardmote/issues";function Z$(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length>=2?`${t[0]?.[0]??""}${t[t.length-1]?.[0]??""}`.toUpperCase():e.slice(0,2).toUpperCase()}r(Z$,"deriveInitials");function mh({label:e,icon:t,onClick:i,href:l,external:c=!1}){const u="flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",m=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,s.jsx)(t,{className:"size-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})]});return l?c?(0,s.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",className:u,onClick:i,children:m}):(0,s.jsx)(gn,{to:l,className:u,onClick:i,children:m}):(0,s.jsx)("button",{type:"button",className:u,onClick:i,children:m})}r(mh,"MenuAction");function Nw({deploymentMode:e,open:t,onOpenChange:i,forceExpanded:l=!1}){const{hidden:c,loaded:u}=lr(),m=_$()?G$:null,f=u&&m!==null&&!Ed(c,"company.members")&&!Ed(c,"company.invites"),[h,g]=(0,x.useState)(!1),{isMobile:v,setSidebarOpen:y,collapsed:j,peeking:k}=Jn(),S=j&&!k&&!l,N=t??h,_=i??g,{data:I}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),D=K0({onSignedOut:K}),T=I?.user.name?.trim()||"Board",C=I?.user.email?.trim()||(e==="authenticated"?"Signed in":"Local workspace board"),M=Z$(T),z=I$(I?.user);function K(){_(!1),v&&y(!1)}r(K,"closeNavigationChrome");function P(){D.mutate()}return r(P,"handleSignOut"),(0,s.jsx)("div",{className:"bg-line/50 px-3 py-2 dark:bg-bg-3",children:(0,s.jsxs)("div",{className:X("flex items-center gap-0.5",!S&&"px-2"),children:[(0,s.jsxs)(va,{open:N,onOpenChange:_,children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",className:X("flex min-w-0 items-center gap-2.5 rounded-lg text-left text-(length:--text-compact) font-medium text-ink/80 transition-colors hover:bg-bg-3 hover:text-ink",S?"w-full px-3 py-2":"flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,s.jsxs)(Od,{size:"sm",children:[I?.user.image?(0,s.jsx)(Dd,{src:I.user.image,alt:T}):null,(0,s.jsx)(Md,{children:M})]}),(0,s.jsx)("span",{className:X("min-w-0 flex-1 truncate",S&&"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none"),children:T})]})}),(0,s.jsxs)(ba,{side:"top",align:"start",sideOffset:10,className:"min-h-(--profile-popover-min-height) w-(--profile-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-line bg-bg-2 p-0 shadow-(--shadow-profile-popover)",children:[(0,s.jsxs)("div",{className:"relative flex h-(--profile-popover-header-height) shrink-0 items-center gap-2.5 px-3.5",children:[(0,s.jsx)(gn,{to:z,"aria-label":"View profile",onClick:K,className:"absolute inset-0 transition-colors hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus"}),(0,s.jsxs)(Od,{className:"pointer-events-none relative size-9",children:[I?.user.image?(0,s.jsx)(Dd,{src:I.user.image,alt:T}):null,(0,s.jsx)(Md,{className:"text-xs text-ink",children:M})]}),(0,s.jsxs)("div",{className:"pointer-events-none relative min-w-0 flex-1",children:[(0,s.jsx)("h2",{className:"truncate text-sm font-semibold leading-(--profile-popover-label-line-height) text-ink",children:T}),(0,s.jsx)("p",{className:"truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-ink-3",children:C})]})]}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-0.5 border-t border-line px-2.5 pb-2.5 pt-2",children:[(0,s.jsx)(mh,{label:"Settings",icon:SS,href:"/company/settings",onClick:K}),f&&m?(0,s.jsx)(mh,{label:"Invite",icon:W1,href:m,onClick:K}):null,(0,s.jsx)(mh,{label:"Documentation",icon:ET,href:Y$,external:!0,onClick:r(()=>_(!1),"onClick")}),(0,s.jsx)(qI,{variant:"compact-menu-action",onAfterToggle:r(()=>_(!1),"onAfterToggle")}),(0,s.jsx)(B$,{variant:"compact-menu-action",onAfterAction:r(()=>_(!1),"onAfterAction")}),e==="authenticated"?(0,s.jsxs)("button",{type:"button",className:X("flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bad/10",D.isPending&&"cursor-not-allowed opacity-60"),onClick:P,disabled:D.isPending,children:[(0,s.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,s.jsx)(wf,{className:"size-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:D.isPending?"Signing out...":"Sign out"})]}):null,(0,s.jsx)(Q$,{})]})]})]}),S?null:(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("a",{href:X$,target:"_blank",rel:"noreferrer","aria-label":"Share feedback",className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-ink-3/50 transition-colors hover:bg-bg-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,s.jsx)(c0,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,s.jsx)(Ea,{side:"top",children:"Share feedback"})]})]})})}r(Nw,"SidebarAccountMenu");var J$=["input","textarea","select","[contenteditable='true']","[contenteditable='plaintext-only']","[role='textbox']","[role='combobox']"].join(", "),eB="[data-page-search-target='true']",tB=new Set(["Shift","Meta","Control","Alt"]);function ao(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(J$):!1}r(ao,"isKeyboardShortcutTextInputTarget");function Cg(e=document){return!!e.querySelector("[role='dialog'][aria-modal='true']")}r(Cg,"hasBlockingShortcutDialog");function nB(e){if(!e.isConnected||"disabled"in e&&typeof e.disabled=="boolean"&&e.disabled||e.closest("[hidden], [aria-hidden='true'], [inert]")||e.closest("[role='dialog'][aria-modal='true']"))return!1;const t=window.getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"?!1:e.getClientRects().length>0||e===document.activeElement}r(nB,"isVisibleShortcutTarget");function sB(e=document){return Array.from(e.querySelectorAll(eB)).find(t=>nB(t))??null}r(sB,"findPageSearchShortcutTarget");function aB(e=document){const t=sB(e);return t?(t.focus(),(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select(),!0):!1}r(aB,"focusPageSearchShortcutTarget");function iB({key:e,isComposing:t}){return e==="Enter"&&!t}r(iB,"shouldBlurPageSearchOnEnter");function rB({key:e,isComposing:t,currentValue:i}){return e==="Escape"&&!t&&i.length===0}r(rB,"shouldBlurPageSearchOnEscape");function Pf(e){return tB.has(e)}r(Pf,"isModifierOnlyKey");function jG({defaultPrevented:e,key:t,metaKey:i,ctrlKey:l,altKey:c,target:u,hasOpenDialog:m,hasSelection:f}){if(e||i||l||c||Pf(t)||m||ao(u))return"ignore";switch(t){case"j":case"ArrowDown":return"next";case"k":case"ArrowUp":return"previous";case"Enter":return f?"toggle":"ignore";case"x":return f?"dismiss":"ignore";default:return"ignore"}}r(jG,"resolveAttentionQueueKeyAction");function wG({armed:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:u,target:m,hasOpenDialog:f}){return!e||t||l||c||u||Pf(i)||f||ao(m)?"ignore":i.toLowerCase()==="y"?"archive":"ignore"}r(wG,"resolveInboxQuickArchiveKeyAction");function kG({hasUndoableArchive:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:u,target:m,hasOpenDialog:f}){return!e||t||l||c||u||Pf(i)||f||ao(m)?"ignore":i==="u"?"undo_archive":"ignore"}r(kG,"resolveInboxUndoArchiveKeyAction");function lB({armed:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:u,target:m,hasOpenDialog:f}){if(t)return e?"disarm":"ignore";if(l||c||u||Pf(i))return"ignore";if(f||ao(m))return e?"disarm":"ignore";const h=i.toLowerCase();return e?h==="i"?"navigate_inbox":h==="c"?"focus_comment":h==="f"?"open_file_viewer":h==="g"?"arm":"disarm":h==="g"?"arm":"ignore"}r(lB,"resolveIssueDetailGoKeyAction");function oB({onNewIssue:e,onSearch:t,onToggleSidebar:i,onTogglePanel:l,onShowShortcuts:c,onGoToInbox:u}){(0,x.useEffect)(()=>{let m=!1,f=null;const h=r(()=>{f!==null&&(window.clearTimeout(f),f=null)},"clearGoChordTimeout"),g=r(()=>{m=!1,h()},"disarmGoChord"),v=r(()=>{m=!0,h(),f=window.setTimeout(()=>{m=!1,f=null},1200)},"armGoChord");function y(S){if(S.defaultPrevented){g();return}if(u){const N=lB({armed:m,defaultPrevented:S.defaultPrevented,key:S.key,metaKey:S.metaKey,ctrlKey:S.ctrlKey,altKey:S.altKey,target:S.target,hasOpenDialog:Cg()});if(N==="arm"){v();return}if(N==="navigate_inbox"){g(),S.preventDefault(),u();return}if(N==="focus_comment"||N==="open_file_viewer"){g(),S.preventDefault();return}N==="disarm"&&g()}if(!ao(S.target)&&!Cg()){if(S.key==="/"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),aB()||t?.();return}if(S.key==="?"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),c?.();return}S.key==="c"&&!S.metaKey&&!S.ctrlKey&&!S.altKey&&(S.preventDefault(),e?.()),S.key==="["&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),i?.()),S.key==="]"&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),l?.())}}r(y,"handleKeyDown");const j=r(()=>g(),"handlePointerDown"),k=r(S=>{S.target instanceof HTMLElement&&S.target!==document.body&&g()},"handleFocusIn");return document.addEventListener("pointerdown",j,!0),document.addEventListener("focusin",k,!0),document.addEventListener("keydown",y),()=>{g(),document.removeEventListener("pointerdown",j,!0),document.removeEventListener("focusin",k,!0),document.removeEventListener("keydown",y)}},[e,t,i,l,c,u])}r(oB,"useKeyboardShortcuts");var cB=new Set(["auth","invite","board-claim","cli-auth","docs","s"]);function tA(e){const t=(e.split("?")[0]??"").split("/").filter(Boolean);if(t.length===0)return!0;const[i]=t;return!cB.has(i)}r(tA,"isRememberableCompanyPath");function uB(e){const t=Rd(e.companyPrefix);return e.companies.find(i=>Rd(i.issuePrefix)===t)??null}r(uB,"findCompanyByPrefix");function dB(e){const t=Gk(e.pathname);return t?uB({companies:e.companies,companyPrefix:t})?.id??null:e.fallbackCompanyId}r(dB,"getRememberedPathOwnerCompanyId");function fB(e){const t=e.path?pf(e.path):"/dashboard";if(!tA(t))return"/dashboard";const[i,l]=(t.split("?")[0]??"").split("/").filter(Boolean);if(i==="issues"&&l){const c=/^([A-Za-z]+)-\d+$/.exec(l);if(c&&Rd(c[1]??"")!==Rd(e.companyPrefix))return"/dashboard"}return t}r(fB,"sanitizeRememberedPathForCompany");var nA="wardmote.companyPaths";function sA(){try{const e=localStorage.getItem(nA);if(e)return JSON.parse(e)}catch{}return{}}r(sA,"getCompanyPaths");function mB(e,t){const i=sA();i[e]=t,localStorage.setItem(nA,JSON.stringify(i))}r(mB,"saveCompanyPath");function pB(){const{companies:e,selectedCompanyId:t,selectedCompany:i,selectionSource:l}=vt(),c=vn(),u=bs(),m=(0,x.useRef)(t),f=(0,x.useMemo)(()=>dB({companies:e,pathname:c.pathname,fallbackCompanyId:m.current}),[e,c.pathname]),h=c.pathname+c.search;(0,x.useEffect)(()=>{const g=f,v=pf(h);g&&tA(v)&&mB(g,v)},[h,f]),(0,x.useEffect)(()=>{if(t){if(m.current!==null&&t!==m.current&&l!=="route_sync"&&i){const g=sA(),v=fB({path:g[t],companyPrefix:i.issuePrefix});u(`/${i.issuePrefix}${v}`,{replace:!0})}m.current=t}},[i,t,l,u])}r(pB,"useCompanyPageMemory");var hB=class{static{r(this,"MobileNavScrollTracker")}options;lastTop;lastMaxTop;visible=!0;direction=0;distance=0;constructor(e,t,i){this.options=e,this.lastTop=t,this.lastMaxTop=i}update(e,t){const i=Math.max(0,Math.min(e,t)),l=i-Math.max(this.lastTop,this.options.topZone),c=t!==this.lastMaxTop;if(this.lastTop=i,this.lastMaxTop=t,i<=this.options.topZone)this.visible=!0,this.direction=0,this.distance=0;else if(c)this.direction=0,this.distance=0;else if(l!==0){const u=Math.sign(l);u!==this.direction&&(this.distance=0),this.direction=u,this.distance+=Math.abs(l);const m=u>0?this.options.hideDistance:this.options.showDistance;this.distance>=m&&(this.visible=u<0,this.distance=0)}return this.visible}};function gB(e,t){const[i,l]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{if(l(!0),!e)return;const c=getComputedStyle(document.documentElement),u=r(y=>Number.parseFloat(c.getPropertyValue(y))||0,"distance"),m=r(()=>{const y=document.scrollingElement??document.documentElement;return{top:window.scrollY||y.scrollTop||0,max:Math.max(0,y.scrollHeight-y.clientHeight)}},"scrollBounds"),f=m(),h=new hB({topZone:u("--mobile-nav-scroll-top-zone"),hideDistance:u("--mobile-nav-scroll-hide-distance"),showDistance:u("--mobile-nav-scroll-show-distance")},f.top,f.max);let g=null;const v=r(()=>{g===null&&(g=requestAnimationFrame(()=>{g=null;const{top:y,max:j}=m(),k=h.visible,S=h.update(y,j);S!==k&&l(S)}))},"onScroll");return window.addEventListener("scroll",v,{passive:!0}),()=>{window.removeEventListener("scroll",v),g!==null&&cancelAnimationFrame(g)}},[e,t]),i}r(gB,"useMobileNavVisibility");function xB(e){const{matchedCompany:t,selectedCompanyId:i,companies:l}=e;return!t||t.status!=="archived"||i===t.id?null:l.find(c=>c.id===i&&c.status!=="archived")??l.find(c=>c.status!=="archived")??null}r(xB,"resolveArchivedCompanyBounce");function SG(e){const{archivedCompanyId:t,companies:i}=e,l=i.find(c=>c.id!==t&&c.status!=="archived");return l?{kind:"company",company:l}:{kind:"companies_list"}}r(SG,"resolveCompanyArchiveDeparture");function bB(e){const{selectionSource:t,selectedCompanyId:i,routeCompanyId:l}=e;return!(i===l||t==="manual"&&i)}r(bB,"shouldSyncCompanySelectionFromRoute");function vB(e,t){return e instanceof HTMLElement?!(t instanceof HTMLElement)||!document.contains(t)||t===document.body||t===document.documentElement?!0:!e.contains(t):!1}r(vB,"shouldFocusMainContentAfterNavigation");function yB(e){if(!(e instanceof HTMLElement))return()=>{};const t=window.requestAnimationFrame(()=>{vB(e,document.activeElement)&&e.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(t)}r(yB,"scheduleMainContentFocus");function jB(e=document,t=window){const i=r(()=>{e.documentElement.scrollTop!==0&&(e.documentElement.scrollTop=0),e.body.scrollTop!==0&&(e.body.scrollTop=0)},"onScroll");return t.addEventListener("scroll",i,{capture:!0}),()=>t.removeEventListener("scroll",i,{capture:!0})}r(jB,"pinDocumentScrollToZero");var wB=z_({NotFoundPage:r(()=>sr,"NotFoundPage")});function sr({scope:e="global",requestedPrefix:t}){const i=vn(),{setBreadcrumbs:l}=IS(),{companies:c,selectedCompany:u}=vt();(0,x.useEffect)(()=>{l([{label:"Not Found"}])},[l]);const m=u??c[0]??null,f=m?`/${m.issuePrefix}/dashboard`:"/",h=`${i.pathname}${i.search}${i.hash}`,g=t?.toUpperCase(),v=e==="invalid_company_prefix"?"Organization not found":"Page not found",y=e==="invalid_company_prefix"?`No organization matches prefix "${g??"unknown"}".`:"This route does not exist.";return(0,s.jsx)("div",{className:"mx-auto max-w-2xl py-10",children:(0,s.jsxs)(Dc,{className:"block p-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"rounded-md border border-bad/20 bg-bad/10 p-2",children:(0,s.jsx)(Ja,{className:"h-5 w-5 text-bad"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:v}),(0,s.jsx)("p",{className:"text-sm text-ink-3",children:y})]})]}),(0,s.jsxs)("div",{className:"mt-4 rounded-md border border-line bg-bg-3/20 px-3 py-2 text-xs text-ink-3",children:["Requested path: ",(0,s.jsx)("code",{className:"font-mono",children:h})]}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap gap-2",children:[(0,s.jsx)(le,{asChild:!0,children:(0,s.jsxs)(gn,{to:f,children:[(0,s.jsx)(Wk,{className:"mr-1.5 h-4 w-4"}),"Open dashboard"]})}),(0,s.jsx)(le,{variant:"secondary",asChild:!0,children:(0,s.jsx)(gn,{to:"/",children:"Go home"})})]})]})})}r(sr,"NotFoundPage$1");function kB(e,t){return yC(e,t)[0]?.toLowerCase()??null}r(kB,"getCompanyRouteSegment");var SB=new Set(["browse","connections","assistant-connection","connect","chat","vercel-connect","review","attention","gateways","advanced","app"]);function NB(e){const t=(0,x.useRef)(null);return(0,x.useLayoutEffect)(()=>{const i=t.current,l=i?.parentElement;if(!e||!i||!l)return;const c=r(()=>l.style.setProperty("--mobile-topbar-h",`${i.offsetHeight}px`),"apply");if(c(),typeof ResizeObserver>"u")return()=>l.style.removeProperty("--mobile-topbar-h");const u=new ResizeObserver(c);return u.observe(i),()=>{u.disconnect(),l.style.removeProperty("--mobile-topbar-h")}},[e]),t}r(NB,"useMobileTopbarHeightVar");function CB({sidebarSections:e}){const{sidebarOpen:t,setSidebarOpen:i,toggleSidebar:l,collapsed:c,peeking:u,setPeeking:m,isMobile:f,isTablet:h}=Jn(),g=NB(f),{openNewIssue:v,openOnboarding:y}=Pa(),{togglePanelVisible:j}=q0(),k=bf()?.pushToast??null,{companies:S,loading:N,selectedCompany:_,selectedCompanyId:I,selectionSource:D,setSelectedCompanyId:T}=vt(),{companyPrefix:C,pluginRoutePath:M,agentId:z,routineId:K}=La(),P=bs(),A=vn(),B=nE(),O=c4(A.pathname,C),W=O.builtInContextualSurface==="settings",Y=O.companySegments,ce=O.isTaskDetail,{enabled:oe}=yf(),$=oe&&Y[0]?.toLowerCase()==="chats",R=ce||$,ne=Y[0]?.toLowerCase()==="tools",ue=Y[0]?.toLowerCase()==="apps",ae=ue&&Y[1]&&!SB.has(Y[1].toLowerCase())?Y[1]:null,Ee=ue&&Y[1]?.toLowerCase()==="app"&&Y[2]?Y[2]:null,fe=(0,x.useRef)(!1),Ae=(0,x.useRef)(null),Ce=(0,x.useRef)(null),Se=(0,x.useRef)(new l3),he=(0,x.useRef)(A.key),De=gB(f&&!ce,A.pathname),[Ye,ze]=(0,x.useState)(!1),ve=(0,x.useMemo)(()=>{if(!C)return null;const Re=C.toUpperCase();return S.find(Me=>Me.issuePrefix.toUpperCase()===Re)??null},[S,C]),ft=!!C&&!N&&S.length>0&&!ve,At=(0,x.useMemo)(()=>M?.toLowerCase()??kB(A.pathname,C),[C,A.pathname,M]),xt=ve?.id??null,Pt=ve?.issuePrefix??null,{slots:de}=Tc({slotTypes:["page","routeSidebar"],companyId:xt,enabled:!!(xt&&At)}),Oe=(0,x.useMemo)(()=>I3(de,At),[At,de]),qe=(0,x.useMemo)(()=>({companyId:xt,companyPrefix:Pt}),[xt,Pt]),ut=W?(0,s.jsx)(m4,{}):ae?(0,s.jsx)($j,{kind:"connection",connectionId:ae}):Ee?(0,s.jsx)($j,{kind:"application",applicationId:Ee}):ue||ne?(0,s.jsx)(A4,{}):Oe?(0,s.jsx)(Uc,{surface:`plugin:${Oe.id}`,title:Oe.displayName,children:(0,s.jsx)(x0,{slot:Oe,context:qe,className:"min-h-0 flex-1",missingBehavior:"placeholder"})}):null,Vt=$?(0,s.jsx)(N$,{}):O.builtInContextualSurface==="agent"&&z?(0,s.jsx)(L4,{agentRef:z}):O.builtInContextualSurface==="routine"&&K?(0,s.jsx)(e3,{children:(0,s.jsx)($4,{routineId:K})}):O.builtInContextualSurface==="skills"?(0,s.jsx)(q4,{}):ut,Wt=Vt!=null,H=Wt&&($||O.builtInContextualSurface==="skills"||O.builtInContextualSurface==="agent"||O.builtInContextualSurface==="routine"||ue||ne),rn=W&&(f||h),je=Wt&&!H&&!(h&&W),$e=H,He=Wt?Oe&&!O.builtInContextualSurface?`plugin:${Oe.id}`:O.builtInContextualSurface:null,mt=(0,x.useRef)(null),{data:it}=ge({queryKey:U.health,queryFn:r(()=>Rc.get(),"queryFn"),retry:!1,refetchInterval:r(Re=>Re.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,x.useEffect)(()=>{const Re=mt.current;He&&C&&Re&&Re.surface!==He&&Re.pathname!==A.pathname&&u4({surface:He,companyPrefix:C,previousPathname:Re.pathname}),mt.current={pathname:A.pathname,surface:He}},[C,He,A.pathname]),(0,x.useEffect)(()=>{N||fe.current||it?.deploymentMode!=="authenticated"&&S.length===0&&(fe.current=!0,y())},[S,N,y,it?.deploymentMode]),(0,x.useEffect)(()=>{if(!C||N||S.length===0)return;if(!ve){const Me=(I?S.find(Fe=>Fe.id===I):null)??S[0]??null;Me&&I!==Me.id&&T(Me.id,{source:"route_sync"});return}if(C!==ve.issuePrefix){const Me=A.pathname.replace(/^\/[^/]+/,"");P(`/${ve.issuePrefix}${Me}${A.search}`,{replace:!0});return}const Re=xB({matchedCompany:ve,selectedCompanyId:I,companies:S});if(Re){k?.({title:`${ve.name} is archived`,body:`Switched to ${Re.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${ve.id}`}),T(Re.id,{source:"route_sync"}),P(`/${Re.issuePrefix}/dashboard`,{replace:!0});return}bB({selectionSource:D,selectedCompanyId:I,routeCompanyId:ve.id})&&T(ve.id,{source:"route_sync"})},[C,S,N,ve,A.pathname,A.search,P,k,D,I,T]);const Qt=j,Rn=(0,x.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]),Gt=(0,x.useRef)(null),Tt=(0,x.useRef)(!1),Jt=(0,x.useRef)(!1),kt=(0,x.useCallback)(()=>{Gt.current!==null&&(window.clearTimeout(Gt.current),Gt.current=null)},[]),Qn=(0,x.useCallback)(()=>{kt(),Gt.current=window.setTimeout(()=>m(!0),50)},[kt,m]),pt=(0,x.useCallback)(()=>{kt(),m(!0)},[kt,m]),dn=(0,x.useCallback)(()=>{kt(),Gt.current=window.setTimeout(()=>m(!1),120)},[kt,m]),Rt=(0,x.useCallback)(()=>{Tt.current=!0,c&&!Jt.current&&Qn()},[c,Qn]),ln=(0,x.useCallback)(()=>{Tt.current=!1,Jt.current=!1,dn()},[dn]),Dt=(0,x.useCallback)(()=>{Jt.current||pt()},[pt]),ht=(0,x.useCallback)(()=>{Tt.current||dn()},[dn]);(0,x.useEffect)(()=>kt,[kt]);const Mt=(0,x.useRef)(c);return(0,x.useEffect)(()=>{c!==Mt.current&&(c?(kt(),m(!1),Jt.current=Tt.current):Jt.current=!1,Mt.current=c)},[c,kt,m]),(0,x.useEffect)(()=>{if(!u)return;const Re=r(Me=>{Me.key==="Escape"&&(kt(),m(!1))},"onKeyDown");return window.addEventListener("keydown",Re),()=>window.removeEventListener("keydown",Re)},[u,kt,m]),pB(),oB({onNewIssue:r(()=>v(),"onNewIssue"),onSearch:Rn,onToggleSidebar:l,onTogglePanel:Qt,onShowShortcuts:r(()=>ze(!0),"onShowShortcuts"),onGoToInbox:r(()=>P("/inbox"),"onGoToInbox")}),(0,x.useEffect)(()=>{if(!f)return;const Re=30,Me=50,Fe=75;let St=0,at=0;const Ot=r(Ut=>{const en=Ut.touches[0];St=en.clientX,at=en.clientY},"onTouchStart"),on=r(Ut=>{const en=Ut.changedTouches[0],tn=en.clientX-St;if(!(Math.abs(en.clientY-at)>Fe)){if(!t&&St<Re&&tn>Me){i(!0);return}t&&tn<-50&&i(!1)}},"onTouchEnd");return document.addEventListener("touchstart",Ot,{passive:!0}),document.addEventListener("touchend",on,{passive:!0}),()=>{document.removeEventListener("touchstart",Ot),document.removeEventListener("touchend",on)}},[f,t,i]),(0,x.useEffect)(()=>{const Re=document.body.style.overflow;return document.body.style.overflow=f?"visible":"clip",()=>{document.body.style.overflow=Re}},[f]),(0,x.useEffect)(()=>{if(!f)return jB()},[f]),(0,x.useEffect)(()=>{if(typeof document>"u")return;const Re=Ce.current;return yB(Re)},[A.pathname]),(0,x.useEffect)(()=>{const Re=Ce.current;if(!Re)return;const Me=r(()=>{Se.current.remember(he.current,Re.scrollTop)},"recordScroll");return Re.addEventListener("scroll",Me,{passive:!0}),()=>Re.removeEventListener("scroll",Me)},[]),(0,x.useLayoutEffect)(()=>{const Re=Ce.current,Me=r3({previousPathname:Ae.current,pathname:A.pathname,navigationType:B,state:A.state});Ae.current=A.pathname;const Fe=B==="POP",St=Fe?Se.current.recall(A.key):0;if(he.current=A.key,Fe){Ey(Re,St);const at=requestAnimationFrame(()=>Ey(Re,St));return()=>cancelAnimationFrame(at)}Me&&c3(Re)},[A.key,A.pathname,A.state,B]),(0,s.jsx)(JI,{children:(0,s.jsxs)("div",{"data-app-shell":"",className:X("bg-bg text-ink pt-(--sz-safe-top)",f?"min-h-dvh overflow-x-clip":"flex h-dvh flex-col overflow-clip"),children:[(0,s.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-bg focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:"Skip to Main Content"}),(0,s.jsx)(u$,{}),(0,s.jsx)(UU,{}),(0,s.jsx)(qU,{devServer:it?.devServer}),(0,s.jsx)(HU,{diskSpace:it?.diskSpace,warnings:it?.warnings}),(0,s.jsx)(ZU,{}),(0,s.jsx)(a$,{}),(0,s.jsxs)("div",{className:X("min-h-0 flex-1",f?"w-full":"flex overflow-clip"),children:[f&&t&&(0,s.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/50",onClick:r(()=>i(!1),"onClick"),"aria-label":"Close sidebar"}),f?(0,s.jsxs)("div",{className:X("fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",t?"translate-x-0":"-translate-x-full"),children:[(0,s.jsx)("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:(0,s.jsx)("div",{className:"w-60 shrink-0 overflow-hidden",children:Wt?(0,s.jsx)(od,{children:Vt}):(0,s.jsx)(Pj,{children:e})})}),(0,s.jsx)(Nw,{deploymentMode:it?.deploymentMode,forceExpanded:je})]}):(0,s.jsxs)(C$,{open:t,collapsed:je?!1:c,peeking:je?!1:u,resizable:!0,onPanelMouseEnter:je?void 0:Rt,onPanelMouseLeave:je?void 0:ln,onPanelFocusCapture:!je&&c?Dt:void 0,onPanelBlurCapture:!je&&c?ht:void 0,children:[(0,s.jsx)("div",{className:"flex flex-1 min-h-0",children:je?(0,s.jsx)(od,{children:Vt}):(0,s.jsx)(Pj,{children:e})}),(0,s.jsx)(Nw,{deploymentMode:it?.deploymentMode,forceExpanded:je})]}),!f&&$e&&!H?(0,s.jsx)(od,{className:"w-60 shrink-0",children:Vt}):null,(0,s.jsxs)("div",{className:X("flex min-w-0 flex-col",f?"w-full":"h-full flex-1"),children:[(0,s.jsxs)("div",{ref:g,"data-slot":f?"mobile-topbar":void 0,className:X(!f&&R&&"hidden",f&&"sticky top-0 z-20 bg-bg/95 backdrop-blur supports-[backdrop-filter]:bg-bg/85"),children:[(0,s.jsx)(bw,{mobile:f,onNavigateHome:r(()=>P("/dashboard"),"onNavigateHome")}),(0,s.jsx)(qj,{}),rn?(0,s.jsx)("div",{className:"border-b border-line px-4 pb-3",children:(0,s.jsx)(b4,{})}):null]}),(0,s.jsxs)("div",{className:X(f?"block":"relative flex flex-1 min-h-0",!f&&R&&"streamlined-task-detail-surface"),children:[!f&&H?(0,s.jsx)(od,{className:"w-60 shrink-0 bg-bg",children:Vt}):null,(0,s.jsxs)("div",{className:X(!f&&R?"flex min-w-0 flex-1 flex-col":"contents"),children:[!f&&R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(bw,{mobile:!1,onNavigateHome:r(()=>P("/dashboard"),"onNavigateHome")}),(0,s.jsx)(qj,{taskDetailLayout:!0})]}):null,(0,s.jsx)("main",{id:"main-content",ref:Ce,tabIndex:-1,style:f?{"--tc-composer-bottom":"var(--sz-calc-14)"}:void 0,className:X("flex-1 p-4 outline-none md:p-6",!f&&R&&"pt-0 md:pt-0",f?"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:ft?(0,s.jsx)(sr,{scope:"invalid_company_prefix",requestedPrefix:C??_?.issuePrefix}):(0,s.jsx)(v$,{children:(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:(0,s.jsx)(Zl,{})})})})]}),(0,s.jsx)(oz,{taskDetailLayout:!f&&R})]})]})]}),f&&(0,s.jsx)(OU,{visible:De}),(0,s.jsx)(Zz,{}),(0,s.jsx)(ZP,{}),(0,s.jsx)(eU,{}),(0,s.jsx)(aU,{}),(0,s.jsx)(pU,{}),(0,s.jsx)(bU,{open:Ye,onOpenChange:ze}),(0,s.jsx)(wU,{}),(0,s.jsx)(EU,{health:it}),(0,s.jsx)(MU,{localTrusted:it?.deploymentMode==="local_trusted"})]})})}r(CB,"Layout");var Cw=null;function AB(){return Cw??=new mf,Cw}r(AB,"getDetachedClient");function _B(){const e=(0,x.useContext)(Jg),{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn"),enabled:e!=null},e??AB());return e?{enabled:t?.enableConferenceRoomChat===!0,loaded:i}:{enabled:!1,loaded:!0}}r(_B,"useConferenceRoomChatEnabled");function EB(){const{enabled:e,loaded:t}=_B();return t?e?(0,s.jsx)(Zl,{}):(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):null}r(EB,"ConferenceRoomChatGate");function Gi({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enablePipelines!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(Gi,"PipelinesExperimentalGate");function Aw({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enableCases!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(Aw,"CasesExperimentalGate");function _w({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enableStatusCards!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(_w,"StatusCardsExperimentalGate");function IB({children:e}){const{data:t,isFetched:i}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return i?t?.enablePixelsOffice!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(s.Fragment,{children:e}):null}r(IB,"PixelsOfficeExperimentalGate");function Aa({pageKey:e}){const{hidden:t,loaded:i}=lr();return i?t.has(e)?(0,s.jsx)(Qe,{to:"/company/settings",replace:!0}):(0,s.jsx)(Zl,{}):null}r(Aa,"HiddenSettingsPageGate");function ph(){const{data:e,isFetched:t}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn")});return t?e?.enableIsolatedWorkspaces!==!0?(0,s.jsx)(Qe,{to:"/dashboard",replace:!0}):(0,s.jsx)(Zl,{}):null}r(ph,"IsolatedWorkspacesRouteGate");function Il(){const e=vn(),{workspaceId:t}=La(),{companies:i,loading:l}=vt(),c=ge({queryKey:U.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Lf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t)return(0,s.jsx)(sr,{scope:"global"});if(l||c.isPending)return(0,s.jsx)(Ra,{});if(c.isError)return(0,s.jsx)(sr,{scope:"global"});const u=i.find(m=>m.id===c.data.companyId);return u?(0,s.jsx)(Qe,{to:`/${u.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):(0,s.jsx)(sr,{scope:"global"})}r(Il,"UnprefixedExecutionWorkspaceRedirect");function TB(){const{companyPrefix:e,workspaceId:t}=La(),{companies:i,loading:l}=vt(),c=ge({queryKey:U.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Lf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t||!e)return(0,s.jsx)(sr,{scope:"global"});if(l||c.isPending)return(0,s.jsx)(Ra,{});if(c.isError)return(0,s.jsx)(sr,{scope:"global"});const u=i.find(m=>m.issuePrefix.toUpperCase()===e.toUpperCase());return!u||u.id!==c.data.companyId?(0,s.jsx)(sr,{scope:"global"}):(0,s.jsx)(Zl,{})}r(TB,"ExecutionWorkspaceCompanyGate");var xs={status:r((e={})=>{const t=new URLSearchParams;e.command&&t.set("command",e.command),e.network&&t.set("network","1");const i=t.toString();return we.get(`/onboarding/omp${i?`?${i}`:""}`)},"status"),browse:r(e=>we.get(`/onboarding/omp/browse${e?`?path=${encodeURIComponent(e)}`:""}`),"browse"),loginProviders:r((e=!1)=>we.get(`/onboarding/omp/login/providers${e?"?refresh=1":""}`),"loginProviders"),startLogin:r(e=>we.post("/onboarding/omp/login",{provider:e}),"startLogin"),login:r(e=>we.get(`/onboarding/omp/login/${encodeURIComponent(e)}`),"login"),answerLogin:r((e,t)=>we.post(`/onboarding/omp/login/${encodeURIComponent(e)}/input`,{value:t}),"answerLogin"),cancelLogin:r(e=>we.delete(`/onboarding/omp/login/${encodeURIComponent(e)}`),"cancelLogin"),customProviders:r(()=>we.get("/onboarding/omp/custom-providers"),"customProviders"),saveCustomProvider:r((e,t)=>we.put(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`,t),"saveCustomProvider"),removeCustomProvider:r(e=>we.delete(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`),"removeCustomProvider"),fetchCustomProviderModels:r(e=>we.post("/onboarding/omp/custom-providers/models",e),"fetchCustomProviderModels"),probeCustomProvider:r(e=>we.post("/onboarding/omp/custom-providers/probe",e),"probeCustomProvider"),remote:r(e=>we.post("/onboarding/omp/remote",{address:e}),"remote")};function RB(e){return{heartbeat:{enabled:e?.heartbeatEnabled??ky.heartbeatEnabled,intervalSec:e?.intervalSec??ky.intervalSec,wakeOnDemand:!0,skipTimerWhenNoActionableWork:!0,cooldownSec:10,maxConcurrentRuns:20}}}r(RB,"buildNewAgentRuntimeConfig");function DB({className:e,...t}){return(0,s.jsx)("div",{role:"group","data-slot":"segmented",className:X("inline-flex items-center gap-0.5 rounded-md border border-line-strong bg-bg-2 p-0.5",e),...t})}r(DB,"Segmented");function MB({selected:e=!1,className:t,type:i="button",...l}){return(0,s.jsx)("button",{type:i,"data-slot":"segmented-item","aria-pressed":e,className:X("inline-flex h-7 items-center justify-center gap-1.5 whitespace-nowrap rounded-sm px-2.5 text-(length:--t-13) font-medium text-ink-2 transition-(--tp-color-background-color-border-color-box-shadow-opacity) outline-hidden hover:bg-bg-3 hover:text-ink focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:pointer-events-none disabled:text-ink-3 aria-pressed:bg-ink aria-pressed:text-bg-2 aria-pressed:hover:bg-ink aria-pressed:hover:text-bg-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}r(MB,"SegmentedItem");var OB="input:not([type=hidden]):not(:disabled), select:not(:disabled), textarea:not(:disabled)",LB="Discard your unsaved changes?",zB=2/3;function PB(e,t){const[i,l]=(0,x.useState)(null),c=(0,x.useRef)(!1),u=(0,x.useRef)(new Map),m=(0,x.useRef)(e);m.current=e;const f=(0,x.useRef)(i);f.current=i;const h=(0,x.useId)(),g=i===null?null:e(i),v=(0,x.useCallback)(D=>`${h}-row-editor-${D.replace(/\s+/g,"_")}`,[h]),y=r(()=>!c.current||window.confirm(LB),"mayDiscard"),j=(0,x.useCallback)((D=!0)=>{const T=f.current;if(c.current=!1,l(null),T===null||!D)return;const C=m.current(T);requestAnimationFrame(()=>{const M=u.current.get(C);(M?.isConnected?M:t?.current)?.focus()})},[t]),k=r(D=>g===e(D)?!0:g!==null&&!y()?!1:(c.current=!1,l(D),!0),"request"),S=r(D=>{if(g!==e(D)){k(D);return}y()&&j()},"toggle"),N=r(()=>{y()&&j()},"dismiss"),_=(0,x.useCallback)(D=>{c.current=D},[]);return{open:i,openKey:g,request:k,toggle:S,close:j,dismiss:N,setDirty:_,triggerProps:r(D=>({ref:r(T=>{T?u.current.set(D,T):u.current.delete(D)},"ref"),"aria-expanded":g===D,"aria-controls":g===D?v(D):void 0}),"triggerProps"),panelId:v}}r(PB,"useInlineRowEditor");function Ew({id:e,onEscape:t,className:i,children:l}){const c=(0,x.useRef)(null);(0,x.useEffect)(()=>{const m=c.current;if(!m)return;m.querySelector(OB)?.focus({preventScroll:!0});const f=m.getBoundingClientRect().top;if(f>=0&&f<=window.innerHeight*zB)return;const h=m.parentElement?.tagName==="LI"?m.previousElementSibling:null;h?h.scrollIntoView?.({block:"center"}):m.scrollIntoView?.({block:"start"})},[]);const u=r(m=>{m.key!=="Escape"||m.defaultPrevented||(m.preventDefault(),m.stopPropagation(),t())},"onKeyDown");return(0,s.jsx)("div",{ref:c,id:e,className:X("scroll-mt-16",i),onKeyDown:u,children:l})}r(Ew,"InlineRowEditorPanel");var UB=2e3,Iw=["omp","login-providers"];function hh(e){return e instanceof Error?e.message:"Something went wrong"}r(hh,"errorText");function Cs({tone:e,children:t}){return(0,s.jsx)("div",{role:e==="bad"?"alert":"status",className:X("rounded-md border px-3 py-2 text-sm",e==="bad"?"border-bad text-ink":e==="ok"?"border-ok text-ink":"border-line text-ink-2"),children:t})}r(Cs,"OmpNote");function $B({onSignedIn:e,autoFocus:t=!1}){const i=wn(),l=ge({queryKey:Iw,queryFn:r(()=>xs.loginProviders(),"queryFn"),staleTime:6e5}),[c,u]=(0,x.useState)(""),[m,f]=(0,x.useState)(null),[h,g]=(0,x.useState)(""),v=c||l.data?.providers[0]||"",y=Kt({mutationFn:r(C=>xs.startLogin(C.name),"mutationFn"),onSuccess:r((C,{popup:M})=>{g(""),f(C),M&&C.url&&C.state==="waiting"?M.location.href=C.url:M?.close()},"onSuccess"),onError:r((C,{popup:M})=>M?.close(),"onError")}),j=Kt({mutationFn:r(C=>xs.answerLogin(m.id,C),"mutationFn"),onSuccess:r(C=>{g(""),f(C)},"onSuccess")}),k=Kt({mutationFn:r(C=>xs.cancelLogin(C),"mutationFn"),onSettled:r(()=>f(null),"onSettled")}),S=m?.state==="waiting",N=ge({queryKey:["omp","login",m?.id??""],queryFn:r(()=>xs.login(m.id),"queryFn"),enabled:S,refetchInterval:UB});(0,x.useEffect)(()=>{N.data&&N.data.id===m?.id&&f(N.data)},[N.data,m?.id]);const _=(0,x.useRef)(null),I=(0,x.useRef)(e);I.current=e;const D=m?.state==="succeeded"?m.id:null;(0,x.useEffect)(()=>{!D||_.current===D||(_.current=D,i.invalidateQueries({queryKey:["agents"]}),I.current?.())},[D,i]);function T(C){C.preventDefault(),h.trim()&&j.mutate(h.trim())}return r(T,"submitAnswer"),l.isLoading?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Asking OMP which providers it can sign in to..."}):l.error?(0,s.jsxs)(Cs,{tone:"bad",children:[hh(l.error)," ",(0,s.jsx)(le,{type:"button",variant:"link",size:"xs",onClick:r(()=>{l.refetch()},"onClick"),children:"Try again"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[!m||!S?(0,s.jsxs)("form",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",onSubmit:r(C=>{C.preventDefault(),v&&y.mutate({name:v,popup:window.open("about:blank","_blank")})},"onSubmit"),children:[(0,s.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:["Provider",(0,s.jsx)(Zh,{value:v,onChange:r(C=>u(C.target.value),"onChange"),autoFocus:t,className:"w-full",children:l.data?.providers.map(C=>(0,s.jsx)("option",{value:C,children:C},C))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(le,{type:"submit",disabled:!v||y.isPending,className:"flex-1 sm:flex-none",children:y.isPending?"Starting...":"Sign in"}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon","aria-label":"Reload provider list",title:"Reload provider list",onClick:r(()=>{xs.loginProviders(!0).then(C=>i.setQueryData(Iw,C))},"onClick"),children:(0,s.jsx)(Yr,{"aria-hidden":"true"})})]})]}):null,y.error?(0,s.jsx)(Cs,{tone:"bad",children:hh(y.error)}):null,m?(0,s.jsxs)("section",{"aria-label":`Sign-in to ${m.provider}`,className:"flex flex-col gap-3 rounded-lg border border-line bg-bg-2 px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("b",{className:"text-sm font-semibold",children:m.provider}),S?(0,s.jsx)(le,{type:"button",variant:"ghost",size:"xs",disabled:k.isPending,onClick:r(()=>k.mutate(m.id),"onClick"),children:"Cancel"}):null]}),S&&m.url?(0,s.jsxs)("ol",{className:"flex list-decimal flex-col gap-1.5 ps-5 text-sm text-ink-2",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-medium text-accent underline underline-offset-4",children:["Open the sign-in page ",(0,s.jsx)(bS,{"aria-hidden":"true",className:"size-3.5"})]})," ","(already opened in a new tab unless the browser blocked it) and approve access."]}),m.prompt&&!m.prompt.secret?(0,s.jsx)("li",{children:"If the page ends on an address that does not load (it starts with http://localhost), copy that whole address from the browser bar and paste it below. On the machine that runs Wardmote this step finishes by itself."}):(0,s.jsx)("li",{children:"Enter the code OMP shows below if the page asks for one. This panel moves on by itself once you approve."})]}):null,S&&m.prompt?(0,s.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,s.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:[m.prompt.label.replace(/:$/,""),(0,s.jsx)(Wn,{value:h,onChange:r(C=>g(C.target.value),"onChange"),type:m.prompt.secret?"password":"text",autoComplete:"off",spellCheck:!1,autoFocus:!m.url})]}),(0,s.jsx)(le,{type:"submit",disabled:!h.trim()||j.isPending,children:j.isPending?"Sending...":"Send"})]}):null,S&&!m.prompt&&!m.url?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Waiting for OMP..."}):null,S&&m.message?(0,s.jsx)(Cs,{tone:"bad",children:m.message}):null,j.error?(0,s.jsx)(Cs,{tone:"bad",children:hh(j.error)}):null,m.state==="succeeded"?(0,s.jsxs)(Cs,{tone:"ok",children:[m.message??"Signed in",". Models from this provider are ready."]}):null,m.state==="failed"?(0,s.jsxs)(Cs,{tone:"bad",children:[m.message??"Sign-in failed",". Check the account on the provider's page, then press Sign in again."]}):null,S&&!m.prompt&&m.lines.length?(0,s.jsx)("pre",{"aria-label":"OMP output",className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-bg-3 px-3 py-2 font-mono text-xs text-ink-2",children:m.lines.join(`
55
55
  `)}):null,(!S||m.prompt)&&m.lines.length?(0,s.jsxs)("details",{className:"text-xs text-ink-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer select-none",children:"What OMP printed"}),(0,s.jsx)("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-bg-3 px-3 py-2 font-mono",children:m.lines.join(`
56
56
  `)})]}):null]}):null]})}r($B,"OmpSignIn");var gh=500,xh=10,BB=(0,x.memo)(r(function({result:t,savedIds:i,room:l,onAdd:c}){const[u,m]=(0,x.useState)(""),[f,h]=(0,x.useState)(()=>new Set),g=(0,x.useMemo)(()=>t.models.filter(_=>!i.has(_.id)),[t.models,i]),v=(0,x.useMemo)(()=>{if(t.truncated)return[];const _=new Set(t.models.map(I=>I.id));return[...i].filter(I=>!_.has(I))},[t.models,t.truncated,i]),y=(0,x.useMemo)(()=>{const _=u.trim().toLowerCase();return _?t.models.filter(I=>I.id.toLowerCase().includes(_)||I.name?.toLowerCase().includes(_)):t.models},[u,t.models]),j=g.filter(_=>f.has(_.id));function k(_,I){h(D=>{const T=new Set(D);return I?T.add(_):T.delete(_),T})}r(k,"toggle");function S(_){c(_),h(new Set)}r(S,"add");const N=r(_=>_>l,"overLimit");return(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border border-line-soft p-3","aria-label":"Upstream models",children:[(0,s.jsxs)("p",{className:"text-sm",children:[t.url," lists ",t.models.length," ",t.models.length===1?"model":"models",t.truncated?" (more exist; only these were read)":"",": ",g.length," new, ",t.models.length-g.length," already added."]}),v.length?(0,s.jsxs)(Cs,{tone:"info",children:[v.length," saved ",v.length===1?"model is":"models are"," not listed upstream and ",v.length===1?"stays":"stay"," until you remove ",v.length===1?"it":"them",": ",v.slice(0,xh).join(", "),v.length>xh?`, and ${v.length-xh} more`:"","."]}):null,(0,s.jsx)(Wn,{value:u,onChange:r(_=>m(_.target.value),"onChange"),placeholder:"Search upstream models","aria-label":"Search upstream models",autoComplete:"off"}),(0,s.jsxs)("ul",{className:"flex max-h-72 flex-col overflow-y-auto rounded-md border border-line-soft",children:[y.slice(0,gh).map(_=>{const I=i.has(_.id);return(0,s.jsx)("li",{className:"border-b border-line-soft last:border-b-0",children:(0,s.jsxs)("label",{className:"flex items-center gap-2 px-2 py-1.5 text-sm",children:[(0,s.jsx)("input",{type:"checkbox",checked:I||f.has(_.id),disabled:I,onChange:r(D=>k(_.id,D.target.checked),"onChange"),"aria-label":_.id}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:_.id}),_.name?(0,s.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:_.name}):null,I?(0,s.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:"Added"}):null]})},_.id)}),y.length===0?(0,s.jsx)("li",{className:"px-2 py-1.5 text-sm text-ink-3",children:"No upstream model matches."}):null]}),y.length>gh?(0,s.jsxs)("span",{className:"text-xs text-ink-3",children:["Showing ",gh," of ",y.length,"; search to narrow the list."]}):null,(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)(le,{type:"button",size:"sm",disabled:j.length===0||N(j.length),onClick:r(()=>S(j),"onClick"),children:["Add selected",j.length?` (${j.length})`:""]}),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",disabled:g.length===0||N(g.length),onClick:r(()=>S(g),"onClick"),children:["Add all",g.length?` (${g.length})`:""]}),N(Math.max(j.length,g.length))?(0,s.jsxs)("span",{className:"text-xs text-ink-3",children:["Only ",l," more ",l===1?"model fits":"models fit","; a provider holds at most ",500,"."]}):null]})]})},"UpstreamModelPicker")),bh=["omp","custom-providers"],KB={"openai-responses":"OpenAI Responses (/responses): most OpenAI-compatible gateways","openai-completions":"OpenAI Chat Completions (/chat/completions): vLLM, LiteLLM, Ollama, llama.cpp","anthropic-messages":"Anthropic Messages (/messages)","openai-codex-responses":"ChatGPT Codex backend: only with a ChatGPT sign-in token","google-generative-ai":"Google Gemini API","google-vertex":"Google Vertex AI","google-gemini-cli":"Gemini CLI backend","azure-openai-responses":"Azure OpenAI Responses","bedrock-converse-stream":"AWS Bedrock Converse"},qB={"openai-models-list":"OpenAI /models list",proxy:"Proxy (models from the gateway)",litellm:"LiteLLM",ollama:"Ollama","llama.cpp":"llama.cpp","lm-studio":"LM Studio","apple-foundation-models":"Apple Foundation Models"},Cd={id:"",name:"",api:"",contextWindow:"",maxTokens:"",reasoning:!1,images:!1};function FB(e){return e?{name:e.name,baseUrl:e.baseUrl??"",api:e.api??"",keyMode:e.apiKey.kind==="none"?"none":e.apiKey.kind==="missing"?"literal":"keep",keyValue:"",authHeader:e.authHeader,disableStrictTools:e.disableStrictTools,discovery:e.discovery?.type??"",discoveryTimeout:e.discovery?.timeoutMs?String(e.discovery.timeoutMs):"",injectV1:e.discovery?.injectV1??!1,headers:e.headers.map(t=>({name:t.name,value:"",saved:!0})),models:e.models.map(t=>({id:t.id,name:t.name??"",api:t.api??"",contextWindow:t.contextWindow?String(t.contextWindow):"",maxTokens:t.maxTokens?String(t.maxTokens):"",reasoning:t.reasoning??!1,images:t.images??!1}))}:{name:"",baseUrl:"",api:"openai-responses",keyMode:"literal",keyValue:"",authHeader:!1,disableStrictTools:!1,discovery:"",discoveryTimeout:"",injectV1:!1,headers:[],models:[{...Cd}]}}r(FB,"initialState");function Ag(e){switch(e.keyMode){case"keep":return{kind:"keep"};case"none":return{kind:"none"};case"env":return{kind:"env",name:e.keyValue.trim()};case"command":return{kind:"command",command:e.keyValue.trim()};default:return{kind:"literal",value:e.keyValue.trim()}}}r(Ag,"keyInput");function Tl(e){const t=Number(e.replace(/[_,\s]/g,""));return e.trim()&&Number.isInteger(t)&&t>0?t:void 0}r(Tl,"positive");function _g(e){return e.headers.filter(t=>t.name.trim()).map(t=>t.saved&&!t.value?{name:t.name.trim()}:{name:t.name.trim(),value:t.value})}r(_g,"headersInput");function HB(e){return{baseUrl:e.baseUrl.trim(),api:e.api||null,apiKey:Ag(e),authHeader:e.authHeader,disableStrictTools:e.disableStrictTools,headers:_g(e),discovery:e.discovery?{type:e.discovery,...Tl(e.discoveryTimeout)?{timeoutMs:Tl(e.discoveryTimeout)}:{},...e.discovery==="openai-models-list"&&e.injectV1?{injectV1:!0}:{}}:null,models:e.models.filter(t=>t.id.trim()).map(t=>({id:t.id.trim(),...t.name.trim()?{name:t.name.trim()}:{},...t.api?{api:t.api}:{},...Tl(t.contextWindow)?{contextWindow:Tl(t.contextWindow)}:{},...Tl(t.maxTokens)?{maxTokens:Tl(t.maxTokens)}:{},...t.reasoning?{reasoning:!0}:{},...t.images?{images:!0}:{}}))}}r(HB,"toInput");function dc(e){if(e instanceof Si){const t=e.body?.details;if(Array.isArray(t)){const i=t.map(l=>typeof l?.message=="string"?`${Array.isArray(l.path)?`${l.path.join(".")}: `:""}${l.message}`:null).filter(l=>!!l);if(i.length)return i}return[e.message]}return[e instanceof Error?e.message:"Something went wrong"]}r(dc,"problemsOf");function ec({label:e,hint:t,children:i}){return(0,s.jsxs)("label",{className:"flex min-w-0 flex-col gap-1.5 text-sm font-medium",children:[e,i,t?(0,s.jsx)("span",{className:"text-xs font-normal text-ink-3",children:t}):null]})}r(ec,"Field");function vh({label:e,hint:t,checked:i,onChange:l}){return(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("span",{className:"flex flex-col gap-0.5 text-sm",children:[(0,s.jsx)("span",{className:"font-medium",children:e}),(0,s.jsx)("span",{className:"text-xs text-ink-3",children:t})]}),(0,s.jsx)(OS,{checked:i,onCheckedChange:l,"aria-label":e})]})}r(vh,"Toggle");function Tw({provider:e,takenNames:t,onSaved:i,onCancel:l,onDirtyChange:c}){const[u]=(0,x.useState)(()=>FB(e)),[m,f]=(0,x.useState)(u),h=JSON.stringify(m)!==JSON.stringify(u);(0,x.useEffect)(()=>c?.(h),[h,c]);const[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),k=r(O=>f(W=>({...W,...O})),"set"),S=r((O,W)=>f(Y=>({...Y,models:Y.models.map((ce,oe)=>oe===O?{...ce,...W}:ce)})),"setModel"),N=r((O,W)=>f(Y=>({...Y,headers:Y.headers.map((ce,oe)=>oe===O?{...ce,...W}:ce)})),"setHeader"),_=e!==null,I=!_&&m.name&&!P_.test(m.name)?"Use letters, digits, dot, dash or underscore":!_&&t.includes(m.name)?"A provider with this name already exists; edit it instead":null,D=Kt({mutationFn:r(()=>xs.saveCustomProvider(m.name.trim(),HB(m)),"mutationFn"),onSuccess:i}),T=Kt({mutationFn:r(()=>xs.probeCustomProvider({..._?{name:e.name}:{},baseUrl:m.baseUrl.trim(),apiKey:Ag(m),authHeader:m.authHeader,headers:_g(m),...m.models[0]?.id.trim()?{modelId:m.models[0].id.trim()}:{}}),"mutationFn"),onSuccess:r(O=>{v(O),f(W=>({...W,api:O.suggestedApi??W.api,models:W.models.some(Y=>Y.id.trim())||!O.usedModel?W.models:[{...Cd,id:O.usedModel}]}))},"onSuccess"),onError:r(()=>v(null),"onError")}),C=Kt({mutationFn:r(()=>xs.fetchCustomProviderModels({..._?{name:e.name}:{},baseUrl:m.baseUrl.trim(),api:m.api||null,apiKey:Ag(m),authHeader:m.authHeader,headers:_g(m)}),"mutationFn"),onSuccess:j,onError:r(()=>j(null),"onError")}),M=m.models.map(O=>O.id.trim()).filter(Boolean).join(`
57
57
  `),z=(0,x.useMemo)(()=>new Set(M?M.split(`
58
- `):[]),[M]),K=(0,x.useMemo)(()=>y&&!y.error&&!y.truncated?new Set(y.models.map(O=>O.id)):null,[y]),P=(0,x.useCallback)(O=>{f(W=>{const Y=W.models.filter($=>$.id.trim()),ce=new Set(Y.map($=>$.id.trim())),oe=O.filter($=>!ce.has($.id)).map($=>({...Cd,id:$.id,name:$.name??""}));return{...W,models:[...Y,...oe]}})},[]);function A(O){O.preventDefault(),I||D.mutate()}r(A,"submit");const B=[..._&&e.apiKey.kind!=="none"&&e.apiKey.kind!=="missing"?[{mode:"keep",label:"Keep saved"}]:[],{mode:"literal",label:"Key"},{mode:"env",label:"Env variable"},{mode:"command",label:"Command"},{mode:"none",label:"No key"}];return(0,s.jsxs)("form",{onSubmit:A,"aria-label":_?`Edit ${e.name}`:"Add a custom provider",className:"flex flex-col gap-4 rounded-lg border border-line bg-bg-2 px-4 py-4 sm:px-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:_?`Edit ${e.name}`:"Add a custom provider"}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:(0,s.jsx)(is,{"aria-hidden":"true"})})]}),_&&e.otherKeys.length?(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Also kept as written in models.yml: ",e.otherKeys.join(", "),"."]}):null,(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsx)(ec,{label:"Name",hint:I??"Used in model ids, e.g. my-gateway/model",children:(0,s.jsx)(Wn,{value:m.name,onChange:r(O=>k({name:O.target.value}),"onChange"),disabled:_,required:!0,"aria-invalid":!!I,placeholder:"my-gateway",autoComplete:"off"})}),(0,s.jsx)(ec,{label:"Base URL",hint:"Usually ends in /v1",children:(0,s.jsx)(Wn,{value:m.baseUrl,onChange:r(O=>k({baseUrl:O.target.value}),"onChange"),required:!0,type:"url",placeholder:"http://localhost:8000/v1",autoComplete:"off"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"API key"}),(0,s.jsx)(DB,{"aria-label":"Where the key comes from",className:"flex-wrap self-start",children:B.map(({mode:O,label:W})=>(0,s.jsx)(MB,{selected:m.keyMode===O,onClick:r(()=>k({keyMode:O,keyValue:""}),"onClick"),children:W},O))}),m.keyMode==="literal"?(0,s.jsx)(Wn,{value:m.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),type:"password",autoComplete:"off",required:!0,"aria-label":"API key",placeholder:"sk-..."}):m.keyMode==="env"?(0,s.jsx)(Wn,{value:m.keyValue,onChange:r(O=>k({keyValue:O.target.value.toUpperCase()}),"onChange"),required:!0,"aria-label":"Environment variable name",placeholder:"MY_GATEWAY_KEY",autoComplete:"off"}):m.keyMode==="command"?(0,s.jsx)(Wn,{value:m.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),required:!0,"aria-label":"Command that prints the key",placeholder:"op read op://vault/gateway/key",autoComplete:"off",className:"font-mono"}):null,(0,s.jsx)("span",{className:"text-xs text-ink-3",children:m.keyMode==="keep"?`The saved ${e?.apiKey.kind==="env"?`variable ${e.apiKey.name}`:e?.apiKey.kind==="command"?"command":"key"} stays as it is.`:m.keyMode==="env"?"OMP reads the key from this variable on the machine that runs agents.":m.keyMode==="command"?"OMP runs this command and uses what it prints.":m.keyMode==="none"?"For local servers that need no key.":"Saved in OMP's models.yml. Wardmote never shows it again."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(ec,{label:"Wire format (api)",hint:"Picking the wrong one is the most common mistake. Test connection suggests the right one.",children:(0,s.jsxs)(Zh,{value:m.api,onChange:r(O=>k({api:O.target.value}),"onChange"),className:"w-full",children:[(0,s.jsx)("option",{value:"",children:"Set per model"}),X_.map(O=>(0,s.jsx)("option",{value:O,children:KB[O]??O},O))]})}),(0,s.jsx)(le,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!m.baseUrl.trim()||T.isPending,onClick:r(()=>T.mutate(),"onClick"),children:T.isPending?"Testing...":"Test connection"}),T.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(T.error).join(" ")}):null,g?(0,s.jsxs)(Cs,{tone:g.suggestedApi?"ok":"bad",children:[g.suggestedApi?`${g.suggestedApi} answered${g.usedModel?` for ${g.usedModel}`:""}, so the wire format is set to it.`:g.usedModel?`No wire format answered for ${g.usedModel}. Check the base URL, key and model id.`:"The server listed no models. Add a model id below, then test again.",(0,s.jsx)("ul",{className:"mt-1 flex flex-col gap-0.5 text-xs text-ink-3",children:g.attempts.map(O=>(0,s.jsxs)("li",{className:"break-all",children:[O.api,": ",O.status??"no answer",O.detail&&!O.ok?` (${O.detail})`:""]},O.api))})]}):null]}),(0,s.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,s.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Models"}),m.models.map((O,W)=>(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 rounded-md border border-line-soft p-2 sm:grid-cols-[2fr_2fr_1fr_1fr_auto]",children:[K&&O.id.trim()&&!K.has(O.id.trim())?(0,s.jsx)("span",{className:"col-span-2 text-xs text-ink-3 sm:col-span-5",children:"Not listed upstream any more; kept until you remove it."}):null,(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} id`,value:O.id,onChange:r(Y=>S(W,{id:Y.target.value}),"onChange"),placeholder:"model id",className:"col-span-2 sm:col-span-1",autoComplete:"off"}),(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} name`,value:O.name,onChange:r(Y=>S(W,{name:Y.target.value}),"onChange"),placeholder:"Display name",className:"col-span-2 sm:col-span-1"}),(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} context window`,value:O.contextWindow,onChange:r(Y=>S(W,{contextWindow:Y.target.value}),"onChange"),placeholder:"Context",inputMode:"numeric"}),(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} max output tokens`,value:O.maxTokens,onChange:r(Y=>S(W,{maxTokens:Y.target.value}),"onChange"),placeholder:"Max output",inputMode:"numeric"}),(0,s.jsxs)("div",{className:"col-span-2 flex items-center justify-between gap-3 text-xs sm:col-span-1",children:[(0,s.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:O.reasoning,onChange:r(Y=>S(W,{reasoning:Y.target.checked}),"onChange")}),"Thinks"]}),(0,s.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:O.images,onChange:r(Y=>S(W,{images:Y.target.checked}),"onChange")}),"Images"]}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove model ${W+1}`,onClick:r(()=>k({models:m.models.filter((Y,ce)=>ce!==W)}),"onClick"),children:(0,s.jsx)(Fh,{"aria-hidden":"true"})})]})]},W)),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>k({models:[...m.models,{...Cd}]}),"onClick"),children:[(0,s.jsx)(Js,{"aria-hidden":"true"}),"Add model"]}),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",disabled:!m.baseUrl.trim()||C.isPending,onClick:r(()=>C.mutate(),"onClick"),children:[(0,s.jsx)(MT,{"aria-hidden":"true"}),C.isPending?"Fetching...":"Fetch models"]})]}),C.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(C.error).join(" ")}):null,y?.error?(0,s.jsx)(Cs,{tone:"bad",children:y.error}):null,y&&!y.error?(0,s.jsx)(BB,{result:y,savedIds:z,room:500-z.size,onAdd:P}):null,(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Leave context and max output empty when unsure; OMP fills known models in."})]}),(0,s.jsxs)("details",{className:"flex flex-col gap-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer select-none text-sm font-medium",children:"Advanced"}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[(0,s.jsx)(vh,{label:"Send the key as an Authorization header",hint:"OpenAI wire formats already do. Turn on for discovery or proxies that need it.",checked:m.authHeader,onChange:r(O=>k({authHeader:O}),"onChange")}),(0,s.jsx)(vh,{label:"Disable strict tools",hint:"For Anthropic-style proxies that reject strict tool schemas.",checked:m.disableStrictTools,onChange:r(O=>k({disableStrictTools:O}),"onChange")}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsx)(ec,{label:"Model discovery",hint:"Ask the server for its models instead of listing them",children:(0,s.jsxs)(Zh,{value:m.discovery,onChange:r(O=>k({discovery:O.target.value}),"onChange"),className:"w-full",children:[(0,s.jsx)("option",{value:"",children:"Off"}),H_.map(O=>(0,s.jsx)("option",{value:O,children:qB[O]??O},O))]})}),m.discovery?(0,s.jsx)(ec,{label:"Discovery timeout (ms)",children:(0,s.jsx)(Wn,{value:m.discoveryTimeout,onChange:r(O=>k({discoveryTimeout:O.target.value}),"onChange"),inputMode:"numeric",placeholder:"OMP default"})}):null]}),m.discovery==="openai-models-list"?(0,s.jsx)(vh,{label:"Add /v1 to the discovery URL",hint:"Turn on when the base URL has no /v1 but the model list lives under it.",checked:m.injectV1,onChange:r(O=>k({injectV1:O}),"onChange")}):null,(0,s.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,s.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Extra headers"}),m.headers.map((O,W)=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2",children:[(0,s.jsx)(Wn,{"aria-label":`Header ${W+1} name`,value:O.name,onChange:r(Y=>N(W,{name:Y.target.value}),"onChange"),placeholder:"X-Header",disabled:O.saved}),(0,s.jsx)(Wn,{"aria-label":`Header ${W+1} value`,value:O.value,onChange:r(Y=>N(W,{value:Y.target.value}),"onChange"),placeholder:O.saved?"Saved; type to replace":"value",type:"password",autoComplete:"off"}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove header ${W+1}`,onClick:r(()=>k({headers:m.headers.filter((Y,ce)=>ce!==W)}),"onClick"),children:(0,s.jsx)(Fh,{"aria-hidden":"true"})})]},W)),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",className:"self-start",onClick:r(()=>k({headers:[...m.headers,{name:"",value:"",saved:!1}]}),"onClick"),children:[(0,s.jsx)(Js,{"aria-hidden":"true"}),"Add header"]})]})]})]}),D.error?(0,s.jsx)(Cs,{tone:"bad",children:(0,s.jsx)("ul",{className:"flex flex-col gap-0.5",children:dc(D.error).map(O=>(0,s.jsx)("li",{children:O},O))})}):null,(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(le,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),(0,s.jsx)(le,{type:"submit",disabled:D.isPending||!!I,children:D.isPending?"Checking with OMP...":"Save provider"})]})]})}r(Tw,"CustomProviderForm");function VB(e){switch(e.apiKey.kind){case"env":return e.apiKey.present?`key from ${e.apiKey.name}`:`${e.apiKey.name} is not set on the server`;case"literal":return"key saved";case"command":return"key from a command";case"none":return"no key";case"oauth":return"OMP sign-in";default:return"no key set"}}r(VB,"keySummary");var Ul=":new";function WB(e){return e===Ul?Ul:e.name}r(WB,"providerKey");function QB({onChanged:e}){const t=wn(),i=ge({queryKey:bh,queryFn:r(()=>xs.customProviders(),"queryFn")}),l=PB(WB),c=Kt({mutationFn:r(h=>xs.removeCustomProvider(h),"mutationFn"),onSuccess:r((h,g)=>{t.setQueryData(bh,h),l.openKey===g&&l.close(!1),e?.()},"onSuccess")}),u=i.data?.providers??[],m=u.map(h=>h.name),f=r(h=>{t.setQueryData(bh,h),l.close(),e?.()},"onSaved");return(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[i.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(i.error).join(" ")}):null,i.data?.parseError?(0,s.jsxs)(Cs,{tone:"bad",children:[i.data.parseError,". Fix ",i.data.modelsPath," by hand; Wardmote will not overwrite it."]}):null,u.length?(0,s.jsx)("ul",{"aria-label":"Custom providers",className:"flex flex-col divide-y divide-line rounded-lg border border-line",children:u.map(h=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm",children:[(0,s.jsx)("b",{className:"font-medium",children:h.name}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-ink-3",children:[h.baseUrl,h.api,VB(h),h.discovery?`discovery: ${h.discovery.type}`:`${h.models.length} ${h.models.length===1?"model":"models"}`].filter(Boolean).join(" · ")}),(0,s.jsxs)("span",{className:"flex gap-1",children:[(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Edit ${h.name}`,...l.triggerProps(h.name),onClick:r(()=>l.toggle(h),"onClick"),children:(0,s.jsx)(S0,{"aria-hidden":"true"})}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${h.name}`,disabled:c.isPending,onClick:r(()=>{window.confirm(`Remove ${h.name} from OMP's models.yml? A backup stays in models.yml.bak.`)&&c.mutate(h.name)},"onClick"),children:(0,s.jsx)(Fh,{"aria-hidden":"true"})})]})]}),l.openKey===h.name?(0,s.jsx)(Ew,{id:l.panelId(h.name),onEscape:l.dismiss,className:"px-2 pb-2 sm:px-3 sm:pb-3",children:(0,s.jsx)(Tw,{provider:h,takenNames:m,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):null]},h.name))}):i.isLoading?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Reading models.yml..."}):null,c.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(c.error).join(" ")}):null,l.openKey===Ul?(0,s.jsx)(Ew,{id:l.panelId(Ul),onEscape:l.dismiss,children:(0,s.jsx)(Tw,{provider:null,takenNames:m,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!!i.data?.parseError,...l.triggerProps(Ul),onClick:r(()=>l.request(Ul),"onClick"),children:[(0,s.jsx)(Js,{"aria-hidden":"true"}),"Add custom provider"]}),i.data?(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Saved to ",i.data.modelsPath,", with the previous copy in models.yml.bak."]}):null]})}r(QB,"CustomProviders");var GB=["Check OMP","Connect a model","First task"],Eg="Atlas",YB="general";var XB="Only an instance admin can set up OMP on this server.";function yh(e){return e?e.status===403?{message:XB,retry:!1}:{message:e.message||"Could not check OMP on this server.",retry:!0}:null}r(yh,"statusFailure");var ZB={anthropic:"Anthropic",openai:"OpenAI","openai-codex":"OpenAI",openrouter:"OpenRouter",google:"Google",deepseek:"DeepSeek"};function JB(e){return e?ZB[e]??e:null}r(JB,"providerLabel");function e6(e){return e.state==="ready"?"ready":e.state==="missing"?e.network==="offline"?"offline":"install":"old"}r(e6,"checkView");function t6(e){return(e?.models.length??0)>0}r(t6,"hasModel");function n6(e){return e.state!=="ready"?null:t6(e)?2:1}r(n6,"nextStepAfterCheck");function s6(e){return!e.connected||e.state!=="ready"?null:e.modelCount>0?2:1}r(s6,"nextStepAfterRemote");function a6(e){return e.copies.slice(1).filter(t=>t.version!==e.version)}r(a6,"olderCopies");function i6(e){const t=e.trim().split(/\r?\n/,1)[0]?.trim()??"";return t.length<=120?t:`${t.slice(0,119).trimEnd()}…`}r(i6,"taskTitle");function Rw(e){const t=e?.replace(/[\\/]+$/,"").split(/[\\/]/).pop()?.trim();return t||"My company"}r(Rw,"companyNameForFolder");function r6(e){return e?.recommendedModel?e.models.find(t=>t.id===e.recommendedModel)?.label??e.recommendedModel:null}r(r6,"recommendedModelLabel");function l6(e){return e?.recommendedModel?JB(e.models.find(t=>t.id===e.recommendedModel)?.provider??e.recommendedModel.split("/",1)[0]):null}r(l6,"signedInProvider");var nf="Wardmote",aA=2e3,cd=["onboarding","omp-status"],o6={ok:(0,s.jsx)(Ta,{className:"size-3.5","aria-hidden":!0}),bad:(0,s.jsx)(is,{className:"size-3.5","aria-hidden":!0}),warn:(0,s.jsx)(Ja,{className:"size-3.5","aria-hidden":!0}),wait:(0,s.jsx)(gI,{className:"size-3.5","aria-hidden":!0}),run:(0,s.jsx)(Yr,{className:"size-3.5 motion-safe:animate-spin","aria-hidden":!0})},c6={ok:"bg-ok-soft text-ok",bad:"bg-bad-soft text-bad",warn:"bg-warn-soft text-warn",wait:"bg-bg-3 text-ink-3",run:"bg-run-soft text-run"};function $l({rows:e,label:t}){return(0,s.jsx)("section",{"aria-label":t,className:"rounded-lg border border-line-soft bg-bg-2 px-4 py-1",children:(0,s.jsx)("ul",{children:e.map(i=>(0,s.jsxs)("li",{"data-check":i.state,className:"flex items-center gap-2.5 border-b border-line-soft py-2 text-(length:--t-13) last:border-b-0",children:[(0,s.jsx)("span",{className:X("grid size-5.5 shrink-0 place-items-center rounded-full",c6[i.state]),children:o6[i.state]}),(0,s.jsx)("span",{className:"min-w-0",children:i.label}),i.value?(0,s.jsx)("span",{className:"ms-auto min-w-0 truncate font-mono text-xs text-ink-3",children:i.value}):null]},i.label))})})}r($l,"Checks");function Ig({command:e}){const[t,i]=(0,x.useState)(!1);return(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,s.jsx)("code",{className:"block w-full whitespace-pre-wrap break-all rounded-md border border-line-soft bg-bg-3 px-3 py-2.5 font-mono text-(length:--t-13)",children:e}),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>{w0(e).then(()=>i(!0))},"onClick"),children:[t?(0,s.jsx)(Ta,{className:"size-3.5","aria-hidden":!0}):(0,s.jsx)(SI,{className:"size-3.5","aria-hidden":!0}),t?"Copied":"Copy command"]})]})}r(Ig,"CommandBlock");function sf({tone:e,children:t}){return(0,s.jsxs)("div",{role:e==="bad"?"alert":"note",className:X("flex gap-2.5 rounded-md px-3 py-2.5 text-(length:--t-13)",{warn:"bg-warn-soft",info:"bg-run-soft",bad:"bg-bad-soft"}[e]),children:[(0,s.jsx)(Ja,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),(0,s.jsx)("span",{children:t})]})}r(sf,"Note");function u6({step:e}){return(0,s.jsx)("ol",{"aria-label":"Setup steps",className:"flex flex-wrap items-center gap-1.5 text-xs text-ink-2",children:GB.map((t,i)=>(0,s.jsxs)("li",{className:"flex items-center gap-1.5","aria-current":i===e?"step":void 0,children:[i>0?(0,s.jsx)("span",{"aria-hidden":!0,className:"h-px w-5.5 bg-line"}):null,(0,s.jsx)("span",{className:X("grid size-5 place-items-center rounded-full border border-line-strong text-(length:--text-micro) font-semibold",i<e&&"border-ok bg-ok text-bg",i===e&&"border-accent text-accent"),children:i<e?(0,s.jsx)(Ta,{className:"size-3","aria-hidden":!0}):i+1}),(0,s.jsx)("span",{className:X(i===e?"font-semibold text-ink":"max-sm:sr-only"),children:t})]},t))})}r(u6,"Steps");function tr({title:e,lede:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("h1",{id:"onboarding-title",className:"text-(length:--t-24) font-semibold tracking-tight sm:text-(length:--t-32) sm:leading-tight",children:e}),(0,s.jsx)("p",{className:"max-w-130 text-base text-ink-2",children:t})]})}r(tr,"Heading");function iA({title:e,paragraphs:t}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:e}),t.map(i=>(0,s.jsx)("p",{className:"text-sm text-ink-2",children:i},i))]})}r(iA,"SideText");var d6=(0,s.jsx)(iA,{title:"Why OMP",paragraphs:[`${nf} runs every agent on OMP. OMP talks to the model and uses the tools; ${nf} assigns work, keeps the record and holds the settings.`,"You will not need to open OMP's own settings: models, thinking and tools are set here."]});function _c({children:e}){return(0,s.jsx)("div",{className:"mt-auto flex flex-wrap items-center gap-2 pt-2",children:e})}r(_c,"Actions");function Tg(e){if(e instanceof Si){const t=e.body;if(t&&typeof t.error=="string")return t.error}return e instanceof Error?e.message:String(e)}r(Tg,"errorMessage$1");function f6({open:e,onOpenChange:t,onPick:i}){const[l,c]=(0,x.useState)(null),u=ge({queryKey:["onboarding","omp-browse",l],queryFn:r(()=>xs.browse(l),"queryFn"),enabled:e});return(0,s.jsx)(ya,{open:e,onOpenChange:t,children:(0,s.jsxs)(za,{className:"sm:max-w-lg",children:[(0,s.jsxs)(Jl,{children:[(0,s.jsx)(Da,{children:"Choose omp"}),(0,s.jsx)(eo,{className:"truncate font-mono text-xs",children:u.data?.path??"…"})]}),(0,s.jsxs)("ul",{className:"-mx-2 max-h-80 overflow-y-auto",children:[u.data?.parent?(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>c(u.data?.parent??null),"onClick"),children:[(0,s.jsx)(wi,{className:"size-4 text-ink-3","aria-hidden":!0}),".."]})}):null,u.data?.entries.map(m=>(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>{m.kind==="directory"?c(m.path):(i(m.path),t(!1))},"onClick"),children:[m.kind==="directory"?(0,s.jsx)(wi,{className:"size-4 text-ink-3","aria-hidden":!0}):(0,s.jsx)(LT,{className:"size-4 text-accent","aria-hidden":!0}),(0,s.jsx)("span",{className:"truncate",children:m.name})]})},m.path)),u.isError?(0,s.jsx)("li",{className:"px-2 py-2 text-sm text-bad",children:Tg(u.error)}):null]})]})})}r(f6,"OmpFilePicker");function m6({status:e,failure:t,command:i,onChooseCommand:l,onRemote:c,onRetry:u}){const[m,f]=(0,x.useState)(!1),h=r(v=>v.state==="ready"?{state:"ok",label:`Version ${v.version}`,value:`needs ${v.minVersion} or newer`}:{state:"bad",label:v.version?`Version ${v.version}`:"Version unknown",value:`needs ${v.minVersion}`},"versionRow");if(!e)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Install OMP",lede:"Looking for OMP on this computer."}),(0,s.jsx)($l,{label:"OMP checks",rows:[t&&!t.retry?{state:"bad",label:"Looking for omp",value:"stopped"}:{state:"run",label:"Looking for omp",value:"every 2 s"}]}),t?(0,s.jsx)(sf,{tone:"bad",children:t.message}):null]});const g=e6(e);if(g==="old"){const v=a6(e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Update OMP",lede:e.version?`OMP ${e.version} is older than ${e.minVersion}, so some settings set here would be ignored.`:`The version of OMP could not be read. ${nf} needs OMP ${e.minVersion} or newer.`}),(0,s.jsx)(Ig,{command:e.updateCommand}),(0,s.jsx)($l,{label:"OMP checks",rows:[{state:"ok",label:"omp found",value:e.path},h(e)]}),v.length>0?(0,s.jsxs)(sf,{tone:"warn",children:["Two copies of omp are installed. The older one in ",e.path," runs first. Remove it, or update it with the command above."]}):null]})}return g==="offline"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"You are offline",lede:"Installing needs the internet once. Connect, or point to an omp you already copied here."}),(0,s.jsx)($l,{label:"OMP checks",rows:[{state:"bad",label:"omp.sh not reachable",value:"3 tries"},i?h(e):{state:"wait",label:"Version check"}]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("span",{id:"omp-path-label",className:"text-sm font-medium",children:"Path to omp"}),(0,s.jsxs)(le,{type:"button",variant:"secondary","aria-labelledby":"omp-path-label",className:"justify-between font-normal",onClick:r(()=>f(!0),"onClick"),children:[(0,s.jsx)("span",{className:X("truncate",i?"font-mono text-xs":"text-ink-3"),children:i??"Choose file"}),(0,s.jsx)(wi,{className:"size-4","aria-hidden":!0})]})]}),(0,s.jsx)(f6,{open:m,onOpenChange:f,onPick:l}),(0,s.jsx)(_c,{children:(0,s.jsxs)(le,{type:"button",variant:"secondary",onClick:u,children:[(0,s.jsx)(Yr,{className:"size-3.5","aria-hidden":!0}),"Try again"]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Install OMP",lede:"Run this in a terminal on this computer. This page moves on by itself."}),(0,s.jsx)(Ig,{command:e.installCommand}),(0,s.jsxs)("p",{className:"text-sm text-ink-2",children:[e.os.label," detected ·"," ",(0,s.jsx)("a",{className:"inline-flex min-h-6 items-center text-accent underline-offset-2 hover:underline",href:"https://omp.sh",target:"_blank",rel:"noreferrer",children:"Other ways"})]}),(0,s.jsx)($l,{label:"OMP checks",rows:[e.state==="ready"?{state:"ok",label:"omp found",value:e.path}:{state:"run",label:"Looking for omp",value:"every 2 s"},e.state==="ready"?h(e):{state:"wait",label:`Version ${e.minVersion} or newer`},e.models.length>0?{state:"ok",label:`${e.models.length} models`}:{state:"wait",label:"At least one model"}]}),e.runtime==="local"?(0,s.jsx)(_c,{children:(0,s.jsx)(le,{type:"button",variant:"ghost",onClick:c,children:"Run agents on another machine"})}):null]})}r(m6,"CheckOmpScreen");function p6({remote:e,pending:t,error:i,onCheck:l,onLocal:c}){const[u,m]=(0,x.useState)(e?.address??""),f=e?[e.connected?{state:"ok",label:"Connected",value:e.latencyMs!==null?`${e.latencyMs} ms`:null}:{state:"bad",label:"Not connected",value:e.error},...e.connected?[e.state==="missing"?{state:"bad",label:"omp not found there"}:e.state==="ready"?{state:"ok",label:`omp ${e.version} found`}:{state:"bad",label:`omp ${e.version??""} is too old`.replace(" "," "),value:"needs 18.1.16"},e.modelCount>0?{state:"ok",label:`${e.modelCount} models signed in there`}:{state:"bad",label:"No model signed in there",value:"next step"}]:[]]:[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Run agents on another machine",lede:"OMP must be installed where agents run. We check it over SSH."}),(0,s.jsxs)("form",{className:"flex flex-col gap-1.5",onSubmit:r(h=>{h.preventDefault(),l(u.trim())},"onSubmit"),id:"onboarding-remote-form",children:[(0,s.jsx)("label",{htmlFor:"onboarding-ssh-address",className:"text-sm font-medium",children:"SSH address"}),(0,s.jsx)(Wn,{id:"onboarding-ssh-address",value:u,onChange:r(h=>m(h.target.value),"onChange"),placeholder:"user@host",autoComplete:"off",spellCheck:!1,"aria-describedby":"onboarding-ssh-help"}),(0,s.jsx)("span",{id:"onboarding-ssh-help",className:"text-xs text-ink-3",children:"Uses your SSH keys. The working folder is your home folder unless you change it later."})]}),f.length>0?(0,s.jsx)($l,{label:"Remote checks",rows:f}):null,i?(0,s.jsx)(sf,{tone:"bad",children:i}):null,(0,s.jsxs)(_c,{children:[(0,s.jsx)(le,{type:"button",variant:"ghost",onClick:c,children:"Use this computer"}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)(le,{type:"submit",form:"onboarding-remote-form",disabled:t||u.trim().length===0,children:t?"Checking…":"Continue"})]})]})}r(p6,"RemoteScreen");function h6({remote:e,onSignedIn:t}){const[i,l]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(!e)return;const c=window.setInterval(t,aA);return()=>window.clearInterval(c)},[e,t]),e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Connect a model",lede:`OMP on ${e.host} has no model signed in yet.`}),(0,s.jsxs)("p",{className:"text-sm text-ink-2",children:["Sign in on ",e.host,". This page moves on by itself."]}),(0,s.jsx)(Ig,{command:`ssh -t ${e.username}@${e.host}${e.port!==22?` -p ${e.port}`:""} omp login`})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Connect a model",lede:i?"Add your own gateway or local server to OMP.":"OMP has no model signed in yet. Sign in to a provider; OMP keeps the sign-in."}),i?(0,s.jsx)(QB,{onChanged:t}):(0,s.jsx)($B,{autoFocus:!0,onSignedIn:t}),(0,s.jsxs)(_c,{children:[(0,s.jsx)(le,{type:"button",variant:"link",size:"sm",onClick:r(()=>l(c=>!c),"onClick"),children:i?"Sign in to a provider instead":"Use my own server instead"}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Moves on by itself once OMP has a model."})]})]})}r(h6,"ConnectScreen");function g6({status:e,remote:t,pending:i,error:l,onStart:c}){const[u,m]=(0,x.useState)(""),f=t?t.homeFolder:e?.projectFolder,h=t?null:r6(e);return(0,s.jsxs)("form",{className:"contents",onSubmit:r(g=>{g.preventDefault(),u.trim()&&c(u.trim())},"onSubmit"),children:[(0,s.jsx)(tr,{title:"What should your first agent do?",lede:`${Eg} starts as soon as you press Start. You can rename it and change its setup later.`}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("label",{htmlFor:"onboarding-first-task",className:"text-sm font-medium",children:"First task"}),(0,s.jsx)(RS,{id:"onboarding-first-task",value:u,onChange:r(g=>m(g.target.value),"onChange"),rows:4,placeholder:f?`Read the README in ${f} and list the three riskiest modules.`:void 0,autoFocus:!0})]}),(0,s.jsxs)("section",{"aria-label":"First agent",className:"flex flex-col gap-1.5 rounded-lg border border-line-soft bg-bg-2 px-4 py-3 text-sm",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Agent"}),Eg,", general assistant"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Model"}),h?`${h} (recommended)`:"OMP default"]}),(0,s.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,s.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Folder"}),(0,s.jsx)("span",{className:"min-w-0 truncate font-mono text-xs leading-5",children:f??"~"})]})]}),l?(0,s.jsx)(sf,{tone:"bad",children:l}):null,(0,s.jsxs)(_c,{children:[(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsxs)(le,{type:"submit",disabled:i||u.trim().length===0,children:[(0,s.jsx)(m0,{className:"size-3.5","aria-hidden":!0}),i?"Starting…":"Start"]})]})]})}r(g6,"TaskScreen");function x6(){const{onboardingOpen:e,onboardingOptions:t,closeOnboarding:i,onboardingRouteDismissed:l,setOnboardingRouteDismissed:c}=Mc(),{companies:u,loading:m}=vt(),f=vn(),h=IU(f.pathname),g=h&&m?null:TU({pathname:f.pathname,companyPrefix:h,companies:u});if(!(e||g!==null&&!l))return null;const v=(e?t.companyId:g?.companyId)??null;return(0,s.jsx)(b6,{companyId:v,onClose:r(()=>{i(),c(!0)},"onClose")})}r(x6,"OnboardingFlow");function b6({companyId:e,onClose:t}){const i=wn(),l=bs(),{setSelectedCompanyId:c}=vt(),[u,m]=(0,x.useState)(0),[f,h]=(0,x.useState)("local"),[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),[k,S]=(0,x.useState)(null),N=ge({queryKey:[...cd,g],queryFn:r(()=>xs.status({command:g}),"queryFn"),retry:r((P,A)=>(yh(A)?.retry??!0)&&P<2,"retry"),refetchInterval:r(P=>yh(P.state.error)?.retry===!1||u===2&&P.state.data?!1:aA,"refetchInterval")}),_=N.data,I=yh(N.error),D=ge({queryKey:[...cd,"network",g],queryFn:r(()=>xs.status({command:g,network:!0}),"queryFn"),enabled:_?.state==="missing"&&f==="local",refetchInterval:3e4}),T=(0,x.useMemo)(()=>{if(_)return _.state!=="missing"?_:{..._,network:D.data?.network??null}},[_,D.data]);(0,x.useEffect)(()=>{if(f!=="local"||!_||u===2)return;const P=n6(_);P!==null&&P>u&&m(P)},[f,_,u]);const C=Kt({mutationFn:r(P=>xs.remote(P),"mutationFn"),onSuccess:r(P=>{j(P);const A=s6(P);A!==null&&m(A)},"onSuccess")}),M=(0,x.useCallback)(()=>{if(!y){i.invalidateQueries({queryKey:cd});return}xs.remote(y.address).then(P=>{j(P),P.modelCount>0&&m(2)}).catch(()=>{})},[y,i]),z=Kt({mutationFn:r(async P=>{const A=f==="remote"?y?.homeFolder??null:_?.projectFolder??null;let B=e;B||(B=(await wy.create({name:Rw(f==="remote"?y?.host:A)})).id,await i.invalidateQueries({queryKey:U.companies.all}));let O=null;f==="remote"&&y?.homeFolder&&(O=(await rT.create(B,{name:y.host,driver:"ssh",config:{host:y.host,port:y.port,username:y.username,remoteWorkspacePath:y.homeFolder}})).id);const W={};f==="local"&&_?.recommendedModel&&(W.model=_.recommendedModel),A&&(W.cwd=A),g&&(W.command=g);const Y=await $s.hire(B,{name:Eg,role:YB,appearance:Y_(),adapterType:"omp_local",adapterConfig:W,onboardingFirstAgent:!0,runtimeConfig:RB(),...O?{defaultEnvironmentId:O}:{}});Y.approval&&await vN.approve(Y.approval.id,"Approved during onboarding first-agent setup.");const ce=await rr.create(B,{name:Rw(A),status:"in_progress",...f==="local"&&A?{workspace:{sourceType:"local_path",cwd:A,isPrimary:!0}}:{}}),oe=await hn.create(B,{title:i6(P),description:P,status:"todo",assigneeAgentId:Y.agent.id,projectId:ce.id});return{companyId:B,issue:oe}},"mutationFn"),onMutate:r(()=>S(null),"onMutate"),onError:r(P=>S(Tg(P)),"onError"),onSuccess:r(async({companyId:P,issue:A})=>{await Promise.all([i.invalidateQueries({queryKey:U.companies.all}),i.invalidateQueries({queryKey:U.agents.list(P)}),i.invalidateQueries({queryKey:U.projects.list(P)}),i.invalidateQueries({queryKey:U.issues.list(P)})]);const B=(await wy.list()).find(W=>W.id===P)?.issuePrefix??null;c(P,{source:"route_sync"}),t();const O=A.identifier??A.id;l(B?`/${B}/issues/${O}`:`/issues/${O}`)},"onSuccess")}),K=u===1?(0,s.jsx)(iA,{title:"Skipped when OMP is ready",paragraphs:["If OMP already has a signed-in model on this machine, this step is skipped and the best model is picked for you."]}):u===2?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:f==="remote"?`Found on ${y?.host??"that machine"}`:"Found on this computer"}),(0,s.jsx)($l,{label:"Found",rows:f==="remote"?[{state:"ok",label:`OMP ${y?.version??""}`.trim()},{state:"ok",label:`${y?.modelCount??0} models signed in`},{state:"ok",label:"Working folder",value:y?.homeFolder}]:[{state:"ok",label:`OMP ${_?.version??""}`.trim()},{state:"ok",label:`${l6(_)??"Model"} signed in`,value:"imported"},{state:"ok",label:"Project folder",value:_?.projectFolder}]})]}):d6;return(0,s.jsx)(ya,{open:!0,onOpenChange:r(P=>{P||t()},"onOpenChange"),children:(0,s.jsxs)(j3,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-50 bg-bg"}),(0,s.jsxs)("div",{"data-testid":"onboarding-flow","data-step":u,role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",className:"fixed inset-0 z-50 grid overflow-y-auto lg:grid-cols-2",onKeyDown:r(P=>{P.key==="Escape"&&t()},"onKeyDown"),children:[(0,s.jsxs)("main",{className:"flex min-h-dvh min-w-0 flex-col gap-4.5 px-4 py-5 sm:px-8 sm:py-8 lg:px-14 lg:py-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)(p0,{className:"size-6.5 shrink-0 text-ink","aria-hidden":"true"}),(0,s.jsx)("b",{className:"text-base font-semibold",children:nf})]}),(0,s.jsx)(u6,{step:u}),u===0&&f==="local"?(0,s.jsx)(m6,{status:T,failure:I,command:g,onChooseCommand:v,onRemote:r(()=>h("remote"),"onRemote"),onRetry:r(()=>{i.invalidateQueries({queryKey:cd})},"onRetry")}):null,u===0&&f==="remote"?(0,s.jsx)(p6,{remote:y,pending:C.isPending,error:C.isError?Tg(C.error):null,onCheck:r(P=>C.mutate(P),"onCheck"),onLocal:r(()=>{h("local"),j(null)},"onLocal")}):null,u===1?(0,s.jsx)(h6,{remote:f==="remote"?y:null,onSignedIn:M}):null,u===2?(0,s.jsx)(g6,{status:_,remote:f==="remote"?y:null,pending:z.isPending,error:k,onStart:r(P=>z.mutate(P),"onStart")}):null]}),(0,s.jsx)("aside",{className:"hidden min-w-0 flex-col gap-4 border-s border-line-soft bg-bg-3 px-12 py-10 lg:flex",children:K})]})]})})}r(b6,"OnboardingFlowDialog");function v6(){const{openNewIssue:e}=Pa();return(0,x.useEffect)(()=>{e()},[e]),(0,s.jsx)(Qe,{to:"/issues",replace:!0})}r(v6,"NewTaskShortcut");var y6="npx @tickernelz/wardmote auth bootstrap-ceo";function jh({hasActiveInvite:e=!1}){return(0,s.jsxs)("div",{className:"mt-6 border-t border-line pt-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(XI,{className:"size-4 text-ink-3","aria-hidden":!0}),(0,s.jsx)("span",{children:"Prefer to finish setup from the host?"})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:e?"A bootstrap invite is already active. Check your Wardmote startup logs for the first-admin URL, or run this command on the host to rotate it:":"Run this command on the host that runs Wardmote to print a one-time first-admin invite URL:"}),(0,s.jsx)("pre",{className:"mt-3 overflow-x-auto rounded-md border border-line bg-bg-3/30 p-3 font-mono text-xs",children:y6})]})}r(jh,"CliFallback");function ud({children:e}){return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsx)(Dc,{className:"block p-6",children:e})})}r(ud,"StateChrome");function j6(e){return e.user.email||e.user.name||e.user.id}r(j6,"displayIdentity");function w6(e){return e?.status===409?{title:"Someone else has already claimed this instance.",body:"Refresh to sign in, or ask the existing admin to invite you from Settings -> Access."}:e?.status===401?{title:"Your session expired. Sign in again to claim this instance.",body:""}:{title:"We couldn't reach the server. Try again in a moment.",body:""}}r(w6,"claimErrorCopy");function k6({claimAvailable:e,hasActiveInvite:t=!1,session:i,claimState:l,claimError:c,onClaim:u}){if(!e)return(0,s.jsxs)(ud,{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"This Wardmote is waiting on its first admin"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This instance runs in invite-only mode. The operator must generate a one-time first-admin invite URL from the host. Once you have the link, open it from this browser to finish setup."}),(0,s.jsx)(jh,{hasActiveInvite:t}),(0,s.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Browser-based claim is intentionally disabled in public mode so anyone on the network can't promote themselves."})]});if(l==="success")return(0,s.jsxs)(ud,{children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",children:(0,s.jsx)(zd,{className:"size-5","aria-hidden":!0})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"You're the instance admin"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Setup is complete. Taking you to onboarding to create your first organization..."})]})]}),(0,s.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,s.jsx)(As,{className:"size-4 animate-spin text-ink-3","aria-hidden":!0}),(0,s.jsx)("span",{className:"text-sm text-ink-3",children:"Redirecting..."})]}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(le,{asChild:!0,variant:"secondary",children:(0,s.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]});if(!i)return(0,s.jsxs)(ud,{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Sign in or create your Wardmote account to become the first admin from this browser."}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(le,{asChild:!0,children:(0,s.jsx)(gn,{to:"/auth?next=/",children:"Sign in / Create account"})})}),(0,s.jsx)(jh,{hasActiveInvite:t})]});const m=w6(c),f=l==="claiming";return(0,s.jsxs)(ud,{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(le,{onClick:u,disabled:f,children:[f&&(0,s.jsx)(As,{className:"mr-2 size-4 animate-spin","aria-hidden":!0}),f?"Claiming...":"Claim this instance"]}),(0,s.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,s.jsx)("span",{className:"font-medium text-ink",children:j6(i)})]})]}),(0,s.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["Wrong account?"," ",(0,s.jsx)(gn,{to:"/auth?next=/",className:"underline underline-offset-2",children:"Switch account"}),"."]}),c&&(0,s.jsxs)("div",{role:"alert",className:"mt-4 flex items-start gap-2 rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:[(0,s.jsx)(Ja,{className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":!0}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:m.title}),m.body&&(0,s.jsx)("p",{className:"mt-1 text-bad/90",children:m.body})]})]}),(0,s.jsx)(jh,{hasActiveInvite:t})]})}r(k6,"BootstrapPendingPage");var dd=5e3;function S6({temporary:e,retrying:t,onRetry:i}){return(0,s.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col gap-4 px-4 py-16",children:[(0,s.jsx)(Yr,{className:"size-6 text-ink-3","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",role:"status",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:e?"Reconnecting to Wardmote":"Unable to load Wardmote"}),(0,s.jsx)("p",{className:"text-sm text-ink-3",children:e?"The server may be restarting or your connection was interrupted. We’ll try again every few seconds and reconnect automatically.":"We couldn’t check your access to this instance. Try again, or contact your instance administrator if this continues."})]}),(0,s.jsx)("div",{children:(0,s.jsx)(le,{variant:"secondary",onClick:i,disabled:t,children:t?"Connecting…":"Try again"})})]})}r(S6,"CloudAccessError");function N6(){return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsxs)(Dc,{className:"block p-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"No organization access"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This account is signed in, but it does not have an active organization membership or instance-admin access on this Wardmote instance."}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Use an organization invite or sign in with an account that already belongs to this org."})]})})}r(N6,"NoBoardAccessPage");function Dw({allowMembershipRequest:e=!1}={}){const t=vn(),i=wn(),[l,c]=(0,x.useState)(!1),u=ge({queryKey:U.health,queryFn:r(()=>Rc.get(),"queryFn"),retry:!1,refetchInterval:r(T=>{if(T.state.error)return Tr(T.state.error)?dd:!1;const C=T.state.data;return C?.status==="starting"?dd:C?.deploymentMode==="authenticated"&&C.bootstrapStatus==="bootstrap_pending"?2e3:!1},"refetchInterval"),refetchIntervalInBackground:!0}),m=u.data?.deploymentMode==="authenticated",f=m&&u.data?.bootstrapStatus==="bootstrap_pending",h=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),enabled:m,retry:!1,refetchInterval:r(T=>Tr(T.state.error)?dd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),g=ge({queryKey:U.access.currentBoardAccess,queryFn:r(()=>Xa.getCurrentBoardAccess(),"queryFn"),enabled:m&&!f&&!!h.data,retry:!1,refetchInterval:r(T=>Tr(T.state.error)?dd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),v=Kt({mutationFn:r(()=>Xa.claimBootstrapAdmin(),"mutationFn"),onSuccess:r(async()=>{await i.invalidateQueries({queryKey:U.auth.session}),await i.invalidateQueries({queryKey:U.health}),await i.invalidateQueries({queryKey:U.companies.all}),await i.invalidateQueries({queryKey:U.companies.stats}),await i.invalidateQueries({queryKey:U.access.currentBoardAccess})},"onSuccess")}),y=[u,...m?[h]:[],...m&&!f&&h.data?[g]:[]],j=u.data?.status==="starting",k=j||y.some(T=>Tr(T.error)),S=y.find(T=>T.error&&!(T.data!==void 0&&Tr(T.error)))?.error,N=u.isLoading||m&&h.isLoading||m&&!f&&!!h.data&&g.isLoading,_=e||!m||!!g.data?.isInstanceAdmin||(g.data?.companyIds.length??0)>0,I=!N&&!S&&!f&&(!m||!!h.data)&&_;(0,x.useEffect)(()=>{I?u.data?.status==="ok"&&c(!0):c(!1)},[I,u.data?.status]);const D=(0,x.useRef)(!1);if((0,x.useEffect)(()=>{k?D.current=!0:D.current&&!N&&!S&&(D.current=!1,i.invalidateQueries({predicate:r(T=>Tr(T.state.error),"predicate")}))},[k,N,S,i]),S||j&&!l)return(0,s.jsx)(S6,{temporary:S?Tr(S):!0,retrying:y.some(T=>T.isFetching),onRetry:r(()=>{for(const T of y)(T.error||T===u&&j)&&T.refetch({cancelRefetch:!1})},"onRetry")});if(N)return(0,s.jsx)(Ra,{});if(f){const T=u.data;if(!T)return(0,s.jsx)(Ra,{});const C=v.error instanceof Si?{status:v.error.status,message:v.error.message}:v.error instanceof Error?{message:v.error.message}:null;return(0,s.jsx)(k6,{claimAvailable:T.deploymentExposure==="private",hasActiveInvite:T.bootstrapInviteActive,session:h.data,claimState:v.isSuccess?"success":v.isPending?"claiming":"idle",claimError:C,onClaim:r(()=>v.mutate(),"onClaim")})}if(m&&!h.data){const T=encodeURIComponent(`${t.pathname}${t.search}`);return(0,s.jsx)(Qe,{to:`/auth?next=${T}`,replace:!0})}return _?(0,s.jsxs)(s.Fragment,{children:[k&&(0,s.jsx)("div",{role:"status",className:"bg-bg-3 px-4 py-2 text-center text-sm text-ink-3",children:"Connection interrupted. Reconnecting automatically…"}),(0,s.jsx)(Zl,{})]}):(0,s.jsx)(N6,{})}r(Dw,"CloudAccessGate");var rA=["all","active","paused","error","builtin"];function C6({endpointId:e,children:t}){const i=ge({queryKey:U.chatEndpoints.detail(e),queryFn:r(()=>ES.get(e),"queryFn")}),{enabled:l,githubEnabled:c}=s0();return i.isError?(0,s.jsxs)("div",{className:"space-y-3 p-6",children:[(0,s.jsx)("p",{role:"alert",className:"text-sm text-bad",children:i.error.message}),(0,s.jsx)(le,{variant:"secondary",onClick:r(()=>{i.refetch()},"onClick"),children:"Retry"})]}):i.data?Fk(i.data.provider,l,c)?(0,s.jsx)(s.Fragment,{children:t}):(0,s.jsx)(Qe,{to:"/apps",replace:!0}):null}r(C6,"ProviderEndpointGate");function fd({children:e}){const{enabled:t,githubEnabled:i,loaded:l}=s0(),[c]=Uk(),{endpointId:u}=La();return!u&&c.get("provider")==="agentmail"?(0,s.jsx)(s.Fragment,{children:e}):l?u?(0,s.jsx)(C6,{endpointId:u,children:e}):Fk(c.get("provider"),t,i)?(0,s.jsx)(s.Fragment,{children:e}):(0,s.jsx)(Qe,{to:"/apps",replace:!0}):null}r(fd,"ChatConnectorsExperimentalGate");Ne(()=>ke(()=>import("./TaskChatLab-fOJfHKjI.js").then(e=>e.TaskChatLab),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119])));var A6=Ne(()=>ke(()=>import("./Cases-Da1szfrr.js").then(e=>e.Cases),__vite__mapDeps([120,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,122,40,123,124,7,9,125,126,98,127,128,129,38,130,54]))),_6=Ne(()=>ke(()=>import("./CaseDetail-DdJrlm0m.js").then(e=>e.CaseDetail),__vite__mapDeps([131,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,93,115,83,84,4,41,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,97,14,100,54,92,91,102,36,37,133,52,134,82,85,86,87,88,89,77,90,94,95,96,76,40,135,44,46,136,137,138,139,12,103,125,140,141,142,143,144,53,47,45,18,35,48,49,51,55,13,145,119,146,126,101,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,78,162,163,164,165,166,167,168,169,170,128,171,117,118,172,98,127,173,174,175,176,177,178,129,179,180]))),E6=Ne(()=>ke(()=>import("./Dashboard-Cgj9BeTt.js").then(e=>e.Dashboard),__vite__mapDeps([181,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,76,41,182,183,7,9,57,184,92,91,60,70,185,146,126,147,186,187,37,188,189,95,127,149,163,161,78,100,176,73,190,10,13,165,58,59,61,62,4,43,63,64,6,34,65,66,67,68,69,50,38,71,72,54,125,191,166,167,168,192,193,194,111,195,196,197,198,141,199,200,52,121,110,82,83,84,85,86,87,88,89,77,90,94,96,201,101,202,143,144,40,203,204,153,205,206,115,116,207,155,14,208,162,209,119,175,210,211,212,98,213,102,214,215,56,12,156,107,172,216,217,218,219,220,221,222,39,223,224,225,173,174,226,227,228,229,230,231,232,233,234,235,236,36,237,238,239,11,35,152,150,240,46,81,53,97,99,241,118,104,148,242,112,243,244,103,117,154,109,245,246,159,160,164,247,248,249,250,251,106,252,80,45,18,47,48,49,51,55,253]))),I6=Ne(()=>ke(()=>import("./DashboardLive-Ku1cHAj9.js").then(e=>e.DashboardLive),__vite__mapDeps([254,1,3,21,20,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,202,127,193,194,111,185,146,149,91,60,92,93,195,196,197,198,141,199,200,52,7,9,121,4,110,82,59,61,83,84,85,86,87,88,89,77,90,54,94,95,96,201,101,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,238,239,11,35,152,150,58,62,63,65,67,69,50,72,73,240,46,81,53,97,99,241,118,104,148,242,112,243,244,103,117,176,154,109,245,246,159,160,164,247,248,249,250,167,251,106,252,80,45,18,47,48,49,51,55]))),T6=Ne(()=>ke(()=>import("./Companies-BkHWSxdB.js").then(e=>e.Companies),__vite__mapDeps([255,1,3,20,22,21,115,25,8,83,26,27,84,4,41,5,142,29,116,7,9,13,172,104,54,125,98,127,176]))),R6=Ne(()=>ke(()=>import("./Agents-CToMMxGu.js").then(e=>e.Agents),__vite__mapDeps([256,1,3,17,16,20,194,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,134,83,84,9,76,7,48,10,56,13,100,91,60,92,93,37,70,111,141,185,146,257,101,52,54,258,259,127,222,39,223,40,175,163,161,78,173,85,86,174,229,230,232,176,260,200,261]))),wh=Ne(()=>ke(()=>import("./AgentDetail-bCAmWRXs.js").then(e=>e.AgentDetail),__vite__mapDeps([262,1,3,16,17,20,263,194,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,238,42,44,45,18,35,46,47,48,49,50,51,53,55,264,265,266,80,58,62,63,65,67,69,72,73,81,97,99,111,147,113,133,184,126,267,268,245,164,247,248,249,154,269,270,108,271,272,273,274,260,275,276,277,278,11,279,280,281,176,282]))),D6=Ne(()=>ke(()=>import("./Projects-DPmo6PFV.js").then(e=>e.Projects),__vite__mapDeps([283,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,13,126,127,176,276,277,261]))),Mr=Ne(()=>ke(()=>import("./ProjectDetail-DeLSGbmz.js").then(e=>e.ProjectDetail),__vite__mapDeps([284,1,3,16,17,20,22,196,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,134,142,62,285,286,176,111,185,146,126,147,186,188,189,287,288,58,63,65,67,69,50,72,73,177,178,169,276,277,289,268,290,245,291,292,103,140,275]))),M6=Ne(()=>ke(()=>import("./ProjectWorkspaceDetail-DPajDjA-.js").then(e=>e.ProjectWorkspaceDetail),__vite__mapDeps([293,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,103,125,140,141,134,83,84,201,101,52,54,202,4,126,186,187,37,188,189,127,176,169,87,294]))),O6=Ne(()=>ke(()=>import("./Workspaces-CDTiwIHd.js").then(e=>e.Workspaces),__vite__mapDeps([295,1,3,20,263,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,141,127,289,76,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,69,70,50,38,71,72,73,156,125,37,101,52,54,163,161,78,100,173,85,86,83,40,174,268,196,197,198,199,200,121,110,82,84,87,88,89,77,90,91,92,93,94,95,96,201,202,143,144,41,203,204,153,205,206,115,116,207,155,13,14,208,162,209,119,175,210,211,212,98,213,102,182,214,215,56,12,57,107,172,216,187,217,218,219,220,221,222,39,223,224,225,226,227,228,229,230,231,232,233,234,235,236,36,237,290,111,245,292,103,126,140,275]))),L6=Ne(()=>ke(()=>import("./Issues-B5QG33RC.js").then(e=>e.Issues),__vite__mapDeps([296,1,3,16,17,20,263,194,297,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,62,122,4,41,63,64,214,7,11,13,14,100,90,54,187,92,93,37,70,111,141,185,146,126,101,52,147,298,148,127,149,91,60,176,73,299,58,59,61,43,6,34,65,66,67,68,69,50,38,71,72,162,57,169,87,200,115,82,85,86,88,89,77,94,95,96,139,144,40,42,44,45,18,12,35,36,46,47,48,49,51,53,55,56,300,103,102,222,39,223,175,227,228,119,221,229,76,246,269,251,106,252,80,81,97,98,99]))),z6=Ne(()=>ke(()=>import("./Search-CXiBakEC.js").then(e=>e.Search),__vite__mapDeps([301,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,115,83,84,41,134,9,122,40,302,46,7,13,14,100,271,90,54,187,125,91,60,92,93,70,126,98,217,127,149,35,175,73,133,52]))),P6=Ne(()=>ke(()=>import("./IssueDetail-BIif8Swu.js").then(e=>e.t).then(e=>e.IssueDetail),__vite__mapDeps([303,1,3,25,8,16,17,20,263,194,22,196,197,198,141,21,19,23,24,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,18,35,137,238,304,108,166,167,168,132,58,62,63,65,67,69,50,72,73,97,133,248,249,305,306,307,308,134,122,53,264,265,266,80,46,45,47,48,49,51,55,81,99,111,147,113,42,44,309,135,75,79,103,104,105,302,310,311,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,165,169,170,128,106,240,241,118,242,112,243,244,11,312,15,74,109,114,117,313,185,257,298,186,188,189,267,287,252,314,315,316,195,239,176,245,246,247,250,317,318,299,178,288,177,269,319,190,10,320,270,271,191]))),U6=Ne(()=>ke(()=>import("./AgentChats-TN5SE_gN.js").then(e=>e.AgentChats),__vite__mapDeps([321,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,91,60,92,93,127,322]))),$6=Ne(()=>ke(()=>import("./AgentChat-D5FDUYuV.js").then(e=>e.AgentChat),__vite__mapDeps([323,1,3,16,17,20,22,303,25,8,263,194,196,197,198,141,21,19,23,24,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,18,35,137,238,304,108,166,167,168,132,58,62,63,65,67,69,50,72,73,97,133,248,249,305,306,307,308,134,122,53,264,265,266,80,46,45,47,48,49,51,55,81,99,111,147,113,42,44,309,135,75,79,103,104,105,302,310,311,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,165,169,170,128,106,240,241,118,242,112,243,244,11,312,15,74,109,114,117,313,185,257,298,186,188,189,267,287,252,314,315,316,195,239,176,245,246,247,250,317,318,299,178,288,177,269,319,190,10,320,270,271,191,324,322]))),B6=Ne(()=>ke(()=>import("./IssueChatLongThreadPerf-JH8rtLk0.js").then(e=>e.IssueChatLongThreadPerf),__vite__mapDeps([325,1,3,125,8,9,176,195,16,17,20,196,22,197,198,141,21,19,23,24,25,26,27,28,29,5,30,31,32,33,199,200,52,7,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,238,239,11,35,152,150,58,62,63,65,67,69,50,72,73,240,46,81,53,97,99,241,118,104,148,242,112,243,244,103,117,111,154,109,245,246,159,160,164,247,248,249,250,167]))),K6=Ne(()=>ke(()=>import("./Routines-Ct6W3Ht-.js").then(e=>e.Routines),__vite__mapDeps([326,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,82,59,60,61,83,52,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,122,4,40,41,7,9,13,145,37,70,111,185,146,126,101,147,327,127,151,150,152,153,173,174,176,328,200,115,116,172,98,133,329,110,203,204,205,6,310,66,311,125,141,102,230,38,170]))),q6=Ne(()=>ke(()=>import("./Pipelines-DaQPh688.js").then(e=>e.Learnings),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),F6=Ne(()=>ke(()=>import("./Pipelines-DaQPh688.js").then(e=>e.PipelineItemDetail),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),H6=Ne(()=>ke(()=>import("./Pipelines-DaQPh688.js").then(e=>e.PipelineItemLegacyRedirect),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),kh=Ne(()=>ke(()=>import("./Pipelines-DaQPh688.js").then(e=>e.Pipelines),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),V6=Ne(()=>ke(()=>import("./Pipelines-DaQPh688.js").then(e=>e.ReviewQueue),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),W6=Ne(()=>ke(()=>import("./PipelineSettings-CCoxV9Es.js").then(e=>e.PipelineSettings),__vite__mapDeps([334,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,199,115,83,84,4,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,139,62,144,160,40,206,203,7,9,204,101,153,205,161,116,207,155,68,13,14,208,162,209,119,125,37,175,210,11,12,172,141,98,127,213,102,151,150,221,152,333,335,110,43,173,174]))),Mw=Ne(()=>ke(()=>import("./StatusCards-BmNOGr1d.js").then(e=>e.StatusCards),__vite__mapDeps([336,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,115,83,84,41,134,9,40,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,69,70,50,38,71,72,73,116,182,13,156,100,337,119,88,86,125,91,92,93,101,52,54,98,127,102,152,150,153,163,161,78,173,85,174,133,290,111,245]))),Q6=Ne(()=>ke(()=>import("./PixelsOffice-D1X7mdpk.js").then(e=>e.PixelsOffice),__vite__mapDeps([338,1,3,20,59,60,61,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,265,83,85,86,339,34,214,7,9,11,12,312,54,187,125,37,70,111,147,94,95,127,176,133,52,340,240,196,197,198,141,199,200,121,4,110,82,84,87,88,89,77,90,91,92,93,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,175,210,211,212,98,213,102,38,182,66,215,56,156,57,107,172,100,216,217,218,219,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,63,58,62,65,67,69,50,72,73,46,81,53,97,35,99,241,118,104,148,242,112,243,244,333,291]))),Ow=Ne(()=>ke(()=>import("./RoutineDetail-Cb0oYk5B.js").then(e=>e.RoutineDetail),__vite__mapDeps([341,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,93,115,83,84,4,41,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,97,14,100,54,92,91,102,36,37,133,52,110,82,85,86,87,88,89,77,90,94,95,96,139,143,266,161,206,40,203,204,101,153,205,207,155,13,208,162,209,119,125,175,210,342,12,312,145,172,343,216,187,111,126,98,147,217,127,213,151,150,221,152,225,173,174,231,176,275,278,200,11,179,344,163,78,329,310,311,141,230,170,335,199,345]))),G6=Ne(()=>ke(()=>import("./UserProfile-Cavc3nhB.js").then(e=>e.UserProfile),__vite__mapDeps([346,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,161,7,9,209,258,259,127]))),Rl=Ne(()=>ke(()=>import("./ExecutionWorkspaceDetail-CVB4ZY8I.js").then(e=>e.ExecutionWorkspaceDetail),__vite__mapDeps([347,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,103,125,140,141,134,83,84,4,40,6,145,100,37,70,111,185,146,126,98,186,187,188,189,94,95,127,102,38,176,169,87,275,289,76,58,59,60,61,62,43,63,64,65,66,67,68,69,50,71,72,73,156,101,52,54,163,161,78,173,85,86,174,268,196,197,198,199,200,121,110,82,88,89,77,90,91,92,93,96,201,202,143,144,41,203,204,153,205,206,115,116,207,155,13,208,162,209,119,175,210,211,212,213,182,214,215,56,57,107,172,216,217,218,219,220,221,222,39,223,224,225,226,227,228,229,230,231,232,233,234,235,236,36,237,290,245,294,329,310,311,151,150,152,170]))),Y6=Ne(()=>ke(()=>import("./Goals-jLNZ4UKT.js").then(e=>e.Goals),__vite__mapDeps([348,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,127,349,41]))),Lw=Ne(()=>ke(()=>import("./Artifacts-Dz3eHCaQ.js").then(e=>e.Artifacts),__vite__mapDeps([350,1,3,16,17,20,263,18,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,4,6,34,12,35,36,37,38,115,83,84,41,202,7,9,54,125,98,127,320]))),X6=Ne(()=>ke(()=>import("./GoalDetail-Bscma2qU.js").then(e=>e.GoalDetail),__vite__mapDeps([351,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,7,13,70,126,127,220,288,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,58,62,4,43,63,64,6,34,65,66,67,68,69,50,38,71,72,73,177,178,40,174,169,261,349,41]))),zw=Ne(()=>ke(()=>import("./Approvals-DL6kx45P.js").then(e=>e.Approvals),__vite__mapDeps([352,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,57,125,70,127,318,63,64,7,149,91,60,92,93,176,299,58,59,61,62,4,43,6,34,65,66,67,68,69,50,38,71,72,73,162]))),Z6=Ne(()=>ke(()=>import("./ApprovalDetail-CVgy1uNi.js").then(e=>e.ApprovalDetail),__vite__mapDeps([353,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,92,93,127,149,91,102,299,162,57]))),J6=Ne(()=>ke(()=>import("./CompanyActivity-CMBXXwCw.js").then(e=>e.CompanyActivity),__vite__mapDeps([354,1,3,355,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,134,83,84,9,139,356,144,76,40,41,339,7,10,69,13,14,300,162,286,100,98,176,187,125,60,92,93,91,37,70,111,101,52,54,147,217,327,94,95,127,149,173,85,86,4,174,191,166,167,168,357,358,291,345,359]))),md=Ne(()=>ke(()=>import("./AuditHub-Dz2UXl0c.js").then(e=>e.AuditHub),__vite__mapDeps([355,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,134,83,84,9,139,356,144,76,40,41,339,7,10,69,13,14,300,162,286,100,98,176,187,125,60,92,93,91,37,70,111,101,52,54,147,217,327,94,95,127,149,173,85,86,4,174,191,166,167,168,357,358,291,345,359]))),e8=Ne(()=>ke(()=>import("./WhatNeedsMe-B7BSt_wb.js").then(e=>e.WhatNeedsMe),__vite__mapDeps([360,1,3,16,17,20,22,361,263,194,59,60,61,248,249,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,115,83,84,41,143,122,89,40,174,63,64,58,62,43,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,171,240,196,197,198,141,200,52,110,82,85,86,87,88,77,90,54,91,92,93,94,95,96,201,101,202,144,76,203,204,153,205,161,206,207,155,13,14,208,162,209,119,125,37,175,210,211,212,98,213,102,182,214,215,56,12,156,57,107,172,100,216,187,217,218,219,127,220,221,222,39,223,163,78,224,225,173,226,227,228,229,230,231,232,233,234,235,236,36,237,46,81,53,97,35,99,241,118,104,148,242,112,243,244,307,362,147,166,167,168,340,111,185,146]))),t8=Ne(()=>ke(()=>import("./DecisionQueuePage-D8cyKm4V.js").then(e=>e.DecisionQueuePage),__vite__mapDeps([363,1,3,16,17,20,22,361,263,194,59,60,61,248,249,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,115,83,84,41,143,122,89,40,174,63,64,58,62,43,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,171,240,196,197,198,141,200,52,110,82,85,86,87,88,77,90,54,91,92,93,94,95,96,201,101,202,144,76,203,204,153,205,161,206,207,155,13,14,208,162,209,119,125,37,175,210,211,212,98,213,102,182,214,215,56,12,156,57,107,172,100,216,187,217,218,219,127,220,221,222,39,223,163,78,224,225,173,226,227,228,229,230,231,232,233,234,235,236,36,237,46,81,53,97,35,99,241,118,104,148,242,112,243,244,307,362,147,166,167,168,340]))),n8=Ne(()=>ke(()=>import("./BoardChat-DsMVXf5M.js").then(e=>e.BoardChat),__vite__mapDeps([364,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,115,83,84,4,41,139,39,40,161,365,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,46,171,277,97,366,313,100,90,184,119,88,86,91,92,93,185,146,95,127,35,176,114,116,117,118,54,101,52,102,36,37,133]))),s8=Ne(()=>ke(()=>import("./CompanySettings-CuU9qSp5.js").then(e=>e.CompanySettings),__vite__mapDeps([367,1,3,16,17,20,22,21,199,25,8,26,200,52,27,7,9,40,203,23,24,4,54,204,31,101,153,205,10,13,125,37,141,98,259,127,220,221,173,85,86,83,174,228,41,43,119,88,229,76,30,243,368,196,197,198,19,28,29,5,32,33,121,110,82,59,60,61,84,87,89,77,90,91,92,93,94,95,96,201,202,143,144,161,64,6,206,115,116,207,155,68,14,208,162,209,175,210,34,211,212,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,222,39,223,163,78,224,225,226,227,230,231,71,232,233,234,235,236,36,237,357]))),a8=Ne(()=>ke(()=>import("./CompanyConnections-CVzsivTW.js").then(e=>e.CompanyConnections),__vite__mapDeps([369,1,3,20,196,16,17,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,368,357,358]))),Sh=Ne(()=>ke(()=>import("./CompanyEnvironments-K7piWRrx.js").then(e=>e.CompanyEnvironments),__vite__mapDeps([370,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,52,7,9,202,4,206,115,83,84,41,40,203,54,204,101,153,205,161,116,207,155,68,13,14,208,162,209,119,88,86,125,37,175,210,215,12,156,172,70,141,127,213,226,121,110,98,102,173,85,174,228,43,221,229,76,230,232,308]))),i8=Ne(()=>ke(()=>import("./BootstrapSetupUxLab-CWWisaHp.js").then(e=>e.BootstrapSetupUxLab),__vite__mapDeps([371,1,3,7,8,9,57,33,100,176]))),r8=Ne(()=>ke(()=>import("./ResponsibleUserDenialUxLab-Bt9vnHJz.js").then(e=>e.ResponsibleUserDenialUxLab),__vite__mapDeps([372,1,3,176,270,238,108,271]))),l8=Ne(()=>ke(()=>import("./CrossIssueCollaborationUxLab-CEh5B2iJ.js").then(e=>e.CrossIssueCollaborationUxLab),__vite__mapDeps([373,1,3,304,238,143,64,207,57,108,166,167,168,93,25,8,26,92,176,250,119,88,86,125,9]))),o8=Ne(()=>ke(()=>import("./CompanySettingsPluginPage-59_bMQQ3.js").then(e=>e.CompanySettingsPluginPage),__vite__mapDeps([374,1,3,16,17,21,20,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,186,187,37,188,189,127]))),c8=Ne(()=>ke(()=>import("./CompanyAccess-BaiGlxY1.js").then(e=>e.CompanyAccess),__vite__mapDeps([375,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,134,83,84,9,4,6,7,57,172,125,37,70,101,52,54,147,186,187,188,189,258,259,127,38]))),u8=Ne(()=>ke(()=>import("./CompanyAccess-BaiGlxY1.js").then(e=>e.CompanyAccessLegacyRoute),__vite__mapDeps([375,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,134,83,84,9,4,6,7,57,172,125,37,70,101,52,54,147,186,187,188,189,258,259,127,38]))),Pw=Ne(()=>ke(()=>import("./AdvancedToolsRoute-CN5fWS4T.js").then(e=>e.AdvancedToolsRoute),__vite__mapDeps([376,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,142,365,285,10,377,104,126,147,176,133,281,253,378,379,194]))),Uw=Ne(()=>ke(()=>import("./ProfileWizardRoute-CijS7-aN.js").then(e=>e.ProfileWizardRoute),__vite__mapDeps([380,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,110,40,41,7,9,241,13,54,125,37,98,218,127,102,224,91,60,92,93,217,173,85,86,83,174,175,281,100,176,379,194,70,126,94,95,381,162,147]))),d8=Ne(()=>ke(()=>import("./ProfileDetailRoute-DMdAvFmb.js").then(e=>e.ProfileDetailRoute),__vite__mapDeps([382,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,142,6,7,9,57,172,168,125,37,101,52,54,98,218,127,102,281,100,176,378,379,194,70,126,94,95,381,162,147]))),f8=Ne(()=>ke(()=>import("./Browse-Be6aSv-F.js").then(e=>e.Browse),__vite__mapDeps([383,1,3,20,194,22,384,16,17,197,198,141,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,200,52,7,9,121,4,41,156,100,209,92,93,111,101,54,98,217,218,50,163,161,78,225,359,385,115,83,84,110,306,116,34,215,212,172,119,88,86,91,60,37,70,147,267,219,127,237,112,386,387,134,6,241,184,38,231,102,71]))),lA=Ne(()=>ke(()=>import("./AppsConnect-DH7aSjtS.js").then(e=>e.AppsConnect),__vite__mapDeps([388,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,385,389]))),m8=Ne(()=>ke(()=>import("./ChatEndpointSetup-J23lq-xi.js").then(e=>e.ChatEndpointSetup),__vite__mapDeps([390,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,110,43,6,34,207,155,7,9,100,216,187,119,88,86,91,60,92,93,37,70,141,126,101,52,54,98,259,267,127,102,224,41,217,38,236,36,391,202,143,218,176,112,244,275,279,162,228,40,221,229,76,392]))),$w=Ne(()=>ke(()=>import("./ChatEndpointDetail-DSOH-zfs.js").then(e=>e.ChatEndpointDetail),__vite__mapDeps([393,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,52,7,9,121,4,115,83,84,41,110,82,59,60,61,85,86,87,88,89,77,90,54,91,92,93,94,95,96,139,356,144,40,43,58,62,63,64,6,34,65,66,67,68,69,70,50,38,71,72,73,116,11,12,13,156,172,100,119,125,37,101,98,147,267,218,219,127,102,221,235,234,112,275,394,224,217,225,391,202,143,126,176,244,279,162,228,229,76,392]))),p8=Ne(()=>ke(()=>import("./ChatIdentityConfirm-DCI5BnWo.js").then(e=>e.ChatIdentityConfirm),__vite__mapDeps([395,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,259,267]))),h8=Ne(()=>ke(()=>import("./AppsReview-Bf7oB0ES.js").then(e=>e.AppsReview),__vite__mapDeps([396,1,3,21,20,22,127,397,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,240,196,197,198,141,199,200,52,121,110,82,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,206,115,116,207,155,13,14,208,162,209,119,125,37,175,210,211,212,98,213,102,182,214,215,56,12,156,57,107,172,100,216,187,217,218,219,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,232,233,234,235,236,36,237,46,81,53,97,35,99,241,118,104,148,242,112,243,244]))),g8=Ne(()=>ke(()=>import("./AppDetail-P807ou0a.js").then(e=>e.AppDetail),__vite__mapDeps([398,1,3,16,17,20,22,196,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,384,111,50,359,385,147,314,386,389,394,391,126,176,112,244,275,279,397,58,62,63,65,67,69,72,73,240,46,81,53,97,35,99,241,118,104,148,242,243]))),Bw=Ne(()=>ke(()=>import("./AppNotConnected-DuA4PukX.js").then(e=>e.AppNotConnected),__vite__mapDeps([399,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,398,384,111,50,359,385,147,314,386,389,394,391,126,176,112,244,275,279,397,58,62,63,65,67,69,72,73,240,46,81,53,97,35,99,241,118,104,148,242,243]))),Kw=Ne(()=>ke(()=>import("./GatewaysList-CKSwMmOi.js").then(e=>e.GatewaysList),__vite__mapDeps([400,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,37,70,126,98,217,218,127,221,281,100,125,176,401,139,6,68,101,52,54,38]))),x8=Ne(()=>ke(()=>import("./GatewayDetail-DB1J44bF.js").then(e=>e.GatewayDetail),__vite__mapDeps([402,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,76,266,4,40,53,41,174,203,7,9,54,204,52,101,153,205,43,316,6,68,285,13,366,119,88,86,37,70,126,98,217,218,127,221,38,281,100,125,176,401,139]))),b8=Ne(()=>ke(()=>import("./CompanySkills-GBJMThWx.js").then(e=>e.CompanySkills),__vite__mapDeps([403,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,115,83,84,41,134,9,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,40,53,161,43,58,62,63,64,6,34,65,66,67,68,7,69,70,50,38,71,72,73,316,116,155,46,182,311,215,79,11,13,156,208,313,162,57,172,100,104,184,119,125,37,126,101,98,127,149,102,163,78,224,217,235,234,36,274,275,179,404,328,200,133,405]))),qw=Ne(()=>ke(()=>import("./SkillSources-C3kuN9Hz.js").then(e=>e.SkillSources),__vite__mapDeps([406,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,115,83,84,4,41,161,135,34,46,7,9,13,156,100,101,52,54,98,50,127,204,237,55,405,407,78,125,389]))),Nh=Ne(()=>ke(()=>import("./SkillStudio-DVVVKjdn.js").then(e=>e.SkillStudio),__vite__mapDeps([408,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,93,115,83,84,4,41,110,134,9,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,94,95,96,202,40,203,7,204,101,153,205,409,76,155,211,121,6,68,212,162,119,125,37,98,213,102,38,337,64,58,62,43,63,34,65,66,67,69,70,50,71,72,73,116,46,182,332,78,48,240,196,197,198,141,200,201,143,144,161,206,207,13,14,208,209,175,210,214,215,56,12,156,57,107,172,100,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,174,226,227,228,229,230,231,232,233,234,235,236,36,237,81,53,97,35,99,241,118,104,148,242,112,243,244,149,150,176,51,55,178,133,274,261,179,130,404,405,403,316,311,79,11,313,184,126,275,328,410,411]))),v8=Ne(()=>ke(()=>import("./Secrets-XUpMCMhK.js").then(e=>e.Secrets),__vite__mapDeps([412,1,3,16,17,20,21,22,121,25,8,4,115,83,26,27,84,41,5,134,9,23,24,142,62,143,53,161,63,309,6,116,34,211,110,68,7,212,162,119,88,86,125,91,60,92,93,37,101,52,54,98,213,102,38,66,124,214,78,215,342,13,156,31,57,172,100,209,104,70,147,258,259,217,127,224,173,85,40,174,210,36,133]))),y8=Ne(()=>ke(()=>import("./CompanyImport-CBVjSXPA.js").then(e=>e.CompanyImport),__vite__mapDeps([413,1,3,20,22,196,16,17,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,58,62,63,65,67,69,50,72,73,414,415,416]))),j8=Ne(()=>ke(()=>import("./DesignGuide-DvO3NaE-.js").then(e=>e.DesignGuide),__vite__mapDeps([417,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,265,134,239,11,35,152,150,58,62,63,65,67,69,50,72,73,75,42,44,45,18,46,47,48,49,51,53,55,79,80,81,97,99,103,104,105,183,106,418,240,241,118,148,242,112,243,244,419,362,184,313,176,109,111,315,316,145,298,157,288,177,178,165,169,133,276,277,280,281,261,130,404,192,193,194,185,146,149,195,238,117,154,245,246,159,160,164,247,248,249,250,167,251,252,407,344,410,411]))),w8=Ne(()=>ke(()=>import("./InstanceFeatures-DUQnBkxy.js").then(e=>e.InstanceFeatures),__vite__mapDeps([420,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,125,9,98,189,127,421,141,258,259,221]))),k8=Ne(()=>ke(()=>import("./AgentDefaults-CiVVS_pQ.js").then(e=>e.AgentDefaults),__vite__mapDeps([422,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,143,70,127,272,273,7,9,14,54,125,173,85,86,83,4,40,174]))),S8=Ne(()=>ke(()=>import("./OmpAllSettings-aHENTYf5.js").then(e=>e.n).then(e=>e.OmpAllSettingsPage),__vite__mapDeps([282,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,202,7,9,14,125,70,98,127,102,221,173,85,86,83,4,40,174,175,272,273,54]))),N8=Ne(()=>ke(()=>import("./ModelsAndProviders-BtbhNxf_.js").then(e=>e.ModelsAndProviders),__vite__mapDeps([423,1,3,20,21,22,7,8,9,13,156,70,127,272]))),C8=Ne(()=>ke(()=>import("./InstanceAdvanced-C5IIPBwh.js").then(e=>e.InstanceAdvanced),__vite__mapDeps([424,1,3,7,8,9,12,14,100,125,127,421,20,141,258,259,221]))),A8=Ne(()=>ke(()=>import("./InstanceAccess-Ns2rAmva.js").then(e=>e.InstanceAccess),__vite__mapDeps([425,1,3,20,22,121,25,8,4,7,9,57,32,37,147,127,176]))),_8=Ne(()=>ke(()=>import("./ProfileSettings-DVm3Tqzs.js").then(e=>e.ProfileSettings),__vite__mapDeps([426,1,3,20,22,21,93,25,8,26,110,214,7,9,12,208,366,172,70,98,127,220,221,224,121,4,23,24,27,41,91,60,92,217,225,173,85,86,83,40,174,176]))),E8=Ne(()=>ke(()=>import("./PluginManager-4rrrAOLG.js").then(e=>e.PluginManager),__vite__mapDeps([427,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,110,182,7,9,13,377,313,172,100,125,37,101,52,54,98,188,127,176]))),I8=Ne(()=>ke(()=>import("./PluginSettings-yP8NX-sM.js").then(e=>e.PluginSettings),__vite__mapDeps([428,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,201,101,52,7,54,202,89,63,64,66,208,162,100,343,125,188,186,187,37,189,127,226,121,4,110,40,41,161,207,155,68,13,172,98,213,102,173,85,86,174,176,169,87,140,141]))),Fw=Ne(()=>ke(()=>import("./AdapterManager-DFPaPUUr.js").then(e=>e.AdapterManager),__vite__mapDeps([429,1,3,20,21,22,110,25,8,201,33,101,52,26,27,7,9,54,30,66,13,377,156,172,100,125,37,98,127,227,23,24,40,222,39,223,4,31,175,228,41,43,119,88,86,221,229,76,233,234,176]))),Hw=Ne(()=>ke(()=>import("./PluginPage-B4kdPADI.js").then(e=>e.PluginPage),__vite__mapDeps([430,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,202,7,9,188,186,187,37,189,127]))),T8=Ne(()=>ke(()=>import("./NewAgent-C4JqnMkp.js").then(e=>e.NewAgent),__vite__mapDeps([431,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237]))),R8=Ne(()=>ke(()=>import("./Auth-_P9t1YSS.js").then(e=>e.AuthPage),__vite__mapDeps([432,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,419,362,184,72,259,433]))),D8=Ne(()=>ke(()=>import("./BoardClaim-CsomHmd6.js").then(e=>e.BoardClaimPage),__vite__mapDeps([434,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,176]))),M8=Ne(()=>ke(()=>import("./AssistantConnection-5Y4fBVXq.js").then(e=>e.AssistantConnection),__vite__mapDeps([387,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,4,6,34,7,241,184,92,93,127,38,231,54,102,71,386]))),Vw=Ne(()=>ke(()=>import("./McpConnect-Bk8Qskqw.js").then(e=>e.McpConnectPage),__vite__mapDeps([435,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,184,92,93,98,176,386]))),O8=Ne(()=>ke(()=>import("./McpConnect-Bk8Qskqw.js").then(e=>e.McpDevicePage),__vite__mapDeps([435,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,184,92,93,98,176,386]))),L8=Ne(()=>ke(()=>import("./McpConnect-Bk8Qskqw.js").then(e=>e.AssistantConnectionsPage),__vite__mapDeps([435,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,184,92,93,98,176,386]))),z8=Ne(()=>ke(()=>import("./CliAuth-CRG0c0EH.js").then(e=>e.CliAuthPage),__vite__mapDeps([436,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,176]))),P8=Ne(()=>ke(()=>import("./InviteLanding-BHmCRaWY.js").then(e=>e.InviteLandingPage),__vite__mapDeps([437,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,259,229,76,433]))),Ww=Ne(()=>ke(()=>import("./PublicIssueSharePage-B_W1Qpy_.js").then(e=>e.PublicIssueSharePage),__vite__mapDeps([438,1,3,16,17,20,202,58,59,60,61,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,74,46,47,92,93,217,319]))),U8=Ne(()=>ke(()=>import("./JoinRequestQueue-ZZq3jWW-.js").then(e=>e.JoinRequestQueue),__vite__mapDeps([439,1,3,20,21,22,7,8,9,125,37,147,127,176]))),oA=Ne(()=>ke(()=>Promise.resolve().then(()=>wB).then(e=>e.NotFoundPage),void 0)),tc=Ne(()=>ke(()=>import("./Inbox-DHwNNh-Z.js").then(e=>e.n).then(e=>e.Inbox),__vite__mapDeps([297,1,3,16,17,20,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,62,122,4,41,63,64,214,7,11,13,14,100,90,54,187,92,93,37,70,111,141,185,146,126,101,52,147,298,148,127,149,91,60,176,73,299,58,59,61,43,6,34,65,66,67,68,69,50,38,71,72,162,57,169,87]))),$8=Ne(()=>ke(()=>import("./CompanyExport-Bo8tUPaY.js").then(e=>e.CompanyExport),__vite__mapDeps([440,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,14,54,37,126,127,55,416]))),B8=Ne(()=>ke(()=>import("./Terminal-CGmILZtz.js").then(e=>e.Terminal),__vite__mapDeps([441,1,3,20,305,25,8,115,83,26,27,84,4,41,5,39,223,306,6,7,9,307,31,54,98,38,36,37,308,21,22,19,16,17,23,24,28,29,30,32,33,110,13,49,172,101,52,147,127,230,410])));function K8({children:e}){return(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:e})}r(K8,"ProductionSurface");function q8(e){const t=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{index:!0,element:(0,s.jsx)(Qe,{to:"dashboard",replace:!0})}),(0,s.jsx)(L,{path:"dashboard",element:(0,s.jsx)(E6,{})}),(0,s.jsx)(L,{path:"dashboard/live",element:(0,s.jsx)(I6,{})}),(0,s.jsx)(L,{path:"timeline",element:(0,s.jsx)(Va,{to:"/activity/timeline"})}),(0,s.jsx)(L,{path:"onboarding",element:(0,s.jsx)(dA,{})}),(0,s.jsx)(L,{path:"companies",element:(0,s.jsx)(T6,{})}),(0,s.jsx)(L,{path:"company/settings",element:(0,s.jsx)(s8,{})}),(0,s.jsx)(L,{path:"company/settings/connections",element:(0,s.jsx)(a8,{})}),(0,s.jsx)(L,{path:"company/settings/agent-defaults",element:(0,s.jsx)(k8,{})}),(0,s.jsx)(L,{path:"company/settings/agent-defaults/all",element:(0,s.jsx)(S8,{})}),(0,s.jsx)(L,{path:"company/settings/models",element:(0,s.jsx)(N8,{})}),(0,s.jsx)(L,{path:"company/settings/environments",element:(0,s.jsx)(Qe,{to:"/company/settings/instance/environments",replace:!0})}),(0,s.jsx)(L,{path:"company/settings/cloud-upstream",element:(0,s.jsx)(Qe,{to:"/company/export",replace:!0})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.members"}),children:[(0,s.jsx)(L,{path:"company/settings/members",element:(0,s.jsx)(c8,{})}),(0,s.jsx)(L,{path:"company/settings/access",element:(0,s.jsx)(u8,{})})]}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.invites"}),children:(0,s.jsx)(L,{path:"company/settings/invites",element:(0,s.jsx)(Qe,{to:"/company/settings/members?tab=invites",replace:!0})})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.export"}),children:(0,s.jsx)(L,{path:"company/export/*",element:(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:(0,s.jsx)($8,{})})})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.import"}),children:(0,s.jsx)(L,{path:"company/import",element:(0,s.jsx)(y8,{})})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.secrets"}),children:(0,s.jsx)(L,{path:"company/settings/secrets",element:(0,s.jsx)(v8,{})})}),(0,s.jsx)(L,{path:"company/settings/tools",element:(0,s.jsx)(Yw,{})}),(0,s.jsx)(L,{path:"company/settings/tools/:tab",element:(0,s.jsx)(Yw,{})}),(0,s.jsx)(L,{path:"tools",element:(0,s.jsx)(Xw,{})}),(0,s.jsx)(L,{path:"tools/:tab",element:(0,s.jsx)(Xw,{})}),(0,s.jsx)(L,{path:"apps",element:(0,s.jsx)(f8,{})}),(0,s.jsx)(L,{path:"apps/assistant-connection",element:(0,s.jsx)(M8,{})}),(0,s.jsx)(L,{path:"apps/browse",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/connections",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/byo",element:(0,s.jsx)(lA,{byoOnly:!0})}),(0,s.jsx)(L,{path:"apps/vercel-connect",element:(0,s.jsx)(Qw,{credentialSource:"vercel_connect"})}),(0,s.jsx)(L,{path:"apps/connect",element:(0,s.jsx)(Qw,{})}),(0,s.jsx)(L,{path:"apps/chat/connect",element:(0,s.jsx)(fd,{children:(0,s.jsx)(m8,{})})}),(0,s.jsx)(L,{path:"apps/chat/:endpointId",element:(0,s.jsx)(fd,{children:(0,s.jsx)(Qe,{to:"settings",replace:!0})})}),(0,s.jsx)(L,{path:"apps/chat/:endpointId/reviews/:reviewId",element:(0,s.jsx)(fd,{children:(0,s.jsx)($w,{})})}),(0,s.jsx)(L,{path:"apps/chat/:endpointId/:tab",element:(0,s.jsx)(fd,{children:(0,s.jsx)($w,{})})}),(0,s.jsx)(L,{path:"apps/connect/:appKey",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/connect/:appKey/:stage",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/review",element:(0,s.jsx)(h8,{})}),(0,s.jsx)(L,{path:"apps/attention",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/gateways",element:(0,s.jsx)(Kw,{})}),(0,s.jsx)(L,{path:"apps/gateways/:gatewayId",element:(0,s.jsx)(Qe,{to:"overview",replace:!0})}),(0,s.jsx)(L,{path:"apps/gateways/:gatewayId/:tab",element:(0,s.jsx)(x8,{})}),(0,s.jsx)(L,{path:"apps/advanced",element:(0,s.jsx)(Pw,{})}),(0,s.jsx)(L,{path:"apps/advanced/gateways",element:(0,s.jsx)(Kw,{})}),(0,s.jsx)(L,{path:"apps/advanced/profiles/new",element:(0,s.jsx)(Uw,{mode:"new"})}),(0,s.jsx)(L,{path:"apps/advanced/profiles/:profileId/edit",element:(0,s.jsx)(Uw,{mode:"edit"})}),(0,s.jsx)(L,{path:"apps/advanced/profiles/:profileId",element:(0,s.jsx)(d8,{})}),(0,s.jsx)(L,{path:"apps/advanced/audit",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/advanced/run-your-own",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/advanced/:tab",element:(0,s.jsx)(Pw,{})}),(0,s.jsx)(L,{path:"apps/app/:applicationId",element:(0,s.jsx)(Bw,{})}),(0,s.jsx)(L,{path:"apps/app/:applicationId/:tab",element:(0,s.jsx)(Bw,{})}),(0,s.jsx)(L,{path:"apps/:connectionId",element:(0,s.jsx)(Qe,{to:"permissions",replace:!0})}),(0,s.jsx)(L,{path:"apps/:connectionId/:tab",element:(0,s.jsx)(g8,{})}),(0,s.jsx)(L,{path:"company/settings/instance",element:(0,s.jsx)(Qe,{to:"/company/settings",replace:!0})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.profile"}),children:(0,s.jsx)(L,{path:"company/settings/instance/profile",element:(0,s.jsx)(_8,{})})}),(0,s.jsx)(L,{path:"company/settings/instance/general",element:(0,s.jsx)(Qe,{to:"/company/settings",replace:!0})}),(0,s.jsx)(L,{path:"company/settings/instance/heartbeats",element:(0,s.jsx)(Qe,{to:"/company/settings",replace:!0})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.environments"}),children:[(0,s.jsx)(L,{path:"company/settings/instance/environments",element:(0,s.jsx)(Sh,{})}),(0,s.jsx)(L,{path:"company/settings/instance/environments/new",element:(0,s.jsx)(Sh,{mode:"create"})}),(0,s.jsx)(L,{path:"company/settings/instance/environments/:environmentId/edit",element:(0,s.jsx)(Sh,{mode:"edit"})})]}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.access"}),children:(0,s.jsx)(L,{path:"company/settings/instance/access",element:(0,s.jsx)(A8,{})})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.experimental"}),children:[(0,s.jsx)(L,{path:"company/settings/instance/features",element:(0,s.jsx)(w8,{})}),(0,s.jsx)(L,{path:"company/settings/instance/advanced",element:(0,s.jsx)(C8,{})}),(0,s.jsx)(L,{path:"company/settings/instance/experimental",element:(0,s.jsx)(Qe,{to:"/company/settings/instance/features",replace:!0})})]}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.plugins"}),children:[(0,s.jsx)(L,{path:"company/settings/instance/plugins",element:(0,s.jsx)(E8,{})}),(0,s.jsx)(L,{path:"company/settings/instance/plugins/:pluginId",element:(0,s.jsx)(I8,{})})]}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.adapters"}),children:(0,s.jsx)(L,{path:"company/settings/instance/adapters",element:(0,s.jsx)(Fw,{})})}),(0,s.jsx)(L,{path:"company/settings/:settingsRoutePath/*",element:(0,s.jsx)(o8,{})}),(0,s.jsx)(L,{path:"skills/sources",element:(0,s.jsx)(qw,{})}),(0,s.jsx)(L,{path:"skills/sources/:sourceId",element:(0,s.jsx)(qw,{})}),(0,s.jsx)(L,{path:"skills/studio",element:(0,s.jsx)(Nh,{})}),(0,s.jsx)(L,{path:"skills/studio/new",element:(0,s.jsx)(Nh,{})}),(0,s.jsx)(L,{path:"skills/studio/:skillId",element:(0,s.jsx)(Nh,{})}),(0,s.jsx)(L,{path:"skills/:skillId/studio",element:(0,s.jsx)(cA,{})}),(0,s.jsx)(L,{path:"skills/*",element:(0,s.jsx)(b8,{})}),(0,s.jsx)(L,{path:"settings",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"settings/*",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"plugins/:pluginId",element:(0,s.jsx)(Hw,{})}),(0,s.jsx)(L,{path:"org",element:(0,s.jsx)(Qe,{to:"/agents/all",replace:!0})}),(0,s.jsx)(L,{path:"agents",element:(0,s.jsx)(Qe,{to:"/agents/all",replace:!0})}),rA.map(i=>(0,s.jsx)(L,{path:`agents/${i}`,element:(0,s.jsx)(R6,{})},i)),(0,s.jsx)(L,{path:"agents/new",element:(0,s.jsx)(T8,{})}),(0,s.jsx)(L,{path:"agents/:agentId",element:(0,s.jsx)(wh,{})}),(0,s.jsx)(L,{path:"agents/:agentId/:tab",element:(0,s.jsx)(wh,{})}),(0,s.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,s.jsx)(wh,{})}),(0,s.jsx)(L,{path:"projects",element:(0,s.jsx)(D6,{})}),(0,s.jsx)(L,{path:"projects/:projectId",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/overview",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(ph,{}),children:(0,s.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,s.jsx)(M6,{})})}),(0,s.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/configuration",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/budget",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(ph,{}),children:(0,s.jsx)(L,{path:"workspaces",element:(0,s.jsx)(O6,{})})}),(0,s.jsx)(L,{path:"terminal",element:(0,s.jsx)(K8,{children:(0,s.jsx)(B8,{})})}),(0,s.jsx)(L,{path:"issues",element:(0,s.jsx)(L6,{})}),(0,s.jsx)(L,{path:"tasks",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"tasks/new",element:(0,s.jsx)(v6,{})}),(0,s.jsx)(L,{path:"search",element:(0,s.jsx)(z6,{})}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"issues/all",element:(0,s.jsx)(ha,{view:"all"})}),(0,s.jsx)(L,{path:"issues/active",element:(0,s.jsx)(ha,{view:"active"})}),(0,s.jsx)(L,{path:"issues/backlog",element:(0,s.jsx)(ha,{view:"backlog"})}),(0,s.jsx)(L,{path:"issues/done",element:(0,s.jsx)(ha,{view:"done"})}),(0,s.jsx)(L,{path:"issues/recent",element:(0,s.jsx)(ha,{view:"recent"})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"issues/all",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/active",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/backlog",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/done",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/recent",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})})]}),(0,s.jsx)(L,{path:"chats",element:(0,s.jsx)(U6,{})}),(0,s.jsx)(L,{path:"chats/:agentRef",element:(0,s.jsx)($6,{})}),(0,s.jsx)(L,{path:"issues/:issueId",element:(0,s.jsx)(P6,{})}),null,(0,s.jsx)(L,{path:"routines",element:(0,s.jsx)(K6,{})}),(0,s.jsx)(L,{path:"cases",element:(0,s.jsx)(Aw,{children:(0,s.jsx)(A6,{})})}),(0,s.jsx)(L,{path:"cases/:caseIdentifier",element:(0,s.jsx)(Aw,{children:(0,s.jsx)(_6,{})})}),(0,s.jsx)(L,{path:"pixels-office",element:(0,s.jsx)(IB,{children:(0,s.jsx)(Q6,{})})}),(0,s.jsx)(L,{path:"status",element:(0,s.jsx)(_w,{children:(0,s.jsx)(Mw,{})})}),(0,s.jsx)(L,{path:"status/:cardId",element:(0,s.jsx)(_w,{children:(0,s.jsx)(Mw,{})})}),(0,s.jsx)(L,{path:"status-cards",element:(0,s.jsx)(Zw,{})}),(0,s.jsx)(L,{path:"status-cards/:cardId",element:(0,s.jsx)(Zw,{})}),(0,s.jsx)(L,{path:"review-queue",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(V6,{})})}),(0,s.jsx)(L,{path:"learnings",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(q6,{})})}),(0,s.jsx)(L,{path:"pipelines",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(kh,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(kh,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(kh,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(W6,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(F6,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(H6,{})})}),(0,s.jsx)(L,{path:"routines/:routineId",element:(0,s.jsx)(Ow,{})}),(0,s.jsx)(L,{path:"routines/:routineId/:section",element:(0,s.jsx)(Ow,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(ph,{}),children:(0,s.jsxs)(L,{element:(0,s.jsx)(TB,{}),children:[(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,s.jsx)(Rl,{})})]})}),(0,s.jsx)(L,{path:"goals",element:(0,s.jsx)(Y6,{})}),(0,s.jsx)(L,{path:"goals/:goalId",element:(0,s.jsx)(X6,{})}),(0,s.jsx)(L,{path:"artifacts",element:(0,s.jsx)(Lw,{})}),(0,s.jsx)(L,{path:"approvals",element:(0,s.jsx)(Qe,{to:"/approvals/pending",replace:!0})}),(0,s.jsx)(L,{path:"approvals/pending",element:(0,s.jsx)(zw,{})}),(0,s.jsx)(L,{path:"approvals/all",element:(0,s.jsx)(zw,{})}),(0,s.jsx)(L,{path:"approvals/:approvalId",element:(0,s.jsx)(Z6,{})}),(0,s.jsx)(L,{path:"activity",element:(0,s.jsx)(J6,{})}),(0,s.jsx)(L,{path:"activity/runs",element:(0,s.jsx)(md,{section:"runs"})}),(0,s.jsx)(L,{path:"activity/costs",element:(0,s.jsx)(md,{section:"costs"})}),(0,s.jsx)(L,{path:"activity/budgets",element:(0,s.jsx)(md,{section:"budgets"})}),(0,s.jsx)(L,{path:"activity/timeline",element:(0,s.jsx)(md,{section:"timeline"})}),(0,s.jsx)(L,{path:"audit",element:(0,s.jsx)(Va,{to:"/activity",forceAgentMode:!0})}),(0,s.jsx)(L,{path:"audit/activity",element:(0,s.jsx)(Va,{to:"/activity"})}),(0,s.jsx)(L,{path:"audit/runs",element:(0,s.jsx)(Va,{to:"/activity/runs"})}),(0,s.jsx)(L,{path:"audit/costs",element:(0,s.jsx)(Va,{to:"/activity/costs"})}),(0,s.jsx)(L,{path:"audit/budgets",element:(0,s.jsx)(Va,{to:"/activity/budgets"})}),(0,s.jsx)(L,{path:"audit/timeline",element:(0,s.jsx)(Va,{to:"/activity/timeline"})}),(0,s.jsx)(L,{path:"runs",element:(0,s.jsx)(Va,{to:"/activity/runs"})}),(0,s.jsx)(L,{path:"costs",element:(0,s.jsx)(Va,{to:"/activity/costs"})}),(0,s.jsx)(L,{path:"budgets",element:(0,s.jsx)(Va,{to:"/activity/budgets"})}),(0,s.jsxs)(L,{element:(0,s.jsx)(EB,{}),children:[(0,s.jsx)(L,{path:"board-chat",element:(0,s.jsx)(n8,{})}),(0,s.jsx)(L,{path:"artifacts",element:(0,s.jsx)(Lw,{})})]}),null,(0,s.jsx)(L,{path:"decisions",element:(0,s.jsx)(e8,{})}),(0,s.jsx)(L,{path:"decisions/queues/:key",element:(0,s.jsx)(t8,{})}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"inbox",element:(0,s.jsx)(Gw,{})}),(0,s.jsx)(L,{path:"inbox/mine",element:(0,s.jsx)(ha,{view:"mine"})}),(0,s.jsx)(L,{path:"inbox/recent",element:(0,s.jsx)(ha,{view:"recent"})}),(0,s.jsx)(L,{path:"inbox/unread",element:(0,s.jsx)(ha,{view:"unread"})}),(0,s.jsx)(L,{path:"inbox/blocked",element:(0,s.jsx)(ha,{view:"blocked"})}),(0,s.jsx)(L,{path:"inbox/all",element:(0,s.jsx)(ha,{view:"everything"})}),(0,s.jsx)(L,{path:"inbox/new",element:(0,s.jsx)(ha,{view:"mine"})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"inbox",element:(0,s.jsx)(Gw,{})}),(0,s.jsx)(L,{path:"inbox/mine",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/recent",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/unread",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/blocked",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/all",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/new",element:(0,s.jsx)(Qe,{to:"/inbox/mine",replace:!0})})]}),(0,s.jsx)(L,{path:"inbox/requests",element:(0,s.jsx)(U8,{})}),(0,s.jsx)(L,{path:"u/:userSlug",element:(0,s.jsx)(G6,{})}),(0,s.jsx)(L,{path:"design-guide",element:(0,s.jsx)(j8,{})}),(0,s.jsx)(L,{path:"instance/settings/adapters",element:(0,s.jsx)(Fw,{})}),(0,s.jsx)(L,{path:":pluginRoutePath/*",element:(0,s.jsx)(Hw,{})}),(0,s.jsx)(L,{path:"*",element:(0,s.jsx)(oA,{scope:"board"})})]})}r(q8,"boardRoutes");function Qw({credentialSource:e="wardmote_vault"}={}){const t=vn(),i=new URLSearchParams(t.search),{enabled:l,githubEnabled:c}=s0();return dT(i,{chatConnectorsEnabled:l,githubReviewBotsEnabled:c})?(0,s.jsx)(lA,{credentialSource:e}):(0,s.jsx)(Qe,{to:"/apps",replace:!0})}r(Qw,"AppsConnectEntryRoute");function Gw(){const{enabled:e}=Of();return e?(0,s.jsx)(ha,{view:PE(bj())}):(0,s.jsx)(Qe,{to:`/inbox/${bj()}`,replace:!0})}r(Gw,"InboxRootRedirect");function ha({view:e}){const t=vn(),i=new URLSearchParams(t.search);return i.set(DE,e),(0,s.jsx)(Qe,{to:`/issues?${i.toString()}${t.hash}`,replace:!0})}r(ha,"TaskViewRedirect");function cA(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=vt(),{companyPrefix:c,skillId:u}=La();if(l)return null;const m=(c?t.find(f=>f.issuePrefix.toUpperCase()===c.toUpperCase()):null)??i??t[0]??null;return!m||!u?(0,s.jsx)(Qe,{to:"/skills/studio",replace:!0}):(0,s.jsx)(Qe,{to:`/${m.issuePrefix}/skills/studio/${encodeURIComponent(u)}${e.search}${e.hash}`,replace:!0})}r(cA,"LegacySkillStudioRedirect");function Lr(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=vt(),{companyPrefix:c}=La(),{hidden:u}=lr();if(l)return(0,s.jsx)(Ra,{});const m=(c?t.find(h=>h.issuePrefix.toUpperCase()===c.toUpperCase()):null)??i??t[0]??null;if(!m)return Y0({pathname:e.pathname,hasCompanies:!1})?(0,s.jsx)(Qe,{to:"/onboarding",replace:!0}):(0,s.jsx)(J0,{});const f=_3(E3(`${e.pathname}${e.search}${e.hash}`),u);return(0,s.jsx)(Qe,{to:`/${m.issuePrefix}${f}`,replace:!0})}r(Lr,"LegacySettingsRedirect");function Yw(){const{tab:e}=La();return(0,s.jsx)(Qe,{to:uA(e),replace:!0})}r(Yw,"LegacyToolsSettingsRedirect");function Xw(){const{tab:e}=La();return(0,s.jsx)(Qe,{to:uA(e),replace:!0})}r(Xw,"LegacyToolsRedirect");function uA(e){return e?e==="applications"||e==="connections"||e==="overview"||e==="examples"||e==="runtime"||e==="audit"?"/apps":e==="policies"?"/apps/advanced/profiles":`/apps/advanced/${e}`:"/apps/advanced/profiles"}r(uA,"legacyToolsRedirectTarget");function dA(){const{companies:e}=vt(),{openOnboarding:t}=Pa(),{t:i}=aN(),{onboardingOpen:l,onboardingRouteDismissed:c}=Cf(),{companyPrefix:u}=La(),m=u?e.find(g=>g.issuePrefix.toUpperCase()===u.toUpperCase())??null:null;if(RU({onboardingOpen:l,routeDismissed:c}))return null;const f=m?`Add another agent to ${m.name}`:e.length>0?"Create another organization":"Create your first organization",h=m?"Run onboarding again to add an agent and a starter task for this organization.":e.length>0?"Run onboarding again to create another organization and seed its first agent.":"Get started by creating an organization and your first agent.";return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:f}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:h}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(le,{onClick:r(()=>m?t({initialStep:HC(),companyId:m.id}):t(),"onClick"),children:m?"Add Agent":"Start Onboarding"})})]})})}r(dA,"OnboardingRoutePage");function F8(){const{companies:e,selectedCompany:t,loading:i}=vt(),l=vn();if(i)return(0,s.jsx)(Ra,{});const c=t??e[0]??null;return c?(0,s.jsx)(Qe,{to:`/${c.issuePrefix}/dashboard`,replace:!0}):Y0({pathname:l.pathname,hasCompanies:!1})?(0,s.jsx)(Qe,{to:"/onboarding",replace:!0}):(0,s.jsx)(J0,{})}r(F8,"CompanyRootRedirect");function Zw(){const{cardId:e}=La(),t=zE(),i=t?`/${t}`:"";return(0,s.jsx)(Qe,{to:`${i}/status${e?`/${e}`:""}`,replace:!0})}r(Zw,"StatusCardsLegacyRedirect");function Va({to:e,forceAgentMode:t=!1}){const i=vn(),l=new URLSearchParams(i.search);t&&l.set("mode","agents");const c=l.toString();return(0,s.jsx)(Qe,{to:`${e}${c?`?${c}`:""}${i.hash}`,replace:!0})}r(Va,"AuditCompatibilityRedirect");function Ze(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=vt();if(l)return(0,s.jsx)(Ra,{});const c=i??t[0]??null;return c?(0,s.jsx)(Qe,{to:`/${c.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):Y0({pathname:e.pathname,hasCompanies:!1})?(0,s.jsx)(Qe,{to:"/onboarding",replace:!0}):(0,s.jsx)(J0,{})}r(Ze,"UnprefixedBoardRedirect");function J0(){const{openOnboarding:e}=Pa(),{t}=aN();return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:t("app.noCompanies.title",{defaultValue:"Create your first organization"})}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:t("app.noCompanies.description",{defaultValue:"Get started by creating an organization."})}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(le,{onClick:r(()=>e(),"onClick"),children:t("app.noCompanies.newCompany",{defaultValue:"New Organization"})})})]})})}r(J0,"NoCompaniesStartPage");function H8(){const{enabled:e}=Of();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:(0,s.jsxs)(aE,{children:[(0,s.jsx)(L,{path:"auth",element:(0,s.jsx)(R8,{})}),(0,s.jsx)(L,{path:"board-claim/:token",element:(0,s.jsx)(D8,{})}),(0,s.jsx)(L,{path:"mcp-connect/:id",element:(0,s.jsx)(Vw,{})}),(0,s.jsx)(L,{path:"dot-connect/:id",element:(0,s.jsx)(Vw,{agentPairingOnly:!0})}),(0,s.jsx)(L,{path:"mcp-device",element:(0,s.jsx)(O8,{})}),(0,s.jsx)(L,{path:"assistant-connections",element:(0,s.jsx)(L8,{})}),(0,s.jsx)(L,{path:"cli-auth/:id",element:(0,s.jsx)(z8,{})}),(0,s.jsx)(L,{path:"invite/:token",element:(0,s.jsx)(P8,{})}),(0,s.jsx)(L,{path:"s/:token",element:(0,s.jsx)(Ww,{})}),(0,s.jsx)(L,{path:"s/:token/issues/:issueId",element:(0,s.jsx)(Ww,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(Dw,{allowMembershipRequest:!0}),children:(0,s.jsx)(L,{path:"chat-identity/confirm",element:(0,s.jsx)(p8,{})})}),(0,s.jsx)(L,{path:"tests/perf/long-thread",element:(0,s.jsx)(B6,{})}),(0,s.jsx)(L,{path:"ux-lab/bootstrap-setup",element:(0,s.jsx)(i8,{})}),(0,s.jsx)(L,{path:"ux-lab/responsible-user-denial",element:(0,s.jsx)(r8,{})}),(0,s.jsx)(L,{path:"ux-lab/cross-issue-collaboration",element:(0,s.jsx)(l8,{})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Dw,{}),children:[(0,s.jsx)(L,{index:!0,element:(0,s.jsx)(F8,{})}),(0,s.jsx)(L,{path:"onboarding",element:(0,s.jsx)(dA,{})}),(0,s.jsx)(L,{path:"instance",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"instance/settings",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"instance/settings/*",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"companies",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"dashboard",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"inbox/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"issues",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"tasks",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"tasks/new",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"issues/:issueId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"routines",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"routines/:routineId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"review-queue",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"learnings",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"cases",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"cases/:caseIdentifier",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pixels-office",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status/:cardId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status-cards",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status-cards/:cardId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"artifacts",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"audit",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"audit/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"activity",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"activity/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"runs",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"costs",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"budgets",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"decisions",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"u/:userSlug",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/studio",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/studio/new",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/studio/:skillId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/:skillId/studio",element:(0,s.jsx)(cA,{})}),(0,s.jsx)(L,{path:"skills/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"settings",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"settings/*",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"agents",element:(0,s.jsx)(Ze,{})}),rA.map(t=>(0,s.jsx)(L,{path:`agents/${t}`,element:(0,s.jsx)(Ze,{})},t)),(0,s.jsx)(L,{path:"agents/new",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"agents/:agentId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"agents/:agentId/:tab",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/overview",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/configuration",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"workspaces",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"terminal",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:":companyPrefix",element:(0,s.jsx)(CB,{}),children:q8(e)}),(0,s.jsx)(L,{path:"*",element:(0,s.jsx)(oA,{scope:"global"})})]})]})}),(0,s.jsx)(x6,{}),(0,s.jsx)(K$,{})]})}r(H8,"App");var V8=class extends x.Component{static{r(this,"AppErrorBoundary")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){XC(e,{boundary:"app",componentStack:t.componentStack})}render(){const{error:e}=this.state;return e?(0,s.jsxs)("div",{className:"mx-auto flex min-h-screen max-w-2xl flex-col justify-center space-y-4 px-4 py-10",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold",children:"Wardmote hit an error"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while running the app. Reloading usually fixes this."})]}),(0,s.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",className:"inline-flex items-center rounded-md border border-line-strong bg-bg px-3 py-1.5 text-sm font-medium shadow-sm hover:bg-bg-3 hover:text-ink",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})})]}):this.props.children}};function W8(){const{data:e}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),t=e?.sentryDsn,i=e?.sentryEnvironment??void 0;return(0,x.useEffect)(()=>{if(t)return h$(t,i),()=>{g$()}},[t,i]),null}r(W8,"SentryGate");function Q8(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}r(Q8,"createDeferred");function G8(e,t=300){const i=new Map;let l=null,c=null;const u=r(async()=>{l!==null&&(clearTimeout(l),l=null);const h=c;if(c=null,i.size===0){h?.resolve();return}const g=[...i.values()];i.clear();try{await Promise.all(g.map(v=>e.invalidateQueries(ff().visible?v:{...v,refetchType:"none"})))}finally{h?.resolve()}},"flush");return{schedule:r(h=>(i.set(Y8(h),h),c===null&&(c=Q8()),l===null&&(l=setTimeout(()=>{u()},t)),c.promise),"schedule"),flush:u,dispose:r(()=>{l!==null&&(clearTimeout(l),l=null),i.clear(),c?.resolve(),c=null},"dispose")}}r(G8,"createInvalidationBatcher");var Jw=0;function Y8(e){if(typeof e.predicate=="function")return`__predicate__:${Jw+=1}`;try{return JSON.stringify([e.queryKey??null,e.refetchType??null,e.exact??null,e.type??null])}catch{return`__nonserializable__:${Jw+=1}`}}r(Y8,"serializeFilters");function X8(e,t){return new Proxy(e,{get(i,l){if(l==="invalidateQueries")return u=>t.schedule(u??{});const c=Reflect.get(i,l,i);return typeof c=="function"?c.bind(i):c}})}r(X8,"createCoalescingQueryClient");function Z8(e,t){if(!e)return e;const i=e.filter(l=>l.id!==t);return i.length===e.length?e:i}r(Z8,"removeRunFromList");function J8(e,t,i){if(!e)return{next:e,present:!1};let l=!1,c=!1;const u=e.map(m=>m.id!==t||(l=!0,m.status===i)?m:(c=!0,{...m,status:i}));return{next:c?u:e,present:l}}r(J8,"patchRunStatusInList");function eK(e,t){if(!e)return e;const i=e.filter(l=>l.id!==t);return i.length===e.length?e:i}r(eK,"removeLiveRunById");function tK(e,t){return!e||e.executionRunId!==t?e:{...e,executionRunId:null,executionAgentNameKey:null,executionLockedAt:null}}r(tK,"clearIssueExecutionRun");var nK=3e4,sK=["status","priority","title","assigneeAgentId","assigneeUserId","projectId","parentId"],aK=new Set(["issue.read_marked","issue.read_unmarked","issue.inbox_archived","issue.inbox_unarchived"]);function Rg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(Rg,"isRecord");function ex(e){return Rg(e)&&Array.isArray(e.pages)}r(ex,"isInfiniteIssueData");function iK(e){return Array.isArray(e)?e.length:ex(e)?e.pages.reduce((t,i)=>t+(Array.isArray(i)?i.length:0),0):0}r(iK,"issueListRowCount");function rK(e){const t=e.state.data;return ex(t)||iK(t)>=100}r(rK,"isLargeIssueListQuery");function lK(e,t,i){const l={},c=Rg(t?.changes)?t.changes:null;if(e==="issue.updated"&&c)for(const u of sK){const m=c[u];!Rg(m)||m.updated===!0||!("to"in m)||(l[u]=m.to)}return i&&e&&!aK.has(e)&&!Number.isNaN(Date.parse(i))&&(l.lastActivityAt=i),l}r(lK,"readIssueListPatchFromActivity");function oK(e,t){let i=null;for(const[l,c]of Object.entries(t)){if(l==="lastActivityAt"){const u=e.lastActivityAt?new Date(e.lastActivityAt).getTime():0;if(new Date(c).getTime()<=u)continue}else if(!(l in e)||e[l]===c)continue;i??={...e},i[l]=c}return i??e}r(oK,"patchIssueRow");function ek(e,t,i){const l=e.findIndex(m=>m?.id===t);if(l<0)return e;const c=oK(e[l],i);if(c===e[l])return e;const u=e.slice();return u[l]=c,u}r(ek,"patchIssueRows");function cK(e,t,i){if(Array.isArray(e))return ek(e,t,i);if(!ex(e))return e;let l=!1;const c=e.pages.map(u=>{if(!Array.isArray(u))return u;const m=ek(u,t,i);return m!==u&&(l=!0),m});return l?{...e,pages:c}:e}r(cK,"patchIssueListData");function uK(e,t,i,l){if(Object.keys(l).length===0)return 0;let c=0;for(const[u,m]of e.getQueriesData({queryKey:U.issues.list(t)})){const f=cK(m,i,l);f!==m&&(e.setQueryData(u,f),c+=1)}return c}r(uK,"patchIssueInListCaches");function dK(e,t){for(const i of e.getQueryCache().findAll({queryKey:U.issues.list(t)}))e.invalidateQueries({queryKey:i.queryKey,exact:!0,...rK(i)?{refetchType:"none"}:{}})}r(dK,"invalidateIssueListsForActivity");function fK(e,t){const i=r(l=>l.state.isInvalidated,"predicate");return Promise.all([e.refetchQueries({queryKey:U.issues.list(t),type:"active",predicate:i}),e.refetchQueries({queryKey:U.heartbeats(t),type:"active",predicate:i})])}r(fK,"refreshInvalidatedLiveLists");function Bl(e){return typeof e=="string"&&e.length>0?e:null}r(Bl,"readString$1");function mK(e){return e.length===3&&e[0]==="issues"&&e[2]==="agent-todo"}r(mK,"isAgentTodoQueryKey");function pK(e){if(e.type!=="heartbeat.run.event")return null;const t=e.payload??{};if(t.eventType!=="agent.todo")return null;const i=Bl(t.runId),l=Bl(t.agentId),c=Bl(t.issueId),u=t.seq;if(!i||!l||!c||typeof u!="number"||!Number.isInteger(u))return null;const m=q_(t.payload);return m?{...m,runId:i,agentId:l,issueId:c,seq:u,createdAt:Bl(t.lastEventAt)??e.createdAt,runStatus:"running"}:null}r(pK,"readAgentTodoSnapshotFromLiveEvent");function tk(e,t){if(t.type==="heartbeat.run.status"){const l=t.payload??{},c=Bl(l.runId),u=Bl(l.status);if(!c||!u)return;e.setQueriesData({predicate:r(m=>mK(m.queryKey),"predicate")},m=>m&&m.runId===c&&m.runStatus!==u?{...m,runStatus:u}:m);return}const i=pK(t);i&&e.setQueryData(U.issues.agentTodo(i.issueId),l=>l&&l.runId===i.runId&&l.seq>=i.seq?l:i)}r(tk,"applyAgentTodoLiveEvent");function hK(e){const t=e.trim().toLowerCase();return t==="0.0.0.0"||t==="::"||t==="[::]"}r(hK,"isWildcardHost");function gK(e=window.location){return hK(e.hostname)?e.port?`localhost:${e.port}`:"localhost":e.host}r(gK,"browserReachableHost");function xK(e,t=window.location){const i=t.protocol==="https:"?"wss":"ws",l=e.startsWith("/")?e:`/${e}`;return`${i}://${gK(t)}${l}`}r(xK,"buildSameOriginWebSocketUrl");function bK(e){try{return new WebSocket(e)}catch{return null}}r(bK,"tryCreateWebSocket");var vK="/pwa-192x192.png",yK="/pwa-monochrome-512x512.png";function tx(){return typeof window<"u"&&"Notification"in window}r(tx,"notificationsSupported");function nx(){return tx()?Notification.permission:"unsupported"}r(nx,"notificationPermission");async function jK(){return tx()?Notification.permission!=="default"?Notification.permission:Notification.requestPermission():"unsupported"}r(jK,"requestNotificationPermission");function wK(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window}r(wK,"pushSupported");function NG(e=typeof navigator>"u"?void 0:navigator){return e?(/iPad|iPhone|iPod/.test(e.userAgent)||e.platform==="MacIntel"&&(e.maxTouchPoints??0)>1)&&e.standalone!==!0:!1}r(NG,"isIosWithoutHomeScreenInstall");async function fA(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{return await navigator.serviceWorker.getRegistration()??null}catch{return null}}r(fA,"getServiceWorkerRegistration");var mA="wardmote.notifications.seen.v1",kK="wardmote.notifications.claim",SK=6e5,NK=200,CK=new Map;function AK(){let e=null;try{e=typeof localStorage>"u"?null:localStorage}catch{e=null}const t=typeof navigator<"u"&&navigator.locks?{request:r((i,l)=>navigator.locks.request(i,l),"request")}:null;return{storage:e,locks:t,now:r(()=>Date.now(),"now"),memory:CK}}r(AK,"defaultEnv");function _K(e){const t=e.storage?.getItem(mA);if(!t)return new Map(e.memory);try{const i=JSON.parse(t),l=new Map(e.memory);for(const[c,u]of Object.entries(i))typeof u=="number"&&l.set(c,u);return l}catch{return new Map(e.memory)}}r(_K,"readSeen");function Ch(e,t){const i=t.now(),l=_K(t);for(const[u,m]of l)i-m>SK&&l.delete(u);if(l.has(e))return!1;l.set(e,i);const c=[...l.entries()].sort((u,m)=>m[1]-u[1]).slice(0,NK);t.memory.clear();for(const[u,m]of c)t.memory.set(u,m);return EK(t,c),!0}r(Ch,"claimInsideLock");function EK(e,t){try{e.storage?.setItem(mA,JSON.stringify(Object.fromEntries(t)))}catch{return}}r(EK,"writeSeen");async function IK(e,t=AK()){if(!t.locks)return Ch(e,t);try{return await t.locks.request(kK,()=>Ch(e,t))}catch{return Ch(e,t)}}r(IK,"claimNotificationKey");var Ah="paperclip-notifications";function _h(e){return new Promise((t,i)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>i(e.error)})}r(_h,"settle");function TK(e){return new Promise((t,i)=>{e.oncomplete=()=>t(),e.onerror=()=>i(e.error),e.onabort=()=>i(e.error)})}r(TK,"committed");async function RK(e,t){if(typeof indexedDB.databases!="function"||!(await indexedDB.databases()).some(c=>c.name===Ah))return 0;const i=await _h(indexedDB.open(Ah));let l=0;try{if(i.objectStoreNames.contains(t)){const c=await _h(i.transaction(t,"readonly").objectStore(t).getAll()),u=new Set(await _h(e.transaction(t,"readonly").objectStore(t).getAllKeys())),m=c.filter(f=>!u.has(f.kind));if(m.length>0){const f=e.transaction(t,"readwrite"),h=f.objectStore(t);for(const g of m)h.put(g);await TK(f),l=m.length}}}finally{i.close()}return indexedDB.deleteDatabase(Ah),l}r(RK,"moveRetiredCustomSounds");var DK="wardmote-notifications",fc="custom-sounds";function MK(e){return e.type.startsWith("audio/")?e.size<=0?{ok:!1,error:"The audio file is empty."}:e.size>524288?{ok:!1,error:"Custom sounds must be 512 KB or smaller."}:{ok:!0}:{ok:!1,error:"Choose an audio file."}}r(MK,"validateCustomSoundFile");function pA(e){return new Promise((t,i)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>i(e.error)})}r(pA,"requestResult");var pd=null;function OK(){if(typeof indexedDB>"u")return Promise.reject(new Error("IndexedDB is unavailable."));if(!pd){const e=indexedDB.open(DK,1);e.onupgradeneeded=()=>{e.result.objectStoreNames.contains(fc)||e.result.createObjectStore(fc,{keyPath:"kind"})},pd=pA(e).then(async t=>(await RK(t,fc).catch(()=>0),t)).catch(t=>{throw pd=null,t})}return pd}r(OK,"openDb");async function sx(e,t){return pA(t((await OK()).transaction(fc,e).objectStore(fc)))}r(sx,"withStore");var Dg=new Set;function LK(e){return Dg.add(e),()=>Dg.delete(e)}r(LK,"subscribeCustomSounds");function hA(){for(const e of Dg)e()}r(hA,"notifyCustomSoundsChanged");async function CG(e,t){const i=MK(t);if(!i.ok)throw new Error(i.error);const l={kind:e,name:t.name,type:t.type,size:t.size,blob:t,updatedAt:new Date().toISOString()};return await sx("readwrite",c=>c.put(l)),hA(),l}r(CG,"saveCustomSound");async function zK(e){try{return await sx("readonly",t=>t.get(e))??null}catch{return null}}r(zK,"loadCustomSound");async function AG(e){await sx("readwrite",t=>t.delete(e)),hA()}r(AG,"removeCustomSound");var PK=[{id:"confirmation",label:"Confirmation"},{id:"question",label:"Question"},{id:"glass",label:"Glass"},{id:"bong",label:"Bong"},{id:"maximize",label:"Rise"},{id:"pluck",label:"Pluck"},{id:"error",label:"Alert"},{id:"drop",label:"Drop"},{id:"select",label:"Select"},{id:"open",label:"Open"}],_G="custom",EG="none",Mg={approval:"confirmation",question:"question",comment:"pluck",assignment:"maximize",review:"glass",run_failed:"error",join_request:"bong",disk_space:"drop"},IG={approval:"Approvals",question:"Agent questions",comment:"Comments",assignment:"Assignments",review:"Ready for review",run_failed:"Failed runs",join_request:"Join requests",disk_space:"Low disk space"},gA=new Set(PK.map(e=>e.id));function UK(e){return typeof e=="string"&&(gA.has(e)||e==="custom"||e==="none")}r(UK,"isKnownSoundId");function $K(e){return gA.has(e)}r($K,"isLibrarySoundId");function nk(e,t){return`/sounds/${e}.${t}`}r(nk,"librarySoundUrl");var Og=new Map,af=new Map,sk=!1,hd=null;function xA(){return typeof Audio<"u"}r(xA,"audioSupported");function ak(){return hd||(hd=new Audio().canPlayType('audio/ogg; codecs="vorbis"')?"ogg":"mp3",hd)}r(ak,"libraryFormat");function bA(e){let t=Og.get(e);return t||(t=new Audio,t.preload="auto",t.src=e,Og.set(e,t)),t}r(bA,"audioFor");function BK(){for(const e of af.values())e.then(t=>{t&&(Og.delete(t),URL.revokeObjectURL(t))});af.clear()}r(BK,"revokeCustomSounds");function KK(e){sk||(sk=!0,LK(BK));let t=af.get(e);return t||(t=zK(e).then(i=>i?URL.createObjectURL(i.blob):null),af.set(e,t)),t}r(KK,"customSoundUrl");async function vA(e,t){if(t==="none")return null;if(t==="custom"){const i=await KK(e);return i||nk(Mg[e],ak())}return nk($K(t)?t:Mg[e],ak())}r(vA,"resolveSoundUrl");async function qK(e,t,i){if(!xA())return!1;const l=await vA(e,t);if(!l)return!1;const c=bA(l);c.volume=Math.min(1,Math.max(0,i)),c.currentTime=0;try{return await c.play(),!0}catch{return!1}}r(qK,"playSound");function FK(e,t){return qK(e,t.kinds[e].soundId,t.volume)}r(FK,"playKindSound");function ik(e){if(!(!xA()||!e.enabled))for(const[t,i]of Object.entries(e.kinds))i.enabled&&vA(t,i.soundId).then(l=>{l&&bA(l)})}r(ik,"preloadNotificationSounds");var Lg={getWebPushConfig:r(()=>we.get("/notifications/web-push/config"),"getWebPushConfig"),upsertWebPushSubscription:r(e=>we.put("/notifications/web-push/subscription",e),"upsertWebPushSubscription"),deleteWebPushSubscription:r(e=>we.deleteWithBody("/notifications/web-push/subscription",e),"deleteWebPushSubscription"),sendWebPushTest:r(()=>we.post("/notifications/web-push/test",{}),"sendWebPushTest")},yA="wardmote.notifications.v1",HK=.6;function zg(){const e={};for(const t of Yg)e[t]={enabled:!0,soundId:Mg[t]};return{enabled:!0,volume:HK,pushEnabled:!0,kinds:e}}r(zg,"defaultNotificationSettings");function Eh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}r(Eh,"asRecord");function jA(e){const t=zg(),i=Eh(e);if(!i)return t;const l=typeof i.volume=="number"&&Number.isFinite(i.volume)?Math.min(1,Math.max(0,i.volume)):t.volume,c=Eh(i.kinds)??{},u={...t.kinds};for(const m of Yg){const f=Eh(c[m]);f&&(u[m]={enabled:typeof f.enabled=="boolean"?f.enabled:t.kinds[m].enabled,soundId:UK(f.soundId)?f.soundId:t.kinds[m].soundId})}return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,volume:l,pushEnabled:typeof i.pushEnabled=="boolean"?i.pushEnabled:t.pushEnabled,kinds:u}}r(jA,"normalizeNotificationSettings");function rf(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}r(rf,"storage");function VK(){const e=rf()?.getItem(yA);if(!e)return zg();try{return jA(JSON.parse(e))}catch{return zg()}}r(VK,"readStored");var lf,sc=null,Ad=new Set,gd=!1;function Vr(){const e=rf()?.getItem("wardmote.notifications.v1")??null;return sc&&e===lf||(lf=e,sc=VK()),sc}r(Vr,"getNotificationSettings");function wA(){for(const e of Ad)e()}r(wA,"notify");function kA(e){const t=jA(typeof e=="function"?e(Vr()):e);try{rf()?.setItem(yA,JSON.stringify(t))}catch{lf=void 0}return sc=t,lf=rf()?.getItem("wardmote.notifications.v1")??null,wA(),t}r(kA,"setNotificationSettings");function TG(e,t){return kA(i=>({...i,kinds:{...i.kinds,[e]:{...i.kinds[e],...t}}}))}r(TG,"updateKindSettings");function WK(e){return e.enabled?Yg.filter(t=>e.kinds[t].enabled):[]}r(WK,"enabledNotificationKinds");function rk(e){e.key!==null&&e.key!=="wardmote.notifications.v1"||wA()}r(rk,"onStorage");function SA(e){return Ad.add(e),!gd&&typeof window<"u"&&(gd=!0,window.addEventListener("storage",rk)),()=>{Ad.delete(e),Ad.size===0&&gd&&typeof window<"u"&&(gd=!1,window.removeEventListener("storage",rk))}}r(SA,"subscribeNotificationSettings");function RG(){return(0,x.useSyncExternalStore)(SA,Vr,Vr)}r(RG,"useNotificationSettings");var mc={status:"unknown",error:null},Pg=new Set,Ug=null,lk=Promise.resolve();function ok(e){if(!(e.status===mc.status&&e.error===mc.error)){mc=e;for(const t of Pg)t()}}r(ok,"setPushState");function ck(){return mc}r(ck,"getPushState");function QK(){return mc.status==="active"}r(QK,"hasActivePushSubscription");function GK(e){return Pg.add(e),()=>Pg.delete(e)}r(GK,"subscribePushState");function DG(){return(0,x.useSyncExternalStore)(GK,ck,ck)}r(DG,"usePushState");function NA(e){const t=e.padEnd(e.length+(4-e.length%4)%4,"=").replace(/-/g,"+").replace(/_/g,"/"),i=atob(t),l=new Uint8Array(new ArrayBuffer(i.length));for(let c=0;c<i.length;c+=1)l[c]=i.charCodeAt(c);return l}r(NA,"urlBase64ToUint8Array");function YK(e,t){const i=e.options?.applicationServerKey;if(!i)return!0;const l=NA(t),c=new Uint8Array(i);return c.length===l.length&&c.every((u,m)=>u===l[m])}r(YK,"sameApplicationServerKey");async function uk(e){await Lg.deleteWebPushSubscription({endpoint:e.endpoint}).catch(()=>{}),await e.unsubscribe().catch(()=>!1),Ug=null}r(uk,"forgetSubscription");async function XK(e,t){if(!wK())return{status:"unsupported",error:null};const i=await fA();if(!i)return{status:"unsupported",error:null};let l=await i.pushManager.getSubscription();if(!(e.enabled&&e.pushEnabled))return l&&await uk(l),{status:"off",error:null};if(nx()!=="granted")return{status:"permission",error:null};const c=await Lg.getWebPushConfig();if(!c.enabled||!c.publicKey)return{status:"server-disabled",error:null};l&&!YK(l,c.publicKey)&&(await uk(l),l=null),l||(l=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:NA(c.publicKey)}));const u=l.toJSON(),m=u.keys?.p256dh,f=u.keys?.auth;if(!m||!f)return{status:"error",error:"The browser returned an incomplete push subscription."};const h=WK(e),g=[t,l.endpoint,...h].join("|");return g!==Ug&&(await Lg.upsertWebPushSubscription({endpoint:l.endpoint,keys:{p256dh:m,auth:f},kinds:h}),Ug=g),{status:"active",error:null}}r(XK,"reconcile");function $g(e,t){const i=lk.then(async()=>{try{const l=await XK(e,t);return ok(l),l}catch(l){const c={status:"error",error:l instanceof Error?l.message:"Push subscription failed."};return ok(c),c}});return lk=i.catch(()=>{}),i}r($g,"syncPushSubscription");function CA(e,t){return t.enabled&&t.kinds[e.kind]?.enabled===!0}r(CA,"kindEnabled");function ZK(e){const{payload:t,userId:i,settings:l}=e;return!i||!t.recipientUserIds.includes(i)||!CA(t.notification,l)?"none":e.visible?"sound":e.pushActive?"none":"os"}r(ZK,"decideLiveNotification");function JK(e){return!e.visible||!CA(e.notification,e.settings)?"none":"sound"}r(JK,"decideServiceWorkerNotification");async function eq(e){if(nx()!=="granted")return;const t={body:e.body,tag:e.key,data:{url:e.url},icon:vK,badge:yK},i=await fA();if(i){await i.showNotification(e.title,t);return}new Notification(e.title,t)}r(eq,"showOsNotification");var AA={claim:r(e=>IK(e),"claim"),playSound:r((e,t)=>FK(e.kind,t),"playSound"),showOsNotification:eq};async function _A(e,t,i,l){return e==="none"?e:await l.claim(t.key)?(e==="sound"?await l.playSound(t,i):await l.showOsNotification(t),e):"none"}r(_A,"perform");function tq(e,t,i=AA,l={}){const c=l.settings??Vr();return _A(ZK({payload:e,userId:t,settings:c,visible:l.visible??ff().visible,pushActive:l.pushActive??QK()}),e.notification,c,i)}r(tq,"deliverLiveNotification");function nq(e,t=AA,i={}){const l=i.settings??Vr();return _A(JK({notification:e,settings:l,visible:i.visible??ff().visible}),e,l,t)}r(nq,"deliverServiceWorkerNotification");function EA(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.key=="string"&&typeof t.kind=="string"&&typeof t.title=="string"?t:null}r(EA,"readNotification");function sq(e){if(!e||typeof e!="object")return null;const t=e,i=EA(t.notification);return!i||!Array.isArray(t.recipientUserIds)?null:{notification:i,recipientUserIds:t.recipientUserIds.filter(l=>typeof l=="string")}}r(sq,"readNotificationCreatedPayload");function aq(e){if(!e||typeof e!="object")return null;const t=e;if(t.type==="wardmote.notification"){const i=EA(t.notification);return i?{type:"notification",notification:i}:null}return t.type==="wardmote.navigate"&&typeof t.url=="string"&&t.url.startsWith("/")?{type:"navigate",url:t.url}:null}r(aq,"readServiceWorkerMessage");var iq=1e4,rq=3,lq=2e3,oq=3e5,cq=2e3,uq=15e3,dq=0,fq=1,Ec=new Set(["succeeded","interrupted","failed","cancelled","timed_out"]),IA=(0,x.createContext)(null);function mq(e,t,i){if(i.companyId===t)for(const l of Array.from(e))try{l(i)}catch{}}r(mq,"dispatchLiveEventToSubscribers");function MG(e){const t=(0,x.useContext)(IA),i=(0,x.useRef)(e);(0,x.useEffect)(()=>{i.current=e}),(0,x.useEffect)(()=>{if(t)return t.subscribe(l=>{i.current(l)})},[t])}r(MG,"useCompanyLiveEvent");function be(e){return typeof e=="string"&&e.length>0?e:null}r(be,"readString");function Xr(e){return typeof e!="object"||e===null||Array.isArray(e)?null:e}r(Xr,"readRecord");function of(e){return e.slice(0,8)}r(of,"shortId");function TA(e,t,i){const l=e.getQueryData(U.agents.list(t))?.find(c=>c.id===i);return l?.name?l.name:e.getQueryData(U.agents.detail(i))?.name??null}r(TA,"resolveAgentName");function pq(e,t,i){const l=e.getQueryData(U.access.companyUserDirectory(t));if(!l)return null;const c=l.users.find(u=>u.principalId===i);return c?.user?.name?.trim()||c?.user?.email?.trim()||null}r(pq,"resolveUserName");function zr(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}r(zr,"truncate");function hq(e,t,i,l){return i==="agent"&&l?TA(e,t,l)??`Agent ${of(l)}`:i==="system"?"System":i==="user"&&l?pq(e,t,l)??(l==="board"||l==="local-board"?"Board":`User ${of(l)}`):i==="plugin"?"Plugin":"Unknown actor"}r(hq,"resolveActorLabel");function ax(e,t,i,l){const c=new Set([i]),u=e.getQueryData(U.issues.detail(i)),m=e.getQueryData(U.issues.list(t)),f=be(l?.identifier)??be(l?.issueIdentifier);f&&c.add(f),u?.id&&c.add(u.id),u?.identifier&&c.add(u.identifier);const h=m?.find(g=>!!(g.id===i||g.identifier&&g.identifier===i||f&&g.identifier===f));return h?.id&&c.add(h.id),h?.identifier&&c.add(h.identifier),Array.from(c)}r(ax,"resolveIssueQueryRefs");function gq(e,t,i,l){const c=ax(e,t,i,l),u=c.map(v=>e.getQueryData(U.issues.detail(v))).find(v=>!!v),m=e.getQueryData(U.issues.list(t))?.find(v=>c.some(y=>v.id===y||v.identifier===y)),f=u??m??null,h=be(l?.identifier)??be(l?.issueIdentifier)??f?.identifier??`Task ${of(i)}`,g=be(l?.title)??be(l?.issueTitle)??f?.title??null;return{ref:h,title:g,label:g?`${h} - ${zr(g,72)}`:h,href:`/issues/${f?.identifier??i}`}}r(gq,"resolveIssueToastContext");function RA(){return!(typeof document>"u"||document.visibilityState!=="visible"||typeof document.hasFocus=="function"&&!document.hasFocus())}r(RA,"isPageForegrounded");function or(e,t,i){if(!(i?.isForegrounded??RA()))return null;const l=pf(t).split("/").filter(Boolean);if(!["issues","chats"].includes(l[0])||!l[1])return null;let c=decodeURIComponent(l[1]);if(l[0]==="chats"){const j=e.getQueryData(U.auth.session),k=j?.user?.id??j?.session?.userId??null,S=Gk(t),N=e.getQueryData(U.companies.list(k))?.companies.find(D=>D.issuePrefix.toUpperCase()===S?.toUpperCase());if(!N)return null;const _=e.getQueryData(U.agents.list(N.id))?.find(D=>D.id===c||ar(D)===c);if(!_)return null;const I=e.getQueryData(U.agentChats.detail(N.id,k,_.id));if(!I)return null;c=I.id}const u=e.getQueryData(U.issues.detail(c))??null,m=new Set([c]);u?.id&&m.add(u.id),u?.identifier&&m.add(u.identifier);function f(j,k){const S=e.getQueryData(U.issues.activeRun(j)),N=e.getQueryData(U.issues.liveRuns(j))??[],_=e.getQueryData(U.issues.runs(j))??[];S?.id&&k.add(S.id);for(const I of N)I.id&&k.add(I.id);for(const I of _)I.runId&&k.add(I.runId)}r(f,"collectCachedIssueRunIds");const h=new Set;for(const j of m)f(j,h);const g=new Set(m),v=new Set,y=new Set(h);if(u?.companyId&&u.id){const j=e.getQueryData(U.issues.listByDescendantRoot(u.companyId,u.id))??[];for(const k of j)g.add(k.id),k.identifier&&g.add(k.identifier),k.assigneeAgentId&&v.add(k.assigneeAgentId),k.executionRunId&&y.add(k.executionRunId),f(k.id,y),k.identifier&&f(k.identifier,y)}if(u?.companyId){const j=e.getQueryData(U.liveRuns(u.companyId))??[];for(const k of j)k.issueId&&g.has(k.issueId)&&y.add(k.id)}return{routeIssueRef:c,issueRefs:m,assigneeAgentId:u?.assigneeAgentId??null,runIds:h,subtreeIssueRefs:g,subtreeAgentIds:v,subtreeRunIds:y}}r(or,"resolveVisibleIssueRouteContext");function Uf(e,t){const i=new Set([e]),l=be(t?.identifier)??be(t?.issueIdentifier);return l&&i.add(l),i}r(Uf,"buildIssueRefsForPayload");function $f(e,t){for(const i of e)if(t.has(i))return!0;return!1}r($f,"overlaps");function xq(e,t,i,l){const c=be(i.entityType),u=be(i.entityId);if(c!=="issue"||!u)return!1;const m=or(e,t,l);return m?$f(m.subtreeIssueRefs,Uf(u,Xr(i.details))):!1}r(xq,"shouldSuppressActivityToastForVisibleIssue");function bq(e,t,i,l){if(!(l?.isForegrounded??RA()))return!1;const c=pf(t).match(/^\/agents\/[^/]+\/runs\/([^/]+)/)?.[1];if(c&&decodeURIComponent(c)===be(i.runId))return!0;const u=or(e,t,l);if(!u)return!1;const m=be(i.issueId);if(m)return u.subtreeIssueRefs.has(m);const f=be(i.runId);if(f)return u.subtreeRunIds.has(f);const h=be(i.agentId);return!!h&&(h===u.assigneeAgentId||u.subtreeAgentIds.has(h))}r(bq,"shouldSuppressRunStatusToastForVisibleIssue");function dk(e,t,i,l){const c=or(e,t,l);if(!c)return!1;const u=be(i.runId),m=be(i.agentId);if(!(u!==null&&c.runIds.has(u)||m&&c.assigneeAgentId&&m===c.assigneeAgentId))return!1;const f=be(i.status);if(u&&f&&Ec.has(f))for(const v of c.issueRefs)e.invalidateQueries({queryKey:U.issues.comments(v)}),e.setQueryData(U.issues.liveRuns(v),y=>eK(y,u)),e.setQueryData(U.issues.activeRun(v),y=>y?.id===u?null:y),e.setQueryData(U.issues.detail(v),y=>tK(y,u));const h=!!f&&Ec.has(f),g=!h&&(l?.liveStatusAlreadyPatched??!1);for(const v of c.issueRefs)e.invalidateQueries({queryKey:U.issues.detail(v)}),e.invalidateQueries({queryKey:U.issues.activity(v)}),e.invalidateQueries({queryKey:U.issues.runs(v)}),l?.runLifecycleEvent&&e.invalidateQueries({queryKey:U.issues.queuedComments(v)}),g||(e.invalidateQueries({queryKey:U.issues.liveRuns(v)}),e.invalidateQueries({queryKey:U.issues.activeRun(v)})),h&&(e.invalidateQueries({queryKey:U.issues.comments(v)}),e.invalidateQueries({queryKey:U.issues.attachments(v)}),e.invalidateQueries({queryKey:U.issues.workProducts(v)}),e.invalidateQueries({queryKey:U.issues.workProductPullRequestRefresh(v)}),e.invalidateQueries({queryKey:["issues","tree-control-state",v]}));return!0}r(dk,"invalidateVisibleIssueRunQueries");function nc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(nc,"hasPatchKey");function DA(e,t){return e.id!==t.runId?e:{...e,...nc(t,"message")?{currentStatusMessage:t.message}:{},...nc(t,"updatedAt")?{currentStatusUpdatedAt:t.updatedAt}:{},...nc(t,"currentToolName")?{currentToolName:t.currentToolName}:{},...nc(t,"lastAssistantSnippet")?{lastAssistantSnippet:t.lastAssistantSnippet}:{},...nc(t,"lastEventAt")?{lastEventAt:t.lastEventAt}:{}}}r(DA,"applyRunLiveStatusPatch");function fk(e,t){if(!e)return e;let i=!1;const l=e.map(c=>c.id!==t.runId?c:(i=!0,DA(c,t)));return i?l:e}r(fk,"applyRunLiveStatusPatchToArray");function vq(e,t,i){const l=be(e.runId);if(!l)return null;const c={runId:l,agentId:be(e.agentId),issueId:be(e.issueId)};if(i==="heartbeat.run.progress")return c.message=be(e.message),c.updatedAt=be(e.updatedAt)??t,c.currentToolName=be(e.currentToolName),c.lastAssistantSnippet=be(e.lastAssistantSnippet),c.lastEventAt=be(e.lastEventAt)??c.updatedAt,c;if(i==="heartbeat.run.log")return c.lastEventAt=be(e.ts)??t,c;if(i==="heartbeat.run.event"){const u=be(e.message);u&&(c.message=u),c.updatedAt=be(e.updatedAt)??t;const m=be(e.currentToolName);m&&(c.currentToolName=m);const f=be(e.lastAssistantSnippet);return f&&(c.lastAssistantSnippet=f),c.lastEventAt=be(e.lastEventAt)??t,c}return null}r(vq,"readRunLiveStatusPatchFromPayload");var yq=1e3;function jq(e=yq){const t=new Map,i=new Map,l=r(c=>{const u=t.get(c);if(!u){i.delete(c);return}t.delete(c),i.set(c,setTimeout(()=>l(c),e)),u.apply(u.patch)},"release");return{submit:r((c,u)=>{if(i.has(c.runId)){t.set(c.runId,{patch:c,apply:u});return}i.set(c.runId,setTimeout(()=>l(c.runId),e)),u(c)},"submit"),dispose:r(()=>{for(const c of i.values())clearTimeout(c);i.clear(),t.clear()},"dispose")}}r(jq,"createRunLogPatchThrottle");function wq(e,t,i,l,c){let u=!1;e.setQueryData(U.liveRuns(t),h=>{const g=fk(h,l);return g!==h&&(u=!0),g});const m=new Set;if(l.issueId)for(const h of ax(e,t,l.issueId,null))m.add(h);const f=or(e,i,c);if(f&&(f.runIds.has(l.runId)||l.issueId&&f.issueRefs.has(l.issueId)||l.agentId&&f.assigneeAgentId&&l.agentId===f.assigneeAgentId))for(const h of f.issueRefs)m.add(h);for(const h of m)e.setQueryData(U.issues.activeRun(h),g=>!g||g.id!==l.runId?g:(u=!0,DA(g,l))),e.setQueryData(U.issues.liveRuns(h),g=>{const v=fk(g,l);return v!==g&&(u=!0),v});return u}r(wq,"applyRunLiveStatusPatchToCaches");function kq(e,t,i,l){const c=or(e,t,l);if(!c)return!1;const u=be(i.agentId);return!!u&&(u===c.assigneeAgentId||c.subtreeAgentIds.has(u))}r(kq,"shouldSuppressAgentStatusToastForVisibleIssue");function Sq(e,t,i,l){const c=be(i.entityType),u=be(i.entityId),m=be(i.actorType),f=be(i.action),h=Xr(i.details);if(c!=="issue"||!u||m!=="agent"&&m!=="system"||f!=="issue.updated"||be(h?.source)==="comment")return!1;const g=or(e,t,l);return g?$f(g.issueRefs,Uf(u,h)):!1}r(Sq,"shouldDeferIssueRefetchForVisibleAgentActivity");function MA(e,t,i,l){const c=be(i.entityType),u=be(i.entityId),m=be(i.action),f=Xr(i.details);if(c!=="issue"||!u||m!=="issue.comment_added")return!1;const h=or(e,t,l);return h?$f(h.issueRefs,Uf(u,f)):!1}r(MA,"shouldDeferVisibleIssueCommentActivity");async function Nq(e,t,i,l){const c=be(i.entityType),u=be(i.action),m=Xr(i.details),f=be(m?.commentId);if(c!=="issue"||u!=="issue.comment_added"||!f)return!1;const h=or(e,t,l);if(!h)return!1;const g=be(i.entityId);if(!g||!$f(h.issueRefs,Uf(g,m)))return!1;try{const v=await hn.getComment(h.routeIssueRef,f);for(const y of h.issueRefs)e.setQueryData(U.issues.comments(y),j=>j?{...j,pages:ME(j.pages,v)}:{pages:[[v]],pageParams:[null]});return!0}catch{for(const v of h.issueRefs)e.invalidateQueries({queryKey:U.issues.comments(v)});return!1}}r(Nq,"hydrateVisibleIssueComment");var Cq=new Set(["issue.created","issue.updated","issue.comment_added"]),mk=new Set(["issue.document_created","issue.document_updated","issue.document_restored","issue.document_deleted"]),Aq=new Set(["issue.document_annotation_thread_created","issue.document_annotation_comment_added","issue.document_annotation_thread_resolved","issue.document_annotation_thread_reopened","issue.document_annotation_remapped"]),_q=new Set(["routine.document_annotation_thread_created","routine.document_annotation_comment_added","routine.document_annotation_thread_resolved","routine.document_annotation_thread_reopened","routine.document_annotation_remapped"]),Eq=new Set(["case.document_annotation_thread_created","case.document_annotation_comment_added","case.document_annotation_thread_resolved","case.document_annotation_thread_reopened","case.document_annotation_remapped"]),Iq=new Set(["error"]),Tq=new Set(["failed","timed_out","cancelled"]);function Rq(e){if(!e)return null;const t=[];if(typeof e.status=="string"&&t.push(`status -> ${e.status.replace(/_/g," ")}`),typeof e.priority=="string"&&t.push(`priority -> ${e.priority}`),typeof e.assigneeAgentId=="string"||typeof e.assigneeUserId=="string"?t.push("reassigned"):(e.assigneeAgentId===null||e.assigneeUserId===null)&&t.push("unassigned"),e.reopened===!0){const i=be(e.reopenedFrom);t.push(i?`reopened from ${i.replace(/_/g," ")}`:"reopened")}return typeof e.title=="string"&&t.push("title changed"),typeof e.description=="string"&&t.push("description changed"),t.length>0?t.join(", "):null}r(Rq,"describeIssueUpdate");function Dq(e,t,i,l){const c=be(i.entityType),u=be(i.entityId),m=be(i.action),f=Xr(i.details),h=be(i.actorId),g=be(i.actorType);if(c!=="issue"||!u||!m||!Cq.has(m))return null;const v=gq(e,t,u,f),y=be(be(i.actorName)?.trim())??hq(e,t,g,h),j=g==="agent"&&h?e.getQueryData(U.agents.list(t))?.find(K=>K.id===h)??e.getQueryData(U.agents.detail(h)):void 0,k=g==="user"&&h?e.getQueryData(U.access.companyUserDirectory(t))?.users.find(K=>K.principalId===h)?.user:void 0,S=h&&(g==="user"||g==="agent")?{type:g,id:h,name:y,image:i.actorImage!==void 0?be(i.actorImage):k?.image,appearance:g==="agent"?eE(i.actorAppearance!==void 0?i.actorAppearance:j?.appearance,h):void 0}:void 0;if(g==="user"&&l.userId&&h===l.userId||g==="agent"&&l.agentId&&h===l.agentId)return null;if(m==="issue.created")return{actor:S,title:`${y} created ${v.ref}`,body:v.title?zr(v.title,96):void 0,tone:"success",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${u}`};if(m==="issue.updated"){if(be(f?.source)==="comment")return null;const K=Rq(f),P=K?v.title?`${zr(v.title,64)} - ${K}`:K:v.title?zr(v.title,96):v.label;return{actor:S,title:`${y} updated ${v.ref}`,body:zr(P,100),tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${u}`}}const N=be(f?.commentId),_=be(f?.bodySnippet),I=f?.reopened===!0,D=f?.updated===!0,T=be(f?.reopenedFrom),C=I?T?`reopened from ${T.replace(/_/g," ")}`:"reopened":null,M=I?`${y} reopened and commented on ${v.ref}`:D?`${y} commented and updated ${v.ref}`:`${y} commented on ${v.ref}`,z=_?C?`${C} - ${_.replace(/^#+\s*/m,"").replace(/\n/g," ")}`:_.replace(/^#+\s*/m,"").replace(/\n/g," "):C?v.title?`${C} - ${v.title}`:C:v.title??void 0;return{actor:S,title:M,body:z?zr(z,96):void 0,tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${u}:${N??"na"}`}}r(Dq,"buildActivityToast");function Mq(e){const t=be(e.entityType),i=be(e.action),l=be(e.entityId),c=Xr(e.details);return t!=="join_request"||!i||!l||i!=="join.requested"&&i!=="join.request_replayed"?null:{title:`${be(c?.requestType)==="agent"?"Agent":"Someone"} wants to join`,body:"A new join request is waiting for approval.",tone:"info",action:{label:"View inbox",href:"/inbox/mine"},dedupeKey:`join-request:${l}`}}r(Mq,"buildJoinRequestToast");function Oq(e,t,i,l){const c=be(e.agentId),u=be(e.status);if(!c||!u||!Iq.has(u))return null;const m=u==="error"?"error":"info",f=t(c)??`Agent ${of(c)}`;return{title:u==="running"?`${f} started`:`${f} errored`,body:i.getQueryData(U.agents.list(l))?.find(h=>h.id===c)?.title??void 0,tone:m,action:{label:"View agent",href:`/agents/${c}`},dedupeKey:`agent-status:${c}:${u}`}}r(Oq,"buildAgentStatusToast");function Lq(e,t){const i=be(e.runId),l=be(e.agentId),c=be(e.status);if(!i||!l||!c||!Tq.has(c))return null;const u=be(e.error),m=be(e.errorCode);if(m==="operator_interrupted"||m==="workspace_busy")return null;const f=be(e.contextSource),h=be(e.triggerDetail),g=t(l)??"Agent";if(c==="failed"&&m==="low_trust_isolation_unavailable"&&f?.startsWith("chat:"))return{title:`${g} couldn't start this chat`,body:"This external chat identity isn't linked, and isolated guest workspaces are disabled. Link the identity in Connectors or enable isolated workspaces, then start a new task.",tone:"warn",ttlMs:1e4,action:{label:"Open chat connections",href:"/apps"},dedupeKey:`run-status:${i}:${c}`};const v=c==="succeeded"?"success":c==="cancelled"?"info":"error",y=`${g} run ${c==="succeeded"?"succeeded":c==="failed"?"failed":c==="timed_out"?"timed out":"cancelled"}`;let j;return u?j=zr(u,100):h&&(j=`Trigger: ${h}`),{title:y,body:j,tone:v,ttlMs:c==="succeeded"?5e3:7e3,action:{label:"View run",href:`/agents/${l}/runs/${i}`},dedupeKey:`run-status:${i}:${c}`}}r(Lq,"buildRunStatusToast");function zq(e,t,i){const l=be(i.runId),c=be(i.status);if(!l||!c)return!1;if(e.setQueryData(U.runDetail(l),m=>{if(!m)return m;const f=r(h=>Object.prototype.hasOwnProperty.call(i,h),"has");return{...m,status:c,...f("invocationSource")?{invocationSource:be(i.invocationSource)??m.invocationSource}:{},...f("triggerDetail")?{triggerDetail:be(i.triggerDetail)}:{},...f("error")?{error:be(i.error)}:{},...f("errorCode")?{errorCode:be(i.errorCode)}:{},...f("startedAt")?{startedAt:be(i.startedAt)}:{},...f("finishedAt")?{finishedAt:be(i.finishedAt)}:{}}}),Ec.has(c))return e.setQueryData(U.liveRuns(t),m=>Z8(m,l)),!0;let u=!1;return e.setQueryData(U.liveRuns(t),m=>{const f=J8(m,l,c);return u=f.present,f.next}),u}r(zq,"applyRunLifecycleToCompanyLiveRuns");function Pq(e,t,i){const l=be(i.status);l&&Ec.has(l)&&e.invalidateQueries({queryKey:U.heartbeats(t),refetchType:"none"}),e.invalidateQueries({queryKey:U.agents.list(t)}),e.invalidateQueries({queryKey:U.dashboard(t)}),e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:U.sidebarBadges(t)});const c=be(i.agentId);c&&(e.invalidateQueries({queryKey:U.agents.detail(c)}),e.invalidateQueries({queryKey:U.heartbeats(t,c)}));const u=be(i.runId);u&&e.invalidateQueries({queryKey:U.runDetail(u)})}r(Pq,"invalidateHeartbeatQueries");function Uq(e,t,i){const l=be(i.agentId);l&&e.invalidateQueries({queryKey:U.agents.detail(l)})}r(Uq,"invalidateHeartbeatProgressQueries");var $q=new Set(["approval","attention_source","budget_incident","decision","decision_queue","issue_recovery_action","join_request"]),Bq=["issue.blockers_","issue.dependency_recovery_","issue.disposition_repair_","issue.execution_recovery_","issue.interaction_","issue.recovery_action_","issue.stalled_review_","issue.thread_interaction_"],Kq=new Set(["failed","timed_out"]);function qq(e,t,i){return t?.startsWith("inbox.")||e&&$q.has(e)?!0:e!=="issue"||!t?!1:Bq.some(l=>t.startsWith(l))||t==="issue.reviewers_updated"||t==="issue.status_decision_recorded"?!0:(t==="issue.created"||t==="issue.updated")&&(i?.status!==void 0||i?.blockedByIssueIds!==void 0)}r(qq,"activityChangesAttention");function pk(e,t,i,l){return e.getQueriesData({queryKey:U.attention(t)}).some(([,c])=>c?"items"in c?Array.isArray(c.items)&&c.items.some(i):"count"in c&&l(c):!1)}r(pk,"cachedAttentionIncludes");function Bg(e,t){e.invalidateQueries({queryKey:U.attention(t)})}r(Bg,"invalidateAttentionQueries");function Fq(e,t,i,l,c){e.invalidateQueries({queryKey:U.activity(t)}),e.invalidateQueries({queryKey:U.dashboard(t)}),e.invalidateQueries({queryKey:U.sidebarBadges(t)});const u=be(i.entityType),m=be(i.entityId),f=be(i.action),h=be(i.actorType),g=be(i.actorId),v=Xr(i.details),y=h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId;if(qq(u,f,v)&&Bg(e,t),u==="decision"&&(e.invalidateQueries({queryKey:["decisions",t]}),m&&e.invalidateQueries({queryKey:U.decisions.detail(m)})),(f?.startsWith("ai_connection.")||f?.startsWith("connection_grant."))&&e.invalidateQueries({queryKey:["ai-connections",t]}),(f?.startsWith("primary_agent.")||f?.startsWith("agent.")||f?.startsWith("resource_membership."))&&e.invalidateQueries({queryKey:["primary-agent",t]}),f?.startsWith("resource_membership.")||f?.startsWith("primary_agent.")){const j=be(v?.userId);(!j||j===l.userId)&&e.invalidateQueries({queryKey:U.resourceMemberships.mine(t)})}if(u==="issue"){const j=U.agentChats.list(t,l.userId);if((m&&e.getQueryData(j)?.some(k=>k.id===m)||f==="issue.conversation_opened"&&y)&&e.invalidateQueries({queryKey:j}),(f==="issue.tree_hold_created"||f==="issue.tree_hold_released"||f==="issue.updated")&&e.invalidateQueries({queryKey:["issues","tree-control-state"]}),m&&uK(e,t,m,lK(f,v,c?.occurredAt??null)),dK(e,t),vI(e,t,i),m){const k=(f==="issue.comment_added"||f==="issue.updated"&&be(v?.source)==="comment")&&(h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId),S=!!c?.pathname&&Sq(e,c.pathname,i,{isForegrounded:c.isForegrounded}),N=!!c?.pathname&&MA(e,c.pathname,i,{isForegrounded:c.isForegrounded}),_=ax(e,t,m,v);for(const I of _){const D=k||S||N?{refetchType:"inactive"}:void 0;if(e.invalidateQueries({queryKey:U.issues.detail(I),...D}),e.invalidateQueries({queryKey:U.issues.activity(I),...D}),(f==="issue.comment_added"||f==="issue.conversation_session_started")&&e.invalidateQueries({queryKey:U.issues.comments(I),...D}),(f==="issue.comment_added"||f?.startsWith("issue.queued_comment"))&&e.invalidateQueries({queryKey:U.issues.queuedComments(I)}),(f?.startsWith("issue.attachment_")||f?.startsWith("issue.work_product_"))&&(e.invalidateQueries({queryKey:U.issues.attachments(I)}),e.invalidateQueries({queryKey:U.issues.workProducts(I)})),f==="issue.conversation_session_started"&&(e.invalidateQueries({queryKey:["issues","tree-control-state",I]}),e.invalidateQueries({queryKey:U.issues.interactions(I)})),f&&mk.has(f)){const T=be(v?.key);e.invalidateQueries({queryKey:U.issues.documents(I),...D}),T?(e.invalidateQueries({queryKey:U.issues.document(I,T),...D}),e.invalidateQueries({queryKey:U.issues.documentRevisions(I,T),...D})):(e.invalidateQueries({queryKey:["issues","document",I],...D}),e.invalidateQueries({queryKey:["issues","document-revisions",I],...D}))}if(f&&(mk.has(f)||Aq.has(f))){const T=be(v?.key)??be(v?.documentKey);e.invalidateQueries({queryKey:T?["issues","document-annotations",I,T]:["issues","document-annotations",I],...D})}(f?.startsWith("issue.thread_interaction_")||(f==="issue.updated"||f==="issue.status_decision_recorded")&&be(v?.source)==="native_status_decision")&&(e.invalidateQueries({queryKey:U.issues.interactions(I)}),e.invalidateQueries({queryKey:U.tools.actionRequests(t,"pending")}),e.invalidateQueries({queryKey:U.apps.attention(t)}),e.invalidateQueries({queryKey:U.tools.trustRules(t)}))}}return}if(u==="agent"){e.invalidateQueries({queryKey:U.agents.list(t)}),e.invalidateQueries({queryKey:U.org(t)}),m&&(e.invalidateQueries({queryKey:U.agents.detail(m)}),e.invalidateQueries({queryKey:U.heartbeats(t,m)}));return}if(u==="project"){const j=be(i.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:U.issues.activity(j)}),e.invalidateQueries({queryKey:U.projects.all(t)}),m&&e.invalidateQueries({queryKey:U.projects.detail(m)});return}if(u==="company_skill"){const j=be(i.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:U.issues.activity(j)}),m&&e.invalidateQueries({queryKey:U.companySkills.detail(t,m)}),e.invalidateQueries({queryKey:U.companySkills.list(t)});return}if(u==="goal"){e.invalidateQueries({queryKey:U.goals.list(t)}),m&&e.invalidateQueries({queryKey:U.goals.detail(m)});return}if(u==="approval"){e.invalidateQueries({queryKey:U.approvals.list(t)});return}if(u==="join_request"){e.invalidateQueries({queryKey:U.access.joinRequests(t)});return}if(u==="cost_event"){e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:["usage-by-provider",t]}),e.invalidateQueries({queryKey:["usage-by-biller",t]}),e.invalidateQueries({queryKey:U.usageWindowSpend(t)});return}if(u==="routine"||u==="routine_trigger"||u==="routine_run"){if(e.invalidateQueries({queryKey:["routines"]}),u==="routine"&&f&&_q.has(f)&&m){const j=be(v?.key)??be(v?.documentKey)??"description",k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:["routines","document-annotations",m,j],...k})}return}if(u==="case"){if(e.invalidateQueries({queryKey:U.cases.list(t)}),m&&(e.invalidateQueries({queryKey:U.cases.detail(m)}),e.invalidateQueries({queryKey:U.cases.events(m)}),f&&Eq.has(f))){const j=be(v?.key)??be(v?.documentKey),k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:j?["cases","document-annotations",m,j]:["cases","document-annotations",m],...k})}return}if(u==="summary_slot"){const j=be(v?.scopeKind),k=be(v?.slotKey),S=be(v?.scopeId);j&&k&&(e.invalidateQueries({queryKey:U.summarySlots.detail(t,j,k,S)}),e.invalidateQueries({queryKey:U.summarySlots.revisions(t,j,k,S)}));return}u==="company"&&e.invalidateQueries({queryKey:U.companies.all})}r(Fq,"invalidateActivityQueries");function Hq(e,t){const i=t.payload??{},l=be(i.runId),c=be(i.status);if(!l||!c||!Ec.has(c))return!1;const u=`${t.companyId}:${l}:${c}`,m=e.observedRunOutcomes.has(u);e.observedRunOutcomes.delete(u),e.observedRunOutcomes.add(u),e.observedRunOutcomes.size>cq&&e.observedRunOutcomes.delete(e.observedRunOutcomes.values().next().value);const f=Date.parse(be(i.finishedAt)??""),h=Date.parse(t.createdAt);return m||h-f>oq}r(Hq,"observeRunOutcome");function Vq(e,t){const i=Date.now();if(i<e.suppressUntil)return!0;const l=e.cooldownHits.get(t);if(!l)return!1;const c=l.filter(u=>i-u<iq);return e.cooldownHits.set(t,c),c.length>=rq}r(Vq,"shouldSuppressToast");function Wq(e,t){const i=Date.now(),l=e.cooldownHits.get(t)??[];l.push(i),e.cooldownHits.set(t,l)}r(Wq,"recordToastHit");function Ih(e,t,i,l){Vq(e,i)||t(l)!==null&&Wq(e,i)}r(Ih,"gatedPushToast");function Qq(e,t,i,l,c,u,m,f){if(l.companyId!==t)return;const h=r(k=>TA(e,t,k),"nameOf"),g=l.payload??{},v=l.type==="heartbeat.run.status"&&(Hq(u,l)||bq(e,i,g)),y=vq(g,l.createdAt,l.type);let j=!1;if(y){const k=r(S=>{j=wq(e,t,i,S)},"applyPatch");l.type==="heartbeat.run.log"&&f?f.submit(y,k):k(y)}if(l.type!=="heartbeat.run.log"){if(l.type==="heartbeat.run.queued"||l.type==="heartbeat.run.status"){const k=zq(e,t,g);if(Pq(e,t,g),tk(e,l),k||e.invalidateQueries({queryKey:U.liveRuns(t)}),dk(e,i,g,{runLifecycleEvent:!0}),(l.type==="heartbeat.run.status"&&Kq.has(be(g.status)??"")||l.type==="heartbeat.run.queued"&&pk(e,t,S=>S.sourceKind==="failed_run",S=>(S.countsBySourceKind?.failed_run??0)>0))&&Bg(e,t),l.type==="heartbeat.run.status"){const S=Lq(g,h);S&&!v&&Ih(u,c,"run-status",S)}return}if(l.type==="heartbeat.run.progress"){Uq(e,t,g),dk(e,i,g,{liveStatusAlreadyPatched:j});return}if(l.type==="heartbeat.run.event"){tk(e,l);return}if(l.type==="agent.status"){e.invalidateQueries({queryKey:U.agents.list(t)}),e.invalidateQueries({queryKey:U.dashboard(t)}),e.invalidateQueries({queryKey:U.org(t)});const k=be(g.agentId);k&&e.invalidateQueries({queryKey:U.agents.detail(k)}),(be(g.status)==="error"||k&&pk(e,t,N=>N.sourceKind==="agent_error_alert"&&N.subject?.id===k,N=>N.errorAgentIds?.includes(k)===!0))&&Bg(e,t);const S=Oq(g,h,e,t);S&&!kq(e,i,g)&&Ih(u,c,"agent-status",S);return}if(l.type==="activity.logged"){Fq(e,t,g,m,{pathname:i,occurredAt:l.createdAt??null}),MA(e,i,g)&&Nq(e,i,g);const k=be(g.action),S=Dq(e,t,g,m)??Mq(g);S&&!xq(e,i,g)&&Ih(u,c,`activity:${k??"unknown"}`,S)}}}r(Qq,"handleLiveEvent");function Gq(e,t){return e&&e===t?e:null}r(Gq,"resolveLiveCompanyId");function hk(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null}r(hk,"resetSocketHandlers");function gk(e,t){if(e){if(e.readyState===dq){e.onopen=()=>{hk(e),e.close(1e3,t)},e.onmessage=null,e.onerror=()=>{},e.onclose=null;return}hk(e),e.readyState===fq&&e.close(1e3,t)}}r(gk,"closeSocketQuietly");function Yq(e,t,i){return e==="success"&&(t||i==="local_trusted")}r(Yq,"canUseLiveSession");function Xq({children:e}){const{visible:t}=$k(),i=(0,x.useRef)(!t),{selectedCompanyId:l,selectedCompany:c}=vt(),u=wn(),{pushToast:m}=Ni(),f=vn(),h=(0,x.useRef)({cooldownHits:new Map,suppressUntil:0,observedRunOutcomes:new Set}),g=(0,x.useRef)(f.pathname),{data:v,status:y}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),{data:j}=ge({queryKey:U.health,queryFn:Rc.get}),k=v?.user?.id??v?.session?.userId??(j?.deploymentMode==="local_trusted"?"local-board":null),S=v?.session?.id??k??"signed_out",N=Gq(l,c?.id??null),_=Yq(y,v!=null,j?.deploymentMode)&&N!==null,I=(0,x.useRef)({userId:k,agentId:null}),D=(0,x.useRef)(new Set),T=(0,x.useCallback)(P=>(D.current.add(P),()=>{D.current.delete(P)}),[]),C=(0,x.useMemo)(()=>({subscribe:T}),[T]),M=(0,x.useMemo)(()=>G8(u),[u]),z=(0,x.useMemo)(()=>X8(u,M),[u,M]),K=(0,x.useMemo)(()=>jq(),[]);return(0,x.useEffect)(()=>()=>{M.dispose(),K.dispose()},[M,K]),(0,x.useEffect)(()=>{g.current=f.pathname},[f.pathname]),(0,x.useEffect)(()=>{I.current={userId:k,agentId:null}},[k]),(0,x.useEffect)(()=>{if(!t||!_||!N)return;const P=window.setInterval(()=>{fK(u,N)},nK);return()=>window.clearInterval(P)},[_,N,u,t]),(0,x.useEffect)(()=>{if(!t){i.current=!0,M.dispose(),K.dispose();return}if(!_||!N)return;i.current&&(i.current=!1,u.invalidateQueries({type:"active"},{cancelRefetch:!1}));let P=!1,A=0,B=null,O=null,W=null;const Y=r(()=>{B!==null&&(window.clearTimeout(B),B=null)},"clearReconnect"),ce=r(()=>{O!==null&&(window.clearInterval(O),O=null)},"stopPolling"),oe=r(()=>{P||O!==null||(O=window.setInterval(()=>{u.invalidateQueries({type:"active"},{cancelRefetch:!1})},uq))},"startPolling"),$=r(()=>{if(P||B!==null)return;A+=1;const ue=Math.min(15e3,1e3*2**Math.min(A-1,4));B=window.setTimeout(()=>{B=null,R()},ue)},"scheduleReconnect"),R=r(()=>{if(P)return;const ue=xK(`/api/companies/${encodeURIComponent(N)}/events/ws`),ae=bK(ue);if(!ae){oe(),$();return}W=ae,ae.onopen=()=>{if(P||W!==ae){gk(ae,"stale_connection");return}ce(),A>0&&(h.current.suppressUntil=Date.now()+lq),u.invalidateQueries({type:"active"},{cancelRefetch:!1}),A=0},ae.onmessage=Ee=>{if(!ff().visible)return;const fe=typeof Ee.data=="string"?Ee.data:"";if(fe)try{const Ae=JSON.parse(fe);if(Qq(z,N,g.current,Ae,m,h.current,{userId:I.current.userId,agentId:I.current.agentId},K),mq(D.current,N,Ae),Ae.type==="notification.created"){const Ce=sq(Ae.payload);Ce&&tq(Ce,I.current.userId)}}catch{}},ae.onerror=()=>{},ae.onclose=()=>{W===ae&&(W=null,!P&&(oe(),$()))}},"connect"),ne=window.setTimeout(R,0);return()=>{P=!0,window.clearTimeout(ne),Y(),ce();const ue=W;W=null,gk(ue,"provider_unmount")}},[t,M,K,u,z,N,m,_,S]),(0,s.jsx)(IA.Provider,{value:C,children:e})}r(Xq,"LiveUpdatesProvider");function Zq(e){let t=Vr();ik(t),$g(t,e.userId);const i=SA(()=>{const u=Vr();u!==t&&(t=u,ik(u),$g(u,e.userId))}),l=typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:null,c=r(u=>{const m=aq(u.data);m&&(m.type==="navigate"?e.navigate(m.url):nq(m.notification))},"onMessage");return l?.addEventListener("message",c),l?.startMessages(),()=>{i(),l?.removeEventListener("message",c)}}r(Zq,"startNotificationRuntime");function Jq(){const e=bs(),t=(0,x.useRef)(e),{data:i}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),l=i?.user?.id??i?.session?.userId??null;return(0,x.useEffect)(()=>{t.current=e},[e]),(0,x.useEffect)(()=>{if(l)return Zq({userId:l,navigate:r(c=>t.current(c),"navigate")})},[l]),null}r(Jq,"NotificationRuntime");var e7=36e5,t7=3e3,n7=2e3,xk="wardmote.skip-waiting",s7="wardmote.build-id",OA=null,Kg=new Set;function a7(e){OA=e;for(const t of Kg)t()}r(a7,"publishUpdate");function i7(e){return Kg.add(e),()=>{Kg.delete(e)}}r(i7,"subscribe");function r7(){return(0,x.useSyncExternalStore)(i7,()=>OA,()=>null)}r(r7,"useServiceWorkerUpdate");function l7(e){return new Promise(t=>{const i=new MessageChannel,l=r(u=>{clearTimeout(c),i.port1.close(),t(u)},"finish"),c=setTimeout(()=>l(null),n7);i.port1.onmessage=u=>{l(typeof u.data?.buildId=="string"?u.data.buildId:null)},e.postMessage({type:s7},[i.port2])})}r(l7,"requestWorkerBuildId");function o7(e={}){const t=e.container??(typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:void 0);if(!t)return()=>{};const i=e.documentRef??document,l=e.reload??(()=>window.location.reload()),c=e.updateIntervalMs??e7,u=e.onUpdateReady??a7;let m=!!t.controller,f=!1,h=!1,g,v=!1;const y=r(async C=>e.pageBuildId?await l7(C)!==e.pageBuildId:!0,"servesNewerBuild"),j=r(()=>{h||(h=!0,g!==void 0&&clearTimeout(g),l())},"reloadOnce"),k=r(async C=>{const M=await y(C);if(!v){if(!M){C.postMessage({type:xk});return}u(()=>{f=!0,C.postMessage({type:xk}),g=setTimeout(j,t7)})}},"offerWaiting"),S=r(()=>{if(!m){m=!0;return}if(f){j();return}const C=t.controller;C&&y(C).then(M=>{M&&!v&&!f&&u(j)})},"onControllerChange");t.addEventListener("controllerchange",S);let N;const _=r(()=>{const C=N?.installing;C&&C.addEventListener("statechange",()=>{C.state==="installed"&&t.controller&&k(C)})},"watchInstalling"),I=r(()=>{N?.update().catch(()=>{})},"checkForUpdates"),D=r(()=>{i.visibilityState==="visible"&&I()},"onVisibilityChange");i.addEventListener("visibilitychange",D);const T=setInterval(I,c);return t.register("/sw.js").then(C=>{N=C,C.waiting&&t.controller&&k(C.waiting),C.addEventListener("updatefound",_)}).catch(()=>{}),()=>{v=!0,t.removeEventListener("controllerchange",S),i.removeEventListener("visibilitychange",D),N?.removeEventListener("updatefound",_),clearInterval(T),g!==void 0&&clearTimeout(g)}}r(o7,"startServiceWorkerUpdates");var LA="wardmote.notifications.asked-after-decision";function c7(){try{return window.localStorage.getItem(LA)==="1"}catch{return!0}}r(c7,"alreadyAsked");function u7(){try{window.localStorage.setItem(LA,"1")}catch{return}}r(u7,"markAsked");async function d7(e){const t=await jK();if(t!=="granted")return t;const i=kA(l=>({...l,enabled:!0,pushEnabled:!0}));return e&&await $g(i,e),t}r(d7,"enableNotificationsAfterDecision");function f7(){const{pushToast:e}=Ni(),{data:t}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),i=t?.user?.id??t?.session?.userId??null;(0,x.useEffect)(()=>lE(()=>{c7()||!tx()||nx()!=="default"||(u7(),e({id:"wardmote-notify-after-decision",title:"Get notified when an agent needs a decision",body:"Turn on notifications for this device. You can change it later in Settings.",tone:"info",persistent:!0,action:{label:"Turn on",onClick:r(()=>{d7(i)},"onClick")}}))}),[e,i])}r(f7,"useFirstDecisionNotificationPrompt");var m7="wardmote-update-ready";function p7(){const{pushToast:e}=Ni(),t=r7(),i=wn(),l=e0(),c=(0,x.useRef)(l);return(0,x.useEffect)(()=>{t&&e({id:m7,title:"A new version is ready.",tone:"info",persistent:!0,action:{label:"Reload",onClick:t}})},[t,e]),(0,x.useEffect)(()=>{if(l){c.current=!0;return}c.current&&(c.current=!1,i.invalidateQueries())},[l,i]),f7(),null}r(p7,"PwaRuntime");var zA={get:r(e=>we.get(`/companies/${e}/primary-agent/me`),"get"),set:r((e,t)=>we.put(`/companies/${e}/primary-agent/me`,t),"set")};function h7(e){const t=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),i=t.data?.user?.id??t.data?.session?.userId??"local-board",l=ge({queryKey:U.primaryAgent.mine(e??"__none__",i),queryFn:r(()=>zA.get(e),"queryFn"),enabled:!!e&&t.isSuccess});return{...l,userId:i,loading:!!e&&(t.isPending||l.isPending&&!t.error),error:t.error??l.error,retry:r(()=>t.isError?t.refetch():l.refetch(),"retry")}}r(h7,"usePrimaryAgent");function g7({children:e}){const{selectedCompanyId:t}=vt(),i=h7(t),l=wn(),{pushToast:c}=Ni(),u=(0,x.useRef)({companyId:t,userId:i.userId});u.current={companyId:t,userId:i.userId};const m=r(j=>U.primaryAgent.mine(j.companyId,j.userId),"keyFor"),f=r(j=>j.companyId===u.current.companyId&&j.userId===u.current.userId,"isCurrentScope"),h=ge({queryKey:U.agents.list(t),queryFn:r(()=>$s.list(t),"queryFn"),enabled:!!t}),g=Kt({mutationFn:r(j=>zA.set(j.companyId,{primaryAgentId:j.agentId}),"mutationFn"),onMutate:r(async j=>{const k=m(j);await l.cancelQueries({queryKey:k});const S=l.getQueryData(k);return l.setQueryData(k,{companyId:j.companyId,userId:j.userId,primaryAgentId:j.agentId,initialized:!0}),{previous:S}},"onMutate"),onError:r((j,k,S)=>{l.setQueryData(m(k),S?.previous),f(k)&&c({title:"Couldn't change your primary agent.",body:j.message,tone:"error",action:{label:"Retry",onClick:r(()=>{f(k)&&g.mutate(k)},"onClick")}})},"onError"),onSuccess:r((j,k)=>l.setQueryData(m(k),j),"onSuccess"),onSettled:r((j,k,S)=>{l.invalidateQueries({queryKey:m(S)}),l.invalidateQueries({queryKey:U.resourceMemberships.mine(S.companyId)})},"onSettled")}),v=h.data?.find(j=>j.id===i.data?.primaryAgentId&&j.status!=="terminated")??null,y=i.error??h.error;return(0,s.jsx)(MM,{value:t?{companyId:t,primaryAgentId:v?.id??null,primaryAgent:v,loading:i.loading||h.isPending,error:y?.message,onRetry:r(()=>{i.retry(),h.refetch()},"onRetry"),pendingAgentId:g.isPending&&f(g.variables)?g.variables.agentId:null,onChange:r(j=>g.mutate({companyId:t,userId:i.userId,agentId:j}),"onChange")}:null,children:e})}r(g7,"PrimaryAgentProvider");var bk="min-h-9",x7={default:void 0,warning:"bg-amber-500/5 text-amber-700 dark:text-amber-300",error:"bg-bad/5 text-bad",muted:"opacity-50"};function OG(e,t){const i={name:"",path:"",kind:"dir",children:[]};for(const c of Object.keys(e)){const u=c.split("/").filter(Boolean);let m=i,f="";for(let h=0;h<u.length;h++){const g=u[h];f=f?`${f}/${g}`:g;const v=h===u.length-1;let y=m.children.find(j=>j.name===g);y||(y={name:g,path:f,kind:v?"file":"dir",children:[],action:v?t?.get(c)??null:null},m.children.push(y)),m=y}}function l(c){c.children.sort((u,m)=>u.kind!==m.kind?u.kind==="file"?-1:1:u.name.localeCompare(m.name)),c.children.forEach(l)}return r(l,"sortNode"),l(i),i.children}r(OG,"buildFileTree");function b7(e){let t=0;for(const i of e)i.kind==="file"?t++:t+=b7(i.children);return t}r(b7,"countFiles");function PA(e,t="all"){const i=new Set;for(const l of e){(t==="all"||l.kind===t)&&i.add(l.path);for(const c of PA(l.children,t))i.add(c)}return i}r(PA,"collectAllPaths");function v7(e){return e.endsWith(".yaml")||e.endsWith(".yml")?vS:yS}r(v7,"fileIcon");function UA(e,t,i=0){const l=[];for(const c of e)l.push({node:c,depth:i}),c.kind==="dir"&&t.has(c.path)&&l.push(...UA(c.children,t,i+1));return l}r(UA,"flattenVisibleNodes");function y7(e,t){if(e.kind==="file")return{allChecked:t.has(e.path),someChecked:!1};const i=[...PA(e.children,"file")],l=i.length>0&&i.every(c=>t.has(c));return{allChecked:l,someChecked:i.some(c=>t.has(c))&&!l}}r(y7,"checkboxState");function LG(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return null;const i={},l=t[1],c=t[2];let u=null,m=null;for(const f of l.split(`
58
+ `):[]),[M]),K=(0,x.useMemo)(()=>y&&!y.error&&!y.truncated?new Set(y.models.map(O=>O.id)):null,[y]),P=(0,x.useCallback)(O=>{f(W=>{const Y=W.models.filter($=>$.id.trim()),ce=new Set(Y.map($=>$.id.trim())),oe=O.filter($=>!ce.has($.id)).map($=>({...Cd,id:$.id,name:$.name??""}));return{...W,models:[...Y,...oe]}})},[]);function A(O){O.preventDefault(),I||D.mutate()}r(A,"submit");const B=[..._&&e.apiKey.kind!=="none"&&e.apiKey.kind!=="missing"?[{mode:"keep",label:"Keep saved"}]:[],{mode:"literal",label:"Key"},{mode:"env",label:"Env variable"},{mode:"command",label:"Command"},{mode:"none",label:"No key"}];return(0,s.jsxs)("form",{onSubmit:A,"aria-label":_?`Edit ${e.name}`:"Add a custom provider",className:"flex flex-col gap-4 rounded-lg border border-line bg-bg-2 px-4 py-4 sm:px-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:_?`Edit ${e.name}`:"Add a custom provider"}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:(0,s.jsx)(is,{"aria-hidden":"true"})})]}),_&&e.otherKeys.length?(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Also kept as written in models.yml: ",e.otherKeys.join(", "),"."]}):null,(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsx)(ec,{label:"Name",hint:I??"Used in model ids, e.g. my-gateway/model",children:(0,s.jsx)(Wn,{value:m.name,onChange:r(O=>k({name:O.target.value}),"onChange"),disabled:_,required:!0,"aria-invalid":!!I,placeholder:"my-gateway",autoComplete:"off"})}),(0,s.jsx)(ec,{label:"Base URL",hint:"Usually ends in /v1",children:(0,s.jsx)(Wn,{value:m.baseUrl,onChange:r(O=>k({baseUrl:O.target.value}),"onChange"),required:!0,type:"url",placeholder:"http://localhost:8000/v1",autoComplete:"off"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"API key"}),(0,s.jsx)(DB,{"aria-label":"Where the key comes from",className:"flex-wrap self-start",children:B.map(({mode:O,label:W})=>(0,s.jsx)(MB,{selected:m.keyMode===O,onClick:r(()=>k({keyMode:O,keyValue:""}),"onClick"),children:W},O))}),m.keyMode==="literal"?(0,s.jsx)(Wn,{value:m.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),type:"password",autoComplete:"off",required:!0,"aria-label":"API key",placeholder:"sk-..."}):m.keyMode==="env"?(0,s.jsx)(Wn,{value:m.keyValue,onChange:r(O=>k({keyValue:O.target.value.toUpperCase()}),"onChange"),required:!0,"aria-label":"Environment variable name",placeholder:"MY_GATEWAY_KEY",autoComplete:"off"}):m.keyMode==="command"?(0,s.jsx)(Wn,{value:m.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),required:!0,"aria-label":"Command that prints the key",placeholder:"op read op://vault/gateway/key",autoComplete:"off",className:"font-mono"}):null,(0,s.jsx)("span",{className:"text-xs text-ink-3",children:m.keyMode==="keep"?`The saved ${e?.apiKey.kind==="env"?`variable ${e.apiKey.name}`:e?.apiKey.kind==="command"?"command":"key"} stays as it is.`:m.keyMode==="env"?"OMP reads the key from this variable on the machine that runs agents.":m.keyMode==="command"?"OMP runs this command and uses what it prints.":m.keyMode==="none"?"For local servers that need no key.":"Saved in OMP's models.yml. Wardmote never shows it again."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(ec,{label:"Wire format (api)",hint:"Picking the wrong one is the most common mistake. Test connection suggests the right one.",children:(0,s.jsxs)(Zh,{value:m.api,onChange:r(O=>k({api:O.target.value}),"onChange"),className:"w-full",children:[(0,s.jsx)("option",{value:"",children:"Set per model"}),X_.map(O=>(0,s.jsx)("option",{value:O,children:KB[O]??O},O))]})}),(0,s.jsx)(le,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!m.baseUrl.trim()||T.isPending,onClick:r(()=>T.mutate(),"onClick"),children:T.isPending?"Testing...":"Test connection"}),T.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(T.error).join(" ")}):null,g?(0,s.jsxs)(Cs,{tone:g.suggestedApi?"ok":"bad",children:[g.suggestedApi?`${g.suggestedApi} answered${g.usedModel?` for ${g.usedModel}`:""}, so the wire format is set to it.`:g.usedModel?`No wire format answered for ${g.usedModel}. Check the base URL, key and model id.`:"The server listed no models. Add a model id below, then test again.",(0,s.jsx)("ul",{className:"mt-1 flex flex-col gap-0.5 text-xs text-ink-3",children:g.attempts.map(O=>(0,s.jsxs)("li",{className:"break-all",children:[O.api,": ",O.status??"no answer",O.detail&&!O.ok?` (${O.detail})`:""]},O.api))})]}):null]}),(0,s.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,s.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Models"}),m.models.map((O,W)=>(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 rounded-md border border-line-soft p-2 sm:grid-cols-[2fr_2fr_1fr_1fr_auto]",children:[K&&O.id.trim()&&!K.has(O.id.trim())?(0,s.jsx)("span",{className:"col-span-2 text-xs text-ink-3 sm:col-span-5",children:"Not listed upstream any more; kept until you remove it."}):null,(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} id`,value:O.id,onChange:r(Y=>S(W,{id:Y.target.value}),"onChange"),placeholder:"model id",className:"col-span-2 sm:col-span-1",autoComplete:"off"}),(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} name`,value:O.name,onChange:r(Y=>S(W,{name:Y.target.value}),"onChange"),placeholder:"Display name",className:"col-span-2 sm:col-span-1"}),(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} context window`,value:O.contextWindow,onChange:r(Y=>S(W,{contextWindow:Y.target.value}),"onChange"),placeholder:"Context",inputMode:"numeric"}),(0,s.jsx)(Wn,{"aria-label":`Model ${W+1} max output tokens`,value:O.maxTokens,onChange:r(Y=>S(W,{maxTokens:Y.target.value}),"onChange"),placeholder:"Max output",inputMode:"numeric"}),(0,s.jsxs)("div",{className:"col-span-2 flex items-center justify-between gap-3 text-xs sm:col-span-1",children:[(0,s.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:O.reasoning,onChange:r(Y=>S(W,{reasoning:Y.target.checked}),"onChange")}),"Thinks"]}),(0,s.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:O.images,onChange:r(Y=>S(W,{images:Y.target.checked}),"onChange")}),"Images"]}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove model ${W+1}`,onClick:r(()=>k({models:m.models.filter((Y,ce)=>ce!==W)}),"onClick"),children:(0,s.jsx)(Fh,{"aria-hidden":"true"})})]})]},W)),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>k({models:[...m.models,{...Cd}]}),"onClick"),children:[(0,s.jsx)(Js,{"aria-hidden":"true"}),"Add model"]}),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",disabled:!m.baseUrl.trim()||C.isPending,onClick:r(()=>C.mutate(),"onClick"),children:[(0,s.jsx)(MT,{"aria-hidden":"true"}),C.isPending?"Fetching...":"Fetch models"]})]}),C.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(C.error).join(" ")}):null,y?.error?(0,s.jsx)(Cs,{tone:"bad",children:y.error}):null,y&&!y.error?(0,s.jsx)(BB,{result:y,savedIds:z,room:500-z.size,onAdd:P}):null,(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Leave context and max output empty when unsure; OMP fills known models in."})]}),(0,s.jsxs)("details",{className:"flex flex-col gap-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer select-none text-sm font-medium",children:"Advanced"}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[(0,s.jsx)(vh,{label:"Send the key as an Authorization header",hint:"OpenAI wire formats already do. Turn on for discovery or proxies that need it.",checked:m.authHeader,onChange:r(O=>k({authHeader:O}),"onChange")}),(0,s.jsx)(vh,{label:"Disable strict tools",hint:"For Anthropic-style proxies that reject strict tool schemas.",checked:m.disableStrictTools,onChange:r(O=>k({disableStrictTools:O}),"onChange")}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsx)(ec,{label:"Model discovery",hint:"Ask the server for its models instead of listing them",children:(0,s.jsxs)(Zh,{value:m.discovery,onChange:r(O=>k({discovery:O.target.value}),"onChange"),className:"w-full",children:[(0,s.jsx)("option",{value:"",children:"Off"}),H_.map(O=>(0,s.jsx)("option",{value:O,children:qB[O]??O},O))]})}),m.discovery?(0,s.jsx)(ec,{label:"Discovery timeout (ms)",children:(0,s.jsx)(Wn,{value:m.discoveryTimeout,onChange:r(O=>k({discoveryTimeout:O.target.value}),"onChange"),inputMode:"numeric",placeholder:"OMP default"})}):null]}),m.discovery==="openai-models-list"?(0,s.jsx)(vh,{label:"Add /v1 to the discovery URL",hint:"Turn on when the base URL has no /v1 but the model list lives under it.",checked:m.injectV1,onChange:r(O=>k({injectV1:O}),"onChange")}):null,(0,s.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,s.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Extra headers"}),m.headers.map((O,W)=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2",children:[(0,s.jsx)(Wn,{"aria-label":`Header ${W+1} name`,value:O.name,onChange:r(Y=>N(W,{name:Y.target.value}),"onChange"),placeholder:"X-Header",disabled:O.saved}),(0,s.jsx)(Wn,{"aria-label":`Header ${W+1} value`,value:O.value,onChange:r(Y=>N(W,{value:Y.target.value}),"onChange"),placeholder:O.saved?"Saved; type to replace":"value",type:"password",autoComplete:"off"}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove header ${W+1}`,onClick:r(()=>k({headers:m.headers.filter((Y,ce)=>ce!==W)}),"onClick"),children:(0,s.jsx)(Fh,{"aria-hidden":"true"})})]},W)),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",className:"self-start",onClick:r(()=>k({headers:[...m.headers,{name:"",value:"",saved:!1}]}),"onClick"),children:[(0,s.jsx)(Js,{"aria-hidden":"true"}),"Add header"]})]})]})]}),D.error?(0,s.jsx)(Cs,{tone:"bad",children:(0,s.jsx)("ul",{className:"flex flex-col gap-0.5",children:dc(D.error).map(O=>(0,s.jsx)("li",{children:O},O))})}):null,(0,s.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,s.jsx)(le,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),(0,s.jsx)(le,{type:"submit",disabled:D.isPending||!!I,children:D.isPending?"Checking with OMP...":"Save provider"})]})]})}r(Tw,"CustomProviderForm");function VB(e){switch(e.apiKey.kind){case"env":return e.apiKey.present?`key from ${e.apiKey.name}`:`${e.apiKey.name} is not set on the server`;case"literal":return"key saved";case"command":return"key from a command";case"none":return"no key";case"oauth":return"OMP sign-in";default:return"no key set"}}r(VB,"keySummary");var Ul=":new";function WB(e){return e===Ul?Ul:e.name}r(WB,"providerKey");function QB({onChanged:e}){const t=wn(),i=ge({queryKey:bh,queryFn:r(()=>xs.customProviders(),"queryFn")}),l=PB(WB),c=Kt({mutationFn:r(h=>xs.removeCustomProvider(h),"mutationFn"),onSuccess:r((h,g)=>{t.setQueryData(bh,h),l.openKey===g&&l.close(!1),e?.()},"onSuccess")}),u=i.data?.providers??[],m=u.map(h=>h.name),f=r(h=>{t.setQueryData(bh,h),l.close(),e?.()},"onSaved");return(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[i.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(i.error).join(" ")}):null,i.data?.parseError?(0,s.jsxs)(Cs,{tone:"bad",children:[i.data.parseError,". Fix ",i.data.modelsPath," by hand; Wardmote will not overwrite it."]}):null,u.length?(0,s.jsx)("ul",{"aria-label":"Custom providers",className:"flex flex-col divide-y divide-line rounded-lg border border-line",children:u.map(h=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm",children:[(0,s.jsx)("b",{className:"font-medium",children:h.name}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-ink-3",children:[h.baseUrl,h.api,VB(h),h.discovery?`discovery: ${h.discovery.type}`:`${h.models.length} ${h.models.length===1?"model":"models"}`].filter(Boolean).join(" · ")}),(0,s.jsxs)("span",{className:"flex gap-1",children:[(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Edit ${h.name}`,...l.triggerProps(h.name),onClick:r(()=>l.toggle(h),"onClick"),children:(0,s.jsx)(S0,{"aria-hidden":"true"})}),(0,s.jsx)(le,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${h.name}`,disabled:c.isPending,onClick:r(()=>{window.confirm(`Remove ${h.name} from OMP's models.yml? A backup stays in models.yml.bak.`)&&c.mutate(h.name)},"onClick"),children:(0,s.jsx)(Fh,{"aria-hidden":"true"})})]})]}),l.openKey===h.name?(0,s.jsx)(Ew,{id:l.panelId(h.name),onEscape:l.dismiss,className:"px-2 pb-2 sm:px-3 sm:pb-3",children:(0,s.jsx)(Tw,{provider:h,takenNames:m,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):null]},h.name))}):i.isLoading?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Reading models.yml..."}):null,c.error?(0,s.jsx)(Cs,{tone:"bad",children:dc(c.error).join(" ")}):null,l.openKey===Ul?(0,s.jsx)(Ew,{id:l.panelId(Ul),onEscape:l.dismiss,children:(0,s.jsx)(Tw,{provider:null,takenNames:m,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!!i.data?.parseError,...l.triggerProps(Ul),onClick:r(()=>l.request(Ul),"onClick"),children:[(0,s.jsx)(Js,{"aria-hidden":"true"}),"Add custom provider"]}),i.data?(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Saved to ",i.data.modelsPath,", with the previous copy in models.yml.bak."]}):null]})}r(QB,"CustomProviders");var GB=["Check OMP","Connect a model","First task"],Eg="Atlas",YB="general";var XB="Only an instance admin can set up OMP on this server.";function yh(e){return e?e.status===403?{message:XB,retry:!1}:{message:e.message||"Could not check OMP on this server.",retry:!0}:null}r(yh,"statusFailure");var ZB={anthropic:"Anthropic",openai:"OpenAI","openai-codex":"OpenAI",openrouter:"OpenRouter",google:"Google",deepseek:"DeepSeek"};function JB(e){return e?ZB[e]??e:null}r(JB,"providerLabel");function e6(e){return e.state==="ready"?"ready":e.state==="missing"?e.network==="offline"?"offline":"install":"old"}r(e6,"checkView");function t6(e){return(e?.models.length??0)>0}r(t6,"hasModel");function n6(e){return e.state!=="ready"?null:t6(e)?2:1}r(n6,"nextStepAfterCheck");function s6(e){return!e.connected||e.state!=="ready"?null:e.modelCount>0?2:1}r(s6,"nextStepAfterRemote");function a6(e){return e.copies.slice(1).filter(t=>t.version!==e.version)}r(a6,"olderCopies");function i6(e){const t=e.trim().split(/\r?\n/,1)[0]?.trim()??"";return t.length<=120?t:`${t.slice(0,119).trimEnd()}…`}r(i6,"taskTitle");function Rw(e){const t=e?.replace(/[\\/]+$/,"").split(/[\\/]/).pop()?.trim();return t||"My company"}r(Rw,"companyNameForFolder");function r6(e){return e?.recommendedModel?e.models.find(t=>t.id===e.recommendedModel)?.label??e.recommendedModel:null}r(r6,"recommendedModelLabel");function l6(e){return e?.recommendedModel?JB(e.models.find(t=>t.id===e.recommendedModel)?.provider??e.recommendedModel.split("/",1)[0]):null}r(l6,"signedInProvider");var nf="Wardmote",aA=2e3,cd=["onboarding","omp-status"],o6={ok:(0,s.jsx)(Ta,{className:"size-3.5","aria-hidden":!0}),bad:(0,s.jsx)(is,{className:"size-3.5","aria-hidden":!0}),warn:(0,s.jsx)(Ja,{className:"size-3.5","aria-hidden":!0}),wait:(0,s.jsx)(gI,{className:"size-3.5","aria-hidden":!0}),run:(0,s.jsx)(Yr,{className:"size-3.5 motion-safe:animate-spin","aria-hidden":!0})},c6={ok:"bg-ok-soft text-ok",bad:"bg-bad-soft text-bad",warn:"bg-warn-soft text-warn",wait:"bg-bg-3 text-ink-3",run:"bg-run-soft text-run"};function $l({rows:e,label:t}){return(0,s.jsx)("section",{"aria-label":t,className:"rounded-lg border border-line-soft bg-bg-2 px-4 py-1",children:(0,s.jsx)("ul",{children:e.map(i=>(0,s.jsxs)("li",{"data-check":i.state,className:"flex items-center gap-2.5 border-b border-line-soft py-2 text-(length:--t-13) last:border-b-0",children:[(0,s.jsx)("span",{className:X("grid size-5.5 shrink-0 place-items-center rounded-full",c6[i.state]),children:o6[i.state]}),(0,s.jsx)("span",{className:"min-w-0",children:i.label}),i.value?(0,s.jsx)("span",{className:"ms-auto min-w-0 truncate font-mono text-xs text-ink-3",children:i.value}):null]},i.label))})})}r($l,"Checks");function Ig({command:e}){const[t,i]=(0,x.useState)(!1);return(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,s.jsx)("code",{className:"block w-full whitespace-pre-wrap break-all rounded-md border border-line-soft bg-bg-3 px-3 py-2.5 font-mono text-(length:--t-13)",children:e}),(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>{w0(e).then(()=>i(!0))},"onClick"),children:[t?(0,s.jsx)(Ta,{className:"size-3.5","aria-hidden":!0}):(0,s.jsx)(SI,{className:"size-3.5","aria-hidden":!0}),t?"Copied":"Copy command"]})]})}r(Ig,"CommandBlock");function sf({tone:e,children:t}){return(0,s.jsxs)("div",{role:e==="bad"?"alert":"note",className:X("flex gap-2.5 rounded-md px-3 py-2.5 text-(length:--t-13)",{warn:"bg-warn-soft",info:"bg-run-soft",bad:"bg-bad-soft"}[e]),children:[(0,s.jsx)(Ja,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),(0,s.jsx)("span",{children:t})]})}r(sf,"Note");function u6({step:e}){return(0,s.jsx)("ol",{"aria-label":"Setup steps",className:"flex flex-wrap items-center gap-1.5 text-xs text-ink-2",children:GB.map((t,i)=>(0,s.jsxs)("li",{className:"flex items-center gap-1.5","aria-current":i===e?"step":void 0,children:[i>0?(0,s.jsx)("span",{"aria-hidden":!0,className:"h-px w-5.5 bg-line"}):null,(0,s.jsx)("span",{className:X("grid size-5 place-items-center rounded-full border border-line-strong text-(length:--text-micro) font-semibold",i<e&&"border-ok bg-ok text-bg",i===e&&"border-accent text-accent"),children:i<e?(0,s.jsx)(Ta,{className:"size-3","aria-hidden":!0}):i+1}),(0,s.jsx)("span",{className:X(i===e?"font-semibold text-ink":"max-sm:sr-only"),children:t})]},t))})}r(u6,"Steps");function tr({title:e,lede:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("h1",{id:"onboarding-title",className:"text-(length:--t-24) font-semibold tracking-tight sm:text-(length:--t-32) sm:leading-tight",children:e}),(0,s.jsx)("p",{className:"max-w-130 text-base text-ink-2",children:t})]})}r(tr,"Heading");function iA({title:e,paragraphs:t}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:e}),t.map(i=>(0,s.jsx)("p",{className:"text-sm text-ink-2",children:i},i))]})}r(iA,"SideText");var d6=(0,s.jsx)(iA,{title:"Why OMP",paragraphs:[`${nf} runs every agent on OMP. OMP talks to the model and uses the tools; ${nf} assigns work, keeps the record and holds the settings.`,"You will not need to open OMP's own settings: models, thinking and tools are set here."]});function _c({children:e}){return(0,s.jsx)("div",{className:"mt-auto flex flex-wrap items-center gap-2 pt-2",children:e})}r(_c,"Actions");function Tg(e){if(e instanceof Si){const t=e.body;if(t&&typeof t.error=="string")return t.error}return e instanceof Error?e.message:String(e)}r(Tg,"errorMessage$1");function f6({open:e,onOpenChange:t,onPick:i}){const[l,c]=(0,x.useState)(null),u=ge({queryKey:["onboarding","omp-browse",l],queryFn:r(()=>xs.browse(l),"queryFn"),enabled:e});return(0,s.jsx)(ya,{open:e,onOpenChange:t,children:(0,s.jsxs)(za,{className:"sm:max-w-lg",children:[(0,s.jsxs)(Jl,{children:[(0,s.jsx)(Da,{children:"Choose omp"}),(0,s.jsx)(eo,{className:"truncate font-mono text-xs",children:u.data?.path??"…"})]}),(0,s.jsxs)("ul",{className:"-mx-2 max-h-80 overflow-y-auto",children:[u.data?.parent?(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>c(u.data?.parent??null),"onClick"),children:[(0,s.jsx)(wi,{className:"size-4 text-ink-3","aria-hidden":!0}),".."]})}):null,u.data?.entries.map(m=>(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>{m.kind==="directory"?c(m.path):(i(m.path),t(!1))},"onClick"),children:[m.kind==="directory"?(0,s.jsx)(wi,{className:"size-4 text-ink-3","aria-hidden":!0}):(0,s.jsx)(LT,{className:"size-4 text-accent","aria-hidden":!0}),(0,s.jsx)("span",{className:"truncate",children:m.name})]})},m.path)),u.isError?(0,s.jsx)("li",{className:"px-2 py-2 text-sm text-bad",children:Tg(u.error)}):null]})]})})}r(f6,"OmpFilePicker");function m6({status:e,failure:t,command:i,onChooseCommand:l,onRemote:c,onRetry:u}){const[m,f]=(0,x.useState)(!1),h=r(v=>v.state==="ready"?{state:"ok",label:`Version ${v.version}`,value:`needs ${v.minVersion} or newer`}:{state:"bad",label:v.version?`Version ${v.version}`:"Version unknown",value:`needs ${v.minVersion}`},"versionRow");if(!e)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Install OMP",lede:"Looking for OMP on this computer."}),(0,s.jsx)($l,{label:"OMP checks",rows:[t&&!t.retry?{state:"bad",label:"Looking for omp",value:"stopped"}:{state:"run",label:"Looking for omp",value:"every 2 s"}]}),t?(0,s.jsx)(sf,{tone:"bad",children:t.message}):null]});const g=e6(e);if(g==="old"){const v=a6(e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Update OMP",lede:e.version?`OMP ${e.version} is older than ${e.minVersion}, so some settings set here would be ignored.`:`The version of OMP could not be read. ${nf} needs OMP ${e.minVersion} or newer.`}),(0,s.jsx)(Ig,{command:e.updateCommand}),(0,s.jsx)($l,{label:"OMP checks",rows:[{state:"ok",label:"omp found",value:e.path},h(e)]}),v.length>0?(0,s.jsxs)(sf,{tone:"warn",children:["Two copies of omp are installed. The older one in ",e.path," runs first. Remove it, or update it with the command above."]}):null]})}return g==="offline"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"You are offline",lede:"Installing needs the internet once. Connect, or point to an omp you already copied here."}),(0,s.jsx)($l,{label:"OMP checks",rows:[{state:"bad",label:"omp.sh not reachable",value:"3 tries"},i?h(e):{state:"wait",label:"Version check"}]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("span",{id:"omp-path-label",className:"text-sm font-medium",children:"Path to omp"}),(0,s.jsxs)(le,{type:"button",variant:"secondary","aria-labelledby":"omp-path-label",className:"justify-between font-normal",onClick:r(()=>f(!0),"onClick"),children:[(0,s.jsx)("span",{className:X("truncate",i?"font-mono text-xs":"text-ink-3"),children:i??"Choose file"}),(0,s.jsx)(wi,{className:"size-4","aria-hidden":!0})]})]}),(0,s.jsx)(f6,{open:m,onOpenChange:f,onPick:l}),(0,s.jsx)(_c,{children:(0,s.jsxs)(le,{type:"button",variant:"secondary",onClick:u,children:[(0,s.jsx)(Yr,{className:"size-3.5","aria-hidden":!0}),"Try again"]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Install OMP",lede:"Run this in a terminal on this computer. This page moves on by itself."}),(0,s.jsx)(Ig,{command:e.installCommand}),(0,s.jsxs)("p",{className:"text-sm text-ink-2",children:[e.os.label," detected ·"," ",(0,s.jsx)("a",{className:"inline-flex min-h-6 items-center text-accent underline-offset-2 hover:underline",href:"https://omp.sh",target:"_blank",rel:"noreferrer",children:"Other ways"})]}),(0,s.jsx)($l,{label:"OMP checks",rows:[e.state==="ready"?{state:"ok",label:"omp found",value:e.path}:{state:"run",label:"Looking for omp",value:"every 2 s"},e.state==="ready"?h(e):{state:"wait",label:`Version ${e.minVersion} or newer`},e.models.length>0?{state:"ok",label:`${e.models.length} models`}:{state:"wait",label:"At least one model"}]}),e.runtime==="local"?(0,s.jsx)(_c,{children:(0,s.jsx)(le,{type:"button",variant:"ghost",onClick:c,children:"Run agents on another machine"})}):null]})}r(m6,"CheckOmpScreen");function p6({remote:e,pending:t,error:i,onCheck:l,onLocal:c}){const[u,m]=(0,x.useState)(e?.address??""),f=e?[e.connected?{state:"ok",label:"Connected",value:e.latencyMs!==null?`${e.latencyMs} ms`:null}:{state:"bad",label:"Not connected",value:e.error},...e.connected?[e.state==="missing"?{state:"bad",label:"omp not found there"}:e.state==="ready"?{state:"ok",label:`omp ${e.version} found`}:{state:"bad",label:`omp ${e.version??""} is too old`.replace(" "," "),value:"needs 18.1.16"},e.modelCount>0?{state:"ok",label:`${e.modelCount} models signed in there`}:{state:"bad",label:"No model signed in there",value:"next step"}]:[]]:[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Run agents on another machine",lede:"OMP must be installed where agents run. We check it over SSH."}),(0,s.jsxs)("form",{className:"flex flex-col gap-1.5",onSubmit:r(h=>{h.preventDefault(),l(u.trim())},"onSubmit"),id:"onboarding-remote-form",children:[(0,s.jsx)("label",{htmlFor:"onboarding-ssh-address",className:"text-sm font-medium",children:"SSH address"}),(0,s.jsx)(Wn,{id:"onboarding-ssh-address",value:u,onChange:r(h=>m(h.target.value),"onChange"),placeholder:"user@host",autoComplete:"off",spellCheck:!1,"aria-describedby":"onboarding-ssh-help"}),(0,s.jsx)("span",{id:"onboarding-ssh-help",className:"text-xs text-ink-3",children:"Uses your SSH keys. The working folder is your home folder unless you change it later."})]}),f.length>0?(0,s.jsx)($l,{label:"Remote checks",rows:f}):null,i?(0,s.jsx)(sf,{tone:"bad",children:i}):null,(0,s.jsxs)(_c,{children:[(0,s.jsx)(le,{type:"button",variant:"ghost",onClick:c,children:"Use this computer"}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)(le,{type:"submit",form:"onboarding-remote-form",disabled:t||u.trim().length===0,children:t?"Checking…":"Continue"})]})]})}r(p6,"RemoteScreen");function h6({remote:e,onSignedIn:t}){const[i,l]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(!e)return;const c=window.setInterval(t,aA);return()=>window.clearInterval(c)},[e,t]),e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Connect a model",lede:`OMP on ${e.host} has no model signed in yet.`}),(0,s.jsxs)("p",{className:"text-sm text-ink-2",children:["Sign in on ",e.host,". This page moves on by itself."]}),(0,s.jsx)(Ig,{command:`ssh -t ${e.username}@${e.host}${e.port!==22?` -p ${e.port}`:""} omp login`})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tr,{title:"Connect a model",lede:i?"Add your own gateway or local server to OMP.":"OMP has no model signed in yet. Sign in to a provider; OMP keeps the sign-in."}),i?(0,s.jsx)(QB,{onChanged:t}):(0,s.jsx)($B,{autoFocus:!0,onSignedIn:t}),(0,s.jsxs)(_c,{children:[(0,s.jsx)(le,{type:"button",variant:"link",size:"sm",onClick:r(()=>l(c=>!c),"onClick"),children:i?"Sign in to a provider instead":"Use my own server instead"}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Moves on by itself once OMP has a model."})]})]})}r(h6,"ConnectScreen");function g6({status:e,remote:t,pending:i,error:l,onStart:c}){const[u,m]=(0,x.useState)(""),f=t?t.homeFolder:e?.projectFolder,h=t?null:r6(e);return(0,s.jsxs)("form",{className:"contents",onSubmit:r(g=>{g.preventDefault(),u.trim()&&c(u.trim())},"onSubmit"),children:[(0,s.jsx)(tr,{title:"What should your first agent do?",lede:`${Eg} starts as soon as you press Start. You can rename it and change its setup later.`}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("label",{htmlFor:"onboarding-first-task",className:"text-sm font-medium",children:"First task"}),(0,s.jsx)(RS,{id:"onboarding-first-task",value:u,onChange:r(g=>m(g.target.value),"onChange"),rows:4,placeholder:f?`Read the README in ${f} and list the three riskiest modules.`:void 0,autoFocus:!0})]}),(0,s.jsxs)("section",{"aria-label":"First agent",className:"flex flex-col gap-1.5 rounded-lg border border-line-soft bg-bg-2 px-4 py-3 text-sm",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Agent"}),Eg,", general assistant"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Model"}),h?`${h} (recommended)`:"OMP default"]}),(0,s.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,s.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Folder"}),(0,s.jsx)("span",{className:"min-w-0 truncate font-mono text-xs leading-5",children:f??"~"})]})]}),l?(0,s.jsx)(sf,{tone:"bad",children:l}):null,(0,s.jsxs)(_c,{children:[(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsxs)(le,{type:"submit",disabled:i||u.trim().length===0,children:[(0,s.jsx)(m0,{className:"size-3.5","aria-hidden":!0}),i?"Starting…":"Start"]})]})]})}r(g6,"TaskScreen");function x6(){const{onboardingOpen:e,onboardingOptions:t,closeOnboarding:i,onboardingRouteDismissed:l,setOnboardingRouteDismissed:c}=Mc(),{companies:u,loading:m}=vt(),f=vn(),h=IU(f.pathname),g=h&&m?null:TU({pathname:f.pathname,companyPrefix:h,companies:u});if(!(e||g!==null&&!l))return null;const v=(e?t.companyId:g?.companyId)??null;return(0,s.jsx)(b6,{companyId:v,onClose:r(()=>{i(),c(!0)},"onClose")})}r(x6,"OnboardingFlow");function b6({companyId:e,onClose:t}){const i=wn(),l=bs(),{setSelectedCompanyId:c}=vt(),[u,m]=(0,x.useState)(0),[f,h]=(0,x.useState)("local"),[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),[k,S]=(0,x.useState)(null),N=ge({queryKey:[...cd,g],queryFn:r(()=>xs.status({command:g}),"queryFn"),retry:r((P,A)=>(yh(A)?.retry??!0)&&P<2,"retry"),refetchInterval:r(P=>yh(P.state.error)?.retry===!1||u===2&&P.state.data?!1:aA,"refetchInterval")}),_=N.data,I=yh(N.error),D=ge({queryKey:[...cd,"network",g],queryFn:r(()=>xs.status({command:g,network:!0}),"queryFn"),enabled:_?.state==="missing"&&f==="local",refetchInterval:3e4}),T=(0,x.useMemo)(()=>{if(_)return _.state!=="missing"?_:{..._,network:D.data?.network??null}},[_,D.data]);(0,x.useEffect)(()=>{if(f!=="local"||!_||u===2)return;const P=n6(_);P!==null&&P>u&&m(P)},[f,_,u]);const C=Kt({mutationFn:r(P=>xs.remote(P),"mutationFn"),onSuccess:r(P=>{j(P);const A=s6(P);A!==null&&m(A)},"onSuccess")}),M=(0,x.useCallback)(()=>{if(!y){i.invalidateQueries({queryKey:cd});return}xs.remote(y.address).then(P=>{j(P),P.modelCount>0&&m(2)}).catch(()=>{})},[y,i]),z=Kt({mutationFn:r(async P=>{const A=f==="remote"?y?.homeFolder??null:_?.projectFolder??null;let B=e;B||(B=(await wy.create({name:Rw(f==="remote"?y?.host:A)})).id,await i.invalidateQueries({queryKey:U.companies.all}));let O=null;f==="remote"&&y?.homeFolder&&(O=(await rT.create(B,{name:y.host,driver:"ssh",config:{host:y.host,port:y.port,username:y.username,remoteWorkspacePath:y.homeFolder}})).id);const W={};f==="local"&&_?.recommendedModel&&(W.model=_.recommendedModel),A&&(W.cwd=A),g&&(W.command=g);const Y=await $s.hire(B,{name:Eg,role:YB,appearance:Y_(),adapterType:"omp_local",adapterConfig:W,onboardingFirstAgent:!0,runtimeConfig:RB(),...O?{defaultEnvironmentId:O}:{}});Y.approval&&await vN.approve(Y.approval.id,"Approved during onboarding first-agent setup.");const ce=await rr.create(B,{name:Rw(A),status:"in_progress",...f==="local"&&A?{workspace:{sourceType:"local_path",cwd:A,isPrimary:!0}}:{}}),oe=await hn.create(B,{title:i6(P),description:P,status:"todo",assigneeAgentId:Y.agent.id,projectId:ce.id});return{companyId:B,issue:oe}},"mutationFn"),onMutate:r(()=>S(null),"onMutate"),onError:r(P=>S(Tg(P)),"onError"),onSuccess:r(async({companyId:P,issue:A})=>{await Promise.all([i.invalidateQueries({queryKey:U.companies.all}),i.invalidateQueries({queryKey:U.agents.list(P)}),i.invalidateQueries({queryKey:U.projects.list(P)}),i.invalidateQueries({queryKey:U.issues.list(P)})]);const B=(await wy.list()).find(W=>W.id===P)?.issuePrefix??null;c(P,{source:"route_sync"}),t();const O=A.identifier??A.id;l(B?`/${B}/issues/${O}`:`/issues/${O}`)},"onSuccess")}),K=u===1?(0,s.jsx)(iA,{title:"Skipped when OMP is ready",paragraphs:["If OMP already has a signed-in model on this machine, this step is skipped and the best model is picked for you."]}):u===2?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:f==="remote"?`Found on ${y?.host??"that machine"}`:"Found on this computer"}),(0,s.jsx)($l,{label:"Found",rows:f==="remote"?[{state:"ok",label:`OMP ${y?.version??""}`.trim()},{state:"ok",label:`${y?.modelCount??0} models signed in`},{state:"ok",label:"Working folder",value:y?.homeFolder}]:[{state:"ok",label:`OMP ${_?.version??""}`.trim()},{state:"ok",label:`${l6(_)??"Model"} signed in`,value:"imported"},{state:"ok",label:"Project folder",value:_?.projectFolder}]})]}):d6;return(0,s.jsx)(ya,{open:!0,onOpenChange:r(P=>{P||t()},"onOpenChange"),children:(0,s.jsxs)(j3,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-50 bg-bg"}),(0,s.jsxs)("div",{"data-testid":"onboarding-flow","data-step":u,role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",className:"fixed inset-0 z-50 grid overflow-y-auto lg:grid-cols-2",onKeyDown:r(P=>{P.key==="Escape"&&t()},"onKeyDown"),children:[(0,s.jsxs)("main",{className:"flex min-h-dvh min-w-0 flex-col gap-4.5 px-4 py-5 sm:px-8 sm:py-8 lg:px-14 lg:py-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)(p0,{className:"size-6.5 shrink-0 text-ink","aria-hidden":"true"}),(0,s.jsx)("b",{className:"text-base font-semibold",children:nf})]}),(0,s.jsx)(u6,{step:u}),u===0&&f==="local"?(0,s.jsx)(m6,{status:T,failure:I,command:g,onChooseCommand:v,onRemote:r(()=>h("remote"),"onRemote"),onRetry:r(()=>{i.invalidateQueries({queryKey:cd})},"onRetry")}):null,u===0&&f==="remote"?(0,s.jsx)(p6,{remote:y,pending:C.isPending,error:C.isError?Tg(C.error):null,onCheck:r(P=>C.mutate(P),"onCheck"),onLocal:r(()=>{h("local"),j(null)},"onLocal")}):null,u===1?(0,s.jsx)(h6,{remote:f==="remote"?y:null,onSignedIn:M}):null,u===2?(0,s.jsx)(g6,{status:_,remote:f==="remote"?y:null,pending:z.isPending,error:k,onStart:r(P=>z.mutate(P),"onStart")}):null]}),(0,s.jsx)("aside",{className:"hidden min-w-0 flex-col gap-4 border-s border-line-soft bg-bg-3 px-12 py-10 lg:flex",children:K})]})]})})}r(b6,"OnboardingFlowDialog");function v6(){const{openNewIssue:e}=Pa();return(0,x.useEffect)(()=>{e()},[e]),(0,s.jsx)(Qe,{to:"/issues",replace:!0})}r(v6,"NewTaskShortcut");var y6="npx @tickernelz/wardmote auth bootstrap-ceo";function jh({hasActiveInvite:e=!1}){return(0,s.jsxs)("div",{className:"mt-6 border-t border-line pt-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(XI,{className:"size-4 text-ink-3","aria-hidden":!0}),(0,s.jsx)("span",{children:"Prefer to finish setup from the host?"})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:e?"A bootstrap invite is already active. Check your Wardmote startup logs for the first-admin URL, or run this command on the host to rotate it:":"Run this command on the host that runs Wardmote to print a one-time first-admin invite URL:"}),(0,s.jsx)("pre",{className:"mt-3 overflow-x-auto rounded-md border border-line bg-bg-3/30 p-3 font-mono text-xs",children:y6})]})}r(jh,"CliFallback");function ud({children:e}){return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsx)(Dc,{className:"block p-6",children:e})})}r(ud,"StateChrome");function j6(e){return e.user.email||e.user.name||e.user.id}r(j6,"displayIdentity");function w6(e){return e?.status===409?{title:"Someone else has already claimed this instance.",body:"Refresh to sign in, or ask the existing admin to invite you from Settings -> Access."}:e?.status===401?{title:"Your session expired. Sign in again to claim this instance.",body:""}:{title:"We couldn't reach the server. Try again in a moment.",body:""}}r(w6,"claimErrorCopy");function k6({claimAvailable:e,hasActiveInvite:t=!1,session:i,claimState:l,claimError:c,onClaim:u}){if(!e)return(0,s.jsxs)(ud,{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"This Wardmote is waiting on its first admin"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This instance runs in invite-only mode. The operator must generate a one-time first-admin invite URL from the host. Once you have the link, open it from this browser to finish setup."}),(0,s.jsx)(jh,{hasActiveInvite:t}),(0,s.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Browser-based claim is intentionally disabled in public mode so anyone on the network can't promote themselves."})]});if(l==="success")return(0,s.jsxs)(ud,{children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",children:(0,s.jsx)(zd,{className:"size-5","aria-hidden":!0})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"You're the instance admin"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Setup is complete. Taking you to onboarding to create your first organization..."})]})]}),(0,s.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,s.jsx)(As,{className:"size-4 animate-spin text-ink-3","aria-hidden":!0}),(0,s.jsx)("span",{className:"text-sm text-ink-3",children:"Redirecting..."})]}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(le,{asChild:!0,variant:"secondary",children:(0,s.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]});if(!i)return(0,s.jsxs)(ud,{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Sign in or create your Wardmote account to become the first admin from this browser."}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(le,{asChild:!0,children:(0,s.jsx)(gn,{to:"/auth?next=/",children:"Sign in / Create account"})})}),(0,s.jsx)(jh,{hasActiveInvite:t})]});const m=w6(c),f=l==="claiming";return(0,s.jsxs)(ud,{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(le,{onClick:u,disabled:f,children:[f&&(0,s.jsx)(As,{className:"mr-2 size-4 animate-spin","aria-hidden":!0}),f?"Claiming...":"Claim this instance"]}),(0,s.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,s.jsx)("span",{className:"font-medium text-ink",children:j6(i)})]})]}),(0,s.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["Wrong account?"," ",(0,s.jsx)(gn,{to:"/auth?next=/",className:"underline underline-offset-2",children:"Switch account"}),"."]}),c&&(0,s.jsxs)("div",{role:"alert",className:"mt-4 flex items-start gap-2 rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:[(0,s.jsx)(Ja,{className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":!0}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:m.title}),m.body&&(0,s.jsx)("p",{className:"mt-1 text-bad/90",children:m.body})]})]}),(0,s.jsx)(jh,{hasActiveInvite:t})]})}r(k6,"BootstrapPendingPage");var dd=5e3;function S6({temporary:e,retrying:t,onRetry:i}){return(0,s.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col gap-4 px-4 py-16",children:[(0,s.jsx)(Yr,{className:"size-6 text-ink-3","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",role:"status",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:e?"Reconnecting to Wardmote":"Unable to load Wardmote"}),(0,s.jsx)("p",{className:"text-sm text-ink-3",children:e?"The server may be restarting or your connection was interrupted. We’ll try again every few seconds and reconnect automatically.":"We couldn’t check your access to this instance. Try again, or contact your instance administrator if this continues."})]}),(0,s.jsx)("div",{children:(0,s.jsx)(le,{variant:"secondary",onClick:i,disabled:t,children:t?"Connecting…":"Try again"})})]})}r(S6,"CloudAccessError");function N6(){return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsxs)(Dc,{className:"block p-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:"No organization access"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This account is signed in, but it does not have an active organization membership or instance-admin access on this Wardmote instance."}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Use an organization invite or sign in with an account that already belongs to this org."})]})})}r(N6,"NoBoardAccessPage");function Dw({allowMembershipRequest:e=!1}={}){const t=vn(),i=wn(),[l,c]=(0,x.useState)(!1),u=ge({queryKey:U.health,queryFn:r(()=>Rc.get(),"queryFn"),retry:!1,refetchInterval:r(T=>{if(T.state.error)return Tr(T.state.error)?dd:!1;const C=T.state.data;return C?.status==="starting"?dd:C?.deploymentMode==="authenticated"&&C.bootstrapStatus==="bootstrap_pending"?2e3:!1},"refetchInterval"),refetchIntervalInBackground:!0}),m=u.data?.deploymentMode==="authenticated",f=m&&u.data?.bootstrapStatus==="bootstrap_pending",h=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),enabled:m,retry:!1,refetchInterval:r(T=>Tr(T.state.error)?dd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),g=ge({queryKey:U.access.currentBoardAccess,queryFn:r(()=>Xa.getCurrentBoardAccess(),"queryFn"),enabled:m&&!f&&!!h.data,retry:!1,refetchInterval:r(T=>Tr(T.state.error)?dd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),v=Kt({mutationFn:r(()=>Xa.claimBootstrapAdmin(),"mutationFn"),onSuccess:r(async()=>{await i.invalidateQueries({queryKey:U.auth.session}),await i.invalidateQueries({queryKey:U.health}),await i.invalidateQueries({queryKey:U.companies.all}),await i.invalidateQueries({queryKey:U.companies.stats}),await i.invalidateQueries({queryKey:U.access.currentBoardAccess})},"onSuccess")}),y=[u,...m?[h]:[],...m&&!f&&h.data?[g]:[]],j=u.data?.status==="starting",k=j||y.some(T=>Tr(T.error)),S=y.find(T=>T.error&&!(T.data!==void 0&&Tr(T.error)))?.error,N=u.isLoading||m&&h.isLoading||m&&!f&&!!h.data&&g.isLoading,_=e||!m||!!g.data?.isInstanceAdmin||(g.data?.companyIds.length??0)>0,I=!N&&!S&&!f&&(!m||!!h.data)&&_;(0,x.useEffect)(()=>{I?u.data?.status==="ok"&&c(!0):c(!1)},[I,u.data?.status]);const D=(0,x.useRef)(!1);if((0,x.useEffect)(()=>{k?D.current=!0:D.current&&!N&&!S&&(D.current=!1,i.invalidateQueries({predicate:r(T=>Tr(T.state.error),"predicate")}))},[k,N,S,i]),S||j&&!l)return(0,s.jsx)(S6,{temporary:S?Tr(S):!0,retrying:y.some(T=>T.isFetching),onRetry:r(()=>{for(const T of y)(T.error||T===u&&j)&&T.refetch({cancelRefetch:!1})},"onRetry")});if(N)return(0,s.jsx)(Ra,{});if(f){const T=u.data;if(!T)return(0,s.jsx)(Ra,{});const C=v.error instanceof Si?{status:v.error.status,message:v.error.message}:v.error instanceof Error?{message:v.error.message}:null;return(0,s.jsx)(k6,{claimAvailable:T.deploymentExposure==="private",hasActiveInvite:T.bootstrapInviteActive,session:h.data,claimState:v.isSuccess?"success":v.isPending?"claiming":"idle",claimError:C,onClaim:r(()=>v.mutate(),"onClaim")})}if(m&&!h.data){const T=encodeURIComponent(`${t.pathname}${t.search}`);return(0,s.jsx)(Qe,{to:`/auth?next=${T}`,replace:!0})}return _?(0,s.jsxs)(s.Fragment,{children:[k&&(0,s.jsx)("div",{role:"status",className:"bg-bg-3 px-4 py-2 text-center text-sm text-ink-3",children:"Connection interrupted. Reconnecting automatically…"}),(0,s.jsx)(Zl,{})]}):(0,s.jsx)(N6,{})}r(Dw,"CloudAccessGate");var rA=["all","active","paused","error","builtin"];function C6({endpointId:e,children:t}){const i=ge({queryKey:U.chatEndpoints.detail(e),queryFn:r(()=>ES.get(e),"queryFn")}),{enabled:l,githubEnabled:c}=s0();return i.isError?(0,s.jsxs)("div",{className:"space-y-3 p-6",children:[(0,s.jsx)("p",{role:"alert",className:"text-sm text-bad",children:i.error.message}),(0,s.jsx)(le,{variant:"secondary",onClick:r(()=>{i.refetch()},"onClick"),children:"Retry"})]}):i.data?Fk(i.data.provider,l,c)?(0,s.jsx)(s.Fragment,{children:t}):(0,s.jsx)(Qe,{to:"/apps",replace:!0}):null}r(C6,"ProviderEndpointGate");function fd({children:e}){const{enabled:t,githubEnabled:i,loaded:l}=s0(),[c]=Uk(),{endpointId:u}=La();return!u&&c.get("provider")==="agentmail"?(0,s.jsx)(s.Fragment,{children:e}):l?u?(0,s.jsx)(C6,{endpointId:u,children:e}):Fk(c.get("provider"),t,i)?(0,s.jsx)(s.Fragment,{children:e}):(0,s.jsx)(Qe,{to:"/apps",replace:!0}):null}r(fd,"ChatConnectorsExperimentalGate");Ne(()=>ke(()=>import("./TaskChatLab-CU5eA7nX.js").then(e=>e.TaskChatLab),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119])));var A6=Ne(()=>ke(()=>import("./Cases-DXbr4HJt.js").then(e=>e.Cases),__vite__mapDeps([120,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,122,40,123,124,7,9,125,126,98,127,128,129,38,130,54]))),_6=Ne(()=>ke(()=>import("./CaseDetail-DakrB2jI.js").then(e=>e.CaseDetail),__vite__mapDeps([131,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,93,115,83,84,4,41,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,97,14,100,54,92,91,102,36,37,133,52,134,82,85,86,87,88,89,77,90,94,95,96,76,40,135,44,46,136,137,138,139,12,103,125,140,141,142,143,144,53,47,45,18,35,48,49,51,55,13,145,119,146,126,101,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,78,162,163,164,165,166,167,168,169,170,128,171,117,118,172,98,127,173,174,175,176,177,178,129,179,180]))),E6=Ne(()=>ke(()=>import("./Dashboard--lTwxjV-.js").then(e=>e.Dashboard),__vite__mapDeps([181,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,76,41,182,183,7,9,57,184,92,91,60,70,185,146,126,147,186,187,37,188,189,95,127,149,163,161,78,100,176,73,190,10,13,165,58,59,61,62,4,43,63,64,6,34,65,66,67,68,69,50,38,71,72,54,125,191,166,167,168,192,193,194,111,195,196,197,198,141,199,200,52,121,110,82,83,84,85,86,87,88,89,77,90,94,96,201,101,202,143,144,40,203,204,153,205,206,115,116,207,155,14,208,162,209,119,175,210,211,212,98,213,102,214,215,56,12,156,107,172,216,217,218,219,220,221,222,39,223,224,225,173,174,226,227,228,229,230,231,232,233,234,235,236,36,237,238,239,11,35,152,150,240,46,81,53,97,99,241,118,104,148,242,112,243,244,103,117,154,109,245,246,159,160,164,247,248,249,250,251,106,252,80,45,18,47,48,49,51,55,253]))),I6=Ne(()=>ke(()=>import("./DashboardLive-BYyTgF5d.js").then(e=>e.DashboardLive),__vite__mapDeps([254,1,3,21,20,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,202,127,193,194,111,185,146,149,91,60,92,93,195,196,197,198,141,199,200,52,7,9,121,4,110,82,59,61,83,84,85,86,87,88,89,77,90,54,94,95,96,201,101,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,238,239,11,35,152,150,58,62,63,65,67,69,50,72,73,240,46,81,53,97,99,241,118,104,148,242,112,243,244,103,117,176,154,109,245,246,159,160,164,247,248,249,250,167,251,106,252,80,45,18,47,48,49,51,55]))),T6=Ne(()=>ke(()=>import("./Companies-FcUNLIkt.js").then(e=>e.Companies),__vite__mapDeps([255,1,3,20,22,21,115,25,8,83,26,27,84,4,41,5,142,29,116,7,9,13,172,104,54,125,98,127,176]))),R6=Ne(()=>ke(()=>import("./Agents-CClUUMUq.js").then(e=>e.Agents),__vite__mapDeps([256,1,3,17,16,20,194,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,134,83,84,9,76,7,48,10,56,13,100,91,60,92,93,37,70,111,141,185,146,257,101,52,54,258,259,127,222,39,223,40,175,163,161,78,173,85,86,174,229,230,232,176,260,200,261]))),wh=Ne(()=>ke(()=>import("./AgentDetail-DFTeFc4-.js").then(e=>e.AgentDetail),__vite__mapDeps([262,1,3,16,17,20,263,194,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,238,42,44,45,18,35,46,47,48,49,50,51,53,55,264,265,266,80,58,62,63,65,67,69,72,73,81,97,99,111,147,113,133,184,126,267,268,245,164,247,248,249,154,269,270,108,271,272,273,274,260,275,276,277,278,11,279,280,281,176,282]))),D6=Ne(()=>ke(()=>import("./Projects-DLBFbxcj.js").then(e=>e.Projects),__vite__mapDeps([283,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,13,126,127,176,276,277,261]))),Mr=Ne(()=>ke(()=>import("./ProjectDetail-BW6Lr4Iq.js").then(e=>e.ProjectDetail),__vite__mapDeps([284,1,3,16,17,20,22,196,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,134,142,62,285,286,176,111,185,146,126,147,186,188,189,287,288,58,63,65,67,69,50,72,73,177,178,169,276,277,289,268,290,245,291,292,103,140,275]))),M6=Ne(()=>ke(()=>import("./ProjectWorkspaceDetail-DR4JCa1b.js").then(e=>e.ProjectWorkspaceDetail),__vite__mapDeps([293,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,103,125,140,141,134,83,84,201,101,52,54,202,4,126,186,187,37,188,189,127,176,169,87,294]))),O6=Ne(()=>ke(()=>import("./Workspaces-rtQKliW0.js").then(e=>e.Workspaces),__vite__mapDeps([295,1,3,20,263,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,141,127,289,76,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,69,70,50,38,71,72,73,156,125,37,101,52,54,163,161,78,100,173,85,86,83,40,174,268,196,197,198,199,200,121,110,82,84,87,88,89,77,90,91,92,93,94,95,96,201,202,143,144,41,203,204,153,205,206,115,116,207,155,13,14,208,162,209,119,175,210,211,212,98,213,102,182,214,215,56,12,57,107,172,216,187,217,218,219,220,221,222,39,223,224,225,226,227,228,229,230,231,232,233,234,235,236,36,237,290,111,245,292,103,126,140,275]))),L6=Ne(()=>ke(()=>import("./Issues-BWoc80Y9.js").then(e=>e.Issues),__vite__mapDeps([296,1,3,16,17,20,263,194,297,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,62,122,4,41,63,64,214,7,11,13,14,100,90,54,187,92,93,37,70,111,141,185,146,126,101,52,147,298,148,127,149,91,60,176,73,299,58,59,61,43,6,34,65,66,67,68,69,50,38,71,72,162,57,169,87,200,115,82,85,86,88,89,77,94,95,96,139,144,40,42,44,45,18,12,35,36,46,47,48,49,51,53,55,56,300,103,102,222,39,223,175,227,228,119,221,229,76,246,269,251,106,252,80,81,97,98,99]))),z6=Ne(()=>ke(()=>import("./Search-yNNB6kys.js").then(e=>e.Search),__vite__mapDeps([301,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,115,83,84,41,134,9,122,40,302,46,7,13,14,100,271,90,54,187,125,91,60,92,93,70,126,98,217,127,149,35,175,73,133,52]))),P6=Ne(()=>ke(()=>import("./IssueDetail-CsaD311l.js").then(e=>e.t).then(e=>e.IssueDetail),__vite__mapDeps([303,1,3,25,8,16,17,20,263,194,22,196,197,198,141,21,19,23,24,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,18,35,137,238,304,108,166,167,168,132,58,62,63,65,67,69,50,72,73,97,133,248,249,305,306,307,308,134,122,53,264,265,266,80,46,45,47,48,49,51,55,81,99,111,147,113,42,44,309,135,75,79,103,104,105,302,310,311,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,165,169,170,128,106,240,241,118,242,112,243,244,11,312,15,74,109,114,117,313,185,257,298,186,188,189,267,287,252,314,315,316,195,239,176,245,246,247,250,317,318,299,178,288,177,269,319,190,10,320,270,271,191]))),U6=Ne(()=>ke(()=>import("./AgentChats-CmDtTrMa.js").then(e=>e.AgentChats),__vite__mapDeps([321,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,91,60,92,93,127,322]))),$6=Ne(()=>ke(()=>import("./AgentChat-CeuGtMXr.js").then(e=>e.AgentChat),__vite__mapDeps([323,1,3,16,17,20,22,303,25,8,263,194,196,197,198,141,21,19,23,24,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,18,35,137,238,304,108,166,167,168,132,58,62,63,65,67,69,50,72,73,97,133,248,249,305,306,307,308,134,122,53,264,265,266,80,46,45,47,48,49,51,55,81,99,111,147,113,42,44,309,135,75,79,103,104,105,302,310,311,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,165,169,170,128,106,240,241,118,242,112,243,244,11,312,15,74,109,114,117,313,185,257,298,186,188,189,267,287,252,314,315,316,195,239,176,245,246,247,250,317,318,299,178,288,177,269,319,190,10,320,270,271,191,324,322]))),B6=Ne(()=>ke(()=>import("./IssueChatLongThreadPerf-DD3RLbBo.js").then(e=>e.IssueChatLongThreadPerf),__vite__mapDeps([325,1,3,125,8,9,176,195,16,17,20,196,22,197,198,141,21,19,23,24,25,26,27,28,29,5,30,31,32,33,199,200,52,7,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,238,239,11,35,152,150,58,62,63,65,67,69,50,72,73,240,46,81,53,97,99,241,118,104,148,242,112,243,244,103,117,111,154,109,245,246,159,160,164,247,248,249,250,167]))),K6=Ne(()=>ke(()=>import("./Routines-CHtabiYj.js").then(e=>e.Routines),__vite__mapDeps([326,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,82,59,60,61,83,52,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,122,4,40,41,7,9,13,145,37,70,111,185,146,126,101,147,327,127,151,150,152,153,173,174,176,328,200,115,116,172,98,133,329,110,203,204,205,6,310,66,311,125,141,102,230,38,170]))),q6=Ne(()=>ke(()=>import("./Pipelines-CkiYUQS-.js").then(e=>e.Learnings),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),F6=Ne(()=>ke(()=>import("./Pipelines-CkiYUQS-.js").then(e=>e.PipelineItemDetail),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),H6=Ne(()=>ke(()=>import("./Pipelines-CkiYUQS-.js").then(e=>e.PipelineItemLegacyRedirect),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),kh=Ne(()=>ke(()=>import("./Pipelines-CkiYUQS-.js").then(e=>e.Pipelines),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),V6=Ne(()=>ke(()=>import("./Pipelines-CkiYUQS-.js").then(e=>e.ReviewQueue),__vite__mapDeps([330,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,132,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,133,52,121,82,85,86,87,88,89,77,90,94,95,96,122,144,40,174,44,46,332,78,240,196,197,198,141,199,200,110,201,101,202,143,76,203,204,153,205,161,206,207,155,13,208,162,209,119,125,175,210,211,212,98,213,182,214,215,56,12,156,57,107,172,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,226,227,228,229,230,231,232,233,234,235,236,237,81,53,35,99,241,118,104,242,112,243,244,313,111,176,195,238,239,11,152,150,103,117,154,109,245,246,159,160,164,247,248,249,250,167,158,317,178,55,180,333]))),W6=Ne(()=>ke(()=>import("./PipelineSettings-BcAtsehE.js").then(e=>e.PipelineSettings),__vite__mapDeps([334,1,3,16,17,20,22,331,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,126,147,148,199,115,83,84,4,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,139,62,144,160,40,206,203,7,9,204,101,153,205,161,116,207,155,68,13,14,208,162,209,119,125,37,175,210,11,12,172,141,98,127,213,102,151,150,221,152,333,335,110,43,173,174]))),Mw=Ne(()=>ke(()=>import("./StatusCards-DaJdQUN5.js").then(e=>e.StatusCards),__vite__mapDeps([336,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,115,83,84,41,134,9,40,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,69,70,50,38,71,72,73,116,182,13,156,100,337,119,88,86,125,91,92,93,101,52,54,98,127,102,152,150,153,163,161,78,173,85,174,133,290,111,245]))),Q6=Ne(()=>ke(()=>import("./PixelsOffice-BSlctoug.js").then(e=>e.PixelsOffice),__vite__mapDeps([338,1,3,20,59,60,61,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,265,83,85,86,339,34,214,7,9,11,12,312,54,187,125,37,70,111,147,94,95,127,176,133,52,340,240,196,197,198,141,199,200,121,4,110,82,84,87,88,89,77,90,91,92,93,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,175,210,211,212,98,213,102,38,182,66,215,56,156,57,107,172,100,216,217,218,219,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,63,58,62,65,67,69,50,72,73,46,81,53,97,35,99,241,118,104,148,242,112,243,244,333,291]))),Ow=Ne(()=>ke(()=>import("./RoutineDetail-izWzADvA.js").then(e=>e.RoutineDetail),__vite__mapDeps([341,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,93,115,83,84,4,41,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,97,14,100,54,92,91,102,36,37,133,52,110,82,85,86,87,88,89,77,90,94,95,96,139,143,266,161,206,40,203,204,101,153,205,207,155,13,208,162,209,119,125,175,210,342,12,312,145,172,343,216,187,111,126,98,147,217,127,213,151,150,221,152,225,173,174,231,176,275,278,200,11,179,344,163,78,329,310,311,141,230,170,335,199,345]))),G6=Ne(()=>ke(()=>import("./UserProfile-C6q55R0Q.js").then(e=>e.UserProfile),__vite__mapDeps([346,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,161,7,9,209,258,259,127]))),Rl=Ne(()=>ke(()=>import("./ExecutionWorkspaceDetail-CuD5xWOB.js").then(e=>e.ExecutionWorkspaceDetail),__vite__mapDeps([347,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,103,125,140,141,134,83,84,4,40,6,145,100,37,70,111,185,146,126,98,186,187,188,189,94,95,127,102,38,176,169,87,275,289,76,58,59,60,61,62,43,63,64,65,66,67,68,69,50,71,72,73,156,101,52,54,163,161,78,173,85,86,174,268,196,197,198,199,200,121,110,82,88,89,77,90,91,92,93,96,201,202,143,144,41,203,204,153,205,206,115,116,207,155,13,208,162,209,119,175,210,211,212,213,182,214,215,56,57,107,172,216,217,218,219,220,221,222,39,223,224,225,226,227,228,229,230,231,232,233,234,235,236,36,237,290,245,294,329,310,311,151,150,152,170]))),Y6=Ne(()=>ke(()=>import("./Goals-xgGKfQZi.js").then(e=>e.Goals),__vite__mapDeps([348,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,127,349,41]))),Lw=Ne(()=>ke(()=>import("./Artifacts-Bsv5m0aU.js").then(e=>e.Artifacts),__vite__mapDeps([350,1,3,16,17,20,263,18,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,4,6,34,12,35,36,37,38,115,83,84,41,202,7,9,54,125,98,127,320]))),X6=Ne(()=>ke(()=>import("./GoalDetail-oN5pyUUY.js").then(e=>e.GoalDetail),__vite__mapDeps([351,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,7,13,70,126,127,220,288,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,58,62,4,43,63,64,6,34,65,66,67,68,69,50,38,71,72,73,177,178,40,174,169,261,349,41]))),zw=Ne(()=>ke(()=>import("./Approvals-BXrjqpKc.js").then(e=>e.Approvals),__vite__mapDeps([352,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,57,125,70,127,318,63,64,7,149,91,60,92,93,176,299,58,59,61,62,4,43,6,34,65,66,67,68,69,50,38,71,72,73,162]))),Z6=Ne(()=>ke(()=>import("./ApprovalDetail-CE41WFbd.js").then(e=>e.ApprovalDetail),__vite__mapDeps([353,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,92,93,127,149,91,102,299,162,57]))),J6=Ne(()=>ke(()=>import("./CompanyActivity-ScpRBz1G.js").then(e=>e.CompanyActivity),__vite__mapDeps([354,1,3,355,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,134,83,84,9,139,356,144,76,40,41,339,7,10,69,13,14,300,162,286,100,98,176,187,125,60,92,93,91,37,70,111,101,52,54,147,217,327,94,95,127,149,173,85,86,4,174,191,166,167,168,357,358,291,345,359]))),md=Ne(()=>ke(()=>import("./AuditHub-DbUni0O_.js").then(e=>e.AuditHub),__vite__mapDeps([355,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,134,83,84,9,139,356,144,76,40,41,339,7,10,69,13,14,300,162,286,100,98,176,187,125,60,92,93,91,37,70,111,101,52,54,147,217,327,94,95,127,149,173,85,86,4,174,191,166,167,168,357,358,291,345,359]))),e8=Ne(()=>ke(()=>import("./WhatNeedsMe-1igJA4gL.js").then(e=>e.WhatNeedsMe),__vite__mapDeps([360,1,3,16,17,20,22,361,263,194,59,60,61,248,249,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,115,83,84,41,143,122,89,40,174,63,64,58,62,43,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,171,240,196,197,198,141,200,52,110,82,85,86,87,88,77,90,54,91,92,93,94,95,96,201,101,202,144,76,203,204,153,205,161,206,207,155,13,14,208,162,209,119,125,37,175,210,211,212,98,213,102,182,214,215,56,12,156,57,107,172,100,216,187,217,218,219,127,220,221,222,39,223,163,78,224,225,173,226,227,228,229,230,231,232,233,234,235,236,36,237,46,81,53,97,35,99,241,118,104,148,242,112,243,244,307,362,147,166,167,168,340,111,185,146]))),t8=Ne(()=>ke(()=>import("./DecisionQueuePage-BaaKuZBi.js").then(e=>e.DecisionQueuePage),__vite__mapDeps([363,1,3,16,17,20,22,361,263,194,59,60,61,248,249,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,115,83,84,41,143,122,89,40,174,63,64,58,62,43,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,171,240,196,197,198,141,200,52,110,82,85,86,87,88,77,90,54,91,92,93,94,95,96,201,101,202,144,76,203,204,153,205,161,206,207,155,13,14,208,162,209,119,125,37,175,210,211,212,98,213,102,182,214,215,56,12,156,57,107,172,100,216,187,217,218,219,127,220,221,222,39,223,163,78,224,225,173,226,227,228,229,230,231,232,233,234,235,236,36,237,46,81,53,97,35,99,241,118,104,148,242,112,243,244,307,362,147,166,167,168,340]))),n8=Ne(()=>ke(()=>import("./BoardChat-CgzCuFIL.js").then(e=>e.BoardChat),__vite__mapDeps([364,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,115,83,84,4,41,139,39,40,161,365,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,46,171,277,97,366,313,100,90,184,119,88,86,91,92,93,185,146,95,127,35,176,114,116,117,118,54,101,52,102,36,37,133]))),s8=Ne(()=>ke(()=>import("./CompanySettings-BSkg4ahA.js").then(e=>e.CompanySettings),__vite__mapDeps([367,1,3,16,17,20,22,21,199,25,8,26,200,52,27,7,9,40,203,23,24,4,54,204,31,101,153,205,10,13,125,37,141,98,259,127,220,221,173,85,86,83,174,228,41,43,119,88,229,76,30,243,368,196,197,198,19,28,29,5,32,33,121,110,82,59,60,61,84,87,89,77,90,91,92,93,94,95,96,201,202,143,144,161,64,6,206,115,116,207,155,68,14,208,162,209,175,210,34,211,212,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,222,39,223,163,78,224,225,226,227,230,231,71,232,233,234,235,236,36,237,357]))),a8=Ne(()=>ke(()=>import("./CompanyConnections-DMEwbZv7.js").then(e=>e.CompanyConnections),__vite__mapDeps([369,1,3,20,196,16,17,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,368,357,358]))),Sh=Ne(()=>ke(()=>import("./CompanyEnvironments-EqXhVruZ.js").then(e=>e.CompanyEnvironments),__vite__mapDeps([370,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,52,7,9,202,4,206,115,83,84,41,40,203,54,204,101,153,205,161,116,207,155,68,13,14,208,162,209,119,88,86,125,37,175,210,215,12,156,172,70,141,127,213,226,121,110,98,102,173,85,174,228,43,221,229,76,230,232,308]))),i8=Ne(()=>ke(()=>import("./BootstrapSetupUxLab-D-niQCV5.js").then(e=>e.BootstrapSetupUxLab),__vite__mapDeps([371,1,3,7,8,9,57,33,100,176]))),r8=Ne(()=>ke(()=>import("./ResponsibleUserDenialUxLab-Bt9vnHJz.js").then(e=>e.ResponsibleUserDenialUxLab),__vite__mapDeps([372,1,3,176,270,238,108,271]))),l8=Ne(()=>ke(()=>import("./CrossIssueCollaborationUxLab-CEh5B2iJ.js").then(e=>e.CrossIssueCollaborationUxLab),__vite__mapDeps([373,1,3,304,238,143,64,207,57,108,166,167,168,93,25,8,26,92,176,250,119,88,86,125,9]))),o8=Ne(()=>ke(()=>import("./CompanySettingsPluginPage-BzZkZqh-.js").then(e=>e.CompanySettingsPluginPage),__vite__mapDeps([374,1,3,16,17,21,20,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,186,187,37,188,189,127]))),c8=Ne(()=>ke(()=>import("./CompanyAccess-BUcTNg7_.js").then(e=>e.CompanyAccess),__vite__mapDeps([375,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,134,83,84,9,4,6,7,57,172,125,37,70,101,52,54,147,186,187,188,189,258,259,127,38]))),u8=Ne(()=>ke(()=>import("./CompanyAccess-BUcTNg7_.js").then(e=>e.CompanyAccessLegacyRoute),__vite__mapDeps([375,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,134,83,84,9,4,6,7,57,172,125,37,70,101,52,54,147,186,187,188,189,258,259,127,38]))),Pw=Ne(()=>ke(()=>import("./AdvancedToolsRoute-CICI1XRd.js").then(e=>e.AdvancedToolsRoute),__vite__mapDeps([376,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,142,365,285,10,377,104,126,147,176,133,281,253,378,379,194]))),Uw=Ne(()=>ke(()=>import("./ProfileWizardRoute-XnnvzH9S.js").then(e=>e.ProfileWizardRoute),__vite__mapDeps([380,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,121,4,110,40,41,7,9,241,13,54,125,37,98,218,127,102,224,91,60,92,93,217,173,85,86,83,174,175,281,100,176,379,194,70,126,94,95,381,162,147]))),d8=Ne(()=>ke(()=>import("./ProfileDetailRoute-DRFQNId6.js").then(e=>e.ProfileDetailRoute),__vite__mapDeps([382,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,142,6,7,9,57,172,168,125,37,101,52,54,98,218,127,102,281,100,176,378,379,194,70,126,94,95,381,162,147]))),f8=Ne(()=>ke(()=>import("./Browse-0bmB5mqw.js").then(e=>e.Browse),__vite__mapDeps([383,1,3,20,194,22,384,16,17,197,198,141,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,200,52,7,9,121,4,41,156,100,209,92,93,111,101,54,98,217,218,50,163,161,78,225,359,385,115,83,84,110,306,116,34,215,212,172,119,88,86,91,60,37,70,147,267,219,127,237,112,386,387,134,6,241,184,38,231,102,71]))),lA=Ne(()=>ke(()=>import("./AppsConnect-DH7aSjtS.js").then(e=>e.AppsConnect),__vite__mapDeps([388,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,385,389]))),m8=Ne(()=>ke(()=>import("./ChatEndpointSetup-BX3iDH7N.js").then(e=>e.ChatEndpointSetup),__vite__mapDeps([390,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,110,43,6,34,207,155,7,9,100,216,187,119,88,86,91,60,92,93,37,70,141,126,101,52,54,98,259,267,127,102,224,41,217,38,236,36,391,202,143,218,176,112,244,275,279,162,228,40,221,229,76,392]))),$w=Ne(()=>ke(()=>import("./ChatEndpointDetail-BdDKo-Gq.js").then(e=>e.ChatEndpointDetail),__vite__mapDeps([393,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,52,7,9,121,4,115,83,84,41,110,82,59,60,61,85,86,87,88,89,77,90,54,91,92,93,94,95,96,139,356,144,40,43,58,62,63,64,6,34,65,66,67,68,69,70,50,38,71,72,73,116,11,12,13,156,172,100,119,125,37,101,98,147,267,218,219,127,102,221,235,234,112,275,394,224,217,225,391,202,143,126,176,244,279,162,228,229,76,392]))),p8=Ne(()=>ke(()=>import("./ChatIdentityConfirm-DCI5BnWo.js").then(e=>e.ChatIdentityConfirm),__vite__mapDeps([395,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,259,267]))),h8=Ne(()=>ke(()=>import("./AppsReview-C0Y3SxmZ.js").then(e=>e.AppsReview),__vite__mapDeps([396,1,3,21,20,22,127,397,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,240,196,197,198,141,199,200,52,121,110,82,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,206,115,116,207,155,13,14,208,162,209,119,125,37,175,210,211,212,98,213,102,182,214,215,56,12,156,57,107,172,100,216,187,217,218,219,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,232,233,234,235,236,36,237,46,81,53,97,35,99,241,118,104,148,242,112,243,244]))),g8=Ne(()=>ke(()=>import("./AppDetail-DfHLFOtj.js").then(e=>e.AppDetail),__vite__mapDeps([398,1,3,16,17,20,22,196,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,384,111,50,359,385,147,314,386,389,394,391,126,176,112,244,275,279,397,58,62,63,65,67,69,72,73,240,46,81,53,97,35,99,241,118,104,148,242,243]))),Bw=Ne(()=>ke(()=>import("./AppNotConnected-CcmXbFtD.js").then(e=>e.AppNotConnected),__vite__mapDeps([399,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,398,384,111,50,359,385,147,314,386,389,394,391,126,176,112,244,275,279,397,58,62,63,65,67,69,72,73,240,46,81,53,97,35,99,241,118,104,148,242,243]))),Kw=Ne(()=>ke(()=>import("./GatewaysList-DsSKLm1h.js").then(e=>e.GatewaysList),__vite__mapDeps([400,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,37,70,126,98,217,218,127,221,281,100,125,176,401,139,6,68,101,52,54,38]))),x8=Ne(()=>ke(()=>import("./GatewayDetail-xNVOxSIs.js").then(e=>e.GatewayDetail),__vite__mapDeps([402,1,3,16,17,20,263,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,76,266,4,40,53,41,174,203,7,9,54,204,52,101,153,205,43,316,6,68,285,13,366,119,88,86,37,70,126,98,217,218,127,221,38,281,100,125,176,401,139]))),b8=Ne(()=>ke(()=>import("./CompanySkills-BbA4RKIw.js").then(e=>e.CompanySkills),__vite__mapDeps([403,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,115,83,84,41,134,9,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,40,53,161,43,58,62,63,64,6,34,65,66,67,68,7,69,70,50,38,71,72,73,316,116,155,46,182,311,215,79,11,13,156,208,313,162,57,172,100,104,184,119,125,37,126,101,98,127,149,102,163,78,224,217,235,234,36,274,275,179,404,328,200,133,405]))),qw=Ne(()=>ke(()=>import("./SkillSources-Cw4PU-Bz.js").then(e=>e.SkillSources),__vite__mapDeps([406,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,115,83,84,4,41,161,135,34,46,7,9,13,156,100,101,52,54,98,50,127,204,237,55,405,407,78,125,389]))),Nh=Ne(()=>ke(()=>import("./SkillStudio-Cj_M3ZJa.js").then(e=>e.SkillStudio),__vite__mapDeps([408,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,93,115,83,84,4,41,110,134,9,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,94,95,96,202,40,203,7,204,101,153,205,409,76,155,211,121,6,68,212,162,119,125,37,98,213,102,38,337,64,58,62,43,63,34,65,66,67,69,70,50,71,72,73,116,46,182,332,78,48,240,196,197,198,141,200,201,143,144,161,206,207,13,14,208,209,175,210,214,215,56,12,156,57,107,172,100,216,187,217,218,219,127,220,221,222,39,223,163,224,225,173,174,226,227,228,229,230,231,232,233,234,235,236,36,237,81,53,97,35,99,241,118,104,148,242,112,243,244,149,150,176,51,55,178,133,274,261,179,130,404,405,403,316,311,79,11,313,184,126,275,328,410,411]))),v8=Ne(()=>ke(()=>import("./Secrets-BOyOk5BF.js").then(e=>e.Secrets),__vite__mapDeps([412,1,3,16,17,20,21,22,121,25,8,4,115,83,26,27,84,41,5,134,9,23,24,142,62,143,53,161,63,309,6,116,34,211,110,68,7,212,162,119,88,86,125,91,60,92,93,37,101,52,54,98,213,102,38,66,124,214,78,215,342,13,156,31,57,172,100,209,104,70,147,258,259,217,127,224,173,85,40,174,210,36,133]))),y8=Ne(()=>ke(()=>import("./CompanyImport-BhuZu4oc.js").then(e=>e.CompanyImport),__vite__mapDeps([413,1,3,20,22,196,16,17,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,58,62,63,65,67,69,50,72,73,414,415,416]))),j8=Ne(()=>ke(()=>import("./DesignGuide-DS6MuXWY.js").then(e=>e.DesignGuide),__vite__mapDeps([417,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237,265,134,239,11,35,152,150,58,62,63,65,67,69,50,72,73,75,42,44,45,18,46,47,48,49,51,53,55,79,80,81,97,99,103,104,105,183,106,418,240,241,118,148,242,112,243,244,419,362,184,313,176,109,111,315,316,145,298,157,288,177,178,165,169,133,276,277,280,281,261,130,404,192,193,194,185,146,149,195,238,117,154,245,246,159,160,164,247,248,249,250,167,251,252,407,344,410,411]))),w8=Ne(()=>ke(()=>import("./InstanceFeatures-DUQnBkxy.js").then(e=>e.InstanceFeatures),__vite__mapDeps([420,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,125,9,98,189,127,421,141,258,259,221]))),k8=Ne(()=>ke(()=>import("./AgentDefaults-DpYaMGkf.js").then(e=>e.AgentDefaults),__vite__mapDeps([422,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,143,70,127,272,273,7,9,14,54,125,173,85,86,83,4,40,174]))),S8=Ne(()=>ke(()=>import("./OmpAllSettings-DBtL1qDL.js").then(e=>e.n).then(e=>e.OmpAllSettingsPage),__vite__mapDeps([282,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,202,7,9,14,125,70,98,127,102,221,173,85,86,83,4,40,174,175,272,273,54]))),N8=Ne(()=>ke(()=>import("./ModelsAndProviders-BEb4Z38S.js").then(e=>e.ModelsAndProviders),__vite__mapDeps([423,1,3,20,21,22,7,8,9,13,156,70,127,272]))),C8=Ne(()=>ke(()=>import("./InstanceAdvanced-Bdf2a4c_.js").then(e=>e.InstanceAdvanced),__vite__mapDeps([424,1,3,7,8,9,12,14,100,125,127,421,20,141,258,259,221]))),A8=Ne(()=>ke(()=>import("./InstanceAccess-Ns2rAmva.js").then(e=>e.InstanceAccess),__vite__mapDeps([425,1,3,20,22,121,25,8,4,7,9,57,32,37,147,127,176]))),_8=Ne(()=>ke(()=>import("./ProfileSettings-BMwLBQDB.js").then(e=>e.ProfileSettings),__vite__mapDeps([426,1,3,20,22,21,93,25,8,26,110,214,7,9,12,208,366,172,70,98,127,220,221,224,121,4,23,24,27,41,91,60,92,217,225,173,85,86,83,40,174,176]))),E8=Ne(()=>ke(()=>import("./PluginManager-4rrrAOLG.js").then(e=>e.PluginManager),__vite__mapDeps([427,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,110,182,7,9,13,377,313,172,100,125,37,101,52,54,98,188,127,176]))),I8=Ne(()=>ke(()=>import("./PluginSettings-Do37r6Zu.js").then(e=>e.PluginSettings),__vite__mapDeps([428,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,201,101,52,7,54,202,89,63,64,66,208,162,100,343,125,188,186,187,37,189,127,226,121,4,110,40,41,161,207,155,68,13,172,98,213,102,173,85,86,174,176,169,87,140,141]))),Fw=Ne(()=>ke(()=>import("./AdapterManager-DhiW44Eo.js").then(e=>e.AdapterManager),__vite__mapDeps([429,1,3,20,21,22,110,25,8,201,33,101,52,26,27,7,9,54,30,66,13,377,156,172,100,125,37,98,127,227,23,24,40,222,39,223,4,31,175,228,41,43,119,88,86,221,229,76,233,234,176]))),Hw=Ne(()=>ke(()=>import("./PluginPage-C6Qnf9ka.js").then(e=>e.PluginPage),__vite__mapDeps([430,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,202,7,9,188,186,187,37,189,127]))),T8=Ne(()=>ke(()=>import("./NewAgent-C3MxIRJj.js").then(e=>e.NewAgent),__vite__mapDeps([431,1,3,16,17,20,196,22,197,198,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,199,200,52,7,9,121,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,201,101,202,143,144,76,40,41,203,204,153,205,161,43,64,6,206,115,116,207,155,68,13,14,208,162,209,119,125,37,175,210,34,211,212,98,213,102,38,182,66,214,215,56,12,156,57,107,172,100,216,187,70,217,218,219,127,220,221,222,39,223,163,78,224,225,173,174,226,227,228,229,230,231,71,232,233,234,235,236,36,237]))),R8=Ne(()=>ke(()=>import("./Auth-_P9t1YSS.js").then(e=>e.AuthPage),__vite__mapDeps([432,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,419,362,184,72,259,433]))),D8=Ne(()=>ke(()=>import("./BoardClaim-CsomHmd6.js").then(e=>e.BoardClaimPage),__vite__mapDeps([434,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,176]))),M8=Ne(()=>ke(()=>import("./AssistantConnection-Dm2PaSeU.js").then(e=>e.AssistantConnection),__vite__mapDeps([387,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,4,6,34,7,241,184,92,93,127,38,231,54,102,71,386]))),Vw=Ne(()=>ke(()=>import("./McpConnect-Dzf7W2K6.js").then(e=>e.McpConnectPage),__vite__mapDeps([435,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,184,92,93,98,176,386]))),O8=Ne(()=>ke(()=>import("./McpConnect-Dzf7W2K6.js").then(e=>e.McpDevicePage),__vite__mapDeps([435,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,184,92,93,98,176,386]))),L8=Ne(()=>ke(()=>import("./McpConnect-Dzf7W2K6.js").then(e=>e.AssistantConnectionsPage),__vite__mapDeps([435,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,184,92,93,98,176,386]))),z8=Ne(()=>ke(()=>import("./CliAuth-CRG0c0EH.js").then(e=>e.CliAuthPage),__vite__mapDeps([436,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,176]))),P8=Ne(()=>ke(()=>import("./InviteLanding-McBYpNeW.js").then(e=>e.InviteLandingPage),__vite__mapDeps([437,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,259,229,76,433]))),Ww=Ne(()=>ke(()=>import("./PublicIssueSharePage-C9yRZOdP.js").then(e=>e.PublicIssueSharePage),__vite__mapDeps([438,1,3,16,17,20,202,58,59,60,61,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,74,46,47,92,93,217,319]))),U8=Ne(()=>ke(()=>import("./JoinRequestQueue-ZZq3jWW-.js").then(e=>e.JoinRequestQueue),__vite__mapDeps([439,1,3,20,21,22,7,8,9,125,37,147,127,176]))),oA=Ne(()=>ke(()=>Promise.resolve().then(()=>wB).then(e=>e.NotFoundPage),void 0)),tc=Ne(()=>ke(()=>import("./Inbox-wHhHozfr.js").then(e=>e.n).then(e=>e.Inbox),__vite__mapDeps([297,1,3,16,17,20,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,83,84,9,62,122,4,41,63,64,214,7,11,13,14,100,90,54,187,92,93,37,70,111,141,185,146,126,101,52,147,298,148,127,149,91,60,176,73,299,58,59,61,43,6,34,65,66,67,68,69,50,38,71,72,162,57,169,87]))),$8=Ne(()=>ke(()=>import("./CompanyExport-DQ9ffuua.js").then(e=>e.CompanyExport),__vite__mapDeps([440,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,14,54,37,126,127,55,416]))),B8=Ne(()=>ke(()=>import("./Terminal-Bo-WuezO.js").then(e=>e.Terminal),__vite__mapDeps([441,1,3,20,305,25,8,115,83,26,27,84,4,41,5,39,223,306,6,7,9,307,31,54,98,38,36,37,308,21,22,19,16,17,23,24,28,29,30,32,33,110,13,49,172,101,52,147,127,230,410])));function K8({children:e}){return(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:e})}r(K8,"ProductionSurface");function q8(e){const t=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{index:!0,element:(0,s.jsx)(Qe,{to:"dashboard",replace:!0})}),(0,s.jsx)(L,{path:"dashboard",element:(0,s.jsx)(E6,{})}),(0,s.jsx)(L,{path:"dashboard/live",element:(0,s.jsx)(I6,{})}),(0,s.jsx)(L,{path:"timeline",element:(0,s.jsx)(Va,{to:"/activity/timeline"})}),(0,s.jsx)(L,{path:"onboarding",element:(0,s.jsx)(dA,{})}),(0,s.jsx)(L,{path:"companies",element:(0,s.jsx)(T6,{})}),(0,s.jsx)(L,{path:"company/settings",element:(0,s.jsx)(s8,{})}),(0,s.jsx)(L,{path:"company/settings/connections",element:(0,s.jsx)(a8,{})}),(0,s.jsx)(L,{path:"company/settings/agent-defaults",element:(0,s.jsx)(k8,{})}),(0,s.jsx)(L,{path:"company/settings/agent-defaults/all",element:(0,s.jsx)(S8,{})}),(0,s.jsx)(L,{path:"company/settings/models",element:(0,s.jsx)(N8,{})}),(0,s.jsx)(L,{path:"company/settings/environments",element:(0,s.jsx)(Qe,{to:"/company/settings/instance/environments",replace:!0})}),(0,s.jsx)(L,{path:"company/settings/cloud-upstream",element:(0,s.jsx)(Qe,{to:"/company/export",replace:!0})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.members"}),children:[(0,s.jsx)(L,{path:"company/settings/members",element:(0,s.jsx)(c8,{})}),(0,s.jsx)(L,{path:"company/settings/access",element:(0,s.jsx)(u8,{})})]}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.invites"}),children:(0,s.jsx)(L,{path:"company/settings/invites",element:(0,s.jsx)(Qe,{to:"/company/settings/members?tab=invites",replace:!0})})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.export"}),children:(0,s.jsx)(L,{path:"company/export/*",element:(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:(0,s.jsx)($8,{})})})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.import"}),children:(0,s.jsx)(L,{path:"company/import",element:(0,s.jsx)(y8,{})})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"company.secrets"}),children:(0,s.jsx)(L,{path:"company/settings/secrets",element:(0,s.jsx)(v8,{})})}),(0,s.jsx)(L,{path:"company/settings/tools",element:(0,s.jsx)(Yw,{})}),(0,s.jsx)(L,{path:"company/settings/tools/:tab",element:(0,s.jsx)(Yw,{})}),(0,s.jsx)(L,{path:"tools",element:(0,s.jsx)(Xw,{})}),(0,s.jsx)(L,{path:"tools/:tab",element:(0,s.jsx)(Xw,{})}),(0,s.jsx)(L,{path:"apps",element:(0,s.jsx)(f8,{})}),(0,s.jsx)(L,{path:"apps/assistant-connection",element:(0,s.jsx)(M8,{})}),(0,s.jsx)(L,{path:"apps/browse",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/connections",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/byo",element:(0,s.jsx)(lA,{byoOnly:!0})}),(0,s.jsx)(L,{path:"apps/vercel-connect",element:(0,s.jsx)(Qw,{credentialSource:"vercel_connect"})}),(0,s.jsx)(L,{path:"apps/connect",element:(0,s.jsx)(Qw,{})}),(0,s.jsx)(L,{path:"apps/chat/connect",element:(0,s.jsx)(fd,{children:(0,s.jsx)(m8,{})})}),(0,s.jsx)(L,{path:"apps/chat/:endpointId",element:(0,s.jsx)(fd,{children:(0,s.jsx)(Qe,{to:"settings",replace:!0})})}),(0,s.jsx)(L,{path:"apps/chat/:endpointId/reviews/:reviewId",element:(0,s.jsx)(fd,{children:(0,s.jsx)($w,{})})}),(0,s.jsx)(L,{path:"apps/chat/:endpointId/:tab",element:(0,s.jsx)(fd,{children:(0,s.jsx)($w,{})})}),(0,s.jsx)(L,{path:"apps/connect/:appKey",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/connect/:appKey/:stage",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/review",element:(0,s.jsx)(h8,{})}),(0,s.jsx)(L,{path:"apps/attention",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/gateways",element:(0,s.jsx)(Kw,{})}),(0,s.jsx)(L,{path:"apps/gateways/:gatewayId",element:(0,s.jsx)(Qe,{to:"overview",replace:!0})}),(0,s.jsx)(L,{path:"apps/gateways/:gatewayId/:tab",element:(0,s.jsx)(x8,{})}),(0,s.jsx)(L,{path:"apps/advanced",element:(0,s.jsx)(Pw,{})}),(0,s.jsx)(L,{path:"apps/advanced/gateways",element:(0,s.jsx)(Kw,{})}),(0,s.jsx)(L,{path:"apps/advanced/profiles/new",element:(0,s.jsx)(Uw,{mode:"new"})}),(0,s.jsx)(L,{path:"apps/advanced/profiles/:profileId/edit",element:(0,s.jsx)(Uw,{mode:"edit"})}),(0,s.jsx)(L,{path:"apps/advanced/profiles/:profileId",element:(0,s.jsx)(d8,{})}),(0,s.jsx)(L,{path:"apps/advanced/audit",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/advanced/run-your-own",element:(0,s.jsx)(Qe,{to:"/apps",replace:!0})}),(0,s.jsx)(L,{path:"apps/advanced/:tab",element:(0,s.jsx)(Pw,{})}),(0,s.jsx)(L,{path:"apps/app/:applicationId",element:(0,s.jsx)(Bw,{})}),(0,s.jsx)(L,{path:"apps/app/:applicationId/:tab",element:(0,s.jsx)(Bw,{})}),(0,s.jsx)(L,{path:"apps/:connectionId",element:(0,s.jsx)(Qe,{to:"permissions",replace:!0})}),(0,s.jsx)(L,{path:"apps/:connectionId/:tab",element:(0,s.jsx)(g8,{})}),(0,s.jsx)(L,{path:"company/settings/instance",element:(0,s.jsx)(Qe,{to:"/company/settings",replace:!0})}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.profile"}),children:(0,s.jsx)(L,{path:"company/settings/instance/profile",element:(0,s.jsx)(_8,{})})}),(0,s.jsx)(L,{path:"company/settings/instance/general",element:(0,s.jsx)(Qe,{to:"/company/settings",replace:!0})}),(0,s.jsx)(L,{path:"company/settings/instance/heartbeats",element:(0,s.jsx)(Qe,{to:"/company/settings",replace:!0})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.environments"}),children:[(0,s.jsx)(L,{path:"company/settings/instance/environments",element:(0,s.jsx)(Sh,{})}),(0,s.jsx)(L,{path:"company/settings/instance/environments/new",element:(0,s.jsx)(Sh,{mode:"create"})}),(0,s.jsx)(L,{path:"company/settings/instance/environments/:environmentId/edit",element:(0,s.jsx)(Sh,{mode:"edit"})})]}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.access"}),children:(0,s.jsx)(L,{path:"company/settings/instance/access",element:(0,s.jsx)(A8,{})})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.experimental"}),children:[(0,s.jsx)(L,{path:"company/settings/instance/features",element:(0,s.jsx)(w8,{})}),(0,s.jsx)(L,{path:"company/settings/instance/advanced",element:(0,s.jsx)(C8,{})}),(0,s.jsx)(L,{path:"company/settings/instance/experimental",element:(0,s.jsx)(Qe,{to:"/company/settings/instance/features",replace:!0})})]}),(0,s.jsxs)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.plugins"}),children:[(0,s.jsx)(L,{path:"company/settings/instance/plugins",element:(0,s.jsx)(E8,{})}),(0,s.jsx)(L,{path:"company/settings/instance/plugins/:pluginId",element:(0,s.jsx)(I8,{})})]}),(0,s.jsx)(L,{element:(0,s.jsx)(Aa,{pageKey:"instance.adapters"}),children:(0,s.jsx)(L,{path:"company/settings/instance/adapters",element:(0,s.jsx)(Fw,{})})}),(0,s.jsx)(L,{path:"company/settings/:settingsRoutePath/*",element:(0,s.jsx)(o8,{})}),(0,s.jsx)(L,{path:"skills/sources",element:(0,s.jsx)(qw,{})}),(0,s.jsx)(L,{path:"skills/sources/:sourceId",element:(0,s.jsx)(qw,{})}),(0,s.jsx)(L,{path:"skills/studio",element:(0,s.jsx)(Nh,{})}),(0,s.jsx)(L,{path:"skills/studio/new",element:(0,s.jsx)(Nh,{})}),(0,s.jsx)(L,{path:"skills/studio/:skillId",element:(0,s.jsx)(Nh,{})}),(0,s.jsx)(L,{path:"skills/:skillId/studio",element:(0,s.jsx)(cA,{})}),(0,s.jsx)(L,{path:"skills/*",element:(0,s.jsx)(b8,{})}),(0,s.jsx)(L,{path:"settings",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"settings/*",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"plugins/:pluginId",element:(0,s.jsx)(Hw,{})}),(0,s.jsx)(L,{path:"org",element:(0,s.jsx)(Qe,{to:"/agents/all",replace:!0})}),(0,s.jsx)(L,{path:"agents",element:(0,s.jsx)(Qe,{to:"/agents/all",replace:!0})}),rA.map(i=>(0,s.jsx)(L,{path:`agents/${i}`,element:(0,s.jsx)(R6,{})},i)),(0,s.jsx)(L,{path:"agents/new",element:(0,s.jsx)(T8,{})}),(0,s.jsx)(L,{path:"agents/:agentId",element:(0,s.jsx)(wh,{})}),(0,s.jsx)(L,{path:"agents/:agentId/:tab",element:(0,s.jsx)(wh,{})}),(0,s.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,s.jsx)(wh,{})}),(0,s.jsx)(L,{path:"projects",element:(0,s.jsx)(D6,{})}),(0,s.jsx)(L,{path:"projects/:projectId",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/overview",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(ph,{}),children:(0,s.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,s.jsx)(M6,{})})}),(0,s.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/configuration",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{path:"projects/:projectId/budget",element:(0,s.jsx)(Mr,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(ph,{}),children:(0,s.jsx)(L,{path:"workspaces",element:(0,s.jsx)(O6,{})})}),(0,s.jsx)(L,{path:"terminal",element:(0,s.jsx)(K8,{children:(0,s.jsx)(B8,{})})}),(0,s.jsx)(L,{path:"issues",element:(0,s.jsx)(L6,{})}),(0,s.jsx)(L,{path:"tasks",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"tasks/new",element:(0,s.jsx)(v6,{})}),(0,s.jsx)(L,{path:"search",element:(0,s.jsx)(z6,{})}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"issues/all",element:(0,s.jsx)(ha,{view:"all"})}),(0,s.jsx)(L,{path:"issues/active",element:(0,s.jsx)(ha,{view:"active"})}),(0,s.jsx)(L,{path:"issues/backlog",element:(0,s.jsx)(ha,{view:"backlog"})}),(0,s.jsx)(L,{path:"issues/done",element:(0,s.jsx)(ha,{view:"done"})}),(0,s.jsx)(L,{path:"issues/recent",element:(0,s.jsx)(ha,{view:"recent"})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"issues/all",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/active",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/backlog",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/done",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})}),(0,s.jsx)(L,{path:"issues/recent",element:(0,s.jsx)(Qe,{to:"/issues",replace:!0})})]}),(0,s.jsx)(L,{path:"chats",element:(0,s.jsx)(U6,{})}),(0,s.jsx)(L,{path:"chats/:agentRef",element:(0,s.jsx)($6,{})}),(0,s.jsx)(L,{path:"issues/:issueId",element:(0,s.jsx)(P6,{})}),null,(0,s.jsx)(L,{path:"routines",element:(0,s.jsx)(K6,{})}),(0,s.jsx)(L,{path:"cases",element:(0,s.jsx)(Aw,{children:(0,s.jsx)(A6,{})})}),(0,s.jsx)(L,{path:"cases/:caseIdentifier",element:(0,s.jsx)(Aw,{children:(0,s.jsx)(_6,{})})}),(0,s.jsx)(L,{path:"pixels-office",element:(0,s.jsx)(IB,{children:(0,s.jsx)(Q6,{})})}),(0,s.jsx)(L,{path:"status",element:(0,s.jsx)(_w,{children:(0,s.jsx)(Mw,{})})}),(0,s.jsx)(L,{path:"status/:cardId",element:(0,s.jsx)(_w,{children:(0,s.jsx)(Mw,{})})}),(0,s.jsx)(L,{path:"status-cards",element:(0,s.jsx)(Zw,{})}),(0,s.jsx)(L,{path:"status-cards/:cardId",element:(0,s.jsx)(Zw,{})}),(0,s.jsx)(L,{path:"review-queue",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(V6,{})})}),(0,s.jsx)(L,{path:"learnings",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(q6,{})})}),(0,s.jsx)(L,{path:"pipelines",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(kh,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(kh,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(kh,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(W6,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(F6,{})})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,s.jsx)(Gi,{children:(0,s.jsx)(H6,{})})}),(0,s.jsx)(L,{path:"routines/:routineId",element:(0,s.jsx)(Ow,{})}),(0,s.jsx)(L,{path:"routines/:routineId/:section",element:(0,s.jsx)(Ow,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(ph,{}),children:(0,s.jsxs)(L,{element:(0,s.jsx)(TB,{}),children:[(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,s.jsx)(Rl,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,s.jsx)(Rl,{})})]})}),(0,s.jsx)(L,{path:"goals",element:(0,s.jsx)(Y6,{})}),(0,s.jsx)(L,{path:"goals/:goalId",element:(0,s.jsx)(X6,{})}),(0,s.jsx)(L,{path:"artifacts",element:(0,s.jsx)(Lw,{})}),(0,s.jsx)(L,{path:"approvals",element:(0,s.jsx)(Qe,{to:"/approvals/pending",replace:!0})}),(0,s.jsx)(L,{path:"approvals/pending",element:(0,s.jsx)(zw,{})}),(0,s.jsx)(L,{path:"approvals/all",element:(0,s.jsx)(zw,{})}),(0,s.jsx)(L,{path:"approvals/:approvalId",element:(0,s.jsx)(Z6,{})}),(0,s.jsx)(L,{path:"activity",element:(0,s.jsx)(J6,{})}),(0,s.jsx)(L,{path:"activity/runs",element:(0,s.jsx)(md,{section:"runs"})}),(0,s.jsx)(L,{path:"activity/costs",element:(0,s.jsx)(md,{section:"costs"})}),(0,s.jsx)(L,{path:"activity/budgets",element:(0,s.jsx)(md,{section:"budgets"})}),(0,s.jsx)(L,{path:"activity/timeline",element:(0,s.jsx)(md,{section:"timeline"})}),(0,s.jsx)(L,{path:"audit",element:(0,s.jsx)(Va,{to:"/activity",forceAgentMode:!0})}),(0,s.jsx)(L,{path:"audit/activity",element:(0,s.jsx)(Va,{to:"/activity"})}),(0,s.jsx)(L,{path:"audit/runs",element:(0,s.jsx)(Va,{to:"/activity/runs"})}),(0,s.jsx)(L,{path:"audit/costs",element:(0,s.jsx)(Va,{to:"/activity/costs"})}),(0,s.jsx)(L,{path:"audit/budgets",element:(0,s.jsx)(Va,{to:"/activity/budgets"})}),(0,s.jsx)(L,{path:"audit/timeline",element:(0,s.jsx)(Va,{to:"/activity/timeline"})}),(0,s.jsx)(L,{path:"runs",element:(0,s.jsx)(Va,{to:"/activity/runs"})}),(0,s.jsx)(L,{path:"costs",element:(0,s.jsx)(Va,{to:"/activity/costs"})}),(0,s.jsx)(L,{path:"budgets",element:(0,s.jsx)(Va,{to:"/activity/budgets"})}),(0,s.jsxs)(L,{element:(0,s.jsx)(EB,{}),children:[(0,s.jsx)(L,{path:"board-chat",element:(0,s.jsx)(n8,{})}),(0,s.jsx)(L,{path:"artifacts",element:(0,s.jsx)(Lw,{})})]}),null,(0,s.jsx)(L,{path:"decisions",element:(0,s.jsx)(e8,{})}),(0,s.jsx)(L,{path:"decisions/queues/:key",element:(0,s.jsx)(t8,{})}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"inbox",element:(0,s.jsx)(Gw,{})}),(0,s.jsx)(L,{path:"inbox/mine",element:(0,s.jsx)(ha,{view:"mine"})}),(0,s.jsx)(L,{path:"inbox/recent",element:(0,s.jsx)(ha,{view:"recent"})}),(0,s.jsx)(L,{path:"inbox/unread",element:(0,s.jsx)(ha,{view:"unread"})}),(0,s.jsx)(L,{path:"inbox/blocked",element:(0,s.jsx)(ha,{view:"blocked"})}),(0,s.jsx)(L,{path:"inbox/all",element:(0,s.jsx)(ha,{view:"everything"})}),(0,s.jsx)(L,{path:"inbox/new",element:(0,s.jsx)(ha,{view:"mine"})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{path:"inbox",element:(0,s.jsx)(Gw,{})}),(0,s.jsx)(L,{path:"inbox/mine",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/recent",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/unread",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/blocked",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/all",element:(0,s.jsx)(tc,{})}),(0,s.jsx)(L,{path:"inbox/new",element:(0,s.jsx)(Qe,{to:"/inbox/mine",replace:!0})})]}),(0,s.jsx)(L,{path:"inbox/requests",element:(0,s.jsx)(U8,{})}),(0,s.jsx)(L,{path:"u/:userSlug",element:(0,s.jsx)(G6,{})}),(0,s.jsx)(L,{path:"design-guide",element:(0,s.jsx)(j8,{})}),(0,s.jsx)(L,{path:"instance/settings/adapters",element:(0,s.jsx)(Fw,{})}),(0,s.jsx)(L,{path:":pluginRoutePath/*",element:(0,s.jsx)(Hw,{})}),(0,s.jsx)(L,{path:"*",element:(0,s.jsx)(oA,{scope:"board"})})]})}r(q8,"boardRoutes");function Qw({credentialSource:e="wardmote_vault"}={}){const t=vn(),i=new URLSearchParams(t.search),{enabled:l,githubEnabled:c}=s0();return dT(i,{chatConnectorsEnabled:l,githubReviewBotsEnabled:c})?(0,s.jsx)(lA,{credentialSource:e}):(0,s.jsx)(Qe,{to:"/apps",replace:!0})}r(Qw,"AppsConnectEntryRoute");function Gw(){const{enabled:e}=Of();return e?(0,s.jsx)(ha,{view:PE(bj())}):(0,s.jsx)(Qe,{to:`/inbox/${bj()}`,replace:!0})}r(Gw,"InboxRootRedirect");function ha({view:e}){const t=vn(),i=new URLSearchParams(t.search);return i.set(DE,e),(0,s.jsx)(Qe,{to:`/issues?${i.toString()}${t.hash}`,replace:!0})}r(ha,"TaskViewRedirect");function cA(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=vt(),{companyPrefix:c,skillId:u}=La();if(l)return null;const m=(c?t.find(f=>f.issuePrefix.toUpperCase()===c.toUpperCase()):null)??i??t[0]??null;return!m||!u?(0,s.jsx)(Qe,{to:"/skills/studio",replace:!0}):(0,s.jsx)(Qe,{to:`/${m.issuePrefix}/skills/studio/${encodeURIComponent(u)}${e.search}${e.hash}`,replace:!0})}r(cA,"LegacySkillStudioRedirect");function Lr(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=vt(),{companyPrefix:c}=La(),{hidden:u}=lr();if(l)return(0,s.jsx)(Ra,{});const m=(c?t.find(h=>h.issuePrefix.toUpperCase()===c.toUpperCase()):null)??i??t[0]??null;if(!m)return Y0({pathname:e.pathname,hasCompanies:!1})?(0,s.jsx)(Qe,{to:"/onboarding",replace:!0}):(0,s.jsx)(J0,{});const f=_3(E3(`${e.pathname}${e.search}${e.hash}`),u);return(0,s.jsx)(Qe,{to:`/${m.issuePrefix}${f}`,replace:!0})}r(Lr,"LegacySettingsRedirect");function Yw(){const{tab:e}=La();return(0,s.jsx)(Qe,{to:uA(e),replace:!0})}r(Yw,"LegacyToolsSettingsRedirect");function Xw(){const{tab:e}=La();return(0,s.jsx)(Qe,{to:uA(e),replace:!0})}r(Xw,"LegacyToolsRedirect");function uA(e){return e?e==="applications"||e==="connections"||e==="overview"||e==="examples"||e==="runtime"||e==="audit"?"/apps":e==="policies"?"/apps/advanced/profiles":`/apps/advanced/${e}`:"/apps/advanced/profiles"}r(uA,"legacyToolsRedirectTarget");function dA(){const{companies:e}=vt(),{openOnboarding:t}=Pa(),{t:i}=aN(),{onboardingOpen:l,onboardingRouteDismissed:c}=Cf(),{companyPrefix:u}=La(),m=u?e.find(g=>g.issuePrefix.toUpperCase()===u.toUpperCase())??null:null;if(RU({onboardingOpen:l,routeDismissed:c}))return null;const f=m?`Add another agent to ${m.name}`:e.length>0?"Create another organization":"Create your first organization",h=m?"Run onboarding again to add an agent and a starter task for this organization.":e.length>0?"Run onboarding again to create another organization and seed its first agent.":"Get started by creating an organization and your first agent.";return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:f}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:h}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(le,{onClick:r(()=>m?t({initialStep:HC(),companyId:m.id}):t(),"onClick"),children:m?"Add Agent":"Start Onboarding"})})]})})}r(dA,"OnboardingRoutePage");function F8(){const{companies:e,selectedCompany:t,loading:i}=vt(),l=vn();if(i)return(0,s.jsx)(Ra,{});const c=t??e[0]??null;return c?(0,s.jsx)(Qe,{to:`/${c.issuePrefix}/dashboard`,replace:!0}):Y0({pathname:l.pathname,hasCompanies:!1})?(0,s.jsx)(Qe,{to:"/onboarding",replace:!0}):(0,s.jsx)(J0,{})}r(F8,"CompanyRootRedirect");function Zw(){const{cardId:e}=La(),t=zE(),i=t?`/${t}`:"";return(0,s.jsx)(Qe,{to:`${i}/status${e?`/${e}`:""}`,replace:!0})}r(Zw,"StatusCardsLegacyRedirect");function Va({to:e,forceAgentMode:t=!1}){const i=vn(),l=new URLSearchParams(i.search);t&&l.set("mode","agents");const c=l.toString();return(0,s.jsx)(Qe,{to:`${e}${c?`?${c}`:""}${i.hash}`,replace:!0})}r(Va,"AuditCompatibilityRedirect");function Ze(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=vt();if(l)return(0,s.jsx)(Ra,{});const c=i??t[0]??null;return c?(0,s.jsx)(Qe,{to:`/${c.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):Y0({pathname:e.pathname,hasCompanies:!1})?(0,s.jsx)(Qe,{to:"/onboarding",replace:!0}):(0,s.jsx)(J0,{})}r(Ze,"UnprefixedBoardRedirect");function J0(){const{openOnboarding:e}=Pa(),{t}=aN();return(0,s.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,s.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold",children:t("app.noCompanies.title",{defaultValue:"Create your first organization"})}),(0,s.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:t("app.noCompanies.description",{defaultValue:"Get started by creating an organization."})}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(le,{onClick:r(()=>e(),"onClick"),children:t("app.noCompanies.newCompany",{defaultValue:"New Organization"})})})]})})}r(J0,"NoCompaniesStartPage");function H8(){const{enabled:e}=Of();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.Suspense,{fallback:(0,s.jsx)(Ra,{}),children:(0,s.jsxs)(aE,{children:[(0,s.jsx)(L,{path:"auth",element:(0,s.jsx)(R8,{})}),(0,s.jsx)(L,{path:"board-claim/:token",element:(0,s.jsx)(D8,{})}),(0,s.jsx)(L,{path:"mcp-connect/:id",element:(0,s.jsx)(Vw,{})}),(0,s.jsx)(L,{path:"dot-connect/:id",element:(0,s.jsx)(Vw,{agentPairingOnly:!0})}),(0,s.jsx)(L,{path:"mcp-device",element:(0,s.jsx)(O8,{})}),(0,s.jsx)(L,{path:"assistant-connections",element:(0,s.jsx)(L8,{})}),(0,s.jsx)(L,{path:"cli-auth/:id",element:(0,s.jsx)(z8,{})}),(0,s.jsx)(L,{path:"invite/:token",element:(0,s.jsx)(P8,{})}),(0,s.jsx)(L,{path:"s/:token",element:(0,s.jsx)(Ww,{})}),(0,s.jsx)(L,{path:"s/:token/issues/:issueId",element:(0,s.jsx)(Ww,{})}),(0,s.jsx)(L,{element:(0,s.jsx)(Dw,{allowMembershipRequest:!0}),children:(0,s.jsx)(L,{path:"chat-identity/confirm",element:(0,s.jsx)(p8,{})})}),(0,s.jsx)(L,{path:"tests/perf/long-thread",element:(0,s.jsx)(B6,{})}),(0,s.jsx)(L,{path:"ux-lab/bootstrap-setup",element:(0,s.jsx)(i8,{})}),(0,s.jsx)(L,{path:"ux-lab/responsible-user-denial",element:(0,s.jsx)(r8,{})}),(0,s.jsx)(L,{path:"ux-lab/cross-issue-collaboration",element:(0,s.jsx)(l8,{})}),(0,s.jsxs)(L,{element:(0,s.jsx)(Dw,{}),children:[(0,s.jsx)(L,{index:!0,element:(0,s.jsx)(F8,{})}),(0,s.jsx)(L,{path:"onboarding",element:(0,s.jsx)(dA,{})}),(0,s.jsx)(L,{path:"instance",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"instance/settings",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"instance/settings/*",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"companies",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"dashboard",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"inbox/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"issues",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"tasks",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"tasks/new",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"issues/:issueId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"routines",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"routines/:routineId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"review-queue",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"learnings",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"cases",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"cases/:caseIdentifier",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pixels-office",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status/:cardId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status-cards",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"status-cards/:cardId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"artifacts",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"audit",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"audit/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"activity",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"activity/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"runs",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"costs",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"budgets",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"decisions",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"u/:userSlug",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/studio",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/studio/new",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/studio/:skillId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"skills/:skillId/studio",element:(0,s.jsx)(cA,{})}),(0,s.jsx)(L,{path:"skills/*",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"settings",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"settings/*",element:(0,s.jsx)(Lr,{})}),(0,s.jsx)(L,{path:"agents",element:(0,s.jsx)(Ze,{})}),rA.map(t=>(0,s.jsx)(L,{path:`agents/${t}`,element:(0,s.jsx)(Ze,{})},t)),(0,s.jsx)(L,{path:"agents/new",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"agents/:agentId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"agents/:agentId/:tab",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/overview",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"projects/:projectId/configuration",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"workspaces",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"terminal",element:(0,s.jsx)(Ze,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,s.jsx)(Il,{})}),(0,s.jsx)(L,{path:":companyPrefix",element:(0,s.jsx)(CB,{}),children:q8(e)}),(0,s.jsx)(L,{path:"*",element:(0,s.jsx)(oA,{scope:"global"})})]})]})}),(0,s.jsx)(x6,{}),(0,s.jsx)(K$,{})]})}r(H8,"App");var V8=class extends x.Component{static{r(this,"AppErrorBoundary")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){XC(e,{boundary:"app",componentStack:t.componentStack})}render(){const{error:e}=this.state;return e?(0,s.jsxs)("div",{className:"mx-auto flex min-h-screen max-w-2xl flex-col justify-center space-y-4 px-4 py-10",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold",children:"Wardmote hit an error"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while running the app. Reloading usually fixes this."})]}),(0,s.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",className:"inline-flex items-center rounded-md border border-line-strong bg-bg px-3 py-1.5 text-sm font-medium shadow-sm hover:bg-bg-3 hover:text-ink",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})})]}):this.props.children}};function W8(){const{data:e}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),t=e?.sentryDsn,i=e?.sentryEnvironment??void 0;return(0,x.useEffect)(()=>{if(t)return h$(t,i),()=>{g$()}},[t,i]),null}r(W8,"SentryGate");function Q8(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}r(Q8,"createDeferred");function G8(e,t=300){const i=new Map;let l=null,c=null;const u=r(async()=>{l!==null&&(clearTimeout(l),l=null);const h=c;if(c=null,i.size===0){h?.resolve();return}const g=[...i.values()];i.clear();try{await Promise.all(g.map(v=>e.invalidateQueries(ff().visible?v:{...v,refetchType:"none"})))}finally{h?.resolve()}},"flush");return{schedule:r(h=>(i.set(Y8(h),h),c===null&&(c=Q8()),l===null&&(l=setTimeout(()=>{u()},t)),c.promise),"schedule"),flush:u,dispose:r(()=>{l!==null&&(clearTimeout(l),l=null),i.clear(),c?.resolve(),c=null},"dispose")}}r(G8,"createInvalidationBatcher");var Jw=0;function Y8(e){if(typeof e.predicate=="function")return`__predicate__:${Jw+=1}`;try{return JSON.stringify([e.queryKey??null,e.refetchType??null,e.exact??null,e.type??null])}catch{return`__nonserializable__:${Jw+=1}`}}r(Y8,"serializeFilters");function X8(e,t){return new Proxy(e,{get(i,l){if(l==="invalidateQueries")return u=>t.schedule(u??{});const c=Reflect.get(i,l,i);return typeof c=="function"?c.bind(i):c}})}r(X8,"createCoalescingQueryClient");function Z8(e,t){if(!e)return e;const i=e.filter(l=>l.id!==t);return i.length===e.length?e:i}r(Z8,"removeRunFromList");function J8(e,t,i){if(!e)return{next:e,present:!1};let l=!1,c=!1;const u=e.map(m=>m.id!==t||(l=!0,m.status===i)?m:(c=!0,{...m,status:i}));return{next:c?u:e,present:l}}r(J8,"patchRunStatusInList");function eK(e,t){if(!e)return e;const i=e.filter(l=>l.id!==t);return i.length===e.length?e:i}r(eK,"removeLiveRunById");function tK(e,t){return!e||e.executionRunId!==t?e:{...e,executionRunId:null,executionAgentNameKey:null,executionLockedAt:null}}r(tK,"clearIssueExecutionRun");var nK=3e4,sK=["status","priority","title","assigneeAgentId","assigneeUserId","projectId","parentId"],aK=new Set(["issue.read_marked","issue.read_unmarked","issue.inbox_archived","issue.inbox_unarchived"]);function Rg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(Rg,"isRecord");function ex(e){return Rg(e)&&Array.isArray(e.pages)}r(ex,"isInfiniteIssueData");function iK(e){return Array.isArray(e)?e.length:ex(e)?e.pages.reduce((t,i)=>t+(Array.isArray(i)?i.length:0),0):0}r(iK,"issueListRowCount");function rK(e){const t=e.state.data;return ex(t)||iK(t)>=100}r(rK,"isLargeIssueListQuery");function lK(e,t,i){const l={},c=Rg(t?.changes)?t.changes:null;if(e==="issue.updated"&&c)for(const u of sK){const m=c[u];!Rg(m)||m.updated===!0||!("to"in m)||(l[u]=m.to)}return i&&e&&!aK.has(e)&&!Number.isNaN(Date.parse(i))&&(l.lastActivityAt=i),l}r(lK,"readIssueListPatchFromActivity");function oK(e,t){let i=null;for(const[l,c]of Object.entries(t)){if(l==="lastActivityAt"){const u=e.lastActivityAt?new Date(e.lastActivityAt).getTime():0;if(new Date(c).getTime()<=u)continue}else if(!(l in e)||e[l]===c)continue;i??={...e},i[l]=c}return i??e}r(oK,"patchIssueRow");function ek(e,t,i){const l=e.findIndex(m=>m?.id===t);if(l<0)return e;const c=oK(e[l],i);if(c===e[l])return e;const u=e.slice();return u[l]=c,u}r(ek,"patchIssueRows");function cK(e,t,i){if(Array.isArray(e))return ek(e,t,i);if(!ex(e))return e;let l=!1;const c=e.pages.map(u=>{if(!Array.isArray(u))return u;const m=ek(u,t,i);return m!==u&&(l=!0),m});return l?{...e,pages:c}:e}r(cK,"patchIssueListData");function uK(e,t,i,l){if(Object.keys(l).length===0)return 0;let c=0;for(const[u,m]of e.getQueriesData({queryKey:U.issues.list(t)})){const f=cK(m,i,l);f!==m&&(e.setQueryData(u,f),c+=1)}return c}r(uK,"patchIssueInListCaches");function dK(e,t){for(const i of e.getQueryCache().findAll({queryKey:U.issues.list(t)}))e.invalidateQueries({queryKey:i.queryKey,exact:!0,...rK(i)?{refetchType:"none"}:{}})}r(dK,"invalidateIssueListsForActivity");function fK(e,t){const i=r(l=>l.state.isInvalidated,"predicate");return Promise.all([e.refetchQueries({queryKey:U.issues.list(t),type:"active",predicate:i}),e.refetchQueries({queryKey:U.heartbeats(t),type:"active",predicate:i})])}r(fK,"refreshInvalidatedLiveLists");function Bl(e){return typeof e=="string"&&e.length>0?e:null}r(Bl,"readString$1");function mK(e){return e.length===3&&e[0]==="issues"&&e[2]==="agent-todo"}r(mK,"isAgentTodoQueryKey");function pK(e){if(e.type!=="heartbeat.run.event")return null;const t=e.payload??{};if(t.eventType!=="agent.todo")return null;const i=Bl(t.runId),l=Bl(t.agentId),c=Bl(t.issueId),u=t.seq;if(!i||!l||!c||typeof u!="number"||!Number.isInteger(u))return null;const m=q_(t.payload);return m?{...m,runId:i,agentId:l,issueId:c,seq:u,createdAt:Bl(t.lastEventAt)??e.createdAt,runStatus:"running"}:null}r(pK,"readAgentTodoSnapshotFromLiveEvent");function tk(e,t){if(t.type==="heartbeat.run.status"){const l=t.payload??{},c=Bl(l.runId),u=Bl(l.status);if(!c||!u)return;e.setQueriesData({predicate:r(m=>mK(m.queryKey),"predicate")},m=>m&&m.runId===c&&m.runStatus!==u?{...m,runStatus:u}:m);return}const i=pK(t);i&&e.setQueryData(U.issues.agentTodo(i.issueId),l=>l&&l.runId===i.runId&&l.seq>=i.seq?l:i)}r(tk,"applyAgentTodoLiveEvent");function hK(e){const t=e.trim().toLowerCase();return t==="0.0.0.0"||t==="::"||t==="[::]"}r(hK,"isWildcardHost");function gK(e=window.location){return hK(e.hostname)?e.port?`localhost:${e.port}`:"localhost":e.host}r(gK,"browserReachableHost");function xK(e,t=window.location){const i=t.protocol==="https:"?"wss":"ws",l=e.startsWith("/")?e:`/${e}`;return`${i}://${gK(t)}${l}`}r(xK,"buildSameOriginWebSocketUrl");function bK(e){try{return new WebSocket(e)}catch{return null}}r(bK,"tryCreateWebSocket");var vK="/pwa-192x192.png",yK="/pwa-monochrome-512x512.png";function tx(){return typeof window<"u"&&"Notification"in window}r(tx,"notificationsSupported");function nx(){return tx()?Notification.permission:"unsupported"}r(nx,"notificationPermission");async function jK(){return tx()?Notification.permission!=="default"?Notification.permission:Notification.requestPermission():"unsupported"}r(jK,"requestNotificationPermission");function wK(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window}r(wK,"pushSupported");function NG(e=typeof navigator>"u"?void 0:navigator){return e?(/iPad|iPhone|iPod/.test(e.userAgent)||e.platform==="MacIntel"&&(e.maxTouchPoints??0)>1)&&e.standalone!==!0:!1}r(NG,"isIosWithoutHomeScreenInstall");async function fA(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{return await navigator.serviceWorker.getRegistration()??null}catch{return null}}r(fA,"getServiceWorkerRegistration");var mA="wardmote.notifications.seen.v1",kK="wardmote.notifications.claim",SK=6e5,NK=200,CK=new Map;function AK(){let e=null;try{e=typeof localStorage>"u"?null:localStorage}catch{e=null}const t=typeof navigator<"u"&&navigator.locks?{request:r((i,l)=>navigator.locks.request(i,l),"request")}:null;return{storage:e,locks:t,now:r(()=>Date.now(),"now"),memory:CK}}r(AK,"defaultEnv");function _K(e){const t=e.storage?.getItem(mA);if(!t)return new Map(e.memory);try{const i=JSON.parse(t),l=new Map(e.memory);for(const[c,u]of Object.entries(i))typeof u=="number"&&l.set(c,u);return l}catch{return new Map(e.memory)}}r(_K,"readSeen");function Ch(e,t){const i=t.now(),l=_K(t);for(const[u,m]of l)i-m>SK&&l.delete(u);if(l.has(e))return!1;l.set(e,i);const c=[...l.entries()].sort((u,m)=>m[1]-u[1]).slice(0,NK);t.memory.clear();for(const[u,m]of c)t.memory.set(u,m);return EK(t,c),!0}r(Ch,"claimInsideLock");function EK(e,t){try{e.storage?.setItem(mA,JSON.stringify(Object.fromEntries(t)))}catch{return}}r(EK,"writeSeen");async function IK(e,t=AK()){if(!t.locks)return Ch(e,t);try{return await t.locks.request(kK,()=>Ch(e,t))}catch{return Ch(e,t)}}r(IK,"claimNotificationKey");var Ah="paperclip-notifications";function _h(e){return new Promise((t,i)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>i(e.error)})}r(_h,"settle");function TK(e){return new Promise((t,i)=>{e.oncomplete=()=>t(),e.onerror=()=>i(e.error),e.onabort=()=>i(e.error)})}r(TK,"committed");async function RK(e,t){if(typeof indexedDB.databases!="function"||!(await indexedDB.databases()).some(c=>c.name===Ah))return 0;const i=await _h(indexedDB.open(Ah));let l=0;try{if(i.objectStoreNames.contains(t)){const c=await _h(i.transaction(t,"readonly").objectStore(t).getAll()),u=new Set(await _h(e.transaction(t,"readonly").objectStore(t).getAllKeys())),m=c.filter(f=>!u.has(f.kind));if(m.length>0){const f=e.transaction(t,"readwrite"),h=f.objectStore(t);for(const g of m)h.put(g);await TK(f),l=m.length}}}finally{i.close()}return indexedDB.deleteDatabase(Ah),l}r(RK,"moveRetiredCustomSounds");var DK="wardmote-notifications",fc="custom-sounds";function MK(e){return e.type.startsWith("audio/")?e.size<=0?{ok:!1,error:"The audio file is empty."}:e.size>524288?{ok:!1,error:"Custom sounds must be 512 KB or smaller."}:{ok:!0}:{ok:!1,error:"Choose an audio file."}}r(MK,"validateCustomSoundFile");function pA(e){return new Promise((t,i)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>i(e.error)})}r(pA,"requestResult");var pd=null;function OK(){if(typeof indexedDB>"u")return Promise.reject(new Error("IndexedDB is unavailable."));if(!pd){const e=indexedDB.open(DK,1);e.onupgradeneeded=()=>{e.result.objectStoreNames.contains(fc)||e.result.createObjectStore(fc,{keyPath:"kind"})},pd=pA(e).then(async t=>(await RK(t,fc).catch(()=>0),t)).catch(t=>{throw pd=null,t})}return pd}r(OK,"openDb");async function sx(e,t){return pA(t((await OK()).transaction(fc,e).objectStore(fc)))}r(sx,"withStore");var Dg=new Set;function LK(e){return Dg.add(e),()=>Dg.delete(e)}r(LK,"subscribeCustomSounds");function hA(){for(const e of Dg)e()}r(hA,"notifyCustomSoundsChanged");async function CG(e,t){const i=MK(t);if(!i.ok)throw new Error(i.error);const l={kind:e,name:t.name,type:t.type,size:t.size,blob:t,updatedAt:new Date().toISOString()};return await sx("readwrite",c=>c.put(l)),hA(),l}r(CG,"saveCustomSound");async function zK(e){try{return await sx("readonly",t=>t.get(e))??null}catch{return null}}r(zK,"loadCustomSound");async function AG(e){await sx("readwrite",t=>t.delete(e)),hA()}r(AG,"removeCustomSound");var PK=[{id:"confirmation",label:"Confirmation"},{id:"question",label:"Question"},{id:"glass",label:"Glass"},{id:"bong",label:"Bong"},{id:"maximize",label:"Rise"},{id:"pluck",label:"Pluck"},{id:"error",label:"Alert"},{id:"drop",label:"Drop"},{id:"select",label:"Select"},{id:"open",label:"Open"}],_G="custom",EG="none",Mg={approval:"confirmation",question:"question",comment:"pluck",assignment:"maximize",review:"glass",run_failed:"error",join_request:"bong",disk_space:"drop"},IG={approval:"Approvals",question:"Agent questions",comment:"Comments",assignment:"Assignments",review:"Ready for review",run_failed:"Failed runs",join_request:"Join requests",disk_space:"Low disk space"},gA=new Set(PK.map(e=>e.id));function UK(e){return typeof e=="string"&&(gA.has(e)||e==="custom"||e==="none")}r(UK,"isKnownSoundId");function $K(e){return gA.has(e)}r($K,"isLibrarySoundId");function nk(e,t){return`/sounds/${e}.${t}`}r(nk,"librarySoundUrl");var Og=new Map,af=new Map,sk=!1,hd=null;function xA(){return typeof Audio<"u"}r(xA,"audioSupported");function ak(){return hd||(hd=new Audio().canPlayType('audio/ogg; codecs="vorbis"')?"ogg":"mp3",hd)}r(ak,"libraryFormat");function bA(e){let t=Og.get(e);return t||(t=new Audio,t.preload="auto",t.src=e,Og.set(e,t)),t}r(bA,"audioFor");function BK(){for(const e of af.values())e.then(t=>{t&&(Og.delete(t),URL.revokeObjectURL(t))});af.clear()}r(BK,"revokeCustomSounds");function KK(e){sk||(sk=!0,LK(BK));let t=af.get(e);return t||(t=zK(e).then(i=>i?URL.createObjectURL(i.blob):null),af.set(e,t)),t}r(KK,"customSoundUrl");async function vA(e,t){if(t==="none")return null;if(t==="custom"){const i=await KK(e);return i||nk(Mg[e],ak())}return nk($K(t)?t:Mg[e],ak())}r(vA,"resolveSoundUrl");async function qK(e,t,i){if(!xA())return!1;const l=await vA(e,t);if(!l)return!1;const c=bA(l);c.volume=Math.min(1,Math.max(0,i)),c.currentTime=0;try{return await c.play(),!0}catch{return!1}}r(qK,"playSound");function FK(e,t){return qK(e,t.kinds[e].soundId,t.volume)}r(FK,"playKindSound");function ik(e){if(!(!xA()||!e.enabled))for(const[t,i]of Object.entries(e.kinds))i.enabled&&vA(t,i.soundId).then(l=>{l&&bA(l)})}r(ik,"preloadNotificationSounds");var Lg={getWebPushConfig:r(()=>we.get("/notifications/web-push/config"),"getWebPushConfig"),upsertWebPushSubscription:r(e=>we.put("/notifications/web-push/subscription",e),"upsertWebPushSubscription"),deleteWebPushSubscription:r(e=>we.deleteWithBody("/notifications/web-push/subscription",e),"deleteWebPushSubscription"),sendWebPushTest:r(()=>we.post("/notifications/web-push/test",{}),"sendWebPushTest")},yA="wardmote.notifications.v1",HK=.6;function zg(){const e={};for(const t of Yg)e[t]={enabled:!0,soundId:Mg[t]};return{enabled:!0,volume:HK,pushEnabled:!0,kinds:e}}r(zg,"defaultNotificationSettings");function Eh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}r(Eh,"asRecord");function jA(e){const t=zg(),i=Eh(e);if(!i)return t;const l=typeof i.volume=="number"&&Number.isFinite(i.volume)?Math.min(1,Math.max(0,i.volume)):t.volume,c=Eh(i.kinds)??{},u={...t.kinds};for(const m of Yg){const f=Eh(c[m]);f&&(u[m]={enabled:typeof f.enabled=="boolean"?f.enabled:t.kinds[m].enabled,soundId:UK(f.soundId)?f.soundId:t.kinds[m].soundId})}return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,volume:l,pushEnabled:typeof i.pushEnabled=="boolean"?i.pushEnabled:t.pushEnabled,kinds:u}}r(jA,"normalizeNotificationSettings");function rf(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}r(rf,"storage");function VK(){const e=rf()?.getItem(yA);if(!e)return zg();try{return jA(JSON.parse(e))}catch{return zg()}}r(VK,"readStored");var lf,sc=null,Ad=new Set,gd=!1;function Vr(){const e=rf()?.getItem("wardmote.notifications.v1")??null;return sc&&e===lf||(lf=e,sc=VK()),sc}r(Vr,"getNotificationSettings");function wA(){for(const e of Ad)e()}r(wA,"notify");function kA(e){const t=jA(typeof e=="function"?e(Vr()):e);try{rf()?.setItem(yA,JSON.stringify(t))}catch{lf=void 0}return sc=t,lf=rf()?.getItem("wardmote.notifications.v1")??null,wA(),t}r(kA,"setNotificationSettings");function TG(e,t){return kA(i=>({...i,kinds:{...i.kinds,[e]:{...i.kinds[e],...t}}}))}r(TG,"updateKindSettings");function WK(e){return e.enabled?Yg.filter(t=>e.kinds[t].enabled):[]}r(WK,"enabledNotificationKinds");function rk(e){e.key!==null&&e.key!=="wardmote.notifications.v1"||wA()}r(rk,"onStorage");function SA(e){return Ad.add(e),!gd&&typeof window<"u"&&(gd=!0,window.addEventListener("storage",rk)),()=>{Ad.delete(e),Ad.size===0&&gd&&typeof window<"u"&&(gd=!1,window.removeEventListener("storage",rk))}}r(SA,"subscribeNotificationSettings");function RG(){return(0,x.useSyncExternalStore)(SA,Vr,Vr)}r(RG,"useNotificationSettings");var mc={status:"unknown",error:null},Pg=new Set,Ug=null,lk=Promise.resolve();function ok(e){if(!(e.status===mc.status&&e.error===mc.error)){mc=e;for(const t of Pg)t()}}r(ok,"setPushState");function ck(){return mc}r(ck,"getPushState");function QK(){return mc.status==="active"}r(QK,"hasActivePushSubscription");function GK(e){return Pg.add(e),()=>Pg.delete(e)}r(GK,"subscribePushState");function DG(){return(0,x.useSyncExternalStore)(GK,ck,ck)}r(DG,"usePushState");function NA(e){const t=e.padEnd(e.length+(4-e.length%4)%4,"=").replace(/-/g,"+").replace(/_/g,"/"),i=atob(t),l=new Uint8Array(new ArrayBuffer(i.length));for(let c=0;c<i.length;c+=1)l[c]=i.charCodeAt(c);return l}r(NA,"urlBase64ToUint8Array");function YK(e,t){const i=e.options?.applicationServerKey;if(!i)return!0;const l=NA(t),c=new Uint8Array(i);return c.length===l.length&&c.every((u,m)=>u===l[m])}r(YK,"sameApplicationServerKey");async function uk(e){await Lg.deleteWebPushSubscription({endpoint:e.endpoint}).catch(()=>{}),await e.unsubscribe().catch(()=>!1),Ug=null}r(uk,"forgetSubscription");async function XK(e,t){if(!wK())return{status:"unsupported",error:null};const i=await fA();if(!i)return{status:"unsupported",error:null};let l=await i.pushManager.getSubscription();if(!(e.enabled&&e.pushEnabled))return l&&await uk(l),{status:"off",error:null};if(nx()!=="granted")return{status:"permission",error:null};const c=await Lg.getWebPushConfig();if(!c.enabled||!c.publicKey)return{status:"server-disabled",error:null};l&&!YK(l,c.publicKey)&&(await uk(l),l=null),l||(l=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:NA(c.publicKey)}));const u=l.toJSON(),m=u.keys?.p256dh,f=u.keys?.auth;if(!m||!f)return{status:"error",error:"The browser returned an incomplete push subscription."};const h=WK(e),g=[t,l.endpoint,...h].join("|");return g!==Ug&&(await Lg.upsertWebPushSubscription({endpoint:l.endpoint,keys:{p256dh:m,auth:f},kinds:h}),Ug=g),{status:"active",error:null}}r(XK,"reconcile");function $g(e,t){const i=lk.then(async()=>{try{const l=await XK(e,t);return ok(l),l}catch(l){const c={status:"error",error:l instanceof Error?l.message:"Push subscription failed."};return ok(c),c}});return lk=i.catch(()=>{}),i}r($g,"syncPushSubscription");function CA(e,t){return t.enabled&&t.kinds[e.kind]?.enabled===!0}r(CA,"kindEnabled");function ZK(e){const{payload:t,userId:i,settings:l}=e;return!i||!t.recipientUserIds.includes(i)||!CA(t.notification,l)?"none":e.visible?"sound":e.pushActive?"none":"os"}r(ZK,"decideLiveNotification");function JK(e){return!e.visible||!CA(e.notification,e.settings)?"none":"sound"}r(JK,"decideServiceWorkerNotification");async function eq(e){if(nx()!=="granted")return;const t={body:e.body,tag:e.key,data:{url:e.url},icon:vK,badge:yK},i=await fA();if(i){await i.showNotification(e.title,t);return}new Notification(e.title,t)}r(eq,"showOsNotification");var AA={claim:r(e=>IK(e),"claim"),playSound:r((e,t)=>FK(e.kind,t),"playSound"),showOsNotification:eq};async function _A(e,t,i,l){return e==="none"?e:await l.claim(t.key)?(e==="sound"?await l.playSound(t,i):await l.showOsNotification(t),e):"none"}r(_A,"perform");function tq(e,t,i=AA,l={}){const c=l.settings??Vr();return _A(ZK({payload:e,userId:t,settings:c,visible:l.visible??ff().visible,pushActive:l.pushActive??QK()}),e.notification,c,i)}r(tq,"deliverLiveNotification");function nq(e,t=AA,i={}){const l=i.settings??Vr();return _A(JK({notification:e,settings:l,visible:i.visible??ff().visible}),e,l,t)}r(nq,"deliverServiceWorkerNotification");function EA(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.key=="string"&&typeof t.kind=="string"&&typeof t.title=="string"?t:null}r(EA,"readNotification");function sq(e){if(!e||typeof e!="object")return null;const t=e,i=EA(t.notification);return!i||!Array.isArray(t.recipientUserIds)?null:{notification:i,recipientUserIds:t.recipientUserIds.filter(l=>typeof l=="string")}}r(sq,"readNotificationCreatedPayload");function aq(e){if(!e||typeof e!="object")return null;const t=e;if(t.type==="wardmote.notification"){const i=EA(t.notification);return i?{type:"notification",notification:i}:null}return t.type==="wardmote.navigate"&&typeof t.url=="string"&&t.url.startsWith("/")?{type:"navigate",url:t.url}:null}r(aq,"readServiceWorkerMessage");var iq=1e4,rq=3,lq=2e3,oq=3e5,cq=2e3,uq=15e3,dq=0,fq=1,Ec=new Set(["succeeded","interrupted","failed","cancelled","timed_out"]),IA=(0,x.createContext)(null);function mq(e,t,i){if(i.companyId===t)for(const l of Array.from(e))try{l(i)}catch{}}r(mq,"dispatchLiveEventToSubscribers");function MG(e){const t=(0,x.useContext)(IA),i=(0,x.useRef)(e);(0,x.useEffect)(()=>{i.current=e}),(0,x.useEffect)(()=>{if(t)return t.subscribe(l=>{i.current(l)})},[t])}r(MG,"useCompanyLiveEvent");function be(e){return typeof e=="string"&&e.length>0?e:null}r(be,"readString");function Xr(e){return typeof e!="object"||e===null||Array.isArray(e)?null:e}r(Xr,"readRecord");function of(e){return e.slice(0,8)}r(of,"shortId");function TA(e,t,i){const l=e.getQueryData(U.agents.list(t))?.find(c=>c.id===i);return l?.name?l.name:e.getQueryData(U.agents.detail(i))?.name??null}r(TA,"resolveAgentName");function pq(e,t,i){const l=e.getQueryData(U.access.companyUserDirectory(t));if(!l)return null;const c=l.users.find(u=>u.principalId===i);return c?.user?.name?.trim()||c?.user?.email?.trim()||null}r(pq,"resolveUserName");function zr(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}r(zr,"truncate");function hq(e,t,i,l){return i==="agent"&&l?TA(e,t,l)??`Agent ${of(l)}`:i==="system"?"System":i==="user"&&l?pq(e,t,l)??(l==="board"||l==="local-board"?"Board":`User ${of(l)}`):i==="plugin"?"Plugin":"Unknown actor"}r(hq,"resolveActorLabel");function ax(e,t,i,l){const c=new Set([i]),u=e.getQueryData(U.issues.detail(i)),m=e.getQueryData(U.issues.list(t)),f=be(l?.identifier)??be(l?.issueIdentifier);f&&c.add(f),u?.id&&c.add(u.id),u?.identifier&&c.add(u.identifier);const h=m?.find(g=>!!(g.id===i||g.identifier&&g.identifier===i||f&&g.identifier===f));return h?.id&&c.add(h.id),h?.identifier&&c.add(h.identifier),Array.from(c)}r(ax,"resolveIssueQueryRefs");function gq(e,t,i,l){const c=ax(e,t,i,l),u=c.map(v=>e.getQueryData(U.issues.detail(v))).find(v=>!!v),m=e.getQueryData(U.issues.list(t))?.find(v=>c.some(y=>v.id===y||v.identifier===y)),f=u??m??null,h=be(l?.identifier)??be(l?.issueIdentifier)??f?.identifier??`Task ${of(i)}`,g=be(l?.title)??be(l?.issueTitle)??f?.title??null;return{ref:h,title:g,label:g?`${h} - ${zr(g,72)}`:h,href:`/issues/${f?.identifier??i}`}}r(gq,"resolveIssueToastContext");function RA(){return!(typeof document>"u"||document.visibilityState!=="visible"||typeof document.hasFocus=="function"&&!document.hasFocus())}r(RA,"isPageForegrounded");function or(e,t,i){if(!(i?.isForegrounded??RA()))return null;const l=pf(t).split("/").filter(Boolean);if(!["issues","chats"].includes(l[0])||!l[1])return null;let c=decodeURIComponent(l[1]);if(l[0]==="chats"){const j=e.getQueryData(U.auth.session),k=j?.user?.id??j?.session?.userId??null,S=Gk(t),N=e.getQueryData(U.companies.list(k))?.companies.find(D=>D.issuePrefix.toUpperCase()===S?.toUpperCase());if(!N)return null;const _=e.getQueryData(U.agents.list(N.id))?.find(D=>D.id===c||ar(D)===c);if(!_)return null;const I=e.getQueryData(U.agentChats.detail(N.id,k,_.id));if(!I)return null;c=I.id}const u=e.getQueryData(U.issues.detail(c))??null,m=new Set([c]);u?.id&&m.add(u.id),u?.identifier&&m.add(u.identifier);function f(j,k){const S=e.getQueryData(U.issues.activeRun(j)),N=e.getQueryData(U.issues.liveRuns(j))??[],_=e.getQueryData(U.issues.runs(j))??[];S?.id&&k.add(S.id);for(const I of N)I.id&&k.add(I.id);for(const I of _)I.runId&&k.add(I.runId)}r(f,"collectCachedIssueRunIds");const h=new Set;for(const j of m)f(j,h);const g=new Set(m),v=new Set,y=new Set(h);if(u?.companyId&&u.id){const j=e.getQueryData(U.issues.listByDescendantRoot(u.companyId,u.id))??[];for(const k of j)g.add(k.id),k.identifier&&g.add(k.identifier),k.assigneeAgentId&&v.add(k.assigneeAgentId),k.executionRunId&&y.add(k.executionRunId),f(k.id,y),k.identifier&&f(k.identifier,y)}if(u?.companyId){const j=e.getQueryData(U.liveRuns(u.companyId))??[];for(const k of j)k.issueId&&g.has(k.issueId)&&y.add(k.id)}return{routeIssueRef:c,issueRefs:m,assigneeAgentId:u?.assigneeAgentId??null,runIds:h,subtreeIssueRefs:g,subtreeAgentIds:v,subtreeRunIds:y}}r(or,"resolveVisibleIssueRouteContext");function Uf(e,t){const i=new Set([e]),l=be(t?.identifier)??be(t?.issueIdentifier);return l&&i.add(l),i}r(Uf,"buildIssueRefsForPayload");function $f(e,t){for(const i of e)if(t.has(i))return!0;return!1}r($f,"overlaps");function xq(e,t,i,l){const c=be(i.entityType),u=be(i.entityId);if(c!=="issue"||!u)return!1;const m=or(e,t,l);return m?$f(m.subtreeIssueRefs,Uf(u,Xr(i.details))):!1}r(xq,"shouldSuppressActivityToastForVisibleIssue");function bq(e,t,i,l){if(!(l?.isForegrounded??RA()))return!1;const c=pf(t).match(/^\/agents\/[^/]+\/runs\/([^/]+)/)?.[1];if(c&&decodeURIComponent(c)===be(i.runId))return!0;const u=or(e,t,l);if(!u)return!1;const m=be(i.issueId);if(m)return u.subtreeIssueRefs.has(m);const f=be(i.runId);if(f)return u.subtreeRunIds.has(f);const h=be(i.agentId);return!!h&&(h===u.assigneeAgentId||u.subtreeAgentIds.has(h))}r(bq,"shouldSuppressRunStatusToastForVisibleIssue");function dk(e,t,i,l){const c=or(e,t,l);if(!c)return!1;const u=be(i.runId),m=be(i.agentId);if(!(u!==null&&c.runIds.has(u)||m&&c.assigneeAgentId&&m===c.assigneeAgentId))return!1;const f=be(i.status);if(u&&f&&Ec.has(f))for(const v of c.issueRefs)e.invalidateQueries({queryKey:U.issues.comments(v)}),e.setQueryData(U.issues.liveRuns(v),y=>eK(y,u)),e.setQueryData(U.issues.activeRun(v),y=>y?.id===u?null:y),e.setQueryData(U.issues.detail(v),y=>tK(y,u));const h=!!f&&Ec.has(f),g=!h&&(l?.liveStatusAlreadyPatched??!1);for(const v of c.issueRefs)e.invalidateQueries({queryKey:U.issues.detail(v)}),e.invalidateQueries({queryKey:U.issues.activity(v)}),e.invalidateQueries({queryKey:U.issues.runs(v)}),l?.runLifecycleEvent&&e.invalidateQueries({queryKey:U.issues.queuedComments(v)}),g||(e.invalidateQueries({queryKey:U.issues.liveRuns(v)}),e.invalidateQueries({queryKey:U.issues.activeRun(v)})),h&&(e.invalidateQueries({queryKey:U.issues.comments(v)}),e.invalidateQueries({queryKey:U.issues.attachments(v)}),e.invalidateQueries({queryKey:U.issues.workProducts(v)}),e.invalidateQueries({queryKey:U.issues.workProductPullRequestRefresh(v)}),e.invalidateQueries({queryKey:["issues","tree-control-state",v]}));return!0}r(dk,"invalidateVisibleIssueRunQueries");function nc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(nc,"hasPatchKey");function DA(e,t){return e.id!==t.runId?e:{...e,...nc(t,"message")?{currentStatusMessage:t.message}:{},...nc(t,"updatedAt")?{currentStatusUpdatedAt:t.updatedAt}:{},...nc(t,"currentToolName")?{currentToolName:t.currentToolName}:{},...nc(t,"lastAssistantSnippet")?{lastAssistantSnippet:t.lastAssistantSnippet}:{},...nc(t,"lastEventAt")?{lastEventAt:t.lastEventAt}:{}}}r(DA,"applyRunLiveStatusPatch");function fk(e,t){if(!e)return e;let i=!1;const l=e.map(c=>c.id!==t.runId?c:(i=!0,DA(c,t)));return i?l:e}r(fk,"applyRunLiveStatusPatchToArray");function vq(e,t,i){const l=be(e.runId);if(!l)return null;const c={runId:l,agentId:be(e.agentId),issueId:be(e.issueId)};if(i==="heartbeat.run.progress")return c.message=be(e.message),c.updatedAt=be(e.updatedAt)??t,c.currentToolName=be(e.currentToolName),c.lastAssistantSnippet=be(e.lastAssistantSnippet),c.lastEventAt=be(e.lastEventAt)??c.updatedAt,c;if(i==="heartbeat.run.log")return c.lastEventAt=be(e.ts)??t,c;if(i==="heartbeat.run.event"){const u=be(e.message);u&&(c.message=u),c.updatedAt=be(e.updatedAt)??t;const m=be(e.currentToolName);m&&(c.currentToolName=m);const f=be(e.lastAssistantSnippet);return f&&(c.lastAssistantSnippet=f),c.lastEventAt=be(e.lastEventAt)??t,c}return null}r(vq,"readRunLiveStatusPatchFromPayload");var yq=1e3;function jq(e=yq){const t=new Map,i=new Map,l=r(c=>{const u=t.get(c);if(!u){i.delete(c);return}t.delete(c),i.set(c,setTimeout(()=>l(c),e)),u.apply(u.patch)},"release");return{submit:r((c,u)=>{if(i.has(c.runId)){t.set(c.runId,{patch:c,apply:u});return}i.set(c.runId,setTimeout(()=>l(c.runId),e)),u(c)},"submit"),dispose:r(()=>{for(const c of i.values())clearTimeout(c);i.clear(),t.clear()},"dispose")}}r(jq,"createRunLogPatchThrottle");function wq(e,t,i,l,c){let u=!1;e.setQueryData(U.liveRuns(t),h=>{const g=fk(h,l);return g!==h&&(u=!0),g});const m=new Set;if(l.issueId)for(const h of ax(e,t,l.issueId,null))m.add(h);const f=or(e,i,c);if(f&&(f.runIds.has(l.runId)||l.issueId&&f.issueRefs.has(l.issueId)||l.agentId&&f.assigneeAgentId&&l.agentId===f.assigneeAgentId))for(const h of f.issueRefs)m.add(h);for(const h of m)e.setQueryData(U.issues.activeRun(h),g=>!g||g.id!==l.runId?g:(u=!0,DA(g,l))),e.setQueryData(U.issues.liveRuns(h),g=>{const v=fk(g,l);return v!==g&&(u=!0),v});return u}r(wq,"applyRunLiveStatusPatchToCaches");function kq(e,t,i,l){const c=or(e,t,l);if(!c)return!1;const u=be(i.agentId);return!!u&&(u===c.assigneeAgentId||c.subtreeAgentIds.has(u))}r(kq,"shouldSuppressAgentStatusToastForVisibleIssue");function Sq(e,t,i,l){const c=be(i.entityType),u=be(i.entityId),m=be(i.actorType),f=be(i.action),h=Xr(i.details);if(c!=="issue"||!u||m!=="agent"&&m!=="system"||f!=="issue.updated"||be(h?.source)==="comment")return!1;const g=or(e,t,l);return g?$f(g.issueRefs,Uf(u,h)):!1}r(Sq,"shouldDeferIssueRefetchForVisibleAgentActivity");function MA(e,t,i,l){const c=be(i.entityType),u=be(i.entityId),m=be(i.action),f=Xr(i.details);if(c!=="issue"||!u||m!=="issue.comment_added")return!1;const h=or(e,t,l);return h?$f(h.issueRefs,Uf(u,f)):!1}r(MA,"shouldDeferVisibleIssueCommentActivity");async function Nq(e,t,i,l){const c=be(i.entityType),u=be(i.action),m=Xr(i.details),f=be(m?.commentId);if(c!=="issue"||u!=="issue.comment_added"||!f)return!1;const h=or(e,t,l);if(!h)return!1;const g=be(i.entityId);if(!g||!$f(h.issueRefs,Uf(g,m)))return!1;try{const v=await hn.getComment(h.routeIssueRef,f);for(const y of h.issueRefs)e.setQueryData(U.issues.comments(y),j=>j?{...j,pages:ME(j.pages,v)}:{pages:[[v]],pageParams:[null]});return!0}catch{for(const v of h.issueRefs)e.invalidateQueries({queryKey:U.issues.comments(v)});return!1}}r(Nq,"hydrateVisibleIssueComment");var Cq=new Set(["issue.created","issue.updated","issue.comment_added"]),mk=new Set(["issue.document_created","issue.document_updated","issue.document_restored","issue.document_deleted"]),Aq=new Set(["issue.document_annotation_thread_created","issue.document_annotation_comment_added","issue.document_annotation_thread_resolved","issue.document_annotation_thread_reopened","issue.document_annotation_remapped"]),_q=new Set(["routine.document_annotation_thread_created","routine.document_annotation_comment_added","routine.document_annotation_thread_resolved","routine.document_annotation_thread_reopened","routine.document_annotation_remapped"]),Eq=new Set(["case.document_annotation_thread_created","case.document_annotation_comment_added","case.document_annotation_thread_resolved","case.document_annotation_thread_reopened","case.document_annotation_remapped"]),Iq=new Set(["error"]),Tq=new Set(["failed","timed_out","cancelled"]);function Rq(e){if(!e)return null;const t=[];if(typeof e.status=="string"&&t.push(`status -> ${e.status.replace(/_/g," ")}`),typeof e.priority=="string"&&t.push(`priority -> ${e.priority}`),typeof e.assigneeAgentId=="string"||typeof e.assigneeUserId=="string"?t.push("reassigned"):(e.assigneeAgentId===null||e.assigneeUserId===null)&&t.push("unassigned"),e.reopened===!0){const i=be(e.reopenedFrom);t.push(i?`reopened from ${i.replace(/_/g," ")}`:"reopened")}return typeof e.title=="string"&&t.push("title changed"),typeof e.description=="string"&&t.push("description changed"),t.length>0?t.join(", "):null}r(Rq,"describeIssueUpdate");function Dq(e,t,i,l){const c=be(i.entityType),u=be(i.entityId),m=be(i.action),f=Xr(i.details),h=be(i.actorId),g=be(i.actorType);if(c!=="issue"||!u||!m||!Cq.has(m))return null;const v=gq(e,t,u,f),y=be(be(i.actorName)?.trim())??hq(e,t,g,h),j=g==="agent"&&h?e.getQueryData(U.agents.list(t))?.find(K=>K.id===h)??e.getQueryData(U.agents.detail(h)):void 0,k=g==="user"&&h?e.getQueryData(U.access.companyUserDirectory(t))?.users.find(K=>K.principalId===h)?.user:void 0,S=h&&(g==="user"||g==="agent")?{type:g,id:h,name:y,image:i.actorImage!==void 0?be(i.actorImage):k?.image,appearance:g==="agent"?eE(i.actorAppearance!==void 0?i.actorAppearance:j?.appearance,h):void 0}:void 0;if(g==="user"&&l.userId&&h===l.userId||g==="agent"&&l.agentId&&h===l.agentId)return null;if(m==="issue.created")return{actor:S,title:`${y} created ${v.ref}`,body:v.title?zr(v.title,96):void 0,tone:"success",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${u}`};if(m==="issue.updated"){if(be(f?.source)==="comment")return null;const K=Rq(f),P=K?v.title?`${zr(v.title,64)} - ${K}`:K:v.title?zr(v.title,96):v.label;return{actor:S,title:`${y} updated ${v.ref}`,body:zr(P,100),tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${u}`}}const N=be(f?.commentId),_=be(f?.bodySnippet),I=f?.reopened===!0,D=f?.updated===!0,T=be(f?.reopenedFrom),C=I?T?`reopened from ${T.replace(/_/g," ")}`:"reopened":null,M=I?`${y} reopened and commented on ${v.ref}`:D?`${y} commented and updated ${v.ref}`:`${y} commented on ${v.ref}`,z=_?C?`${C} - ${_.replace(/^#+\s*/m,"").replace(/\n/g," ")}`:_.replace(/^#+\s*/m,"").replace(/\n/g," "):C?v.title?`${C} - ${v.title}`:C:v.title??void 0;return{actor:S,title:M,body:z?zr(z,96):void 0,tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${u}:${N??"na"}`}}r(Dq,"buildActivityToast");function Mq(e){const t=be(e.entityType),i=be(e.action),l=be(e.entityId),c=Xr(e.details);return t!=="join_request"||!i||!l||i!=="join.requested"&&i!=="join.request_replayed"?null:{title:`${be(c?.requestType)==="agent"?"Agent":"Someone"} wants to join`,body:"A new join request is waiting for approval.",tone:"info",action:{label:"View inbox",href:"/inbox/mine"},dedupeKey:`join-request:${l}`}}r(Mq,"buildJoinRequestToast");function Oq(e,t,i,l){const c=be(e.agentId),u=be(e.status);if(!c||!u||!Iq.has(u))return null;const m=u==="error"?"error":"info",f=t(c)??`Agent ${of(c)}`;return{title:u==="running"?`${f} started`:`${f} errored`,body:i.getQueryData(U.agents.list(l))?.find(h=>h.id===c)?.title??void 0,tone:m,action:{label:"View agent",href:`/agents/${c}`},dedupeKey:`agent-status:${c}:${u}`}}r(Oq,"buildAgentStatusToast");function Lq(e,t){const i=be(e.runId),l=be(e.agentId),c=be(e.status);if(!i||!l||!c||!Tq.has(c))return null;const u=be(e.error),m=be(e.errorCode);if(m==="operator_interrupted"||m==="workspace_busy")return null;const f=be(e.contextSource),h=be(e.triggerDetail),g=t(l)??"Agent";if(c==="failed"&&m==="low_trust_isolation_unavailable"&&f?.startsWith("chat:"))return{title:`${g} couldn't start this chat`,body:"This external chat identity isn't linked, and isolated guest workspaces are disabled. Link the identity in Connectors or enable isolated workspaces, then start a new task.",tone:"warn",ttlMs:1e4,action:{label:"Open chat connections",href:"/apps"},dedupeKey:`run-status:${i}:${c}`};const v=c==="succeeded"?"success":c==="cancelled"?"info":"error",y=`${g} run ${c==="succeeded"?"succeeded":c==="failed"?"failed":c==="timed_out"?"timed out":"cancelled"}`;let j;return u?j=zr(u,100):h&&(j=`Trigger: ${h}`),{title:y,body:j,tone:v,ttlMs:c==="succeeded"?5e3:7e3,action:{label:"View run",href:`/agents/${l}/runs/${i}`},dedupeKey:`run-status:${i}:${c}`}}r(Lq,"buildRunStatusToast");function zq(e,t,i){const l=be(i.runId),c=be(i.status);if(!l||!c)return!1;if(e.setQueryData(U.runDetail(l),m=>{if(!m)return m;const f=r(h=>Object.prototype.hasOwnProperty.call(i,h),"has");return{...m,status:c,...f("invocationSource")?{invocationSource:be(i.invocationSource)??m.invocationSource}:{},...f("triggerDetail")?{triggerDetail:be(i.triggerDetail)}:{},...f("error")?{error:be(i.error)}:{},...f("errorCode")?{errorCode:be(i.errorCode)}:{},...f("startedAt")?{startedAt:be(i.startedAt)}:{},...f("finishedAt")?{finishedAt:be(i.finishedAt)}:{}}}),Ec.has(c))return e.setQueryData(U.liveRuns(t),m=>Z8(m,l)),!0;let u=!1;return e.setQueryData(U.liveRuns(t),m=>{const f=J8(m,l,c);return u=f.present,f.next}),u}r(zq,"applyRunLifecycleToCompanyLiveRuns");function Pq(e,t,i){const l=be(i.status);l&&Ec.has(l)&&e.invalidateQueries({queryKey:U.heartbeats(t),refetchType:"none"}),e.invalidateQueries({queryKey:U.agents.list(t)}),e.invalidateQueries({queryKey:U.dashboard(t)}),e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:U.sidebarBadges(t)});const c=be(i.agentId);c&&(e.invalidateQueries({queryKey:U.agents.detail(c)}),e.invalidateQueries({queryKey:U.heartbeats(t,c)}));const u=be(i.runId);u&&e.invalidateQueries({queryKey:U.runDetail(u)})}r(Pq,"invalidateHeartbeatQueries");function Uq(e,t,i){const l=be(i.agentId);l&&e.invalidateQueries({queryKey:U.agents.detail(l)})}r(Uq,"invalidateHeartbeatProgressQueries");var $q=new Set(["approval","attention_source","budget_incident","decision","decision_queue","issue_recovery_action","join_request"]),Bq=["issue.blockers_","issue.dependency_recovery_","issue.disposition_repair_","issue.execution_recovery_","issue.interaction_","issue.recovery_action_","issue.stalled_review_","issue.thread_interaction_"],Kq=new Set(["failed","timed_out"]);function qq(e,t,i){return t?.startsWith("inbox.")||e&&$q.has(e)?!0:e!=="issue"||!t?!1:Bq.some(l=>t.startsWith(l))||t==="issue.reviewers_updated"||t==="issue.status_decision_recorded"?!0:(t==="issue.created"||t==="issue.updated")&&(i?.status!==void 0||i?.blockedByIssueIds!==void 0)}r(qq,"activityChangesAttention");function pk(e,t,i,l){return e.getQueriesData({queryKey:U.attention(t)}).some(([,c])=>c?"items"in c?Array.isArray(c.items)&&c.items.some(i):"count"in c&&l(c):!1)}r(pk,"cachedAttentionIncludes");function Bg(e,t){e.invalidateQueries({queryKey:U.attention(t)})}r(Bg,"invalidateAttentionQueries");function Fq(e,t,i,l,c){e.invalidateQueries({queryKey:U.activity(t)}),e.invalidateQueries({queryKey:U.dashboard(t)}),e.invalidateQueries({queryKey:U.sidebarBadges(t)});const u=be(i.entityType),m=be(i.entityId),f=be(i.action),h=be(i.actorType),g=be(i.actorId),v=Xr(i.details),y=h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId;if(qq(u,f,v)&&Bg(e,t),u==="decision"&&(e.invalidateQueries({queryKey:["decisions",t]}),m&&e.invalidateQueries({queryKey:U.decisions.detail(m)})),(f?.startsWith("ai_connection.")||f?.startsWith("connection_grant."))&&e.invalidateQueries({queryKey:["ai-connections",t]}),(f?.startsWith("primary_agent.")||f?.startsWith("agent.")||f?.startsWith("resource_membership."))&&e.invalidateQueries({queryKey:["primary-agent",t]}),f?.startsWith("resource_membership.")||f?.startsWith("primary_agent.")){const j=be(v?.userId);(!j||j===l.userId)&&e.invalidateQueries({queryKey:U.resourceMemberships.mine(t)})}if(u==="issue"){const j=U.agentChats.list(t,l.userId);if((m&&e.getQueryData(j)?.some(k=>k.id===m)||f==="issue.conversation_opened"&&y)&&e.invalidateQueries({queryKey:j}),(f==="issue.tree_hold_created"||f==="issue.tree_hold_released"||f==="issue.updated")&&e.invalidateQueries({queryKey:["issues","tree-control-state"]}),m&&uK(e,t,m,lK(f,v,c?.occurredAt??null)),dK(e,t),vI(e,t,i),m){const k=(f==="issue.comment_added"||f==="issue.updated"&&be(v?.source)==="comment")&&(h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId),S=!!c?.pathname&&Sq(e,c.pathname,i,{isForegrounded:c.isForegrounded}),N=!!c?.pathname&&MA(e,c.pathname,i,{isForegrounded:c.isForegrounded}),_=ax(e,t,m,v);for(const I of _){const D=k||S||N?{refetchType:"inactive"}:void 0;if(e.invalidateQueries({queryKey:U.issues.detail(I),...D}),e.invalidateQueries({queryKey:U.issues.activity(I),...D}),(f==="issue.comment_added"||f==="issue.conversation_session_started")&&e.invalidateQueries({queryKey:U.issues.comments(I),...D}),(f==="issue.comment_added"||f?.startsWith("issue.queued_comment"))&&e.invalidateQueries({queryKey:U.issues.queuedComments(I)}),(f?.startsWith("issue.attachment_")||f?.startsWith("issue.work_product_"))&&(e.invalidateQueries({queryKey:U.issues.attachments(I)}),e.invalidateQueries({queryKey:U.issues.workProducts(I)})),f==="issue.conversation_session_started"&&(e.invalidateQueries({queryKey:["issues","tree-control-state",I]}),e.invalidateQueries({queryKey:U.issues.interactions(I)})),f&&mk.has(f)){const T=be(v?.key);e.invalidateQueries({queryKey:U.issues.documents(I),...D}),T?(e.invalidateQueries({queryKey:U.issues.document(I,T),...D}),e.invalidateQueries({queryKey:U.issues.documentRevisions(I,T),...D})):(e.invalidateQueries({queryKey:["issues","document",I],...D}),e.invalidateQueries({queryKey:["issues","document-revisions",I],...D}))}if(f&&(mk.has(f)||Aq.has(f))){const T=be(v?.key)??be(v?.documentKey);e.invalidateQueries({queryKey:T?["issues","document-annotations",I,T]:["issues","document-annotations",I],...D})}(f?.startsWith("issue.thread_interaction_")||(f==="issue.updated"||f==="issue.status_decision_recorded")&&be(v?.source)==="native_status_decision")&&(e.invalidateQueries({queryKey:U.issues.interactions(I)}),e.invalidateQueries({queryKey:U.tools.actionRequests(t,"pending")}),e.invalidateQueries({queryKey:U.apps.attention(t)}),e.invalidateQueries({queryKey:U.tools.trustRules(t)}))}}return}if(u==="agent"){e.invalidateQueries({queryKey:U.agents.list(t)}),e.invalidateQueries({queryKey:U.org(t)}),m&&(e.invalidateQueries({queryKey:U.agents.detail(m)}),e.invalidateQueries({queryKey:U.heartbeats(t,m)}));return}if(u==="project"){const j=be(i.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:U.issues.activity(j)}),e.invalidateQueries({queryKey:U.projects.all(t)}),m&&e.invalidateQueries({queryKey:U.projects.detail(m)});return}if(u==="company_skill"){const j=be(i.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:U.issues.activity(j)}),m&&e.invalidateQueries({queryKey:U.companySkills.detail(t,m)}),e.invalidateQueries({queryKey:U.companySkills.list(t)});return}if(u==="goal"){e.invalidateQueries({queryKey:U.goals.list(t)}),m&&e.invalidateQueries({queryKey:U.goals.detail(m)});return}if(u==="approval"){e.invalidateQueries({queryKey:U.approvals.list(t)});return}if(u==="join_request"){e.invalidateQueries({queryKey:U.access.joinRequests(t)});return}if(u==="cost_event"){e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:["usage-by-provider",t]}),e.invalidateQueries({queryKey:["usage-by-biller",t]}),e.invalidateQueries({queryKey:U.usageWindowSpend(t)});return}if(u==="routine"||u==="routine_trigger"||u==="routine_run"){if(e.invalidateQueries({queryKey:["routines"]}),u==="routine"&&f&&_q.has(f)&&m){const j=be(v?.key)??be(v?.documentKey)??"description",k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:["routines","document-annotations",m,j],...k})}return}if(u==="case"){if(e.invalidateQueries({queryKey:U.cases.list(t)}),m&&(e.invalidateQueries({queryKey:U.cases.detail(m)}),e.invalidateQueries({queryKey:U.cases.events(m)}),f&&Eq.has(f))){const j=be(v?.key)??be(v?.documentKey),k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:j?["cases","document-annotations",m,j]:["cases","document-annotations",m],...k})}return}if(u==="summary_slot"){const j=be(v?.scopeKind),k=be(v?.slotKey),S=be(v?.scopeId);j&&k&&(e.invalidateQueries({queryKey:U.summarySlots.detail(t,j,k,S)}),e.invalidateQueries({queryKey:U.summarySlots.revisions(t,j,k,S)}));return}u==="company"&&e.invalidateQueries({queryKey:U.companies.all})}r(Fq,"invalidateActivityQueries");function Hq(e,t){const i=t.payload??{},l=be(i.runId),c=be(i.status);if(!l||!c||!Ec.has(c))return!1;const u=`${t.companyId}:${l}:${c}`,m=e.observedRunOutcomes.has(u);e.observedRunOutcomes.delete(u),e.observedRunOutcomes.add(u),e.observedRunOutcomes.size>cq&&e.observedRunOutcomes.delete(e.observedRunOutcomes.values().next().value);const f=Date.parse(be(i.finishedAt)??""),h=Date.parse(t.createdAt);return m||h-f>oq}r(Hq,"observeRunOutcome");function Vq(e,t){const i=Date.now();if(i<e.suppressUntil)return!0;const l=e.cooldownHits.get(t);if(!l)return!1;const c=l.filter(u=>i-u<iq);return e.cooldownHits.set(t,c),c.length>=rq}r(Vq,"shouldSuppressToast");function Wq(e,t){const i=Date.now(),l=e.cooldownHits.get(t)??[];l.push(i),e.cooldownHits.set(t,l)}r(Wq,"recordToastHit");function Ih(e,t,i,l){Vq(e,i)||t(l)!==null&&Wq(e,i)}r(Ih,"gatedPushToast");function Qq(e,t,i,l,c,u,m,f){if(l.companyId!==t)return;const h=r(k=>TA(e,t,k),"nameOf"),g=l.payload??{},v=l.type==="heartbeat.run.status"&&(Hq(u,l)||bq(e,i,g)),y=vq(g,l.createdAt,l.type);let j=!1;if(y){const k=r(S=>{j=wq(e,t,i,S)},"applyPatch");l.type==="heartbeat.run.log"&&f?f.submit(y,k):k(y)}if(l.type!=="heartbeat.run.log"){if(l.type==="heartbeat.run.queued"||l.type==="heartbeat.run.status"){const k=zq(e,t,g);if(Pq(e,t,g),tk(e,l),k||e.invalidateQueries({queryKey:U.liveRuns(t)}),dk(e,i,g,{runLifecycleEvent:!0}),(l.type==="heartbeat.run.status"&&Kq.has(be(g.status)??"")||l.type==="heartbeat.run.queued"&&pk(e,t,S=>S.sourceKind==="failed_run",S=>(S.countsBySourceKind?.failed_run??0)>0))&&Bg(e,t),l.type==="heartbeat.run.status"){const S=Lq(g,h);S&&!v&&Ih(u,c,"run-status",S)}return}if(l.type==="heartbeat.run.progress"){Uq(e,t,g),dk(e,i,g,{liveStatusAlreadyPatched:j});return}if(l.type==="heartbeat.run.event"){tk(e,l);return}if(l.type==="agent.status"){e.invalidateQueries({queryKey:U.agents.list(t)}),e.invalidateQueries({queryKey:U.dashboard(t)}),e.invalidateQueries({queryKey:U.org(t)});const k=be(g.agentId);k&&e.invalidateQueries({queryKey:U.agents.detail(k)}),(be(g.status)==="error"||k&&pk(e,t,N=>N.sourceKind==="agent_error_alert"&&N.subject?.id===k,N=>N.errorAgentIds?.includes(k)===!0))&&Bg(e,t);const S=Oq(g,h,e,t);S&&!kq(e,i,g)&&Ih(u,c,"agent-status",S);return}if(l.type==="activity.logged"){Fq(e,t,g,m,{pathname:i,occurredAt:l.createdAt??null}),MA(e,i,g)&&Nq(e,i,g);const k=be(g.action),S=Dq(e,t,g,m)??Mq(g);S&&!xq(e,i,g)&&Ih(u,c,`activity:${k??"unknown"}`,S)}}}r(Qq,"handleLiveEvent");function Gq(e,t){return e&&e===t?e:null}r(Gq,"resolveLiveCompanyId");function hk(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null}r(hk,"resetSocketHandlers");function gk(e,t){if(e){if(e.readyState===dq){e.onopen=()=>{hk(e),e.close(1e3,t)},e.onmessage=null,e.onerror=()=>{},e.onclose=null;return}hk(e),e.readyState===fq&&e.close(1e3,t)}}r(gk,"closeSocketQuietly");function Yq(e,t,i){return e==="success"&&(t||i==="local_trusted")}r(Yq,"canUseLiveSession");function Xq({children:e}){const{visible:t}=$k(),i=(0,x.useRef)(!t),{selectedCompanyId:l,selectedCompany:c}=vt(),u=wn(),{pushToast:m}=Ni(),f=vn(),h=(0,x.useRef)({cooldownHits:new Map,suppressUntil:0,observedRunOutcomes:new Set}),g=(0,x.useRef)(f.pathname),{data:v,status:y}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),{data:j}=ge({queryKey:U.health,queryFn:Rc.get}),k=v?.user?.id??v?.session?.userId??(j?.deploymentMode==="local_trusted"?"local-board":null),S=v?.session?.id??k??"signed_out",N=Gq(l,c?.id??null),_=Yq(y,v!=null,j?.deploymentMode)&&N!==null,I=(0,x.useRef)({userId:k,agentId:null}),D=(0,x.useRef)(new Set),T=(0,x.useCallback)(P=>(D.current.add(P),()=>{D.current.delete(P)}),[]),C=(0,x.useMemo)(()=>({subscribe:T}),[T]),M=(0,x.useMemo)(()=>G8(u),[u]),z=(0,x.useMemo)(()=>X8(u,M),[u,M]),K=(0,x.useMemo)(()=>jq(),[]);return(0,x.useEffect)(()=>()=>{M.dispose(),K.dispose()},[M,K]),(0,x.useEffect)(()=>{g.current=f.pathname},[f.pathname]),(0,x.useEffect)(()=>{I.current={userId:k,agentId:null}},[k]),(0,x.useEffect)(()=>{if(!t||!_||!N)return;const P=window.setInterval(()=>{fK(u,N)},nK);return()=>window.clearInterval(P)},[_,N,u,t]),(0,x.useEffect)(()=>{if(!t){i.current=!0,M.dispose(),K.dispose();return}if(!_||!N)return;i.current&&(i.current=!1,u.invalidateQueries({type:"active"},{cancelRefetch:!1}));let P=!1,A=0,B=null,O=null,W=null;const Y=r(()=>{B!==null&&(window.clearTimeout(B),B=null)},"clearReconnect"),ce=r(()=>{O!==null&&(window.clearInterval(O),O=null)},"stopPolling"),oe=r(()=>{P||O!==null||(O=window.setInterval(()=>{u.invalidateQueries({type:"active"},{cancelRefetch:!1})},uq))},"startPolling"),$=r(()=>{if(P||B!==null)return;A+=1;const ue=Math.min(15e3,1e3*2**Math.min(A-1,4));B=window.setTimeout(()=>{B=null,R()},ue)},"scheduleReconnect"),R=r(()=>{if(P)return;const ue=xK(`/api/companies/${encodeURIComponent(N)}/events/ws`),ae=bK(ue);if(!ae){oe(),$();return}W=ae,ae.onopen=()=>{if(P||W!==ae){gk(ae,"stale_connection");return}ce(),A>0&&(h.current.suppressUntil=Date.now()+lq),u.invalidateQueries({type:"active"},{cancelRefetch:!1}),A=0},ae.onmessage=Ee=>{if(!ff().visible)return;const fe=typeof Ee.data=="string"?Ee.data:"";if(fe)try{const Ae=JSON.parse(fe);if(Qq(z,N,g.current,Ae,m,h.current,{userId:I.current.userId,agentId:I.current.agentId},K),mq(D.current,N,Ae),Ae.type==="notification.created"){const Ce=sq(Ae.payload);Ce&&tq(Ce,I.current.userId)}}catch{}},ae.onerror=()=>{},ae.onclose=()=>{W===ae&&(W=null,!P&&(oe(),$()))}},"connect"),ne=window.setTimeout(R,0);return()=>{P=!0,window.clearTimeout(ne),Y(),ce();const ue=W;W=null,gk(ue,"provider_unmount")}},[t,M,K,u,z,N,m,_,S]),(0,s.jsx)(IA.Provider,{value:C,children:e})}r(Xq,"LiveUpdatesProvider");function Zq(e){let t=Vr();ik(t),$g(t,e.userId);const i=SA(()=>{const u=Vr();u!==t&&(t=u,ik(u),$g(u,e.userId))}),l=typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:null,c=r(u=>{const m=aq(u.data);m&&(m.type==="navigate"?e.navigate(m.url):nq(m.notification))},"onMessage");return l?.addEventListener("message",c),l?.startMessages(),()=>{i(),l?.removeEventListener("message",c)}}r(Zq,"startNotificationRuntime");function Jq(){const e=bs(),t=(0,x.useRef)(e),{data:i}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),l=i?.user?.id??i?.session?.userId??null;return(0,x.useEffect)(()=>{t.current=e},[e]),(0,x.useEffect)(()=>{if(l)return Zq({userId:l,navigate:r(c=>t.current(c),"navigate")})},[l]),null}r(Jq,"NotificationRuntime");var e7=36e5,t7=3e3,n7=2e3,xk="wardmote.skip-waiting",s7="wardmote.build-id",OA=null,Kg=new Set;function a7(e){OA=e;for(const t of Kg)t()}r(a7,"publishUpdate");function i7(e){return Kg.add(e),()=>{Kg.delete(e)}}r(i7,"subscribe");function r7(){return(0,x.useSyncExternalStore)(i7,()=>OA,()=>null)}r(r7,"useServiceWorkerUpdate");function l7(e){return new Promise(t=>{const i=new MessageChannel,l=r(u=>{clearTimeout(c),i.port1.close(),t(u)},"finish"),c=setTimeout(()=>l(null),n7);i.port1.onmessage=u=>{l(typeof u.data?.buildId=="string"?u.data.buildId:null)},e.postMessage({type:s7},[i.port2])})}r(l7,"requestWorkerBuildId");function o7(e={}){const t=e.container??(typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:void 0);if(!t)return()=>{};const i=e.documentRef??document,l=e.reload??(()=>window.location.reload()),c=e.updateIntervalMs??e7,u=e.onUpdateReady??a7;let m=!!t.controller,f=!1,h=!1,g,v=!1;const y=r(async C=>e.pageBuildId?await l7(C)!==e.pageBuildId:!0,"servesNewerBuild"),j=r(()=>{h||(h=!0,g!==void 0&&clearTimeout(g),l())},"reloadOnce"),k=r(async C=>{const M=await y(C);if(!v){if(!M){C.postMessage({type:xk});return}u(()=>{f=!0,C.postMessage({type:xk}),g=setTimeout(j,t7)})}},"offerWaiting"),S=r(()=>{if(!m){m=!0;return}if(f){j();return}const C=t.controller;C&&y(C).then(M=>{M&&!v&&!f&&u(j)})},"onControllerChange");t.addEventListener("controllerchange",S);let N;const _=r(()=>{const C=N?.installing;C&&C.addEventListener("statechange",()=>{C.state==="installed"&&t.controller&&k(C)})},"watchInstalling"),I=r(()=>{N?.update().catch(()=>{})},"checkForUpdates"),D=r(()=>{i.visibilityState==="visible"&&I()},"onVisibilityChange");i.addEventListener("visibilitychange",D);const T=setInterval(I,c);return t.register("/sw.js").then(C=>{N=C,C.waiting&&t.controller&&k(C.waiting),C.addEventListener("updatefound",_)}).catch(()=>{}),()=>{v=!0,t.removeEventListener("controllerchange",S),i.removeEventListener("visibilitychange",D),N?.removeEventListener("updatefound",_),clearInterval(T),g!==void 0&&clearTimeout(g)}}r(o7,"startServiceWorkerUpdates");var LA="wardmote.notifications.asked-after-decision";function c7(){try{return window.localStorage.getItem(LA)==="1"}catch{return!0}}r(c7,"alreadyAsked");function u7(){try{window.localStorage.setItem(LA,"1")}catch{return}}r(u7,"markAsked");async function d7(e){const t=await jK();if(t!=="granted")return t;const i=kA(l=>({...l,enabled:!0,pushEnabled:!0}));return e&&await $g(i,e),t}r(d7,"enableNotificationsAfterDecision");function f7(){const{pushToast:e}=Ni(),{data:t}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),i=t?.user?.id??t?.session?.userId??null;(0,x.useEffect)(()=>lE(()=>{c7()||!tx()||nx()!=="default"||(u7(),e({id:"wardmote-notify-after-decision",title:"Get notified when an agent needs a decision",body:"Turn on notifications for this device. You can change it later in Settings.",tone:"info",persistent:!0,action:{label:"Turn on",onClick:r(()=>{d7(i)},"onClick")}}))}),[e,i])}r(f7,"useFirstDecisionNotificationPrompt");var m7="wardmote-update-ready";function p7(){const{pushToast:e}=Ni(),t=r7(),i=wn(),l=e0(),c=(0,x.useRef)(l);return(0,x.useEffect)(()=>{t&&e({id:m7,title:"A new version is ready.",tone:"info",persistent:!0,action:{label:"Reload",onClick:t}})},[t,e]),(0,x.useEffect)(()=>{if(l){c.current=!0;return}c.current&&(c.current=!1,i.invalidateQueries())},[l,i]),f7(),null}r(p7,"PwaRuntime");var zA={get:r(e=>we.get(`/companies/${e}/primary-agent/me`),"get"),set:r((e,t)=>we.put(`/companies/${e}/primary-agent/me`,t),"set")};function h7(e){const t=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),i=t.data?.user?.id??t.data?.session?.userId??"local-board",l=ge({queryKey:U.primaryAgent.mine(e??"__none__",i),queryFn:r(()=>zA.get(e),"queryFn"),enabled:!!e&&t.isSuccess});return{...l,userId:i,loading:!!e&&(t.isPending||l.isPending&&!t.error),error:t.error??l.error,retry:r(()=>t.isError?t.refetch():l.refetch(),"retry")}}r(h7,"usePrimaryAgent");function g7({children:e}){const{selectedCompanyId:t}=vt(),i=h7(t),l=wn(),{pushToast:c}=Ni(),u=(0,x.useRef)({companyId:t,userId:i.userId});u.current={companyId:t,userId:i.userId};const m=r(j=>U.primaryAgent.mine(j.companyId,j.userId),"keyFor"),f=r(j=>j.companyId===u.current.companyId&&j.userId===u.current.userId,"isCurrentScope"),h=ge({queryKey:U.agents.list(t),queryFn:r(()=>$s.list(t),"queryFn"),enabled:!!t}),g=Kt({mutationFn:r(j=>zA.set(j.companyId,{primaryAgentId:j.agentId}),"mutationFn"),onMutate:r(async j=>{const k=m(j);await l.cancelQueries({queryKey:k});const S=l.getQueryData(k);return l.setQueryData(k,{companyId:j.companyId,userId:j.userId,primaryAgentId:j.agentId,initialized:!0}),{previous:S}},"onMutate"),onError:r((j,k,S)=>{l.setQueryData(m(k),S?.previous),f(k)&&c({title:"Couldn't change your primary agent.",body:j.message,tone:"error",action:{label:"Retry",onClick:r(()=>{f(k)&&g.mutate(k)},"onClick")}})},"onError"),onSuccess:r((j,k)=>l.setQueryData(m(k),j),"onSuccess"),onSettled:r((j,k,S)=>{l.invalidateQueries({queryKey:m(S)}),l.invalidateQueries({queryKey:U.resourceMemberships.mine(S.companyId)})},"onSettled")}),v=h.data?.find(j=>j.id===i.data?.primaryAgentId&&j.status!=="terminated")??null,y=i.error??h.error;return(0,s.jsx)(MM,{value:t?{companyId:t,primaryAgentId:v?.id??null,primaryAgent:v,loading:i.loading||h.isPending,error:y?.message,onRetry:r(()=>{i.retry(),h.refetch()},"onRetry"),pendingAgentId:g.isPending&&f(g.variables)?g.variables.agentId:null,onChange:r(j=>g.mutate({companyId:t,userId:i.userId,agentId:j}),"onChange")}:null,children:e})}r(g7,"PrimaryAgentProvider");var bk="min-h-9",x7={default:void 0,warning:"bg-amber-500/5 text-amber-700 dark:text-amber-300",error:"bg-bad/5 text-bad",muted:"opacity-50"};function OG(e,t){const i={name:"",path:"",kind:"dir",children:[]};for(const c of Object.keys(e)){const u=c.split("/").filter(Boolean);let m=i,f="";for(let h=0;h<u.length;h++){const g=u[h];f=f?`${f}/${g}`:g;const v=h===u.length-1;let y=m.children.find(j=>j.name===g);y||(y={name:g,path:f,kind:v?"file":"dir",children:[],action:v?t?.get(c)??null:null},m.children.push(y)),m=y}}function l(c){c.children.sort((u,m)=>u.kind!==m.kind?u.kind==="file"?-1:1:u.name.localeCompare(m.name)),c.children.forEach(l)}return r(l,"sortNode"),l(i),i.children}r(OG,"buildFileTree");function b7(e){let t=0;for(const i of e)i.kind==="file"?t++:t+=b7(i.children);return t}r(b7,"countFiles");function PA(e,t="all"){const i=new Set;for(const l of e){(t==="all"||l.kind===t)&&i.add(l.path);for(const c of PA(l.children,t))i.add(c)}return i}r(PA,"collectAllPaths");function v7(e){return e.endsWith(".yaml")||e.endsWith(".yml")?vS:yS}r(v7,"fileIcon");function UA(e,t,i=0){const l=[];for(const c of e)l.push({node:c,depth:i}),c.kind==="dir"&&t.has(c.path)&&l.push(...UA(c.children,t,i+1));return l}r(UA,"flattenVisibleNodes");function y7(e,t){if(e.kind==="file")return{allChecked:t.has(e.path),someChecked:!1};const i=[...PA(e.children,"file")],l=i.length>0&&i.every(c=>t.has(c));return{allChecked:l,someChecked:i.some(c=>t.has(c))&&!l}}r(y7,"checkboxState");function LG(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return null;const i={},l=t[1],c=t[2];let u=null,m=null;for(const f of l.split(`
59
59
  `)){const h=f.trim();if(!h||h.startsWith("#"))continue;if(h.startsWith("- ")&&u){m||(m=[]),m.push(h.slice(2).trim().replace(/^["']|["']$/g,""));continue}u&&m&&(i[u]=m,m=null,u=null);const g=h.match(/^([a-zA-Z_][\w-]*)\s*:\s*(.*)$/);if(g){const v=g[1],y=g[2].trim().replace(/^["']|["']$/g,"");if(y==="null"){u=null;continue}y?(i[v]=y,u=null):u=v}}return u&&m&&(i[u]=m),Object.keys(i).length>0?{data:i,body:c}:null}r(LG,"parseFrontmatter");var zG={name:"Name",title:"Title",kind:"Kind",reportsTo:"Reports to",skills:"Skills",status:"Status",description:"Description",priority:"Priority",assignee:"Responsible",project:"Project",recurring:"Recurring",targetDate:"Target date"};function j7({nodes:e,selectedFile:t,expandedDirs:i,checkedFiles:l,onToggleDir:c,onSelectFile:u,onToggleCheck:m,fileBadges:f,fileTones:h,renderFileExtra:g,renderLabel:v,checkboxLabel:y,getCheckboxState:j,renderNodeExtra:k,visiblePaths:S,disabled:N=!1,fileRowClassName:_,layout:I="default",showCheckboxes:D=!0,wrapLabels:T=!0,loading:C=!1,error:M,empty:z,ariaLabel:K="Files"}){const P=l??new Set,A=(0,x.useMemo)(()=>UA(e,i).filter(({node:R})=>!S||S.has(R.path)),[i,e,S]),[B,O]=(0,x.useState)(null),W=(0,x.useRef)(new Map),Y=A.some(({node:R})=>R.path===B)?B:A[0]?.node.path;function ce(R){O(R),window.requestAnimationFrame(()=>{W.current.get(R)?.focus()})}r(ce,"focusPath");function oe(R){N||(R.kind==="dir"?c(R.path):u(R.path))}r(oe,"toggleNode");function $(R,ne,ue){if(!N)switch(R.key){case"ArrowDown":{R.preventDefault();const ae=A[Math.min(ne+1,A.length-1)];ae&&ce(ae.node.path);break}case"ArrowUp":{R.preventDefault();const ae=A[Math.max(ne-1,0)];ae&&ce(ae.node.path);break}case"ArrowRight":ue.kind==="dir"&&!i.has(ue.path)&&(R.preventDefault(),c(ue.path));break;case"ArrowLeft":ue.kind==="dir"&&i.has(ue.path)&&(R.preventDefault(),c(ue.path));break;case"Enter":R.preventDefault(),oe(ue);break;case" ":D&&m&&j?.(ue)!==null&&(R.preventDefault(),m(ue.path,ue.kind))}}return r($,"handleRowKeyDown"),C?(0,s.jsx)("div",{"aria-busy":"true","aria-label":K,role:"tree",className:"py-1",children:[0,1,2,3].map(R=>(0,s.jsxs)("div",{className:X("flex items-center gap-2 px-4",bk),children:[(0,s.jsx)(lt,{className:"h-4 w-4 shrink-0 rounded-sm"}),(0,s.jsx)(lt,{className:X("h-3.5",R===1?"w-3/5":"w-4/5")})]},R))}):M?(0,s.jsx)("div",{"aria-label":K,role:"tree",className:"p-3",children:(0,s.jsxs)("div",{role:"treeitem","aria-level":1,className:"flex min-h-9 items-center justify-between gap-3 rounded-md border border-bad/30 bg-bad/5 px-3 py-2 text-sm",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)(Bn,{variant:"ghost",className:X("px-2.5",Id.error??"bg-bg-3 text-ink-3"),children:"error"}),(0,s.jsx)("span",{className:"min-w-0 text-bad",children:M.message})]}),M.retry&&(0,s.jsx)(le,{type:"button",size:"xs",variant:"secondary",onClick:M.retry,children:"Retry"})]})}):A.length===0?(0,s.jsx)("div",{"aria-label":K,role:"tree",className:"p-3",children:(0,s.jsxs)("div",{className:"rounded-md border border-dashed border-line px-4 py-8 text-center",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:z?.title??"No files"}),(0,s.jsx)("div",{className:"mt-1 text-xs text-ink-3",children:z?.description??"Files will appear here when they are available."})]})}):(0,s.jsx)("div",{"aria-label":K,role:"tree",children:A.map(({node:R,depth:ne},ue)=>{const ae=R.kind==="dir"&&i.has(R.path),Ee=j?.(R),fe=D&&Ee!==null,{allChecked:Ae,someChecked:Ce}=Ee==null?y7(R,P):{allChecked:Ee==="checked",someChecked:Ee==="mixed"},Se=f?.[R.path],he=h?.[R.path]??"default",De=R.kind==="file"?_?.(R,Ae):void 0,Ye=R.kind==="file"?v7(R.name):null,ze=R.kind==="file"&&R.path===t;return(0,s.jsxs)("div",{ref:r(ve=>{ve?W.current.set(R.path,ve):W.current.delete(R.path)},"ref"),role:"treeitem","aria-level":ne+1,"aria-expanded":R.kind==="dir"?ae:void 0,"aria-selected":R.kind==="file"?ze:void 0,"aria-checked":fe?Ce?"mixed":Ae:void 0,"aria-disabled":N||void 0,tabIndex:Y===R.path?0:-1,className:X(I==="explorer"?"group flex w-full items-center gap-2 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 cursor-pointer":R.kind==="dir"?D?"group grid w-full grid-cols-(--gtc-2) items-center gap-x-1 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 hover:text-ink":"group grid w-full grid-cols-(--gtc-3) items-center gap-x-1 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 hover:text-ink max-[480px]:grid-cols-(--gtc-4)":"group flex w-full items-center gap-1 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 hover:text-ink cursor-pointer",I==="explorer"?"h-8":bk,I==="explorer"&&"file-tree-row-explorer",ze&&"text-ink bg-bg-3/20",x7[he],De,N&&"opacity-50","file-tree-row","outline-none focus-visible:ring-2 focus-visible:ring-focus/50 focus-visible:ring-inset"),style:{"--file-tree-depth":ne},onFocus:r(()=>O(R.path),"onFocus"),onClick:r(()=>oe(R),"onClick"),onKeyDown:r(ve=>$(ve,ue,R),"onKeyDown"),"data-file-tree-path":R.path,children:[I==="explorer"&&(R.kind==="dir"?(0,s.jsx)("button",{type:"button",disabled:N,className:"flex size-4 shrink-0 items-center justify-center rounded-sm hover:text-ink focus-visible:ring-2 focus-visible:ring-focus/50",onClick:r(ve=>{ve.stopPropagation(),c(R.path)},"onClick"),"aria-label":ae?`Collapse ${R.name}`:`Expand ${R.name}`,children:ae?(0,s.jsx)(Br,{className:"size-3.5"}):(0,s.jsx)(nr,{className:"size-3.5"})}):(0,s.jsx)("span",{className:"size-4 shrink-0","aria-hidden":"true"})),fe?(0,s.jsx)("label",{className:X("flex items-center",I==="explorer"?"size-4 shrink-0 justify-center":"pl-2"),onClick:r(ve=>ve.stopPropagation(),"onClick"),children:(0,s.jsx)("input",{type:"checkbox","aria-label":y?.(R)??`Select ${R.path}`,disabled:N,checked:Ae,ref:r(ve=>{ve&&(ve.indeterminate=Ce)},"ref"),onChange:r(()=>m?.(R.path,R.kind),"onChange"),className:I==="explorer"?"size-3.5 shrink-0 accent-ink":"mr-2 accent-ink"})}):D&&I==="explorer"?(0,s.jsx)("span",{className:"size-4 shrink-0","aria-hidden":"true"}):null,(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2 py-1 text-left",children:[(0,s.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:R.kind==="dir"?ae?(0,s.jsx)(jS,{className:"h-3.5 w-3.5"}):(0,s.jsx)(wi,{className:"h-3.5 w-3.5"}):Ye?(0,s.jsx)(Ye,{className:"h-3.5 w-3.5"}):null}),(0,s.jsx)("span",{className:X("min-w-0",I==="explorer"&&"flex-1",T?"break-all leading-4":"truncate"),children:v?v(R):R.name})]}),Se&&(0,s.jsx)(Bn,{variant:"ghost",className:X("ml-3 text-(length:--text-nano) uppercase tracking-wide",Id[Se.status]??"bg-bg-3 text-ink-3"),title:Se.tooltip,children:Se.label}),k?.(R),R.kind==="file"&&g?.(R,Ae),R.kind==="dir"&&I==="default"&&(0,s.jsx)("button",{type:"button",disabled:N,className:"flex h-9 w-9 items-center justify-center self-center rounded-sm text-ink-3 opacity-70 transition-(--tp-background-color-color-opacity) hover:bg-bg-3 hover:text-ink group-hover:opacity-100 focus-visible:ring-2 focus-visible:ring-focus/50 max-[480px]:hidden",onClick:r(ve=>{ve.stopPropagation(),c(R.path)},"onClick"),"aria-label":ae?`Collapse ${R.name}`:`Expand ${R.name}`,children:ae?(0,s.jsx)(Br,{className:"h-3.5 w-3.5"}):(0,s.jsx)(nr,{className:"h-3.5 w-3.5"})})]},R.path)})})}r(j7,"FileTree");function w7(e,t){return e.visible?e.focused?t.visibleMs:t.unfocusedMs??t.visibleMs:t.hiddenMs??!1}r(w7,"resolvePollingInterval");function k7(e,t){if(e<=0)return 0;const i=Math.min(Math.max(t(),0),.999999);return Math.round(i*e)}r(k7,"computeStartupJitterMs");function S7(e){const t=$k(),i=(0,x.useRef)(null);i.current===null&&(e.jitter===!1?i.current=0:i.current=k7(Math.min(e.jitterMaxMs??1e3,Math.round(e.visibleMs*.2)),Math.random));const l=i.current;return(0,x.useMemo)(()=>{const c=w7(t,e);return c===!1?!1:c+l},[t,e.visibleMs,e.unfocusedMs,e.hiddenMs,l])}r(S7,"useVisibilityRefetchInterval");var $A={listForIssue:r(e=>we.get(`/issues/${e}/external-objects`),"listForIssue"),getIssueSummary:r(e=>we.get(`/issues/${e}/external-object-summary`),"getIssueSummary"),getIssueSummaries:r((e,t)=>we.post(`/companies/${e}/issues/external-object-summaries`,{issueIds:t}),"getIssueSummaries"),refreshIssueObjects:r((e,t)=>we.post(`/issues/${e}/external-objects/refresh`,t??{}),"refreshIssueObjects"),getProjectSummary:r(e=>we.get(`/projects/${e}/external-object-summary`),"getProjectSummary")};async function N7(e,t){const i={};for(let l=0;l<t.length;l+=500){const c=t.slice(l,l+500),u=await $A.getIssueSummaries(e,c);Object.assign(i,u.summaries)}return{summaries:i}}r(N7,"fetchIssueExternalObjectSummariesInBatches");function C7(e){switch(e.sourceKind){case"title":return"Title";case"description":return"Description";case"comment":return"Comment";case"document":return e.documentKey?`Document: ${e.documentKey}`:"Document";case"property":return e.propertyKey?`Property: ${e.propertyKey}`:"Property";case"plugin":return"Plugin";default:return"Source"}}r(C7,"formatMentionSourceLabel");function BA(){const e=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn"),retry:!1});return{isEnabled:e.data?.enableExternalObjects===!0,isLoaded:e.data!==void 0||e.isError}}r(BA,"useExternalObjectsFeature");function PG(e){const t=BA(),i=t.isEnabled&&!!e,l=ge({queryKey:U.externalObjects.byIssue(e??"__none__"),queryFn:r(()=>$A.listForIssue(e),"queryFn"),enabled:i,staleTime:6e4}),c=(0,x.useMemo)(()=>(l.data??[]).filter(f=>!!f.object).map(f=>{const h=f.object,g=f.sourceLabels&&f.sourceLabels.length>0?f.sourceLabels:Array.from(new Set(f.mentions.map(C7)));return{group:f,mentionCount:f.mentionCount??f.mentions.length,sourceLabels:g,pill:{providerKey:h.providerKey,objectType:h.objectType,displayKey:h.displayKey,iconKey:h.iconKey,statusCategory:h.statusCategory,liveness:h.liveness,displayTitle:h.displayTitle,statusLabel:h.statusLabel,statusIconKey:h.statusIconKey,url:h.sanitizedCanonicalUrl}}}),[l.data]),u=(0,x.useMemo)(()=>{const f={};for(const{group:h}of c){const g=h.object;if(!g)continue;const v=_y(g.sanitizedCanonicalUrl??null);v&&(f[v]={providerKey:g.providerKey,objectType:g.objectType,displayKey:g.displayKey,iconKey:g.iconKey,statusCategory:g.statusCategory,liveness:g.liveness,statusLabel:g.statusLabel,statusIconKey:g.statusIconKey,displayTitle:g.displayTitle});for(const y of h.mentions){const j=_y(y.sanitizedDisplayUrl??null);j&&!f[j]&&(f[j]={providerKey:g.providerKey,objectType:g.objectType,displayKey:g.displayKey,iconKey:g.iconKey,statusCategory:g.statusCategory,liveness:g.liveness,statusLabel:g.statusLabel,statusIconKey:g.statusIconKey,displayTitle:g.displayTitle})}}return f},[c]),m=(0,x.useCallback)(()=>{l.refetch()},[l.refetch]);return{isEnabled:t.isEnabled,groups:c,markdownReferences:u,isLoading:i&&l.isLoading,isError:l.isError,refetch:m}}r(PG,"useIssueExternalObjects");function A7(e,t){const i=BA(),l=(0,x.useMemo)(()=>[...new Set(t.filter(m=>m.length>0))].sort(),[t]),c=i.isEnabled&&!!e&&l.length>0,u=ge({queryKey:U.externalObjects.issueSummaries(e??"__none__",l),queryFn:r(()=>N7(e,l),"queryFn"),enabled:c,staleTime:6e4});return{summaries:(0,x.useMemo)(()=>new Map(Object.entries(u.data?.summaries??{})),[u.data?.summaries]),isLoading:c&&u.isLoading,isReady:i.isLoaded&&(!c||u.isSuccess)}}r(A7,"useIssueExternalObjectSummaries");var UG={relevance:"Relevance",updated:"Recently updated",created:"Newest created",priority:"Priority"},_7={"24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days","90d":"Last 90 days"};function KA(e){return _7[e]??`Updated ≤ ${e}`}r(KA,"updatedWithinLabel");var E7=new Set(F_);function $G(e){const t=e.get("sort");return t&&E7.has(t)?t:"relevance"}r($G,"parseSearchSort");function BG(e){let t=0;return e.status?.length&&(t+=1),e.priority?.length&&(t+=1),(e.assigneeAgentId!==void 0||e.assigneeUserId)&&(t+=1),e.projectId&&(t+=1),e.labelId&&(t+=1),(e.updatedWithin||e.updatedAfter)&&(t+=1),t}r(BG,"countActiveFilters");function KG(e,t){if(e.assigneeAgentId===null)return"none";if(typeof e.assigneeAgentId=="string")return`agent:${e.assigneeAgentId}`;if(e.assigneeUserId)return e.assigneeUserId===t?"me":`user:${e.assigneeUserId}`}r(KG,"assigneeToken");function qG(e,t,i){const l={...e};return delete l.assigneeAgentId,delete l.assigneeUserId,t&&(t==="none"?l.assigneeAgentId=null:t==="me"?i&&(l.assigneeUserId=i):t.startsWith("agent:")?l.assigneeAgentId=t.slice(6):t.startsWith("user:")&&(l.assigneeUserId=t.slice(5))),l}r(qG,"applyAssigneeToken");function pc(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(pc,"humanize$1");function I7(e,t){return e.assigneeAgentId===null?"Unassigned":typeof e.assigneeAgentId=="string"?t.agentName(e.assigneeAgentId)??"Agent":e.assigneeUserId?e.assigneeUserId===t.currentUserId?"Me":t.userName(e.assigneeUserId)??"User":"Assignee"}r(I7,"assigneeChipLabel");function FG(e,t){const i=[];for(const l of e.status??[])i.push({id:`status:${l}`,label:`Status: ${pc(l)}`,remove:r(c=>{const u={...c},m=(c.status??[]).filter(f=>f!==l);return m.length>0?u.status=m:delete u.status,u},"remove")});for(const l of e.priority??[])i.push({id:`priority:${l}`,label:`Priority: ${pc(l)}`,remove:r(c=>{const u={...c},m=(c.priority??[]).filter(f=>f!==l);return m.length>0?u.priority=m:delete u.priority,u},"remove")});return(e.assigneeAgentId!==void 0||e.assigneeUserId)&&i.push({id:"assignee",label:`Assignee: ${I7(e,t)}`,remove:r(l=>{const c={...l};return delete c.assigneeAgentId,delete c.assigneeUserId,c},"remove")}),e.projectId&&i.push({id:"project",label:`Project: ${t.projectName(e.projectId)??"Project"}`,remove:r(l=>{const c={...l};return delete c.projectId,c},"remove")}),e.labelId&&i.push({id:"label",label:`Label: ${t.labelName(e.labelId)??"Label"}`,remove:r(l=>{const c={...l};return delete c.labelId,c},"remove")}),e.updatedWithin&&i.push({id:"updated",label:`Updated: ${KA(e.updatedWithin)}`,remove:r(l=>{const c={...l};return delete c.updatedWithin,delete c.updatedAfter,c},"remove")}),i}r(FG,"buildFilterChips");function HG(e,t,i){switch(e){case"status":return`Status: ${t.map(pc).join(", ")}`;case"priority":return`Priority: ${t.map(pc).join(", ")}`;case"assigneeAgentId":return`Assignee: ${t.map(l=>i.agentName(l)??"Agent").join(", ")}`;case"assigneeUserId":return`Assignee: ${t.map(l=>l===i.currentUserId?"Me":i.userName(l)??"User").join(", ")}`;case"projectId":return`Project: ${t.map(l=>i.projectName(l)??"Project").join(", ")}`;case"labelId":return`Label: ${t.map(l=>i.labelName(l)??"Label").join(", ")}`;case"updatedWithin":case"updatedAfter":return"Updated window";default:return pc(e)}}r(HG,"describeLoosenSuggestion");function VG(e,t){const i={...e};switch(t){case"status":delete i.status;break;case"priority":delete i.priority;break;case"assigneeAgentId":case"assigneeUserId":delete i.assigneeAgentId,delete i.assigneeUserId;break;case"projectId":delete i.projectId;break;case"labelId":delete i.labelId;break;case"updatedWithin":case"updatedAfter":delete i.updatedWithin,delete i.updatedAfter}return i}r(VG,"clearFilterDimension");var T7='Search title, ID, description… (pick a field or type "exact phrase")';function vk(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(vk,"humanize");function Th(e,t,i,l=""){const c=t?t.kind==="text"&&i.trim()?Pr(t.key,i):"":i;return[...e,l,c].filter(u=>u.trim().length>0).join(" ")}r(Th,"composeRaw");function R7(e,t){typeof e=="function"?e(t):e&&(e.current=t)}r(R7,"assignRef");function yk(e,t,i){const l=!!(t.currentUserId||t.currentAgentId);switch(e){case"status":return[...Ic.map(c=>({id:c,label:vk(c),token:`status:${c}`})),...i.includes("is")?[{id:"is:open",label:"Open",description:"Any open status",token:"is:open"},{id:"is:closed",label:"Closed",description:"Done or cancelled",token:"is:closed"}]:[]];case"priority":return Gg.map(c=>({id:c,label:vk(c),token:`priority:${c}`}));case"assignee":return[...l?[{id:"me",label:"Me",token:"assignee:me"}]:[],{id:"none",label:"Unassigned",token:"assignee:none"},...(t.agents??[]).map(c=>({id:c.id,label:c.name,token:Pr("assignee",c.name)}))];case"author":return[...l?[{id:"me",label:"Me",token:"author:me"}]:[],...(t.agents??[]).map(c=>({id:c.id,label:c.name,token:Pr("author",c.name)}))];case"label":return(t.labels??[]).map(c=>({id:c.id,label:c.name,token:Pr("label",c.name)}));case"project":return(t.projects??[]).map(c=>({id:c.id,label:c.name,token:Pr("project",c.name)}));case"updated":return Dk.map(c=>({id:c,label:KA(c),token:`updated:>${c}`}));default:return[]}}r(yk,"pickerOptions");function D7(e,t){if(!t)return e;const i=[],l=[];for(const c of e){const u=c.label.toLowerCase();u.startsWith(t)||c.id.toLowerCase().startsWith(t)?i.push(c):u.includes(t)&&l.push(c)}return[...i,...l]}r(D7,"rankOptions");function M7({value:e,onChange:t,context:i={},operatorKeys:l=IC,debounceMs:c=250,placeholder:u=T7,ariaLabel:m="Search",className:f,fieldClassName:h,inputClassName:g,clearOnEscape:v=!1,inputRef:y,autoFocus:j,pageSearchTarget:k,trailing:S,onKeyDown:N}){const _=(0,x.useId)(),I=(0,x.useRef)(null),[D,T]=(0,x.useState)(()=>Jo(e,l).tokens),[C,M]=(0,x.useState)(()=>Jo(e,l).text),[z,K]=(0,x.useState)(null),[P,A]=(0,x.useState)(""),[B,O]=(0,x.useState)(!1),[W,Y]=(0,x.useState)(-1),ce=(0,x.useRef)(e),oe=(0,x.useRef)(i);oe.current=i;const $=(0,x.useRef)(t);$.current=t;const R=(0,x.useRef)(l);R.current=l;const ne=(0,x.useMemo)(()=>Az.filter(de=>de.kind==="text"||l.includes(de.key)),[l]),ue=Th(D,z,C,z?P:"");(0,x.useEffect)(()=>{if(e===ce.current)return;ce.current=e;const de=Jo(e,R.current);T(de.tokens),M(de.text),K(null),A("")},[e]);const ae=(0,x.useCallback)(de=>{ce.current=de;const Oe=Ql(de,{...oe.current,operatorKeys:R.current}),qe={raw:de,q:Oe.query,filters:Oe.filters};c<=0?$.current(qe):(0,x.startTransition)(()=>$.current(qe))},[c]);(0,x.useEffect)(()=>{if(ue===ce.current)return;if(c<=0){ae(ue);return}const de=window.setTimeout(()=>{ue!==ce.current&&ae(ue)},c);return()=>window.clearTimeout(de)},[c,ae,ue]);const Ee=(0,x.useCallback)(de=>ne.find(Oe=>Oe.key===de.toLowerCase())??null,[ne]),fe=(0,x.useMemo)(()=>{if(z){if(z.kind==="text")return[];const qe=C.trim().replace(/"/g,"").toLowerCase();return D7(yk(z.key,i,l),qe)}const{token:de}=ah(C);if(de.includes(":")||de.startsWith('"'))return[];const Oe=de.toLowerCase();return ne.filter(qe=>!Oe||qe.key.startsWith(Oe)||qe.label.toLowerCase().startsWith(Oe)).map(qe=>({id:qe.key,label:qe.label,description:qe.description,field:qe}))},[i,C,ne,l,z]),Ae=B&&fe.length>0;(0,x.useEffect)(()=>{Y(z&&z.kind==="picker"?0:-1)},[z,C]);const Ce=r(()=>I.current?.focus(),"focusInput"),Se=r((de,Oe)=>{A(Oe.trim()),K(de),M(""),O(!0),Ce()},"startField"),he=r(()=>{K(null),M(P?`${P} `:""),A("")},"releaseHeldText"),De=r((de,Oe=!0)=>{T(qe=>[...qe,de]),he(),O(Oe),Ce()},"commitToken"),Ye=r((de,Oe=!0)=>{if(de.field){Se(de.field,C.slice(0,ah(C).start));return}de.token&&De(de.token,Oe)},"selectOption"),ze=r(de=>{const Oe=/\s$/.test(de);if(Oe&&O(!0),z){M(de);return}const{start:qe,token:ut}=ah(de),Vt=/^([a-zA-Z]+):$/.exec(ut),Wt=Vt?Ee(Vt[1]):null;if(Wt){Se(Wt,de.slice(0,qe));return}const H=Jo(de,l,!Oe);if(H.tokens.length>0){T(rn=>[...rn,...H.tokens]),M(H.text&&Oe?`${H.text} `:H.text);return}M(de)},"handleDraftChange"),ve=r(de=>{T(Oe=>Oe.filter((qe,ut)=>ut!==de)),Ce()},"removeToken"),ft=r(()=>{if(!z)return!1;const de=C.trim();if(!de)return!1;if(z.kind==="text")return De(Pr(z.key,de)),!0;const Oe=de.toLowerCase(),qe=yk(z.key,i,l).find(ut=>ut.label.toLowerCase()===Oe||ut.id.toLowerCase()===Oe)??(Ae&&W>=0?fe[W]:void 0)??(fe.length===1?fe[0]:void 0);return qe?.token?(De(qe.token),!0):!1},"commitPendingDraft"),At=r(de=>{const Oe=de.nativeEvent.isComposing;if(!Oe&&de.key==="Tab"&&!de.shiftKey&&(z||Ae)){if(de.preventDefault(),ft())return;if(!z&&Ae&&W>=0&&fe[W]){Ye(fe[W]);return}z||O(!1);return}if(!Oe&&de.key==="ArrowDown"){if(de.preventDefault(),!B){O(!0);return}fe.length>0&&Y(qe=>(qe+1)%fe.length);return}if(!Oe&&de.key==="ArrowUp"&&Ae){de.preventDefault(),Y(qe=>qe<=0?fe.length-1:qe-1);return}if(!Oe&&de.key==="Enter"){if(Ae&&W>=0&&fe[W]){de.preventDefault(),Ye(fe[W],!1);return}let qe=ue;if(z?.kind==="text"&&C.trim()){const ut=Pr(z.key,C.trim());De(ut,!1),qe=Th([...D,ut],null,P)}else if(!z){const ut=Jo(C,l);ut.tokens.length>0&&(T([...D,...ut.tokens]),M(ut.text),qe=Th([...D,...ut.tokens],null,ut.text))}qe!==ce.current&&ae(qe),O(!1)}if(!Oe&&de.key==="Escape"&&Ae&&(O(!1),C.length>0||z)){de.preventDefault();return}if(!Oe&&de.key==="Escape"&&v&&ue.length>0){de.preventDefault(),T([]),K(null),A(""),M(""),ce.current="",$.current({raw:"",q:"",filters:{}});return}if(!Oe&&de.key==="Backspace"&&de.currentTarget.selectionStart===0&&de.currentTarget.selectionEnd===0){if(z){de.preventDefault(),he();return}if(D.length>0){de.preventDefault(),T(qe=>qe.slice(0,-1));return}}N?.(de)},"handleKeyDown"),xt=D.map(de=>Tz(de,i)),Pt=z?z.kind==="text"?`${z.label}: type text, Tab or Enter to add`:`Pick ${z.label.toLowerCase()}…`:D.length>0?"":u;return(0,s.jsxs)("div",{className:X("relative",f),"data-testid":"scoped-search",children:[(0,s.jsxs)("div",{className:X("flex h-8 w-full min-w-0 items-center gap-1 overflow-x-auto rounded-md border border-line-strong bg-transparent pl-7 pr-1 shadow-xs focus-within:border-focus focus-within:ring-(length:--rad-3) focus-within:ring-focus/50 dark:bg-line-strong/30",h),onMouseDown:r(de=>{de.target===de.currentTarget&&(de.preventDefault(),Ce())},"onMouseDown"),children:[(0,s.jsx)(Kr,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),xt.map((de,Oe)=>(0,s.jsxs)(Bn,{variant:"secondary",className:"max-w-56 gap-1 pr-0.5 font-normal","data-testid":"scoped-search-pill",children:[(0,s.jsx)("span",{className:"truncate",children:de.label}),(0,s.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg/60","aria-label":`Remove ${de.label}`,onMouseDown:r(qe=>qe.preventDefault(),"onMouseDown"),onClick:r(()=>ve(Oe),"onClick"),children:(0,s.jsx)(is,{className:"h-3 w-3"})})]},`${D[Oe]}:${Oe}`)),z?(0,s.jsxs)(Bn,{variant:"outline",className:"gap-1 pr-0.5 font-normal","data-testid":"scoped-search-pending-field",children:[(0,s.jsxs)("span",{children:[z.key,":"]}),(0,s.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg-3","aria-label":`Remove ${z.label} field`,onMouseDown:r(de=>de.preventDefault(),"onMouseDown"),onClick:r(()=>{he(),Ce()},"onClick"),children:(0,s.jsx)(is,{className:"h-3 w-3"})})]}):null,(0,s.jsx)("input",{ref:r(de=>{I.current=de,R7(y,de)},"ref"),role:"combobox","aria-label":m,"aria-expanded":Ae,"aria-controls":_,"aria-autocomplete":"list","aria-activedescendant":Ae&&W>=0?`${_}-${W}`:void 0,autoFocus:j,value:C,placeholder:Pt,"data-page-search-target":k?"true":void 0,className:X("h-full min-w-24 flex-1 bg-transparent text-base outline-none placeholder:text-ink-3 md:text-sm",g),onChange:r(de=>ze(de.target.value),"onChange"),onFocus:r(()=>O(!0),"onFocus"),onBlur:r(()=>O(!1),"onBlur"),onKeyDown:At}),S]}),Ae?(0,s.jsx)("div",{id:_,role:"listbox","aria-label":z?`${z.label} values`:"Search fields",className:"absolute left-0 top-full z-50 mt-1 max-h-64 w-full min-w-56 overflow-y-auto rounded-md border border-line bg-bg-2 p-1 text-ink shadow-md","data-testid":"scoped-search-options",children:fe.map((de,Oe)=>(0,s.jsxs)("div",{id:`${_}-${Oe}`,role:"option","aria-selected":Oe===W,className:X("flex cursor-pointer items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-sm",Oe===W?"bg-bg-3 text-ink":"hover:bg-bg-3/50"),onMouseDown:r(qe=>qe.preventDefault(),"onMouseDown"),onMouseEnter:r(()=>Y(Oe),"onMouseEnter"),onClick:r(()=>Ye(de),"onClick"),children:[(0,s.jsx)("span",{className:"truncate",children:de.label}),de.description?(0,s.jsx)("span",{className:"hidden truncate text-xs text-ink-3 sm:inline",children:de.description}):null]},de.id))}):null]})}r(M7,"ScopedSearchInput");function qA(e){if(e.length<=1)return[...e];const t=r((v,y)=>{const j=jk(v.createdAt),k=jk(y.createdAt);return j!==k?j-k:v.id<y.id?-1:v.id>y.id?1:0},"tieBreakAsc"),i=new Map;for(const v of e)i.set(v.id,v);const l=new Map,c=new Map;for(const v of e)l.set(v.id,[]),c.set(v.id,0);for(const v of e){const y=new Set;for(const j of v.blockedBy??[])!j||!i.has(j.id)||j.id!==v.id&&(y.has(j.id)||(y.add(j.id),l.get(j.id).push(v.id),c.set(v.id,(c.get(v.id)??0)+1)))}for(const v of l.values())v.sort((y,j)=>t(i.get(y),i.get(j)));const u=[];for(const v of e)c.get(v.id)===0&&u.push(v);u.sort(t);const m=new Set,f=[],h=r(v=>{let y=0,j=u.length;for(;y<j;){const k=y+j>>>1;t(u[k],v)<=0?y=k+1:j=k}u.splice(y,0,v)},"insertReady"),g=r(v=>{for(const y of l.get(v)??[]){if(m.has(y))continue;const j=(c.get(y)??0)-1;if(c.set(y,j),j===0){const k=i.get(y);k&&h(k)}}},"releaseSuccessors");for(;u.length>0;){let v=u.shift();for(;v&&!m.has(v.id);){f.push(v),m.add(v.id),g(v.id);const y=l.get(v.id)??[];if(y.length!==1)break;const j=y[0];if(m.has(j)||(c.get(j)??0)!==0)break;const k=u.findIndex(S=>S.id===j);if(k<0)break;[v]=u.splice(k,1)}}return m.size<e.length?[...e].sort(t):f}r(qA,"workflowSort");function jk(e){if(!e)return 0;const t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:0}r(jk,"toTimestamp");var O7=2;function L7(e,t){return e===!0&&t>=O7}r(L7,"shouldRenderSubIssueProgressSummary");function z7(e){const t={},i=e.filter(f=>f.status!=="cancelled");for(const f of i)t[f.status]=(t[f.status]??0)+1;const l=qA(i),c=l.find(f=>P7(f.status))??null,u=l.filter(f=>!U7(f.status)),m=c===null&&u.length>0&&u.every(f=>f.status==="blocked")?u[0]:null;return{totalCount:i.length,doneCount:t.done??0,inProgressCount:t.in_progress??0,blockedCount:t.blocked??0,countsByStatus:t,target:c?{issue:c,kind:"next"}:m?{issue:m,kind:"blocked"}:null}}r(z7,"buildSubIssueProgressSummary");function P7(e){return e!=="done"&&e!=="cancelled"&&e!=="blocked"}r(P7,"isActionableStatus");function U7(e){return e==="done"||e==="cancelled"}r(U7,"isTerminalStatus");function Dl(e,t){const i={};for(const l of e){const c=t(l);i[c]||(i[c]=[]),i[c].push(l)}return i}r(Dl,"groupBy");function $7(e){return e==="queued"||e==="running"}r($7,"isLiveRunStatus");var B7=new Set(["done","cancelled"]);function qg(e){return B7.has(e)}r(qg,"isTerminalIssueStatus");function FA(e,t){return $7(e.status)&&!qg(t)}r(FA,"isLiveIssueRun");function K7(e){const t=new Map;for(const i of e??[]){const l={status:i.status,updatedAtMs:q7(i.updatedAt)},c=t.get(i.id);(!c||F7(c,l))&&t.set(i.id,l)}return new Map([...t].map(([i,l])=>[i,l.status]))}r(K7,"collectIssueStatusById");function q7(e){if(e==null)return null;const t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:null}r(q7,"issueUpdatedAtMs");function F7(e,t){if(t.updatedAtMs!==null&&e.updatedAtMs!==null){if(t.updatedAtMs!==e.updatedAtMs)return t.updatedAtMs>e.updatedAtMs}else{if(t.updatedAtMs!==null)return!0;if(e.updatedAtMs!==null)return!1}return!qg(e.status)&&qg(t.status)}r(F7,"shouldReplaceIssueStatusSnapshot");function H7(e,t){const i=new Set,l=K7(t);for(const c of e??[])c.issueId&&FA(c,l.get(c.issueId))&&i.add(c.issueId);return i}r(H7,"collectLiveIssueIds");function HA(e,t){const i=new Map;if(!e||e.length===0||t.size===0)return i;const l=new Map;for(const c of e)l.set(c.id,c.parentId);for(const c of t){if(!l.has(c))continue;const u=new Set([c]);let m=l.get(c)??null;for(;m&&!u.has(m);)u.add(m),i.set(m,(i.get(m)??0)+1),m=l.get(m)??null}return i}r(HA,"collectSubtreeLiveCounts");var V7=["assignee","kickedOffBy","project","workspace","parent","labels","updated"],W7={status:"Status",id:"ID",assignee:"Responsible",kickedOffBy:"Kicked off by",project:"Project",workspace:"Workspace",parent:"Parent task",labels:"Tags",updated:"Last updated"},Q7={status:"Task state chip on the left edge.",id:"Ticket identifier like PAP-1009.",assignee:"Responsible agent or board user.",kickedOffBy:"Board user or agent who created the task.",project:"Linked project pill with its color.",workspace:"Execution or project workspace used for the task.",parent:"Parent task identifier and title.",labels:"Task labels and tags.",updated:"Latest visible activity time."};function G7(e,t="legacy"){return e==="id"&&t==="task"?"Task identifier like PAP-1009 on the trailing edge.":e==="status"&&t==="task"?"Task state icon on the leading edge.":Q7[e]}r(G7,"issueColumnDescription");function cf(e){return OE(e.lastActivityAt??e.lastExternalCommentAt??e.updatedAt)}r(cf,"issueActivityTimestamp");function Y7(e){return`Updated ${cf(e)}`}r(Y7,"issueActivityText");function X7(e){return e.map(t=>t==="assignee"||t==="kickedOffBy"?"minmax(6rem, 8rem)":t==="project"?"minmax(4.5rem, 7rem)":t==="workspace"?"minmax(6rem, 9rem)":t==="parent"?"minmax(3.5rem, 5.5rem)":t==="labels"?"minmax(3rem, 6rem)":"minmax(3.5rem, 4.5rem)").join(" ")}r(X7,"issueTrailingGridTemplate");function Z7({availableColumns:e,visibleColumnSet:t,onToggleColumn:i,showDateGroupSeparators:l,onToggleDateGroupSeparators:c,onResetColumns:u,title:m,iconOnly:f=!1,rowPresentation:h="legacy"}){return(0,s.jsxs)(Gr,{children:[(0,s.jsx)(Wr,{asChild:!0,children:(0,s.jsxs)(le,{type:"button",variant:f?"secondary":"ghost",size:f?"icon":"sm",className:f?"h-8 w-8 shrink-0":"hidden h-8 shrink-0 px-2 text-xs sm:inline-flex",title:"Columns",children:[(0,s.jsx)(kI,{className:f?"h-3.5 w-3.5":"mr-1 h-3.5 w-3.5"}),!f&&"Columns"]})}),(0,s.jsxs)(Qr,{align:"end",className:"w-(--sz-300px) rounded-xl border-line/70 p-1.5 shadow-xl shadow-black/10",children:[(0,s.jsx)(oS,{className:"px-2 pb-1 pt-1.5",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-ink-3",children:"Desktop task rows"}),(0,s.jsx)("div",{className:"text-sm font-medium text-ink",children:m})]})}),(0,s.jsx)(ki,{}),e.map(g=>(0,s.jsx)(Ny,{checked:t.has(g),onSelect:r(v=>v.preventDefault(),"onSelect"),onCheckedChange:r(v=>i(g,v===!0),"onCheckedChange"),className:"items-start rounded-lg px-3 py-2.5 pl-8",children:(0,s.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-ink",children:W7[g]}),(0,s.jsx)("span",{className:"text-xs leading-relaxed text-ink-3",children:G7(g,h)})]})},g)),l!==void 0&&c?(0,s.jsx)(Ny,{checked:l,onSelect:r(g=>g.preventDefault(),"onSelect"),onCheckedChange:r(g=>c(g===!0),"onCheckedChange"),className:"items-start rounded-lg px-3 py-2.5 pl-8",children:(0,s.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-ink",children:"Date group separators"}),(0,s.jsx)("span",{className:"text-xs leading-relaxed text-ink-3",children:"Show Today, Yesterday, and Earlier rules on newest-first task lists."})]})}):null,(0,s.jsx)(ki,{}),(0,s.jsxs)(Cn,{onSelect:u,className:"rounded-lg px-3 py-2 text-sm",children:["Reset defaults",(0,s.jsx)("span",{className:"ml-auto text-xs text-ink-3",children:"status, id, updated"})]})]})]})}r(Z7,"IssueColumnPicker");function J7(){return(0,s.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,s.jsx)("span",{className:"absolute inline-flex h-full w-full animate-pulse rounded-full bg-blue-400 opacity-75"}),(0,s.jsx)("span",{className:X("relative inline-flex h-2 w-2 rounded-full","bg-blue-500")})]})}r(J7,"LiveRunDot");function e9(){return(0,s.jsxs)(Bn,{variant:"ghost",className:X("px-1.5 sm:gap-1.5 sm:px-2","bg-blue-500/10"),children:[(0,s.jsx)(J7,{}),(0,s.jsx)("span",{className:X("hidden text-(length:--text-micro) font-medium sm:inline","text-blue-600 dark:text-blue-400"),children:"Live"})]})}r(e9,"LiveRunBadge");function wk({issue:e,isLive:t,subtreeLiveCount:i=0,showSubtreeLiveChip:l=!0,showStatus:c=!0,showIdentifier:u=!0,statusSlot:m,checklistStepNumber:f=null}){return(0,s.jsxs)(s.Fragment,{children:[c?(0,s.jsx)("span",{className:"hidden shrink-0 items-center sm:inline-flex",children:m??(0,s.jsx)(Ya,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention})}):null,f!==null?(0,s.jsxs)("span",{className:"shrink-0 font-mono text-xs text-ink-3","aria-hidden":"true",children:[f,"."]}):null,u?(0,s.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:e.identifier??e.id.slice(0,8)}):null,t&&(0,s.jsx)(e9,{}),l&&!t&&i>0&&(0,s.jsxs)(Bn,{variant:"outline",className:X("px-1.5 sm:gap-1.5 sm:px-2","border-line bg-transparent"),title:`${i} sub-task${i===1?"":"s"} running below`,children:[(0,s.jsx)("span",{className:X("h-2 w-2 shrink-0 rounded-full border","border-ink-3/60 bg-transparent"),"aria-hidden":"true"}),(0,s.jsxs)("span",{className:"hidden text-(length:--text-micro) font-medium text-ink-3 sm:inline",children:[i," live below"]})]})]})}r(wk,"InboxIssueMetaLeading");function t9({issue:e,columns:t,projectName:i,projectColor:l,workspaceId:c,workspaceName:u,assigneeName:m,assigneeAgent:f,creatorAgent:h,assigneeUserName:g,assigneeUserAvatarUrl:v,creatorAgentName:y,creatorUserName:j,creatorUserAvatarUrl:k,viaAgentName:S,currentUserId:N,parentIdentifier:_,parentTitle:I,assigneeContent:D,onFilterWorkspace:T}){const C=cf(e),M=g??Ur(e.assigneeUserId,N)??"User",z=Kk(e),K=z?.kind==="user"?z.id:null,P=j??Ur(K,N)??"User";return(0,s.jsx)("span",{className:"grid items-center gap-2",style:{gridTemplateColumns:X7(t)},children:t.map(A=>{if(A==="assignee")return D?(0,s.jsx)("span",{className:"min-w-0",children:D},A):e.assigneeAgentId?(0,s.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,s.jsx)(Wl,{agent:f??{id:e.assigneeAgentId,name:m??e.assigneeAgentId.slice(0,8)},size:"sm",className:"min-w-0"})},A):e.assigneeUserId?(0,s.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,s.jsx)(Hh,{name:M,avatarUrl:v,size:"sm",className:"min-w-0"})},A):(0,s.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"Unassigned"},A);if(A==="kickedOffBy"){if(z?.kind==="agent"){const B=y??z.id.slice(0,8);return(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,s.jsx)(Wl,{agent:h??{id:z.id,name:B},size:"sm",className:"min-w-0"})})}),(0,s.jsx)(Ea,{side:"top",sideOffset:6,children:B})]},A)}if(z?.kind==="user"){const B=S?`${P} · via ${S}`:P;return(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,s.jsx)(Hh,{name:P,avatarUrl:k,size:"sm",className:"min-w-0"})})}),(0,s.jsx)(Ea,{side:"top",sideOffset:6,children:B})]},A)}return(0,s.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"Unknown"},A)}if(A==="project"){if(i){const B=l??"#64748b";return(0,s.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-2 text-xs font-medium",style:{color:$y(B,.12)},children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:B}}),(0,s.jsx)("span",{className:"truncate",children:i})]},A)}return(0,s.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"No project"},A)}return A==="labels"?(e.labels??[]).length>0?(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[(e.labels??[]).slice(0,2).map(B=>(0,s.jsx)(Bn,{variant:"outline",className:"min-w-0 max-w-full px-1.5 py-0 text-(length:--text-nano)",style:{borderColor:B.color,color:$y(B.color,.12),backgroundColor:`${B.color}1f`},children:(0,s.jsx)("span",{className:"truncate",children:B.name})},B.id)),(e.labels??[]).length>2?(0,s.jsxs)("span",{className:"shrink-0 text-(length:--text-nano) font-medium text-ink-3",children:["+",(e.labels??[]).length-2]}):null]},A):(0,s.jsx)("span",{className:"min-w-0","aria-hidden":"true"},A):A==="workspace"?u?(0,s.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:c&&T?(0,s.jsxs)(Ia,{children:[(0,s.jsx)(_a,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:"truncate rounded-sm text-left text-xs text-ink-3 transition-colors hover:text-ink hover:underline",onClick:r(B=>{B.preventDefault(),B.stopPropagation(),T(c)},"onClick"),children:u})}),(0,s.jsx)(Ea,{side:"top",sideOffset:6,children:"Filter by workspace"})]}):u},A):(0,s.jsx)("span",{className:"min-w-0","aria-hidden":"true"},A):A==="parent"?e.parentId?(0,s.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",title:I??void 0,children:_?(0,s.jsx)("span",{className:"font-mono",children:_}):(0,s.jsx)("span",{className:"italic",children:"Sub-task"})},A):(0,s.jsx)("span",{className:"min-w-0","aria-hidden":"true"},A):A==="updated"?(0,s.jsx)("span",{className:"min-w-0 truncate text-right text-(length:--text-micro) font-medium text-ink-3",children:C},A):null})})}r(t9,"InboxIssueTrailingColumns");function n9({icon:e,title:t,message:i,description:l,action:c,onAction:u,hideActionIcon:m=!1}){return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,s.jsx)("div",{className:"bg-bg-3/50 p-4 mb-4",children:(0,s.jsx)(e,{className:"h-10 w-10 text-ink-3/50"})}),t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-base font-semibold text-ink mb-1.5",children:t}),(0,s.jsx)("p",{className:"text-sm text-ink-3 mb-4 max-w-md",children:i})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-ink mb-1",children:i}),l&&(0,s.jsx)("p",{className:"max-w-md text-sm text-ink-3 mb-4",children:l})]}),c&&u&&(0,s.jsxs)(le,{onClick:u,children:[!m&&(0,s.jsx)(Js,{className:"h-4 w-4 mr-1.5"}),c]})]})}r(n9,"EmptyState");function s9({label:e,collapsible:t=!1,collapsed:i=!1,onToggle:l,trailing:c,className:u}){return(0,s.jsxs)("div",{className:X("flex items-center py-1.5 pl-1 pr-3",u),children:[t?(0,s.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left","aria-expanded":!i,onClick:l,children:[(0,s.jsx)("span",{className:"inline-flex w-4 shrink-0 items-center justify-center",children:(0,s.jsx)(nr,{className:X("h-3.5 w-3.5 shrink-0 text-ink-3 transition-transform",!i&&"rotate-90")})}),(0,s.jsx)("span",{className:"truncate text-sm font-semibold uppercase tracking-wide",children:e})]}):(0,s.jsx)("div",{className:"flex min-w-0 items-center gap-1.5",children:(0,s.jsx)("span",{className:"truncate text-sm font-semibold uppercase tracking-wide",children:e})}),c?(0,s.jsx)("div",{className:"ml-auto",children:c}):null]})}r(s9,"IssueGroupHeader");var Rh={critical:{icon:Ja,color:Wu.critical??"text-yellow-600 dark:text-yellow-400",label:"Critical"},high:{icon:dS,color:Wu.high??"text-yellow-600 dark:text-yellow-400",label:"High"},medium:{icon:KI,color:Wu.medium??"text-yellow-600 dark:text-yellow-400",label:"Medium"},low:{icon:JE,color:Wu.low??"text-yellow-600 dark:text-yellow-400",label:"Low"}},a9=["critical","high","medium","low"];function WG({priority:e,onChange:t,className:i,showLabel:l}){const[c,u]=(0,x.useState)(!1),m=Rh[e]??Rh.medium,f=m.icon,h=(0,s.jsx)("span",{className:X("inline-flex items-center justify-center shrink-0",m.color,t&&!l&&"cursor-pointer",i),children:(0,s.jsx)(f,{className:"h-3.5 w-3.5"})});if(!t)return l?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[h,(0,s.jsx)("span",{className:"text-sm",children:m.label})]}):h;const g=l?(0,s.jsxs)("button",{type:"button","aria-label":`Change priority (current: ${m.label})`,className:"inline-flex min-h-5 items-center gap-1.5 cursor-pointer hover:bg-bg-3/50 rounded px-1 -mx-1 py-0.5 transition-colors",children:[h,(0,s.jsx)("span",{className:"text-sm",children:m.label})]}):(0,s.jsx)("button",{type:"button","data-slot":"icon-button","aria-label":`Change priority (current: ${m.label})`,className:"inline-flex cursor-pointer items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus",children:h});return(0,s.jsxs)(va,{open:c,onOpenChange:u,children:[(0,s.jsx)(xa,{asChild:!0,children:g}),(0,s.jsx)(ba,{className:"w-36 p-1",align:"start",children:a9.map(v=>{const y=Rh[v],j=y.icon;return(0,s.jsxs)(le,{active:v===e,variant:"ghost",size:"sm",className:X("w-full justify-start gap-2 text-xs"),onClick:r(()=>{t(v),u(!1)},"onClick"),children:[(0,s.jsx)(j,{className:X("h-3.5 w-3.5",y.color)}),y.label]},v)})})]})}r(WG,"PriorityIcon");var i9=[["everything","All categories"],["issues_i_touched","My recent tasks"],["join_requests","Join requests"],["approvals","Approvals"],["failed_runs","Failed runs"],["alerts","Alerts"]],r9=[["all","All approval statuses"],["actionable","Needs action"],["resolved","Resolved"]],Dh=6;function Mh({value:e,onChange:t,label:i}){return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(Kr,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-ink-3"}),(0,s.jsx)(Wn,{value:e,onChange:r(l=>t(l.target.value),"onChange"),placeholder:`Search ${i.toLowerCase()}...`,"aria-label":`Search ${i.toLowerCase()}`,className:"h-8 pl-7 text-xs"})]})}r(Mh,"FilterOptionSearch");function l9({state:e,onChange:t,activeFilterCount:i,agents:l,projects:c,labels:u,currentUserId:m,enableExternalObjectFilters:f=!0,enableRoutineVisibilityFilter:h=!1,buttonVariant:g="ghost",iconOnly:v=!1,creators:y,presentation:j="legacy",inboxScopeFilters:k}){const S=j==="streamlined",[N,_]=(0,x.useState)(""),[I,D]=(0,x.useState)(""),[T,C]=(0,x.useState)(""),[M,z]=(0,x.useState)(""),K=(0,x.useMemo)(()=>Bp(l,I,$=>$.name),[l,I]),P=(0,x.useMemo)(()=>Bp(c,T,$=>$.name),[c,T]),A=(0,x.useMemo)(()=>Bp(u,M,$=>$.name),[u,M]),B=y??[],O=(0,x.useMemo)(()=>new Map(B.map($=>[$.id,$])),[B]),W=N.trim().toLowerCase(),Y=(0,x.useMemo)(()=>W?B.filter($=>`${$.label} ${$.searchText??""}`.toLowerCase().includes(W)):B,[B,W]),ce=(0,x.useMemo)(()=>e.creators.map($=>{const R=O.get($);if(R)return R;if($.startsWith("agent:"))return{id:$,label:$.slice(6).slice(0,8),kind:"agent"};const ne=$.startsWith("user:")?$.slice(5):$;return{id:$,label:Ur(ne,m)??ne.slice(0,5),kind:"user"}}),[O,m,e.creators]),oe=r(()=>{t(CS),k?.onClear()},"clearFilters");return(0,s.jsxs)(va,{children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsxs)(le,{variant:g,size:v?"icon":"sm",className:`text-xs ${v?"relative h-8 w-8 shrink-0":""}`,title:v?i>0?`Filters: ${i}`:"Filter":void 0,children:[(0,s.jsx)(PI,{className:v?"h-3.5 w-3.5":"h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1"}),!v&&(0,s.jsx)("span",{className:"hidden sm:inline",children:i>0?`Filters: ${i}`:"Filter"}),!v&&i>0?(0,s.jsx)("span",{className:"ml-0.5 text-(length:--text-nano) font-medium sm:hidden",children:i}):null,v&&i>0?(0,s.jsx)("span",{className:"absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-(length:--text-nano) font-bold text-white",children:i}):null,!v&&i>0?(0,s.jsx)(is,{className:"ml-1 hidden h-3 w-3 sm:block",onClick:r($=>{$.stopPropagation(),oe()},"onClick")}):null]})}),(0,s.jsx)(ba,{align:"end",className:S?"w-(--sz-calc-10) max-h-(--sz-calc-9) overflow-y-auto overscroll-contain p-0":"w-(--sz-calc-10) p-0",children:(0,s.jsxs)("div",{className:"space-y-3 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Filters"}),i>0?(0,s.jsx)("button",{type:"button",className:"text-xs text-ink-3 hover:text-ink",onClick:oe,children:"Clear"}):null]}),k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1","data-filter-options":"inbox-category",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Category"}),(0,s.jsx)("div",{className:"space-y-0.5",children:i9.map(([$,R])=>{const ne=k.category===$;return(0,s.jsxs)("button",{type:"button","aria-pressed":ne,className:X("flex w-full items-center justify-between rounded-sm px-2 py-1 text-left text-sm",ne?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),onClick:r(()=>k.onCategoryChange($),"onClick"),children:[(0,s.jsx)("span",{children:R}),ne?(0,s.jsx)(Ta,{className:"h-3.5 w-3.5"}):null]},$)})})]}),k.showApprovalStatus?(0,s.jsxs)("div",{className:"space-y-1","data-filter-options":"inbox-approval-status",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Approval status"}),(0,s.jsx)("div",{className:"space-y-0.5",children:r9.map(([$,R])=>{const ne=k.approvalStatus===$;return(0,s.jsxs)("button",{type:"button","aria-pressed":ne,className:X("flex w-full items-center justify-between rounded-sm px-2 py-1 text-left text-sm",ne?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),onClick:r(()=>k.onApprovalStatusChange($),"onClick"),children:[(0,s.jsx)("span",{children:R}),ne?(0,s.jsx)(Ta,{className:"h-3.5 w-3.5"}):null]},$)})})]}):null]}),(0,s.jsx)("div",{className:"border-t border-line"})]}):null,(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Quick filters"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:N3.map($=>{const R=A3(e.statuses,$.statuses);return(0,s.jsx)(iT,{selected:R,onClick:r(()=>t({statuses:R?[]:[...$.statuses]}),"onClick"),children:$.label},$.label)})})]}),(0,s.jsx)("div",{className:"border-t border-line"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Status"}),(0,s.jsx)("div",{className:"space-y-0.5",children:Pd.map($=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.statuses.includes($),onCheckedChange:r(()=>t({statuses:Qi(e.statuses,$)}),"onCheckedChange")}),(0,s.jsx)(Ya,{status:$}),(0,s.jsx)("span",{className:"text-sm",children:Qh($)})]},$))})]}),!1]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Responsible"}),S&&(l?.length??0)+(m?2:1)>Dh?(0,s.jsx)(Mh,{value:I,onChange:D,label:"Responsible"}):null,(0,s.jsxs)("div",{"data-filter-options":"responsible",className:S?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:[(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.assignees.includes("__unassigned"),onCheckedChange:r(()=>t({assignees:Qi(e.assignees,"__unassigned")}),"onCheckedChange")}),(0,s.jsx)("span",{className:"text-sm",children:"No responsible"})]}),m?(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.assignees.includes("__me"),onCheckedChange:r(()=>t({assignees:Qi(e.assignees,"__me")}),"onCheckedChange")}),(0,s.jsx)(Kl,{className:"h-3.5 w-3.5 text-ink-3"}),(0,s.jsx)("span",{className:"text-sm",children:"Me"})]}):null,(S?K:l??[]).map($=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.assignees.includes($.id),onCheckedChange:r(()=>t({assignees:Qi(e.assignees,$.id)}),"onCheckedChange")}),(0,s.jsx)("span",{className:"text-sm",children:$.name})]},$.id))]})]}),B.length>0?(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Creator"}),ce.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:ce.map($=>(0,s.jsxs)(Bn,{variant:"secondary",className:"gap-1 pr-1",children:[$.kind==="agent"?(0,s.jsx)(hc,{className:"h-3 w-3"}):(0,s.jsx)(Kl,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:$.label}),(0,s.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg-3",onClick:r(()=>t({creators:e.creators.filter(R=>R!==$.id)}),"onClick"),"aria-label":`Remove creator ${$.label}`,children:(0,s.jsx)(is,{className:"h-3 w-3"})})]},$.id))}):null,(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(Kr,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-ink-3"}),(0,s.jsx)(Wn,{value:N,onChange:r($=>_($.target.value),"onChange"),placeholder:"Search creators...",className:"h-8 pl-7 text-xs"})]}),(0,s.jsx)("div",{"data-filter-options":"creators",className:S?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:Y.length>0?Y.map($=>{const R=e.creators.includes($.id);return(0,s.jsxs)("button",{type:"button",className:`flex w-full items-center gap-2 rounded-sm px-2 py-1 text-left text-sm ${R?"bg-bg-3 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"}`,onClick:r(()=>t({creators:Qi(e.creators,$.id)}),"onClick"),children:[$.kind==="agent"?(0,s.jsx)(hc,{className:"h-3.5 w-3.5"}):(0,s.jsx)(Kl,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:$.label}),R?(0,s.jsx)(is,{className:"h-3 w-3"}):null]},$.id)}):(0,s.jsx)("div",{className:"px-2 py-1 text-xs text-ink-3",children:"No creators match."})})]}):null,c&&c.length>0?(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Project"}),S&&c.length>Dh?(0,s.jsx)(Mh,{value:T,onChange:C,label:"Projects"}):null,(0,s.jsx)("div",{"data-filter-options":"projects",className:S?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:(S?P:c).map($=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.projects.includes($.id),onCheckedChange:r(()=>t({projects:Qi(e.projects,$.id)}),"onCheckedChange")}),(0,s.jsx)("span",{className:"text-sm",children:$.name})]},$.id))})]}):null]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-3",children:[u&&u.length>0?(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Labels"}),S&&u.length>Dh?(0,s.jsx)(Mh,{value:M,onChange:z,label:"Labels"}):null,(0,s.jsx)("div",{"data-filter-options":"labels",className:S?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:(S?A:u).map($=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.labels.includes($.id),onCheckedChange:r(()=>t({labels:Qi(e.labels,$.id)}),"onCheckedChange")}),(0,s.jsx)("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:$.color}}),(0,s.jsx)("span",{className:"text-sm",children:$.name})]},$.id))})]}):null,f?(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"External object status"}),(0,s.jsx)("div",{className:"space-y-0.5",children:w3.map($=>{const R=$==="failed"?"failed":$==="waiting"?"waiting":$==="running"?"running":$==="auth_required"?"auth_required":$==="unreachable"?"unreachable":$==="stale"?"unknown":"closed",ne=xS(R),ue=(NE[R]??"").split(" ").filter(ae=>ae.startsWith("text-")).join(" ");return(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.externalObjectStatuses.includes($),onCheckedChange:r(()=>t({externalObjectStatuses:Qi(e.externalObjectStatuses,$)}),"onCheckedChange")}),(0,s.jsx)(ne,{className:`h-3.5 w-3.5 shrink-0 ${ue}`,"aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-sm",children:S3($)})]},$)})})]}):null,(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-xs text-ink-3",children:"Visibility"}),(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.liveOnly,onCheckedChange:r($=>t({liveOnly:$===!0}),"onCheckedChange")}),(0,s.jsx)("span",{className:"text-sm",children:"Live runs only"})]}),h?(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,s.jsx)(vi,{checked:e.hideRoutineExecutions,onCheckedChange:r($=>t({hideRoutineExecutions:$===!0}),"onCheckedChange")}),(0,s.jsx)("span",{className:"text-sm",children:"Hide routine runs"})]}):null]})]})]})]})})]})}r(l9,"IssueFiltersPopover");function o9(e){return e.objects.find(t=>t.statusTone===e.highestSeverity)?.statusCategory??"unknown"}r(o9,"dominantCategory");function c9(e){return e.objects.find(t=>t.statusTone===e.highestSeverity)??null}r(c9,"dominantObject");function u9(e){const t=[];for(const[i,l]of Object.entries(e.byStatusCategory))l&&t.push(`${l} ${wI(i).toLowerCase()}`);return e.staleCount>0&&t.push(`${e.staleCount} stale`),t.push(`${e.total} total`),`External objects: ${t.join(", ")}`}r(u9,"buildBreakdownTitle");function kk({summary:e,compact:t,className:i}){const l=k0(),c=xI(e),u=e?.total??0;if(!e||u===0||!c)return null;const m=c9(e),f=m?.statusCategory??o9(e),h=yI(m?.statusIconKey)??xS(f),g=RE[f]??"bg-bg-3 text-ink-3",v=bI(e),y=u9(e),j=f==="running"&&!l?"animate-spin":"";return(0,s.jsxs)("span",{role:"img","aria-label":y,title:y,className:X("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium tabular-nums leading-none",g,t&&"px-1 py-0.5",i),"data-external-status":f,"data-external-tone":c,children:[(0,s.jsx)(h,{"aria-hidden":"true",className:X("h-3 w-3 shrink-0",j)}),(0,s.jsx)("span",{children:v>0?v:u})]})}r(kk,"ExternalObjectStatusSummary");function Sk({onArchive:e,disabled:t,compact:i=!1}){return(0,s.jsxs)("button",{type:"button","data-slot":"icon-button",onClick:r(l=>{l.preventDefault(),l.stopPropagation(),e()},"onClick"),onKeyDown:r(l=>{l.key!=="Enter"&&l.key!==" "||(l.preventDefault(),l.stopPropagation(),e())},"onKeyDown"),disabled:t,className:X("inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-ink-3 opacity-0 transition-opacity hover:bg-bg-3 hover:text-ink group-hover:opacity-100 focus-visible:opacity-100 disabled:pointer-events-none disabled:opacity-30",i?"h-5 py-0":"py-1"),"aria-label":"Archive",children:[(0,s.jsx)(uS,{className:"h-3.5 w-3.5"}),"Archive"]})}r(Sk,"InboxArchiveButton");function d9({issue:e,issueLinkState:t,selected:i=!1,presentation:l="legacy",leadingControl:c,statusSlot:u,metadata:m,actions:f,showIdentifier:h=!0,mobileLeading:g,desktopMetaLeading:v,desktopLeadingSpacer:y=!1,mobileMeta:j,mobileTitleMeta:k,desktopTrailing:S,externalObjectSummary:N,trailingMeta:_,titleSuffix:I,titleClassName:D,checklistStepNumber:T=null,checklistCurrentStep:C=!1,checklistDependencyChips:M,checklistRowId:z,unreadState:K=null,onMarkRead:P,onArchive:A,archiveDisabled:B,className:O,onMouseEnter:W,treeGuides:Y=0,chevronInGuide:ce=!1,showDivider:oe=!1}){const $=e.identifier??e.id,R=e.identifier??e.id.slice(0,8),ne=K!=null,ue=K==="visible"||K==="fading",ae=(0,s.jsx)("button",{type:"button","data-slot":"icon-button",onClick:r(De=>{De.preventDefault(),De.stopPropagation(),P?.()},"onClick"),onKeyDown:r(De=>{(De.key==="Enter"||De.key===" ")&&(De.preventDefault(),De.stopPropagation(),P?.())},"onKeyDown"),className:X("inline-flex h-4 w-4 items-center justify-center rounded-full transition-colors",i?"hover:bg-bg-3/80":"hover:bg-blue-500/20"),"aria-label":"Mark as read",children:(0,s.jsx)("span",{className:X("block h-2 w-2 rounded-full transition-opacity duration-300",i?"bg-ink-3/70":"bg-blue-600 dark:bg-blue-400",K==="fading"?"opacity-0":"opacity-100")})}),Ee=i?"!text-ink-3 !border-ink-3":void 0,fe=i0(t,e),Ae=T!==null?(0,s.jsxs)("span",{className:"shrink-0 font-mono text-xs text-ink-3","aria-hidden":"true",children:[T,"."]}):null,Ce=e.activeRecoveryAction??null,Se=Ce&&!vE(Ce.cause)?f9(Ce,i,{scheduledRetry:e.scheduledRetry??null}):null,he=bT(e.blockedBy)?(0,s.jsxs)(Bn,{variant:"outline","data-testid":"issue-row-parked-blocker",className:"[&>svg]:size-2.5 ml-1.5 gap-0.5 border-amber-500/60 bg-amber-500/15 text-(length:--text-nano) text-amber-700 dark:text-amber-300",title:"Blocked by parked work — at least one assigned blocker is in backlog and will not wake its assignee.",children:[(0,s.jsx)(c0,{className:"h-2.5 w-2.5","aria-hidden":!0}),"Blocked by parked work"]}):null;if(l==="task"){const De=K==="visible"||K==="fading";return(0,s.jsxs)("div",{onMouseEnter:W,"data-slot":"task-row","data-unread":De?"true":void 0,className:X("group relative flex min-w-0 items-start gap-2 rounded-lg py-2.5 pr-2 text-sm no-underline text-inherit sm:items-center sm:py-2",ne?"pl-4":"pl-2 sm:pl-4","[&_button]:relative [&_button]:z-10",i?"bg-bg-3/50 hover:bg-bg-3/50":"hover:bg-bg-3/50",C&&"bg-accent/5",O),children:[(0,s.jsx)(gn,{to:Td($),state:fe,disableIssueQuicklook:!0,issuePrefetch:e,"data-inbox-issue-link":!0,id:z,"aria-current":C?"step":void 0,onClickCapture:r(()=>Bh($,fe),"onClickCapture"),className:"absolute inset-0 rounded-lg no-underline text-inherit focus-visible:z-10 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus",children:(0,s.jsxs)("span",{className:"sr-only",children:["Open ",R,": ",e.title]})}),ne?(0,s.jsx)("span",{"data-testid":"issue-row-unread-slot",className:"absolute left-0 top-3 inline-flex h-4 w-4 items-center justify-center sm:top-1/2 sm:-translate-y-1/2",children:ue?ae:null}):null,(0,s.jsxs)("span",{"data-slot":"task-row-leading",className:"flex shrink-0 items-start self-stretch gap-1 pt-px sm:items-center sm:pt-0",children:[Y>0?Array.from({length:Y},(Ye,ze)=>{const ve=ce&&ze===Y-1;return(0,s.jsx)("span",{"data-slot":"task-row-tree-guide","aria-hidden":"true",className:"relative block w-4 shrink-0 self-stretch",children:(0,s.jsx)("span",{"data-slot":"task-row-tree-connector",className:"absolute -inset-y-3 left-7 w-px bg-bg",children:ve?(0,s.jsxs)("span",{className:"absolute inset-0 flex flex-col",children:[(0,s.jsx)("span",{className:"flex-1 bg-line"}),(0,s.jsx)("span",{className:"h-3.5 shrink-0"}),(0,s.jsx)("span",{className:"flex-1 bg-line"})]}):(0,s.jsx)("span",{className:"absolute inset-0 bg-line"})})},`task-guide-${ze}`)}):null,c,u??(0,s.jsx)(Ya,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ee}),he]}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2",children:[(0,s.jsxs)("span",{"data-slot":"task-row-title-cluster",className:"flex min-w-0 flex-1 items-baseline gap-1.5 sm:items-center",children:[(0,s.jsxs)("span",{"data-slot":"task-row-title",className:X("min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",De&&"font-semibold",D),children:[e.title,I]}),Se,k?(0,s.jsx)("span",{className:"ml-auto shrink-0 whitespace-nowrap text-right text-xs text-ink-3 sm:hidden",children:k}):null]}),M?(0,s.jsx)("span",{className:"flex flex-wrap gap-1",children:M}):null,j?(0,s.jsx)("span",{className:"text-xs text-ink-3 sm:hidden",children:j}):null]}),(0,s.jsxs)("span",{"data-slot":"task-row-trailing",className:"ml-auto hidden min-w-0 shrink-0 items-center gap-2 sm:flex",children:[N?(0,s.jsx)(kk,{summary:N,compact:!0}):null,m?(0,s.jsx)("span",{"data-slot":"task-row-metadata",className:"min-w-0",children:m}):null,S,f?(0,s.jsx)("span",{"data-slot":"task-row-actions",className:"flex shrink-0 items-center gap-1",children:f}):null,A?(0,s.jsx)(Sk,{onArchive:A,disabled:B,compact:!0}):null,h?(0,s.jsx)("span",{"data-slot":"task-row-identifier",className:"w-20 shrink-0 text-right font-mono text-xs text-ink-3",children:R}):null,_?(0,s.jsx)("span",{"data-slot":"task-row-timestamp",className:"w-24 shrink-0 truncate text-right text-xs text-ink-3",children:_}):null]})]})}return(0,s.jsxs)("div",{onMouseEnter:W,className:X("group relative flex items-start gap-2 rounded-lg py-2.5 pr-3 text-sm no-underline text-inherit sm:items-center sm:py-2 sm:pl-1",ne?"pl-4":"pl-2","[&_button]:relative [&_button]:z-10",oe&&"border-b border-line last:border-b-0",i?"hover:bg-transparent":"hover:bg-bg-3/50",C?"bg-accent/5":null,O),children:[(0,s.jsx)(gn,{to:Td($),state:fe,disableIssueQuicklook:!0,issuePrefetch:e,"data-inbox-issue-link":!0,id:z,"aria-current":C?"step":void 0,onClickCapture:r(()=>Bh($,fe),"onClickCapture"),className:X("absolute inset-0 rounded-lg no-underline text-inherit focus-visible:z-10 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus"),children:(0,s.jsxs)("span",{className:"sr-only",children:["Open ",R,": ",e.title]})}),(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 pt-px sm:hidden",children:[g??(0,s.jsx)(Ya,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ee}),he]}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:contents",children:[(0,s.jsxs)("span",{"data-slot":"task-row-title-cluster",className:"flex min-w-0 items-start gap-1.5 sm:order-2 sm:flex-1 sm:items-center",children:[(0,s.jsxs)("span",{"data-slot":"task-row-title",className:X("min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",D),children:[e.title,I]}),Se]}),M?(0,s.jsx)("span",{className:"flex flex-wrap gap-1 sm:order-3 sm:ml-(--sz-calc-13)",children:M}):null,(0,s.jsxs)("span",{className:"flex items-center gap-2 self-stretch sm:order-1 sm:shrink-0",children:[ne?(0,s.jsx)("span",{"data-testid":"issue-row-unread-slot",className:"hidden h-4 w-4 shrink-0 items-center justify-center self-center sm:inline-flex",children:ue?ae:null}):null,Y>0?Array.from({length:Y},(De,Ye)=>{const ze=ce&&Ye===Y-1;return(0,s.jsx)("span",{"aria-hidden":"true",className:"relative hidden w-4 shrink-0 self-stretch sm:block",children:(0,s.jsx)("span",{className:"absolute -inset-y-3 left-8 w-px bg-bg",children:ze?(0,s.jsxs)("span",{className:"absolute inset-0 flex flex-col",children:[(0,s.jsx)("span",{className:"flex-1 bg-line"}),(0,s.jsx)("span",{className:"h-3.5 shrink-0"}),(0,s.jsx)("span",{className:"flex-1 bg-line"})]}):(0,s.jsx)("span",{className:"absolute inset-0 bg-line"})})},`guide-${Ye}`)}):null,y?(0,s.jsx)("span",{className:"hidden w-3.5 shrink-0 sm:block"}):null,v??(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"hidden shrink-0 items-center gap-1 sm:inline-flex",children:(0,s.jsx)(Ya,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ee})}),Ae,(0,s.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:R}),he]}),j?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-xs text-ink-3 sm:hidden","aria-hidden":"true",children:"·"}),(0,s.jsx)("span",{className:"text-xs text-ink-3 sm:hidden",children:j})]}):null]})]}),A||S||_||N?(0,s.jsxs)("span",{className:"ml-auto hidden shrink-0 items-center gap-2 sm:order-3 sm:flex sm:gap-3",children:[A?(0,s.jsx)(Sk,{onArchive:A,disabled:B}):null,N?(0,s.jsx)(kk,{summary:N,compact:!0}):null,S,_?(0,s.jsx)("span",{className:"text-xs text-ink-3",children:_}):null]}):null,ue?(0,s.jsx)("span",{className:"absolute left-0 top-1/2 inline-flex h-4 w-4 -translate-y-1/2 items-center justify-center sm:hidden",children:ae}):null]})}r(d9,"IssueRow");function f9(e,t,i){const l=mT(e,i);if(!l)return null;const c=hT[l],u=c.icon,m=pT(e,i),f=xT(l,e.kind,m),h=m?gT(m):null;return(0,s.jsxs)(Bn,{variant:"outline","data-testid":"issue-row-recovery-indicator","data-recovery-state":l,"data-recovery-kind":e.kind,"data-recovery-lane":m?.lane,role:"status","aria-label":h?`${f} — ${h}`:f,className:X("shrink-0 gap-0.5 text-(length:--text-nano)",c.className,t?"!border-ink-3 !text-ink-3":null),title:h?`${f} — ${h}. Open the source task to act.`:`${f} — open the source task to act.`,children:[(0,s.jsx)(u,{className:"h-2.5 w-2.5","aria-hidden":!0}),f]})}r(f9,"renderRecoveryChip");var m9="Kembali ke model utama.";function p9(e,t){return e instanceof Error&&e.message?e.message:t}r(p9,"errorMessage");function h9({issueId:e,run:t,companyId:i,taskLabel:l,className:c}){const u=wn(),[m,f]=(0,x.useState)(!1),h=t?.modelFallback??null,g=Kt({mutationFn:r(async()=>{if(!e||!t)throw new Error("This task has no run on a fallback model.");return await vf.cancel(t.id),hn.addComment(e,m9,void 0,void 0,void 0,crypto.randomUUID())},"mutationFn"),onSuccess:r(()=>{i&&u.invalidateQueries({queryKey:U.liveRuns(i)}),e&&(u.invalidateQueries({queryKey:U.issues.liveRuns(e)}),u.invalidateQueries({queryKey:U.issues.activeRun(e)}),u.invalidateQueries({queryKey:U.issues.runs(e)}),u.invalidateQueries({queryKey:U.issues.comments(e)}))},"onSuccess")});if(!e||!t||!h)return null;const v=l?` on ${l}`:"";return(0,s.jsxs)("span",{"data-slot":"restore-primary-model",className:X("inline-flex min-w-0 items-center gap-1.5",c),children:[(0,s.jsxs)(le,{type:"button",variant:"secondary",size:"xs",disabled:g.isPending,"aria-label":`Back to the primary model${v}`,title:`Back to the primary model — stops this fallback run and wakes the assignee on ${h.primaryModel}`,onClick:r(y=>{y.preventDefault(),y.stopPropagation(),f(!0)},"onClick"),children:[(0,s.jsx)(ic,{"aria-hidden":"true"}),g.isPending?"Restoring…":"Back to primary model"]}),g.error?(0,s.jsx)("span",{role:"alert",className:"text-xs text-bad",children:p9(g.error,"Couldn’t restore the primary model.")}):null,(0,s.jsx)(lS,{open:m,onOpenChange:f,children:(0,s.jsxs)(nS,{children:[(0,s.jsxs)(rS,{children:[(0,s.jsxs)(tS,{children:["Back to the primary model",v,"?"]}),(0,s.jsxs)(eS,{children:["This stops the run on ",h.activeModel," now, so any unsaved work in that turn is lost, and wakes the assignee again on ",h.primaryModel,"."]})]}),(0,s.jsxs)(aS,{children:[(0,s.jsx)(iS,{children:"Keep running"}),(0,s.jsx)(sS,{onClick:r(()=>{f(!1),g.mutate()},"onClick"),children:"Stop and switch"})]})]})})]})}r(h9,"RestorePrimaryModelControl");function g9({context:e,search:t,controls:i,actions:l,feedback:c,className:u,ariaLabel:m="Collection controls"}){return(0,s.jsxs)("div",{"data-slot":"collection-toolbar",className:X("flex flex-col gap-2",u),role:"toolbar","aria-label":m,children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center",children:[e?(0,s.jsx)("div",{"data-slot":"collection-toolbar-context",className:"min-w-0 shrink-0",children:e}):null,t?(0,s.jsx)("div",{"data-slot":"collection-toolbar-search",className:"min-w-0 flex-1",children:t}):null,i||l?(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1 sm:ml-auto sm:flex-nowrap",children:[i?(0,s.jsx)("div",{"data-slot":"collection-toolbar-controls",className:"flex min-w-0 flex-wrap items-center gap-1",children:i}):null,l?(0,s.jsx)("div",{"data-slot":"collection-toolbar-actions",className:"flex shrink-0 items-center gap-1",children:l}):null]}):null]}),c?(0,s.jsx)("div",{"data-slot":"collection-toolbar-feedback",className:"min-w-0",children:c}):null]})}r(g9,"CollectionToolbar");function x9({variant:e="list"}){return e==="dashboard"?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(lt,{className:"h-32 w-full border border-line"}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-4",children:Array.from({length:4}).map((t,i)=>(0,s.jsx)(lt,{className:"h-24 w-full"},i))}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:Array.from({length:4}).map((t,i)=>(0,s.jsx)(lt,{className:"h-44 w-full"},i))}),(0,s.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,s.jsx)(lt,{className:"h-72 w-full"}),(0,s.jsx)(lt,{className:"h-72 w-full"})]})]}):e==="approvals"?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsx)(lt,{className:"h-9 w-44"})}),(0,s.jsx)("div",{className:"grid gap-3",children:Array.from({length:3}).map((t,i)=>(0,s.jsx)(lt,{className:"h-36 w-full"},i))})]}):e==="costs"?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:Array.from({length:6}).map((t,i)=>(0,s.jsx)(lt,{className:"h-9 w-28"},i))}),(0,s.jsx)(lt,{className:"h-40 w-full"}),(0,s.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,s.jsx)(lt,{className:"h-72 w-full"}),(0,s.jsx)(lt,{className:"h-72 w-full"})]})]}):e==="inbox"?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(lt,{className:"h-9 w-56"}),(0,s.jsx)(lt,{className:"h-8 w-40"})]}),(0,s.jsx)("div",{className:"space-y-5",children:Array.from({length:3}).map((t,i)=>(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(lt,{className:"h-4 w-40"}),(0,s.jsx)("div",{className:"space-y-1 border border-line",children:Array.from({length:3}).map((l,c)=>(0,s.jsx)(lt,{className:"h-14 w-full rounded-none"},c))})]},i))})]}):e==="org-chart"?(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsx)(lt,{className:"h-(--sz-calc-17) w-full rounded-lg border border-line"})}):e==="detail"?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(lt,{className:"h-3 w-64"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lt,{className:"h-6 w-6"}),(0,s.jsx)(lt,{className:"h-6 w-6"}),(0,s.jsx)(lt,{className:"h-7 w-48"})]}),(0,s.jsx)(lt,{className:"h-4 w-40"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(lt,{className:"h-10 w-full"}),(0,s.jsx)(lt,{className:"h-32 w-full"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lt,{className:"h-8 w-24"}),(0,s.jsx)(lt,{className:"h-8 w-24"}),(0,s.jsx)(lt,{className:"h-8 w-24"})]}),(0,s.jsx)(lt,{className:"h-24 w-full"}),(0,s.jsx)(lt,{className:"h-24 w-full"})]})]}):e==="issues-list"?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)(lt,{className:"h-9 w-64"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lt,{className:"h-8 w-16"}),(0,s.jsx)(lt,{className:"h-8 w-16"}),(0,s.jsx)(lt,{className:"h-8 w-16"}),(0,s.jsx)(lt,{className:"h-8 w-24"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(lt,{className:"h-4 w-40"}),(0,s.jsx)("div",{className:"space-y-1",children:Array.from({length:8}).map((t,i)=>(0,s.jsx)(lt,{className:"h-11 w-full rounded-none"},i))})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)(lt,{className:"h-9 w-44"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lt,{className:"h-8 w-20"}),(0,s.jsx)(lt,{className:"h-8 w-24"})]})]}),(0,s.jsx)("div",{className:"space-y-1",children:Array.from({length:7}).map((t,i)=>(0,s.jsx)(lt,{className:"h-11 w-full rounded-none"},i))})]})}r(x9,"PageSkeleton");var QG="issue.successful_run_handoff_required",GG="issue.successful_run_handoff_escalated";function VA(e){const t=e.successfulRunHandoff;return t?.required!==!0?!1:t.hasLiveContinuation?e.scheduledRetry?.status==="scheduled_retry":!0}r(VA,"isSuccessfulRunHandoffRequired");function YG(e){const t=e.trim();return t==="Wardmote needs a disposition before this issue can continue."||/^##\s+(This issue still needs a next step|Run finished without a next step|Successful run missing issue disposition)/i.test(t)||b9(t)}r(YG,"isSuccessfulRunHandoffComment");function b9(e){const t=e.trim();return t==="Wardmote could not resolve this issue's missing disposition automatically. The source assignment is unchanged and a board decision is required."||/^Wardmote exhausted the bounded successful-run handoff correction\b/i.test(t)}r(b9,"isSuccessfulRunHandoffEscalationComment");function XG(e){return e==="issue.successful_run_handoff_escalated"?{className:"border-red-500/35 bg-red-500/10 text-red-950 dark:text-red-100",iconClassName:"text-red-600 dark:text-red-300"}:e==="issue.successful_run_handoff_required"?{className:"border-amber-300/70 bg-amber-50/90 text-amber-950 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100",iconClassName:"text-amber-600 dark:text-amber-300"}:{className:"border-line/60 text-ink-3",iconClassName:"text-ink-3"}}r(XG,"successfulRunHandoffActivityTone");var WA=[10,25,50];var v9=["backlog","done","cancelled"],Fg=["backlog","todo","in_progress","in_review","blocked","done","cancelled"],y9={rail:"border-line bg-bg-3/20",railOver:"bg-bg-3/50 ring-1 ring-accent/20",header:"text-ink-3",count:"text-ink-3/60",body:"bg-bg-3/20",bodyOver:"bg-bg-3/40",card:""},j9={backlog:{rail:"border-line bg-bg-3/30",railOver:"bg-bg-3/50 ring-1 ring-neutral-400/25",header:"text-ink-3",count:"text-ink-3/60",body:"bg-bg-3/30 ring-1 ring-inset ring-line/50",bodyOver:"bg-bg-3/50 ring-1 ring-inset ring-neutral-400/25",card:""},todo:{rail:"border-amber-500/25 bg-amber-50/60 dark:bg-amber-950/20",railOver:"bg-amber-100/70 ring-1 ring-amber-500/25 dark:bg-amber-950/35",header:"text-amber-700 dark:text-amber-300",count:"text-amber-700/65 dark:text-amber-300/65",body:"bg-amber-50/45 ring-1 ring-inset ring-amber-500/15 dark:bg-amber-950/15",bodyOver:"bg-amber-100/70 ring-1 ring-inset ring-amber-500/25 dark:bg-amber-950/30",card:""},in_progress:{rail:"border-blue-500/25 bg-blue-50/60 dark:bg-blue-950/20",railOver:"bg-blue-100/70 ring-1 ring-blue-500/25 dark:bg-blue-950/35",header:"text-blue-700 dark:text-blue-300",count:"text-blue-700/65 dark:text-blue-300/65",body:"bg-blue-50/45 ring-1 ring-inset ring-blue-500/15 dark:bg-blue-950/15",bodyOver:"bg-blue-100/70 ring-1 ring-inset ring-blue-500/25 dark:bg-blue-950/30",card:""},blocked:{rail:"border-red-500/25 bg-red-50/60 dark:bg-red-950/20",railOver:"bg-red-100/70 ring-1 ring-red-500/25 dark:bg-red-950/35",header:"text-red-700 dark:text-red-300",count:"text-red-700/65 dark:text-red-300/65",body:"bg-red-50/45 ring-1 ring-inset ring-red-500/15 dark:bg-red-950/15",bodyOver:"bg-red-100/70 ring-1 ring-inset ring-red-500/25 dark:bg-red-950/30",card:""},in_review:{rail:"border-violet-500/25 bg-violet-50/60 dark:bg-violet-950/20",railOver:"bg-violet-100/70 ring-1 ring-violet-500/25 dark:bg-violet-950/35",header:"text-violet-700 dark:text-violet-300",count:"text-violet-700/65 dark:text-violet-300/65",body:"bg-violet-50/45 ring-1 ring-inset ring-violet-500/15 dark:bg-violet-950/15",bodyOver:"bg-violet-100/70 ring-1 ring-inset ring-violet-500/25 dark:bg-violet-950/30",card:""},done:{rail:"border-green-500/25 bg-green-50/60 dark:bg-green-950/20",railOver:"bg-green-100/70 ring-1 ring-green-500/25 dark:bg-green-950/35",header:"text-green-700 dark:text-green-300",count:"text-green-700/65 dark:text-green-300/65",body:"bg-green-50/45 ring-1 ring-inset ring-green-500/15 dark:bg-green-950/15",bodyOver:"bg-green-100/70 ring-1 ring-inset ring-green-500/25 dark:bg-green-950/30",card:""},cancelled:{rail:"border-neutral-300/70 bg-bg-3/25 opacity-80 dark:border-neutral-700/70 dark:bg-neutral-900/20",railOver:"bg-bg-3/45 opacity-90 ring-1 ring-neutral-400/25 dark:bg-neutral-900/35",header:"text-ink-3/80",count:"text-ink-3/50",body:"bg-bg-3/25 ring-1 ring-inset ring-line/50",bodyOver:"bg-bg-3/45 ring-1 ring-inset ring-neutral-400/25",card:"bg-bg-3/35 text-ink-3 opacity-80 hover:shadow-none"}};function w9(e){return j9[e]??y9}r(w9,"getKanbanColumnTone");function Oh(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(Oh,"statusLabel");function k9(e,t){return Fg.includes(e)?e:t.find(i=>i.id===e)?.status??null}r(k9,"resolveKanbanTargetStatus");function S9({status:e,issues:t,agents:i,liveIssueIds:l,subtreeLiveCounts:c,compactCards:u=!1,collapsed:m=!1,visibleCount:f,revealIncrement:h,onShowMore:g}){const{setNodeRef:v,isOver:y}=cC({id:e});t.length;const j=m?[]:t.slice(0,f),k=Math.max(t.length-j.length,0),S=Math.min(h,k),N=w9(e);return m?(0,s.jsxs)("div",{ref:v,className:X("flex min-h-(--sz-220px) w-(--sz-52px) shrink-0 flex-col items-center rounded-md border px-1.5 py-2 transition-colors",N.rail,y&&N.railOver),title:`${Oh(e)}: ${t.length}`,children:[(0,s.jsx)(Ya,{status:e}),(0,s.jsx)("span",{className:X("mt-2 [writing-mode:vertical-rl] rotate-180 text-(length:--text-nano) font-semibold uppercase tracking-wide",N.header),children:Oh(e)}),(0,s.jsx)(Bn,{variant:"ghost",className:X("mt-auto bg-bg px-1.5 text-(length:--text-nano) tabular-nums",N.header),children:t.length})]}):(0,s.jsxs)("div",{className:"flex flex-col shrink-0 min-w-(--sz-260px) w-(--sz-260px)",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 mb-1",children:[(0,s.jsx)(Ya,{status:e}),(0,s.jsx)("span",{className:X("text-xs font-semibold uppercase tracking-wide",N.header),children:Oh(e)}),(0,s.jsx)("span",{className:X("ml-auto text-xs tabular-nums",N.count),children:t.length})]}),(0,s.jsxs)("div",{ref:v,className:X("flex-1 min-h-(--sz-120px) rounded-md p-2 space-y-1 transition-colors",y?N.bodyOver:N.body),children:[(0,s.jsx)($0,{items:j.map(_=>_.id),strategy:dC,children:j.map(_=>(0,s.jsx)(QA,{issue:_,agents:i,isLive:l?.has(_.id),subtreeLiveCount:c?.get(_.id)??0,compact:u,className:N.card},_.id))}),k>0?(0,s.jsxs)("button",{type:"button",className:"mt-1 flex w-full items-center justify-center rounded-md border border-dashed border-line bg-bg/70 px-2 py-2 text-xs font-medium text-ink-3 transition-colors hover:border-ink/30 hover:text-ink",onClick:g,children:["Show ",S," more"]}):null,t.length>0&&(k>0||t.length>=f)?(0,s.jsxs)("p",{className:"px-1 pt-1 text-(length:--text-micro) text-ink-3",children:["Showing ",j.length," of ",t.length]}):null]})]})}r(S9,"KanbanColumn");function QA({issue:e,agents:t,isLive:i,subtreeLiveCount:l=0,isOverlay:c,compact:u=!1,className:m}){const{attributes:f,listeners:h,setNodeRef:g,transform:v,transition:y,isDragging:j}=B0({id:e.id,data:{issue:e}}),k={transform:Za.Transform.toString(v),transition:y},S=r(N=>!N||!t?null:t.find(_=>_.id===N)?.name??null,"agentName");return(0,s.jsx)(Dc,{ref:g,style:k,...f,...h,className:X("block cursor-grab active:cursor-grabbing transition-shadow",j&&!c?"opacity-30":"",c?"shadow-lg ring-1 ring-accent/20":"hover:shadow-sm",u?"p-2":"p-2.5",m),children:(0,s.jsxs)(gn,{to:`/issues/${e.identifier??e.id}`,disableIssueQuicklook:!0,className:"block no-underline text-inherit",onClick:r(N=>{j&&N.preventDefault()},"onClick"),children:[(0,s.jsxs)("div",{className:`flex items-start gap-1.5 ${u?"mb-1":"mb-1.5"}`,children:[(0,s.jsx)("span",{className:"text-xs text-ink-3 font-mono shrink-0",children:e.identifier??e.id.slice(0,8)}),VA(e)?(0,s.jsxs)(Bn,{variant:"outline",className:"border-amber-400/45 bg-amber-50/60 px-1.5 text-(length:--text-nano) text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300",title:"This task needs a next step","aria-label":"Needs next step",children:[(0,s.jsx)(Ja,{className:"h-3 w-3"}),"Next step"]}):null,i&&(0,s.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 text-(length:--text-nano) font-medium text-blue-600 dark:text-blue-400",children:[(0,s.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,s.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,s.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),u?"Live":null]}),!i&&l>0&&(0,s.jsxs)(Bn,{variant:"outline",className:"border-line px-1.5 text-(length:--text-nano) text-ink-3",title:`${l} sub-task${l===1?"":"s"} running below`,children:[(0,s.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full border border-ink-3/60","aria-hidden":"true"}),l," live below"]})]}),(0,s.jsx)("p",{className:`${u?"mb-1.5 text-xs":"mb-2 text-sm"} leading-snug line-clamp-2`,children:e.title}),(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[!1,e.assigneeAgentId&&(()=>{const N=S(e.assigneeAgentId);return N?(0,s.jsx)(Wl,{agent:t?.find(_=>_.id===e.assigneeAgentId)??{id:e.assigneeAgentId,name:N},size:"xs"}):(0,s.jsx)("span",{className:"text-xs text-ink-3 font-mono",children:e.assigneeAgentId.slice(0,8)})})()]})]})})}r(QA,"KanbanCard");function N9({issues:e,agents:t,liveIssueIds:i,compactCards:l=!1,collapsedStatuses:c=[],initialVisibleCount:u=10,revealIncrement:m=10,onUpdateIssue:f}){const[h,g]=(0,x.useState)(null),v=`${u}:${m}`,[y,j]=(0,x.useState)({paginationKey:v,counts:{}}),k=y.paginationKey===v?y.counts:{},S=(0,x.useMemo)(()=>new Set(c),[c]),N=D0(wc(Rf,{activationConstraint:{distance:5}})),_=(0,x.useMemo)(()=>{const z={};for(const K of Fg)z[K]=[];for(const K of e)z[K.status]&&z[K.status].push(K);return z},[e]),I=(0,x.useMemo)(()=>h?e.find(z=>z.id===h):null,[h,e]),D=(0,x.useMemo)(()=>HA(e,i??new Set),[e,i]);function T(z){g(z.active.id)}r(T,"handleDragStart");function C(z){g(null);const{active:K,over:P}=z;if(!P)return;const A=K.id,B=e.find(W=>W.id===A);if(!B)return;const O=k9(P.id,e);O&&O!==B.status&&f(A,{status:O})}r(C,"handleDragEnd");function M(z){}return r(M,"handleDragOver"),(0,s.jsxs)(P0,{sensors:N,onDragStart:T,onDragOver:M,onDragEnd:C,children:[(0,s.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-4 -mx-2 px-2",children:Fg.map(z=>(0,s.jsx)(S9,{status:z,issues:_[z]??[],agents:t,liveIssueIds:i,subtreeLiveCounts:D,compactCards:l,collapsed:S.has(z)||S.size>0&&_[z].length===0,visibleCount:k[z]??u,revealIncrement:m,onShowMore:r(()=>{j(K=>{const P=K.paginationKey===v?K.counts:{};return{paginationKey:v,counts:{...P,[z]:(P[z]??u)+m}}})},"onShowMore")},z))}),(0,s.jsx)(EL,{children:I?(0,s.jsx)(QA,{issue:I,agents:t,isOverlay:!0,compact:l}):null})]})}r(N9,"KanbanBoard");function uf(e,t){const i=new Set(e.map(m=>m.id)),l=r(m=>!m.parentId||!i.has(m.parentId)||t?.has(m.id)===!0,"isRoot"),c=e.filter(l),u=new Map;for(const m of e)if(m.parentId&&!l(m)){const f=u.get(m.parentId)??[];f.push(m),u.set(m.parentId,f)}return{roots:c,childMap:u}}r(uf,"buildIssueTree");function GA(e,t){return(t.get(e)??[]).reduce((i,l)=>i+1+GA(l.id,t),0)}r(GA,"countDescendants");function ZG(e,t){const i=new Map;for(const m of t){if(!m.parentId)continue;const f=i.get(m.parentId)??[];f.push(m),i.set(m.parentId,f)}const l=[],c=new Set([e]);let u=[e];for(;u.length>0;){const m=[];for(const f of u)for(const h of i.get(f)??[])c.has(h.id)||(c.add(h.id),l.push(h),m.push(h.id));u=m}return l}r(ZG,"filterIssueDescendants");function C9(e,t){const i=e.currentExecutionWorkspace?.name??e.currentExecutionWorkspace?.branchName??e.currentExecutionWorkspace?.cwd??e.executionWorkspaceId??null,l=e.assigneeUserId&&e.assigneeUserId!==t?e.assigneeUserId??void 0:void 0;return{parentId:e.id,parentIdentifier:e.identifier??void 0,parentTitle:e.title,...e.projectId?{projectId:e.projectId}:{},...e.projectWorkspaceId?{projectWorkspaceId:e.projectWorkspaceId}:{},...e.goalId?{goalId:e.goalId}:{},...e.executionWorkspaceId?{executionWorkspaceId:e.executionWorkspaceId}:{},...e.executionWorkspaceId?{executionWorkspaceMode:"reuse_existing"}:e.executionWorkspacePreference?{executionWorkspaceMode:e.executionWorkspacePreference}:{},...i?{parentExecutionWorkspaceLabel:i}:{},...e.assigneeAgentId?{assigneeAgentId:e.assigneeAgentId}:{},...l?{assigneeUserId:l}:{}}}r(C9,"buildSubIssueDefaultsForViewer");function YA(){return typeof localStorage>"u"?null:localStorage}r(YA,"browserStorage");function Lh(e,t){if(!t)return null;try{const i=e.getItem(t);return i==null?null:JSON.parse(i)}catch{return null}}r(Lh,"parseStoredJson");function XA({companyId:e,collectionKey:t}){return`wardmote:task-collection:v1:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}r(XA,"taskCollectionPreferencesStorageKey");function A9(e,t){if(!e||typeof e!="object")return!1;const i=e;return i.version===1&&i.companyId===t.companyId&&i.collectionKey===t.collectionKey&&"viewState"in i&&Array.isArray(i.columns)}r(A9,"isCurrentEnvelope");function Hg(e,t,i=YA()){if(!i)return;const l={version:1,companyId:e.companyId,collectionKey:e.collectionKey,viewState:t.viewState,viewStateSource:t.viewStateSource??"stored",columns:t.columns};try{i.setItem(XA(e),JSON.stringify(l)),e.legacyViewStorageKey&&i.setItem(e.legacyViewStorageKey,JSON.stringify(t.viewState)),e.legacyColumnsStorageKey&&i.setItem(e.legacyColumnsStorageKey,JSON.stringify(t.columns))}catch{}}r(Hg,"saveTaskCollectionPreferences");function _9({storage:e=YA(),defaultViewState:t,defaultColumns:i,normalizeViewState:l,normalizeColumns:c,...u}){if(!e)return{viewState:t,columns:i,migrated:!1,source:"default"};const m=Lh(e,XA(u));if(A9(m,u))return{viewState:l(m.viewState),columns:c(m.columns),migrated:!1,source:m.viewStateSource==="default"?"default":"current"};const f=Lh(e,u.legacyViewStorageKey),h=Lh(e,u.legacyColumnsStorageKey),g=f!==null||h!==null,v={viewState:f===null?t:l(f),columns:h===null?i:c(h)};return g&&Hg(u,{...v,viewStateSource:f===null?"default":"stored"},e),{...v,migrated:g,source:f!==null?"legacy":"default"}}r(_9,"loadTaskCollectionPreferences");var E9={today:"Today",yesterday:"Yesterday",earlier:"Earlier"};function Nk(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}r(Nk,"localCalendarOrdinal");function I9(e,t=new Date){const i=e instanceof Date?e:new Date(e);if(Number.isNaN(i.getTime()))return"earlier";const l=Math.round((Nk(t)-Nk(i))/864e5);return l<=0?"today":l===1?"yesterday":"earlier"}r(I9,"taskDateGroup");function T9(e,t){return e===t||e===null&&t==="earlier"?null:E9[t]}r(T9,"taskDateGroupSeparator");var xd=200,bd=200;function Ck(e){const t=new Date(e.startedAt??e.createdAt).getTime();return Number.isFinite(t)?t:0}r(Ck,"runStartMs");function R9(e,t){const i=new Map(t.map(c=>[c.id,c.status])),l=new Map;for(const c of e??[]){if(!c.issueId||!c.modelFallback||!FA(c,i.get(c.issueId)))continue;const u=l.get(c.issueId);(!u||Ck(c)>Ck(u))&&l.set(c.issueId,c)}return l}r(R9,"fallbackRunsByIssueId");function vd(e){return e.type==="group"?`group:${e.key}`:`issue:${e.issue.id}`}r(vd,"issuesListNavEntryKey");function Vg(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}r(Vg,"escapeAttrValue");var ZA=100,D9=150,M9=320;function yd(e){if(!e||typeof window>"u")return null;let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){const i=window.getComputedStyle(t).overflowY;if(i==="auto"||i==="scroll"||i==="overlay")return t;t=t.parentElement}return null}r(yd,"findIssuesScrollContainer");var O9=12,L9=24;function JA(e){if(!e)return{top:0,bottom:window.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.top+e.clientHeight}}r(JA,"issuesViewportBounds");function z9(e,t,i){const l=e.querySelectorAll("[data-issue-row-id]"),c=JA(t);let u=0,m=l.length;for(;u<m;){const h=u+m>>1;l[h].getBoundingClientRect().bottom<=c.top?u=h+1:m=h}const f=[];for(let h=u;h<l.length&&f.length<O9;h+=1){const g=l[h].getBoundingClientRect();if(g.top>=c.bottom)break;f.push({id:l[h].dataset.issueRowId,top:g.top-c.top})}return{identity:i,rows:f}}r(z9,"captureIssueRowScrollAnchor");function P9(e,t,i){const l=JA(t),c=[];if(i.rows.forEach(({id:f,top:h},g)=>{const v=e.querySelector(`[data-issue-row-id="${Vg(f)}"]`);v&&c.push({shift:Math.round(v.getBoundingClientRect().top-l.top-h),index:g})}),c.length===0)return null;c.sort((f,h)=>f.shift-h.shift);let u=null,m=0;for(let f=1;f<=c.length;f+=1){if(f<c.length&&c[f].shift-c[f-1].shift<=L9)continue;const h=c.slice(m,f),g=h.reduce((v,y)=>y.index<v.index?y:v);(!u||h.length>u.count||h.length===u.count&&g.index<u.first.index)&&(u={count:h.length,first:g}),m=f}return u.first.shift}r(P9,"issueRowAnchorShift");var U9=Ic,$9={backlog:"Backlog",todo:"Todo",in_progress:"In progress",in_review:"In review",done:"Done",blocked:"Blocked",cancelled:"Cancelled"},B9={backlog:"bg-ink-3/40",todo:"bg-blue-500",in_progress:"bg-yellow-500",in_review:"bg-violet-500",done:"bg-green-500",blocked:"bg-red-500",cancelled:"bg-neutral-400"},_d={...CS,sortField:"updated",sortDir:"desc",groupBy:"none",viewMode:"list",nestingEnabled:!0,showDateGroupSeparators:!0,collapsedGroups:[],collapsedParents:[],boardCardDensity:"auto",boardColdLaneMode:"expanded",boardColumnPageSize:10};function K9(e){return e==="compact"||e==="comfortable"||e==="auto"?e:"auto"}r(K9,"normalizeBoardCardDensity");function q9(e){return e==="collapsed"||e==="expanded"||e==="auto"?e:"auto"}r(q9,"normalizeBoardColdLaneMode");function F9(e){return WA.includes(e)?e:10}r(F9,"normalizeBoardColumnPageSize");function H9(e){const t=e&&typeof e=="object"?e:{};return{..._d,...t,...k3(t),workspaces:[],sortField:["status","priority","title","created","updated","workflow"].includes(t.sortField??"")?t.sortField:_d.sortField,sortDir:t.sortDir==="asc"?"asc":"desc",groupBy:["status","priority","assignee","project","workspace","parent","none"].includes(t.groupBy??"")?t.groupBy:_d.groupBy,viewMode:t.viewMode==="board"?"board":"list",nestingEnabled:t.nestingEnabled!==!1,showDateGroupSeparators:t.showDateGroupSeparators!==!1,collapsedGroups:Array.isArray(t.collapsedGroups)?t.collapsedGroups.filter(i=>typeof i=="string"):[],collapsedParents:Array.isArray(t.collapsedParents)?t.collapsedParents.filter(i=>typeof i=="string"):[],boardCardDensity:K9(t.boardCardDensity),boardColdLaneMode:q9(t.boardColdLaneMode),boardColumnPageSize:F9(t.boardColumnPageSize)}}r(H9,"normalizeIssueViewState");function V9(e,t,i){const l=e.source==="default"&&i?{...e.viewState,sortField:i,sortDir:"asc"}:e.viewState;return t?{...l,assignees:t,statuses:[]}:l}r(V9,"getInitialViewState");function Ak(e,t,i,l,c){const u=V9(e,t,l),m=i?{...u,workspaces:i,statuses:[]}:u;return c?{...m,statuses:c}:m}r(Ak,"getInitialWorkspaceViewState");function W9(e){return`${e}:issue-columns`}r(W9,"getIssueColumnsStorageKey");function _k(e){return _9({...e,defaultViewState:_d,defaultColumns:CN,normalizeViewState:H9,normalizeColumns:r(t=>EN(Array.isArray(t)?t:[]),"normalizeColumns")})}r(_k,"loadIssueCollectionPreferences");function Q9(e,t){if(t.sortField==="workflow"){const c=qA(e);return t.sortDir==="desc"?[...c].reverse():c}const i=[...e],l=t.sortDir==="asc"?1:-1;return i.sort((c,u)=>{switch(t.sortField){case"status":return l*(Pd.indexOf(c.status)-Pd.indexOf(u.status));case"priority":return l*(Wh.indexOf(c.priority)-Wh.indexOf(u.priority));case"title":return l*c.title.localeCompare(u.title);case"created":return l*(new Date(c.createdAt).getTime()-new Date(u.createdAt).getTime());case"updated":return l*Y9(c,u);default:return 0}}),i}r(Q9,"sortIssues");function G9(e,t,i,l){const c=Math.min(i.length,ZA);if(!e||e.identity!==t)return c;if(e.ids===i)return Math.min(i.length,Math.max(e.limit,l,c));const u=new Map;i.forEach((h,g)=>u.set(h,g));const m=Math.min(e.limit,e.ids.length);let f=-1;for(let h=0;h<m;h+=1){const g=u.get(e.ids[h]);g!==void 0&&g>f&&(f=g)}return Math.min(i.length,Math.max(f+1,l,c))}r(G9,"nextIssueRowRenderLimit");function Wg(e){return e.lastActivityAt??e.updatedAt}r(Wg,"issueRecencyDate");function Y9(e,t){const i=new Date(Wg(e)).getTime()-new Date(Wg(t)).getTime();return i!==0?i:new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}r(Y9,"compareIssueRecency");function X9(e){return e.sortDir!=="desc"?null:e.sortField==="created"?t=>t.createdAt:e.sortField==="updated"?Wg:null}r(X9,"issueDateSeparatorDate");var e2=864e5,Z9=7*e2;function J9(e,t=Date.now()){const i=t-new Date(e).getTime();return i<e2?0:i<Z9?1:2}r(J9,"issueAgeBucket");function eF(e){return e===1?"Older than a day":"Older than a week"}r(eF,"issueAgeSeparatorLabel");function tF(e,t){const i=[];return e<1&&t>=1&&i.push(1),e<2&&t>=2&&i.push(2),i}r(tF,"issueAgeBucketsCrossed");function Ek({label:e}){return(0,s.jsxs)("div",{className:"flex items-center gap-3 px-3 py-1.5 sm:pl-0 sm:pr-4",role:"separator","aria-label":e,"data-issues-date-separator":"",children:[(0,s.jsx)("span",{className:"h-px min-w-0 flex-1 bg-line/80","aria-hidden":"true","data-date-group-rule":""}),(0,s.jsx)("span",{className:"shrink-0 text-(length:--text-nano) font-medium uppercase tracking-wider text-ink-3/70","data-date-group-label":"",children:e}),(0,s.jsx)("span",{className:"h-px min-w-0 flex-1 bg-line/80","aria-hidden":"true","data-date-group-rule":""})]})}r(Ek,"IssueDateSeparator");function nF(e){return e!=="done"&&e!=="cancelled"&&e!=="blocked"}r(nF,"isActionableWorkflowStatus");function sF(e,t){const i=new Map;if(!t)return e.forEach((m,f)=>{i.set(m.id,String(f+1))}),i;const{roots:l,childMap:c}=uf(e),u=r((m,f)=>{m.forEach((h,g)=>{const v=f?`${f}.${g+1}`:String(g+1);i.set(h.id,v),u(c.get(h.id)??[],v)})},"visit");return u(l,null),e.forEach((m,f)=>{i.has(m.id)||i.set(m.id,String(f+1))}),i}r(sF,"buildChecklistStepNumberMap");function aF(e,t){const i=new Map;if(!t){const m=new Map;for(const f of e){if(!f.parentId)continue;const h=m.get(f.parentId);h&&i.set(f.id,h.id),m.set(f.parentId,f)}return i}const{roots:l,childMap:c}=uf(e),u=r(m=>{m.forEach((f,h)=>{const g=h>0?m[h-1]:null;f.parentId&&g?.parentId===f.parentId&&i.set(f.id,g.id),u(c.get(f.id)??[])})},"visit");return u(l),i}r(aF,"buildPreviousSiblingIssueIdMap");function iF(e,t,i){return!!(e.parentId&&i&&(e.blockedBy??[]).length===1&&t.length===1&&t[0]===i)}r(iF,"shouldSuppressSinglePreviousSiblingBlockerChip");function rF({context:e,search:t,controls:i}){return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2 sm:gap-3",children:[e,t]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:i})]})}r(rF,"LegacyIssuesToolbar");function lF({value:e,context:t,onDebouncedChange:i}){return(0,s.jsx)(M7,{value:e,context:t,onChange:r(({raw:l})=>i(l),"onChange"),ariaLabel:"Search tasks",className:"w-full sm:w-64 md:w-80",inputClassName:"text-xs sm:text-sm",pageSearchTarget:!0,onKeyDown:r(l=>{if(iB({key:l.key,isComposing:l.nativeEvent.isComposing})){l.currentTarget.blur();return}rB({key:l.key,isComposing:l.nativeEvent.isComposing,currentValue:l.currentTarget.value})&&l.currentTarget.blur()},"onKeyDown")})}r(lF,"IssueSearchInput");function oF({summary:e,issueLinkState:t,parentIssueIdForCostSummary:i}){const l=e.target,c=l?.issue??null,u=c?.identifier??c?.id??"",m=c?i0(t,c):void 0,f=Ic.map(k=>({status:k,count:e.countsByStatus[k]??0})).filter(k=>k.count>0),h=e.inProgressCount>0,g=S7({visibleMs:5e3}),{data:v}=ge({queryKey:U.issues.costSummary(i??"pending",{excludeRoot:!0}),queryFn:r(()=>hn.getCostSummary(i,{excludeRoot:!0}),"queryFn"),enabled:!!i,refetchInterval:h?g:!1}),y=v?v.inputTokens+v.cachedInputTokens+v.outputTokens:0,j=!!v&&(v.runCount>0||y>0);return(0,s.jsx)("div",{className:"border border-line bg-bg p-3",children:(0,s.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm",children:[(0,s.jsxs)("span",{className:"font-medium text-ink",children:[e.doneCount,"/",e.totalCount," done"]}),(0,s.jsxs)("span",{className:"text-ink-3",children:[e.inProgressCount," in progress"]}),(0,s.jsxs)("span",{className:"text-ink-3",children:[e.blockedCount," blocked"]}),j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"text-ink-3 tabular-nums",title:`${v.runCount.toLocaleString()} run${v.runCount===1?"":"s"} across ${v.issueCount} sub-task${v.issueCount===1?"":"s"}`,children:[tE(y)," tokens"]}),(0,s.jsxs)("span",{className:"text-ink-3 tabular-nums",children:[G_(v.runtimeMs)," runtime"]})]})]}),(0,s.jsx)("div",{role:"progressbar","aria-label":"Sub-tasks completion progress","aria-valuemin":0,"aria-valuenow":e.doneCount,"aria-valuemax":e.totalCount,className:"flex h-2 w-full overflow-hidden rounded-full bg-bg-3",children:f.map(({status:k,count:S})=>(0,s.jsx)("span",{className:X("h-full",B9[k]),style:{width:`${S/e.totalCount*100}%`},title:`${$9[k]}: ${S}`,"aria-hidden":"true"},k))})]}),(0,s.jsx)("div",{className:"min-w-0 border border-line bg-bg px-3 py-2 text-sm lg:w-72",children:l&&c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-xs font-medium text-ink-3",children:l.kind==="next"?"Next up":"Waiting on blockers"}),(0,s.jsxs)(gn,{to:Td(u),state:m,issuePrefetch:c,className:"mt-1 block min-w-0 text-ink underline-offset-2 hover:underline",children:[(0,s.jsx)("span",{className:"font-mono text-xs text-ink-3",children:c.identifier??c.id.slice(0,8)})," ",(0,s.jsx)("span",{children:c.title})]})]}):e.totalCount===0?(0,s.jsx)("div",{className:"text-sm font-medium text-ink",children:"No active sub-tasks"}):e.doneCount===e.totalCount?(0,s.jsx)("div",{className:"text-sm font-medium text-ink",children:"All sub-tasks done"}):(0,s.jsx)("div",{className:"text-sm font-medium text-ink",children:"No actionable sub-tasks"})})]})})}r(oF,"SubIssueProgressSummaryStrip");var Ik=["","pl-4 sm:pl-0","pl-8 sm:pl-0","pl-12 sm:pl-0","pl-16 sm:pl-0"];function cF(e){return(0,s.jsx)(uF,{...e})}r(cF,"IssuesList");function uF({issues:e,isLoading:t,error:i,agents:l,projects:c,liveIssueIds:u,liveRuns:m,projectId:f,viewStateKey:h,issueLinkState:g,initialAssignees:v,initialWorkspaces:y,initialStatuses:j,initialSearch:k,searchFilters:S,searchWithinLoadedIssues:N=!1,baseCreateIssueDefaults:_,createIssueLabel:I,defaultSortField:D,showProgressSummary:T=!1,parentIssueIdForCostSummary:C,enableRoutineVisibilityFilter:M=!1,hasMoreIssues:z=!1,isLoadingMoreIssues:K=!1,mutedIssueIds:P,issueBadgeById:A,onLoadMoreIssues:B,onSearchChange:O,rowPresentation:W="legacy",toolbarContext:Y,toolbarPresentation:ce="legacy",listHeader:oe,onUpdateIssue:$}){const R=(0,x.useRef)(null),ne=bs(),ue=wn(),[ae,Ee]=(0,x.useState)(null),fe=(0,x.useRef)(!0);(0,x.useEffect)(()=>{const V=r(()=>{fe.current=!0},"handlePointerMove");return window.addEventListener("mousemove",V,{passive:!0}),()=>window.removeEventListener("mousemove",V)},[]);const Ae=(0,x.useRef)(null),Ce=(0,x.useCallback)(V=>{fe.current&&(Ae.current=V,Ee(Q=>Q===null?Q:null))},[]),{selectedCompanyId:Se}=vt(),{openNewIssue:he}=Pa(),{data:De}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),{data:Ye}=ge({queryKey:U.access.companyUserDirectory(Se),queryFn:r(()=>Xa.listUserDirectory(Se),"queryFn"),enabled:!!Se}),{data:ze}=ge({queryKey:U.instance.experimentalSettings,queryFn:r(()=>fs.getExperimental(),"queryFn"),retry:!1}),ve=De?.user?.id??De?.session?.userId??null,ft=ze!==void 0,At=ze?.enableIsolatedWorkspaces===!0,xt=ze?.enableExternalObjects===!0,Pt=Se?`${h}:${Se}`:h,de={companyId:Se??"__unscoped__",collectionKey:h,legacyViewStorageKey:Pt,legacyColumnsStorageKey:W9(Pt)},Oe=v?.join("|")??"",qe=y?.join("|")??"",ut=j?`set:${j.join("|")}`:"",Vt=(0,x.useRef)(null);Vt.current===null&&(Vt.current=_k(de));const Wt=Vt.current,[H,rn]=(0,x.useState)(()=>Ak(Wt,v,y,D,j)),[je,$e]=(0,x.useState)(null),[He,mt]=(0,x.useState)(""),[it,Qt]=(0,x.useState)(k??""),[Rn,Gt]=(0,x.useState)(ZA),[Tt,Jt]=(0,x.useState)(Wt.columns),kt=(0,x.useRef)(!1),[Qn,pt]=(0,x.useState)(!1),dn=(0,x.useDeferredValue)(it).trim().toLowerCase();(0,x.useEffect)(()=>{Qt(k??"")},[k]);const{data:Rt}=ge({queryKey:U.issues.labels(Se),queryFn:r(()=>hn.listLabels(Se),"queryFn"),enabled:!!Se}),ln=(0,x.useMemo)(()=>({currentUserId:ve,agents:l,projects:c,labels:Rt}),[l,ve,Rt,c]),Dt=(0,x.useMemo)(()=>Ql(dn,ln),[dn,ln]),ht=Dt.query,Mt=ht.length>0||TC(Dt.filters),Re=Mt&&!N;(0,x.useEffect)(()=>{Mt||pt(!1)},[Mt]);const Me=(0,x.useRef)(`${Pt}::${Oe}::${qe}::${ut}`);(0,x.useEffect)(()=>{const V=`${Pt}::${Oe}::${qe}::${ut}`;if(Me.current!==V){Me.current=V;const Q=_k(de);rn(Ak(Q,v,y,D,j)),Jt(Q.columns)}},[Pt,v,Oe,y,qe,j,ut,D,de.companyId,de.collectionKey,de.legacyViewStorageKey,de.legacyColumnsStorageKey]);const Fe=(0,x.useCallback)(V=>{rn(Q=>{const Z={...Q,...V};return Hg(de,{viewState:Z,columns:Tt}),Z})},[de.companyId,de.collectionKey,de.legacyColumnsStorageKey,de.legacyViewStorageKey,Tt]);(0,x.useEffect)(()=>{!ft||xt||H.externalObjectStatuses.length===0||Fe({externalObjectStatuses:[]})},[ft,xt,Fe,H.externalObjectStatuses.length]),(0,x.useEffect)(()=>{const V=new Set(e.map(Z=>Z.parentId).filter(Boolean)),Q=H.collapsedParents.filter(Z=>V.has(Z));Q.length!==H.collapsedParents.length&&Fe({collapsedParents:Q})},[e]);const St=(0,x.useMemo)(()=>{if(!Mt)return{};const V={...Pz(H),...DC(Dt.filters)};return f&&(V.projectId=f),V},[Mt,Dt.filters,f,H]),{data:at=[]}=ge({queryKey:[...U.issues.search(Se,ht,f),S??{},St,"compact",xd,M?"with-routine-executions":"without-routine-executions"],queryFn:r(({signal:V})=>hn.listCompact(Se,{...St,...ht.length>0?{q:ht}:{},projectId:f,limit:xd,...S,...M?{includeRoutineExecutions:!0}:{}},{signal:V}).then(Q=>Q),"queryFn"),enabled:!!Se&&Re,placeholderData:r(V=>V,"placeholderData")}),Ot=t0({queries:U9.map(V=>({queryKey:[...U.issues.list(Se??"__no-company__"),"board-column",V,ht,St,f??"__all-projects__",S??{},"compact",bd,M?"with-routine-executions":"without-routine-executions"],queryFn:r(({signal:Q})=>St.status&&!St.status.split(",").includes(V)?Promise.resolve([]):hn.listCompact(Se,{...St,...S,...ht.length>0?{q:ht}:{},projectId:f,status:V,limit:bd,...M?{includeRoutineExecutions:!0}:{}},{signal:Q}).then(Z=>Z),"queryFn"),enabled:!!Se&&H.viewMode==="board"&&!N,placeholderData:r(Q=>Q,"placeholderData")}))}),{data:on=[]}=ge({queryKey:Se?U.executionWorkspaces.summaryList(Se):["execution-workspaces","__disabled__"],queryFn:r(()=>Lf.listSummaries(Se),"queryFn"),enabled:!!Se&&At}),Ut=(0,x.useCallback)(V=>!V||!l?null:l.find(Q=>Q.id===V)?.name??null,[l]),en=(0,x.useMemo)(()=>oP(Ye?.users),[Ye?.users]),tn=(0,x.useMemo)(()=>cP(Ye?.users),[Ye?.users]),fn=(0,x.useMemo)(()=>{const V=new Map;for(const Q of c??[])V.set(Q.id,{name:Q.name,color:Q.color??null});return V},[c]),An=(0,x.useMemo)(()=>{const V=new Map;for(const Q of c??[])for(const Z of Q.workspaces??[])V.set(Z.id,{name:Z.name||Q.name,projectId:Q.id});return V},[c]),Dn=(0,x.useMemo)(()=>{const V=new Map;for(const Q of c??[]){const Z=Q.executionWorkspacePolicy?.defaultProjectWorkspaceId??Q.primaryWorkspace?.id??null;Z&&V.set(Q.id,Z)}return V},[c]),ta=(0,x.useMemo)(()=>new Set(Dn.values()),[Dn]),ms=(0,x.useMemo)(()=>{const V=new Map;for(const Q of on){const Z=Q.projectWorkspaceId?An.get(Q.projectWorkspaceId)??null:null;V.set(Q.id,{name:Q.name,mode:Q.mode,projectWorkspaceId:Q.projectWorkspaceId??null,projectId:Z?.projectId??null})}return V},[on,An]),Is=(0,x.useMemo)(()=>({executionWorkspaceById:ms,defaultProjectWorkspaceIdByProjectId:Dn}),[Dn,ms]),na=(0,x.useMemo)(()=>{const V=new Map;for(const[Q,Z]of An)My({id:Q},ta)&&V.set(Q,Z.name);for(const[Q,Z]of ms)My({id:Q,mode:Z.mode,projectWorkspaceId:Z.projectWorkspaceId},ta)&&V.set(Q,Z.name);return V},[ta,ms,An]),ps=(0,x.useMemo)(()=>{const V=new Map,Q=new Set;ve&&V.set(`user:${ve}`,{id:`user:${ve}`,label:ve==="local-board"?"Board":"Me",kind:"user",searchText:ve==="local-board"?"board me human local-board":`me board human ${ve}`});for(const Z of e)if(Z.createdByUserId){const Te=`user:${Z.createdByUserId}`;V.has(Te)||V.set(Te,{id:Te,label:Ur(Z.createdByUserId,ve)??Z.createdByUserId.slice(0,5),kind:"user",searchText:`${Z.createdByUserId} board user human`})}for(const Z of l??[]){Q.add(Z.id);const Te=`agent:${Z.id}`;V.has(Te)||V.set(Te,{id:Te,label:Z.name,kind:"agent",searchText:`${Z.name} ${Z.id} agent`})}for(const Z of e)if(Z.createdByAgentId&&!Q.has(Z.createdByAgentId)){const Te=`agent:${Z.createdByAgentId}`;V.has(Te)||V.set(Te,{id:Te,label:Z.createdByAgentId.slice(0,8),kind:"agent",searchText:`${Z.createdByAgentId} agent`})}return[...V.values()].sort((Z,Te)=>Z.kind!==Te.kind?Z.kind==="user"?-1:1:Z.label.localeCompare(Te.label))},[l,ve,e]),bt=(0,x.useMemo)(()=>new Set(Tt),[Tt]),kn=(0,x.useMemo)(()=>xO(At),[At]),es=(0,x.useMemo)(()=>new Set(kn),[kn]),Ua=(0,x.useMemo)(()=>HA(e,u??new Set),[e,u]),Kn=(0,x.useMemo)(()=>R9(m,e),[e,m]),ja=(0,x.useMemo)(()=>V7.filter(V=>bt.has(V)&&es.has(V)&&(W==="legacy"||V!=="updated")),[es,W,bt]),Gn=(0,x.useMemo)(()=>{const V=new Map;for(const Q of e)V.set(Q.id,Q);return V},[e]),Sn=(0,x.useMemo)(()=>{const V=new Map;for(const Q of e)V.set(Q.id,Q.identifier?`${Q.identifier}: ${Q.title}`:Q.title);return V},[e]),Bs=(0,x.useMemo)(()=>{if(H.viewMode!=="board"||N)return null;const V=new Map;let Q=!1;for(const Z of Ot){Q||=Z.isPending;for(const Te of Z.data??[])V.set(Te.id,Te)}return V.size>0?[...V.values()]:Q?e:[]},[Ot,e,N,H.viewMode]),vs=(0,x.useMemo)(()=>H.viewMode==="board"&&!N&&Ot.some(V=>(V.data?.length??0)===bd),[Ot,N,H.viewMode]),Mn=(0,x.useMemo)(()=>Bs??(Re?at:e),[Bs,e,Re,at]),Ts=(0,x.useMemo)(()=>{if(!Mt||!N)return Mn;const V=MC(ht);return Mn.filter(Q=>Uz(Q,V)&&$z(Q,Dt.filters))},[Mt,ht,Dt.filters,N,Mn]),_n=Re&&!Qn&&H.viewMode==="list",mn=H.externalObjectStatuses.length>0,$a=(0,x.useMemo)(()=>H.viewMode==="list"||mn?Ts.map(V=>V.id):[],[mn,Ts,H.viewMode]),{summaries:Ba,isLoading:hs,isReady:ys}=A7(Se,$a),wa=(0,x.useMemo)(()=>({...Is,externalObjectSummaryByIssueId:Ba,externalObjectSummariesReady:ys&&!hs}),[hs,ys,Ba,Is]),Ka=mn&&hs&&!ys,Lt=(0,x.useMemo)(()=>{const V=AS(Ts,H,ve,M,u,wa);return _n?V:Q9(V,H)},[_n,Ts,H,ve,M,u,wa]),sa=(0,x.useMemo)(()=>L7(T,e.length)?z7(e):null,[e,T]),Ks=(0,x.useMemo)(()=>D==="workflow"&&H.groupBy==="none",[D,H.groupBy]),qs=(0,x.useMemo)(()=>{if(!Ks)return null;const V=new Set(Lt.map(et=>et.id)),Q=sF(Lt,H.nestingEnabled),Z=aF(Lt,H.nestingEnabled),Te=new Map;return Lt.forEach(et=>{const zt=(et.blockedBy??[]).map(rt=>rt.id).filter(rt=>{if(!V.has(rt))return!1;const cn=Gn.get(rt);return cn?cn.status!=="done"&&cn.status!=="cancelled":!1}),En=iF(et,zt,Z.get(et.id));Te.set(et.id,En?[]:zt)}),{stepNumberByIssueId:Q,unresolvedVisibleBlockersByIssueId:Te,currentStepIssueId:(Lt.find(et=>nF(et.status))??null??Lt.find(et=>et.status==="blocked")??null)?.id??null}},[Ks,Lt,Gn,H.nestingEnabled]),js=C3(H,M),On=H.viewMode==="board"&&Lt.length>100,ka=H.boardCardDensity==="compact"||H.boardCardDensity==="auto"&&On,Rs=(0,x.useMemo)(()=>H.boardColdLaneMode==="collapsed"||H.boardColdLaneMode==="auto"&&On?[...v9]:[],[On,H.boardColdLaneMode]),ie=H.boardCardDensity!=="auto"||H.boardColdLaneMode!=="auto"||H.boardColumnPageSize!==10,Ie=(0,x.useMemo)(()=>{if(H.groupBy==="none")return[{key:"__all",label:null,items:Lt}];if(H.groupBy==="status"){const Q=Dl(Lt,Z=>Z.status);return Pd.filter(Z=>Q[Z]?.length).map(Z=>({key:Z,label:Qh(Z),items:Q[Z]}))}if(H.groupBy==="priority"){const Q=Dl(Lt,Z=>Z.priority);return Wh.filter(Z=>Q[Z]?.length).map(Z=>({key:Z,label:Qh(Z),items:Q[Z]}))}if(H.groupBy==="workspace"){const Q=Dl(Lt,Z=>Dy(Z,Is)??"__no_workspace");return Object.keys(Q).sort((Z,Te)=>Z==="__no_workspace"?1:Te==="__no_workspace"?-1:(Q[Te]?.length??0)-(Q[Z]?.length??0)).map(Z=>({key:Z,label:Z==="__no_workspace"?"No Workspace":na.get(Z)??Z.slice(0,8),items:Q[Z]}))}if(H.groupBy==="project"){const Q=Dl(Lt,Z=>Z.projectId??"__no_project");return Object.keys(Q).sort((Z,Te)=>{if(Z==="__no_project")return 1;if(Te==="__no_project")return-1;const et=fn.get(Z)?.name??Z,zt=fn.get(Te)?.name??Te;return et.localeCompare(zt)}).map(Z=>({key:Z,label:Z==="__no_project"?"No Project":fn.get(Z)?.name??Z.slice(0,8),items:Q[Z]}))}if(H.groupBy==="parent"){const Q=Dl(Lt,Z=>Z.parentId??"__no_parent");return Object.keys(Q).sort((Z,Te)=>Z==="__no_parent"?1:Te==="__no_parent"?-1:(Q[Te]?.length??0)-(Q[Z]?.length??0)).map(Z=>({key:Z,label:Z==="__no_parent"?"No Parent":Sn.get(Z)??Z.slice(0,8),items:Q[Z]}))}const V=Dl(Lt,Q=>Q.assigneeAgentId??(Q.assigneeUserId?`__user:${Q.assigneeUserId}`:"__unassigned"));return Object.keys(V).map(Q=>({key:Q,label:Q==="__unassigned"?"Unassigned":Q.startsWith("__user:")?Ur(Q.slice(7),ve,en)??"User":Ut(Q)??Q.slice(0,8),items:V[Q]}))},[Lt,Is,H.groupBy,l,Ut,ve,na,Sn,en,fn]),Le=(0,x.useMemo)(()=>JSON.stringify([Pt,dn,H.statuses,H.priorities,H.assignees,H.creators,H.labels,H.projects,H.workspaces,H.liveOnly??!1,H.externalObjectStatuses,H.hideRoutineExecutions,H.sortField,H.sortDir,H.groupBy,H.viewMode,H.nestingEnabled,_n]),[Pt,dn,H.statuses,H.priorities,H.assignees,H.creators,H.labels,H.projects,H.workspaces,H.liveOnly,H.externalObjectStatuses,H.hideRoutineExecutions,H.sortField,H.sortDir,H.groupBy,H.viewMode,H.nestingEnabled,_n]),nt=(0,x.useRef)({identity:"",keptRootIds:new Set,seenIds:new Set,knownIds:new Set}),gt=(0,x.useMemo)(()=>{const V=new Map;if(H.viewMode!=="list")return V;const Q=nt.current.identity===Le?nt.current:null;for(const Z of Ie){if(!H.nestingEnabled){V.set(Z.key,{roots:Z.items,childMap:new Map});continue}let Te;if(Q){Te=new Set(Q.keptRootIds);for(const et of Z.items)et.parentId&&!Q.knownIds.has(et.id)&&Q.seenIds.has(et.parentId)&&Te.add(et.id)}V.set(Z.key,uf(Z.items,Te))}return V},[Ie,Le,H.nestingEnabled,H.viewMode]),qt=r(V=>gt.get(V.key)??(H.nestingEnabled?uf(V.items):{roots:V.items,childMap:new Map}),"issueTreeForGroup"),Ds=(0,x.useMemo)(()=>{if(H.viewMode!=="list")return[];const V=[];let Q=0;for(const Z of Ie){const Te=!!Z.label&&H.collapsedGroups.includes(Z.key);Z.label&&V.push({type:"group",key:Z.key,collapsed:Te});const{roots:et,childMap:zt}=qt(Z),En=r(rt=>{Q+=1;const cn=zt.get(rt.id)??[],_t=!H.collapsedParents.includes(rt.id);if(Te||V.push({type:"issue",issue:rt,hasChildren:cn.length>0,expanded:_t,budgetOrdinal:Q}),_t)for(const ye of cn)En(ye)},"walk");for(const rt of et)En(rt)}return V},[Ie,H.viewMode,H.collapsedGroups,H.collapsedParents,H.nestingEnabled]),J=(0,x.useRef)({flatNavEntries:Ds,selectedNavKey:ae,viewMode:H.viewMode,issueLinkState:g,collapsedGroups:H.collapsedGroups,collapsedParents:H.collapsedParents,updateView:Fe});J.current={flatNavEntries:Ds,selectedNavKey:ae,viewMode:H.viewMode,issueLinkState:g,collapsedGroups:H.collapsedGroups,collapsedParents:H.collapsedParents,updateView:Fe};const _e=(0,x.useCallback)(V=>{if(V.startsWith("group:")){const Z=R.current?.querySelector(`[data-issues-group-key="${Vg(V.slice(6))}"]`);return Z instanceof HTMLElement?Z:null}const Q=R.current?.querySelector(`[data-issue-row-id="${Vg(V.slice(6))}"]`)?.querySelector("[data-inbox-issue-link]");return Q instanceof HTMLElement?Q:null},[]);(0,x.useEffect)(()=>{const V=r(Q=>{if(Q.defaultPrevented)return;const Z=Q.target;if(!(Z instanceof HTMLElement)||ao(Z)||Cg(document)||Q.metaKey||Q.ctrlKey||Q.altKey)return;const Te=J.current;if(Te.viewMode!=="list"||Te.flatNavEntries.length===0)return;const et=r(rt=>rt?Te.flatNavEntries.findIndex(cn=>vd(cn)===rt):-1,"indexOfKey"),zt=et(Ae.current),En=fe.current&&zt>=0?zt:et(Te.selectedNavKey);switch(Q.key){case"j":case"ArrowDown":case"k":case"ArrowUp":{Q.preventDefault(),fe.current=!1;const rt=Q.key==="j"||Q.key==="ArrowDown"?"next":"previous",cn=wO(En,Te.flatNavEntries.length,rt),_t=Te.flatNavEntries[cn];if(!_t)break;Ee(vd(_t)),_t.type==="issue"&&Gt(ye=>Math.max(ye,_t.budgetOrdinal+1));break}case"ArrowLeft":case"ArrowRight":{const rt=Te.flatNavEntries[En];if(!rt)return;const cn=Q.key==="ArrowLeft";if(rt.type==="group"){Q.preventDefault(),fe.current=!1,Ee(vd(rt)),Te.updateView({collapsedGroups:cn?Te.collapsedGroups.includes(rt.key)?Te.collapsedGroups:[...Te.collapsedGroups,rt.key]:Te.collapsedGroups.filter(_t=>_t!==rt.key)});break}if(!rt.hasChildren)return;Q.preventDefault(),fe.current=!1,Ee(vd(rt)),Te.updateView({collapsedParents:cn?Te.collapsedParents.includes(rt.issue.id)?Te.collapsedParents:[...Te.collapsedParents,rt.issue.id]:Te.collapsedParents.filter(_t=>_t!==rt.issue.id)});break}case"Enter":{const rt=Te.flatNavEntries[En];if(!rt||rt.type!=="issue")return;Q.preventDefault();const cn=rt.issue,_t=cn.identifier??cn.id,ye=i0(Te.issueLinkState,cn);Bh(_t,ye),_E(ue,_t,{issue:cn}),ne(Td(_t),{state:ye});break}default:return}},"handleKeyDown");return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[ne,ue]);const Be=(0,x.useMemo)(()=>{if(H.viewMode!=="list")return[];const V=[];for(const Q of Ie){const{roots:Z,childMap:Te}=qt(Q),et=r(zt=>{if(V.push(zt.id),!H.collapsedParents.includes(zt.id))for(const En of Te.get(zt.id)??[])et(En)},"walk");for(const zt of Z)et(zt)}return V},[Ie,H.collapsedParents,H.nestingEnabled,H.viewMode]),Xe=(0,x.useRef)(null),Ve=(0,x.useMemo)(()=>H.viewMode==="list"?G9(Xe.current,Le,Be,Rn):Rn,[Be,Le,Rn,H.viewMode]);(0,x.useLayoutEffect)(()=>{H.viewMode==="list"&&(Xe.current={identity:Le,ids:Be,limit:Ve},Rn!==Ve&&Gt(Ve))},[Be,Le,Ve,Rn,H.viewMode]),(0,x.useEffect)(()=>{ae&&_e(ae)?.scrollIntoView({block:"nearest"})},[_e,Ve,ae]),(0,x.useLayoutEffect)(()=>{if(!H.nestingEnabled||H.viewMode!=="list")return;const V=nt.current,Q=V.identity===Le?V:{identity:Le,keptRootIds:new Set,seenIds:new Set,knownIds:new Set},Z=Be.slice(0,Ve);for(const Te of Z)Q.seenIds.add(Te);for(const Te of Ie)for(const et of Te.items)Q.knownIds.add(et.id);for(const Te of gt.values())for(const et of Te.roots)et.parentId&&(Q.seenIds.has(et.id)||Q.knownIds.has(et.parentId))&&Q.keptRootIds.add(et.id);nt.current=Q},[Be,Ie,gt,Le,Ve,H.nestingEnabled,H.viewMode]);const ot=(0,x.useRef)(null),yt=(0,x.useCallback)(()=>{const V=R.current;if(!V||H.viewMode!=="list"){ot.current=null;return}ot.current=z9(V,yd(V),Le)},[Le,H.viewMode]);(0,x.useEffect)(()=>{if(H.viewMode!=="list")return;const V=yd(R.current)??window;return V.addEventListener("scroll",yt,{passive:!0}),()=>V.removeEventListener("scroll",yt)},[yt,H.viewMode]),(0,x.useLayoutEffect)(()=>{const V=R.current,Q=ot.current;if(V&&Q&&Q.identity===Le&&H.viewMode==="list"){const Z=yd(V),Te=P9(V,Z,Q);if(Te===null)return;Te!==0&&(Z?Z.scrollTop+=Te:window.scrollBy(0,Te))}yt()},[Be,yt,Le,Ve,H.viewMode]);const pn=(0,x.useRef)(null),Ln=!!oe&&H.viewMode==="list"&&!H.liveOnly&&dn.length===0;(0,x.useLayoutEffect)(()=>{const V=pn.current;if(!Ln||!V||typeof ResizeObserver>"u")return;const Q=new ResizeObserver(()=>yt());return Q.observe(V),()=>Q.disconnect()},[yt,Ln]);const Ms=H.viewMode==="list"&&Ve<Lt.length,zn=Math.max(Lt.length-Ve,0),Ft=(0,x.useCallback)(()=>{if(H.viewMode==="list"){if(Ms){Gt(Math.min(Lt.length,Ve+D9));return}z&&!K&&B?.()}},[Lt.length,z,Ms,K,B,Ve,H.viewMode]),Nn=H.viewMode==="list"&&!t&&(Ms||z&&!K);(0,x.useEffect)(()=>{if(!Nn)return;let V=null;const Q=yd(R.current),Z=Q??window,Te=r((En="scroll")=>{V===null&&(V=window.requestAnimationFrame(()=>{V=null;const rt=Q?.scrollHeight??document.documentElement.scrollHeight;if(rt===0)return;const cn=Q?.clientHeight??window.innerHeight,_t=Q?Q.scrollTop+Q.clientHeight:window.scrollY+window.innerHeight,ye=rt>cn+1;if(_t>=rt-M9){if(En==="initial"&&!Ms&&z&&!ye){if(kt.current)return;kt.current=!0}Ft()}}))},"checkScrollPosition"),et=r(()=>Te("scroll"),"handleScroll"),zt=r(()=>Te("resize"),"handleResize");return Z.addEventListener("scroll",et,{passive:!0}),window.addEventListener("resize",zt),Te("initial"),()=>{Z.removeEventListener("scroll",et),window.removeEventListener("resize",zt),V!==null&&window.cancelAnimationFrame(V)}},[Nn,z,Ms,Ft]);const ws=(0,x.useCallback)(V=>{const Q=V?.key,Z={..._??{}};if(f&&Z.projectId===void 0&&(Z.projectId=f),Q){if(H.groupBy==="status")Z.status=Q;else if(H.groupBy==="priority")Z.priority=Q;else if(H.groupBy==="assignee"&&Q!=="__unassigned")Q.startsWith("__user:")?Z.assigneeUserId=Q.slice(7):Z.assigneeAgentId=Q;else if(H.groupBy==="project"&&Q!=="__no_project")Z.projectId=Q;else if(H.groupBy==="workspace"&&Q!=="__no_workspace"){const Te=V?.items.find(zt=>zt.executionWorkspaceId===Q||zt.projectWorkspaceId===Q)??null,et=ms.get(Q);if(et){Z.executionWorkspaceId=Q,Z.executionWorkspaceMode="reuse_existing",et.projectWorkspaceId&&(Z.projectWorkspaceId=et.projectWorkspaceId);const zt=et.projectId??(et.projectWorkspaceId?An.get(et.projectWorkspaceId)?.projectId:null)??(Te?.executionWorkspaceId===Q?Te.projectId:null);zt&&(Z.projectId=zt)}else{const zt=An.get(Q);zt&&(Z.projectWorkspaceId=Q,Z.projectId=zt.projectId)}}else if(H.groupBy==="parent"&&Q!=="__no_parent"){const Te=Gn.get(Q);Te?Object.assign(Z,C9(Te,ve)):Z.parentId=Q}}return Z},[_,ve,ms,Gn,f,An,H.groupBy]),Fs=I?`Create ${I}`:"Create Task",Yt=I?`New ${I}`:"New Task",gs=(0,x.useCallback)(V=>{he(ws(V))},[ws,he]),cr=(0,x.useCallback)(V=>{Fe({workspaces:[V]})},[Fe]),aa=(0,x.useCallback)(V=>{const Q=EN(V);Jt(Q),Hg(de,{viewState:H,columns:Q})},[de.companyId,de.collectionKey,de.legacyColumnsStorageKey,de.legacyViewStorageKey,H]),$c=(0,x.useCallback)((V,Q)=>{if(Q){aa([...Tt,V]);return}aa(Tt.filter(Z=>Z!==V))},[aa,Tt]),ei=(0,x.useCallback)((V,Q,Z=null)=>{$(V,{assigneeAgentId:Q,assigneeUserId:Z}),$e(null),mt("")},[$]);let Hs=H.viewMode==="list"?Ve:Number.POSITIVE_INFINITY;return(0,s.jsxs)("div",{ref:R,className:"wardmote-issue-list space-y-4",children:[sa?(0,s.jsx)(oF,{summary:sa,issueLinkState:g,parentIssueIdForCostSummary:C}):null,(0,s.jsx)(ce==="collection"?g9:rF,{className:"wardmote-task-list-toolbar",ariaLabel:ce==="collection"?"Task controls":void 0,context:Y?(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[Y,(0,s.jsxs)(le,{size:"sm",variant:"secondary","aria-label":Yt,onClick:r(()=>gs(),"onClick"),children:[(0,s.jsx)(Js,{className:"h-4 w-4 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:Yt})]})]}):(0,s.jsxs)(le,{size:"sm",variant:"secondary","aria-label":Yt,onClick:r(()=>gs(),"onClick"),children:[(0,s.jsx)(Js,{className:"h-4 w-4 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:Yt})]}),search:(0,s.jsx)(lF,{value:it,context:ln,onDebouncedChange:r(V=>{Qt(V),O?.(V)},"onDebouncedChange")}),controls:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center border border-line rounded-md overflow-hidden mr-1",role:"group","aria-label":"View mode",children:[(0,s.jsx)("button",{className:`flex h-8 w-8 items-center justify-center transition-colors ${H.viewMode==="list"?"bg-bg-3 text-ink":"text-ink-3 hover:text-ink"}`,onClick:r(()=>Fe({viewMode:"list"}),"onClick"),title:"List view","aria-label":"List view","aria-pressed":H.viewMode==="list",children:(0,s.jsx)(HT,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("button",{className:`flex h-8 w-8 items-center justify-center transition-colors ${H.viewMode==="board"?"bg-bg-3 text-ink":"text-ink-3 hover:text-ink"}`,onClick:r(()=>Fe({viewMode:"board"}),"onClick"),title:"Board view","aria-label":"Board view","aria-pressed":H.viewMode==="board",children:(0,s.jsx)(eR,{className:"h-3.5 w-3.5"})})]}),H.viewMode==="list"&&(0,s.jsx)(le,{active:H.nestingEnabled,type:"button",variant:"secondary",size:"icon",className:X("hidden h-8 w-8 shrink-0 sm:inline-flex"),onClick:r(()=>Fe({nestingEnabled:!H.nestingEnabled}),"onClick"),title:H.nestingEnabled?"Disable parent-child nesting":"Enable parent-child nesting",children:(0,s.jsx)(f1,{className:"h-3.5 w-3.5"})}),H.viewMode==="board"&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(le,{active:ka,type:"button",variant:"secondary",size:"icon",className:X("h-8 w-8 shrink-0"),onClick:r(()=>Fe({boardCardDensity:ka?"comfortable":"compact"}),"onClick"),title:ka?"Use comfortable cards":"Use compact cards",children:(0,s.jsx)(TT,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(le,{active:Rs.length>0,type:"button",variant:"secondary",size:"icon",className:X("h-8 w-8 shrink-0"),onClick:r(()=>Fe({boardColdLaneMode:Rs.length>0?"expanded":"collapsed"}),"onClick"),title:Rs.length>0?"Expand cold lanes":"Collapse cold lanes",children:(0,s.jsx)(QT,{className:"h-3.5 w-3.5"})}),(0,s.jsxs)(va,{children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsxs)(le,{active:H.boardColumnPageSize!==10,type:"button",variant:"secondary",size:"sm",className:X("h-8 shrink-0 gap-1.5 px-2"),title:"Cards per column",children:[(0,s.jsx)(FT,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"min-w-4 text-xs tabular-nums",children:H.boardColumnPageSize})]})}),(0,s.jsx)(ba,{align:"end",className:"w-40 p-0",children:(0,s.jsx)("div",{className:"p-2 space-y-0.5",children:WA.map(V=>(0,s.jsxs)("button",{type:"button",className:X("flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm",H.boardColumnPageSize===V?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50"),onClick:r(()=>Fe({boardColumnPageSize:V}),"onClick"),children:[(0,s.jsxs)("span",{children:[V," per column"]}),H.boardColumnPageSize===V&&(0,s.jsx)(Ta,{className:"h-3.5 w-3.5"})]},V))})})]}),(0,s.jsx)(le,{type:"button",variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",onClick:r(()=>Fe({boardCardDensity:"auto",boardColdLaneMode:"expanded",boardColumnPageSize:10}),"onClick"),disabled:!ie,title:"Reset board density",children:(0,s.jsx)(ic,{className:"h-3.5 w-3.5"})})]}),(0,s.jsx)(Z7,{availableColumns:kn,visibleColumnSet:bt,onToggleColumn:$c,showDateGroupSeparators:H.showDateGroupSeparators,onToggleDateGroupSeparators:r(V=>Fe({showDateGroupSeparators:V}),"onToggleDateGroupSeparators"),onResetColumns:r(()=>aa(CN),"onResetColumns"),title:"Choose which task columns stay visible",iconOnly:!0,rowPresentation:W}),(0,s.jsx)(l9,{state:H,onChange:Fe,buttonVariant:"secondary",activeFilterCount:js,agents:l,creators:ps,projects:c?.map(V=>({id:V.id,name:V.name})),labels:Rt?.map(V=>({id:V.id,name:V.name,color:V.color})),currentUserId:ve,enableExternalObjectFilters:xt,enableRoutineVisibilityFilter:M,iconOnly:!0,presentation:W==="task"?"streamlined":"legacy"}),H.viewMode==="list"&&(0,s.jsxs)(va,{children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsx)(le,{variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",title:"Sort",children:(0,s.jsx)(tI,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(ba,{align:"end",className:"w-48 p-0",children:(0,s.jsxs)("div",{className:"p-2 space-y-0.5",children:[Re&&(0,s.jsx)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${_n?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>pt(!1),"onClick"),children:(0,s.jsx)("span",{children:"Relevance"})}),[["workflow","Workflow"],["status","Status"],["priority","Priority"],["title","Title"],["created","Created"],["updated","Updated"]].filter(([V])=>V!=="priority").map(([V,Q])=>(0,s.jsxs)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${!_n&&H.sortField===V?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>{Re&&pt(!0),_n?Fe({sortField:V,sortDir:V==="updated"||V==="created"?"desc":"asc"}):H.sortField===V?Fe({sortDir:H.sortDir==="asc"?"desc":"asc"}):Fe({sortField:V,sortDir:"asc"})},"onClick"),children:[(0,s.jsx)("span",{children:Q}),!_n&&H.sortField===V&&(0,s.jsx)("span",{className:"text-xs text-ink-3",children:H.sortDir==="asc"?"↑":"↓"})]},V))]})})]}),H.viewMode==="list"&&(0,s.jsxs)(va,{children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsx)(le,{variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",title:"Group",children:(0,s.jsx)(hf,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(ba,{align:"end",className:"w-44 p-0",children:(0,s.jsx)("div",{className:"p-2 space-y-0.5",children:[["status","Status"],["priority","Priority"],["assignee","Responsible"],["project","Project"],["workspace","Workspace"],["parent","Parent Task"],["none","None"]].filter(([V])=>V!=="priority").map(([V,Q])=>(0,s.jsxs)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${H.groupBy===V?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>Fe({groupBy:V}),"onClick"),children:[(0,s.jsx)("span",{children:Q}),H.groupBy===V&&(0,s.jsx)(Ta,{className:"h-3.5 w-3.5"})]},V))})})]})]})}),Ln?(0,s.jsx)("div",{ref:pn,children:oe}):null,(t||Ka)&&(0,s.jsx)(x9,{variant:"issues-list"}),i&&(0,s.jsx)("p",{className:"text-sm text-bad",children:i.message}),Re&&at.length===xd&&(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Showing up to ",xd," matches. Refine the search to narrow further."]}),vs&&(0,s.jsxs)("p",{className:"text-xs text-ink-3",children:["Some board columns are showing up to ",bd," tasks. Refine filters or search to reveal the rest."]}),!t&&!Ka&&Lt.length===0&&H.viewMode==="list"&&(0,s.jsx)(n9,{icon:Ld,message:"No tasks match the current filters or search.",action:Fs,onAction:r(()=>gs(),"onAction")}),H.viewMode==="board"?(0,s.jsx)(N9,{issues:Lt,agents:l,liveIssueIds:u,compactCards:ka,collapsedStatuses:Rs,initialVisibleCount:H.boardColumnPageSize,revealIncrement:H.boardColumnPageSize,onUpdateIssue:$}):(0,s.jsxs)("div",{className:"-mx-2 sm:mx-0",children:[Ie.map(V=>Hs<=0?null:(0,s.jsxs)(Jk,{open:!H.collapsedGroups.includes(V.key),onOpenChange:r(Q=>{Fe({collapsedGroups:Q?H.collapsedGroups.filter(Z=>Z!==V.key):[...H.collapsedGroups,V.key]})},"onOpenChange"),children:[V.label&&(0,s.jsx)("div",{"data-issues-group-key":V.key,className:X("rounded-lg px-3 sm:pl-0 sm:pr-4",ae===`group:${V.key}`?"bg-bg-3/50":"hover:bg-bg-3/50"),onClick:r(()=>Ee(`group:${V.key}`),"onClick"),onMouseEnter:r(()=>Ce(`group:${V.key}`),"onMouseEnter"),children:(0,s.jsx)(s9,{label:V.label,collapsible:!0,collapsed:H.collapsedGroups.includes(V.key),onToggle:r(()=>{Fe({collapsedGroups:H.collapsedGroups.includes(V.key)?H.collapsedGroups.filter(Q=>Q!==V.key):[...H.collapsedGroups,V.key]})},"onToggle"),trailing:(0,s.jsx)(le,{variant:"ghost",size:"icon-xs",className:"-mr-2",title:`New task in ${V.label}`,"aria-label":`New task in ${V.label}`,onClick:r(()=>gs(V),"onClick"),children:(0,s.jsx)(Js,{className:"h-3 w-3"})})})}),(0,s.jsx)(Zk,{children:(()=>{const{roots:Q,childMap:Z}=qt(V),Te=r((ye,ia)=>{if(Hs<=0)return null;Hs-=1;const rs=(Z.get(ye.id)??[]).length>0,Vs=rs?GA(ye.id,Z):0,ts=!H.collapsedParents.includes(ye.id),io=!(rs&&ts),Ci=ye.projectId?fn.get(ye.projectId)??null:null,ur=ye.parentId?Gn.get(ye.parentId)??null:null,Zr=A?.get(ye.id),Bf=P?.has(ye.id)===!0,dr=ye.assigneeUserId?tn.get(ye.assigneeUserId)??null:null,Bc=Ur(ye.assigneeUserId,ve,en)??dr?.label??null,Jr=Kk(ye),fr=Jr?.kind==="user"?Jr.id:null,Kc=Jr?.kind==="user"?Jr.viaAgentId??null:null,ro=r(Ke=>{Ke.preventDefault(),Ke.stopPropagation(),Fe({collapsedParents:ts?[...H.collapsedParents,ye.id]:H.collapsedParents.filter(ks=>ks!==ye.id)})},"toggleCollapse"),ti=qs,lo=ti?.stepNumberByIssueId.get(ye.id)??null,oo=ti?.unresolvedVisibleBlockersByIssueId.get(ye.id)??[],Kf=ti?`issue-workflow-row-${ye.id}`:void 0,qc=ti&&ye.status==="done"?"text-ink-3":void 0,co=oo.map(Ke=>{const ks=Gn.get(Ke);if(!ks)return null;const Fc=ks.identifier??ks.id.slice(0,8),ni=ti?.stepNumberByIssueId.get(Ke);return{blockerId:Ke,chipLabel:`blocked by ${Fc}${ni?` · step ${ni}`:""}`}}).filter(Ke=>Ke!==null),mr=co[0]??null,uo=Math.max(co.length-1,0),qf=uo>0?` ... and ${uo} more`:"",fo=mr?`${mr.chipLabel}${qf}`:"",mo=co.slice(1).map(Ke=>Ke.chipLabel).join(", "),Ai=uo>0?`${fo}: ${mo}`:fo,Ff=ti&&mr?(0,s.jsx)("button",{type:"button","data-slot":"icon-button",onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation();const ks=document.getElementById(`issue-workflow-row-${mr.blockerId}`);ks&&(ks.scrollIntoView({behavior:"smooth",block:"nearest"}),ks.focus?.())},"onClick"),className:"inline-flex items-center rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-amber-700 hover:bg-amber-100/80 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300",title:Ai,"aria-label":Ai,children:fo},mr.blockerId):null,po=Kn.get(ye.id)??null,ho=po?(0,s.jsx)(h9,{issueId:ye.id,run:po,companyId:Se,taskLabel:ye.identifier??ye.id.slice(0,8)}):void 0;return(0,s.jsx)("div",{"data-issue-row-id":ye.id,className:X(W==="legacy"&&ia>0&&Ik[Math.min(ia,Ik.length-1)],io&&"wardmote-issue-list-row-deferred")||void 0,children:(0,s.jsx)(d9,{issue:ye,presentation:W,issueLinkState:g,selected:ae===`issue:${ye.id}`,onMouseEnter:r(()=>Ce(`issue:${ye.id}`),"onMouseEnter"),treeGuides:ia,chevronInGuide:ia>0&&rs,checklistStepNumber:lo,checklistCurrentStep:ti?.currentStepIssueId===ye.id,checklistDependencyChips:Ff,checklistRowId:Kf,titleClassName:qc,externalObjectSummary:Ba.get(ye.id)??null,titleSuffix:(0,s.jsxs)(s.Fragment,{children:[rs&&!ts?(0,s.jsxs)("span",{className:"ml-1.5 text-xs text-ink-3",children:["(",Vs," sub-task",Vs!==1?"s":"",")"]}):null,Zr?Zr==="Paused"?(0,s.jsxs)(Bn,{variant:"ghost",className:X("ml-1.5 px-1.5 text-(length:--text-nano)",Id.paused),"aria-label":"Paused",title:"Paused",children:[(0,s.jsx)(RT,{className:"h-3 w-3"}),"Paused"]}):(0,s.jsx)(Bn,{variant:"outline",className:"ml-1.5 border-amber-500/40 bg-amber-500/10 px-1.5 text-(length:--text-nano) text-amber-700 dark:text-amber-300",children:Zr}):null,VA(ye)?(0,s.jsxs)(Bn,{variant:"outline",className:"ml-1.5 border-amber-400/45 bg-amber-50/60 px-1.5 text-(length:--text-nano) text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300","aria-label":"Needs next step",title:"This task needs a next step",children:[(0,s.jsx)(Ld,{className:"h-3 w-3"}),"Needs next step"]}):null]}),className:X(Bf&&"opacity-70",ae===`issue:${ye.id}`&&"bg-bg-3/50 hover:bg-bg-3/50"),leadingControl:W==="task"?rs?(0,s.jsx)("button",{type:"button","data-slot":"icon-button",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center","aria-label":ts?"Collapse sub-tasks":"Expand sub-tasks",onClick:ro,children:(0,s.jsx)(nr,{className:X("h-3.5 w-3.5 transition-transform",ts&&"rotate-90")})}):(0,s.jsx)("span",{"data-slot":"task-row-disclosure-spacer",className:"h-4 w-4 shrink-0","aria-hidden":"true"}):void 0,statusSlot:W==="task"?(0,s.jsxs)("span",{className:"relative inline-flex items-start self-stretch sm:items-center",onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation()},"onClick"),children:[(0,s.jsx)(Ya,{status:ye.status,externalConversationState:ye.externalConversationState,size:"md",blockerAttention:ye.blockerAttention,onChange:r(Ke=>$(ye.id,{status:Ke}),"onChange")}),rs&&ts?(0,s.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-5 -bottom-2.5 left-1/2 w-px bg-line sm:hidden"}):null]}):void 0,metadata:W==="task"?(0,s.jsx)(wk,{issue:ye,isLive:u?.has(ye.id)===!0,subtreeLiveCount:Ua.get(ye.id)??0,showStatus:!1,showIdentifier:!1,checklistStepNumber:lo}):void 0,actions:ho,showIdentifier:bt.has("id")&&es.has("id"),mobileLeading:rs?(0,s.jsx)("button",{type:"button","data-slot":"icon-button",onClick:ro,children:(0,s.jsx)(nr,{className:X("h-3.5 w-3.5 transition-transform",ts&&"rotate-90")})}):(0,s.jsx)("span",{className:"inline-flex items-center",onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation()},"onClick"),children:(0,s.jsx)(Ya,{status:ye.status,externalConversationState:ye.externalConversationState,size:"md",blockerAttention:ye.blockerAttention,onChange:r(Ke=>$(ye.id,{status:Ke}),"onChange")})}),desktopMetaLeading:W==="legacy"?(0,s.jsxs)(s.Fragment,{children:[rs?(0,s.jsx)("button",{type:"button","data-slot":"icon-button",className:"relative z-10 hidden w-4 shrink-0 items-center justify-center sm:inline-flex",onClick:ro,children:(0,s.jsx)(nr,{className:X("h-3.5 w-3.5 transition-transform",ts&&"rotate-90")})}):(0,s.jsx)("span",{className:"hidden w-4 shrink-0 sm:block"}),(0,s.jsx)(wk,{issue:ye,isLive:u?.has(ye.id)===!0,subtreeLiveCount:Ua.get(ye.id)??0,showStatus:bt.has("status")&&es.has("status"),showIdentifier:bt.has("id")&&es.has("id"),checklistStepNumber:lo,statusSlot:(0,s.jsx)("span",{className:"inline-flex items-center",onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation()},"onClick"),children:(0,s.jsx)(Ya,{status:ye.status,externalConversationState:ye.externalConversationState,size:"md",blockerAttention:ye.blockerAttention,onChange:r(Ke=>$(ye.id,{status:Ke}),"onChange")})})})]}):void 0,mobileTitleMeta:W==="task"?cf(ye):void 0,mobileMeta:W==="legacy"?Y7(ye).toLowerCase():ho,trailingMeta:W==="task"&&bt.has("updated")&&es.has("updated")?cf(ye):void 0,desktopTrailing:ja.length>0?(0,s.jsx)(t9,{issue:ye,columns:ja,projectName:Ci?.name??null,projectColor:Ci?.color??null,workspaceId:Dy(ye,Is),workspaceName:IN(ye,{executionWorkspaceById:ms,projectWorkspaceById:An,defaultProjectWorkspaceIdByProjectId:Dn}),onFilterWorkspace:cr,assigneeName:Ut(ye.assigneeAgentId),assigneeAgent:l?.find(Ke=>Ke.id===ye.assigneeAgentId),creatorAgent:l?.find(Ke=>Ke.id===ye.createdByAgentId),assigneeUserName:Bc,assigneeUserAvatarUrl:dr?.image??null,creatorAgentName:Ut(ye.createdByAgentId),creatorUserName:fr?tn.get(fr)?.label??null:null,creatorUserAvatarUrl:fr?tn.get(fr)?.image??null:null,viaAgentName:Kc?Ut(Kc):null,currentUserId:ve,parentIdentifier:ur?.identifier??null,parentTitle:ur?.title??null,assigneeContent:(0,s.jsxs)(va,{open:je===ye.id,onOpenChange:r(Ke=>{$e(Ke?ye.id:null),Ke||mt("")},"onOpenChange"),children:[(0,s.jsx)(xa,{asChild:!0,children:(0,s.jsx)("button",{className:"flex w-full shrink-0 items-center overflow-hidden rounded-md px-2 py-1 transition-colors hover:bg-bg-3/50",onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation()},"onClick"),children:ye.assigneeAgentId&&Ut(ye.assigneeAgentId)?(0,s.jsx)(Wl,{agent:l.find(Ke=>Ke.id===ye.assigneeAgentId),size:"sm",className:"min-w-0"}):ye.assigneeUserId?(0,s.jsx)(Hh,{name:Bc??"User",avatarUrl:dr?.image??null,size:"sm",className:"min-w-0"}):(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-ink-3",children:[(0,s.jsx)("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-dashed border-ink-3/35 bg-bg-3/30",children:(0,s.jsx)(Kl,{className:"h-3.5 w-3.5"})}),"Assignee"]})})}),(0,s.jsxs)(ba,{className:"w-56 p-1",align:"end",onClick:r(Ke=>Ke.stopPropagation(),"onClick"),onPointerDownOutside:r(()=>mt(""),"onPointerDownOutside"),children:[(0,s.jsx)("input",{className:"mb-1 w-full border-b border-line bg-transparent px-2 py-1.5 text-xs outline-none placeholder:text-ink-3/50",placeholder:"Search responsible...",value:He,onChange:r(Ke=>mt(Ke.target.value),"onChange"),autoFocus:!0}),(0,s.jsxs)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:[(0,s.jsx)("button",{className:X("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-bg-3/50",!ye.assigneeAgentId&&!ye.assigneeUserId&&"bg-bg-3"),onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation(),ei(ye.id,null,null)},"onClick"),children:"No responsible"}),ve&&(0,s.jsxs)("button",{className:X("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",ye.assigneeUserId===ve&&"bg-bg-3"),onClick:r(Ke=>{Ke.preventDefault(),Ke.stopPropagation(),ei(ye.id,null,ve)},"onClick"),children:[(0,s.jsx)(Kl,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,s.jsx)("span",{children:"Me"})]}),(l??[]).filter(Ke=>He.trim()?Ke.name.toLowerCase().includes(He.toLowerCase()):!0).map(Ke=>(0,s.jsx)("button",{className:X("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",ye.assigneeAgentId===Ke.id&&"bg-bg-3"),onClick:r(ks=>{ks.preventDefault(),ks.stopPropagation(),ei(ye.id,Ke.id,null)},"onClick"),children:(0,s.jsx)(Wl,{agent:Ke,size:"sm",className:"min-w-0"})},Ke.id))]})]})]})}):void 0})},ye.id)},"renderIssueRow"),et=H.showDateGroupSeparators&&!_n?X9(H):null,zt=new Date,En=[];let rt=null,cn=null;const _t=r((ye,ia)=>{const rs=Te(ye,ia);if(rs!==null){if(et&&W==="task"){const Vs=I9(et(ye),zt),ts=T9(rt,Vs);ts&&En.push((0,s.jsx)(Ek,{label:ts},`date-sep-${ye.id}-${Vs}`)),rt=Vs}else if(et){const Vs=J9(et(ye),zt.getTime());for(const ts of cn===null?[]:tF(cn,Vs))En.push((0,s.jsx)(Ek,{label:eF(ts)},`date-sep-${ye.id}-${ts}`));cn=Vs}if(En.push(rs),!H.collapsedParents.includes(ye.id))for(const Vs of Z.get(ye.id)??[])_t(Vs,ia+1)}},"appendIssueRow");for(const ye of Q)_t(ye,0);return En})()})]},V.key)),(zn>0||z||K)&&(0,s.jsx)("div",{className:"py-2","data-testid":"issues-load-more-sentinel",children:(0,s.jsx)("p",{className:"text-xs text-ink-3",children:K?"Loading more tasks...":zn>0?`Rendering ${Math.min(Ve,Lt.length)} of ${Lt.length} tasks`:"Scroll to load more tasks"})})]})]})}r(uF,"StreamlinedIssuesList");function dF(e){return e?new Date(e).toLocaleString():"Never"}r(dF,"formatLastRunTimestamp");function fF(e){return e?e.replaceAll("_"," "):null}r(fF,"formatRoutineRunStatus");function JG(e,t){return e==="archived"&&t||t?"active":"paused"}r(JG,"nextRoutineStatus");function mF({routine:e,projectById:t,agentById:i,runningRoutineId:l,statusMutationRoutineId:c,href:u,configureLabel:m="Edit",managedByLabel:f,secondaryDetails:h,runNowButton:g=!1,disableRunNow:v=!1,disableToggle:y=!1,hideArchiveAction:j=!1,divider:k=!0,selected:S=!1,selectMode:N=!1,extraMenuItems:_,onSelectChange:I,onRunNow:D,onToggleEnabled:T,onToggleArchived:C}){const M=e.status==="active",z=e.status==="archived",K=c===e.id,P=e.projectId?t.get(e.projectId)??null:null,A=e.assigneeAgentId?i.get(e.assigneeAgentId)??null:null,B=!z&&!e.assigneeAgentId,O=l===e.id||z||v;return(0,s.jsxs)(gn,{to:u,className:`group flex flex-col gap-3 px-3 py-3 transition-colors hover:bg-bg-3/50 sm:flex-row sm:items-center no-underline text-inherit${k?" border-b border-line last:border-b-0":""}`,children:[N?(0,s.jsx)("div",{className:"flex items-start pt-0.5 sm:pt-1",onClick:r(W=>{W.preventDefault(),W.stopPropagation()},"onClick"),children:(0,s.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded border-line",checked:S,"aria-label":`Select ${e.title}`,onChange:r(W=>I?.(e,W.target.checked),"onChange")})}):null,(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"truncate text-sm font-medium",children:e.title}),z||e.status==="paused"||B?(0,s.jsx)("span",{className:"text-xs text-ink-3",children:z?"archived":B?"draft":"paused"}):null,f?(0,s.jsx)("span",{className:"text-xs text-ink-3",children:f}):null]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-ink-3",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:P?.color??"var(--project-none)"}}),(0,s.jsx)("span",{children:e.projectId?P?.name??"Unknown project":"No project"})]}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[e.assigneeAgentId?(0,s.jsx)(ir,{agent:{...A,id:e.assigneeAgentId},size:16,className:"h-3.5 w-3.5 shrink-0"}):null,(0,s.jsx)("span",{children:e.assigneeAgentId?A?.name??"Unknown agent":"No default agent"})]}),(0,s.jsxs)("span",{children:[dF(e.lastRun?.triggeredAt),e.lastRun?` · ${fF(e.lastRun.status)}`:""]})]}),h?(0,s.jsx)("div",{className:"text-xs text-ink-3",children:h}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",onClick:r(W=>{W.preventDefault(),W.stopPropagation()},"onClick"),children:[g?(0,s.jsxs)(le,{variant:"secondary",size:"sm",disabled:O,onClick:r(()=>D(e),"onClick"),children:[(0,s.jsx)(m0,{className:"h-3.5 w-3.5"}),l===e.id?"Running...":"Run now"]}):null,(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(OS,{size:"lg",checked:M,onCheckedChange:r(()=>T(e,M),"onCheckedChange"),disabled:K||z||y,"aria-label":M?`Disable ${e.title}`:`Enable ${e.title}`}),(0,s.jsx)("span",{className:"w-12 text-xs text-ink-3",children:z?"Archived":B?"Draft":M?"On":"Off"})]}),(0,s.jsxs)(Gr,{children:[(0,s.jsx)(Wr,{asChild:!0,children:(0,s.jsx)(le,{variant:"ghost",size:"icon-sm","aria-label":`More actions for ${e.title}`,children:(0,s.jsx)(gf,{className:"h-4 w-4"})})}),(0,s.jsxs)(Qr,{align:"end",children:[(0,s.jsx)(Cn,{asChild:!0,children:(0,s.jsx)(gn,{to:u,children:m})}),(0,s.jsx)(Cn,{disabled:O,onClick:r(()=>D(e),"onClick"),children:l===e.id?"Running...":"Run now"}),_?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ki,{}),_]}):null,(0,s.jsx)(ki,{}),(0,s.jsx)(Cn,{onClick:r(()=>T(e,M),"onClick"),disabled:K||z||y,children:M?"Pause":"Enable"}),!j&&C?(0,s.jsx)(Cn,{onClick:r(()=>C(e),"onClick"),disabled:K,children:e.status==="archived"?"Restore":"Archive"}):null]})]})]})]})}r(mF,"RoutineListRow");function pF(e){return{id:e.key,title:e.title,status:e.status,projectId:e.projectId??null,assigneeAgentId:e.assigneeAgentId??null,lastRun:e.lastRunAt||e.lastRunStatus?{triggeredAt:e.lastRunAt??null,status:e.lastRunStatus??null}:null}}r(pF,"managedRoutineToRow");function hF({routines:e,agents:t=[],projects:i=[],pluginDisplayName:l=null,emptyMessage:c="No managed routines.",runningRoutineKey:u=null,statusMutationRoutineKey:m=null,reconcilingRoutineKey:f=null,resettingRoutineKey:h=null,onRunNow:g,onToggleEnabled:v,onReconcile:y,onReset:j}){const k=new Map(t.map(N=>[N.id,N])),S=new Map(i.map(N=>[N.id,{name:N.name,color:N.color}]));return e.length===0?(0,s.jsx)("div",{className:"rounded-lg border border-line px-3 py-8 text-center text-sm text-ink-3",children:c}):(0,s.jsx)("div",{className:"rounded-lg border border-line",children:e.map(N=>{const _=pF(N),I=N.href??(N.routineId?`/routines/${N.routineId}`:"/routines"),D=N.missingRefs??[],T=!!(N.routineId&&N.resourceKey&&D.length===0),C=N.managedByPluginDisplayName??l,M=!!(y||j);return(0,s.jsxs)("div",{className:"last:[&_a]:border-b-0",children:[(0,s.jsx)(mF,{routine:_,projectById:S,agentById:k,runningRoutineId:u,statusMutationRoutineId:m,href:I,configureLabel:"Configure",managedByLabel:C?`Managed by ${C}`:null,runNowButton:!0,hideArchiveAction:!0,disableRunNow:!T,disableToggle:!T,secondaryDetails:(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[N.resourceKey?(0,s.jsx)("span",{children:N.resourceKey}):null,N.cronExpression?(0,s.jsxs)("span",{children:["Schedule ",N.cronExpression]}):null]}),onRunNow:r(()=>g?.(N),"onRunNow"),onToggleEnabled:r(()=>v?.(N,_.status==="active"),"onToggleEnabled")}),M?(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-line px-3 pb-3 text-xs text-ink-3 last:border-b-0",onClick:r(z=>{z.preventDefault(),z.stopPropagation()},"onClick"),children:[(0,s.jsx)("span",{children:D.length?`Missing ${D.map(z=>`${z.resourceKind}:${z.resourceKey}`).join(", ")}`:"Routine defaults can be repaired."}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[y?(0,s.jsx)(le,{size:"sm",variant:"ghost",disabled:f===N.key,onClick:r(()=>y(N),"onClick"),children:f===N.key?"Reconciling...":"Reconcile"}):null,j?(0,s.jsx)(le,{size:"sm",variant:"ghost",disabled:h===N.key,onClick:r(()=>j(N),"onClick"),children:h===N.key?"Resetting...":"Reset"}):null]})]}):null]},N.key)})})}r(hF,"ManagedRoutinesList");function Tk(e){return new Set(e??[])}r(Tk,"toPathSet");function gF({expandedPaths:e,checkedPaths:t,selectedFile:i=null,showCheckboxes:l=!1,onToggleDir:c,onSelectFile:u,...m}){return(0,x.createElement)(j7,{...m,selectedFile:i,expandedDirs:Tk(e),checkedFiles:t?Tk(t):void 0,showCheckboxes:l,onToggleDir:c??(()=>{}),onSelectFile:u??(()=>{})})}r(gF,"PluginSdkFileTree");function xF(e){const[t,i]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let l=!1;return ke(()=>import("./MarkdownEditor-DXD-Cu3u.js").then(c=>c.n).then(c=>{l||i(()=>c.MarkdownEditor)}),__vite__mapDeps([82,1,3,25,8,17,20,59,60,61,21,22,83,27,26,52,84,85,86,24,87,88,28,89,77,90,54,91,92,93,94,95,96])),()=>{l=!0}},[]),t?(0,x.createElement)(t,e):(0,x.createElement)("textarea",{className:e.className,value:e.value,placeholder:e.placeholder,readOnly:e.readOnly,onBlur:e.onBlur,onChange:r(l=>e.onChange(l.currentTarget.value),"onChange")})}r(xF,"PluginSdkMarkdownEditor");function bF(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""&&t!==!1))}r(bF,"compactIssueFilters");function vF({companyId:e,projectId:t=null,filters:i,viewStateKey:l="wardmote:plugin-issues-view",initialSearch:c,createIssueLabel:u,searchWithinLoadedIssues:m=!0}){const f=wn(),h=(0,x.useMemo)(()=>bF({...i??{},projectId:i?.projectId??t??void 0}),[i,t]),g=h.originKindPrefix??null,v=h.projectId??t??null,y=(0,x.useMemo)(()=>["plugins","sdk-ui","issues-list",e??"__no-company__",h],[e,h]),{data:j}=ge({queryKey:U.agents.list(e??"__no-company__"),queryFn:r(()=>$s.list(e),"queryFn"),enabled:!!e}),{data:k}=ge({queryKey:U.projects.list(e??"__no-company__",{includeArchived:!0}),queryFn:r(()=>rr.list(e,{includeArchived:!0}),"queryFn"),enabled:!!e}),S=U.liveRuns(e??"__no-company__"),N=gc({companyId:e,resourceKey:"live-runs",queryKey:S,enabled:!!e,refetchInterval:!1,leaderOnly:!0}),{data:_,dataUpdatedAt:I}=ge({queryKey:S,queryFn:r(()=>vf.liveRunsForCompany(e),"queryFn"),enabled:N.enabled,refetchInterval:N.refetchInterval});xc(N,_,I);const{data:D,isLoading:T,error:C}=ge({queryKey:y,queryFn:r(()=>hn.list(e,h),"queryFn"),enabled:!!e}),M=(0,x.useMemo)(()=>H7(_,D),[D,_]),z=Kt({mutationFn:r(({id:K,data:P})=>hn.update(K,P),"mutationFn"),onSuccess:r(()=>{e&&(f.invalidateQueries({queryKey:["plugins","sdk-ui","issues-list",e]}),f.invalidateQueries({queryKey:U.issues.list(e)}),v&&(f.invalidateQueries({queryKey:U.issues.listByProject(e,v)}),g&&f.invalidateQueries({queryKey:U.issues.listPluginOperationsByProject(e,v,g)})))},"onSuccess")});return e?(0,x.createElement)(cF,{issues:D??[],isLoading:T,error:C,agents:j,projects:k,liveIssueIds:M,projectId:v??void 0,viewStateKey:l,initialSearch:c,createIssueLabel:u,searchWithinLoadedIssues:m,onUpdateIssue:r((K,P)=>z.mutate({id:K,data:P}),"onUpdateIssue")}):(0,x.createElement)("div",{className:"text-sm text-ink-3"},"Select an organization to view tasks.")}r(vF,"PluginSdkIssuesList");function yF({companyId:e,value:t,onChange:i,placeholder:l="Responsible",noneLabel:c="No responsible",searchPlaceholder:u="Search responsible...",emptyMessage:m="No responsible found.",includeUsers:f=!0,includeTerminatedAgents:h=!1,className:g,onConfirm:v}){const y=g0(),j=e??y.companyId??null,{data:k}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),enabled:f}),S=k?.user?.id??k?.session?.userId??null,{data:N}=ge({queryKey:U.agents.list(j??"__no-company__"),queryFn:r(()=>$s.list(j),"queryFn"),enabled:!!j}),{data:_}=ge({queryKey:U.access.companyUserDirectory(j??"__no-company__"),queryFn:r(()=>Xa.listUserDirectory(j),"queryFn"),enabled:!!j&&f}),I=(0,x.useMemo)(()=>Xh(),[]),D=(0,x.useMemo)(()=>I.map(K=>K.startsWith("agent:")?K.slice(6):null).filter(K=>!!K),[I]),T=(0,x.useMemo)(()=>MS((N??[]).filter(K=>h||K.status!=="terminated"),D),[N,h,D]),C=(0,x.useMemo)(()=>[...f?_S(S):[],...f?LC(_?.users,{excludeUserIds:[S]}):[],...T.map(K=>({id:Or({assigneeAgentId:K.id}),label:K.name,searchText:`${K.name} ${K.role} ${K.title??""}`}))],[_?.users,S,f,T]),M=ql(t),z=M.assigneeAgentId?T.find(K=>K.id===M.assigneeAgentId):null;return(0,x.createElement)(j0,{value:t,options:C,recentOptionIds:I,placeholder:l,noneLabel:c,searchPlaceholder:u,emptyMessage:m,className:g,onConfirm:v,onChange:r(K=>{const P=ql(K);P.assigneeAgentId&&Bd(P.assigneeAgentId),P.assigneeUserId&&$d(P.assigneeUserId),i(K,P)},"onChange"),renderTriggerValue:r(K=>K?z?(0,x.createElement)(df,null,(0,x.createElement)(Kh,{icon:z.icon,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,x.createElement)("span",{className:"truncate"},K.label)):(0,x.createElement)("span",{className:"truncate"},K.label):(0,x.createElement)("span",{className:"text-ink-3"},l),"renderTriggerValue"),renderOption:r(K=>{if(!K.id)return(0,x.createElement)("span",{className:"truncate"},K.label);const P=ql(K.id),A=P.assigneeAgentId?T.find(B=>B.id===P.assigneeAgentId):null;return(0,x.createElement)(df,null,A?(0,x.createElement)(Kh,{icon:A.icon,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,x.createElement)(Kl,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,x.createElement)("span",{className:"truncate"},K.label))},"renderOption")})}r(yF,"PluginSdkAssigneePicker");function jF({companyId:e,value:t,onChange:i,placeholder:l="Project",noneLabel:c="No project",searchPlaceholder:u="Search projects...",emptyMessage:m="No projects found.",includeArchived:f=!1,className:h,onConfirm:g}){const v=g0(),y=e??v.companyId??null,{data:j}=ge({queryKey:U.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),k=j?.user?.id??j?.session?.userId??null,{data:S}=ge({queryKey:U.projects.list(y??"__no-company__",{includeArchived:f}),queryFn:r(()=>rr.list(y,{includeArchived:f}),"queryFn"),enabled:!!y}),N=(0,x.useMemo)(()=>(S??[]).filter(C=>f||!C.archivedAt),[f,S]),{orderedProjects:_}=PC({projects:N,companyId:y,userId:k}),I=(0,x.useMemo)(()=>pg(),[]),D=(0,x.useMemo)(()=>_.map(C=>({id:C.id,label:C.name,searchText:C.description??""})),[_]),T=_.find(C=>C.id===t)??null;return(0,x.createElement)(j0,{value:t,options:D,recentOptionIds:I,placeholder:l,noneLabel:c,searchPlaceholder:u,emptyMessage:m,className:h,onConfirm:g,onChange:r(C=>{C&&Jd(C),i(C)},"onChange"),renderTriggerValue:r(C=>!C||!T?(0,x.createElement)("span",{className:"text-ink-3"},l):(0,x.createElement)(df,null,(0,x.createElement)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:T.color??"#6366f1"}}),(0,x.createElement)("span",{className:"truncate"},C.label)),"renderTriggerValue"),renderOption:r(C=>{if(!C.id)return(0,x.createElement)("span",{className:"truncate"},C.label);const M=_.find(z=>z.id===C.id);return(0,x.createElement)(df,null,(0,x.createElement)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:M?.color??"#6366f1"}}),(0,x.createElement)("span",{className:"truncate"},C.label))},"renderOption")})}r(jF,"PluginSdkProjectPicker");function df({children:e}){return(0,x.createElement)("span",{className:"contents"},e)}r(df,"FragmentSafe");function wF({label:e,status:t}){const i={ok:"border-emerald-300 bg-emerald-50 text-emerald-700",warning:"border-amber-300 bg-amber-50 text-amber-800",error:"border-red-300 bg-red-50 text-red-700",info:"border-slate-300 bg-slate-50 text-slate-700",pending:"border-slate-300 bg-slate-50 text-slate-600"}[t];return(0,x.createElement)("span",{className:`inline-flex w-fit items-center rounded-full border px-2 py-0.5 text-xs font-medium ${i}`},e)}r(wF,"PluginSdkStatusBadge");function kF({columns:e,rows:t,loading:i,emptyMessage:l="No rows."}){if(i)return(0,x.createElement)("div",{className:"text-sm text-ink-3"},"Loading...");if(!t.length)return(0,x.createElement)("div",{className:"text-sm text-ink-3"},l);const c=e.map(u=>u.width??"minmax(0, 1fr)").join(" ");return(0,x.createElement)("div",{className:"overflow-hidden rounded-md border"},(0,x.createElement)("div",{className:"hidden border-b bg-bg-3/35 px-3 py-2 text-xs font-medium uppercase tracking-wide text-ink-3 md:grid md:[grid-template-columns:var(--plugin-grid-cols)]",style:{"--plugin-grid-cols":c}},e.map(u=>(0,x.createElement)("div",{key:u.key},u.header))),(0,x.createElement)("div",{className:"divide-y"},t.map((u,m)=>(0,x.createElement)("div",{key:String(u.id??m),className:"grid gap-2 px-3 py-3 md:items-center md:[grid-template-columns:var(--plugin-grid-cols)]",style:{"--plugin-grid-cols":c}},e.map(f=>(0,x.createElement)("div",{key:f.key,className:"min-w-0 text-sm"},(0,x.createElement)("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-ink-3 md:hidden"},f.header),f.render?f.render(u[f.key],u):String(u[f.key]??"")))))))}r(kF,"PluginSdkDataTable");function SF({pairs:e}){return(0,x.createElement)("dl",{className:"grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[max-content_minmax(0,1fr)]"},e.flatMap(t=>[(0,x.createElement)("dt",{key:`${t.label}:label`,className:"text-ink-3"},t.label),(0,x.createElement)("dd",{key:`${t.label}:value`,className:"min-w-0"},t.value)]))}r(SF,"PluginSdkKeyValueList");function NF({label:e,value:t,unit:i}){return(0,x.createElement)("div",{className:"rounded-md border bg-bg-2 p-3"},(0,x.createElement)("div",{className:"text-xs font-medium uppercase tracking-wide text-ink-3"},e),(0,x.createElement)("div",{className:"mt-1 text-lg font-semibold"},`${t}${i??""}`))}r(NF,"PluginSdkMetricCard");function CF({data:e}){return(0,x.createElement)("pre",{className:"max-h-80 overflow-auto rounded-md border bg-bg-3/30 p-2 text-xs"},JSON.stringify(e,null,2))}r(CF,"PluginSdkJsonTree");function AF({label:e="Loading"}){return(0,x.createElement)("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-ink-3/30 border-t-ink align-middle",role:"status","aria-label":e})}r(AF,"PluginSdkSpinner");var _F=class extends x.Component{static{r(this,"PluginSdkErrorBoundary")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback??(0,x.createElement)("div",{className:"rounded-md border border-bad/30 p-3 text-sm text-bad"},"Plugin UI failed to render."):this.props.children}};function EF(e,t){globalThis.__wardmotePluginBridge__={react:e,reactJsxRuntime:s,reactDom:t,sdkUi:{usePluginData:R3,usePluginAction:T3,useHostContext:g0,useHostLocation:D3,useHostNavigation:P3,usePluginStream:O3,usePluginToast:M3,copyTextToClipboard:w0,MarkdownBlock:r(({content:i,className:l,enableWikiLinks:c,wikiLinkRoot:u,resolveWikiLinkHref:m})=>(0,x.createElement)(jI,{className:l,softBreaks:!1,enableWikiLinks:c,wikiLinkRoot:u,resolveWikiLinkHref:m,children:i}),"MarkdownBlock"),MetricCard:NF,StatusBadge:wF,DataTable:kF,KeyValueList:SF,JsonTree:CF,Spinner:AF,ErrorBoundary:_F,MarkdownEditor:xF,FileTree:gF,IssuesList:vF,AssigneePicker:yF,ProjectPicker:jF,ManagedRoutinesList:hF}}}r(EF,"initPluginBridge");var IF=1e4;function TF(e=IF){if(typeof performance>"u"||typeof performance.clearMeasures!="function")return()=>{};const i=setInterval(r(()=>{globalThis.__wardmoteKeepPerfMeasures||performance.clearMeasures()},"reap"),e);return()=>clearInterval(i)}r(TF,"startPerfMeasureReaper");var RF=Xl((e=>{function t($,R){var ne=$.length;$.push(R);e:for(;0<ne;){var ue=ne-1>>>1,ae=$[ue];if(0<c(ae,R))$[ue]=R,$[ne]=ae,ne=ue;else break e}}r(t,"push");function i($){return $.length===0?null:$[0]}r(i,"peek");function l($){if($.length===0)return null;var R=$[0],ne=$.pop();if(ne!==R){$[0]=ne;e:for(var ue=0,ae=$.length,Ee=ae>>>1;ue<Ee;){var fe=2*(ue+1)-1,Ae=$[fe],Ce=fe+1,Se=$[Ce];if(0>c(Ae,ne))Ce<ae&&0>c(Se,Ae)?($[ue]=Se,$[Ce]=ne,ue=Ce):($[ue]=Ae,$[fe]=ne,ue=fe);else if(Ce<ae&&0>c(Se,ne))$[ue]=Se,$[Ce]=ne,ue=Ce;else break e}}return R}r(l,"pop");function c($,R){var ne=$.sortIndex-R.sortIndex;return ne!==0?ne:$.id-R.id}if(r(c,"compare"),e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var m=Date,f=m.now();e.unstable_now=function(){return m.now()-f}}var h=[],g=[],v=1,y=null,j=3,k=!1,S=!1,N=!1,_=!1,I=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function C($){for(var R=i(g);R!==null;){if(R.callback===null)l(g);else if(R.startTime<=$)l(g),R.sortIndex=R.expirationTime,t(h,R);else break;R=i(g)}}r(C,"advanceTimers");function M($){if(N=!1,C($),!S)if(i(h)!==null)S=!0,z||(z=!0,W());else{var R=i(g);R!==null&&oe(M,R.startTime-$)}}r(M,"handleTimeout");var z=!1,K=-1,P=5,A=-1;function B(){return _?!0:!(e.unstable_now()-A<P)}r(B,"shouldYieldToHost");function O(){if(_=!1,z){var $=e.unstable_now();A=$;var R=!0;try{e:{S=!1,N&&(N=!1,D(K),K=-1),k=!0;var ne=j;try{t:{for(C($),y=i(h);y!==null&&!(y.expirationTime>$&&B());){var ue=y.callback;if(typeof ue=="function"){y.callback=null,j=y.priorityLevel;var ae=ue(y.expirationTime<=$);if($=e.unstable_now(),typeof ae=="function"){y.callback=ae,C($),R=!0;break t}y===i(h)&&l(h),C($)}else l(h);y=i(h)}if(y!==null)R=!0;else{var Ee=i(g);Ee!==null&&oe(M,Ee.startTime-$),R=!1}}break e}finally{y=null,j=ne,k=!1}R=void 0}}finally{R?W():z=!1}}}r(O,"performWorkUntilDeadline");var W;if(typeof T=="function")W=r(function(){T(O)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var Y=new MessageChannel,ce=Y.port2;Y.port1.onmessage=O,W=r(function(){ce.postMessage(null)},"schedulePerformWorkUntilDeadline")}else W=r(function(){I(O,0)},"schedulePerformWorkUntilDeadline");function oe($,R){K=I(function(){$(e.unstable_now())},R)}r(oe,"requestHostTimeout"),e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$||(P=0<$?Math.floor(1e3/$):5)},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function($){switch(j){case 1:case 2:case 3:var R=3;break;default:R=j}var ne=j;j=R;try{return $()}finally{j=ne}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function($,R){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ne=j;j=$;try{return R()}finally{j=ne}},e.unstable_scheduleCallback=function($,R,ne){var ue=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ue+ne:ue):ne=ue,$){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=ne+ae,$={id:v++,callback:R,priorityLevel:$,startTime:ne,expirationTime:ae,sortIndex:-1},ne>ue?($.sortIndex=ne,t(g,$),i(h)===null&&$===i(g)&&(N?(D(K),K=-1):N=!0,oe(M,ne-ue))):($.sortIndex=ae,t(h,$),S||k||(S=!0,z||(z=!0,W()))),$},e.unstable_shouldYield=B,e.unstable_wrapCallback=function($){var R=j;return function(){var ne=j;j=R;try{return $.apply(this,arguments)}finally{j=ne}}}})),DF=Xl(((e,t)=>{t.exports=RF()})),MF=Xl((e=>{var t=DF(),i=Xg(),l=Pk();function c(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}r(c,"formatProdErrorMessage");function u(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}r(u,"isValidContainer");function m(n){var a=n,o=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(o=a.return),n=a.return;while(n)}return a.tag===3?o:null}r(m,"getNearestMountedFiber");function f(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}r(f,"getSuspenseInstanceFromFiber");function h(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}r(h,"getActivityInstanceFromFiber");function g(n){if(m(n)!==n)throw Error(c(188))}r(g,"assertIsMounted");function v(n){var a=n.alternate;if(!a){if(a=m(n),a===null)throw Error(c(188));return a!==n?null:n}for(var o=n,d=a;;){var p=o.return;if(p===null)break;var b=p.alternate;if(b===null){if(d=p.return,d!==null){o=d;continue}break}if(p.child===b.child){for(b=p.child;b;){if(b===o)return g(p),n;if(b===d)return g(p),a;b=b.sibling}throw Error(c(188))}if(o.return!==d.return)o=p,d=b;else{for(var w=!1,E=p.child;E;){if(E===o){w=!0,o=p,d=b;break}if(E===d){w=!0,d=p,o=b;break}E=E.sibling}if(!w){for(E=b.child;E;){if(E===o){w=!0,o=b,d=p;break}if(E===d){w=!0,d=b,o=p;break}E=E.sibling}if(!w)throw Error(c(189))}}if(o.alternate!==d)throw Error(c(190))}if(o.tag!==3)throw Error(c(188));return o.stateNode.current===o?n:a}r(v,"findCurrentFiberUsingSlowPath");function y(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=y(n),a!==null)return a;n=n.sibling}return null}r(y,"findCurrentHostFiberImpl");var j=Object.assign,k=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),C=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=W&&n[W]||n["@@iterator"],typeof n=="function"?n:null)}r(Y,"getIteratorFn");var ce=Symbol.for("react.client.reference");function oe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ce?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case _:return"Fragment";case D:return"Profiler";case I:return"StrictMode";case z:return"Suspense";case K:return"SuspenseList";case B:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case N:return"Portal";case C:return n.displayName||"Context";case T:return(n._context.displayName||"Context")+".Consumer";case M:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case P:return a=n.displayName||null,a!==null?a:oe(n.type)||"Memo";case A:a=n._payload,n=n._init;try{return oe(n(a))}catch{}}return null}r(oe,"getComponentNameFromType");var $=Array.isArray,R=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},ae=[],Ee=-1;function fe(n){return{current:n}}r(fe,"createCursor");function Ae(n){0>Ee||(n.current=ae[Ee],ae[Ee]=null,Ee--)}r(Ae,"pop");function Ce(n,a){Ee++,ae[Ee]=n.current,n.current=a}r(Ce,"push");var Se=fe(null),he=fe(null),De=fe(null),Ye=fe(null);function ze(n,a){switch(Ce(De,a),Ce(he,n),Ce(Se,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?Vv(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=Vv(a),n=Wv(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Ae(Se),Ce(Se,n)}r(ze,"pushHostContainer");function ve(){Ae(Se),Ae(he),Ae(De)}r(ve,"popHostContainer");function ft(n){n.memoizedState!==null&&Ce(Ye,n);var a=Se.current,o=Wv(a,n.type);a!==o&&(Ce(he,n),Ce(Se,o))}r(ft,"pushHostContext");function At(n){he.current===n&&(Ae(Se),Ae(he)),Ye.current===n&&(Ae(Ye),Qo._currentValue=ue)}r(At,"popHostContext");var xt,Pt;function de(n){if(xt===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);xt=a&&a[1]||"",Pt=-1<o.stack.indexOf(`
60
60
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
61
61
  `+xt+n+Pt}r(de,"describeBuiltInComponentFrame");var Oe=!1;function qe(n,a){if(!n||Oe)return"";Oe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:r(function(){try{if(a){var xe=r(function(){throw Error()},"Fake");if(Object.defineProperty(xe.prototype,"props",{set:r(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(re){var se=re}Reflect.construct(n,[],xe)}else{try{xe.call()}catch(re){se=re}n.call(xe.prototype)}}else{try{throw Error()}catch(re){se=re}(xe=n())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(re){if(re&&se&&typeof re.stack=="string")return[re.stack,se.stack]}return[null,null]},"DetermineComponentFrameRoot")};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),w=b[0],E=b[1];if(w&&E){var q=w.split(`