@tickernelz/wardmote-ui 2026.1115.2 → 2026.1115.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessSelectIdentity-DYzOt7oU.js +1 -0
- package/dist/assets/AdapterManager-LrG13B-j.js +1 -0
- package/dist/assets/AdvancedToolsRoute-BfFzw6Ig.js +39 -0
- package/dist/assets/AgentActionButtons-CwRFF_Dw.js +1 -0
- package/dist/assets/AgentAvatar-BlHmcjn-.js +1 -0
- package/dist/assets/AgentBubbleActionRow-BQBX8l1O.js +1 -0
- package/dist/assets/AgentCharacter-CpSNclLb.js +2 -0
- package/dist/assets/AgentChat-GF4rDExq.js +1 -0
- package/dist/assets/AgentChats-DnD3LHW-.js +1 -0
- package/dist/assets/AgentDefaults-CDGRyKsA.js +1 -0
- package/dist/assets/AgentDetail-sQJiRDSr.js +38 -0
- package/dist/assets/AgentIconPicker-CF5iYBgx.js +1 -0
- package/dist/assets/AgentIdentity-CC-enZ41.js +1 -0
- package/dist/assets/AgentMailCredentialField-BHeNsFE4.js +1 -0
- package/dist/assets/AgentMultiSelect-BfF2nXUA.js +1 -0
- package/dist/assets/AgentRoleEditor-Cfl-49T-.js +1 -0
- package/dist/assets/AgentSetupPrompt-CzYzUQnP.js +30 -0
- package/dist/assets/AgentTodoCard-Bdndvl3W.js +1 -0
- package/dist/assets/Agents-GMj3U6SM.js +3 -0
- package/dist/assets/AppDetail-C_3eZB-a.js +5 -0
- package/dist/assets/AppLogo-CuH8fcoG.js +1 -0
- package/dist/assets/AppNotConnected-BxoSM4jY.js +1 -0
- package/dist/assets/ApprovalCard-v8kEoA2z.js +1 -0
- package/dist/assets/ApprovalDetail-BtEHYcwC.js +1 -0
- package/dist/assets/ApprovalPayload-ChFKOQSj.js +1 -0
- package/dist/assets/Approvals-wop-F29a.js +1 -0
- package/dist/assets/AppsConnect-DPtIXQMU.js +1 -0
- package/dist/assets/AppsReview-7PQE6cE7.js +1 -0
- package/dist/assets/ArtifactCard-CT-VxldE.js +1 -0
- package/dist/assets/Artifacts-DFYhVyjH.js +1 -0
- package/dist/assets/AssistantConnection-BbI_35_h.js +1 -0
- package/dist/assets/AttentionInteractionResolver-3lKdKWna.js +1 -0
- package/dist/assets/AuditHub-CQ94Hfux.js +1 -0
- package/dist/assets/Auth-BZbUO0IB.js +3 -0
- package/dist/assets/BoardChat-_HSQ483L.js +18 -0
- package/dist/assets/BoardClaim-CBnDy_QJ.js +1 -0
- package/dist/assets/BootstrapSetupUxLab-TeV44iyQ.js +1 -0
- package/dist/assets/BreadcrumbContext-BopoVMP4.js +1 -0
- package/dist/assets/Browse-DawljbDh.js +1 -0
- package/dist/assets/BudgetPolicyCard-CCJk5nvD.js +1 -0
- package/dist/assets/CaseDetail-C3LVlRCB.js +2 -0
- package/dist/assets/CaseIdentifierKey-CGhp9-uM.js +1 -0
- package/dist/assets/Cases-CTd2weIC.js +2 -0
- package/dist/assets/ChatEndpointDetail-BukMAOCb.js +5 -0
- package/dist/assets/ChatEndpointSetup-D8Mj4X--.js +1 -0
- package/dist/assets/ChatIdentityConfirm-CbTY4DH0.js +1 -0
- package/dist/assets/ChoiceControls-EiWGh3lC.js +1 -0
- package/dist/assets/CliAuth-BMpmaqyg.js +1 -0
- package/dist/assets/CommentAttributionChip-jZcw_6rf.js +1 -0
- package/dist/assets/Companies-LHUCDr2_.js +1 -0
- package/dist/assets/CompanyAccess-ypQfdNSU.js +1 -0
- package/dist/assets/CompanyActivity-HYakDclt.js +1 -0
- package/dist/assets/CompanyConnections-BPWx2Eup.js +1 -0
- package/dist/assets/CompanyContext-BawkN74-.js +1 -0
- package/dist/assets/CompanyEnvironments-COwIvdgq.js +3 -0
- package/dist/assets/CompanyExport-CMqkUdRy.js +4 -0
- package/dist/assets/CompanyImport-WfGbnEwh.js +1 -0
- package/dist/assets/CompanySettings-fcSIdfyx.js +1 -0
- package/dist/assets/CompanySettingsPluginPage-mn5U4sXu.js +1 -0
- package/dist/assets/CompanySkills-DAVE_6wX.js +10 -0
- package/dist/assets/ComposerAddMenu-BHU78jD5.js +3 -0
- package/dist/assets/ConfigureBuiltInAgentModal-DbfoPReR.js +1 -0
- package/dist/assets/ConnectionSetupFlow-Di9s7hig.js +40 -0
- package/dist/assets/CopyText-Bjqi6sFc.js +1 -0
- package/dist/assets/CopyableGatewayUrl-4xXPWI-X.js +1 -0
- package/dist/assets/CrossIssueCollaborationUxLab-DeDQO7u2.js +1 -0
- package/dist/assets/Dashboard-DKck2eWN.js +2 -0
- package/dist/assets/DecisionDateChips-C0p2FvDI.js +1 -0
- package/dist/assets/DecisionModelSettings-DVOSNCxT.js +1 -0
- package/dist/assets/DecisionQueuePage-BfEdo0uW.js +1 -0
- package/dist/assets/DesignGuide-DI9NANFO.js +23 -0
- package/dist/assets/DocumentFrameHeader-Dt-r3sS1.js +1 -0
- package/dist/assets/EmailConnectionAccess-8DeJOJKC.js +1 -0
- package/dist/assets/EmailEndpointSetup-cLeElc-x.js +1 -0
- package/dist/assets/EnforcementBanner-DGMArx4p.js +1 -0
- package/dist/assets/EntityRow-CvxNDGH9.js +1 -0
- package/dist/assets/ExecutionWorkspaceDetail-C_S3XWG3.js +19 -0
- package/dist/assets/FilterBar-TEUgseUr.js +1 -0
- package/dist/assets/FoldCurtain-g4QM_vdF.js +1 -0
- package/dist/assets/FolderControls-CfN804hS.js +1 -0
- package/dist/assets/GatewayDetail-BdtKv3My.js +2 -0
- package/dist/assets/GatewaysList-DVCTOOMv.js +1 -0
- package/dist/assets/GoalDetail-hrwCIZTK.js +1 -0
- package/dist/assets/GoalTree-CXQvkx8F.js +1 -0
- package/dist/assets/Goals-D6rI7q_v.js +1 -0
- package/dist/assets/Identity-DS6gqRX9.js +1 -0
- package/dist/assets/ImageGalleryModal-CfbyrfcF.js +1 -0
- package/dist/assets/Inbox-CB5vsXpq.js +2 -0
- package/dist/assets/InlineBanner-BTb26bnx.js +1 -0
- package/dist/assets/InlineEditor-bcCtevvt.js +1 -0
- package/dist/assets/InlineEntitySelector-Boxagbbz.js +1 -0
- package/dist/assets/InstanceAccess-BzNJPvQq.js +1 -0
- package/dist/assets/InstanceAdvanced-DuA6iFZY.js +1 -0
- package/dist/assets/InstanceFeatures-B-tCkdtY.js +1 -0
- package/dist/assets/InviteLanding-GkH6fBLM.js +1 -0
- package/dist/assets/IssueChatLongThreadPerf-yXqFaVQx.js +2 -0
- package/dist/assets/IssueChatThread-BunMNG2a.js +40 -0
- package/dist/assets/IssueDetail-DUlhQyVU.js +9 -0
- package/dist/assets/IssueDocumentAnnotations-BbxGyZkA.js +2 -0
- package/dist/assets/IssueOutputSection-jq6HqIzm.js +1 -0
- package/dist/assets/IssueRecoveryActionCard-DevIbiTj.js +1 -0
- package/dist/assets/IssueReferencePill-DnlSEdIa.js +1 -0
- package/dist/assets/IssueThreadInteractionCard-CsgPWxz9.js +9 -0
- package/dist/assets/IssueWriteDenialNotice-CJpj214n.js +1 -0
- package/dist/assets/Issues-Cgh6wUPU.js +5 -0
- package/dist/assets/JoinRequestQueue-CgLkhRtE.js +1 -0
- package/dist/assets/JsonSchemaForm-CzZl1-wr.js +1 -0
- package/dist/assets/LiveNowTodoLine-CvDOLg-Q.js +1 -0
- package/dist/assets/ManagedAiConnectionDetails-B9xFzjIb.js +1 -0
- package/dist/assets/MarkdownBody-BSpHsqLe.js +16 -0
- package/dist/assets/MarkdownEditor-ej77nT4-.js +85 -0
- package/dist/assets/McpConnect-fn9EsKPR.js +1 -0
- package/dist/assets/MembershipAction-CVq7Eb2I.js +1 -0
- package/dist/assets/MetricCard-Bo72rsam.js +1 -0
- package/dist/assets/MissingPluginTabPlaceholder-ePyBHi8t.js +1 -0
- package/dist/assets/ModelsAndProviders-BSHQep_J.js +1 -0
- package/dist/assets/MootMark-DK8Wa7aP.js +1 -0
- package/dist/assets/NewAgent-C6-Kqdk1.js +1 -0
- package/dist/assets/OmpAllSettings-CFr6xCYf.js +1 -0
- package/dist/assets/OpenwaGatewayManager-BgraIgfK.js +2 -0
- package/dist/assets/PathInstructionsModal-fE_gzSEE.js +1 -0
- package/dist/assets/PipelineSettings-Cb4mKkOX.js +2 -0
- package/dist/assets/Pipelines-kMTqabXa.js +1 -0
- package/dist/assets/PixelsOffice-DOUkaotx.js +2 -0
- package/dist/assets/PluginManager-BunuLJAA.js +1 -0
- package/dist/assets/PluginPage-DZ54hKav.js +1 -0
- package/dist/assets/PluginSettings-Cc4V4i4t.js +1 -0
- package/dist/assets/ProfileDetailRoute-C04bm1Ih.js +1 -0
- package/dist/assets/ProfileSettings-DdyMIUsa.js +1 -0
- package/dist/assets/ProfileWizardRoute-BlUJjxU2.js +1 -0
- package/dist/assets/ProjectDetail-Ba2GmXf4.js +1 -0
- package/dist/assets/ProjectWorkspaceDetail-1xWRtNmd.js +29 -0
- package/dist/assets/ProjectWorkspacesContent-4iIZbAnr.js +1 -0
- package/dist/assets/Projects-D8xWaWzL.js +1 -0
- package/dist/assets/PublicIssueSharePage-CaHHc_dt.js +1 -0
- package/dist/assets/QuestionForm-Bh_dCMto.js +7 -0
- package/dist/assets/QuotaBar-CccttbGN.js +1 -0
- package/dist/assets/RepositoryEditor-3FpoAm8m.js +1 -0
- package/dist/assets/ResponsibleUserDenialNotice-CUEsRvCA.js +1 -0
- package/dist/assets/ResponsibleUserDenialUxLab-YC4rMwFs.js +1 -0
- package/dist/assets/ReviewQueueCard-CEuqLXOC.js +1 -0
- package/dist/assets/RichWorkProductCard-BNtri52O.js +1 -0
- package/dist/assets/RoutineActivityRow-CM2EG1CO.js +1 -0
- package/dist/assets/RoutineDetail-oltS_agt.js +2 -0
- package/dist/assets/RoutineRunVariablesDialog-Dj7WZGnX.js +1 -0
- package/dist/assets/RoutineVariablesEditor-DC19vjxQ.js +1 -0
- package/dist/assets/Routines-cQHGy-mn.js +1 -0
- package/dist/assets/ScrollToBottom-C_w4cE9e.js +1 -0
- package/dist/assets/Search-nMFLh2bi.js +1 -0
- package/dist/assets/SearchableSelect-CZnKSdR4.js +1 -0
- package/dist/assets/Secrets-D8yURT8w.js +4 -0
- package/dist/assets/SetupWizard-D8OrYUnv.js +1 -0
- package/dist/assets/SidebarContext-D6mXtEd3.js +1 -0
- package/dist/assets/SidebarNavItem-D8YRCkoO.js +1 -0
- package/dist/assets/SkillBinaryFile-F3_YQDoF.js +1 -0
- package/dist/assets/SkillCardIcon-C9_u-xAR.js +2 -0
- package/dist/assets/SkillSourceTree-BnL67Y8X.js +2 -0
- package/dist/assets/SkillSources-DZbS-KiP.js +2 -0
- package/dist/assets/SkillStudio-CIbZHTve.js +9 -0
- package/dist/assets/SourceTrustBadge-CGnT4Nku.js +1 -0
- package/dist/assets/StatusCards-BILY_bbr.js +1 -0
- package/dist/assets/StatusIcon-DzDjbmDP.js +1 -0
- package/dist/assets/SummarySlotCard-Ci-KAIBb.js +1 -0
- package/dist/assets/TaskChatComposerTakeoverContext-C-b4rk4H.js +1 -0
- package/dist/assets/TaskChatLab-h1FdMEW-.js +11 -0
- package/dist/assets/TaskChatMarker-DflEtf-f.js +2 -0
- package/dist/assets/TaskChatProtocolCard-Dha-ezkh.js +1 -0
- package/dist/assets/TaskChatThreadView-BhhNuyza.js +4 -0
- package/dist/assets/TaskTreeControls-DktTBVlU.js +3 -0
- package/dist/assets/Terminal-B3Xdhd5l.js +1 -0
- package/dist/assets/TerminalView-Bq0msE0n.js +58 -0
- package/dist/assets/ThemeContext-Clrow9z9.js +1 -0
- package/dist/assets/ThemeToggle-DlwR2ipa.js +1 -0
- package/dist/assets/ToastContext-frwty7Yo.js +1 -0
- package/dist/assets/ToolsAdminGate-BH39lQW8.js +1 -0
- package/dist/assets/TrustPresetSection-CIesEMme.js +1 -0
- package/dist/assets/UserProfile-wsuF0XZ-.js +1 -0
- package/dist/assets/WebhookUrlWarning-oa5qwoza.js +1 -0
- package/dist/assets/WhatNeedsMe-WlO-TpLD.js +1 -0
- package/dist/assets/WorkspaceRuntimeControls-3Qk45hwY.js +1 -0
- package/dist/assets/Workspaces-CIRD_EiX.js +1 -0
- package/dist/assets/access-D-v-Ev7r.js +1 -0
- package/dist/assets/activity-BYf_2EMB.js +1 -0
- package/dist/assets/activity-format-52Xp53TJ.js +1 -0
- package/dist/assets/activity-qLzc56U1.js +1 -0
- package/dist/assets/adapter-display-registry-CCnmBeoN.js +1 -0
- package/dist/assets/adapters-Cdl54ByW.js +1 -0
- package/dist/assets/agent-avatar-url-CN2MH_xU.js +1 -0
- package/dist/assets/agent-config-primitives-CuzrzVpx.js +1 -0
- package/dist/assets/agentChats-DHNsMsa3.js +1 -0
- package/dist/assets/agents-6Xp_VYq8.js +1 -0
- package/dist/assets/alert-dialog-CAVMGk_s.js +1 -0
- package/dist/assets/app-connect-policy-BI2uHLM7.js +1 -0
- package/dist/assets/archive-restore-BYDZCrd5.js +1 -0
- package/dist/assets/archive-yM2gm7-e.js +1 -0
- package/dist/assets/arrow-down-Bni2Y4vj.js +1 -0
- package/dist/assets/arrow-down-left-3uM8pwDj.js +1 -0
- package/dist/assets/arrow-left-B4kJ2C9P.js +1 -0
- package/dist/assets/arrow-right-jtSygHgu.js +1 -0
- package/dist/assets/arrow-up-B3w0tYKG.js +1 -0
- package/dist/assets/arrow-up-down-Bmb2M4K9.js +1 -0
- package/dist/assets/arrow-up-right-XlVh-UIT.js +1 -0
- package/dist/assets/artifacts-Cl3niPya.js +1 -0
- package/dist/assets/assets-Iymx_Bg2.js +1 -0
- package/dist/assets/attachment-icon-gllPrAKj.js +1 -0
- package/dist/assets/avatar-Bpe8F1Cf.js +1 -0
- package/dist/assets/badge-C_Yv1fHA.js +1 -0
- package/dist/assets/badge-check-Cr-5XoXb.js +1 -0
- package/dist/assets/book-open-CqnGT7yH.js +1 -0
- package/dist/assets/bot-CNmGgvtM.js +1 -0
- package/dist/assets/boxes-D3gzyTBI.js +1 -0
- package/dist/assets/braces-BJ45x5i0.js +1 -0
- package/dist/assets/browser-use-C2IUEDue.js +1 -0
- package/dist/assets/budgets-B9S-3Thk.js +1 -0
- package/dist/assets/button-Ckn7hiVo.js +1 -0
- package/dist/assets/calendar-clock-DxEyQi4Q.js +1 -0
- package/dist/assets/card-Bnw8dg8v.js +1 -0
- package/dist/assets/cases-DrJfN3ya.js +1 -0
- package/dist/assets/chatEndpoints-KlTuvdyJ.js +1 -0
- package/dist/assets/check-A6fazLX_.js +1 -0
- package/dist/assets/checkbox-Ci6pHDRz.js +1 -0
- package/dist/assets/chevron-down-DtfgFP5s.js +1 -0
- package/dist/assets/chevron-left-BoSo1Lqc.js +1 -0
- package/dist/assets/chevron-right-DrB4uldj.js +1 -0
- package/dist/assets/chevron-up-CSST3qTQ.js +1 -0
- package/dist/assets/chip-CugbD0dW.js +1 -0
- package/dist/assets/circle-4pZhXkpD.js +1 -0
- package/dist/assets/circle-alert-6NgAlZU4.js +1 -0
- package/dist/assets/circle-dot-X9sJ-1f9.js +1 -0
- package/dist/assets/circle-question-mark-Bk6tMkKa.js +1 -0
- package/dist/assets/circle-slash-C8iq6QcZ.js +1 -0
- package/dist/assets/circle-x-CkI_5U1-.js +1 -0
- package/dist/assets/clipboard-paste-DicZCxg3.js +1 -0
- package/dist/assets/clock-DM_8qfdH.js +1 -0
- package/dist/assets/cloud-m4N5Px-R.js +1 -0
- package/dist/assets/code-xml-iAAtPQ8U.js +1 -0
- package/dist/assets/coins-BqkDI3XJ.js +1 -0
- package/dist/assets/collapsible-Cu7X7M4E.js +1 -0
- package/dist/assets/columns-3-XwcazPGo.js +1 -0
- package/dist/assets/command-BFj_f3kT.js +5 -0
- package/dist/assets/companies-query-Djk6HKsd.js +1 -0
- package/dist/assets/connection-identity-Bs2ve6Sg.js +1 -0
- package/dist/assets/connection-owner-DxmODGEj.js +1 -0
- package/dist/assets/copy-Cwrdt7rb.js +1 -0
- package/dist/assets/createLucideIcon-CpKa5z2C.js +94 -0
- package/dist/assets/decision-models-zZd0TaiQ.js +1 -0
- package/dist/assets/dialog-BcuAydRt.js +1 -0
- package/dist/assets/dist-8Ml8BWtE.js +1 -0
- package/dist/assets/dist-BAZsRuR9.js +1 -0
- package/dist/assets/dist-BPwKZDMy.js +1 -0
- package/dist/assets/dist-Bq3J5Xim.js +1 -0
- package/dist/assets/dist-Bqxy_Sqe.js +1 -0
- package/dist/assets/dist-CDHeFFfn.js +1 -0
- package/dist/assets/dist-C_wEPi-m.js +1 -0
- package/dist/assets/dist-CaN0MRIY.js +1 -0
- package/dist/assets/dist-CtUkiazs.js +1 -0
- package/dist/assets/dist-DMbzNqoL.js +1 -0
- package/dist/assets/dist-DXXJdI37.js +1 -0
- package/dist/assets/dist-Dio6anIY.js +1 -0
- package/dist/assets/dist-Dsk8n_J_.js +1 -0
- package/dist/assets/dropdown-menu-CGtdGbbM.js +1 -0
- package/dist/assets/ellipsis-CTJQ3nrw.js +1 -0
- package/dist/assets/ellipsis-vertical-DgEkGDM6.js +1 -0
- package/dist/assets/email-DSDHyuPN.js +1 -0
- package/dist/assets/environment-variables-editor-CeJtQgG3.js +1 -0
- package/dist/assets/environments-CkOqllDO.js +1 -0
- package/dist/assets/es2015-BboM3iDV.js +41 -0
- package/dist/assets/external-link-f1hYdqHj.js +1 -0
- package/dist/assets/eye-BCZqVltr.js +1 -0
- package/dist/assets/eye-off-Drp_Gh8x.js +1 -0
- package/dist/assets/fast-responses-q6SLOUdm.js +1 -0
- package/dist/assets/file-CRMPeh1y.js +1 -0
- package/dist/assets/file-code-corner-D5u3jRAw.js +1 -0
- package/dist/assets/file-question-mark-yatbinF8.js +1 -0
- package/dist/assets/file-search-C2PvP-hc.js +1 -0
- package/dist/assets/file-text-CIptNPaa.js +1 -0
- package/dist/assets/flag-Do1bbSQ9.js +1 -0
- package/dist/assets/flask-conical-DbI6ckSE.js +1 -0
- package/dist/assets/folder-git-2-d0qIjUiM.js +1 -0
- package/dist/assets/folder-open-DdjnhxeI.js +1 -0
- package/dist/assets/folder-search-DUw9MTaE.js +1 -0
- package/dist/assets/funnel-Buv8XWwQ.js +1 -0
- package/dist/assets/git-pull-request-BroHiQow.js +1 -0
- package/dist/assets/github-icon-PKpt4XHN.js +1 -0
- package/dist/assets/health-BKtUXrtD.js +1 -0
- package/dist/assets/heartbeats-C4e5-0d-.js +1 -0
- package/dist/assets/inbox-BxCpgHY6.js +1 -0
- package/dist/assets/inboxArchiveCache-Bsso_yAX.js +1 -0
- package/dist/assets/index-BOCwP1Ce.js +67 -0
- package/dist/assets/info-CI1ZF_Yq.js +1 -0
- package/dist/assets/input-DGxLesAp.js +1 -0
- package/dist/assets/instanceSettings-BC3n-KRI.js +1 -0
- package/dist/assets/interaction-audience-BWLoJP0-.js +1 -0
- package/dist/assets/interaction-card-visibility-m9hROy8p.js +1 -0
- package/dist/assets/issue-blockers-BV73PW-a.js +1 -0
- package/dist/assets/issue-output-CzeGYt1-.js +1 -0
- package/dist/assets/issue-properties-_A68wM5k.js +4 -0
- package/dist/assets/issue-share-D02c-2yC.js +1 -0
- package/dist/assets/issue-workspace-selection-D78aNSwQ.js +1 -0
- package/dist/assets/key-round-CsFf9ssm.js +1 -0
- package/dist/assets/label-BZn646Ew.js +1 -0
- package/dist/assets/layout-dashboard-tkcdq24q.js +1 -0
- package/dist/assets/link-2-CmfjbAC7.js +1 -0
- package/dist/assets/link-DrbHlVPk.js +1 -0
- package/dist/assets/list-filter-4z1mipm2.js +1 -0
- package/dist/assets/list-todo-nTDn23HZ.js +1 -0
- package/dist/assets/log-in-QM-xBVBd.js +1 -0
- package/dist/assets/maximize-2-DBpDftOD.js +1 -0
- package/dist/assets/mention-chips-DORj0XZl.js +17 -0
- package/dist/assets/message-square-plus-PiTnDv4v.js +1 -0
- package/dist/assets/minus-D25pDzjX.js +1 -0
- package/dist/assets/model-fallback-BBi0_msi.js +1 -0
- package/dist/assets/model-picker-fields-CYCSwNEw.js +1 -0
- package/dist/assets/network-VbPswQBT.js +1 -0
- package/dist/assets/octagon-alert-BKU0Wedd.js +1 -0
- package/dist/assets/octagon-x-BPpbsbuK.js +1 -0
- package/dist/assets/omp-settings-model-C2OWQeYw.js +1 -0
- package/dist/assets/package-DczbARit.js +1 -0
- package/dist/assets/pause-S8e_AGf-.js +1 -0
- package/dist/assets/pen-line-D0UgBOKm.js +1 -0
- package/dist/assets/pipeline-stage-presentation-DdCpyAsp.js +2 -0
- package/dist/assets/pipelines-Bd_XM8ro.js +1 -0
- package/dist/assets/play-XEVcbyM_.js +1 -0
- package/dist/assets/plug-DWkip4Z9.js +1 -0
- package/dist/assets/plugins-CRoAPVrv.js +1 -0
- package/dist/assets/plus-CXoQSz3w.js +1 -0
- package/dist/assets/popover-CcOhyOND.js +1 -0
- package/dist/assets/power-CPZD6Q9M.js +1 -0
- package/dist/assets/presentation-mode-c7TKp9Hu.js +1 -0
- package/dist/assets/profile-summary-BHzP6Xtf.js +1 -0
- package/dist/assets/projects-BPtzjKQw.js +1 -0
- package/dist/assets/proposal-review-IzmBWgPK.js +1 -0
- package/dist/assets/queryClient-BFkbfDwx.js +1 -0
- package/dist/assets/queryKeys-BVuBtip7.js +1 -0
- package/dist/assets/radio-DbtOVq1U.js +1 -0
- package/dist/assets/radio-card-BWfKPzHY.js +1 -0
- package/dist/assets/recent-agent-chats-GcKZMrz5.js +1 -0
- package/dist/assets/refresh-cw-DQ4dQkEl.js +1 -0
- package/dist/assets/repeat-mygPNxs4.js +1 -0
- package/dist/assets/resizable-panels-Dt9iNH-x.js +1 -0
- package/dist/assets/review-policy-D8qCZM-M.js +1 -0
- package/dist/assets/rotate-ccw-Bvcqd3aw.js +1 -0
- package/dist/assets/rotate-cw-Cvc7znRa.js +1 -0
- package/dist/assets/router-DVO-ie3J.js +1 -0
- package/dist/assets/routines-DmdoQzs5.js +1 -0
- package/dist/assets/runRetryState-v6kTMiL8.js +1 -0
- package/dist/assets/save-jNtYK7zU.js +1 -0
- package/dist/assets/schema-config-fields-5IZKWDM9.js +1 -0
- package/dist/assets/scroll-area-B3xrRUOC.js +1 -0
- package/dist/assets/scroll-text-CTb9-tx_.js +1 -0
- package/dist/assets/search-CMj2qhPR.js +1 -0
- package/dist/assets/secrets-DrU7_Mll.js +1 -0
- package/dist/assets/select-D8dRQ63R.js +1 -0
- package/dist/assets/send-Dk3YvlsQ.js +1 -0
- package/dist/assets/separator-D8YzlNNu.js +1 -0
- package/dist/assets/server-DW23QYGg.js +1 -0
- package/dist/assets/server-cog-Dlo-LMHG.js +1 -0
- package/dist/assets/settings-Dw-RMThV.js +1 -0
- package/dist/assets/shared-DAFyYLvq.js +1 -0
- package/dist/assets/sheet-CxFPwZR_.js +1 -0
- package/dist/assets/shield-DJ-g4sMO.js +1 -0
- package/dist/assets/shield-alert-BFIzeqOf.js +1 -0
- package/dist/assets/shield-check-DxJhStbm.js +1 -0
- package/dist/assets/shield-question-mark-EYOAJqM7.js +1 -0
- package/dist/assets/shield-x-DwOArOD3.js +1 -0
- package/dist/assets/sidebarPreferences-Wtkpi6Pj.js +1 -0
- package/dist/assets/skeleton-D3sROvM4.js +1 -0
- package/dist/assets/slots-DEJtGm8A.js +49 -0
- package/dist/assets/smoke-lab-matrix-CU0mJLc0.js +1 -0
- package/dist/assets/square-SHxqAQv8.js +1 -0
- package/dist/assets/star-DMFjS4pe.js +15 -0
- package/dist/assets/sun-DxGkWlRw.js +1 -0
- package/dist/assets/system-notice-comment-Czbtm4Gz.js +1 -0
- package/dist/assets/tabs-BXjEFplq.js +1 -0
- package/dist/assets/task-chat-attachments-quN0fSXh.js +10 -0
- package/dist/assets/terminal-BFBXuhaO.js +1 -0
- package/dist/assets/textarea-BACZM3sN.js +1 -0
- package/dist/assets/thumbs-down-B2dkBFuW.js +1 -0
- package/dist/assets/thumbs-up-uInKQhvj.js +1 -0
- package/dist/assets/toggle-switch-B0NDLEeD.js +1 -0
- package/dist/assets/tools-DzOIVgY_.js +1 -0
- package/dist/assets/tooltip-m0rBg4Gj.js +1 -0
- package/dist/assets/transcript-adapter-DjeY_fLn.js +5 -0
- package/dist/assets/trash-v7m_afTU.js +1 -0
- package/dist/assets/triangle-alert-H5UZJkol.js +1 -0
- package/dist/assets/use-adapter-capabilities-D8BkxAj3.js +1 -0
- package/dist/assets/use-copy-action-Df90KRXH.js +1 -0
- package/dist/assets/useAgentChatEnabled-DZ-w4F_4.js +1 -0
- package/dist/assets/useAutosaveIndicator-BsakWzAX.js +1 -0
- package/dist/assets/useHiddenSettings-BqQYYafK.js +1 -0
- package/dist/assets/useInfiniteQuery-DFHZwHYJ.js +1 -0
- package/dist/assets/useInstanceFeatureSettings-DvqgEsyr.js +1 -0
- package/dist/assets/useManagedSandboxOnly-DLLb0Bdf.js +1 -0
- package/dist/assets/useMobileEntityPickerViewportStyle-D7HY-LCa.js +1 -0
- package/dist/assets/usePrefersReducedMotion-DEqVMce4.js +1 -0
- package/dist/assets/useProfilesData-BI4avXOm.js +1 -0
- package/dist/assets/useQueries-CLv_DZmY.js +1 -0
- package/dist/assets/useSecondTick-BJuzLSgJ.js +1 -0
- package/dist/assets/useSharedPolling-D4hBrMOp.js +1 -0
- package/dist/assets/useSummaryDraftStream-DbhSvixc.js +3 -0
- package/dist/assets/user-CnZWlDTv.js +1 -0
- package/dist/assets/user-check-DU0qYVju.js +1 -0
- package/dist/assets/user-minus-DEKf2JCx.js +1 -0
- package/dist/assets/user-round-CQgPjiiv.js +1 -0
- package/dist/assets/user-x-DRByod8u.js +1 -0
- package/dist/assets/users-0ZB9mWor.js +1 -0
- package/dist/assets/wand-sparkles-C8d30moD.js +1 -0
- package/dist/assets/webhook-CaDCJLSg.js +1 -0
- package/dist/assets/x-B64nl98S.js +1 -0
- package/dist/index.html +190 -190
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/AccessSelectIdentity-DP1Mu7bR.js +0 -1
- package/dist/assets/AdapterManager-DlCyzyMu.js +0 -1
- package/dist/assets/AdvancedToolsRoute-4n8ZC6o0.js +0 -39
- package/dist/assets/AgentActionButtons-LV4FbrTY.js +0 -1
- package/dist/assets/AgentAvatar-B4hORIPc.js +0 -1
- package/dist/assets/AgentBubbleActionRow-DkXjmbLK.js +0 -1
- package/dist/assets/AgentCharacter-DDxSOhSK.js +0 -2
- package/dist/assets/AgentChat-CXR66MM4.js +0 -1
- package/dist/assets/AgentChats-C4cEfRO_.js +0 -1
- package/dist/assets/AgentDefaults-BZwFysUw.js +0 -1
- package/dist/assets/AgentDetail-DPCbH362.js +0 -38
- package/dist/assets/AgentIconPicker-DHgdD_9_.js +0 -1
- package/dist/assets/AgentIdentity-DysUzsFa.js +0 -1
- package/dist/assets/AgentMailCredentialField-GpMDP0TI.js +0 -1
- package/dist/assets/AgentMultiSelect-qfPqHgqC.js +0 -1
- package/dist/assets/AgentRoleEditor-GiQtUBwK.js +0 -1
- package/dist/assets/AgentSetupPrompt-kYvr8COH.js +0 -30
- package/dist/assets/AgentTodoCard-82Za1R6Y.js +0 -1
- package/dist/assets/Agents-BotjqSPg.js +0 -3
- package/dist/assets/AppDetail-B5T_4Bu-.js +0 -5
- package/dist/assets/AppLogo-A080obfm.js +0 -1
- package/dist/assets/AppNotConnected-eBGlritA.js +0 -1
- package/dist/assets/ApprovalCard-CyXVBGnO.js +0 -1
- package/dist/assets/ApprovalDetail-BSNBUdim.js +0 -1
- package/dist/assets/ApprovalPayload-vezR61PH.js +0 -1
- package/dist/assets/Approvals-YzDki85i.js +0 -1
- package/dist/assets/AppsConnect-eslQZ4Lz.js +0 -1
- package/dist/assets/AppsReview-D02Q501S.js +0 -1
- package/dist/assets/ArtifactCard-CC5aIvtf.js +0 -1
- package/dist/assets/Artifacts-CnP5QapS.js +0 -1
- package/dist/assets/AssistantConnection-refIKgUa.js +0 -1
- package/dist/assets/AttentionInteractionResolver-_l8MisRg.js +0 -1
- package/dist/assets/AuditHub-CKyN1yDa.js +0 -1
- package/dist/assets/Auth-BRkjUyyN.js +0 -3
- package/dist/assets/BoardChat-Dn5D5hbo.js +0 -18
- package/dist/assets/BoardClaim-7gbzMdsZ.js +0 -1
- package/dist/assets/BootstrapSetupUxLab-CDn9Qoy4.js +0 -1
- package/dist/assets/BreadcrumbContext-_dNLeVnD.js +0 -1
- package/dist/assets/Browse-BQApRQGO.js +0 -1
- package/dist/assets/BudgetPolicyCard-BAwZpX0_.js +0 -1
- package/dist/assets/CaseDetail-CPGVCggR.js +0 -2
- package/dist/assets/CaseIdentifierKey-CEVNnXBk.js +0 -1
- package/dist/assets/Cases-CpluIjg7.js +0 -2
- package/dist/assets/ChatEndpointDetail-C15kjogV.js +0 -5
- package/dist/assets/ChatEndpointSetup-Czgls4T4.js +0 -1
- package/dist/assets/ChatIdentityConfirm-BJoMzDSS.js +0 -1
- package/dist/assets/ChoiceControls-Dd_bVqHH.js +0 -1
- package/dist/assets/CliAuth-CfQo7C9j.js +0 -1
- package/dist/assets/CommentAttributionChip-CoZpP9Qu.js +0 -1
- package/dist/assets/Companies-DK47FHh_.js +0 -1
- package/dist/assets/CompanyAccess-G_ygWCdy.js +0 -1
- package/dist/assets/CompanyActivity-BzF5S-ak.js +0 -1
- package/dist/assets/CompanyConnections-V6QokJbP.js +0 -1
- package/dist/assets/CompanyContext-DDgccGSs.js +0 -1
- package/dist/assets/CompanyEnvironments-Dtsf3CLS.js +0 -3
- package/dist/assets/CompanyExport-CMPWrtnT.js +0 -4
- package/dist/assets/CompanyImport-1brk-ZPP.js +0 -1
- package/dist/assets/CompanySettings-DXs4duFl.js +0 -1
- package/dist/assets/CompanySettingsPluginPage-C2DZeyFu.js +0 -1
- package/dist/assets/CompanySkills-BE6s5mI1.js +0 -10
- package/dist/assets/ComposerAddMenu-BAe6OEqw.js +0 -3
- package/dist/assets/ConfigureBuiltInAgentModal-7wvPpeNM.js +0 -1
- package/dist/assets/ConnectionSetupFlow-CYRelIus.js +0 -40
- package/dist/assets/CopyText-ClimrXBs.js +0 -1
- package/dist/assets/CopyableGatewayUrl-i8-LiYxQ.js +0 -1
- package/dist/assets/CrossIssueCollaborationUxLab-Dm0T3f-s.js +0 -1
- package/dist/assets/Dashboard-CU-kG6C4.js +0 -2
- package/dist/assets/DecisionDateChips-BhvEmkt1.js +0 -1
- package/dist/assets/DecisionModelSettings-DMCwoXY5.js +0 -1
- package/dist/assets/DecisionQueuePage-CBULv6cY.js +0 -1
- package/dist/assets/DesignGuide-BwncU-wB.js +0 -23
- package/dist/assets/DocumentFrameHeader-Cvi5g3Mg.js +0 -1
- package/dist/assets/EmailConnectionAccess-BdGNG8sv.js +0 -1
- package/dist/assets/EmailEndpointSetup-BPf_8pC0.js +0 -1
- package/dist/assets/EnforcementBanner-vHB9L-Yh.js +0 -1
- package/dist/assets/EntityRow-Bnh1HYkH.js +0 -1
- package/dist/assets/ExecutionWorkspaceDetail-CqvRHX5r.js +0 -19
- package/dist/assets/FilterBar-B0nW3JWT.js +0 -1
- package/dist/assets/FoldCurtain-CaqbwQ5-.js +0 -1
- package/dist/assets/FolderControls-BzHjv3pm.js +0 -1
- package/dist/assets/GatewayDetail-Br82oQib.js +0 -2
- package/dist/assets/GatewaysList-kBD3cwdU.js +0 -1
- package/dist/assets/GoalDetail-BFeUPzal.js +0 -1
- package/dist/assets/GoalTree-CaQSt6o5.js +0 -1
- package/dist/assets/Goals-CnYUdXEo.js +0 -1
- package/dist/assets/Identity-J7JnIwUT.js +0 -1
- package/dist/assets/ImageGalleryModal-QrZd2HrQ.js +0 -1
- package/dist/assets/Inbox-C6bCCEH6.js +0 -2
- package/dist/assets/InlineBanner-Bb5XPk0z.js +0 -1
- package/dist/assets/InlineEditor-DED3FvOC.js +0 -1
- package/dist/assets/InlineEntitySelector-BPTU6UGg.js +0 -1
- package/dist/assets/InstanceAccess-CDzvvhRr.js +0 -1
- package/dist/assets/InstanceAdvanced-CTjlJp69.js +0 -1
- package/dist/assets/InstanceFeatures-CqkXR6d9.js +0 -1
- package/dist/assets/InviteLanding-C65R08_E.js +0 -1
- package/dist/assets/IssueChatLongThreadPerf-mdn5NFzU.js +0 -2
- package/dist/assets/IssueChatThread-CZ9Q-xq-.js +0 -40
- package/dist/assets/IssueDetail-svM2GGnk.js +0 -9
- package/dist/assets/IssueDocumentAnnotations-MC9Cg0US.js +0 -2
- package/dist/assets/IssueOutputSection-Du3C5TFv.js +0 -1
- package/dist/assets/IssueRecoveryActionCard-Bq2QDhQA.js +0 -1
- package/dist/assets/IssueReferencePill-Cnjk1Ugc.js +0 -1
- package/dist/assets/IssueThreadInteractionCard-CAzrNSjO.js +0 -9
- package/dist/assets/IssueWriteDenialNotice-BL15rdb3.js +0 -1
- package/dist/assets/Issues-D97SDuYL.js +0 -5
- package/dist/assets/JoinRequestQueue-B_br1twW.js +0 -1
- package/dist/assets/JsonSchemaForm-BeT-YkAn.js +0 -1
- package/dist/assets/LiveNowTodoLine-Cq1ub6Gj.js +0 -1
- package/dist/assets/ManagedAiConnectionDetails-COyNN_aD.js +0 -1
- package/dist/assets/MarkdownBody-B_U4yj24.js +0 -16
- package/dist/assets/MarkdownEditor-DAi4IIOl.js +0 -85
- package/dist/assets/McpConnect-CYsPUSYV.js +0 -1
- package/dist/assets/MembershipAction-DYMy7umB.js +0 -1
- package/dist/assets/MetricCard-C4ovc-sG.js +0 -1
- package/dist/assets/MissingPluginTabPlaceholder-tpHW_cHu.js +0 -1
- package/dist/assets/ModelsAndProviders-BJaNzbhV.js +0 -1
- package/dist/assets/MootMark-JzjkztPD.js +0 -1
- package/dist/assets/NewAgent-DGXol110.js +0 -1
- package/dist/assets/OmpAllSettings-BvYkLMhp.js +0 -1
- package/dist/assets/OpenwaGatewayManager-CPX75sP6.js +0 -2
- package/dist/assets/PathInstructionsModal-CDSHNrY7.js +0 -1
- package/dist/assets/PipelineSettings-B6Am-LrO.js +0 -2
- package/dist/assets/Pipelines-MgjAhzew.js +0 -1
- package/dist/assets/PixelsOffice-DnBnPerp.js +0 -2
- package/dist/assets/PluginManager-CPYhUxgY.js +0 -1
- package/dist/assets/PluginPage-C1XADFT2.js +0 -1
- package/dist/assets/PluginSettings-CapWiXsO.js +0 -1
- package/dist/assets/ProfileDetailRoute-PJCQrW25.js +0 -1
- package/dist/assets/ProfileSettings-DXbA8GQP.js +0 -1
- package/dist/assets/ProfileWizardRoute-DaZPFglw.js +0 -1
- package/dist/assets/ProjectDetail-DQxMbc1Q.js +0 -1
- package/dist/assets/ProjectWorkspaceDetail-dA3zVCbf.js +0 -29
- package/dist/assets/ProjectWorkspacesContent-DnzUTFfW.js +0 -1
- package/dist/assets/Projects-D3ZC8FJk.js +0 -1
- package/dist/assets/PublicIssueSharePage-BtWc4gq4.js +0 -1
- package/dist/assets/QuestionForm-Ce0J42bT.js +0 -7
- package/dist/assets/QuotaBar-t5jmdx0g.js +0 -1
- package/dist/assets/RepositoryEditor-DxXq3UJI.js +0 -1
- package/dist/assets/ResponsibleUserDenialNotice-CEvs5gLH.js +0 -1
- package/dist/assets/ResponsibleUserDenialUxLab-DN6KJXcW.js +0 -1
- package/dist/assets/ReviewQueueCard-C9YVH9hi.js +0 -1
- package/dist/assets/RichWorkProductCard-CJPI3xQY.js +0 -1
- package/dist/assets/RoutineActivityRow-BKtWtOsg.js +0 -1
- package/dist/assets/RoutineDetail-DUZXGXpv.js +0 -2
- package/dist/assets/RoutineRunVariablesDialog-CQJpihoC.js +0 -1
- package/dist/assets/RoutineVariablesEditor-Bfp8oxTI.js +0 -1
- package/dist/assets/Routines-CZMUFOH1.js +0 -1
- package/dist/assets/ScrollToBottom-wVHhI6vr.js +0 -1
- package/dist/assets/Search-8efHT3Mn.js +0 -1
- package/dist/assets/SearchableSelect-LINcdfon.js +0 -1
- package/dist/assets/Secrets-BZCIDLKj.js +0 -4
- package/dist/assets/SetupWizard-C7Lq6-gc.js +0 -1
- package/dist/assets/SidebarContext-CQAYTXv1.js +0 -1
- package/dist/assets/SidebarNavItem-Ctqx1ZPE.js +0 -1
- package/dist/assets/SkillBinaryFile-DQ_98eYB.js +0 -1
- package/dist/assets/SkillCardIcon-BCnSfO_D.js +0 -2
- package/dist/assets/SkillSourceTree-D31jixpq.js +0 -2
- package/dist/assets/SkillSources-Bn1LRP0O.js +0 -2
- package/dist/assets/SkillStudio-C4o17_hm.js +0 -9
- package/dist/assets/SourceTrustBadge-C0F4cAmH.js +0 -1
- package/dist/assets/StatusCards-BIvnBXBN.js +0 -1
- package/dist/assets/StatusIcon-BjnMkdr3.js +0 -1
- package/dist/assets/SummarySlotCard-Bpu8HBIR.js +0 -1
- package/dist/assets/TaskChatComposerTakeoverContext-R3Q1BhAK.js +0 -1
- package/dist/assets/TaskChatLab-DAEcgWdy.js +0 -11
- package/dist/assets/TaskChatMarker-Bbn6iq01.js +0 -2
- package/dist/assets/TaskChatProtocolCard-wllJ9P2o.js +0 -1
- package/dist/assets/TaskChatThreadView-Bnyakc3A.js +0 -4
- package/dist/assets/TaskTreeControls-BFz5K7U-.js +0 -3
- package/dist/assets/Terminal-DGUlqBL9.js +0 -1
- package/dist/assets/TerminalView-Cz01H-I5.js +0 -58
- package/dist/assets/ThemeContext-B1H3O5xP.js +0 -1
- package/dist/assets/ThemeToggle-U9FTg879.js +0 -1
- package/dist/assets/ToastContext-BL2cptrZ.js +0 -1
- package/dist/assets/ToolsAdminGate-tzHGMGsb.js +0 -1
- package/dist/assets/TrustPresetSection-lyB0V8c9.js +0 -1
- package/dist/assets/UserProfile-5qgIbXdf.js +0 -1
- package/dist/assets/WebhookUrlWarning-DCT2VWqt.js +0 -1
- package/dist/assets/WhatNeedsMe-DjxO39CR.js +0 -1
- package/dist/assets/WorkspaceRuntimeControls--vWoZbsc.js +0 -1
- package/dist/assets/Workspaces-BzTr5cqx.js +0 -1
- package/dist/assets/access-RvWIoVKp.js +0 -1
- package/dist/assets/activity-BD29TjTr.js +0 -1
- package/dist/assets/activity-BwjvcZxv.js +0 -1
- package/dist/assets/activity-format-BNHOXlUD.js +0 -1
- package/dist/assets/adapter-display-registry-Btc8GS-1.js +0 -1
- package/dist/assets/adapters-CgHcTR0X.js +0 -1
- package/dist/assets/agent-avatar-url-BIEMYowR.js +0 -1
- package/dist/assets/agent-config-primitives-BgAI9Wjh.js +0 -1
- package/dist/assets/agentChats-Do1wOmo4.js +0 -1
- package/dist/assets/agents-DjsXf9UL.js +0 -1
- package/dist/assets/alert-dialog-B25sZXGU.js +0 -1
- package/dist/assets/app-connect-policy-BHI-V2Dg.js +0 -1
- package/dist/assets/archive-D88zlq0K.js +0 -1
- package/dist/assets/archive-restore-BCdKBUrD.js +0 -1
- package/dist/assets/arrow-down-DEeYvDSD.js +0 -1
- package/dist/assets/arrow-down-left-Bbtqoesi.js +0 -1
- package/dist/assets/arrow-left-DbEq2ZQa.js +0 -1
- package/dist/assets/arrow-right-CI9A-h7U.js +0 -1
- package/dist/assets/arrow-up-ddF-jVQ8.js +0 -1
- package/dist/assets/arrow-up-down-DbH6kJcR.js +0 -1
- package/dist/assets/arrow-up-right-Who3c6Eu.js +0 -1
- package/dist/assets/artifacts-CVWeUMom.js +0 -1
- package/dist/assets/assets-CFbf4zTY.js +0 -1
- package/dist/assets/attachment-icon-ML6IBayL.js +0 -1
- package/dist/assets/avatar-Da46HV9P.js +0 -1
- package/dist/assets/badge-Dz4tmpgp.js +0 -1
- package/dist/assets/badge-check-Ckoc56vq.js +0 -1
- package/dist/assets/book-open-BxTSC4RX.js +0 -1
- package/dist/assets/bot-B76w73ks.js +0 -1
- package/dist/assets/boxes-DKD_NMHM.js +0 -1
- package/dist/assets/braces-CFDFcEHK.js +0 -1
- package/dist/assets/browser-use-B_hQkV_4.js +0 -1
- package/dist/assets/budgets-Dh83JquC.js +0 -1
- package/dist/assets/button-D3bYvq4T.js +0 -1
- package/dist/assets/calendar-clock-BISCDlGh.js +0 -1
- package/dist/assets/card-CtkberpO.js +0 -1
- package/dist/assets/cases-CyKm563_.js +0 -1
- package/dist/assets/chatEndpoints-DU1FUTHN.js +0 -1
- package/dist/assets/check-DtcbYVEc.js +0 -1
- package/dist/assets/checkbox-CM0BzCfq.js +0 -1
- package/dist/assets/chevron-down-B_rMrTLq.js +0 -1
- package/dist/assets/chevron-left-BOxfE_aw.js +0 -1
- package/dist/assets/chevron-right-DDmPvaMb.js +0 -1
- package/dist/assets/chevron-up-JIXWtmhk.js +0 -1
- package/dist/assets/chip-Carlb_db.js +0 -1
- package/dist/assets/circle-QmNEwt6Q.js +0 -1
- package/dist/assets/circle-alert-IYSLYJUJ.js +0 -1
- package/dist/assets/circle-dot--lzumEbC.js +0 -1
- package/dist/assets/circle-question-mark-DwSVXXAd.js +0 -1
- package/dist/assets/circle-slash-CW8QpI4G.js +0 -1
- package/dist/assets/circle-x-BjJ9dhyd.js +0 -1
- package/dist/assets/clipboard-paste-CTGh3EHl.js +0 -1
- package/dist/assets/clock-CC_JLeqp.js +0 -1
- package/dist/assets/cloud-B-O92Qvh.js +0 -1
- package/dist/assets/code-xml-0Ayyc-wN.js +0 -1
- package/dist/assets/coins-DOScIoKX.js +0 -1
- package/dist/assets/collapsible-DfIkfd0G.js +0 -1
- package/dist/assets/columns-3-CY4STSME.js +0 -1
- package/dist/assets/command-D25L6P6V.js +0 -5
- package/dist/assets/companies-query-C3PiqvlB.js +0 -1
- package/dist/assets/connection-identity-DxOISTHV.js +0 -1
- package/dist/assets/connection-owner-EECE9Eiz.js +0 -1
- package/dist/assets/copy-B55HyIrd.js +0 -1
- package/dist/assets/createLucideIcon-B-uEJvX6.js +0 -94
- package/dist/assets/decision-models-DGwWNl8R.js +0 -1
- package/dist/assets/dialog-DlsqN-fP.js +0 -1
- package/dist/assets/dist-2Rw-Zd_A.js +0 -1
- package/dist/assets/dist-BDSttwka.js +0 -1
- package/dist/assets/dist-BFkQWgno.js +0 -1
- package/dist/assets/dist-BYL6sXm3.js +0 -1
- package/dist/assets/dist-BnmtZ2Iv.js +0 -1
- package/dist/assets/dist-C5mWZjS5.js +0 -1
- package/dist/assets/dist-CJqlwWdH.js +0 -1
- package/dist/assets/dist-CcFm-u0f.js +0 -1
- package/dist/assets/dist-D7pwu0R1.js +0 -1
- package/dist/assets/dist-DZXev2k_.js +0 -1
- package/dist/assets/dist-E2vHKLl_.js +0 -1
- package/dist/assets/dist-LX8UwhCI.js +0 -1
- package/dist/assets/dist-UqMQn1S1.js +0 -1
- package/dist/assets/dropdown-menu-BdCU_bAX.js +0 -1
- package/dist/assets/ellipsis-DoMWjpQg.js +0 -1
- package/dist/assets/ellipsis-vertical-BJDskJB3.js +0 -1
- package/dist/assets/email-CK7WXZe2.js +0 -1
- package/dist/assets/environment-variables-editor-jbMGpQS9.js +0 -1
- package/dist/assets/environments-DNM7-n7c.js +0 -1
- package/dist/assets/es2015-D_463nn1.js +0 -41
- package/dist/assets/external-link-CxXijrsp.js +0 -1
- package/dist/assets/eye-Cr1d3Exj.js +0 -1
- package/dist/assets/eye-off-D13_kZ5c.js +0 -1
- package/dist/assets/fast-responses-DfTJsIyW.js +0 -1
- package/dist/assets/file-code-corner-BjfTMOCK.js +0 -1
- package/dist/assets/file-pnrh3b35.js +0 -1
- package/dist/assets/file-question-mark-BkUB191G.js +0 -1
- package/dist/assets/file-search-rH270bSD.js +0 -1
- package/dist/assets/file-text-Bsh0mVGb.js +0 -1
- package/dist/assets/flag-grOpQtVK.js +0 -1
- package/dist/assets/flask-conical-CStGGVAY.js +0 -1
- package/dist/assets/folder-git-2-DwoXLLLe.js +0 -1
- package/dist/assets/folder-open-_ghGCHXm.js +0 -1
- package/dist/assets/folder-search-DREkJnno.js +0 -1
- package/dist/assets/funnel-DuO6AYgp.js +0 -1
- package/dist/assets/git-pull-request-BjnLQJTs.js +0 -1
- package/dist/assets/github-icon-DFxdtKYj.js +0 -1
- package/dist/assets/health-DbFHC5QU.js +0 -1
- package/dist/assets/heartbeats-xPg7ZEsm.js +0 -1
- package/dist/assets/inbox-BqqJhYb6.js +0 -1
- package/dist/assets/inboxArchiveCache-BlAbu38l.js +0 -1
- package/dist/assets/index-DbENFODe.js +0 -67
- package/dist/assets/info-BwrvDiVL.js +0 -1
- package/dist/assets/input-It0utqV7.js +0 -1
- package/dist/assets/instanceSettings-Beri9WSh.js +0 -1
- package/dist/assets/interaction-audience-BKA801vy.js +0 -1
- package/dist/assets/interaction-card-visibility-CcLH43P2.js +0 -1
- package/dist/assets/issue-blockers-BziPNnMx.js +0 -1
- package/dist/assets/issue-output-CBQvTXwe.js +0 -1
- package/dist/assets/issue-properties-BmOIUOmd.js +0 -4
- package/dist/assets/issue-share-CnQGf7_a.js +0 -1
- package/dist/assets/issue-workspace-selection-CIvSmFv2.js +0 -1
- package/dist/assets/key-round-B3uXhHZr.js +0 -1
- package/dist/assets/label-CPQI5V7i.js +0 -1
- package/dist/assets/layout-dashboard-Do0AiLwc.js +0 -1
- package/dist/assets/link-2-k_0bFjUn.js +0 -1
- package/dist/assets/link-D8yT0AWm.js +0 -1
- package/dist/assets/list-filter-Ral9WsjH.js +0 -1
- package/dist/assets/list-todo-DEUK6RwS.js +0 -1
- package/dist/assets/log-in-v9DKL1c0.js +0 -1
- package/dist/assets/maximize-2-Cvn_jAEz.js +0 -1
- package/dist/assets/mention-chips-DiRTrrHG.js +0 -17
- package/dist/assets/message-square-plus-DfHcFdyP.js +0 -1
- package/dist/assets/minus-BICJQjhd.js +0 -1
- package/dist/assets/model-fallback-TGS2bD1z.js +0 -1
- package/dist/assets/model-picker-fields-CO8eTE_4.js +0 -1
- package/dist/assets/network-fTXDUoNc.js +0 -1
- package/dist/assets/octagon-alert-GkcxkXei.js +0 -1
- package/dist/assets/octagon-x-Dv-Y-nVs.js +0 -1
- package/dist/assets/omp-settings-model-CMuKzvaI.js +0 -1
- package/dist/assets/package-CtAS5cQ_.js +0 -1
- package/dist/assets/pause-Dt9kKzpY.js +0 -1
- package/dist/assets/pen-line-ChG9h6IN.js +0 -1
- package/dist/assets/pipeline-stage-presentation-DoJvVCJ3.js +0 -2
- package/dist/assets/pipelines-DRMWZLsA.js +0 -1
- package/dist/assets/play-BEx2fnvh.js +0 -1
- package/dist/assets/plug-C6x6irKg.js +0 -1
- package/dist/assets/plugins-B9j-cGkW.js +0 -1
- package/dist/assets/plus-BbX1VFl1.js +0 -1
- package/dist/assets/popover-Csg2lQJG.js +0 -1
- package/dist/assets/power-BhiyULZK.js +0 -1
- package/dist/assets/presentation-mode-4ymENOlr.js +0 -1
- package/dist/assets/profile-summary-BvOz6WgX.js +0 -1
- package/dist/assets/projects-BoqVGttS.js +0 -1
- package/dist/assets/proposal-review-BWfjrdl_.js +0 -1
- package/dist/assets/queryClient-B1lX-ygT.js +0 -1
- package/dist/assets/queryKeys-yuC-YxZI.js +0 -1
- package/dist/assets/radio-card-DjSTuW8s.js +0 -1
- package/dist/assets/radio-ljY5_vGs.js +0 -1
- package/dist/assets/recent-agent-chats-D6dncy6K.js +0 -1
- package/dist/assets/refresh-cw-DFyxqrfh.js +0 -1
- package/dist/assets/repeat-Kcok_N3k.js +0 -1
- package/dist/assets/resizable-panels-Cfyr3j78.js +0 -1
- package/dist/assets/review-policy-CF8yrOPs.js +0 -1
- package/dist/assets/rotate-ccw-axI90MQW.js +0 -1
- package/dist/assets/rotate-cw-CsneTEMK.js +0 -1
- package/dist/assets/router-2HX_SyKK.js +0 -1
- package/dist/assets/routines-5Q3z9LWd.js +0 -1
- package/dist/assets/runRetryState-BXetWeys.js +0 -1
- package/dist/assets/save-D6Ol3Dt5.js +0 -1
- package/dist/assets/schema-config-fields-D7skOY9b.js +0 -1
- package/dist/assets/scroll-area-Drh0SHUe.js +0 -1
- package/dist/assets/scroll-text-DkybSLN1.js +0 -1
- package/dist/assets/search-oKGByIam.js +0 -1
- package/dist/assets/secrets-DQ_ZOoe5.js +0 -1
- package/dist/assets/select-DKYWrP8G.js +0 -1
- package/dist/assets/send-DeeMT_AN.js +0 -1
- package/dist/assets/separator-CWcHaiNj.js +0 -1
- package/dist/assets/server-DnJLt7Tc.js +0 -1
- package/dist/assets/server-cog-DTIiF5_T.js +0 -1
- package/dist/assets/settings-BCLiRXsG.js +0 -1
- package/dist/assets/shared-BMQlB2gM.js +0 -1
- package/dist/assets/sheet-_2ap0Qlb.js +0 -1
- package/dist/assets/shield--xuWEiGM.js +0 -1
- package/dist/assets/shield-alert-CE3cG15R.js +0 -1
- package/dist/assets/shield-check-EFhQ8TuB.js +0 -1
- package/dist/assets/shield-question-mark-m0tt6hs2.js +0 -1
- package/dist/assets/shield-x-CknkwZJY.js +0 -1
- package/dist/assets/sidebarPreferences-CxJ8nhCI.js +0 -1
- package/dist/assets/skeleton-BrYUg3zU.js +0 -1
- package/dist/assets/slots-DEaEOBky.js +0 -49
- package/dist/assets/smoke-lab-matrix-ClXyORST.js +0 -1
- package/dist/assets/square-B6e-47ON.js +0 -1
- package/dist/assets/star-BXywPGTx.js +0 -15
- package/dist/assets/sun-COPyd3B-.js +0 -1
- package/dist/assets/system-notice-comment-z2u-lnKf.js +0 -1
- package/dist/assets/tabs-BP71y3CO.js +0 -1
- package/dist/assets/task-chat-attachments-gnHi9Y8F.js +0 -10
- package/dist/assets/terminal-CPu3HVdk.js +0 -1
- package/dist/assets/textarea-9ySinQRQ.js +0 -1
- package/dist/assets/thumbs-down-B5HCpIhF.js +0 -1
- package/dist/assets/thumbs-up-D4dbuLOd.js +0 -1
- package/dist/assets/toggle-switch-n2GNfMll.js +0 -1
- package/dist/assets/tools-CXMpY5lh.js +0 -1
- package/dist/assets/tooltip-CBtM5Ru1.js +0 -1
- package/dist/assets/transcript-adapter-DDVisW9K.js +0 -5
- package/dist/assets/trash-CXx6ftRP.js +0 -1
- package/dist/assets/triangle-alert-Cpo2fj-L.js +0 -1
- package/dist/assets/use-adapter-capabilities-bMzhmkI4.js +0 -1
- package/dist/assets/use-copy-action-DTcJkzd7.js +0 -1
- package/dist/assets/useAgentChatEnabled-CxjeKfu8.js +0 -1
- package/dist/assets/useAutosaveIndicator-7HgPvOXz.js +0 -1
- package/dist/assets/useHiddenSettings-D4B9ID2B.js +0 -1
- package/dist/assets/useInfiniteQuery-KaGSl9U6.js +0 -1
- package/dist/assets/useInstanceFeatureSettings-CQdym27e.js +0 -1
- package/dist/assets/useManagedSandboxOnly-DmBVo7DC.js +0 -1
- package/dist/assets/useMobileEntityPickerViewportStyle-CupVnJPm.js +0 -1
- package/dist/assets/usePrefersReducedMotion-D2ae-qu3.js +0 -1
- package/dist/assets/useProfilesData-CwxF85Mp.js +0 -1
- package/dist/assets/useQueries-CARcRe0M.js +0 -1
- package/dist/assets/useSecondTick-C8mfjKOs.js +0 -1
- package/dist/assets/useSharedPolling-C9W19bSA.js +0 -1
- package/dist/assets/useSummaryDraftStream-BNKrqAT0.js +0 -3
- package/dist/assets/user-D82a7TR4.js +0 -1
- package/dist/assets/user-check-C8h_kn-H.js +0 -1
- package/dist/assets/user-minus-Bb57s2Ci.js +0 -1
- package/dist/assets/user-round-DGXuqT69.js +0 -1
- package/dist/assets/user-x-ZsJKw74i.js +0 -1
- package/dist/assets/users-DWw89AvQ.js +0 -1
- package/dist/assets/wand-sparkles-3T1jSols.js +0 -1
- package/dist/assets/webhook-C65Oqhz7.js +0 -1
- package/dist/assets/x-hMw21ejo.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var zn=Object.defineProperty;var u=(t,e)=>zn(t,"name",{value:e,configurable:!0});import{i as Ke}from"./rolldown-runtime-ZpX3ckPj.js";import{O as Z,jt as Hn,na as Yn,t as Zt,ta as Xn}from"./createLucideIcon-CpKa5z2C.js";import{X as Ue,_ as Ve,g as Qt,r as Ot,t as N,v as D}from"./queryKeys-BVuBtip7.js";import{tt as Gn}from"./mention-chips-DORj0XZl.js";import{n as qn}from"./CompanyContext-BawkN74-.js";import{W as Kn,t as Q,zt as Wt}from"./router-DVO-ie3J.js";import{t as Ze}from"./scroll-area-B3xrRUOC.js";import{t as Un}from"./coins-BqkDI3XJ.js";import{t as Vn}from"./external-link-f1hYdqHj.js";import{t as Zn}from"./inbox-BxCpgHY6.js";import{r as Qn,t as z}from"./button-Ckn7hiVo.js";import{t as Qe}from"./pause-S8e_AGf-.js";import{t as zt}from"./play-XEVcbyM_.js";import{t as Jn}from"./radio-DbtOVq1U.js";import{t as ts}from"./x-B64nl98S.js";import{r as es}from"./SidebarContext-D6mXtEd3.js";import{t as xt}from"./badge-C_Yv1fHA.js";import{a as ns}from"./ToastContext-frwty7Yo.js";import{t as At}from"./agents-6Xp_VYq8.js";import{t as Je}from"./heartbeats-C4e5-0d-.js";import{t as tn}from"./access-D-v-Ev7r.js";import{t as en}from"./routines-DmdoQzs5.js";import{n as ss}from"./BreadcrumbContext-BopoVMP4.js";import{t as is}from"./card-Bnw8dg8v.js";import{Pa as re,Xa as rs,fa as nn,gt as os,no as as,ua as sn,v as ls}from"./index-BOCwP1Ce.js";import{r as cs,s as us,t as fs}from"./sheet-CxFPwZR_.js";import{t as ds}from"./AttentionInteractionResolver-3lKdKWna.js";import{t as hs}from"./pipelines-Bd_XM8ro.js";import{t as ms}from"./budgets-B9S-3Thk.js";var rn={name:"alarm-smoke",size:24,node:[["path",{d:"M11 21c0-2.5 2-2.5 2-5",key:"1sicvv"}],["path",{d:"M16 21c0-2.5 2-2.5 2-5",key:"1o3eny"}],["path",{d:"m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8",key:"1bvca4"}],["path",{d:"M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z",key:"x3qr1j"}],["path",{d:"M6 21c0-2.5 2-2.5 2-5",key:"i3w1gp"}]]};rn.node;var gs=Zt(rn),on={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};on.node;var ps=Zt(on),an={name:"volume-x",size:24,node:[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z",key:"1p7khw"}],["path",{d:"m16.5 14.5 5-5",key:"cul3yw"}],["path",{d:"m16.5 9.5 5 5",key:"1akey5"}]]};an.node;var ws=Zt(an),_=Ke(Yn(),1),Ht={snapshot:u(t=>Ot.get(`/companies/${t}/pixels-office`),"snapshot"),timeline:u((t,e)=>{const s=new URLSearchParams({from:e.from,to:e.to});return e.cursor&&s.set("cursor",e.cursor),Ot.get(`/companies/${t}/pixels-office/timeline?${s.toString()}`)},"timeline"),replaceSeats:u((t,e)=>Ot.put(`/companies/${t}/pixels-office/seats`,{assignments:e}),"replaceSeats")};var vs=.15,xs=.3,ln=.5,ys=.001,bs=.5,cn="#808080",Is="#FF00FF",As="#3A3A5C",Ts=.2,un=.6,oe=.1,Yt=new Map;function Jt(t,e,s){const n=Yt.get(t);if(n)return n;const i=s.colorize?Ss(e,s):mn(e,s);return Yt.set(t,i),i}u(Jt,"getColorizedSprite");function Cs(){Yt.clear()}u(Cs,"clearColorizeCache");function Ss(t,e){const{h:s,s:n,b:i,c:r}=e,o=[];for(const a of t){const l=[];for(const c of a){if(c===""){l.push("");continue}const d=parseInt(c.slice(1,3),16),m=parseInt(c.slice(3,5),16),f=parseInt(c.slice(5,7),16);let g=(.299*d+.587*m+.114*f)/255;if(r!==0){const p=(100+r)/100;g=.5+(g-.5)*p}i!==0&&(g=g+i/200),g=Math.max(0,Math.min(1,g));const v=fn(c),y=hn(s,n/100,g);l.push(dn(y,v))}o.push(l)}return o}u(Ss,"colorizeSprite");function fn(t){return t.length>7?parseInt(t.slice(7,9),16):255}u(fn,"extractAlpha");function dn(t,e){return e>=255?t:`${t}${e.toString(16).padStart(2,"0").toUpperCase()}`}u(dn,"appendAlpha");function hn(t,e,s){const n=(1-Math.abs(2*s-1))*e,i=t/60,r=n*(1-Math.abs(i%2-1));let o=0,a=0,l=0;i<1?(o=n,a=r,l=0):i<2?(o=r,a=n,l=0):i<3?(o=0,a=n,l=r):i<4?(o=0,a=r,l=n):i<5?(o=r,a=0,l=n):(o=n,a=0,l=r);const c=s-n/2,d=Math.round((o+c)*255),m=Math.round((a+c)*255),f=Math.round((l+c)*255);return`#${Nt(d).toString(16).padStart(2,"0")}${Nt(m).toString(16).padStart(2,"0")}${Nt(f).toString(16).padStart(2,"0")}`.toUpperCase()}u(hn,"hslToHex");function Nt(t){return Math.max(0,Math.min(255,t))}u(Nt,"clamp255");function _s(t,e,s){const n=t/255,i=e/255,r=s/255,o=Math.max(n,i,r),a=Math.min(n,i,r),l=(o+a)/2;if(o===a)return[0,0,l];const c=o-a,d=l>.5?c/(2-o-a):c/(o+a);let m=0;return o===n?m=((i-r)/c+(i<r?6:0))*60:o===i?m=((r-n)/c+2)*60:m=((n-i)/c+4)*60,[m,d,l]}u(_s,"rgbToHsl");function mn(t,e){const{h:s,s:n,b:i,c:r}=e,o=[];for(const a of t){const l=[];for(const c of a){if(c===""){l.push("");continue}const d=parseInt(c.slice(1,3),16),m=parseInt(c.slice(3,5),16),f=parseInt(c.slice(5,7),16),g=fn(c),[v,y,p]=_s(d,m,f),b=((v+s)%360+360)%360,x=Math.max(0,Math.min(1,y+n/100));let T=p;if(r!==0){const w=(100+r)/100;T=.5+(T-.5)*w}i!==0&&(T=T+i/200),T=Math.max(0,Math.min(1,T));const A=hn(b,x,T);l.push(dn(A,g))}o.push(l)}return o}u(mn,"adjustSprite");var ks=Array.from({length:16},()=>Array(16).fill(cn)),_t=[];function Rs(t){_t=t,Cs()}u(Rs,"setFloorSprites");function Ms(t){const e=t-1;return e<0?null:e<_t.length?_t[e]:_t.length===0&&t>=1?ks:null}u(Ms,"getFloorSprite");function Fs(){return!0}u(Fs,"hasFloorSprites");function Es(t,e){const s=`floor-${t}-${e.h}-${e.s}-${e.b}-${e.c}`,n=Ms(t);return n?Jt(s,n,{...e,colorize:!0}):Array.from({length:16},()=>Array(16).fill(Is))}u(Es,"getColorizedFloorSprite");var $={WALL:0,FLOOR_1:1,FLOOR_2:2,FLOOR_3:3,FLOOR_4:4,FLOOR_5:5,FLOOR_6:6,FLOOR_7:7,FLOOR_8:8,FLOOR_9:9,VOID:255},E={IDLE:"idle",WALK:"walk",TYPE:"type"},S={DOWN:0,LEFT:1,RIGHT:2,UP:3},K=new Map,rt=new Map,Xt=new Map,ae=new Map,kt=new Map,Gt=null,gn=null;function Os(t){if(!t?.catalog||!t?.sprites)return!1;const e=t.catalog.map(f=>{const g=t.sprites[f.id];return g?{type:f.id,label:f.label,footprintW:f.footprintW,footprintH:f.footprintH,sprite:g,isDesk:f.isDesk,category:f.category,...f.orientation?{orientation:f.orientation}:{},...f.canPlaceOnSurfaces?{canPlaceOnSurfaces:!0}:{},...f.backgroundTiles?{backgroundTiles:f.backgroundTiles}:{},...f.canPlaceOnWalls?{canPlaceOnWalls:!0}:{},...f.mirrorSide?{mirrorSide:!0}:{}}:null}).filter(f=>f!==null);for(const f of t.catalog)if(f.mirrorSide&&f.orientation==="side"){const g=e.find(v=>v.type===f.id);g&&e.push({...g,type:`${f.id}:left`,orientation:"left",mirrorSide:!0})}if(e.length===0)return!1;K.clear(),rt.clear(),Xt.clear(),ae.clear(),kt.clear();const s=new Map;for(const f of t.catalog)if(f.groupId&&f.orientation){if(f.state&&f.state!=="off")continue;let g=s.get(f.groupId);g||(g=new Map,s.set(f.groupId,g)),f.orientation==="side"?(g.set("right",f.id),f.mirrorSide&&g.set("left",`${f.id}:left`)):g.set(f.orientation,f.id)}const n=new Map;for(const f of t.catalog)f.groupId&&f.rotationScheme&&n.set(f.groupId,f.rotationScheme);const i=new Set,r=["front","right","back","left"];for(const[f,g]of s){if(g.size<2)continue;const v=n.get(f);let y=r;v==="2-way"&&(y=["front","right"]);const p=y.filter(A=>g.has(A));if(p.length<2)continue;const b={};for(const A of p)b[A]=g.get(A);const x={orientations:p,members:b},T=new Set;for(const A of Object.values(b))T.has(A)||(K.set(A,x),T.add(A));for(const[A,w]of Object.entries(b))A!=="front"&&i.add(w)}const o=new Map;for(const f of t.catalog)if(f.groupId&&f.state){const g=`${f.groupId}|${f.orientation||""}`;let v=o.get(g);if(v||(v=new Map,o.set(g,v)),f.animationGroup&&f.frame!==void 0&&f.frame>0)continue;v.set(f.state,f.id)}for(const f of o.values()){const g=f.get("on"),v=f.get("off");g&&v&&(rt.set(g,v),rt.set(v,g),Xt.set(v,g),ae.set(g,v))}for(const f of t.catalog)if(f.groupId&&f.orientation&&f.state==="on"){if(f.animationGroup&&f.frame!==void 0&&f.frame>0)continue;const g=rt.get(f.id);if(g){const v=K.get(g);if(v){const y={};for(const b of v.orientations){const x=v.members[b];y[b]=rt.get(x)??x}const p={orientations:v.orientations,members:y};for(const b of Object.values(y))K.has(b)||K.set(b,p)}}}const a=new Map;for(const f of t.catalog)if(f.animationGroup&&f.frame!==void 0){let g=a.get(f.animationGroup);g||(g=[],a.set(f.animationGroup,g)),g.push({id:f.id,frame:f.frame})}for(const[f,g]of a)g.sort((v,y)=>v.frame-y.frame),kt.set(f,g.map(v=>v.id));const l=new Set;for(const f of t.catalog)f.state==="on"&&l.add(f.id);Gt=e;const c=e.filter(f=>!i.has(f.type)&&!l.has(f.type));for(const f of c)(K.has(f.type)||rt.has(f.type))&&(f.label=f.label.replace(/ - Front - Off$/,"").replace(/ - Front$/,"").replace(/ - Off$/,""));gn=c;const d=new Set(Array.from(K.values())).size,m=kt.size;return!0}u(Os,"buildDynamicCatalog");function Y(t){return Gt?Gt.find(e=>e.type===t):gn?.find(e=>e.type===t)}u(Y,"getCatalogEntry");function Ns(t){return Xt.get(t)??t}u(Ns,"getOnStateType");function Ls(t){for(const[,e]of kt)if(e.includes(t))return e;return null}u(Ls,"getAnimationFrames");function js(t){const e=K.get(t);if(e){for(const[s,n]of Object.entries(e.members))if(n===t)return s}}u(js,"getOrientationInGroup");function Ps(t){const e=[];for(let s=0;s<t.rows;s++){const n=[];for(let i=0;i<t.cols;i++)n.push(t.tiles[s*t.cols+i]);e.push(n)}return e}u(Ps,"layoutToTileMap");function Bs(t){const e=new Map;for(const n of t){const i=Y(n.type);if(!i||!i.isDesk)continue;const r=n.row*16+i.sprite.length;for(let o=0;o<i.footprintH;o++)for(let a=0;a<i.footprintW;a++){const l=`${n.col+a},${n.row+o}`,c=e.get(l);(c===void 0||r>c)&&e.set(l,r)}}const s=[];for(let n=0;n<t.length;n++){const i=t[n],r=Y(i.type);if(!r)continue;const o=i.col*16,a=i.row*16;let l=a+r.sprite.length;if(r.category==="chairs"&&(r.orientation==="back"?l=(i.row+r.footprintH)*16+1:l=(i.row+1)*16),r.canPlaceOnSurfaces)for(let m=0;m<r.footprintH;m++)for(let f=0;f<r.footprintW;f++){const g=e.get(`${i.col+f},${i.row+m}`);g!==void 0&&g+.5>l&&(l=g+.5)}let c=r.sprite;if(i.color){const{h:m,s:f,b:g,c:v}=i.color;c=Jt(`furn-${i.type}-${m}-${f}-${g}-${v}-${i.color.colorize?1:0}`,r.sprite,i.color)}let d=!1;r.mirrorSide&&js(i.type)==="left"&&(d=!0),s.push({sprite:c,x:o,y:a,zY:l,sourceIndex:n,...d?{mirrored:!0}:{}})}return s}u(Bs,"layoutToFurnitureInstances");function Ds(t,e){const s=new Set;for(const n of t){const i=Y(n.type);if(!i)continue;const r=i.backgroundTiles||0;for(let o=0;o<i.footprintH;o++)if(!(o<r))for(let a=0;a<i.footprintW;a++){const l=`${n.col+a},${n.row+o}`;e&&e.has(l)||s.add(l)}}return s}u(Ds,"getBlockedTiles");function $s(t){switch(t){case"front":return S.DOWN;case"back":return S.UP;case"left":return S.LEFT;case"right":case"side":return S.RIGHT;default:return S.DOWN}}u($s,"orientationToFacing");function qt(t){const e=new Map,s=new Set;for(const i of t){const r=Y(i.type);if(!(!r||!r.isDesk))for(let o=0;o<r.footprintH;o++)for(let a=0;a<r.footprintW;a++)s.add(`${i.col+a},${i.row+o}`)}const n=[{dc:0,dr:-1,facing:S.UP},{dc:0,dr:1,facing:S.DOWN},{dc:-1,dr:0,facing:S.LEFT},{dc:1,dr:0,facing:S.RIGHT}];for(const i of t){const r=Y(i.type);if(!r||r.category!=="chairs")continue;let o=0;const a=r.backgroundTiles??0;for(let l=a;l<r.footprintH;l++)for(let c=0;c<r.footprintW;c++){const d=i.col+c,m=i.row+l;let f=S.DOWN;if(r.orientation)f=$s(r.orientation);else for(const v of n)if(s.has(`${d+v.dc},${m+v.dr}`)){f=v.facing;break}const g=o===0?i.uid:`${i.uid}:${o}`;e.set(g,{uid:g,seatCol:d,seatRow:m,facingDir:f,assigned:!1}),o++}}return e}u(qt,"layoutToSeats");var Ws={h:35,s:30,b:15,c:0},zs={h:25,s:45,b:5,c:10};function Hs(){const t=$.WALL,e=$.FLOOR_1,s=$.FLOOR_2,n=[],i=[];for(let r=0;r<11;r++)for(let o=0;o<20;o++)r===0||r===10||o===0||o===19?(n.push(t),i.push(null)):o<10?(n.push(e),i.push(Ws)):(n.push(s),i.push(zs));return{version:1,cols:20,rows:11,tiles:n,tileColors:i,furniture:[]}}u(Hs,"createDefaultLayout");var Ys="bubble-permission",Xs="Permission bubble: white square with '...' in amber, and a tail pointer (11x13)";var Gs={_:"",B:"#555566",F:"#EEEEFF",A:"#CCA700"},qs=[["B","B","B","B","B","B","B","B","B","B","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","A","F","A","F","A","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","B","B","B","B","B","B","B","B","B","B"],["_","_","_","_","B","B","B","_","_","_","_"],["_","_","_","_","_","B","_","_","_","_","_"],["_","_","_","_","_","_","_","_","_","_","_"]],Ks={name:Ys,description:Xs,width:11,height:13,palette:Gs,pixels:qs},Us="bubble-waiting",Vs="Waiting bubble: white square with green checkmark, and a tail pointer (11x13)";var Zs={_:"",B:"#555566",F:"#EEEEFF",G:"#44BB66"},Qs=[["_","B","B","B","B","B","B","B","B","B","_"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","G","F","B"],["B","F","F","F","F","F","F","G","F","F","B"],["B","F","F","G","F","F","G","F","F","F","B"],["B","F","F","F","G","G","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["B","F","F","F","F","F","F","F","F","F","B"],["_","B","B","B","B","B","B","B","B","B","_"],["_","_","_","_","B","B","B","_","_","_","_"],["_","_","_","_","_","B","_","_","_","_","_"],["_","_","_","_","_","_","_","_","_","_","_"]],Js={name:Us,description:Vs,width:11,height:13,palette:Zs,pixels:Qs};function pn(t){return t.pixels.map(e=>e.map(s=>t.palette[s]??s))}u(pn,"resolveBubbleSprite");var za=pn(Ks),Ha=pn(Js),ft=null;function ti(t){ft=t,Kt.clear()}u(ti,"setCharacterTemplates");function ei(){return ft?ft.length:6}u(ei,"getLoadedCharacterCount");function ni(t){return t.map(e=>[...e].reverse())}u(ni,"flipSpriteHorizontal");var Kt=new Map;function si(t,e){const s={h:e,s:0,b:0,c:0},n=u(o=>mn(o,s),"shift"),i=u(o=>[n(o[0]),n(o[1]),n(o[2]),n(o[3])],"shiftWalk"),r=u(o=>[n(o[0]),n(o[1])],"shiftPair");return{walk:{[S.DOWN]:i(t.walk[S.DOWN]),[S.UP]:i(t.walk[S.UP]),[S.RIGHT]:i(t.walk[S.RIGHT]),[S.LEFT]:i(t.walk[S.LEFT])},typing:{[S.DOWN]:r(t.typing[S.DOWN]),[S.UP]:r(t.typing[S.UP]),[S.RIGHT]:r(t.typing[S.RIGHT]),[S.LEFT]:r(t.typing[S.LEFT])},reading:{[S.DOWN]:r(t.reading[S.DOWN]),[S.UP]:r(t.reading[S.UP]),[S.RIGHT]:r(t.reading[S.RIGHT]),[S.LEFT]:r(t.reading[S.LEFT])}}}u(si,"hueShiftSprites");function ii(t,e){const s=[];for(let n=0;n<e;n++)s.push(new Array(t).fill(""));return s}u(ii,"emptySprite");function ri(t,e=0){const s=`${t}:${e}`,n=Kt.get(s);if(n)return n;let i;if(ft){const r=ft[t%ft.length],o=r.down,a=r.up,l=r.right,c=ni;i={walk:{[S.DOWN]:[o[0],o[1],o[2],o[1]],[S.UP]:[a[0],a[1],a[2],a[1]],[S.RIGHT]:[l[0],l[1],l[2],l[1]],[S.LEFT]:[c(l[0]),c(l[1]),c(l[2]),c(l[1])]},typing:{[S.DOWN]:[o[3],o[4]],[S.UP]:[a[3],a[4]],[S.RIGHT]:[l[3],l[4]],[S.LEFT]:[c(l[3]),c(l[4])]},reading:{[S.DOWN]:[o[5],o[6]],[S.UP]:[a[5],a[6]],[S.RIGHT]:[l[5],l[6]],[S.LEFT]:[c(l[5]),c(l[6])]}}}else{const r=ii(16,32),o=[r,r,r,r],a=[r,r];i={walk:{[S.DOWN]:o,[S.UP]:o,[S.RIGHT]:o,[S.LEFT]:o},typing:{[S.DOWN]:a,[S.UP]:a,[S.RIGHT]:a,[S.LEFT]:a},reading:{[S.DOWN]:a,[S.UP]:a,[S.RIGHT]:a,[S.LEFT]:a}}}return e!==0&&(i=si(i,e)),Kt.set(s,i),i}u(ri,"getCharacterSprites");var q=[];function oi(t){q=t}u(oi,"setWallSprites");function ai(){return q.length>0}u(ai,"hasWallSprites");function wn(t,e,s){const n=s.length,i=n>0?s[0].length:0;let r=0;return e>0&&s[e-1][t]===$.WALL&&(r|=1),t<i-1&&s[e][t+1]===$.WALL&&(r|=2),e<n-1&&s[e+1][t]===$.WALL&&(r|=4),t>0&&s[e][t-1]===$.WALL&&(r|=8),r}u(wn,"buildWallMask");function li(t,e,s,n=0){if(q.length===0)return null;const i=(q[n]??q[0])[wn(t,e,s)];return i?{sprite:i,offsetY:16-i.length}:null}u(li,"getWallSprite");function ci(t,e,s,n,i=0){if(q.length===0)return null;const r=q[i]??q[0],o=wn(t,e,s),a=r[o];if(!a)return null;const l=`wall-${i}-${o}-${n.h}-${n.s}-${n.b}-${n.c}`;return{sprite:Jt(l,a,{...n,colorize:!0}),offsetY:16-a.length}}u(ci,"getColorizedWallSprite");function ui(t,e,s){if(q.length===0)return[];const n=t.length,i=n>0?t[0].length:0,r=s??i,o=[];for(let a=0;a<n;a++)for(let l=0;l<i;l++){if(t[a][l]!==$.WALL)continue;const c=a*r+l,d=e?.[c],m=d?ci(l,a,t,d):li(l,a,t);m&&o.push({sprite:m.sprite,x:l*16,y:a*16+m.offsetY,zY:(a+1)*16})}return o}u(ui,"getWallInstances");function fi(t){const{h:e,s,b:n,c:i}=t;let r=.5;if(i!==0){const y=(100+i)/100;r=.5+(r-.5)*y}n!==0&&(r=r+n/200),r=Math.max(0,Math.min(1,r));const o=s/100,a=(1-Math.abs(2*r-1))*o,l=e/60,c=a*(1-Math.abs(l%2-1));let d=0,m=0,f=0;l<1?(d=a,m=c,f=0):l<2?(d=c,m=a,f=0):l<3?(d=0,m=a,f=c):l<4?(d=0,m=c,f=a):l<5?(d=c,m=0,f=a):(d=a,m=0,f=c);const g=r-a/2,v=u(y=>Math.max(0,Math.min(255,Math.round((y+g)*255))),"clamp");return`#${v(d).toString(16).padStart(2,"0")}${v(m).toString(16).padStart(2,"0")}${v(f).toString(16).padStart(2,"0")}`}u(fi,"wallColorToHex");var ot=16,Tt=32,Lt=7,le=16,ce=16,ue=32,fe=4,di=16,st="/pixels/",jt=null;function de(t){const e=[];for(let d=0;d<t.rows;d++)for(let m=0;m<t.cols;m++)t.tiles[d*t.cols+m]!==255&&e.push({col:m,row:d});if(e.length===0)return t;const s=Math.max(0,Math.min(...e.map(d=>d.col))-1),n=Math.min(t.cols-1,Math.max(...e.map(d=>d.col))+1),i=Math.max(0,Math.min(...e.map(d=>d.row))-1),r=Math.min(t.rows-1,Math.max(...e.map(d=>d.row))+1),o=n-s+1,a=r-i+1,l=[],c=t.tileColors?[]:void 0;for(let d=i;d<=r;d++)for(let m=s;m<=n;m++){const f=d*t.cols+m;l.push(t.tiles[f]),c?.push(t.tileColors?.[f]??null)}return{...t,cols:o,rows:a,tiles:l,tileColors:c,furniture:t.furniture.map(d=>({...d,col:d.col-s,row:d.row-i}))}}u(de,"trimLayoutToVisibleRoom");function hi(t,e,s){return{...t,tileColors:t.tiles.map(n=>n===0?s:n===255?null:e),furniture:t.furniture.map(n=>["DESK_FRONT","TABLE_FRONT","SMALL_TABLE_FRONT","SMALL_TABLE_SIDE","COFFEE_TABLE"].includes(n.type)?{...n,color:{h:150,s:18,b:-10,c:-20}}:n)}}u(hi,"recolorLayout");var he=5,me=[{floor:{h:145,s:16,b:-8,c:-35},wall:{h:270,s:18,b:-20,c:-45}},{floor:{h:60,s:20,b:-6,c:-30},wall:{h:310,s:22,b:-24,c:-40}},{floor:{h:200,s:18,b:-10,c:-32},wall:{h:20,s:20,b:-22,c:-42}},{floor:{h:95,s:22,b:-12,c:-28},wall:{h:240,s:16,b:-18,c:-48}}];function mi(t){const e=new Set;for(const l of t.furniture){const c=Y(l.type);if(c)for(let d=0;d<c.footprintH;d++)for(let m=0;m<c.footprintW;m++)e.add(`${l.col+m},${l.row+d}`)}const s=u((l,c)=>t.tiles[c*t.cols+l],"tileAt");let n=-1;for(let l=0;l<t.rows-1&&n<0;l++)for(let c=0;c<t.cols;c++){const d=s(c,l+1);if(s(c,l)===0&&d!==0&&d!==255){n=l;break}}const i=[];function r(l,c,d,m,f){for(let g=0;g<f;g++)for(let v=0;v<m;v++)e.add(`${c+v},${d+g}`);i.push({uid:`anchor-${l}`,type:l,col:c,row:d})}u(r,"claim");function o(l,c){const d=Y(l);if(n<1||!d)return!1;const m=d.footprintW,f=Array.from({length:t.cols-m+1},(g,v)=>v);c&&f.reverse();for(const g of f){let v=!0;for(let y=0;y<m&&v;y++)s(g+y,n)!==0&&(v=!1),e.has(`${g+y},${n}`)&&(v=!1),e.has(`${g+y},${n-1}`)&&(v=!1);if(v)return r(l,g,n-1,m,2),!0}return!1}u(o,"placeOnWall");function a(l,c){const d=Y(l);if(!d)return!1;const m=d.footprintW,f=d.footprintH;for(let g=t.rows-f;g>n;g--){const v=Array.from({length:t.cols-m+1},(y,p)=>p);c&&v.reverse();for(const y of v){let p=!0;for(let b=0;b<f&&p;b++)for(let x=0;x<m&&p;x++){const T=s(y+x,g+b);(T===0||T===255)&&(p=!1),e.has(`${y+x},${g+b}`)&&(p=!1)}if(p)return r(l,y,g,m,f),!0}}return!1}return u(a,"placeOnFloor"),o("KANBAN_BOARD",!1)||a("KANBAN_BOARD",!1),o("ALARM_LIGHT",!0)||a("ALARM_LIGHT",!0),a("MAILBOX",!1)||o("MAILBOX",!1),a("COIN_STACK",!0)||o("COIN_STACK",!0),i}u(mi,"placeAnchorFurniture");function gi(t,e){const s=qt(t.furniture).size,n=qt(e.furniture).size,i=50-s-n,r=s>0&&i>0?Math.ceil(i/s):1,o=[t,e];for(let A=0;A<r;A++){const w=me[A%me.length];o.push(hi(t,w.floor,w.wall))}const a=Math.max(0,Math.floor((t.rows-e.rows)/2)),l=o.map((A,w)=>({layout:A,offsetCol:0,offsetRow:w===1?a:0}));let c=0;for(const A of l)A.offsetCol=c,c+=A.layout.cols+he;c-=he;const d=Math.max(...l.map(A=>A.offsetRow+A.layout.rows)),m=Array(c*d).fill(255),f=Array(c*d).fill(null),g={h:214,s:30,b:-100,c:-55},v={h:32,s:20,b:-6,c:-42},y=9;for(const{layout:A,offsetCol:w,offsetRow:I}of l)for(let C=0;C<A.rows;C++)for(let k=0;k<A.cols;k++){const R=C*A.cols+k,F=(C+I)*c+k+w;m[F]=A.tiles[R],f[F]=A.tileColors?.[R]??null}const p=Math.floor(d/2),b={col:t.cols-1,row:p};for(let A=1;A<l.length;A++){const w=l[A-1],I=w.offsetCol+w.layout.cols-2,C=l[A].offsetCol+1;for(let k=p-1;k<=p+1;k++)for(let R=I;R<=C;R++){const F=k*c+R;m[F]=y,f[F]=v}for(let k=p-2;k<=p+2;k++){for(const R of[I+1,I+2,C-1,C]){const F=k*c+R;m[F]=y,f[F]=v}for(const R of[I-1,C+1]){const F=k*c+R;m[F]===255&&(m[F]=0,f[F]=g)}}}f[b.row*c+b.col]={h:32,s:20,b:-14,c:-42};const x=l.flatMap(({layout:A,offsetCol:w,offsetRow:I},C)=>A.furniture.map(k=>({...k,uid:`camera${C+1}-${k.uid}`,col:k.col+w,row:k.row+I})));x.push(...mi(t));const T=l.map(({layout:A,offsetCol:w,offsetRow:I})=>{let C=A.rows,k=-1,R=A.cols,F=-1;for(let j=0;j<A.rows;j++)for(let P=0;P<A.cols;P++)A.tiles[j*A.cols+P]!==255&&(j<C&&(C=j),j>k&&(k=j),P<R&&(R=P),P>F&&(F=P));if(k<0)return{col:w,row:I,cols:A.cols,rows:A.rows};const L=C>0?1:0;return{col:w+R,row:I+C-L,cols:F-R+1,rows:k-C+1+L}});return{layout:{version:1,cols:c,rows:d,layoutRevision:1,tiles:m,tileColors:f,spawnTile:b,furniture:x},cameraBounds:{office:T[0],boardroomKitchen:T[1],overflowOffice:T[2],rooms:T}}}u(gi,"combineLayouts");function pi(t,e,s,n){return n<2?"":`#${t.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${n===255?"":n.toString(16).padStart(2,"0")}`}u(pi,"rgbaToHex");function wi(t,e,s){const n=(s*t.width+e)*4;return pi(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3])}u(wi,"pixelAt");function dt(t,e,s,n=0,i=0){return Array.from({length:s},(r,o)=>Array.from({length:e},(a,l)=>wi(t,n+l,i+o)))}u(dt,"readSprite");async function Ft(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch ${t}`);const s=await createImageBitmap(await e.blob()),n=document.createElement("canvas");n.width=s.width,n.height=s.height;const i=n.getContext("2d");if(!i)throw new Error("Could not decode PNG");i.drawImage(s,0,0),s.close();const r=i.getImageData(0,0,n.width,n.height);return{width:n.width,height:n.height,data:r.data}}u(Ft,"decodePng");async function vi(t){return Promise.all(t.characters.map(async e=>{const s=await Ft(`${st}${e}`);return{down:Array.from({length:Lt},(n,i)=>dt(s,ot,Tt,i*ot,0)),up:Array.from({length:Lt},(n,i)=>dt(s,ot,Tt,i*ot,Tt)),right:Array.from({length:Lt},(n,i)=>dt(s,ot,Tt,i*ot,64))}}))}u(vi,"decodeCharacters");async function xi(t){return Promise.all(t.floors.map(async e=>dt(await Ft(`${st}${e}`),le,le)))}u(xi,"decodeFloors");async function yi(t){return Promise.all(t.walls.map(async e=>{const s=await Ft(`${st}${e}`);return Array.from({length:di},(n,i)=>dt(s,ce,ue,i%fe*ce,Math.floor(i/fe)*ue))}))}u(yi,"decodeWalls");async function bi(t){const e=await Promise.all(t.furniture.map(async s=>{const n=await Ft(`${st}${s.furniturePath}`);return[s.id,dt(n,s.width,s.height)]}));return Object.fromEntries(e)}u(bi,"decodeFurniture");async function Pt(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch ${t}`);return await e.json()}u(Pt,"fetchJson");function Ii(){return jt??=(async()=>{const t=await Pt(`${st}pixels-office-assets.json`),e=t.layouts??{office:t.defaultLayout,boardroomKitchen:t.defaultLayout},[s,n,i,r,o,a]=await Promise.all([vi(t),xi(t),yi(t),bi(t),Pt(`${st}${e.office}`).then(de),Pt(`${st}${e.boardroomKitchen}`).then(de)]);ti(s),Rs(n),oi(i),Os({catalog:t.furniture,sprites:r});const l=gi(o,a);return{layouts:{office:o,boardroomKitchen:a,combined:l.layout},cameraBounds:l.cameraBounds}})().catch(t=>{throw jt=null,t}),jt}u(Ii,"loadPixelAssets");var ge={kanban:"KANBAN_BOARD",mailbox:"MAILBOX",clock:"CLOCK",coins:"COIN_STACK",alarm:"ALARM_LIGHT"},Ai=6,pe=.4,we=1.18;function ve(t,e,s,n){return e*2>=n-s?Math.min(s+e,Math.max(n-e,t)):Math.min(n-e,Math.max(s+e,t))}u(ve,"clampAxis");var Ti=class{static{u(this,"Camera")}worldWidth;worldHeight;worldTop;centerX=0;centerY=0;zoom=1;followAgentId=null;viewportWidth=1;viewportHeight=1;dpr=1;offsetX=0;offsetY=0;targetX=0;targetY=0;tweening=!1;constructor(t,e,s=0){this.worldWidth=t,this.worldHeight=e,this.worldTop=s,this.centerX=t/2,this.centerY=(s+e)/2,this.targetX=this.centerX,this.targetY=this.centerY,this.recompute()}get minZoom(){return Math.max(1,Math.ceil(this.dpr))}get maxZoom(){return Math.max(this.minZoom,Math.round(Ai*this.dpr))}setViewport(t,e,s){this.viewportWidth=Math.max(1,t),this.viewportHeight=Math.max(1,e),this.dpr=s>0?s:1,this.setZoom(this.zoom)}setZoom(t){this.zoom=Math.min(this.maxZoom,Math.max(this.minZoom,Math.round(t))),this.recompute()}fitRoom(t){const e=t.cols*16,s=t.rows*16;let n=Math.max(1,Math.floor(Math.min(this.viewportWidth/e,this.viewportHeight/s)));for(;e*(n+1)<=this.viewportWidth*we&&s*(n+1)<=this.viewportHeight*we;)n+=1;this.zoom=Math.min(this.maxZoom,Math.max(this.minZoom,n)),this.centerX=(t.col+t.cols/2)*16,this.centerY=(t.row+t.rows/2)*16,this.targetX=this.centerX,this.targetY=this.centerY,this.tweening=!1,this.recompute()}panBy(t,e){this.followAgentId=null,this.tweening=!1,this.centerX-=t*this.dpr/this.zoom,this.centerY-=e*this.dpr/this.zoom,this.targetX=this.centerX,this.targetY=this.centerY,this.recompute()}zoomAt(t,e,s){if(s===0)return;const n=t*this.dpr,i=e*this.dpr,r=(n-this.offsetX)/this.zoom,o=(i-this.offsetY)/this.zoom,a=Math.min(this.maxZoom,Math.max(this.minZoom,this.zoom+Math.trunc(s)));a!==this.zoom&&(this.zoom=a,this.centerX=r-(n-this.viewportWidth/2)/a,this.centerY=o-(i-this.viewportHeight/2)/a,this.targetX=this.centerX,this.targetY=this.centerY,this.tweening=!1,this.recompute())}centerOn(t,e){this.targetX=t,this.targetY=e,this.tweening=!0}jumpTo(t,e){this.centerX=t,this.centerY=e,this.targetX=t,this.targetY=e,this.tweening=!1,this.recompute()}follow(t){this.followAgentId=t,t===null&&(this.tweening=!1)}update(t,e,s){if(this.followAgentId!==null&&e!==null&&s!==null&&(this.targetX=e,this.targetY=s,this.tweening=!0),!this.tweening)return!1;const n=1-Math.exp(-9*t);this.centerX+=(this.targetX-this.centerX)*n,this.centerY+=(this.targetY-this.centerY)*n;const i=Math.abs(this.targetX-this.centerX)<pe&&Math.abs(this.targetY-this.centerY)<pe;return i&&(this.centerX=this.targetX,this.centerY=this.targetY,this.tweening=this.followAgentId!==null),this.recompute(),!i}recompute(){const t=this.viewportWidth/(2*this.zoom),e=this.viewportHeight/(2*this.zoom);this.centerX=ve(this.centerX,t,0,this.worldWidth),this.centerY=ve(this.centerY,e,this.worldTop,this.worldHeight),this.offsetX=Math.round(this.viewportWidth/2-this.centerX*this.zoom),this.offsetY=Math.round(this.viewportHeight/2-this.centerY*this.zoom)}},vn=Number.POSITIVE_INFINITY,Ci=class{static{u(this,"GameLoop")}options;rafHandle=0;cancelSleep=null;lastTime=0;lastRender=0;plannedSleepSec=0;running=!1;interval;raf;cancelRaf;now;isHidden;frame=u(t=>{if(this.rafHandle=0,!this.running||this.isHidden())return;if(this.lastRender!==0&&t-this.lastRender<this.interval){this.scheduleFrame();return}const e=this.lastTime===0?0:(t-this.lastTime)/1e3,s=Math.max(oe,this.plannedSleepSec+oe);this.lastTime=t,this.lastRender=t,this.plannedSleepSec=0;const n=this.options.step(Math.min(e,s));if(this.options.render(),n<=0){this.scheduleFrame();return}if(n===vn)return;this.plannedSleepSec=n;const i=setTimeout(()=>{this.cancelSleep=null,this.wake()},n*1e3);this.cancelSleep=()=>{clearTimeout(i)}},"frame");constructor(t){this.options=t,this.interval=1e3/(t.fps??30)-1,this.raf=t.raf??(e=>requestAnimationFrame(e)),this.cancelRaf=t.cancelRaf??(e=>cancelAnimationFrame(e)),this.now=t.now??(()=>performance.now()),this.isHidden=t.isHidden??(()=>typeof document<"u"&&document.hidden)}get scheduled(){return this.rafHandle!==0||this.cancelSleep!==null}start(){this.running||(this.running=!0,this.lastTime=0,this.lastRender=0,this.scheduleFrame())}stop(){this.running=!1,this.rafHandle!==0&&(this.cancelRaf(this.rafHandle),this.rafHandle=0),this.cancelSleep?.(),this.cancelSleep=null}wake(){!this.running||this.isHidden()||(this.cancelSleep?.(),this.cancelSleep=null,this.rafHandle===0&&(this.lastRender=0,this.lastTime===0&&(this.lastTime=this.now()),this.scheduleFrame()))}scheduleFrame(){this.rafHandle===0&&(this.rafHandle=this.raf(this.frame))}},xe=16,Si=32;function _i(t,e,s,n){let i=null,r=Number.NEGATIVE_INFINITY;for(const o of s){const a=o.state===E.TYPE?6:0,l=o.x-xe/2,c=o.y+a;if(t<l||t>l+xe||e>c||e<c-Si)continue;const d=o.y+16/2+ln;d<=r||(r=d,i=o.id)}if(i!==null)return{kind:"agent",agentId:i};for(const o of n)if(!(t<o.x||t>o.x+o.width)&&!(e<o.y||e>o.y+o.height))return{kind:"object",object:o.kind};return null}u(_i,"hitTestWorld");var ki="#f5f5f5",Ri="#4ade80",Mi="rgba(255, 255, 255, 0.85)",Fi="rgba(12, 12, 16, 0.9)",Ei=class{static{u(this,"Minimap")}cache=null;cacheSource=null;cacheWidth=0;cacheHeight=0;draw(t,e,s,n,i,r){if(t.clearRect(0,0,e,s),t.fillStyle=Fi,t.fillRect(0,0,e,s),!n||n.width===0||n.height===0)return;const o=Math.min(e/n.width,s/n.height),a=Math.max(1,Math.floor(n.width*o)),l=Math.max(1,Math.floor(n.height*o)),c=Math.floor((e-a)/2),d=Math.floor((s-l)/2);if(!this.cache||this.cacheSource!==n.canvas||this.cacheWidth!==a||this.cacheHeight!==l){const p=this.cache??document.createElement("canvas");p.width=a,p.height=l;const b=p.getContext("2d");b.clearRect(0,0,a,l),b.imageSmoothingEnabled=!0,b.drawImage(n.canvas,0,0,a,l),this.cache=p,this.cacheSource=n.canvas,this.cacheWidth=a,this.cacheHeight=l}t.drawImage(this.cache,c,d);const m=Math.max(1,Math.round(o*6));for(const p of i.characters.values())t.fillStyle=p.isActive&&!p.still?Ri:ki,t.fillRect(c+Math.round(p.x*o)-(m>>1),d+Math.round((p.y-n.originY)*o)-(m>>1),m,m);const f=-r.offsetX/r.zoom,g=-r.offsetY/r.zoom-n.originY,v=r.width/r.zoom,y=r.height/r.zoom;t.strokeStyle=Mi,t.lineWidth=1,t.strokeRect(c+Math.round(f*o)+.5,d+Math.round(g*o)+.5,Math.max(2,Math.round(v*o)),Math.max(2,Math.round(y*o)))}},Oi=4096,Ni=class{static{u(this,"NavGrid")}cols;rows;walkableTiles=[];open;visitedStamp;parent;queue;cache=new Map;stamp=0;constructor(t,e){this.rows=t.length,this.cols=this.rows>0?t[0].length:0;const s=this.cols*this.rows;this.open=new Uint8Array(s),this.visitedStamp=new Int32Array(s),this.parent=new Int32Array(s),this.queue=new Int32Array(s);for(let n=0;n<this.rows;n++){const i=t[n];for(let r=0;r<this.cols;r++){const o=i[r];o===$.WALL||o===$.VOID||e.has(`${r},${n}`)||(this.open[n*this.cols+r]=1,this.walkableTiles.push({col:r,row:n}))}}}inBounds(t,e){return t>=0&&t<this.cols&&e>=0&&e<this.rows}isWalkable(t,e){return this.inBounds(t,e)?this.open[e*this.cols+t]===1:!1}setWalkable(t,e,s){if(!this.inBounds(t,e))return;const n=e*this.cols+t,i=s?1:0;this.open[n]!==i&&(this.open[n]=i,this.cache.clear())}findPath(t,e,s,n,i=!1,r=null){if(!this.inBounds(t,e)||!this.inBounds(s,n))return[];const o=e*this.cols+t,a=n*this.cols+s;if(o===a)return[];if(this.open[a]!==1&&!i)return[];const l=(o*this.open.length+a)*2+(i?1:0);if(r===null){const f=this.cache.get(l);if(f)return this.materialise(f)}if(!this.search(o,a,r))return[];let c=0;for(let f=a;f!==o;f=this.parent[f])c++;const d=new Int32Array(c);let m=c-1;for(let f=a;f!==o;f=this.parent[f])d[m]=f,m--;return r===null&&(this.cache.size>=Oi&&this.cache.clear(),this.cache.set(l,d)),this.materialise(d)}nearestOpen(t,e,s){if(!this.inBounds(t,e))return null;this.stamp++;const{open:n,visitedStamp:i,queue:r,cols:o}=this,a=n.length,l=e*o+t;i[l]=this.stamp,r[0]=l;let c=0,d=1;for(;c<d;){const m=r[c];c++;const f=m%o,g=(m-f)/o;if(n[m]===1&&s(f,g))return{col:f,row:g};for(let v=0;v<4;v++){let y;if(v===0){if(y=m-o,y<0)continue}else if(v===1){if(y=m+o,y>=a)continue}else if(v===2){if(f===0)continue;y=m-1}else{if(f===o-1)continue;y=m+1}i[y]!==this.stamp&&n[y]===1&&(i[y]=this.stamp,r[d]=y,d++)}}return null}search(t,e,s){this.stamp++;const{open:n,visitedStamp:i,parent:r,queue:o,cols:a}=this,l=n.length;i[t]=this.stamp,o[0]=t;let c=0,d=1;for(;c<d;){const m=o[c];if(c++,m===e)return!0;const f=m%a;for(let g=0;g<4;g++){let v;if(g===0){if(v=m-a,v<0)continue}else if(g===1){if(v=m+a,v>=l)continue}else if(g===2){if(f===0)continue;v=m-1}else{if(f===a-1)continue;v=m+1}if(i[v]!==this.stamp&&!(n[v]!==1&&v!==e)&&!(s!==null&&s[v]===1&&v!==e)){if(i[v]=this.stamp,r[v]=m,v===e)return!0;o[d]=v,d++}}}return!1}materialise(t){const e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]={col:t[s]%this.cols,row:t[s]/this.cols|0};return e}},Li={Read:!0,Grep:!0,Glob:!0,WebFetch:!0,WebSearch:!0};function ji(t){return t!==null&&Li[t]===!0}u(ji,"isReadingTool");function Pi(t,e,s,n){const i=s-t,r=n-e;return i>0?S.RIGHT:i<0?S.LEFT:r>0?S.DOWN:S.UP}u(Pi,"directionBetween");function Bi(t,e,s,n,i=0){const r=n?n.seatCol:1,o=n?n.seatRow:1;return{id:t,state:E.TYPE,dir:n?n.facingDir:S.DOWN,x:r*16+16/2,y:o*16+16/2,tileCol:r,tileRow:o,path:[],moveProgress:0,blockedTimer:0,currentTool:null,palette:e,hueShift:i,frame:0,frameTimer:0,wanderTimer:0,wanderCount:0,wanderLimit:Ut(3,6),isActive:!0,still:!1,pinned:!1,hop:0,seatId:s,bubbleType:null,bubbleTimer:0,seatTimer:0,inputTokens:0,outputTokens:0}}u(Bi,"createCharacter");function Di(t){return t.state===E.WALK?!0:t.state===E.TYPE?!t.still:!1}u(Di,"isCharacterAnimating");function $i(t,e,s,n,i){switch(t.frameTimer+=e,t.state){case E.TYPE:if(t.still?(t.frame=0,t.frameTimer=0):t.frameTimer>=.3&&(t.frameTimer-=xs,t.frame=(t.frame+1)%2),!t.isActive&&!t.pinned){if(t.seatTimer>0){t.seatTimer-=e;break}t.seatTimer=0,t.state=E.IDLE,t.frame=0,t.frameTimer=0,t.wanderTimer=Ct(2,20),t.wanderCount=0,t.wanderLimit=Ut(3,6)}break;case E.IDLE:if(t.frame=0,t.seatTimer<0&&(t.seatTimer=0),t.pinned)break;if(t.isActive){const r=t.seatId?n.get(t.seatId):void 0;if(!r){t.state=E.TYPE,t.frame=0,t.frameTimer=0;break}const o=s.findPath(t.tileCol,t.tileRow,r.seatCol,r.seatRow,!0);o.length>0?(t.path=o,t.moveProgress=0,t.state=E.WALK):(t.state=E.TYPE,t.dir=r.facingDir),t.frame=0,t.frameTimer=0;break}if(t.wanderTimer-=e,t.wanderTimer<=0){t.wanderCount>=t.wanderLimit&&(t.wanderCount=0,t.wanderLimit=Ut(3,6));const r=s.walkableTiles;let o=null;for(let a=0;a<8&&r.length>0;a++){const l=r[Math.floor(Math.random()*r.length)];if(i.isFreeFor(t.id,l.col,l.row)){o=l;break}}if(o){const a=s.findPath(t.tileCol,t.tileRow,o.col,o.row);a.length>0&&(t.path=a,t.moveProgress=0,t.state=E.WALK,t.frame=0,t.frameTimer=0,t.wanderCount++)}t.wanderTimer=Ct(2,20)}break;case E.WALK:{if(t.frameTimer>=.15&&(t.frameTimer-=vs,t.frame=(t.frame+1)%4),t.path.length===0){t.x=t.tileCol*16+16/2,t.y=t.tileRow*16+16/2;const m=t.seatId?n.get(t.seatId):void 0;m&&t.tileCol===m.seatCol&&t.tileRow===m.seatRow&&m?(t.state=E.TYPE,t.dir=m.facingDir):t.isActive&&!t.pinned&&!m?t.state=E.TYPE:t.isActive&&!t.pinned?t.state=E.IDLE:(t.state=E.IDLE,t.wanderTimer=Ct(2,20)),t.frame=0,t.frameTimer=0;break}const r=t.path[0];if(t.dir=Pi(t.tileCol,t.tileRow,r.col,r.row),t.moveProgress===0&&!i.claim(t.id,r.col,r.row)){if(t.blockedTimer+=e,t.frame=1,t.blockedTimer<.6)break;const m=t.path[t.path.length-1],f=t.seatId?n.get(t.seatId):void 0,g=f!==void 0&&f.seatCol===m.col&&f.seatRow===m.row,v=i.isFreeFor(t.id,m.col,m.row)?s.findPath(t.tileCol,t.tileRow,m.col,m.row,g,i.blockedFor(t.id)):[];v.length>0?(t.path=v,t.blockedTimer=0):t.blockedTimer>=3&&(t.path=[],t.blockedTimer=0,t.state=E.IDLE,t.wanderTimer=Ct(.5,2),t.frame=0,t.frameTimer=0);break}t.blockedTimer=0,t.moveProgress+=48/16*e;const o=t.tileCol*16+16/2,a=t.tileRow*16+16/2,l=r.col*16+16/2,c=r.row*16+16/2,d=Math.min(t.moveProgress,1);t.x=o+(l-o)*d,t.y=a+(c-a)*d,t.moveProgress>=1&&(i.release(t.id,t.tileCol,t.tileRow),t.tileCol=r.col,t.tileRow=r.row,t.x=l,t.y=c,t.path.shift(),t.moveProgress=0);break}}}u($i,"updateCharacter");function Wi(t,e){switch(t.state){case E.TYPE:return ji(t.currentTool)?e.reading[t.dir][t.frame%2]:e.typing[t.dir][t.frame%2];case E.WALK:return e.walk[t.dir][t.frame%4];default:return e.walk[t.dir][1]}}u(Wi,"getCharacterSprite");function Ct(t,e){return t+Math.random()*(e-t)}u(Ct,"randomRange");function Ut(t,e){return t+Math.floor(Math.random()*(e-t+1))}u(Ut,"randomInt");var zi=2,at=new Map,ye=new WeakMap;function Hi(t){const e=ye.get(t);if(e)return e;const s=t.length,n=t[0].length,i=[];for(let r=0;r<s+2;r++)i.push(new Array(n+2).fill(""));for(let r=0;r<s;r++)for(let o=0;o<n;o++){if(t[r][o]==="")continue;const a=r+1,l=o+1;i[a-1][l]===""&&(i[a-1][l]="#FFFFFF"),i[a+1][l]===""&&(i[a+1][l]="#FFFFFF"),i[a][l-1]===""&&(i[a][l-1]="#FFFFFF"),i[a][l+1]===""&&(i[a][l+1]="#FFFFFF")}for(let r=0;r<s;r++)for(let o=0;o<n;o++)t[r][o]!==""&&(i[r+1][o+1]="");return ye.set(t,i),i}u(Hi,"getOutlineSprite");function wt(t,e){let s=at.get(e);for(s?at.delete(e):s=new WeakMap,at.set(e,s);at.size>zi;){const l=at.keys().next();if(l.done)break;at.delete(l.value)}const n=s.get(t);if(n)return n;const i=t.length,r=t[0].length,o=document.createElement("canvas");o.width=r*e,o.height=i*e;const a=o.getContext("2d");a.imageSmoothingEnabled=!1;for(let l=0;l<i;l++)for(let c=0;c<r;c++){const d=t[l][c];d!==""&&(a.fillStyle=d,a.fillRect(c*e,l*e,e,e))}return s.set(t,o),o}u(wt,"getCachedSprite");var be=16,Yi=32;function Xi(t,e,s){const n=new Set;for(const r of s)n.add(r.seatRow*e.cols+r.seatCol);const i=new Uint8Array(t.length);for(let r=0;r<t.length;r++){const o=t[r],a=o.x,l=o.x+o.sprite[0].length,c=o.y,d=o.y+o.sprite.length,m=Math.max(0,Math.floor(a/16)-1),f=Math.min(e.cols-1,Math.ceil(l/16)),g=Math.max(0,Math.floor(c/16)-1),v=Math.min(e.rows-1,Math.ceil(d/16)+2);for(let y=g;y<=v&&i[r]===0;y++)for(let p=m;p<=f;p++){if(!e.isWalkable(p,y)&&!n.has(y*e.cols+p)||y*16+16/2+.5>=o.zY)continue;const b=p*16+16/2-be/2,x=y*16+16/2+6,T=x-Yi;if(!(b>=l||b+be<=a)&&!(T>=d||x<=c)){i[r]=1;break}}}return qi(t,i),i}u(Xi,"classifyOccluders");function Gi(t,e){return t.x<e.x+e.sprite[0].length&&e.x<t.x+t.sprite[0].length&&t.y<e.y+e.sprite.length&&e.y<t.y+t.sprite.length}u(Gi,"spriteOverlaps");function qi(t,e){const s=[];for(let n=0;n<t.length;n++)e[n]===1&&s.push(n);for(let n=0;n<s.length;n++){const i=t[s[n]];for(let r=0;r<t.length;r++){if(e[r]===1)continue;const o=t[r];o.zY<=i.zY||!Gi(o,i)||(e[r]=1,s.push(r))}}}u(qi,"liftStackedItems");function Vt(t){let e=0;for(const s of t)s.y<e&&(e=Math.floor(s.y));return e}u(Vt,"drawablesTop");function Ki(t,e,s){const n=Vt(s),i=t.cols*16,r=t.rows*16-n,o=document.createElement("canvas");o.width=i,o.height=r;const a=o.getContext("2d");a.imageSmoothingEnabled=!1,a.translate(0,-n),Ui(a,e,t.tileColors,t.cols);const l=s.map((c,d)=>d);l.sort((c,d)=>s[c].zY-s[d].zY);for(const c of l){const d=s[c],m=wt(d.sprite,1);d.mirrored?(a.save(),a.translate(d.x+m.width,d.y),a.scale(-1,1),a.drawImage(m,0,0),a.restore()):a.drawImage(m,d.x,d.y)}return{canvas:o,width:i,height:r,originY:n}}u(Ki,"buildStaticLayer");function Ui(t,e,s,n){const i=Fs();for(let r=0;r<e.length;r++){const o=e[r];for(let a=0;a<o.length;a++){const l=o[a];if(l===$.VOID)continue;const c=r*n+a;if(l===$.WALL||!i){if(l===$.WALL){const m=s?.[c];t.fillStyle=m?fi(m):As}else t.fillStyle=cn;t.fillRect(a*16,r*16,16,16);continue}const d=s?.[c]??{h:0,s:0,b:0,c:0};t.drawImage(wt(Es(l,d),1),a*16,r*16)}}}u(Ui,"drawTiles");var Vi=class{static{u(this,"TileClaims")}cols;owners=new Map;mask;constructor(t,e){this.cols=t,this.mask=new Uint8Array(t*e)}isFreeFor(t,e,s){const n=this.owners.get(s*this.cols+e);return n===void 0||n===t}claim(t,e,s){const n=s*this.cols+e,i=this.owners.get(n);return i!==void 0&&i!==t?!1:(this.owners.set(n,t),!0)}release(t,e,s){const n=s*this.cols+e;this.owners.get(n)===t&&this.owners.delete(n)}releaseAll(t){for(const[e,s]of this.owners)s===t&&this.owners.delete(e)}blockedFor(t){this.mask.fill(0);for(const[e,s]of this.owners)s!==t&&(this.mask[e]=1);return this.mask}},Zi=class{static{u(this,"OfficeState")}layout;tileMap;seats;blockedTiles;nav;claims;staticFurniture=[];dynamicFurniture=[];switchable=[];characters=new Map;furnitureAnimTimer=0;selectedAgentId=null;hoveredAgentId=null;autoOnTiles=new Set;constructor(t){this.layout=t||Hs(),this.tileMap=Ps(this.layout),this.seats=qt(this.layout.furniture),this.blockedTiles=Ds(this.layout.furniture),this.nav=new Ni(this.tileMap,this.blockedTiles),this.claims=new Vi(this.nav.cols,this.nav.rows),this.buildFurniture()}getLayout(){return this.layout}buildFurniture(){const t=this.layout.furniture,e=[],s=[];for(const c of t){const d=Ns(c.type);if(d===c.type){s.push(null);continue}const m=Ls(d)??[d],f=e.length;for(const g of m)e.push({...c,uid:`${c.uid}:on:${g}`,type:g});s.push({start:f,count:m.length})}const n=Bs([...t,...e]),i=new Array(t.length).fill(null),r=new Array(e.length).fill(null);for(const c of n){const d=c.sourceIndex??0;d<t.length?i[d]=c:r[d-t.length]=c}const o=[];this.switchable=[];for(let c=0;c<t.length;c++){const d=i[c];if(!d)continue;const m=s[c];if(!m){o.push(d);continue}const f=[];for(let g=0;g<m.count;g++){const v=r[m.start+g];v&&f.push(v)}this.switchable.push({off:d,on:f.length>0?f:[d],tiles:this.footprintTiles(t[c])})}const a=ai()?ui(this.tileMap,this.layout.tileColors,this.layout.cols):[];a.length>0&&o.push(...a);const l=Xi(o,this.nav,this.seats.values());this.staticFurniture=[],this.dynamicFurniture=[];for(let c=0;c<o.length;c++)l[c]===1?this.dynamicFurniture.push(o[c]):this.staticFurniture.push(o[c])}footprintTiles(t){const e=Y(t.type),s=[];if(!e)return s;for(let n=0;n<e.footprintH;n++)for(let i=0;i<e.footprintW;i++)s.push((t.row+n)*this.layout.cols+t.col+i);return s}getSpawnTile(){const t=this.layout.spawnTile;return t&&this.nav.isWalkable(t.col,t.row)?t:this.nav.walkableTiles[0]??{col:1,row:1}}findFreeSeat(){const t=new Set;for(const n of this.layout.furniture){const i=Y(n.type);if(!(!i||i.category!=="electronics"))for(let r=0;r<i.footprintH;r++)for(let o=0;o<i.footprintW;o++)t.add(`${n.col+o},${n.row+r}`)}const e=[],s=[];for(const[n,i]of this.seats){if(i.assigned)continue;let r=!1;const o=i.facingDir===S.RIGHT?1:i.facingDir===S.LEFT?-1:0,a=i.facingDir===S.DOWN?1:i.facingDir===S.UP?-1:0;for(let l=1;l<=3&&!r;l++){const c=i.seatCol+o*l,d=i.seatRow+a*l;if(t.has(`${c},${d}`)){r=!0;break}if(o!==0){if(t.has(`${c},${d-1}`)||t.has(`${c},${d+1}`)){r=!0;break}}else if(t.has(`${c-1},${d}`)||t.has(`${c+1},${d}`)){r=!0;break}}(r?e:s).push(n)}return e.length>0?e[Math.floor(Math.random()*e.length)]:s.length>0?s[Math.floor(Math.random()*s.length)]:null}pickDiversePalette(){const t=ei(),e=new Array(t).fill(0);for(const o of this.characters.values())o.palette<t&&e[o.palette]++;const s=Math.min(...e),n=[];for(let o=0;o<t;o++)e[o]===s&&n.push(o);const i=n[Math.floor(Math.random()*n.length)];let r=0;return s>0&&(r=45+Math.floor(Math.random()*271)),{palette:i,hueShift:r}}addAgent(t,e={}){if(this.characters.has(t))return;const s=e.pose;let n,i;if(s)n=s.palette,i=s.hueShift;else if(e.palette!==void 0)n=e.palette,i=e.hueShift??0;else{const d=this.pickDiversePalette();n=d.palette,i=d.hueShift}const r=s?.seatId??e.seatId;let o=null;if(r){const d=this.seats.get(r);d&&!d.assigned&&(o=r)}const a=o!==null;o||(o=this.findFreeSeat());const l=o?this.seats.get(o):null;l&&(l.assigned=!0);const c=Bi(t,n,o,l,i);if(s)c.tileCol=s.tileCol,c.tileRow=s.tileRow,c.x=s.x,c.y=s.y,c.dir=s.dir,c.state=s.state===E.WALK?E.IDLE:s.state,s.state===E.WALK&&this.snapToTile(c,c.tileCol,c.tileRow);else if(!a){const d=this.getSpawnTile();this.snapToTile(c,d.col,d.row),c.state=E.IDLE,c.dir=S.DOWN,c.wanderTimer=Math.random()*3}if(!this.claims.claim(t,c.tileCol,c.tileRow)){const d=this.nav.nearestOpen(c.tileCol,c.tileRow,(m,f)=>this.claims.isFreeFor(t,m,f));d&&(this.snapToTile(c,d.col,d.row),c.state===E.TYPE&&(c.state=E.IDLE),this.claims.claim(t,d.col,d.row))}this.characters.set(t,c)}removeAgent(t){const e=this.characters.get(t);if(e){if(e.seatId){const s=this.seats.get(e.seatId);s&&(s.assigned=!1)}this.selectedAgentId===t&&(this.selectedAgentId=null),this.hoveredAgentId===t&&(this.hoveredAgentId=null),this.claims.releaseAll(t),this.characters.delete(t),this.rebuildAutoOnTiles()}}walkToTile(t,e,s){const n=this.characters.get(t);if(!n)return!1;const i=n.seatId?this.seats.get(n.seatId):void 0,r=i?i.seatCol===e&&i.seatRow===s:!1;if(!this.nav.isWalkable(e,s)&&!r)return!1;let o={col:e,row:s};if(!this.claims.isFreeFor(t,e,s)){const l=this.nav.nearestOpen(e,s,(c,d)=>this.claims.isFreeFor(t,c,d));if(!l)return!1;o=l}const a=this.nav.findPath(n.tileCol,n.tileRow,o.col,o.row,r);return a.length===0?!1:(this.settleClaims(n),n.path=a,n.moveProgress=0,n.state=E.WALK,n.frame=0,n.frameTimer=0,!0)}setAgentActive(t,e){const s=this.characters.get(t);!s||s.isActive===e||(s.isActive=e,e||(s.seatTimer=-1,this.settleClaims(s),s.path=[],s.moveProgress=0),this.rebuildAutoOnTiles())}setAgentStill(t,e){const s=this.characters.get(t);!s||s.still===e||(s.still=e,this.rebuildAutoOnTiles())}snapToTile(t,e,s){t.tileCol=e,t.tileRow=s,t.x=e*16+16/2,t.y=s*16+16/2}settleClaims(t){if(t.moveProgress>0&&t.path.length>0){const e=t.path[0];this.claims.release(t.id,t.tileCol,t.tileRow),this.snapToTile(t,e.col,e.row)}this.claims.releaseAll(t.id),this.claims.claim(t.id,t.tileCol,t.tileRow)}setAgentPinned(t,e){const s=this.characters.get(t);s&&(s.pinned=e)}rebuildAutoOnTiles(){this.autoOnTiles.clear();const t=this.layout.cols;for(const e of this.characters.values()){if(!e.isActive||e.still||!e.seatId)continue;const s=this.seats.get(e.seatId);if(!s)continue;const n=s.facingDir===S.RIGHT?1:s.facingDir===S.LEFT?-1:0,i=s.facingDir===S.DOWN?1:s.facingDir===S.UP?-1:0;for(let r=1;r<=3;r++)this.autoOnTiles.add((s.seatRow+i*r)*t+s.seatCol+n*r);for(let r=1;r<=2;r++){const o=s.seatCol+n*r,a=s.seatRow+i*r;n!==0?(this.autoOnTiles.add((a-1)*t+o),this.autoOnTiles.add((a+1)*t+o)):(this.autoOnTiles.add(a*t+o-1),this.autoOnTiles.add(a*t+o+1))}}}resolveSwitchable(t){const e=this.switchable[t];let s=!1;for(const i of e.tiles)if(this.autoOnTiles.has(i)){s=!0;break}if(!s)return e.off;const n=Math.floor(this.furnitureAnimTimer/Ts);return e.on[n%e.on.length]}isSwitchableAnimating(){return this.autoOnTiles.size>0}setAgentTool(t,e){const s=this.characters.get(t);s&&(s.currentTool=e)}showWaitingBubble(t){const e=this.characters.get(t);e&&(e.bubbleType="waiting",e.bubbleTimer=2)}startHop(t){const e=this.characters.get(t);e&&(e.hop=un)}update(t){this.furnitureAnimTimer+=t;let e=this.isSwitchableAnimating();for(const s of this.characters.values())$i(s,t,this.nav,this.seats,this.claims),Di(s)&&(e=!0),s.hop>0&&(s.hop=Math.max(0,s.hop-t),e=!0),s.bubbleType==="waiting"&&(s.bubbleTimer-=t,e=!0,s.bubbleTimer<=0&&(s.bubbleType=null,s.bubbleTimer=0));return e}nextWakeSeconds(){let t=Number.POSITIVE_INFINITY;for(const e of this.characters.values())e.pinned||(e.state===E.IDLE&&!e.isActive?t=Math.min(t,Math.max(0,e.wanderTimer)):e.state===E.TYPE&&!e.isActive&&(t=Math.min(t,Math.max(0,e.seatTimer))));return t}},xn="pixels-office:v2:",Qi=2e3;function yn(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}u(yn,"storage");function Ji(t){const e=Object.values(E).find(n=>n===t.s),s=Object.values(S).find(n=>n===t.d);return!e||s===void 0||!Number.isFinite(t.x)||!Number.isFinite(t.y)?null:{tileCol:t.c,tileRow:t.r,x:t.x,y:t.y,dir:s,state:e,palette:t.p,hueShift:t.h,seatId:t.seat}}u(Ji,"toRestoredPose");function tr(t){const e=new Map,s=yn();if(!s)return e;const n=s.getItem(xn+t);if(!n)return e;let i;try{i=JSON.parse(n)}catch{return e}if(i?.v!==2||typeof i.poses!="object")return e;for(const[r,o]of Object.entries(i.poses)){const a=Ji(o);a&&e.set(r,a)}return e}u(tr,"loadStoredPoses");function Ie(t,e){const s=yn();if(!s)return;const n={};for(const r of e)n[r.id]={c:r.tileCol,r:r.tileRow,x:r.x,y:r.y,d:r.dir,s:r.state,p:r.palette,h:r.hueShift,seat:r.seatId};const i={v:2,poses:n};try{s.setItem(xn+t,JSON.stringify(i))}catch{return}}u(Ie,"storePoses");var er=class{static{u(this,"PoseFlusher")}companyId;collect;cancelTimer=null;onPageHide=u(()=>{this.flushNow()},"onPageHide");constructor(t,e){this.companyId=t,this.collect=e,typeof window<"u"&&window.addEventListener("pagehide",this.onPageHide)}schedule(){if(this.cancelTimer!==null)return;const t=setTimeout(()=>{this.cancelTimer=null,Ie(this.companyId,this.collect())},Qi);this.cancelTimer=()=>{clearTimeout(t)}}flushNow(){this.cancelTimer?.(),this.cancelTimer=null,Ie(this.companyId,this.collect())}dispose(){this.cancelTimer?.(),this.cancelTimer=null,typeof window<"u"&&window.removeEventListener("pagehide",this.onPageHide)}},nr=class{static{u(this,"SceneRenderer")}capacity=0;sprites=[];drawX=new Float64Array(0);drawY=new Float64Array(0);depth=new Float64Array(0);alpha=new Float64Array(0);mirrored=new Uint8Array(0);order=new Int32Array(0);buckets=new Int32Array(0);count=0;render(t,e,s,n){t.clearRect(0,0,n.width,n.height),s&&sr(t,s,n),this.count=0;for(const i of e.dynamicFurniture)this.pushInstance(i,n);for(let i=0;i<e.switchable.length;i++)this.pushInstance(e.resolveSwitchable(i),n);for(const i of e.characters.values()){const r=Wi(i,ri(i.palette,i.hueShift)),o=wt(r,n.zoom),a=i.state===E.TYPE?6:0,l=i.hop>0?Math.sin((1-i.hop/un)*Math.PI)*7:0,c=Math.round(n.offsetX+i.x*n.zoom-o.width/2),d=Math.round(n.offsetY+(i.y+a-l)*n.zoom-o.height);if(c>n.width||c+o.width<0||d>n.height||d+o.height<0)continue;const m=i.y+16/2+ln,f=e.selectedAgentId===i.id,g=e.hoveredAgentId===i.id;if(f||g){const v=wt(Hi(r),n.zoom);this.push(v,c-n.zoom,d-n.zoom,m-ys,f?1:bs,!1)}this.push(o,c,d,m,1,!1)}this.sortByDepth();for(let i=0;i<this.count;i++){const r=this.order[i],o=this.sprites[r],a=this.alpha[r],l=a<1;l&&(t.save(),t.globalAlpha=a),this.mirrored[r]===1?(t.save(),t.translate(this.drawX[r]+o.width,this.drawY[r]),t.scale(-1,1),t.drawImage(o,0,0),t.restore()):t.drawImage(o,this.drawX[r],this.drawY[r]),l&&t.restore()}}sortByDepth(){const t=this.count;let e=0;for(let n=0;n<t;n++){const i=this.depth[n]|0;i>e&&(e=i)}this.buckets.length<e+2&&(this.buckets=new Int32Array(e+128)),this.order.length<t&&(this.order=new Int32Array(this.capacity));const s=this.buckets;s.fill(0,0,e+2);for(let n=0;n<t;n++)s[(this.depth[n]|0)+1]++;for(let n=1;n<=e+1;n++)s[n]+=s[n-1];for(let n=0;n<t;n++){const i=this.depth[n]|0;this.order[s[i]]=n,s[i]++}}pushInstance(t,e){const s=wt(t.sprite,e.zoom),n=e.offsetX+t.x*e.zoom,i=e.offsetY+t.y*e.zoom;n>e.width||n+s.width<0||i>e.height||i+s.height<0||this.push(s,n,i,t.zY,1,t.mirrored===!0)}push(t,e,s,n,i,r){this.count===this.capacity&&this.grow(),this.sprites[this.count]=t,this.drawX[this.count]=e,this.drawY[this.count]=s,this.depth[this.count]=n,this.alpha[this.count]=i,this.mirrored[this.count]=r?1:0,this.count++}grow(){const t=this.capacity===0?256:this.capacity*2,e=new Float64Array(t),s=new Float64Array(t),n=new Float64Array(t),i=new Float64Array(t),r=new Uint8Array(t);e.set(this.drawX),s.set(this.drawY),n.set(this.depth),i.set(this.alpha),r.set(this.mirrored),this.drawX=e,this.drawY=s,this.depth=n,this.alpha=i,this.mirrored=r,this.sprites.length=t,this.capacity=t}};function sr(t,e,s){const n=s.offsetY+e.originY*s.zoom,i=Math.max(0,Math.floor(-s.offsetX/s.zoom)),r=Math.max(0,Math.floor(-n/s.zoom)),o=Math.min(e.width,Math.ceil((s.width-s.offsetX)/s.zoom)),a=Math.min(e.height,Math.ceil((s.height-n)/s.zoom)),l=o-i,c=a-r;l<=0||c<=0||t.drawImage(e.canvas,i,r,l,c,s.offsetX+i*s.zoom,n+r*s.zoom,l*s.zoom,c*s.zoom)}u(sr,"blitStaticLayer");var ir=3,rr=25,or=class{static{u(this,"OfficeControllerImpl")}companyId;worldWidth;worldHeight;state;cameraState;renderer=new nr;minimap=new Ei;loop;flusher;visuals=new Map;listeners=new Set;visits=new Map;objectBoxes=[];anchors=new Map;officeRoom;view={zoom:1,offsetX:0,offsetY:0,width:0,height:0,nowMs:0};renderedFrames=0;get frameCount(){return this.renderedFrames}poseScratch={agentId:"",x:0,y:0,moving:!1,seated:!1};onVisibilityChange=u(()=>{typeof document<"u"&&!document.hidden&&this.loop.wake()},"onVisibilityChange");overlays=[];canvas=null;ctx=null;resizeObserver=null;staticLayer=null;syncKey="";fitted=!1;rooms;constructor(t,e,s){this.companyId=t,this.state=new Zi(e),this.worldWidth=e.cols*16,this.worldHeight=e.rows*16,this.officeRoom=s.office,this.rooms=s.rooms.map((n,i)=>({id:i===0?"office":i===1?"boardroom":`overflow-${i-1}`,label:i===0?"Office":i===1?"Boardroom & Kitchen":`Overflow ${i-1}`,centerX:(n.col+n.cols/2)*16,centerY:(n.row+n.rows/2)*16})),this.cameraState=new Ti(this.worldWidth,this.worldHeight,Math.min(Vt(this.state.staticFurniture),Vt(this.state.dynamicFurniture))),this.collectObjects(e),this.flusher=new er(t,()=>this.state.characters.values()),this.loop=new Ci({step:u(n=>this.step(n),"step"),render:u(()=>this.render(),"render")})}collectObjects(t){const e=Object.keys(ge);for(const s of e){const n=ge[s],i=t.furniture.find(d=>d.type===n);if(!i)continue;const r=Y(n);if(!r)continue;const o=i.col*16,a=i.row*16,l=r.footprintW*16,c=r.sprite.length;this.objectBoxes.push({kind:s,x:o,y:a,width:l,height:c}),this.anchors.set(s,{x:o+l/2,y:a})}}syncAgents(t,e){let s="";for(const o of t)s+=`${o.agentId}:${o.status}:${o.working?1:0}:${o.activity?.icon??"-"};`;for(const o of e)s+=`${o.agentId}@${o.seatId};`;if(s===this.syncKey){let o=!1;for(const a of t)this.visuals.get(a.agentId)!==a&&(this.visuals.set(a.agentId,a),o=!0);o&&this.loop.wake();return}this.syncKey=s;const n=new Map;for(const o of e)n.set(o.agentId,o);const i=this.visuals.size===0?tr(this.companyId):null,r=new Set;for(const o of t){if(r.add(o.agentId),this.visuals.set(o.agentId,o),!this.state.characters.has(o.agentId)){const a=n.get(o.agentId);this.state.addAgent(o.agentId,{palette:a?.characterIndex,seatId:a?.seatId,pose:i?.get(o.agentId)})}this.applyStatus(o)}for(const o of Array.from(this.state.characters.keys()))r.has(o)||(this.state.removeAgent(o),this.visuals.delete(o),this.visits.delete(o));this.loop.wake()}applyStatus(t){const e=t.status,s=e==="idle"&&!t.working,n=!t.working&&(e==="paused"||e==="budget_paused"||e==="error");this.state.setAgentActive(t.agentId,!s),this.state.setAgentStill(t.agentId,n);const i=t.activity?.icon==="read"&&!s&&!n;this.state.setAgentTool(t.agentId,i?"Read":null)}readPlacements(){const t=[];for(const[e,s]of this.state.characters)s.seatId&&t.push({agentId:e,characterIndex:s.palette,seatId:s.seatId});return t}visual(t){return this.visuals.get(t)}forEachPose(t){for(const e of this.state.characters.values())this.fillPose(this.poseScratch,e),t(this.poseScratch)}pose(t){const e=this.state.characters.get(t);if(e)return{agentId:e.id,x:e.x,y:e.y,moving:e.state===E.WALK,seated:e.state===E.TYPE}}fillPose(t,e){t.agentId=e.id,t.x=e.x,t.y=e.y,t.moving=e.state===E.WALK,t.seated=e.state===E.TYPE}objectAnchor(t){return this.anchors.get(t)}emit(t){if(t.kind==="celebrate")if(t.big)for(const e of this.state.characters.keys())this.state.startHop(e);else this.state.startHop(t.agentId);else t.kind==="visit"&&this.startVisit(t.fromAgentId,t.toAgentId);for(const e of this.listeners)e(t);this.loop.wake()}onEffect(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setOverlayLayers(t){this.overlays=t,this.loop.wake()}hitTest(t,e){const s=this.cameraState.dpr,n=(t*s-this.view.offsetX)/this.view.zoom,i=(e*s-this.view.offsetY)/this.view.zoom;return _i(n,i,this.state.characters.values(),this.objectBoxes)}select(t){this.state.selectedAgentId=t,this.loop.wake()}get selectedAgentId(){return this.state.selectedAgentId}hover(t){const e=t!==null&&t.kind==="agent"?t.agentId:null;e!==this.state.hoveredAgentId&&(this.state.hoveredAgentId=e,this.loop.wake())}get hoveredAgentId(){return this.state.hoveredAgentId}get camera(){return this.cameraState}panBy(t,e){this.fitted=!0,this.cameraState.panBy(t,e),this.loop.wake()}zoomAt(t,e,s){this.fitted=!0,this.cameraState.zoomAt(t,e,s),this.loop.wake()}centerOn(t,e){this.fitted=!0,this.cameraState.centerOn(t,e),this.loop.wake()}follow(t){this.fitted=!0,this.cameraState.follow(t),this.loop.wake()}drawMinimap(t,e,s){this.minimap.draw(t,e,s,this.staticLayer,this.state,this.view)}attach(t){if(this.canvas===t){this.loop.wake();return}this.canvas&&this.detach(),this.canvas=t,this.ctx=t.getContext("2d"),this.ctx&&(this.ctx.imageSmoothingEnabled=!1),this.staticLayer??=Ki(this.state.getLayout(),this.state.tileMap,this.state.staticFurniture),this.resize(),typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>{this.resize(),this.loop.wake()}),this.resizeObserver.observe(t)),typeof document<"u"&&document.addEventListener("visibilitychange",this.onVisibilityChange),this.loop.start()}detach(){this.loop.stop(),this.resizeObserver?.disconnect(),this.resizeObserver=null,typeof document<"u"&&document.removeEventListener("visibilitychange",this.onVisibilityChange),this.flusher.flushNow(),this.canvas=null,this.ctx=null}wake(){this.loop.wake()}dispose(){this.detach(),this.flusher.dispose(),this.listeners.clear()}resize(){const t=this.canvas;if(!t)return;const e=typeof window<"u"&&window.devicePixelRatio||1,s=t.getBoundingClientRect(),n=Math.max(1,Math.round((s.width||t.clientWidth)*e)),i=Math.max(1,Math.round((s.height||t.clientHeight)*e));t.width!==n&&(t.width=n),t.height!==i&&(t.height=i),this.ctx&&(this.ctx.imageSmoothingEnabled=!1),this.cameraState.setViewport(n,i,e),this.fitted||this.cameraState.fitRoom(this.officeRoom)}startVisit(t,e){if(this.visits.has(t)||t===e)return;const s=this.state.characters.get(e);if(!s)return;const n=this.freeTileNear(s.tileCol,s.tileRow);if(n){if(this.state.setAgentPinned(t,!0),!this.state.walkToTile(t,n.col,n.row)){this.state.setAgentPinned(t,!1);return}this.visits.set(t,{toAgentId:e,phase:"travelling",timer:rr})}}freeTileNear(t,e){const s=this.state.nav;for(let n=1;n<=3;n++)for(let i=-n;i<=n;i++)for(let r=-n;r<=n;r++)if(!(Math.abs(i)!==n&&Math.abs(r)!==n)&&s.isWalkable(t+r,e+i))return{col:t+r,row:e+i};return null}updateVisits(t){if(this.visits.size===0)return!1;for(const[e,s]of this.visits){const n=this.state.characters.get(e);if(!n){this.visits.delete(e);continue}if(s.timer-=t,s.phase==="travelling"){n.state!==E.WALK?(s.phase="lingering",s.timer=ir):s.timer<=0&&this.endVisit(e);continue}s.timer<=0&&this.endVisit(e)}return this.visits.size>0}endVisit(t){this.visits.delete(t),this.state.setAgentPinned(t,!1)}step(t){let e=this.state.update(t);this.updateVisits(t)&&(e=!0);const s=this.cameraState.followAgentId,n=s!==null?this.state.characters.get(s):void 0;this.cameraState.update(t,n?.x??null,n?.y??null)&&(e=!0);for(const r of this.overlays)r.update(t,this)&&(e=!0);if(this.flusher.schedule(),e)return 0;const i=this.state.nextWakeSeconds();return i===Number.POSITIVE_INFINITY?vn:Math.max(.05,i)}render(){const t=this.ctx,e=this.canvas;if(!(!t||!e)){this.renderedFrames+=1,this.view.zoom=this.cameraState.zoom,this.view.offsetX=this.cameraState.offsetX,this.view.offsetY=this.cameraState.offsetY,this.view.width=e.width,this.view.height=e.height,this.view.nowMs=Date.now(),this.renderer.render(t,this.state,this.staticLayer,this.view);for(const s of this.overlays)s.draw(t,this.view,this)}}},ar=3,tt=new Map,St=new Map;function lr(t){const e=tt.get(t);if(e)return Promise.resolve(e);const s=St.get(t);if(s)return s;const n=Ii().then(({layouts:i,cameraBounds:r})=>{St.delete(t);const o=tt.get(t);if(o)return o;const a=new or(t,i.combined,r);for(tt.set(t,a);tt.size>ar;){const l=tt.keys().next();if(l.done||l.value===t)break;tt.get(l.value)?.dispose(),tt.delete(l.value)}return a}).catch(i=>{throw St.delete(t),i});return St.set(t,n),n}u(lr,"getOfficeController");var cr=class{static{u(this,"ParticlePool")}capacity;x;y;vx;vy;life;maxLife;tint;count=0;constructor(t){this.capacity=t,this.x=new Float32Array(t),this.y=new Float32Array(t),this.vx=new Float32Array(t),this.vy=new Float32Array(t),this.life=new Float32Array(t),this.maxLife=new Float32Array(t),this.tint=new Uint8Array(t)}spawn(t,e,s,n,i,r){if(this.count>=this.capacity)return!1;const o=this.count;return this.x[o]=t,this.y[o]=e,this.vx[o]=s,this.vy[o]=n,this.life[o]=i,this.maxLife[o]=i,this.tint[o]=r,this.count+=1,!0}step(t,e,s){let n=0;for(;n<this.count;){const i=this.life[n]-t;if(i<=0){const r=this.count-1;this.x[n]=this.x[r],this.y[n]=this.y[r],this.vx[n]=this.vx[r],this.vy[n]=this.vy[r],this.life[n]=this.life[r],this.maxLife[n]=this.maxLife[r],this.tint[n]=this.tint[r],this.count=r;continue}this.life[n]=i,this.vy[n]+=e*t,this.vx[n]*=s,this.x[n]+=this.vx[n]*t,this.y[n]+=this.vy[n]*t,n+=1}return this.count>0}clear(){this.count=0}};var Ae=1.2,Te=.25;var ur=.985;var bn=["#f87171","#fbbf24","#34d399","#60a5fa","#c084fc","#f9fafb"],fr=class{static{u(this,"OfficeEffectState")}confetti=new cr(180);visits=Array.from({length:12},()=>({fromAgentId:"",toAgentId:"",ttl:0}));mentions=Array.from({length:12},()=>({agentId:"",ttl:0}));smokes=Array.from({length:8},()=>({agentId:"",ttl:0,frame:0,frameTimer:0}));cheers=Array.from({length:40},()=>({agentId:"",ttl:0}));stickyErrors=new Set;visitCount=0;mentionCount=0;smokeCount=0;cheerCount=0;alarmPhase=0;office;unsubscribe;bigCheerPending=!1;constructor(t){this.office=t,this.unsubscribe=t.onEffect(this.handleEffect)}dispose(){this.unsubscribe()}cheerPose=u(t=>{this.pushCheer(t.agentId)},"cheerPose");handleEffect=u(t=>{if(t.kind==="celebrate"){const s=this.office.pose(t.agentId);s&&this.burst(s.x,s.y-24,t.big?72:36),this.pushCheer(t.agentId),t.big&&(this.bigCheerPending=!0);return}if(t.kind==="error"){this.stickyErrors.add(t.agentId);for(let n=0;n<this.smokeCount;n+=1)if(this.smokes[n].agentId===t.agentId){this.smokes[n].ttl=6;return}if(this.smokeCount>=8)return;const s=this.smokes[this.smokeCount];s.agentId=t.agentId,s.ttl=6,s.frame=0,s.frameTimer=0,this.smokeCount+=1;return}if(t.kind==="visit"){for(let n=0;n<this.visitCount;n+=1){const i=this.visits[n];if(i.fromAgentId===t.fromAgentId){i.toAgentId=t.toAgentId,i.ttl=4;return}}if(this.visitCount>=12)return;const s=this.visits[this.visitCount];s.fromAgentId=t.fromAgentId,s.toAgentId=t.toAgentId,s.ttl=4,this.visitCount+=1;return}for(let s=0;s<this.mentionCount;s+=1)if(this.mentions[s].agentId===t.agentId){this.mentions[s].ttl=3;return}if(this.mentionCount>=12)return;const e=this.mentions[this.mentionCount];e.agentId=t.agentId,e.ttl=3,this.mentionCount+=1},"handleEffect");burst(t,e,s){for(let n=0;n<s;n+=1){const i=Math.random()*Math.PI*2,r=20+Math.random()*55;if(!this.confetti.spawn(t,e,Math.cos(i)*r,Math.sin(i)*r-40,.9+Math.random()*.8,Math.random()*bn.length|0))return}}pushCheer(t){for(let s=0;s<this.cheerCount;s+=1)if(this.cheers[s].agentId===t){this.cheers[s].ttl=Ae;return}if(this.cheerCount>=40)return;const e=this.cheers[this.cheerCount];e.agentId=t,e.ttl=Ae,this.cheerCount+=1}mentionTtl(t){for(let e=0;e<this.mentionCount;e+=1)if(this.mentions[e].agentId===t)return this.mentions[e].ttl;return 0}update(t){this.bigCheerPending&&(this.bigCheerPending=!1,this.office.forEachPose(this.cheerPose));const e=this.office.selectedAgentId;e!==null&&this.stickyErrors.delete(e);let s=this.confetti.step(t,90,ur),n=0;for(;n<this.visitCount;){const i=this.visits[n];if(i.ttl-=t,i.ttl<=0){const r=this.visitCount-1;this.visits[n]=this.visits[r],this.visits[r]=i,this.visitCount=r;continue}n+=1}for(this.visitCount>0&&(s=!0),n=0;n<this.mentionCount;){const i=this.mentions[n];if(i.ttl-=t,i.ttl<=0){const r=this.mentionCount-1;this.mentions[n]=this.mentions[r],this.mentions[r]=i,this.mentionCount=r;continue}n+=1}for(this.mentionCount>0&&(s=!0),n=0;n<this.cheerCount;){const i=this.cheers[n];if(i.ttl-=t,i.ttl<=0){const r=this.cheerCount-1;this.cheers[n]=this.cheers[r],this.cheers[r]=i,this.cheerCount=r;continue}n+=1}for(this.cheerCount>0&&(s=!0),n=0;n<this.smokeCount;){const i=this.smokes[n];if(i.ttl-=t,i.ttl<=0){const r=this.smokeCount-1;this.smokes[n]=this.smokes[r],this.smokes[r]=i,this.smokeCount=r;continue}for(i.frameTimer+=t;i.frameTimer>=Te;)i.frameTimer-=Te,i.frame=(i.frame+1)%3;n+=1}return this.smokeCount>0?(this.alarmPhase+=t,s=!0):this.alarmPhase=0,s}},W=new Float32Array([18,24,64,.46,18,24,64,.48,18,24,64,.48,18,24,64,.46,24,30,70,.42,60,45,80,.34,255,150,90,.2,255,180,120,.1,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,255,255,0,255,170,100,.12,255,130,70,.22,200,90,70,.3,60,50,90,.38,30,32,72,.42,20,26,66,.45,18,24,64,.46]),dr={r:255,g:255,b:255,alpha:0};function hr(t,e=dr){const s=(t%24+24)%24,n=Math.floor(s),i=(n+1)%24,r=s-n,o=n*4,a=i*4;return e.r=W[o]+(W[a]-W[o])*r,e.g=W[o+1]+(W[a+1]-W[o+1])*r,e.b=W[o+2]+(W[a+2]-W[o+2])*r,e.alpha=W[o+3]+(W[a+3]-W[o+3])*r,e}u(hr,"tintForHour");var mr=2.5,gr=2,pr=14,gt=new Map;function wr(t){const e=gt.get(t);if(e!==void 0)return e;let s=null;if(typeof document<"u"){const n=Math.max(8,Math.round(mr*2*16*t)),i=document.createElement("canvas");i.width=n,i.height=n;const r=i.getContext("2d");if(r){const o=n/2,a=r.createRadialGradient(o,o,0,o,o,o);a.addColorStop(0,"rgba(255, 196, 108, 0.42)"),a.addColorStop(.45,"rgba(255, 170, 80, 0.18)"),a.addColorStop(1,"rgba(255, 150, 60, 0)"),r.fillStyle=a,r.fillRect(0,0,n,n),s=i}}if(gt.set(t,s),gt.size>gr){const n=gt.keys().next();n.done||gt.delete(n.value)}return s}u(wr,"glowSprite");var Bt=6e4;function vr(){const t={r:255,g:255,b:255,alpha:0};let e="",s=0,n=-6e4,i=null,r=null,o=null,a=null,l=0,c=0,d=!1;const m=u(f=>{const g=i,v=r,y=o;if(!g||!v||!y||!a)return;const p=y.visual(f.agentId);if(!p||p.status!=="running")return;const b=f.seated?6:0,x=Math.round(g.offsetX+f.x*g.zoom-l/2),T=Math.round(g.offsetY+(f.y+b-pr)*g.zoom-l/2);x+l<0||T+l<0||x>g.width||T>g.height||v.drawImage(a,x,T)},"drawGlow");return{update(f,g){return d||(d=!0,setTimeout(()=>{d=!1,!(typeof document<"u"&&document.hidden)&&g.wake()},Bt)),c+=f*1e3,c<Bt?!1:(c=0,!0)},draw(f,g,v){if(g.nowMs-n>=Bt){n=g.nowMs;const y=new Date(g.nowMs);hr(y.getHours()+y.getMinutes()/60,t),s=t.alpha,e=`rgb(${Math.round(255+(t.r-255)*t.alpha)}, ${Math.round(255+(t.g-255)*t.alpha)}, ${Math.round(255+(t.b-255)*t.alpha)})`}s>.01&&(f.save(),f.globalCompositeOperation="multiply",f.fillStyle=e,f.fillRect(0,0,g.width,g.height),f.restore(),a=wr(Math.max(1,Math.round(g.zoom))),a&&(l=a.width,i=g,r=f,o=v,f.save(),f.globalCompositeOperation="lighter",v.forEachPose(m),f.restore(),i=null,r=null))}}}u(vr,"createAmbienceLayer");var Ce=["/pixels/furniture/SMOKE/SMOKE_1.png","/pixels/furniture/SMOKE/SMOKE_2.png","/pixels/furniture/SMOKE/SMOKE_3.png"],xr="/pixels/furniture/CONFETTI/CONFETTI.png",In=[null,null,null],ut=null,Se=!1;function yr(){if(!(Se||typeof Image>"u")){Se=!0;for(let t=0;t<Ce.length;t+=1){const e=new Image;e.src=Ce[t],In[t]=e}ut=new Image,ut.src=xr}}u(yr,"requestEffectSprites");function br(t){const e=In[t];return e&&e.complete&&e.naturalWidth>0?e:null}u(br,"smokeFrame");function Ir(){return ut&&ut.complete&&ut.naturalWidth>0?ut:null}u(Ir,"confettiPop");var Ar=1.5,Tr=16,_e=30,Cr=32,Sr=.4,_r=.45,kr="rgba(248, 113, 113, 0.55)",Rr="rgba(129, 212, 250, 0.85)",Mr=[3,3],ke=18;function Fr(t){return yr(),{update(e){return t.update(e)},draw(e,s,n){const i=s.zoom,r=t.confetti;if(r.count>0){const o=Math.max(1,Math.round(Ar*i));for(let a=0;a<r.count;a+=1)e.fillStyle=bn[r.tint[a]],e.fillRect(Math.round(s.offsetX+r.x[a]*i),Math.round(s.offsetY+r.y[a]*i),o,o)}for(let o=0;o<t.cheerCount;o+=1){const a=t.cheers[o];if(a.ttl<1.2-Sr)continue;const l=Ir();if(!l)break;const c=n.pose(a.agentId);if(!c)continue;const d=Cr*i;e.drawImage(l,Math.round(s.offsetX+c.x*i-d/2),Math.round(s.offsetY+(c.y-_e)*i-d/2),d,d)}for(let o=0;o<t.smokeCount;o+=1){const a=t.smokes[o],l=n.pose(a.agentId);if(!l)continue;const c=br(a.frame),d=Tr*i,m=Math.round(s.offsetX+l.x*i-d/2),f=Math.round(s.offsetY+(l.y-_e)*i-d);c?e.drawImage(c,m,f,d,d):(e.fillStyle="rgba(226, 232, 240, 0.55)",e.fillRect(m+d/4,f+d/4,d/2,d/2))}if(t.smokeCount>0){const o=n.objectAnchor("alarm");if(o&&Math.floor(t.alarmPhase/_r)%2===0){const a=16*i;e.save(),e.globalCompositeOperation="lighter",e.fillStyle=kr,e.fillRect(Math.round(s.offsetX+o.x*i-a/2),Math.round(s.offsetY+o.y*i-a/2),a,a),e.restore()}}if(t.visitCount>0){e.save(),e.setLineDash(Mr),e.strokeStyle=Rr,e.lineWidth=Math.max(1,Math.round(i/2));for(let o=0;o<t.visitCount;o+=1){const a=t.visits[o],l=n.pose(a.fromAgentId),c=n.pose(a.toAgentId);!l||!c||(e.beginPath(),e.moveTo(s.offsetX+l.x*i,s.offsetY+(l.y-ke)*i),e.lineTo(s.offsetX+c.x*i,s.offsetY+(c.y-ke)*i),e.stroke())}e.restore()}}}}u(Fr,"createEffectsLayer");var Er="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_/#!?:+@'(), ",Re=["####.#####.##.#","##.#.###.#.###.",".###..#..#...##","##.#.##.##.###.","####..##.#..###","####..##.#..#..",".###..#.##.#.##","#.##.#####.##.#","###.#..#..#.###","..#..#..##.#.#.","#.##.###.#.##.#","#..#..#..#..###","#.########.##.#","#.###.###.###.#",".#.#.##.##.#.#.","##.#.###.#..#..",".#.#.##.####.##","##.#.###.#.##.#",".###...#...###.","###.#..#..#..#.","#.##.##.##.####","#.##.##.##.#.#.","#.##.########.#","#.##.#.#.#.##.#","#.##.#.#..#..#.","###..#.#.#..###",".#.#.##.##.#.#.",".#.##..#..#.###","##...#.#.#..###","##...#.#...###.","#.##.####..#..#","####..##...###.",".###..####.####","###..#.#..#..#.","####.#####.####","####.####..###.",".............#.","......###......","............###","..#..#.#.#..#..","#.#####.#####.#",".#..#..#.....#.","##...#.#.....#.","....#.....#....","....#.###.#....","####.#####...##",".#..#..........","..#.#..#..#...#","#...#..#..#.#..","..........#.#..","..............."],An=50,yt=new Int16Array(128).fill(-1);for(let t=0;t<51;t+=1)yt[Er.charCodeAt(t)]=t;for(let t=97;t<=122;t+=1)yt[t]=yt[t-32];function te(t){let e=0;for(let s=0;s<t.length;s+=1){const n=t.charCodeAt(s),i=n<128?yt[n]:-1;i<0||(e+=i===An?3:4)}return e>0?e-1:0}u(te,"measureLabelWidth");var Or=4,et=new Map;function Nr(t,e){if(typeof document>"u")return null;const s=document.createElement("canvas");s.width=153*t,s.height=5*t;const n=s.getContext("2d");if(!n)return null;n.fillStyle=e;for(let o=0;o<Re.length;o+=1){const a=Re[o],l=o*3*t;for(let c=0;c<5;c+=1)for(let d=0;d<3;d+=1)a.charCodeAt(c*3+d)===35&&n.fillRect(l+d*t,c*t,t,t)}const i=3*t,r=5*t;return{zoom:t,color:e,height:r,drawText(o,a,l,c){let d=l;for(let m=0;m<a.length;m+=1){const f=a.charCodeAt(m),g=f<128?yt[f]:-1;if(!(g<0)){if(g===An){d+=3*t;continue}o.drawImage(s,g*i,0,i,r,d,c,i,r),d+=4*t}}}}}u(Nr,"createAtlas");function Tn(t,e){const s=Math.max(1,Math.round(t)),n=`${s}|${e}`,i=et.get(n);if(i!==void 0)return et.delete(n),et.set(n,i),i;const r=Nr(s,e);if(et.set(n,r),et.size>Or){const o=et.keys().next();o.done||et.delete(o.value)}return r}u(Tn,"getGlyphAtlas");function Lr(t,e){return t.y-e.y||t.x-e.x}u(Lr,"compareBoxes");function jr(t,e){const s=t.length;if(!(s<2)){t.sort(Lr);for(let n=1;n<s;n+=1){const i=t[n];for(let r=0;r<s;r+=1){let o=!1;for(let a=0;a<n;a+=1){const l=t[a];i.x>=l.x+l.w||l.x>=i.x+i.w||i.y>=l.y+l.h+e||l.y>=i.y+i.h+e||(i.y=l.y+l.h+e,o=!0)}if(!o)break}}}}u(jr,"declutterLabelBoxes");var Cn={read:{rows:".#####..#...#..#ooo#..#...#..#ooo#..#...#..#####.",primary:"#e5e7eb",secondary:"#60a5fa"},write:{rows:".....oo....oo#...oo#...oo#...oo#...oo#....##.....",primary:"#fbbf24",secondary:"#fde68a"},run:{rows:".......#o......#o......#o....#o....#o.......#####",primary:"#34d399",secondary:"#065f46"},web:{rows:"..###...#ooo#.#o#o#o##ooooo##o#o#o#.#ooo#...###..",primary:"#38bdf8",secondary:"#0c4a6e"},think0:{rows:".#####.#.....##o....##.....#.####....#.....#.....",primary:"#cbd5f5",secondary:"#f9fafb"},think1:{rows:".#####.#.....##o.o..##.....#.####....#.....#.....",primary:"#cbd5f5",secondary:"#f9fafb"},think2:{rows:".#####.#.....##o.o.o##.....#.####....#.....#.....",primary:"#cbd5f5",secondary:"#f9fafb"},comment:{rows:"#####..#ooo#..#ooo#..#ooo#..#####....#.....#.....",primary:"#a78bfa",secondary:"#ede9fe"},other:{rows:".........###...#ooo#..#ooo#..#ooo#...###.........",primary:"#9ca3af",secondary:"#d1d5db"},bangRed:{rows:"..###....###....###....###....oo#...........###..",primary:"#f87171",secondary:"#991b1b"},bangYellow:{rows:"..###....###....###....###....oo#...........###..",primary:"#facc15",secondary:"#854d0e"},sleep:{rows:"###......#.....#.....###.###.....#.....#......###",primary:"#93c5fd",secondary:"#93c5fd"},coin:{rows:".........###...#ooo#..#o#o#..#ooo#...###.........",primary:"#fbbf24",secondary:"#fde68a"},mention:{rows:".#####.#.....##.###.##.#.#.##.###.##.......#####.",primary:"#67e8f9",secondary:"#155e75"}},vt=Object.keys(Cn),Sn={};for(let t=0;t<vt.length;t+=1)Sn[vt[t]]=t;var Pr=3,nt=new Map;function Br(t){if(typeof document>"u")return null;const e=7*t,s=document.createElement("canvas");s.width=e*vt.length,s.height=e;const n=s.getContext("2d");if(!n)return null;for(let i=0;i<vt.length;i+=1){const r=Cn[vt[i]],o=i*e;for(let a=0;a<7;a+=1)for(let l=0;l<7;l+=1){const c=r.rows.charCodeAt(a*7+l);c!==46&&(n.fillStyle=c===35?r.primary:r.secondary,n.fillRect(o+l*t,a*t,t,t))}}return{zoom:t,size:e,draw(i,r,o,a){const l=Sn[r];i.drawImage(s,l*e,0,e,e,o,a,e,e)}}}u(Br,"createIconAtlas");function Dr(t){const e=Math.max(1,Math.round(t)),s=nt.get(e);if(s!==void 0)return nt.delete(e),nt.set(e,s),s;const n=Br(e);if(nt.set(e,n),nt.size>Pr){const i=nt.keys().next();i.done||nt.delete(i.value)}return n}u(Dr,"getIconAtlas");var Dt=1,$r=34,Wr=2,Me="rgba(12, 14, 20, 0.8)",Fe="rgba(148, 163, 184, 0.45)",Ee=1e4,Oe=320,zr="#cbd5e1",Hr=22,Yr=2,Xr=2;function Gr(t){let e="";for(const s of t)s!==" "&&s.charCodeAt(0)<128&&te(s)>0?e+=s:e.length>0&&!e.endsWith(" ")&&(e+=" ");return e=e.trim(),e.length<=Hr?e:`${e.slice(0,20).trimEnd()}..`}u(Gr,"progressCaption");var Ne={read:"read",write:"write",run:"run",web:"web",comment:"comment",other:"other"};function qr(t){let e=null,s=0,n=null,i=null,r=null,o=!1,a=null,l=0;const c=new Map,d=u((y,p)=>{const b=c.get(y);if(b&&b.message===p)return b;const x=Gr(p),T={message:p,text:x,width:te(x)};return c.set(y,T),T},"captionFor"),m=u((y,p,b,x)=>{if(!i||!e||!a||x.width===0)return y;const T=e.zoom,A=Dt*T,w=x.width*T+4*T,I=b+A*2;i.fillStyle=Me,i.fillRect(y-A,p-A,w,I),i.strokeStyle=Fe,i.lineWidth=1,i.strokeRect(y-A+.5,p-A+.5,w-1,I-1);const C=p-A+Math.round((I-5*T)/2);return a.drawText(i,x.text,y-A+Yr*T,C),y-A+w},"drawCaption"),f=u((y,p,b,x)=>{if(!i||!e)return;const T=Dt*e.zoom;i.fillStyle=Me,i.fillRect(y-T,p-T,b+T*2,b+T*2),i.strokeStyle=Fe,i.lineWidth=1,i.strokeRect(y-T+.5,p-T+.5,b+T*2-1,b+T*2-1),e.draw(i,x,y,p)},"drawBubble"),g=u(y=>{const p=n,b=r;if(!p||!b||!e||!i)return;const x=b.visual(y.agentId);if(!x)return;const T=y.seated?6:0,A=7*e.zoom,w=y.y+T-$r,I=Math.round(p.offsetX+y.x*p.zoom-A/2),C=Math.round(p.offsetY+w*p.zoom-A);if(I+A<0||C+A<0||I>p.width||C>p.height)return;if(t.mentionTtl(y.agentId)>0){f(I,C,A,"mention"),o=!0;return}const k=x.status==="error"||t.stickyErrors.has(y.agentId);if(x.working){v(y,x.activity,I,C,A,k,x.attention);return}if(k){f(I,C,A,"bangRed");return}if(x.status==="awaiting_board"||x.status==="pending_approval"){f(I,C,A,"bangYellow");return}if(x.status==="budget_paused"){f(I,C,A,"sleep"),f(I+A+Wr*e.zoom,C,A,"coin");return}if(x.status==="paused"){f(I,C,A,"sleep");return}const R=x.activity;if(R&&!(p.nowMs-R.updatedAtMs>Ee)){if(R.icon==="think"){const F=Math.floor(p.nowMs/Oe)%3;f(I,C,A,F===0?"think0":F===1?"think1":"think2"),o=!0;return}f(I,C,A,Ne[R.icon])}},"drawForPose"),v=u((y,p,b,x,T,A,w)=>{const I=n,C=r;if(!I||!C||!e)return;const k=p!==null&&I.nowMs-p.updatedAtMs<=Ee;let R;if(!p||p.icon==="think")if(k){const j=Math.floor(I.nowMs/Oe)%3;R=j===0?"think0":j===1?"think1":"think2",o=!0}else R="think1";else R=Ne[p.icon];f(b,x,T,R);const F=4*e.zoom;let L=b+T+F;k&&p?.message&&(e.zoom>=Xr||y.agentId===C.selectedAgentId||y.agentId===C.hoveredAgentId)&&p?.message&&(L=m(L,x,T,d(y.agentId,p.message))+F-Dt*e.zoom),A?f(L,x,T,"bangRed"):w&&f(L,x,T,"bangYellow")},"drawWorking");return{update(y,p){let b=t.mentionCount>0;if(!b){const x=p.selectedAgentId;b=x!==null&&t.stickyErrors.has(x)}return b||o},draw(y,p,b){const x=Math.max(1,Math.round(p.zoom));(!e||s!==x)&&(e=Dr(x),s=x),e&&((!a||l!==x)&&(a=Tn(x,zr),l=x),i=y,n=p,r=b,o=!1,b.forEachPose(g),i=null,n=null)}}}u(qr,"createBubblesLayer");var Kr="#f3f4f6",Ur="rgba(12, 14, 20, 0.72)",Vr=3,Zr=2,Le=1,Qr=3,Jr=1,to=2,eo={running:"#4ade80",queued:"#facc15",idle:"#9ca3af",paused:"#60a5fa",error:"#f87171",pending_approval:"#c084fc",awaiting_board:"#facc15",budget_paused:"#60a5fa"},no={running:1,queued:2,idle:3,paused:4,error:5,pending_approval:6,awaiting_board:7,budget_paused:8};function so(){const t=[],e=[];let s=null,n=!0,i=0,r=null,o=0,a=!0,l=0,c=0,d=-1,m=null,f=null;const g=u(y=>{const p=s;if(!p)return;const b=p.visual(y.agentId);if(c=c*31+(y.x|0)|0,c=c*31+(y.y|0)|0,!b)return;c=c*31+no[b.status]|0;const x=b.shortName;for(let T=0;T<x.length;T+=1)c=c*31+x.charCodeAt(T)|0},"scan"),v=u(y=>{const p=s;if(!p)return;const b=p.visual(y.agentId);if(!b)return;const x=p.hoveredAgentId;if(!a&&!b.working&&y.agentId!==p.selectedAgentId&&y.agentId!==x)return;let T=t[l];T||(T={x:0,y:0,w:0,h:0,text:"",dot:"",anchorX:0,anchorY:0},t[l]=T),l+=1,T.text=b.shortName,T.dot=eo[b.status],T.w=9+te(b.shortName),T.h=7,T.anchorX=Math.round(y.x-T.w/2),T.anchorY=Math.round(y.y+Qr),T.x=T.anchorX,T.y=T.anchorY},"collect");return{update(y,p){s=p,c=0,p.forEachPose(g);const b=p.hoveredAgentId;return(c!==d||p.selectedAgentId!==m||b!==f)&&(n=!0),n},draw(y,p,b){s=b;const x=Math.max(1,Math.round(p.zoom)),T=x>=to;if(n||x!==i||T!==a){a=T,l=0,b.forEachPose(v),e.length=l;for(let w=0;w<l;w+=1)e[w]=t[w];jr(e,Jr),i=x,d=c,m=b.selectedAgentId,f=b.hoveredAgentId,n=!1}if(e.length===0)return;(!r||o!==x)&&(r=Tn(x,Kr),o=x);const A=Vr*x;for(let w=0;w<e.length;w+=1){const I=e[w],C=Math.round(p.offsetX+I.x*p.zoom),k=Math.round(p.offsetY+I.y*p.zoom),R=I.w*x,F=I.h*x;C+R<0||k+F<0||C>p.width||k>p.height||(y.fillStyle=Ur,y.fillRect(C,k,R,F),y.fillStyle=I.dot,y.fillRect(C+Zr*x,k+Le*x+x,A,A),r&&r.drawText(y,I.text,C+7*x,k+Le*x))}}}}u(so,"createLabelsLayer");var je=new WeakMap;function io(t){const e=je.get(t);if(e)return e;const s=new fr(t),n=[vr(),Fr(s),qr(s),so()];return je.set(t,n),n}u(io,"createOfficeOverlays");var ro=.035,oo=.4,ao=6,lo=.12,co={done:{frequency:660,endFrequency:990,duration:.22,type:"triangle"},ding:{frequency:880,endFrequency:880,duration:.14,type:"sine"},error:{frequency:220,endFrequency:130,duration:.35,type:"sawtooth"}},ht=!1,X=null,U=null,pt=null,V=null,Rt=0,Pe=!1;function _n(){if(!X||!V)return;const t=ht?ro*Math.min(1,Rt/ao):0;V.gain.setTargetAtTime(t,X.currentTime,oo)}u(_n,"applyTypingGain");function uo(){pt&&(pt.stop(),pt.disconnect(),pt=null),V?.disconnect(),V=null,U?.disconnect(),U=null,X&&(X.close(),X=null)}u(uo,"stopAudio");function fo(){typeof document>"u"||!X||(document.hidden?X.suspend():ht&&X.resume())}u(fo,"handleVisibility");function ho(t,e){const s=Math.floor(t.sampleRate*1.5),n=t.createBuffer(1,s,t.sampleRate),i=n.getChannelData(0);let r=0,o=0;for(let c=0;c<s;c+=1)c>=r&&(o=1,r=c+Math.floor(t.sampleRate*(.04+Math.random()*.14))),o*=.9965,i[c]=(Math.random()*2-1)*o*o;const a=t.createBufferSource();a.buffer=n,a.loop=!0;const l=t.createBiquadFilter();l.type="bandpass",l.frequency.value=2400,l.Q.value=.8,a.connect(l),l.connect(e),a.start(),pt=a}u(ho,"startTypingNoise");function ee(){if(!ht)return null;if(X)return X;if(typeof globalThis.AudioContext!="function")return null;const t=new globalThis.AudioContext;return X=t,U=t.createGain(),U.gain.value=1,U.connect(t.destination),V=t.createGain(),V.gain.value=0,V.connect(U),ho(t,V),_n(),!Pe&&typeof document<"u"&&(Pe=!0,document.addEventListener("visibilitychange",fo)),t}u(ee,"ensureContext");function Be(t){if(ht!==t){if(ht=t,!t){uo();return}Rt>0&&ee()}}u(Be,"setAmbientEnabled");function mo(t){Rt=Math.max(0,t),ht&&(Rt>0&&ee(),_n())}u(mo,"setTypingLevel");function go(t){const e=ee();if(!e||!U)return;e.state==="suspended"&&e.resume();const s=co[t],n=e.currentTime,i=e.createOscillator();i.type=s.type,i.frequency.setValueAtTime(s.frequency,n),i.frequency.linearRampToValueAtTime(s.endFrequency,n+s.duration);const r=e.createGain();r.gain.setValueAtTime(0,n),r.gain.linearRampToValueAtTime(lo,n+.01),r.gain.exponentialRampToValueAtTime(1e-4,n+s.duration),i.connect(r),r.connect(U),i.start(n),i.stop(n+s.duration+.02),i.onended=()=>{i.disconnect(),r.disconnect()}}u(go,"playEffectSound");var po=[[/web|http|fetch|browser|crawl|url|scrape|navigate/,"web"],[/comment|reply|message|chat|notify|email|slack|discord|ask_user|respond|mention|interaction/,"comment"],[/think|plan|reason|reflect|sequential|todo|goal/,"think"],[/write|edit|create|update|patch|insert|append|replace|delete|remove|rename|move|upload/,"write"],[/bash|shell|exec|run|command|terminal|test|build|install|deploy|git|docker|script|compile/,"run"],[/read|view|cat|open|glob|grep|search|find|list|ls|inspect|diff|show|get|fetch_file|notebook/,"read"]],wo={ls:"read",cd:"run",task:"think",agent:"think"};function vo(t){return(t.includes("__")?t.slice(t.lastIndexOf("__")+2):t).toLowerCase().replace(/[^a-z0-9]+/g,"_")}u(vo,"normalizeToolName");function ne(t){if(!t)return"think";const e=vo(t);if(!e)return"think";const s=wo[e];if(s)return s;for(const[n,i]of po)if(n.test(e))return i;return"other"}u(ne,"activityIconForTool");function kn(t,e){if(!t||!e)return!1;if(e.source==="local_implicit"||e.isInstanceAdmin)return!0;if(!e.memberships||e.memberships.length===0)return e.companyIds.includes(t);const s=e.memberships.find(n=>n.companyId===t&&n.status==="active");return s?s.membershipRole!=="viewer"&&s.membershipRole!==null:!1}u(kn,"canBoardAssignIssues");var it=Object.freeze({changed:!1,effects:Object.freeze([]),sounds:Object.freeze([]),refetch:!1,ticker:null}),xo={completed:!0,succeeded:!0,cancelled:!0,skipped:!0,done:!0},Rn={failed:!0,timed_out:!0};function yo(){return{agents:new Map,ticker:[],tickerSeq:0}}u(yo,"createLiveOfficeState");function Mn(t,e){return{agentId:t,name:e,status:"idle",activeRunId:null,queuedRunId:null,pendingInteractionCount:0,awaitingBoardCount:0,budgetPaused:!1,errorRunId:null,activityIcon:"other",activityMessage:null,activityAtMs:0}}u(Mn,"blankAgent");function G(t,e){let s=t.agents.get(e);return s||(s=Mn(e,e),t.agents.set(e,s)),s}u(G,"ensureAgent");function De(t,e){const s=new Set;for(const n of e.agents){s.add(n.id);const i=t.agents.get(n.id)??Mn(n.id,n.name);if(i.name=n.name,i.status=n.status,i.activeRunId=n.activeRunId,i.queuedRunId=n.queuedRunId,i.pendingInteractionCount=n.pendingInteractionCount,i.awaitingBoardCount=n.awaitingBoardCount,i.budgetPaused=n.budgetPaused,n.progress&&n.progress.runId===n.activeRunId){const r=Date.parse(n.progress.updatedAt);!Number.isNaN(r)&&r>=i.activityAtMs&&(i.activityIcon=ne(n.progress.toolName),i.activityMessage=Mt(n.progress.message),i.activityAtMs=r)}else n.activeRunId===null&&(i.activityMessage=null,i.activityAtMs=0,i.activityIcon="other");t.agents.set(n.id,i)}for(const n of[...t.agents.keys()])s.has(n)||t.agents.delete(n)}u(De,"seedFromSnapshot");function bo(t,e){for(const s of e){const n=t.agents.get(s.agentId);if(!n)continue;if(s.status==="queued"){n.queuedRunId=s.id;continue}n.activeRunId=s.id;const i=s.currentStatusUpdatedAt?Date.parse(s.currentStatusUpdatedAt):NaN,r=Mt(s.currentStatusMessage??s.lastAssistantSnippet??null);if(r===null)continue;const o=Number.isNaN(i)?0:i;o<n.activityAtMs||(n.activityIcon=ne(s.currentToolName??null),n.activityMessage=r,n.activityAtMs=o)}}u(bo,"seedFromLiveRuns");function Mt(t){if(typeof t!="string")return null;const e=t.trim();return e?e.length>180?`${e.slice(0,179)}…`:e:null}u(Mt,"clampMessage");function Io(t){const e=(t.trim().split(/\s+/)[0]??"")||t.trim();return e.length>10?e.slice(0,10):e}u(Io,"shortAgentName");function Ao(t){return t.errorRunId!==null||t.status==="error"?"error":t.awaitingBoardCount>0?"awaiting_board":t.pendingInteractionCount>0||t.status==="pending_approval"?"pending_approval":t.budgetPaused?"budget_paused":t.status==="paused"?"paused":t.activeRunId!==null||t.status==="running"?"running":t.queuedRunId!==null?"queued":"idle"}u(Ao,"visualStatus");function To(t){const e=[];for(const s of t.agents.values()){const n=Ao(s);e.push({agentId:s.agentId,shortName:Io(s.name),status:n,activity:s.activityMessage===null&&s.activityAtMs===0?null:{icon:s.activityIcon,message:s.activityMessage,updatedAtMs:s.activityAtMs},attention:n==="awaiting_board"||n==="pending_approval"||n==="error",working:s.activeRunId!==null||s.status==="running"})}return e.sort((s,n)=>s.agentId<n.agentId?-1:s.agentId>n.agentId?1:0),e}u(To,"deriveAgentVisuals");function Fn(t){let e="";for(const s of t)e+=`${s.agentId}|${s.shortName}|${s.status}|${s.attention?1:0}|${s.working?1:0}|${s.activity?`${s.activity.icon}:${s.activity.updatedAtMs}:${s.activity.message??""}`:""}
|
|
2
|
+
`;return e}u(Fn,"agentVisualsKey");function O(t){return typeof t=="string"&&t.length>0?t:null}u(O,"readString");function Co(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}u(Co,"readRecord");function So(t){if(!t)return null;for(const e of["body","content","markdown","commentBody","text"]){const s=t[e];if(typeof s=="string"&&s.length>0)return s}return null}u(So,"readCommentBody");function _o(t,e){t.tickerSeq+=1;const s={id:t.tickerSeq,...e};return t.ticker.push(s),t.ticker.length>50&&t.ticker.splice(0,t.ticker.length-50),s}u(_o,"pushTicker");function ko(t,e){const s=O(e?.identifier),n=O(e?.title),i=O(e?.status),r=t.replace(/^[a-z_]+\./,"").replaceAll("_"," "),o=s??n??i;return o?`${r} · ${o}`:r}u(ko,"tickerText");function mt(t,e,s,n,i){return{changed:t,effects:e,sounds:s,refetch:n,ticker:i}}u(mt,"result");function Ro(t,e,s){const n=O(e.agentId);if(!n)return it;const i=G(t,n),r=O(e.runId);r&&(i.activeRunId=r,i.queuedRunId===r&&(i.queuedRunId=null),i.errorRunId===r&&(i.errorRunId=null));const o=O(e.updatedAt)??O(e.lastEventAt),a=o?Date.parse(o):NaN;return i.activityAtMs=Number.isNaN(a)?s:a,i.activityIcon=ne(O(e.currentToolName)),i.activityMessage=Mt(O(e.message))??Mt(O(e.lastAssistantSnippet)),mt(!0,[],[],!1,null)}u(Ro,"applyRunProgress");function Mo(t,e){const s=O(e.agentId),n=O(e.runId);if(!s)return it;const i=G(t,s);return i.queuedRunId=n,mt(!0,[],[],!0,null)}u(Mo,"applyRunQueued");function Fo(t,e){const s=O(e.agentId),n=O(e.runId),i=O(e.status);if(!s||!i)return it;const r=G(t,s),o=[],a=[];return i==="running"?(n&&(r.activeRunId=n),r.queuedRunId===n&&(r.queuedRunId=null),r.errorRunId=null):i==="queued"?r.queuedRunId=n:Rn[i]?(n&&(r.errorRunId=n,o.push({kind:"error",agentId:s,runId:n}),a.push("error")),r.activeRunId===n&&(r.activeRunId=null),r.activityMessage=null):xo[i]&&(r.activeRunId===n&&(r.activeRunId=null),r.queuedRunId===n&&(r.queuedRunId=null),r.activityMessage=null,r.activityAtMs=0,r.activityIcon="other"),mt(!0,o,a,!0,null)}u(Fo,"applyRunStatus");function Eo(t,e){const s=O(e.agentId),n=O(e.status);if(!s||!n)return it;const i=G(t,s);return i.status=n,n!=="error"&&(i.errorRunId=null),mt(!0,[],[],!0,null)}u(Eo,"applyAgentStatus");function Oo(t,e,s){const n=O(e.action);if(!n)return it;const i=Co(e.details),r=O(e.agentId)??(e.actorType==="agent"?O(e.actorId):null),o=[],a=[];let l=!1,c=!1;if(n==="issue.updated")O(i?.status)==="done"&&r&&(o.push({kind:"celebrate",agentId:r,big:No(i)>=3}),a.push("done")),c=!0;else if(n==="issue.child_created"){const m=O(i?.assigneeAgentId)??O(i?.addresseeAgentId);r&&m&&m!==r&&o.push({kind:"visit",fromAgentId:r,toAgentId:m,reason:"delegation"}),c=!0}else if(n==="issue.thread_interaction_created"){const m=O(i?.addresseeAgentId);if(r&&m&&m!==r&&o.push({kind:"visit",fromAgentId:r,toAgentId:m,reason:"interaction"}),r){const f=G(t,r);f.pendingInteractionCount+=1,a.push("ding"),l=!0}c=!0}else if(n.startsWith("issue.comment")){const m=So(i);if(m)for(const f of Gn(m))o.push({kind:"mention",agentId:f});c=!0}else if(n.startsWith("issue.thread_interaction_")){if(r){const m=G(t,r);m.pendingInteractionCount>0&&(m.pendingInteractionCount-=1),l=!0}c=!0}else if(n==="agent.paused"){const m=O(e.entityId)??r;m&&(G(t,m).status="paused",l=!0),c=!0}else if(n==="agent.resumed"||n==="agent.approved"){const m=O(e.entityId)??r;if(m){const f=G(t,m);f.status="active",f.budgetPaused=!1,l=!0}c=!0}else(n.startsWith("issue.")||n.startsWith("approval.")||n.startsWith("budget.")||n.startsWith("routine."))&&(c=!0);const d=_o(t,{atMs:s,action:n,text:ko(n,i),agentId:r});return mt(l,o,a,c,d)}u(Oo,"applyActivity");function No(t){const e=t?.childIssueCount??t?.childCount;return typeof e=="number"&&Number.isFinite(e)?e:0}u(No,"readChildCount");function Lo(t,e,s){switch(e.type){case"heartbeat.run.progress":return Ro(t,e.payload,s);case"heartbeat.run.queued":return Mo(t,e.payload);case"heartbeat.run.status":return Fo(t,e.payload);case"agent.status":return Eo(t,e.payload);case"activity.logged":return Oo(t,e.payload,s);default:return it}}u(Lo,"applyLiveEvent");function jo(t,e){const s=e.agentId;if(!s)return it;const n=G(t,s),i=[];switch(e.kind){case"run_started":n.activeRunId=e.runId??n.activeRunId,n.queuedRunId=null,n.errorRunId=null,n.activityMessage=null;break;case"run_finished":e.status&&Rn[e.status]?(n.errorRunId=e.runId??n.activeRunId,n.errorRunId&&i.push({kind:"error",agentId:s,runId:n.errorRunId})):n.errorRunId=null,n.activeRunId=null,n.activityMessage=null;break;case"issue_status":e.status==="done"&&i.push({kind:"celebrate",agentId:s,big:!1});break;case"interaction":e.otherAgentId&&i.push({kind:"visit",fromAgentId:s,toAgentId:e.otherAgentId,reason:"interaction"});break;case"approval":n.awaitingBoardCount=e.status==="resolved"?0:1;break;case"budget":n.budgetPaused=e.status!=="resolved"}return mt(!0,i,[],!1,null)}u(jo,"applyTimelineEvent");function Po(t){for(const e of t.agents.values())e.activeRunId=null,e.queuedRunId=null,e.errorRunId=null,e.awaitingBoardCount=0,e.budgetPaused=!1,e.activityMessage=null,e.activityAtMs=0,e.activityIcon="other"}u(Po,"resetTimelineAgents");function Bo(t){if(typeof requestAnimationFrame=="function"&&typeof document<"u"&&!document.hidden){requestAnimationFrame(t);return}setTimeout(t,0)}u(Bo,"defaultScheduler");function Do(t,e=Bo){const s=yo(),n=new Set,i=[];let r=[],o="",a=!1,l=!1,c=null;const d=[],m=[];function f(){const p=To(s),b=Fn(p);return b===o?!1:(r=p,o=b,!0)}u(f,"recomputeVisuals");function g(p){for(const b of n)b(p)}u(g,"emit");function v(p,b){const x=f();!x&&!p&&!b&&d.length===0&&m.length===0||(g({visuals:r,visualsChanged:x,ticker:s.ticker,tickerChanged:p,effects:d.slice(),sounds:m.slice(),refetch:b}),d.length=0,m.length=0)}u(v,"publish");function y(){if(a=!1,i.length===0)return;const p=Date.now();let b=!1,x=!1;for(const T of i){const A=Lo(s,T,p);A.ticker&&(b=!0),A.refetch&&(x=!0);for(const w of A.effects)d.push(w);for(const w of A.sounds)m.push(w)}i.length=0,v(b,x)}return u(y,"flush"),{companyId:t,state:s,getVisuals:u(()=>r,"getVisuals"),getTicker:u(()=>s.ticker,"getTicker"),isReplaying:u(()=>l,"isReplaying"),seedSnapshot(p){c=p,!l&&(De(s,p),v(!1,!1))},seedLiveRuns(p){l||(bo(s,p),v(!1,!1))},push(p){l||(i.push(p),!a&&(a=!0,e(y)))},flushNow:y,startReplay(){l=!0,i.length=0},applyTimelineFrame(p,b){if(l){b&&Po(s);for(const x of p){const T=jo(s,x);for(const A of T.effects)d.push(A)}v(!1,!1)}},stopReplay(){l=!1,c&&De(s,c),v(!1,!0)},subscribe(p){return n.add(p),()=>{n.delete(p)}}}}u(Do,"createOfficeLiveStore");var $e=new Map;function $o(t){let e=$e.get(t);return e||(e=Do(t),$e.set(t,e)),e}u($o,"getOfficeLiveStore");var En="application/x-wardmote-issue",On="wardmote.pixelsOffice.ambient",h=Ke(Xn(),1),Wo=3,zo=8,We=1.25;function Ho({companyId:t,visuals:e,assignments:s,store:n,onController:i,onSelectAgent:r,onSelectObject:o,onAssignIssue:a}){const l=(0,_.useRef)(null),c=(0,_.useRef)(null),d=(0,_.useRef)(""),m=(0,_.useRef)(null),f=(0,_.useRef)(new Map),g=(0,_.useRef)(null),[v,y]=(0,_.useState)(null),[p,b]=(0,_.useState)(null),[x,T]=(0,_.useState)(null);(0,_.useEffect)(()=>{let w=!1;return b(null),lr(t).then(I=>{if(w)return;c.current=I,I.setOverlayLayers(io(I));const C=l.current;C&&I.attach(C),d.current="",y(I),i(I)}).catch(I=>{w||b(I instanceof Error?I.message:String(I))}),()=>{w=!0,c.current?.detach(),c.current=null,i(null),y(null)}},[t,i]),(0,_.useEffect)(()=>{if(!v)return;const w=Fn(e);if(w===d.current)return;d.current=w,v.syncAgents(e,s);let I=0;for(const C of e)C.status==="running"&&(I+=1);mo(I)},[s,v,e]),(0,_.useEffect)(()=>{if(v)return n.subscribe(w=>{for(const I of w.effects)v.emit(I);for(const I of w.sounds)go(I)})},[v,n]),(0,_.useEffect)(()=>{const w=l.current;if(!w||!v)return;const I=u(C=>{C.preventDefault();const k=w.getBoundingClientRect();v.zoomAt(C.clientX-k.left,C.clientY-k.top,C.deltaY<0?1:-1)},"onWheel");return w.addEventListener("wheel",I,{passive:!1}),()=>w.removeEventListener("wheel",I)},[v]);const A=u((w,I)=>{const C=l.current,k=c.current;if(!C||!k)return null;const R=C.getBoundingClientRect();return k.hitTest(w-R.left,I-R.top)},"hitAt");return(0,h.jsxs)("div",{className:"relative h-(--sz-pixels-office-mobile-canvas) w-full xl:h-(--sz-calc-44) xl:min-h-(--sz-520px)",children:[(0,h.jsx)("canvas",{ref:l,className:x?"size-full cursor-pointer touch-none":"size-full touch-none",onPointerDown:u(w=>{if(f.current.set(w.pointerId,{x:w.clientX,y:w.clientY}),w.currentTarget.setPointerCapture(w.pointerId),f.current.size===2){const[I,C]=[...f.current.values()];g.current={distance:Math.hypot(I.x-C.x,I.y-C.y)},m.current=null,T(null);return}m.current={x:w.clientX,y:w.clientY,moved:!1,touch:w.pointerType==="touch"}},"onPointerDown"),onPointerMove:u(w=>{const I=c.current;if(!I)return;f.current.has(w.pointerId)&&f.current.set(w.pointerId,{x:w.clientX,y:w.clientY});const C=g.current;if(C&&f.current.size===2){const[j,P]=[...f.current.values()],H=Math.hypot(j.x-P.x,j.y-P.y),J=H/C.distance;if(J>=We||J<=1/We){const bt=w.currentTarget.getBoundingClientRect();I.zoomAt((j.x+P.x)/2-bt.left,(j.y+P.y)/2-bt.top,J>1?1:-1),C.distance=H}return}const k=m.current;if(k){const j=w.clientX-k.x,P=w.clientY-k.y,H=k.touch?zo:Wo;(k.moved||Math.abs(j)>H||Math.abs(P)>H)&&(k.moved=!0,k.x=w.clientX,k.y=w.clientY,I.panBy(j,P));return}if(w.pointerType==="touch")return;const R=A(w.clientX,w.clientY);if(I.hover(R),!R){T(null);return}const F=w.currentTarget.getBoundingClientRect();if(R.kind==="object"){T({x:w.clientX-F.left,y:w.clientY-F.top,title:R.object,body:null,age:null});return}const L=I.visual(R.agentId);T({x:w.clientX-F.left,y:w.clientY-F.top,title:L?.shortName??R.agentId.slice(0,8),body:L?.activity?.message??L?.status??null,age:L?.activity&&L.activity.updatedAtMs>0?Z(new Date(L.activity.updatedAtMs)):null})},"onPointerMove"),onPointerUp:u(w=>{const I=c.current,C=m.current,k=g.current!==null;if(f.current.delete(w.pointerId),f.current.size<2&&(g.current=null),m.current=null,w.currentTarget.releasePointerCapture(w.pointerId),!I||C?.moved||k||!C)return;const R=A(w.clientX,w.clientY);if(!R){I.select(null);return}if(R.kind==="agent"){I.select(R.agentId),r(R.agentId);return}o(R.object)},"onPointerUp"),onPointerCancel:u(w=>{f.current.delete(w.pointerId),g.current=null,m.current=null},"onPointerCancel"),onPointerLeave:u(w=>{w.pointerType!=="touch"&&(m.current=null,c.current?.hover(null),T(null))},"onPointerLeave"),onDoubleClick:u(w=>{const I=A(w.clientX,w.clientY);I?.kind==="agent"&&c.current?.follow(I.agentId)},"onDoubleClick"),onDragOver:u(w=>{w.dataTransfer.types.includes("application/x-wardmote-issue")&&(w.preventDefault(),w.dataTransfer.dropEffect="move",c.current?.hover(A(w.clientX,w.clientY)))},"onDragOver"),onDrop:u(w=>{const I=w.dataTransfer.getData(En);if(!I)return;w.preventDefault();const C=A(w.clientX,w.clientY);c.current?.hover(null),C?.kind==="agent"&&a(I,C.agentId)},"onDrop")}),x?(0,h.jsxs)("div",{role:"tooltip",style:{left:x.x+12,top:x.y+12},className:"pointer-events-none absolute z-10 max-w-(--sz-320px) rounded-md border border-line bg-bg-2 px-2 py-1 text-xs text-ink shadow-md",children:[(0,h.jsx)("p",{className:"font-medium",children:x.title}),x.body?(0,h.jsx)("p",{className:"text-ink-3",children:x.body}):null,x.age?(0,h.jsx)("p",{className:"text-ink-3",children:x.age}):null]}):null,p?(0,h.jsx)("p",{className:"absolute inset-x-0 bottom-2 text-center text-sm text-bad",children:p}):null]})}u(Ho,"PixelsOfficeCanvas");function Nn({title:t,subtitle:e,headerExtra:s,onClose:n,children:i}){return(0,h.jsxs)("aside",{"aria-label":t,className:"flex h-full w-full min-w-0 flex-col overflow-hidden rounded-lg border border-line bg-bg-2",children:[(0,h.jsxs)("header",{className:"flex items-start gap-2 border-b border-line px-4 py-3",children:[(0,h.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,h.jsx)("h2",{className:"truncate text-sm font-semibold text-ink",children:t}),e?(0,h.jsx)("p",{className:"truncate text-xs text-ink-3",children:e}):null]}),s,(0,h.jsx)(z,{variant:"ghost",size:"icon","aria-label":"Close panel",onClick:n,children:(0,h.jsx)(ts,{className:"size-4","aria-hidden":!0})})]}),(0,h.jsx)("div",{className:"min-h-0 flex-1",children:i})]})}u(Nn,"OfficePanelShell");var Yo={running:"Running",queued:"Queued",idle:"Idle",paused:"Paused",error:"Error",pending_approval:"Waiting on a person",awaiting_board:"Waiting on the board",budget_paused:"Budget stop"},Xo={running:"default",queued:"secondary",idle:"outline",paused:"secondary",error:"destructive",pending_approval:"secondary",awaiting_board:"secondary",budget_paused:"destructive"};function Go({companyId:t,agent:e,visual:s,onClose:n}){const i=Ue(),[r,o]=(0,_.useState)(null),{data:a}=D({queryKey:N.access.currentBoardAccess,queryFn:u(()=>tn.getCurrentBoardAccess(),"queryFn"),retry:!1}),l=kn(t,a),{data:c}=D({queryKey:N.attention(t),queryFn:u(()=>nn.list(t,{limit:50}),"queryFn"),enabled:e.pendingInteractionCount>0||e.awaitingBoardCount>0}),{data:d}=D({queryKey:N.agents.list(t),queryFn:u(()=>At.list(t),"queryFn")}),m=(0,_.useMemo)(()=>{const x=new Map;for(const T of d??[])x.set(T.id,T);return x},[d]),f=(0,_.useMemo)(()=>(c?.items??[]).filter(x=>x.sourceKind==="issue_thread_interaction"&&(x.resolverAudience?.createdByAgentId===e.id||x.resolverAudience?.addresseeAgentId===e.id)),[c,e.id]),g=u(()=>{i.invalidateQueries({queryKey:N.pixelsOffice.snapshot(t)}),i.invalidateQueries({queryKey:N.attention(t)}),i.invalidateQueries({queryKey:N.agents.list(t)})},"invalidate"),v=Ve({mutationFn:u(x=>x==="pause"?At.pause(e.id,t):x==="resume"?At.resume(e.id,t):At.wakeup(e.id,{source:"on_demand",triggerDetail:"manual"},t),"mutationFn"),onSuccess:u(()=>{o(null),g()},"onSuccess"),onError:u(x=>{o(x instanceof Error?x.message:String(x))},"onError")}),y=s?.status??"idle",p=s?.activity??null,b=e.status==="paused";return(0,h.jsx)(Nn,{title:e.name,subtitle:e.title??e.role,onClose:n,headerExtra:(0,h.jsx)(xt,{variant:Xo[y],children:Yo[y]}),children:(0,h.jsx)(Ze,{className:"h-full",children:(0,h.jsxs)("div",{className:"space-y-4 p-4",children:[p?.message?(0,h.jsxs)("div",{className:"rounded-md border border-line bg-bg-3/40 p-3",children:[(0,h.jsx)("p",{className:"text-sm text-ink",children:p.message}),(0,h.jsx)("p",{className:"mt-1 text-xs text-ink-3",children:p.updatedAtMs>0?Z(new Date(p.updatedAtMs)):"No timestamp"})]}):null,(0,h.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[l?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(z,{size:"sm",variant:"secondary",disabled:v.isPending,onClick:u(()=>v.mutate("wake"),"onClick"),children:[v.isPending&&v.variables==="wake"?(0,h.jsx)(Qn,{className:"size-4 motion-safe:animate-spin","aria-hidden":!0}):(0,h.jsx)(Kn,{className:"size-4","aria-hidden":!0}),"Wake"]}),(0,h.jsxs)(z,{size:"sm",variant:"secondary",disabled:v.isPending,onClick:u(()=>v.mutate(b?"resume":"pause"),"onClick"),children:[b?(0,h.jsx)(zt,{className:"size-4","aria-hidden":!0}):(0,h.jsx)(Qe,{className:"size-4","aria-hidden":!0}),b?"Resume":"Pause"]})]}):null,(0,h.jsx)(z,{size:"sm",variant:"ghost",asChild:!0,children:(0,h.jsxs)(Q,{to:`/agents/${e.id}`,children:[(0,h.jsx)(Vn,{className:"size-4","aria-hidden":!0}),"Agent page"]})})]}),r?(0,h.jsx)("p",{className:"text-sm text-bad",children:r}):null,f.length>0?(0,h.jsxs)("section",{className:"space-y-2",children:[(0,h.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-ink-3",children:"Waiting on a decision"}),f.map(x=>(0,h.jsx)(ds,{companyId:t,issueId:x.relatedIssue?.id??x.subject.id,interactionId:x.subject.id,agentMap:m,onResolved:g},x.id))]}):null,(0,h.jsxs)("section",{className:"space-y-2",children:[(0,h.jsxs)("h3",{className:"text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-ink-3",children:["Tasks · ",e.activeTaskCount," active / ",e.queuedTaskCount," queued"]}),e.tasks.length===0?(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"No open tasks."}):(0,h.jsx)("ul",{className:"space-y-1",children:e.tasks.map(x=>(0,h.jsx)("li",{children:(0,h.jsxs)(Q,{to:`/issues/${x.identifier}`,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-bg-3/40",children:[(0,h.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:x.identifier}),(0,h.jsx)("span",{className:"min-w-0 flex-1 truncate text-ink",children:x.title}),x.runStatus?(0,h.jsx)(xt,{variant:"secondary",children:x.runStatus}):null]})},x.issueId))})]})]})})})}u(Go,"AgentPanel");var qo={kanban:"Kanban board",mailbox:"Mailbox",clock:"Wall clock",coins:"Coin stack",alarm:"Alarm light"};function Ln(t){let e=null;for(const s of t)for(const n of s.triggers){if(!n.enabled||!n.nextRunAt)continue;const i=new Date(n.nextRunAt).getTime();Number.isNaN(i)||(!e||i<e.atMs)&&(e={routineId:s.id,routineName:s.title,atMs:i})}return e}u(Ln,"nextRoutineRun");var Ko={failed:!0,timed_out:!0};function ze(t){return`$${(t/100).toFixed(2)}`}u(ze,"formatCents");function ct({label:t,value:e}){return(0,h.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-sm",children:[(0,h.jsx)("span",{className:"text-ink-3",children:t}),(0,h.jsx)("span",{className:"font-medium text-ink",children:e})]})}u(ct,"Row");function Uo({companyId:t}){const{data:e,isLoading:s}=D({queryKey:N.pipelines.list(t),queryFn:u(()=>hs.list(t),"queryFn")});if(s)return(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"Loading pipelines…"});const n=(e??[]).filter(i=>!i.archivedAt);return n.length===0?(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"No pipelines yet."}):(0,h.jsx)("ul",{className:"space-y-2",children:n.map(i=>(0,h.jsxs)("li",{className:"rounded-md border border-line p-3",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,h.jsx)(Q,{to:`/pipelines/${i.id}`,className:"truncate text-sm font-medium text-ink hover:underline",children:i.name}),(0,h.jsxs)(xt,{variant:"outline",children:[i.stageCount," stages"]})]}),(0,h.jsxs)("div",{className:"mt-1 text-xs text-ink-3",children:[i.openCaseCount," open",typeof i.inMotionCount=="number"?` · ${i.inMotionCount} in motion`:"",typeof i.attentionCount=="number"?` · ${i.attentionCount} need attention`:""]})]},i.id))})}u(Uo,"KanbanBody");function Vo({companyId:t}){const{data:e,isLoading:s}=D({queryKey:N.attention(t),queryFn:u(()=>nn.list(t,{limit:20}),"queryFn")});if(s)return(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"Loading decisions…"});const n=e?.items??[];return n.length===0?(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"Nothing is waiting."}):(0,h.jsx)("ul",{className:"space-y-2",children:n.map(i=>(0,h.jsxs)("li",{className:"rounded-md border border-line p-3",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,h.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-ink",children:i.subject.title??i.whyNow}),(0,h.jsx)(xt,{variant:i.severity==="critical"?"destructive":"secondary",children:i.severity})]}),(0,h.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-xs text-ink-3",children:[(0,h.jsx)("span",{children:i.sourceKind.replaceAll("_"," ")}),(0,h.jsx)("span",{children:"·"}),(0,h.jsx)("span",{children:Z(i.activityAt)}),i.relatedIssue?.identifier?(0,h.jsx)(Q,{to:`/issues/${i.relatedIssue.identifier}`,className:"font-mono hover:underline",children:i.relatedIssue.identifier}):null]})]},i.id))})}u(Vo,"MailboxBody");function Zo({companyId:t}){const{data:e,isLoading:s}=D({queryKey:N.routines.list(t),queryFn:u(()=>en.list(t),"queryFn")}),n=e??[],i=(0,_.useMemo)(()=>Ln(n),[n]);return s?(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"Loading routines…"}):(0,h.jsxs)("div",{className:"space-y-3",children:[(0,h.jsx)(ct,{label:"Local time",value:new Date().toLocaleTimeString()}),i?(0,h.jsxs)("div",{className:"rounded-md border border-line p-3",children:[(0,h.jsx)("p",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-ink-3",children:"Next run"}),(0,h.jsx)(Q,{to:`/routines/${i.routineId}`,className:"text-sm font-medium text-ink hover:underline",children:i.routineName}),(0,h.jsx)("p",{className:"text-xs text-ink-3",children:Z(new Date(i.atMs))})]}):(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"No scheduled routine run."}),(0,h.jsx)("ul",{className:"space-y-1",children:n.slice(0,12).map(r=>(0,h.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,h.jsx)(Q,{to:`/routines/${r.id}`,className:"min-w-0 truncate text-ink hover:underline",children:r.title}),(0,h.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:r.lastRun?Z(r.lastRun.createdAt):"never run"})]},r.id))})]})}u(Zo,"ClockBody");function Qo({companyId:t}){const{data:e}=D({queryKey:N.dashboard(t),queryFn:u(()=>sn.summary(t),"queryFn")}),{data:s}=D({queryKey:N.budgets.overview(t),queryFn:u(()=>ms.overview(t),"queryFn")});return e?(0,h.jsxs)("div",{className:"space-y-3",children:[(0,h.jsx)(ct,{label:"Spent this month",value:ze(e.costs.monthSpendCents)}),(0,h.jsx)(ct,{label:"Budget",value:ze(e.costs.monthBudgetCents)}),(0,h.jsx)(ct,{label:"Utilisation",value:`${e.costs.monthUtilizationPercent}%`}),(0,h.jsx)(ct,{label:"Active budget incidents",value:String(e.budgets.activeIncidents)}),(0,h.jsx)(ct,{label:"Paused by budget",value:`${e.budgets.pausedAgents} agents · ${e.budgets.pausedProjects} projects`}),s?(0,h.jsx)(Q,{to:"/budgets",className:"block text-sm text-accent hover:underline",children:"Budget settings"}):null]}):(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"Loading costs…"})}u(Qo,"CoinsBody");function Jo({companyId:t}){const{data:e,isLoading:s}=D({queryKey:N.heartbeats(t),queryFn:u(()=>Je.list(t,void 0,50,{summary:!0}),"queryFn")});if(s)return(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"Loading runs…"});const n=(e??[]).filter(i=>Ko[i.status]).slice(0,10);return n.length===0?(0,h.jsx)("p",{className:"text-sm text-ink-3",children:"No recent failures."}):(0,h.jsx)("ul",{className:"space-y-2",children:n.map(i=>(0,h.jsxs)("li",{className:"rounded-md border border-line p-3",children:[(0,h.jsxs)(Q,{to:`/agents/${i.agentId}/runs/${i.id}`,className:"flex items-center justify-between gap-2 text-sm text-ink hover:underline",children:[(0,h.jsx)("span",{className:"min-w-0 truncate font-mono",children:i.agentId.slice(0,8)}),(0,h.jsx)(xt,{variant:"destructive",children:i.status})]}),(0,h.jsxs)("p",{className:"mt-1 truncate text-xs text-ink-3",children:[i.error??i.errorCode??"No error text",i.finishedAt?` · ${Z(i.finishedAt)}`:""]})]},i.id))})}u(Jo,"AlarmBody");function ta({companyId:t,object:e,onClose:s}){return(0,h.jsx)(Nn,{title:qo[e],onClose:s,children:(0,h.jsx)(Ze,{className:"h-full",children:(0,h.jsxs)("div",{className:"p-4",children:[e==="kanban"?(0,h.jsx)(Uo,{companyId:t}):null,e==="mailbox"?(0,h.jsx)(Vo,{companyId:t}):null,e==="clock"?(0,h.jsx)(Zo,{companyId:t}):null,e==="coins"?(0,h.jsx)(Qo,{companyId:t}):null,e==="alarm"?(0,h.jsx)(Jo,{companyId:t}):null]})})})}u(ta,"ObjectPanel");var ea={todo:!0,backlog:!0},na=20;function sa({companyId:t,canAssign:e,armedIssueId:s,onArmIssue:n}){const{data:i}=D({queryKey:N.pixelsOffice.unassigned(t),queryFn:u(()=>Wt.listCompact(t,{limit:200,sortField:"updated",sortDir:"desc"}),"queryFn"),enabled:e});if(!e)return null;const r=(i??[]).filter(o=>ea[o.status]&&!o.assigneeAgentId&&!o.assigneeUserId).slice(0,na);return(0,h.jsxs)("div",{className:"flex w-full min-w-0 flex-col gap-1 md:w-auto md:max-w-full",children:[(0,h.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-(--tracking-eyebrow) text-ink-3",children:["Unassigned · ",r.length]}),r.length===0?(0,h.jsx)("span",{className:"text-xs text-ink-3",children:"Everything has an owner."}):(0,h.jsx)("ul",{className:"flex max-w-full gap-1 overflow-x-auto pb-1",children:r.map(o=>(0,h.jsx)("li",{className:"shrink-0",children:(0,h.jsxs)("div",{draggable:!0,role:"button",tabIndex:0,title:o.title,"aria-pressed":s===o.id,"data-issue-id":o.id,onClick:u(()=>n(s===o.id?null:o.id),"onClick"),onKeyDown:u(a=>{a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),n(s===o.id?null:o.id))},"onKeyDown"),onDragStart:u(a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData(En,o.id),a.dataTransfer.setData("text/plain",o.identifier??o.id)},"onDragStart"),className:s===o.id?"flex min-h-8 cursor-grab items-center gap-1 rounded-md border border-accent bg-accent/10 px-2 py-1 text-xs text-ink active:cursor-grabbing":"flex min-h-8 cursor-grab items-center gap-1 rounded-md border border-line bg-bg-2 px-2 py-1 text-xs text-ink active:cursor-grabbing",children:[(0,h.jsx)(rs,{className:"size-3 shrink-0 text-ink-3","aria-hidden":!0}),(0,h.jsx)("span",{className:"whitespace-nowrap font-mono text-ink-3",children:o.identifier??o.id.slice(0,8)}),(0,h.jsx)("span",{className:"max-w-(--sz-150px) truncate",children:o.title})]})},o.id))})]})}u(sa,"UnassignedTray");var ia=3e4;function lt({icon:t,label:e,value:s,tone:n,onClick:i}){return(0,h.jsxs)("button",{type:"button",onClick:i,className:n==="alert"?"flex min-h-8 shrink-0 items-center gap-1.5 rounded-full border border-bad/50 bg-bad/10 px-3 py-1 text-xs text-ink transition-colors hover:bg-bad/20":"flex min-h-8 shrink-0 items-center gap-1.5 rounded-full border border-line bg-bg-2 px-3 py-1 text-xs text-ink transition-colors hover:bg-bg-3/40",children:[t,(0,h.jsx)("span",{className:"font-medium",children:s}),(0,h.jsx)("span",{className:"text-ink-3",children:e})]})}u(lt,"Chip");function ra({companyId:t,ticker:e,canAssign:s,ambientEnabled:n,onToggleAmbient:i,onOpenObject:r,compact:o=!1,armedIssueId:a,onArmIssue:l}){const c=Qt(),[d,m]=(0,_.useState)(()=>new Date);(0,_.useEffect)(()=>{if(!c.visible)return;m(new Date);const x=setInterval(()=>m(new Date),ia);return()=>clearInterval(x)},[c.visible]);const{data:f}=D({queryKey:N.dashboard(t),queryFn:u(()=>sn.summary(t),"queryFn")}),{data:g}=D({queryKey:N.routines.list(t),queryFn:u(()=>en.list(t),"queryFn")}),v=(0,_.useMemo)(()=>Ln(g??[]),[g]),y=e.length>0?e[e.length-1]:null,p=f?(f.costs.monthSpendCents/100).toFixed(0):"0",b=f?(f.costs.monthBudgetCents/100).toFixed(0):"0";return(0,h.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,h.jsxs)("div",{className:o?"-mx-3 flex items-center gap-2 overflow-x-auto px-3 pb-1":"flex flex-wrap items-center gap-2",children:[(0,h.jsx)(lt,{icon:(0,h.jsx)(re,{className:"size-3.5","aria-hidden":!0}),value:String(f?.agents.running??0),label:"running",onClick:u(()=>r("kanban"),"onClick")}),(0,h.jsx)(lt,{icon:(0,h.jsx)(re,{className:"size-3.5","aria-hidden":!0}),value:String(f?.tasks.open??0),label:"open",onClick:u(()=>r("kanban"),"onClick")}),(0,h.jsx)(lt,{icon:(0,h.jsx)(gs,{className:"size-3.5","aria-hidden":!0}),value:String(f?.tasks.blocked??0),label:"blocked",tone:(f?.tasks.blocked??0)>0?"alert":void 0,onClick:u(()=>r("alarm"),"onClick")}),(0,h.jsx)(lt,{icon:(0,h.jsx)(Zn,{className:"size-3.5","aria-hidden":!0}),value:String(f?.pendingApprovals??0),label:"approvals",tone:(f?.pendingApprovals??0)>0?"alert":void 0,onClick:u(()=>r("mailbox"),"onClick")}),(0,h.jsx)(lt,{icon:(0,h.jsx)(Un,{className:"size-3.5","aria-hidden":!0}),value:`$${p}/$${b}`,label:"this month",onClick:u(()=>r("coins"),"onClick")}),(0,h.jsx)(lt,{icon:(0,h.jsx)(as,{className:"size-3.5","aria-hidden":!0}),value:d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),label:v?`next ${Z(new Date(v.atMs))}`:"no routine queued",onClick:u(()=>r("clock"),"onClick")}),(0,h.jsx)(z,{size:"sm",variant:"ghost",className:"shrink-0","aria-pressed":n,"aria-label":n?"Mute office sound":"Unmute office sound",onClick:u(()=>i(!n),"onClick"),children:n?(0,h.jsx)(ps,{className:"size-4","aria-hidden":!0}):(0,h.jsx)(ws,{className:"size-4","aria-hidden":!0})})]}),(0,h.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:items-end md:justify-between md:gap-3",children:[(0,h.jsx)(sa,{companyId:t,canAssign:s,armedIssueId:a,onArmIssue:l}),(0,h.jsx)("p",{"aria-live":"polite",className:"min-w-0 flex-1 truncate text-xs text-ink-3 md:text-right",children:y?`${y.text} · ${Z(new Date(y.atMs))}`:"No activity yet."})]})]})}u(ra,"OfficeHud");var He=160,Ye=112,oa=250;function aa({office:t}){const e=(0,_.useRef)(null),s=Qt();return(0,_.useEffect)(()=>{const n=e.current;if(!n||!t||!s.visible)return;const i=n.getContext("2d");if(!i)return;const r=Math.min(2,Math.round(window.devicePixelRatio||1));n.width=He*r,n.height=Ye*r,i.setTransform(r,0,0,r,0,0);let o=-1;const a=u(()=>{t.frameCount!==o&&(o=t.frameCount,t.drawMinimap(i,He,Ye))},"paint");a();const l=setInterval(a,oa);return()=>clearInterval(l)},[t,s.visible]),(0,h.jsx)("canvas",{ref:e,"aria-label":"Office minimap",className:"hidden h-(--sz-7rem) w-(--sz-160px) cursor-pointer rounded-md border border-line bg-bg-2 @2xl:block",onClick:u(n=>{if(!t)return;const i=n.currentTarget.getBoundingClientRect(),r=(n.clientX-i.left)/i.width,o=(n.clientY-i.top)/i.height;t.centerOn(r*t.worldWidth,o*t.worldHeight)},"onClick")})}u(aa,"OfficeMinimap");var la=[1,10,60],Xe=250,$t=3e5;function ca({companyId:t,store:e,onReplayingChange:s}){const n=Qt(),[i,r]=(0,_.useState)(!1),[o,a]=(0,_.useState)(!1),[l,c]=(0,_.useState)(10),[d,m]=(0,_.useState)(0),f=(0,_.useRef)(0),g=(0,_.useMemo)(()=>{const w=Math.ceil(Date.now()/$t)*$t;return{fromMs:w-Hn,toMs:w}},[]),{data:v,isFetching:y,error:p}=D({queryKey:N.pixelsOffice.timeline(t,new Date(g.fromMs).toISOString(),new Date(g.toMs).toISOString()),queryFn:u(()=>Ht.timeline(t,{from:new Date(g.fromMs).toISOString(),to:new Date(g.toMs).toISOString()}),"queryFn"),enabled:i,staleTime:$t}),b=(0,_.useMemo)(()=>v?.events??[],[v]),x=(0,_.useCallback)((w,I)=>{I&&(f.current=0);const C=[];for(;f.current<b.length;){const k=b[f.current];if(!k||Date.parse(k.at)>w)break;C.push(k),f.current+=1}C.length===0&&!I||e.applyTimelineFrame(C,I)},[b,e]),T=(0,_.useCallback)(()=>{e.startReplay(),f.current=0,m(g.fromMs),r(!0),a(!0),s(!0)},[s,e,g.fromMs]),A=(0,_.useCallback)(()=>{a(!1),r(!1),f.current=0,e.stopReplay(),s(!1)},[s,e]);return(0,_.useEffect)(()=>{if(!i||!o||!n.visible||b.length===0)return;const w=setInterval(()=>{m(I=>{const C=I+Xe*l;return C>=g.toMs?(a(!1),g.toMs):C})},Xe);return()=>clearInterval(w)},[b.length,o,i,l,n.visible,g.toMs]),(0,_.useEffect)(()=>{!i||b.length===0||x(d,!1)},[x,d,b.length,i]),(0,_.useEffect)(()=>()=>{e.isReplaying()&&e.stopReplay()},[e]),i?(0,h.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:[(0,h.jsxs)(z,{size:"sm",variant:"ghost",onClick:u(()=>a(w=>!w),"onClick"),children:[o?(0,h.jsx)(Qe,{className:"size-4","aria-hidden":!0}):(0,h.jsx)(zt,{className:"size-4","aria-hidden":!0}),o?"Pause":"Play"]}),(0,h.jsx)("input",{type:"range","aria-label":"Replay position",min:g.fromMs,max:g.toMs,step:6e4,value:d,onChange:u(w=>{const I=Number(w.target.value),C=I<d;m(I),x(I,C)},"onChange"),className:"min-w-0 flex-1"}),(0,h.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:new Date(d).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),(0,h.jsx)("div",{className:"flex items-center gap-1",children:la.map(w=>(0,h.jsxs)(z,{size:"sm",variant:l===w?"secondary":"ghost",onClick:u(()=>c(w),"onClick"),children:[w,"x"]},w))}),(0,h.jsxs)(z,{size:"sm",variant:"primary",onClick:A,children:[(0,h.jsx)(Jn,{className:"size-4","aria-hidden":!0}),"Live"]}),y?(0,h.jsx)("span",{className:"text-xs text-ink-3",children:"Loading history…"}):null,p?(0,h.jsx)("span",{className:"text-xs text-bad",children:p instanceof Error?p.message:"Timeline unavailable"}):null]}):(0,h.jsxs)(z,{size:"sm",variant:"secondary",onClick:T,children:[(0,h.jsx)(zt,{className:"size-4","aria-hidden":!0}),"Replay last 24 h"]})}u(ca,"TimelineScrubber");var ua=2e3,Ge="(min-width: 1280px)";function qe(t){return t.map(e=>`${e.agentId}:${e.characterIndex}:${e.seatId}`).sort().join("|")}u(qe,"seatKey");function fa(){try{return localStorage.getItem(On)==="on"}catch{return!1}}u(fa,"readAmbientPreference");function Ya(){const{selectedCompanyId:t}=qn(),{setBreadcrumbs:e}=ss(),{pushToast:s}=ns(),n=Ue(),[i,r]=(0,_.useState)(null),{isMobile:o}=es(),[a,l]=(0,_.useState)(()=>window.matchMedia(Ge).matches);(0,_.useEffect)(()=>{const M=window.matchMedia(Ge),B=u(()=>l(M.matches),"onChange");return M.addEventListener("change",B),()=>M.removeEventListener("change",B)},[]);const[c,d]=(0,_.useState)([]),[m,f]=(0,_.useState)([]),[g,v]=(0,_.useState)(null),[y,p]=(0,_.useState)(!1),[b,x]=(0,_.useState)(fa),T=(0,_.useRef)(void 0),A=(0,_.useRef)(null),w=(0,_.useMemo)(()=>$o(t??"__none__"),[t]);(0,_.useEffect)(()=>{e([{label:"Pixels Office"}])},[e]),(0,_.useEffect)(()=>{Be(b);try{localStorage.setItem(On,b?"on":"off")}catch{return}},[b]),(0,_.useEffect)(()=>()=>Be(!1),[]);const I=D({queryKey:N.pixelsOffice.snapshot(t??""),queryFn:u(()=>Ht.snapshot(t),"queryFn"),enabled:!!t}),C=D({queryKey:N.liveRuns(t??""),queryFn:u(()=>Je.liveRunsForCompany(t,{limit:50}),"queryFn"),enabled:!!t}),{data:k}=D({queryKey:N.access.currentBoardAccess,queryFn:u(()=>tn.getCurrentBoardAccess(),"queryFn"),retry:!1}),R=kn(t,k),F=I.data;(0,_.useEffect)(()=>{F&&(w.seedSnapshot(F),d(w.getVisuals()))},[F,w]),(0,_.useEffect)(()=>{C.data&&(w.seedLiveRuns(C.data),d(w.getVisuals()))},[C.data,w]);const L=(0,_.useCallback)(()=>{T.current===void 0&&(T.current=setTimeout(()=>{T.current=void 0,!(typeof document<"u"&&document.hidden)&&n.invalidateQueries({queryKey:N.pixelsOffice.snapshot(t??"")})},ua))},[n,t]);(0,_.useEffect)(()=>()=>clearTimeout(T.current),[]),(0,_.useEffect)(()=>{if(!g||!F||!R||y)return;const M=g.readPlacements(),B=qe(M);B===qe(F.assignments)||B===A.current||(A.current=B,Ht.replaceSeats(F.companyId,M).then(()=>L()).catch(()=>{}))},[R,g,y,L,F,c]),(0,_.useEffect)(()=>w.subscribe(M=>{M.visualsChanged&&d(M.visuals),M.tickerChanged&&f(M.ticker.slice()),M.refetch&&L()}),[L,w]),os((0,_.useCallback)(M=>w.push(M),[w])),(0,_.useEffect)(()=>{const M=u(B=>{const Et=B.target;if(Et&&(Et.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(Et.tagName)))return;if(B.key==="Escape"){r(null),g?.select(null);return}if(B.key.toLowerCase()!=="f"||!g)return;const Wn=g.camera.followAgentId;g.follow(Wn?null:g.selectedAgentId)},"onKeyDown");return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[g]);const j=Ve({mutationFn:u(M=>Wt.update(M.issueId,{assigneeAgentId:M.agentId}),"mutationFn"),onSuccess:u((M,B)=>{n.invalidateQueries({queryKey:N.pixelsOffice.unassigned(t??"")}),L(),s({title:"Task assigned",tone:"success",action:{label:"Undo",onClick:u(()=>{Wt.update(B.issueId,{assigneeAgentId:B.previous}).then(()=>{n.invalidateQueries({queryKey:N.pixelsOffice.unassigned(t??"")}),L()})},"onClick")}})},"onSuccess"),onError:u(M=>{s({title:"Could not assign the task",body:M instanceof Error?M.message:String(M),tone:"error"})},"onError")}),P=(0,_.useCallback)((M,B)=>{R&&j.mutate({issueId:M,agentId:B,previous:null})},[j,R]),[H,J]=(0,_.useState)(null),bt=(0,_.useCallback)(M=>{if(H){P(H,M),J(null);return}r({kind:"agent",agentId:M})},[H,P]),jn=(0,_.useCallback)(M=>{r({kind:"object",object:M})},[]),Pn=(0,_.useMemo)(()=>F?.assignments??[],[F]),se=(0,_.useMemo)(()=>i?.kind==="agent"?F?.agents.find(M=>M.id===i.agentId)??null:null,[i,F]),Bn=(0,_.useMemo)(()=>i?.kind==="agent"?c.find(M=>M.agentId===i.agentId)??null:null,[i,c]),Dn=(0,_.useMemo)(()=>g?.rooms??[],[g]),$n=(0,_.useCallback)(M=>{r({kind:"object",object:M});const B=g?.objectAnchor(M);B&&g?.centerOn(B.x,B.y)},[g]);if(!t)return(0,h.jsx)("div",{className:"p-6 text-sm text-ink-3",children:"Select a company to view the office."});if(I.isLoading)return(0,h.jsx)(ls,{});if(I.isError)return(0,h.jsxs)("div",{className:"space-y-3 p-6",children:[(0,h.jsx)("p",{className:"text-sm text-ink-3",children:I.error instanceof Error?I.error.message:"Could not load the office."}),(0,h.jsx)(z,{variant:"secondary",size:"sm",onClick:u(()=>{I.refetch()},"onClick"),children:"Retry"})]});const It=i?.kind==="agent"&&se?(0,h.jsx)(Go,{companyId:t,agent:se,visual:Bn,onClose:u(()=>r(null),"onClose")}):i?.kind==="object"?(0,h.jsx)(ta,{companyId:t,object:i.object,onClose:u(()=>r(null),"onClose")}):null,ie=(0,h.jsx)(ra,{companyId:t,ticker:m,canAssign:R,ambientEnabled:b,onToggleAmbient:x,onOpenObject:$n,compact:o,armedIssueId:H,onArmIssue:J});return(0,h.jsxs)("div",{className:"flex flex-col gap-3 p-3 md:gap-4 md:p-6",children:[(0,h.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:items-center md:justify-between md:gap-3",children:[(0,h.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,h.jsx)("h1",{className:"text-lg font-semibold text-ink",children:"Pixels Office"}),(0,h.jsxs)("span",{className:"text-xs text-ink-3",children:[c.length," agents",y?" · replaying history":""]})]}),(0,h.jsx)("div",{className:"-mx-3 flex items-center gap-1 overflow-x-auto px-3 md:mx-0 md:flex-wrap md:overflow-visible md:px-0",children:Dn.map(M=>(0,h.jsx)(z,{size:"sm",variant:"ghost",className:"shrink-0",onClick:u(()=>g?.centerOn(M.centerX,M.centerY),"onClick"),children:M.label},M.id))})]}),o?null:ie,(0,h.jsxs)("div",{className:"flex min-h-0 flex-col gap-4 xl:flex-row",children:[(0,h.jsxs)(is,{className:"@container relative min-w-0 flex-1 overflow-hidden p-0",children:[H?(0,h.jsxs)("div",{className:"absolute inset-x-2 top-2 z-10 flex items-center justify-between gap-2 rounded-md border border-line bg-bg-2 px-3 py-2 text-xs text-ink shadow-md",children:[(0,h.jsx)("span",{children:"Tap an agent to assign the selected task."}),(0,h.jsx)(z,{size:"sm",variant:"ghost",onClick:u(()=>J(null),"onClick"),children:"Cancel"})]}):null,(0,h.jsx)(Ho,{companyId:t,visuals:c,assignments:Pn,store:w,onController:v,onSelectAgent:bt,onSelectObject:jn,onAssignIssue:P}),(0,h.jsx)("div",{className:"absolute bottom-3 right-3",children:(0,h.jsx)(aa,{office:g})})]}),It&&a?(0,h.jsx)("div",{className:"relative w-full shrink-0 xl:w-(--sz-360px)",children:(0,h.jsx)("div",{className:"absolute inset-0",children:It})}):null]}),o?ie:null,(0,h.jsx)(fs,{open:It!==null&&!a,onOpenChange:u(M=>M?null:r(null),"onOpenChange"),children:(0,h.jsxs)(cs,{side:"bottom",showCloseButton:!1,className:"max-h-(--sz-80vh) gap-0 rounded-t-xl p-0 pb-(--sz-calc-safe-bottom)",children:[(0,h.jsx)(us,{className:"sr-only",children:"Office details"}),(0,h.jsx)("div",{className:"mx-auto mt-2 h-1.5 w-12 shrink-0 rounded-full bg-ink-3/30","aria-hidden":"true"}),(0,h.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:It})]})}),(0,h.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,h.jsx)(ca,{companyId:t,store:w,onReplayingChange:p})})]})}u(Ya,"PixelsOffice");export{Ya as PixelsOffice};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ae=Object.defineProperty;var a=(t,c)=>ae(t,"name",{value:c,configurable:!0});import{i as R}from"./rolldown-runtime-ZpX3ckPj.js";import{l as A,na as te,ta as ne}from"./createLucideIcon-CpKa5z2C.js";import{X as ie,_ as y,t as p,v as K}from"./queryKeys-BVuBtip7.js";import{n as re}from"./CompanyContext-BawkN74-.js";import{Z as I,t as S}from"./router-DVO-ie3J.js";import{t as le}from"./label-BZn646Ew.js";import{t as ce}from"./flask-conical-DbI6ckSE.js";import{t as n}from"./button-Ckn7hiVo.js";import{t as de}from"./plus-CXoQSz3w.js";import{t as oe}from"./power-CPZD6Q9M.js";import{t as me}from"./settings-Dw-RMThV.js";import{t as xe}from"./trash-v7m_afTU.js";import{t as D}from"./triangle-alert-H5UZJkol.js";import{t as o}from"./badge-C_Yv1fHA.js";import{a as he}from"./ToastContext-frwty7Yo.js";import{a as B,c as ue,i as z,n as M,r as q,s as J,t as L}from"./dialog-BcuAydRt.js";import{t as pe}from"./input-DGxLesAp.js";import{t as x}from"./plugins-CRoAPVrv.js";import{n as ge}from"./BreadcrumbContext-BopoVMP4.js";import{r as je,t as _}from"./card-Bnw8dg8v.js";var d=R(te(),1),e=R(ne(),1);function Ne(t){return t?t.split(/\r?\n/).map(c=>c.trim()).find(Boolean)??null:null}a(Ne,"firstNonEmptyLine");function U(t){return Ne(t.lastError)??"Plugin entered an error state without a stored error message."}a(U,"getPluginErrorSummary");function $(t){if(t.bundledExperimental)return!0;const c=t.packageName??"",h=t.packagePath??"";return c.includes("sandbox")||h.includes("sandbox")?!0:t.manifestJson?.environmentDrivers?.some(i=>i.kind==="sandbox_provider")===!0}a($,"isExperimentalPluginIdentity");function H(){return(0,e.jsx)(o,{variant:"outline",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 hover:bg-amber-500/10 dark:text-amber-200",children:"Beta"})}a(H,"ExperimentalBadge");function Oe(){const{selectedCompany:t}=re(),{setBreadcrumbs:c}=ge(),h=ie(),{pushToast:i}=he(),[b,T]=(0,d.useState)(""),[V,k]=(0,d.useState)(!1),[v,g]=(0,d.useState)(null),[W,X]=(0,d.useState)(""),[m,P]=(0,d.useState)(null);(0,d.useEffect)(()=>{c([{label:t?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Plugins"}])},[t?.name,c]);const{data:Z,isLoading:G,error:Y}=K({queryKey:p.plugins.all,queryFn:a(()=>x.list(),"queryFn")}),w=K({queryKey:p.plugins.examples,queryFn:a(()=>x.listBundled(),"queryFn")}),j=a(()=>{h.invalidateQueries({queryKey:p.plugins.all}),h.invalidateQueries({queryKey:p.plugins.examples}),h.invalidateQueries({queryKey:p.plugins.uiContributions})},"invalidatePluginQueries"),r=y({mutationFn:a(s=>x.install(s),"mutationFn"),onSuccess:a(()=>{j(),k(!1),T(""),i({title:"Plugin installed successfully",tone:"success"})},"onSuccess"),onError:a(s=>{i({title:"Failed to install plugin",body:s.message,tone:"error"})},"onError")}),N=y({mutationFn:a(s=>x.uninstall(s),"mutationFn"),onSuccess:a(()=>{j(),i({title:"Plugin uninstalled successfully",tone:"success"})},"onSuccess"),onError:a(s=>{i({title:"Failed to uninstall plugin",body:s.message,tone:"error"})},"onError")}),f=y({mutationFn:a(s=>x.enable(s),"mutationFn"),onSuccess:a(()=>{j(),i({title:"Plugin enabled",tone:"success"})},"onSuccess"),onError:a(s=>{i({title:"Failed to enable plugin",body:s.message,tone:"error"})},"onError")}),O=y({mutationFn:a(s=>x.disable(s),"mutationFn"),onSuccess:a(()=>{j(),i({title:"Plugin disabled",tone:"info"})},"onSuccess"),onError:a(s=>{i({title:"Failed to disable plugin",body:s.message,tone:"error"})},"onError")}),u=Z??[],C=w.data??[],ee=new Map(u.map(s=>[s.packageName,s])),E=new Map(C.map(s=>[s.packageName,s])),Q=r.variables?.isLocalPath?r.error?.message??null:null,se=(0,d.useMemo)(()=>new Map(u.map(s=>[s.id,U(s)])),[u]);return G?(0,e.jsx)("div",{className:"p-4 text-sm text-ink-3",children:"Loading plugins..."}):Y?(0,e.jsx)("div",{className:"p-4 text-sm text-bad",children:"Failed to load plugins."}):(0,e.jsxs)("div",{className:"max-w-6xl space-y-6",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(I,{className:"h-6 w-6 text-ink-3"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Plugin Manager"})]}),(0,e.jsxs)(L,{open:V,onOpenChange:k,children:[(0,e.jsx)(ue,{asChild:!0,children:(0,e.jsxs)(n,{size:"sm",className:"gap-2",children:[(0,e.jsx)(de,{className:"h-4 w-4"}),"Install Plugin"]})}),(0,e.jsxs)(M,{children:[(0,e.jsxs)(B,{children:[(0,e.jsx)(J,{children:"Install Plugin"}),(0,e.jsx)(q,{children:"Enter the npm package name of the plugin you wish to install."})]}),(0,e.jsx)("div",{className:"grid gap-4 py-4",children:(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(le,{htmlFor:"packageName",children:"npm Package Name"}),(0,e.jsx)(pe,{id:"packageName",placeholder:"@tickernelz/wardmote-plugin-example",value:b,onChange:a(s=>T(s.target.value),"onChange")})]})}),(0,e.jsxs)(z,{children:[(0,e.jsx)(n,{variant:"secondary",onClick:a(()=>k(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(n,{onClick:a(()=>r.mutate({packageName:b}),"onClick"),disabled:!b||r.isPending,children:r.isPending?"Installing...":"Install"})]})]})]})]}),(0,e.jsx)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)(D,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-700"}),(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-ink",children:"Plugins are alpha."}),(0,e.jsx)("p",{className:"text-ink-3",children:"The plugin runtime and API surface are still changing. Expect breaking changes while this feature settles."})]})]})}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(ce,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Available Plugins"}),(0,e.jsx)(o,{variant:"outline",children:"Bundled"})]}),Q&&(0,e.jsx)("div",{className:"rounded-md border border-bad/25 bg-bad/[0.06] px-4 py-3 text-sm text-bad whitespace-pre-wrap break-words",children:Q}),w.isLoading?(0,e.jsx)("div",{className:"text-sm text-ink-3",children:"Loading bundled plugins..."}):w.error?(0,e.jsx)("div",{className:"text-sm text-bad",children:"Failed to load bundled plugins."}):C.length===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed px-4 py-3 text-sm text-ink-3",children:"No bundled plugins were found in this checkout."}):(0,e.jsx)(_,{className:"block py-0",children:(0,e.jsx)("ul",{className:"divide-y",children:C.map(s=>{const l=ee.get(s.packageName),F=r.isPending&&r.variables?.isLocalPath&&r.variables.packageName===s.localPath;return(0,e.jsx)("li",{children:(0,e.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:s.displayName}),(0,e.jsx)(o,{variant:"outline",children:s.tag==="first-party"?"First-party":"Example"}),$({packageName:s.packageName,packagePath:s.localPath,bundledExperimental:s.experimental})&&(0,e.jsx)(H,{}),l?(0,e.jsx)(o,{variant:l.status==="ready"?"default":"secondary",className:l.status==="ready"?"bg-green-600 hover:bg-green-700":"",children:l.status}):(0,e.jsx)(o,{variant:"secondary",children:"Not installed"})]}),(0,e.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:s.description}),(0,e.jsx)("p",{className:"mt-1 text-xs text-ink-3",children:s.packageName}),F&&!s.hasBuiltEntrypoints&&(0,e.jsx)("p",{className:"mt-2 text-xs text-ink-3",children:"Building plugin..."})]}),(0,e.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:l?(0,e.jsxs)(e.Fragment,{children:[l.status!=="ready"&&(0,e.jsx)(n,{variant:"secondary",size:"sm",disabled:f.isPending,onClick:a(()=>f.mutate(l.id),"onClick"),children:"Enable"}),(0,e.jsx)(n,{variant:"secondary",size:"sm",asChild:!0,children:(0,e.jsx)(S,{to:`/company/settings/instance/plugins/${l.id}`,children:l.status==="ready"?"Open Settings":"Review"})})]}):(0,e.jsx)(n,{size:"sm",disabled:F||r.isPending,onClick:a(()=>r.mutate({packageName:s.localPath,isLocalPath:!0}),"onClick"),children:F?"Installing...":"Install"})})]})},s.packageName)})})})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(I,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Installed Plugins"})]}),u.length?(0,e.jsx)(_,{className:"block py-0",children:(0,e.jsx)("ul",{className:"divide-y",children:u.map(s=>(0,e.jsx)("li",{children:(0,e.jsxs)("div",{className:"flex items-start gap-4 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(S,{to:`/company/settings/instance/plugins/${s.id}`,className:"font-medium hover:underline truncate block",title:s.manifestJson.displayName??s.packageName,children:s.manifestJson.displayName??s.packageName}),E.has(s.packageName)&&(0,e.jsx)(o,{variant:"outline",children:E.get(s.packageName)?.tag==="first-party"?"First-party":"Example"}),$({packageName:s.packageName,packagePath:s.packagePath,manifestJson:s.manifestJson,bundledExperimental:E.get(s.packageName)?.experimental})&&(0,e.jsx)(H,{})]}),(0,e.jsx)("div",{children:(0,e.jsxs)("p",{className:"text-xs text-ink-3 mt-0.5 truncate",title:s.packageName,children:[s.packageName," · v",s.manifestJson.version??s.version]})}),(0,e.jsx)("p",{className:"text-sm text-ink-3 truncate mt-0.5",title:s.manifestJson.description,children:s.manifestJson.description||"No description provided."}),s.status==="error"&&(0,e.jsx)("div",{className:"mt-3 rounded-md border border-red-500/25 bg-red-500/[0.06] px-3 py-2",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-start gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-red-700 dark:text-red-300",children:[(0,e.jsx)(D,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("span",{children:"Plugin error"})]}),(0,e.jsx)("p",{className:"mt-1 text-sm text-red-700/90 dark:text-red-200/90 break-words",title:s.lastError??void 0,children:se.get(s.id)})]}),(0,e.jsx)(n,{variant:"danger",size:"sm",onClick:a(()=>P(s),"onClick"),children:"View full error"})]})})]}),(0,e.jsx)("div",{className:"flex shrink-0 self-center",children:(0,e.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(o,{variant:s.status==="ready"?"default":s.status==="error"?"destructive":"secondary",className:A("shrink-0",s.status==="ready"?"bg-green-600 hover:bg-green-700":""),children:s.status}),(0,e.jsx)(n,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:s.status==="ready"?"Disable":"Enable",onClick:a(()=>{s.status==="ready"?O.mutate(s.id):f.mutate(s.id)},"onClick"),disabled:f.isPending||O.isPending,children:(0,e.jsx)(oe,{className:A("h-4 w-4",s.status==="ready"?"text-green-600":"")})}),(0,e.jsx)(n,{variant:"danger",size:"icon-sm",className:"h-8 w-8",title:"Uninstall",onClick:a(()=>{g(s.id),X(s.manifestJson.displayName??s.packageName)},"onClick"),disabled:N.isPending,children:(0,e.jsx)(xe,{className:"h-4 w-4"})})]}),(0,e.jsx)(n,{variant:"secondary",size:"sm",className:"mt-2 h-8",asChild:!0,children:(0,e.jsxs)(S,{to:`/company/settings/instance/plugins/${s.id}`,children:[(0,e.jsx)(me,{className:"h-4 w-4"}),"Configure"]})})]})})]})},s.id))})}):(0,e.jsx)(_,{className:"bg-bg-3/30",children:(0,e.jsxs)(je,{className:"flex flex-col items-center justify-center py-10",children:[(0,e.jsx)(I,{className:"h-10 w-10 text-ink-3 mb-4"}),(0,e.jsx)("p",{className:"text-sm font-medium",children:"No plugins installed"}),(0,e.jsx)("p",{className:"text-xs text-ink-3 mt-1",children:"Install a plugin to extend functionality."})]})})]}),(0,e.jsx)(L,{open:v!==null,onOpenChange:a(s=>{s||g(null)},"onOpenChange"),children:(0,e.jsxs)(M,{children:[(0,e.jsxs)(B,{children:[(0,e.jsx)(J,{children:"Uninstall Plugin"}),(0,e.jsxs)(q,{children:["Are you sure you want to uninstall ",(0,e.jsx)("strong",{children:W}),"? This action cannot be undone."]})]}),(0,e.jsxs)(z,{children:[(0,e.jsx)(n,{variant:"secondary",onClick:a(()=>g(null),"onClick"),children:"Cancel"}),(0,e.jsx)(n,{variant:"delete",disabled:N.isPending,onClick:a(()=>{v&&N.mutate(v,{onSettled:a(()=>g(null),"onSettled")})},"onClick"),children:N.isPending?"Uninstalling...":"Uninstall"})]})]})}),(0,e.jsx)(L,{open:m!==null,onOpenChange:a(s=>{s||P(null)},"onOpenChange"),children:(0,e.jsxs)(M,{className:"sm:max-w-2xl",children:[(0,e.jsxs)(B,{children:[(0,e.jsx)(J,{children:"Error Details"}),(0,e.jsxs)(q,{children:[m?.manifestJson.displayName??m?.packageName??"Plugin"," hit an error state."]})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"rounded-md border border-red-500/25 bg-red-500/[0.06] px-4 py-3",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)(D,{className:"mt-0.5 h-4 w-4 shrink-0 text-red-700 dark:text-red-300"}),(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-red-700 dark:text-red-300",children:"What errored"}),(0,e.jsx)("p",{className:"text-red-700/90 dark:text-red-200/90 break-words",children:m?U(m):"No error summary available."})]})]})}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Full error output"}),(0,e.jsx)("pre",{className:"max-h-(--sz-50vh) overflow-auto rounded-md border bg-bg-3/40 p-3 text-xs leading-5 whitespace-pre-wrap break-words",children:m?.lastError??"No stored error message."})]})]}),(0,e.jsx)(z,{children:(0,e.jsx)(n,{variant:"secondary",onClick:a(()=>P(null),"onClick"),children:"Close"})})]})})]})}a(Oe,"PluginManager");export{Oe as PluginManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M=Object.defineProperty;var p=(n,t)=>M(n,"name",{value:t,configurable:!0});import{i as b}from"./rolldown-runtime-ZpX3ckPj.js";import{na as _,ta as S}from"./createLucideIcon-CpKa5z2C.js";import{v as B}from"./star-DMFjS4pe.js";import{t as K,v as q}from"./queryKeys-BVuBtip7.js";import{n as R}from"./CompanyContext-BawkN74-.js";import{r as U,t as D}from"./router-DVO-ie3J.js";import{t as k}from"./arrow-left-B4kJ2C9P.js";import{t as w}from"./button-Ckn7hiVo.js";import{t as z}from"./plugins-CRoAPVrv.js";import{a as F,t as A}from"./slots-DEJtGm8A.js";import{n as L}from"./BreadcrumbContext-BopoVMP4.js";import{Zt as P}from"./index-BOCwP1Ce.js";var m=b(_(),1),s=b(S(),1);function re(){const n=B(),{companyPrefix:t,pluginId:a,pluginRoutePath:r}=n,c=n["*"],{companies:d,selectedCompanyId:N}=R(),{setBreadcrumbs:h}=L(),y=(0,m.useMemo)(()=>{if(!t)return null;const i=t.toUpperCase();return d.find(e=>e.issuePrefix.toUpperCase()===i)??null},[d,t]),C=!!t&&!y,o=(0,m.useMemo)(()=>y?y.id:t?null:N??null,[y,t,N]),x=(0,m.useMemo)(()=>o?d.find(i=>i.id===o)?.issuePrefix??null:null,[d,o]),{data:l}=q({queryKey:K.plugins.uiContributions,queryFn:p(()=>z.listUiContributions(),"queryFn"),enabled:!!o&&(!!a||!!r)}),f=(0,m.useMemo)(()=>{if(!l)return null;if(a){const e=l.find(g=>g.pluginId===a);if(!e)return null;const u=e.slots.find(g=>g.type==="page");return u?{...u,pluginId:e.pluginId,pluginKey:e.pluginKey,pluginDisplayName:e.displayName,pluginVersion:e.version}:null}if(!r)return null;const i=l.flatMap(e=>{const u=e.slots.find(g=>g.type==="page"&&g.routePath===r);return u?[{...u,pluginId:e.pluginId,pluginKey:e.pluginKey,pluginDisplayName:e.displayName,pluginVersion:e.version}]:[]});return i.length!==1?null:i[0]??null},[a,r,l]),I=(0,m.useMemo)(()=>({companyId:o??null,companyPrefix:x}),[o,x]),v=(0,m.useMemo)(()=>{if(!r||!l)return!1;const i=l.flatMap(e=>e.slots.map(u=>({...u,pluginId:e.pluginId,pluginKey:e.pluginKey,pluginDisplayName:e.displayName,pluginVersion:e.version})));return F(i,r)!==null},[l,r]);if((0,m.useEffect)(()=>{if(f){if(v){h([{label:V(f,c)}]);return}h([{label:"Plugins",href:"/company/settings/instance/plugins"},{label:f.pluginDisplayName}])}},[f,c,h,v]),!o)return C?(0,s.jsx)(P,{scope:"invalid_company_prefix",requestedPrefix:t}):(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"Select an organization to view this page."})});if(!l)return(0,s.jsx)("div",{className:"text-sm text-ink-3",children:"Loading…"});if(!a&&r&&l.filter(i=>i.slots.some(e=>e.type==="page"&&e.routePath===r)).length>1)return(0,s.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 px-3 py-2 text-sm text-bad",children:["Multiple plugins declare the route ",(0,s.jsx)("code",{children:r}),". Use the plugin-id route until the conflict is resolved."]});if(!f){if(r)return(0,s.jsx)(P,{scope:"board"});const i=a?`/company/settings/instance/plugins/${a}`:"/company/settings/instance/plugins";return(0,s.jsx)(U,{to:i,replace:!0})}return(0,s.jsxs)("div",{className:"space-y-4",children:[!v&&(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsx)(w,{variant:"ghost",size:"sm",asChild:!0,children:(0,s.jsxs)(D,{to:x?`/${x}/dashboard`:"/dashboard",children:[(0,s.jsx)(k,{className:"h-4 w-4 mr-1"}),"Back"]})})}),(0,s.jsx)(A,{slot:f,context:I,className:"min-h-(--sz-200px)",missingBehavior:"placeholder"})]})}p(re,"PluginPage");function V(n,t){return $(t)??n.displayName??n.pluginDisplayName}p(V,"resolveRouteSidebarPageTitle");function $(n){const t=(n??"").split("/").filter(Boolean).map(E);return t.length===0?null:t[0]==="page"&&t.length>1?j(t.slice(1).join("/"),{preserveCase:!0}):j(t[0]??null)}p($,"titleFromRouteSplat");function j(n,t={}){const a=n?.trim();if(!a)return null;const r=a.split("/").filter(Boolean).at(-1)??a,c=(r.split("::").at(-1)??r).replace(/\.[^.]+$/,"").replace(/[-_]+/g," ").trim();return c?t.preserveCase?c:c.replace(/\b\w/g,d=>d.toUpperCase()):null}p(j,"titleFromPath");function E(n){try{return decodeURIComponent(n)}catch{return n}}p(E,"decodeRouteSegment");export{re as PluginPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var de=Object.defineProperty;var c=(s,a)=>de(s,"name",{value:a,configurable:!0});import{i as te}from"./rolldown-runtime-ZpX3ckPj.js";import{na as xe,t as ae,ta as me}from"./createLucideIcon-CpKa5z2C.js";import{v as he}from"./star-DMFjS4pe.js";import{X as ne,_ as W,t as w,v as q}from"./queryKeys-BVuBtip7.js";import{n as ue}from"./CompanyContext-BawkN74-.js";import{Z as ge,r as pe,t as V}from"./router-DVO-ie3J.js";import{n as Y,t as fe}from"./tabs-BXjEFplq.js";import{t as je}from"./PathInstructionsModal-fE_gzSEE.js";import{t as be}from"./arrow-left-B4kJ2C9P.js";import{t as Ne}from"./calendar-clock-DxEyQi4Q.js";import{t as ve}from"./circle-x-CkI_5U1-.js";import{t as ye}from"./clock-DM_8qfdH.js";import{n as U}from"./package-DczbARit.js";import{t as ke}from"./folder-open-DdjnhxeI.js";import{r as M,t as $}from"./button-Ckn7hiVo.js";import{t as we}from"./save-jNtYK7zU.js";import{t as Ce}from"./shield-alert-BFIzeqOf.js";import{t as Se}from"./triangle-alert-H5UZJkol.js";import{t as qe}from"./webhook-CaDCJLSg.js";import{t as p}from"./badge-C_Yv1fHA.js";import{t as k}from"./plugins-CRoAPVrv.js";import{o as Fe,t as Le}from"./slots-DEJtGm8A.js";import{n as De}from"./BreadcrumbContext-BopoVMP4.js";import{n as R,r as X,t as Pe}from"./JsonSchemaForm-CzZl1-wr.js";import{i as Z,o as F,r as L,s as D,t as P}from"./card-Bnw8dg8v.js";import{oi as Me}from"./index-BOCwP1Ce.js";import{t as J}from"./separator-D8YzlNNu.js";import{t as $e}from"./useManagedSandboxOnly-DLLb0Bdf.js";var ie={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};ie.node;var Ke=ae(ie),re={name:"square-activity",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]],aliases:["activity-square"]};re.node;var G=ae(re),h=te(xe(),1),e=te(me(),1);function Ns(){const{selectedCompany:s,selectedCompanyId:a}=ue(),{setBreadcrumbs:n}=De(),{companyPrefix:r,pluginId:l}=he(),{hideHostPaths:m}=$e(),[f,g]=(0,h.useState)("configuration"),{data:i,isLoading:j}=q({queryKey:w.plugins.detail(l),queryFn:c(()=>k.get(l),"queryFn"),enabled:!!l}),{data:u,isLoading:v}=q({queryKey:w.plugins.health(l),queryFn:c(()=>k.health(l),"queryFn"),enabled:!!l&&i?.status==="ready",refetchInterval:3e4}),{data:o}=q({queryKey:w.plugins.dashboard(l),queryFn:c(()=>k.dashboard(l),"queryFn"),enabled:!!l,refetchInterval:3e4}),{data:b}=q({queryKey:w.plugins.logs(l),queryFn:c(()=>k.logs(l,{limit:50}),"queryFn"),enabled:!!l&&i?.status==="ready",refetchInterval:3e4}),N=i?.manifestJson?.instanceConfigSchema,d=N&&N.properties&&Object.keys(N.properties).length>0,y=l&&a?w.plugins.config(l,a):["plugins",l??"__missing_plugin__","companies","__missing_company__","config"],{data:T,isLoading:C}=q({queryKey:y,queryFn:c(()=>k.getConfig(l,a),"queryFn"),enabled:!!l&&!!d&&!!a}),{slots:S}=Fe({slotTypes:["settingsPage"],companyId:a,enabled:!!a}),K=S.filter(t=>t.pluginId===l),E=K.length>0;if((0,h.useEffect)(()=>{n([{label:s?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Plugins",href:"/company/settings/instance/plugins"},{label:i?.manifestJson?.displayName??i?.packageName??"Plugin Details"}])},[s?.name,n,r,i]),(0,h.useEffect)(()=>{g("configuration")},[l]),j)return(0,e.jsx)("div",{className:"p-4 text-sm text-ink-3",children:"Loading plugin details..."});if(!i)return(0,e.jsx)(pe,{to:"/company/settings/instance/plugins",replace:!0});const _=i.status,x=i.status==="ready"?"default":i.status==="error"?"destructive":"secondary",le=i.manifestJson.description||"No description provided.",O=i.manifestJson.capabilities??[],B=i.manifestJson.environmentDrivers??[],H=i.manifestJson.localFolders??[],Q=H.length>0&&!m,ce=B.map(t=>t.displayName?.trim()||t.driverKey).filter((t,A,oe)=>oe.indexOf(t)===A).join(", ");return(0,e.jsxs)("div",{className:"max-w-6xl space-y-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(V,{to:"/company/settings/instance/plugins",children:(0,e.jsx)($,{variant:"secondary",size:"icon",className:"h-8 w-8",children:(0,e.jsx)(be,{className:"h-4 w-4"})})}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(ge,{className:"h-6 w-6 text-ink-3"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:i.manifestJson.displayName??i.packageName}),(0,e.jsx)(p,{variant:x,className:"ml-2",children:_}),(0,e.jsxs)(p,{variant:"outline",className:"ml-1",children:["v",i.manifestJson.version??i.version]})]})]}),(0,e.jsxs)(fe,{value:f,onValueChange:c(t=>g(t),"onValueChange"),className:"space-y-6",children:[(0,e.jsx)(Me,{align:"start",items:[{value:"configuration",label:"Configuration"},{value:"status",label:"Status"}],value:f,onValueChange:c(t=>g(t),"onValueChange")}),(0,e.jsx)(Y,{value:"configuration",className:"space-y-6",children:(0,e.jsxs)("div",{className:"space-y-8",children:[(0,e.jsxs)("section",{className:"space-y-5",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:"About"}),(0,e.jsxs)("div",{className:"grid gap-8 lg:grid-cols-(--gtc-52)",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium text-ink-3",children:"Description"}),(0,e.jsx)("p",{className:"text-sm leading-6 text-ink/90",children:le})]}),(0,e.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("h3",{className:"font-medium text-ink-3",children:"Author"}),(0,e.jsx)("p",{className:"text-ink",children:i.manifestJson.author})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"font-medium text-ink-3",children:"Categories"}),(0,e.jsx)("div",{className:"flex flex-wrap gap-2",children:i.categories.length>0?i.categories.map(t=>(0,e.jsx)(p,{variant:"outline",className:"capitalize",children:t},t)):(0,e.jsx)("span",{className:"text-ink",children:"None"})})]})]})]})]}),(0,e.jsx)(J,{}),(0,e.jsxs)("section",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"space-y-1",children:(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Settings"})}),Q?(0,e.jsx)(_e,{pluginId:l,companyId:a,declarations:H}):null,E?(0,e.jsx)("div",{className:"space-y-3",children:K.map(t=>(0,e.jsx)(Le,{slot:t,context:{companyId:a,companyPrefix:r??null},missingBehavior:"placeholder"},`${t.pluginKey}:${t.id}`))}):d?(0,e.jsx)(Je,{pluginId:l,companyId:a,schema:N,initialValues:T?.configJson,isLoading:C,pluginStatus:i.status,supportsConfigTest:i.supportsConfigTest===!0}):B.length>0?(0,e.jsxs)("div",{className:"rounded-md border border-line/60 bg-bg-3/20 px-4 py-3 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-ink",children:"Configure this plugin from Settings → Environments."}),(0,e.jsxs)("p",{className:"mt-1 text-ink-3",children:[ce||"This plugin"," registers environment runtime settings there so the execution target stays instance-scoped while secret bindings still resolve through the selected organization context."]}),(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(V,{to:"/company/settings/instance/environments",children:(0,e.jsx)($,{variant:"secondary",size:"sm",children:"Open Environments"})})})]}):Q?null:(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"This plugin does not require any settings."})]})]})}),(0,e.jsx)(Y,{value:"status",className:"space-y-6",children:(0,e.jsxs)("div",{className:"grid gap-6 xl:grid-cols-(--gtc-39)",children:[(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)(P,{children:[(0,e.jsxs)(F,{children:[(0,e.jsxs)(D,{className:"text-base flex items-center gap-1.5",children:[(0,e.jsx)(U,{className:"h-4 w-4"}),"Runtime Dashboard"]}),(0,e.jsx)(Z,{children:"Worker process, scheduled jobs, and webhook deliveries"})]}),(0,e.jsx)(L,{className:"space-y-6",children:o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("h3",{className:"text-sm font-medium mb-3 flex items-center gap-1.5",children:[(0,e.jsx)(U,{className:"h-3.5 w-3.5 text-ink-3"}),"Worker Process"]}),o.worker?(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Status"}),(0,e.jsx)(p,{variant:o.worker.status==="running"?"default":"secondary",children:o.worker.status})]}),(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"PID"}),(0,e.jsx)("span",{className:"font-mono text-xs",children:o.worker.pid??"—"})]}),(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Uptime"}),(0,e.jsx)("span",{className:"text-xs",children:ze(o.worker.uptime)})]}),(0,e.jsxs)("div",{className:"flex justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Pending RPCs"}),(0,e.jsx)("span",{className:"text-xs",children:o.worker.pendingRequests})]}),o.worker.totalCrashes>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex justify-between col-span-2",children:[(0,e.jsxs)("span",{className:"text-ink-3 flex items-center gap-1",children:[(0,e.jsx)(Se,{className:"h-3 w-3 text-amber-500"}),"Crashes"]}),(0,e.jsxs)("span",{className:"text-xs",children:[o.worker.consecutiveCrashes," consecutive / ",o.worker.totalCrashes," total"]})]}),o.worker.lastCrashAt&&(0,e.jsxs)("div",{className:"flex justify-between col-span-2",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Last Crash"}),(0,e.jsx)("span",{className:"text-xs",children:We(o.worker.lastCrashAt)})]})]})]}):(0,e.jsx)("p",{className:"text-sm text-ink-3 italic",children:"No worker process registered."})]}),(0,e.jsx)(J,{}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("h3",{className:"text-sm font-medium mb-3 flex items-center gap-1.5",children:[(0,e.jsx)(Ne,{className:"h-3.5 w-3.5 text-ink-3"}),"Recent Job Runs"]}),o.recentJobRuns.length>0?(0,e.jsx)("div",{className:"space-y-2",children:o.recentJobRuns.map(t=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md bg-bg-3/50 px-2 py-1.5 text-sm",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)(Oe,{status:t.status}),(0,e.jsx)("span",{className:"truncate font-mono text-xs",title:t.jobKey??t.jobId,children:t.jobKey??t.jobId.slice(0,8)}),(0,e.jsx)(p,{variant:"outline",className:"px-1 py-0 text-(length:--text-nano)",children:t.trigger})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 text-xs text-ink-3",children:[t.durationMs!=null?(0,e.jsx)("span",{children:ee(t.durationMs)}):null,(0,e.jsx)("span",{title:t.createdAt,children:se(t.createdAt)})]})]},t.id))}):(0,e.jsx)("p",{className:"text-sm text-ink-3 italic",children:"No job runs recorded yet."})]}),(0,e.jsx)(J,{}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("h3",{className:"text-sm font-medium mb-3 flex items-center gap-1.5",children:[(0,e.jsx)(qe,{className:"h-3.5 w-3.5 text-ink-3"}),"Recent Webhook Deliveries"]}),o.recentWebhookDeliveries.length>0?(0,e.jsx)("div",{className:"space-y-2",children:o.recentWebhookDeliveries.map(t=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md bg-bg-3/50 px-2 py-1.5 text-sm",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)(Be,{status:t.status}),(0,e.jsx)("span",{className:"truncate font-mono text-xs",title:t.webhookKey,children:t.webhookKey})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 text-xs text-ink-3",children:[t.durationMs!=null?(0,e.jsx)("span",{children:ee(t.durationMs)}):null,(0,e.jsx)("span",{title:t.createdAt,children:se(t.createdAt)})]})]},t.id))}):(0,e.jsx)("p",{className:"text-sm text-ink-3 italic",children:"No webhook deliveries recorded yet."})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 border-t border-line/50 pt-2 text-xs text-ink-3",children:[(0,e.jsx)(ye,{className:"h-3 w-3"}),"Last checked: ",new Date(o.checkedAt).toLocaleTimeString()]})]}):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Runtime diagnostics are unavailable right now."})})]}),b&&b.length>0?(0,e.jsxs)(P,{children:[(0,e.jsxs)(F,{children:[(0,e.jsxs)(D,{className:"text-base flex items-center gap-1.5",children:[(0,e.jsx)(G,{className:"h-4 w-4"}),"Recent Logs"]}),(0,e.jsxs)(Z,{children:["Last ",b.length," log entries"]})]}),(0,e.jsx)(L,{children:(0,e.jsx)("div",{className:"max-h-64 space-y-1 overflow-y-auto font-mono text-xs",children:b.map(t=>(0,e.jsxs)("div",{className:`flex gap-2 py-0.5 ${t.level==="error"?"text-bad":t.level==="warn"?"text-yellow-600 dark:text-yellow-400":t.level==="debug"?"text-ink-3/60":"text-ink-3"}`,children:[(0,e.jsx)("span",{className:"shrink-0 text-ink-3/50",children:new Date(t.createdAt).toLocaleTimeString()}),(0,e.jsx)(p,{variant:"outline",className:"h-4 shrink-0 px-1 text-(length:--text-nano)",children:t.level}),(0,e.jsx)("span",{className:"truncate",title:t.message,children:t.message})]},t.id))})})]}):null]}),(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)(P,{children:[(0,e.jsx)(F,{children:(0,e.jsxs)(D,{className:"text-base flex items-center gap-1.5",children:[(0,e.jsx)(G,{className:"h-4 w-4"}),"Health Status"]})}),(0,e.jsx)(L,{children:v?(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Checking health..."}):u?(0,e.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Overall"}),(0,e.jsx)(p,{variant:u.healthy?"default":"destructive",children:u.status})]}),u.checks.length>0?(0,e.jsx)("div",{className:"space-y-2 border-t border-line/50 pt-2",children:u.checks.map((t,A)=>(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("span",{className:"truncate text-ink-3",title:t.name,children:t.name}),t.passed?(0,e.jsx)(Ke,{className:"h-4 w-4 shrink-0 text-green-500"}):(0,e.jsx)(ve,{className:"h-4 w-4 shrink-0 text-bad"})]},A))}):null,u.lastError?(0,e.jsx)("div",{className:"break-words rounded border border-bad/20 bg-bad/10 p-2 text-xs text-bad",children:u.lastError}):null]}):(0,e.jsxs)("div",{className:"space-y-3 text-sm text-ink-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{children:"Lifecycle"}),(0,e.jsx)(p,{variant:x,children:_})]}),(0,e.jsx)("p",{children:"Health checks run once the plugin is ready."}),i.lastError?(0,e.jsx)("div",{className:"break-words rounded border border-bad/20 bg-bad/10 p-2 text-xs text-bad",children:i.lastError}):null]})})]}),(0,e.jsxs)(P,{children:[(0,e.jsx)(F,{children:(0,e.jsx)(D,{className:"text-base",children:"Details"})}),(0,e.jsxs)(L,{className:"space-y-3 text-sm text-ink-3",children:[(0,e.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,e.jsx)("span",{children:"Plugin ID"}),(0,e.jsx)("span",{className:"font-mono text-xs text-right",children:i.id})]}),(0,e.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,e.jsx)("span",{children:"Plugin Key"}),(0,e.jsx)("span",{className:"font-mono text-xs text-right",children:i.pluginKey})]}),(0,e.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,e.jsx)("span",{children:"NPM Package"}),(0,e.jsx)("span",{className:"max-w-(--sz-170px) truncate text-right text-xs",title:i.packageName,children:i.packageName})]}),(0,e.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,e.jsx)("span",{children:"Version"}),(0,e.jsxs)("span",{className:"text-right text-ink",children:["v",i.manifestJson.version??i.version]})]})]})]}),(0,e.jsxs)(P,{children:[(0,e.jsx)(F,{children:(0,e.jsxs)(D,{className:"text-base flex items-center gap-1.5",children:[(0,e.jsx)(Ce,{className:"h-4 w-4"}),"Permissions"]})}),(0,e.jsx)(L,{children:O.length>0?(0,e.jsx)("ul",{className:"space-y-2 text-sm text-ink-3",children:O.map(t=>(0,e.jsx)("li",{className:"rounded-md bg-bg-3/40 px-2.5 py-2 font-mono text-xs text-ink/85",children:t},t))}):(0,e.jsx)("p",{className:"text-sm text-ink-3 italic",children:"No special permissions requested."})})]})]})]})})]})]})}c(Ns,"PluginSettings");function _e({pluginId:s,companyId:a,declarations:n}){const{data:r,isLoading:l,error:m}=q({queryKey:a?w.plugins.localFolders(s,a):["plugins",s,"companies","none","local-folders"],queryFn:c(()=>k.listLocalFolders(s,a),"queryFn"),enabled:!!a}),f=new Map((r?.folders??[]).map(g=>[g.folderKey,g]));return a?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(ke,{className:"h-4 w-4 text-ink-3"}),(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Local folders"})]}),m?(0,e.jsx)("div",{className:"rounded-md border border-bad/20 bg-bad/10 px-3 py-2 text-sm text-bad",children:m.message||"Failed to load local folder settings."}):null,l?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-3 text-sm text-ink-3",children:[(0,e.jsx)(M,{className:"h-4 w-4 animate-spin"}),"Loading local folders..."]}):(0,e.jsx)("div",{className:"space-y-3",children:n.map(g=>(0,e.jsx)(Re,{pluginId:s,companyId:a,declaration:g,status:f.get(g.folderKey)},g.folderKey))})]}):(0,e.jsx)("div",{className:"rounded-md border border-line/60 bg-bg-3/20 px-4 py-3 text-sm text-ink-3",children:"Select an organization to configure this plugin's local folders."})}c(_e,"PluginLocalFoldersSettings");function Re({pluginId:s,companyId:a,declaration:n,status:r}){const l=ne(),m=r?.path??"",[f,g]=(0,h.useState)(m),[i,j]=(0,h.useState)(null);(0,h.useEffect)(()=>{g(m),j(null)},[m,n.folderKey]);const u=W({mutationFn:c(d=>k.configureLocalFolder(s,a,n.folderKey,{path:d,access:n.access,requiredDirectories:n.requiredDirectories,requiredFiles:n.requiredFiles}),"mutationFn"),onSuccess:c(d=>{j({type:d.healthy?"success":"error",text:d.healthy?"Local folder saved.":"Local folder saved, but validation still needs attention."}),l.invalidateQueries({queryKey:w.plugins.localFolders(s,a)})},"onSuccess"),onError:c(d=>{j({type:"error",text:d.message||"Failed to save local folder."})},"onError")}),v=f.trim(),o=v!==m,b=r?.access??n.access??"readWrite",N=(0,h.useCallback)(()=>{if(!v){j({type:"error",text:"Local folder path is required."});return}if(!Ae(v)){j({type:"error",text:"Local folder must be a full absolute path."});return}j(null),u.mutate(v)},[u,v]);return(0,e.jsxs)("div",{className:"space-y-4 rounded-md border border-line/70 bg-bg px-4 py-4",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("h4",{className:"text-sm font-medium",children:n.displayName}),(0,e.jsx)(p,{variant:"outline",className:"font-mono text-(length:--text-nano)",children:n.folderKey}),(0,e.jsx)(p,{variant:r?.healthy?"default":"secondary",children:r?.healthy?"Healthy":"Needs attention"})]}),n.description?(0,e.jsx)("p",{className:"max-w-3xl text-sm leading-5 text-ink-3",children:n.description}):null]}),(0,e.jsx)(p,{variant:b==="readWrite"?"default":"outline",children:b==="readWrite"?"Read/write":"Read only"})]}),(0,e.jsxs)("div",{className:"grid gap-3 text-sm sm:grid-cols-3",children:[(0,e.jsx)(z,{label:"Configured",value:r?.configured?"Yes":"No",ok:!!r?.configured}),(0,e.jsx)(z,{label:"Readable",value:r?.readable?"Yes":"No",ok:!!r?.readable}),(0,e.jsx)(z,{label:"Writable",value:b==="read"?"Not requested":r?.writable?"Yes":"No",ok:b==="read"||!!r?.writable})]}),r?.path?(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-ink-3",children:"Configured path"}),(0,e.jsx)("div",{className:"break-all rounded-md bg-bg-3/60 px-2 py-1.5 font-mono text-xs text-ink",children:r.path})]}):null,(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("label",{className:"text-xs font-medium text-ink-3",htmlFor:`local-folder-${n.folderKey}`,children:"Local folder path"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("input",{id:`local-folder-${n.folderKey}`,className:"min-w-0 flex-1 rounded-md border border-line bg-bg px-2.5 py-1.5 font-mono text-sm outline-none focus:border-ink/40 focus:ring-2 focus:ring-focus/20",value:f,onChange:c(d=>{g(d.target.value),j(null)},"onChange"),placeholder:"/absolute/path/to/folder"}),(0,e.jsx)(je,{className:"h-8"}),(0,e.jsxs)($,{size:"sm",onClick:N,disabled:u.isPending||!o||!a,children:[u.isPending?(0,e.jsx)(M,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(we,{className:"h-3.5 w-3.5"}),"Save"]})]})]}),(0,e.jsx)(Te,{status:r,declaration:n}),r?.problems?.length?(0,e.jsxs)("div",{className:"space-y-2 rounded-md border border-bad/20 bg-bad/10 px-3 py-2 text-sm text-bad",children:[(0,e.jsx)("div",{className:"font-medium",children:"Validation problems"}),(0,e.jsx)("ul",{className:"space-y-1",children:r.problems.map((d,y)=>(0,e.jsxs)("li",{children:[d.message,d.path?(0,e.jsxs)("span",{className:"font-mono",children:[" ",d.path]}):null]},`${d.code}:${d.path??""}:${y}`))})]}):null,i?(0,e.jsx)("div",{className:`rounded-md border px-3 py-2 text-sm ${i.type==="success"?"border-green-200 bg-green-50 text-green-700 dark:border-green-900 dark:bg-green-950/30 dark:text-green-400":"border-bad/20 bg-bad/10 text-bad"}`,children:i.text}):null]})}c(Re,"PluginLocalFolderRow");function z({label:s,value:a,ok:n}){return(0,e.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-line/60 px-2.5 py-2",children:[(0,e.jsx)("span",{className:"text-ink-3",children:s}),(0,e.jsx)(p,{variant:n?"default":"secondary",children:a})]})}c(z,"FolderStatusMetric");function Te({status:s,declaration:a}){const n=s?.requiredDirectories??a.requiredDirectories??[],r=s?.requiredFiles??a.requiredFiles??[],l=s?.missingDirectories??n,m=s?.missingFiles??r,f=Ee(s);return n.length===0&&r.length===0?null:(0,e.jsxs)("div",{className:"grid gap-3 text-sm md:grid-cols-2",children:[(0,e.jsx)(I,{title:"Required directories",items:n,missingItems:l,missingLabel:"Missing directories",inspectionUnavailable:f}),(0,e.jsx)(I,{title:"Required files",items:r,missingItems:m,missingLabel:"Missing files",inspectionUnavailable:f})]})}c(Te,"FolderRequirements");function Ee(s){return!s?.configured||s.readable?!1:s.problems.some(a=>a.code==="missing"||a.code==="not_readable"||a.code==="not_directory")}c(Ee,"isRootNotInspected");function I({title:s,items:a,missingItems:n,missingLabel:r,inspectionUnavailable:l}){return(0,e.jsxs)("div",{className:"space-y-2 rounded-md border border-line/60 px-3 py-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-ink-3",children:s}),l?(0,e.jsx)(p,{variant:"secondary",className:"text-(length:--text-nano)",children:"Not inspected"}):n.length>0?(0,e.jsxs)(p,{variant:"destructive",className:"text-(length:--text-nano)",children:[n.length," missing"]}):(0,e.jsx)(p,{variant:"outline",className:"text-(length:--text-nano)",children:"Present"})]}),a.length>0?(0,e.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(m=>{const f=n.includes(m);return(0,e.jsx)("span",{className:`rounded border px-1.5 py-0.5 font-mono text-(length:--text-micro) ${l?"border-amber-300/60 bg-amber-50 text-amber-700 dark:border-amber-800/70 dark:bg-amber-950/30 dark:text-amber-300":f?"border-bad/30 bg-bad/10 text-bad":"border-line bg-bg-3/50 text-ink/80"}`,children:m},m)})}):(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"None declared."}),l?(0,e.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:"Configured root was not inspected."}):n.length>0?(0,e.jsxs)("p",{className:"text-xs text-bad",children:[r,": ",n.join(", ")]}):null]})}c(I,"RequirementList");function Ae(s){return s.startsWith("/")||/^[A-Za-z]:[\\/]/.test(s)||s.startsWith("\\\\")}c(Ae,"isLikelyAbsolutePath");function Je({pluginId:s,companyId:a,schema:n,initialValues:r,isLoading:l,pluginStatus:m,supportsConfigTest:f}){const g=ne(),[i,j]=(0,h.useState)(()=>({...R(n),...r??{}})),u=(0,h.useRef)(!1);(0,h.useEffect)(()=>{u.current=!1,j(R(n))},[a,s,n]),(0,h.useEffect)(()=>{r&&!u.current&&(u.current=!0,j({...R(n),...r}))},[r,n]);const[v,o]=(0,h.useState)({}),[b,N]=(0,h.useState)(null),[d,y]=(0,h.useState)(null),T=JSON.stringify(i)!==JSON.stringify({...R(n),...r??{}}),C=W({mutationFn:c(x=>{if(!a)throw new Error("Select an organization before saving plugin configuration.");return k.saveConfig(s,a,x)},"mutationFn"),onSuccess:c(()=>{N({type:"success",text:"Configuration saved."}),y(null),a&&g.invalidateQueries({queryKey:w.plugins.config(s,a)}),setTimeout(()=>N(null),3e3)},"onSuccess"),onError:c(x=>{N({type:"error",text:x.message||"Failed to save configuration."})},"onError")}),S=W({mutationFn:c(x=>{if(!a)throw new Error("Select an organization before testing plugin configuration.");return k.testConfig(s,a,x)},"mutationFn"),onSuccess:c(x=>{x.valid?y({type:"success",text:"Configuration test passed."}):y({type:"error",text:x.message||"Configuration test failed."})},"onSuccess"),onError:c(x=>{y({type:"error",text:x.message||"Configuration test failed."})},"onError")}),K=(0,h.useCallback)(x=>{j(x),o({}),N(null)},[]),E=(0,h.useCallback)(()=>{const x=X(n,i);if(Object.keys(x).length>0){o(x);return}o({}),C.mutate(i)},[n,i,C]),_=(0,h.useCallback)(()=>{const x=X(n,i);if(Object.keys(x).length>0){o(x);return}o({}),y(null),S.mutate(i)},[n,i,S]);return l?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-ink-3 py-4",children:[(0,e.jsx)(M,{className:"h-4 w-4 animate-spin"}),"Loading configuration..."]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(Pe,{schema:n,values:i,onChange:K,errors:v,disabled:C.isPending}),b&&(0,e.jsx)("div",{className:`text-sm p-2 rounded border ${b.type==="success"?"text-green-700 bg-green-50 border-green-200 dark:text-green-400 dark:bg-green-950/30 dark:border-green-900":"text-bad bg-bad/10 border-bad/20"}`,children:b.text}),d&&(0,e.jsx)("div",{className:`text-sm p-2 rounded border ${d.type==="success"?"text-green-700 bg-green-50 border-green-200 dark:text-green-400 dark:bg-green-950/30 dark:border-green-900":"text-bad bg-bad/10 border-bad/20"}`,children:d.text}),(0,e.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,e.jsx)($,{onClick:E,disabled:C.isPending||!T,size:"sm",children:C.isPending?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(M,{className:"h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Configuration"}),m==="ready"&&f&&(0,e.jsx)($,{variant:"secondary",onClick:_,disabled:S.isPending||!a,size:"sm",children:S.isPending?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(M,{className:"h-3.5 w-3.5 animate-spin"}),"Testing..."]}):"Test Configuration"})]})]})}c(Je,"PluginConfigForm");function ze(s){if(s==null)return"—";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const n=Math.floor(a/60);if(n<60)return`${n}m ${a%60}s`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}c(ze,"formatUptime");function ee(s){return s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`}c(ee,"formatDuration");function se(s){const a=Date.now()-new Date(s).getTime();if(a<0)return"just now";const n=Math.floor(a/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const l=Math.floor(r/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}c(se,"formatRelativeTime");function We(s){return new Date(s).toLocaleString()}c(We,"formatTimestamp");function Oe({status:s}){return(0,e.jsx)("span",{className:`inline-block h-2 w-2 rounded-full shrink-0 ${s==="success"||s==="succeeded"?"bg-green-500":s==="failed"?"bg-red-500":s==="running"?"bg-blue-500 animate-pulse":s==="cancelled"?"bg-gray-400":"bg-amber-500"}`,title:s})}c(Oe,"JobStatusDot");function Be({status:s}){return(0,e.jsx)("span",{className:`inline-block h-2 w-2 rounded-full shrink-0 ${s==="processed"||s==="success"?"bg-green-500":s==="failed"?"bg-red-500":s==="received"?"bg-blue-500":"bg-amber-500"}`,title:s})}c(Be,"DeliveryStatusDot");export{Ns as PluginSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var le=Object.defineProperty;var t=(s,a)=>le(s,"name",{value:a,configurable:!0});import{i as V}from"./rolldown-runtime-ZpX3ckPj.js";import{b as Y,l as ee,na as oe,t as ce,ta as de}from"./createLucideIcon-CpKa5z2C.js";import{v as me,y as pe}from"./star-DMFjS4pe.js";import{X as ue,_ as D,t as L,v as xe}from"./queryKeys-BVuBtip7.js";import{n as he}from"./CompanyContext-BawkN74-.js";import{o as fe}from"./router-DVO-ie3J.js";import{t as $}from"./label-BZn646Ew.js";import{t as ge}from"./archive-restore-BYDZCrd5.js";import{t as je}from"./copy-Cwrdt7rb.js";import{t as u}from"./button-Ckn7hiVo.js";import{t as ve}from"./shield-check-DxJhStbm.js";import{t as ye}from"./trash-v7m_afTU.js";import{t as be}from"./user-minus-DEKf2JCx.js";import{t as se}from"./badge-C_Yv1fHA.js";import{i as Ne}from"./ToastContext-frwty7Yo.js";import{a as z,i as F,n as K,r as O,s as q,t as U}from"./dialog-BcuAydRt.js";import{t as Q}from"./input-DGxLesAp.js";import{t as S}from"./tools-DzOIVgY_.js";import{n as ke}from"./BreadcrumbContext-BopoVMP4.js";import{t as we}from"./textarea-BACZM3sN.js";import{Ba as Ce,ni as Ae}from"./index-BOCwP1Ce.js";import{a as Te,i as te,r as ae,s as J}from"./shared-DAFyYLvq.js";import{a as Se,n as Ie,t as Pe}from"./profile-summary-BHzP6Xtf.js";import{t as De}from"./useProfilesData-BI4avXOm.js";import{t as Le}from"./ToolsAdminGate-BH39lQW8.js";var ne={name:"plug-zap",size:24,node:[["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:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],aliases:["plug-zap-2"]};ne.node;var Ee=ce(ne),f=V(oe(),1),e=V(de(),1);function Re({companyId:s,profileId:a,initialCreated:n,initialReviewOpen:l}){const m=fe(),[x,v]=pe(),j=ue(),{pushToast:i}=Ne(),d=De(s),[o,h]=(0,f.useState)(null),[g,I]=(0,f.useState)(null),[E,A]=(0,f.useState)(!!l),[N,R]=(0,f.useState)({}),p=(d.profiles.data?.profiles??[]).find(r=>r.id===a)??null,M=n??x.get("created")==="1",k=p?.newToolsPendingCount??0,w=xe({queryKey:L.tools.profileNewTools(a),queryFn:t(()=>S.getProfileNewTools(a),"queryFn"),enabled:k>0}),C=t(()=>{j.invalidateQueries({queryKey:L.tools.profiles(s)}),j.invalidateQueries({queryKey:L.tools.testAgentAccesses()})},"invalidate"),b=t(r=>String(r?.message??r),"errorBody"),B=(0,f.useMemo)(()=>p?qe(p,d.catalog,d.maps.applicationsById,d.maps.connectionsById,d.connections.data?.connections??[]):[],[p,d.catalog,d.maps.applicationsById,d.maps.connectionsById,d.connections.data?.connections]),c=w.data?.tools??[];(0,f.useEffect)(()=>{x.get("review")==="new-tools"&&k>0&&A(!0)},[k,x]),(0,f.useEffect)(()=>{c.length!==0&&R(r=>{const P={...r};for(const _ of c)P[_.catalogEntryId]||(P[_.catalogEntryId]="keep_blocked");return P})},[c]);const T=D({mutationFn:t(r=>S.updateProfile(a,r),"mutationFn"),onSuccess:t(()=>{C(),i({title:"Profile updated",tone:"success"})},"onSuccess"),onError:t(r=>i({title:"Could not update profile",body:b(r),tone:"error"}),"onError")}),H=D({mutationFn:t(r=>S.duplicateProfile(a,r),"mutationFn"),onSuccess:t(r=>{C(),i({title:"Profile duplicated",body:"The copy is not assigned to anyone yet.",tone:"success"}),m(`/apps/advanced/profiles/${r.id}?created=1`)},"onSuccess"),onError:t(r=>i({title:"Could not duplicate",body:b(r),tone:"error"}),"onError")}),Z=D({mutationFn:t(()=>S.deleteProfile(a),"mutationFn"),onSuccess:t(()=>{C(),i({title:"Profile deleted",tone:"success"}),m("/apps/advanced/profiles")},"onSuccess"),onError:t(r=>i({title:"Could not delete",body:b(r),tone:"error"}),"onError")}),G=D({mutationFn:t(r=>S.unbindProfile(s,a,{targetType:r.targetType,targetId:r.targetId}),"mutationFn"),onSuccess:t(()=>{I(null),C(),i({title:"Assignment removed",tone:"success"})},"onSuccess"),onError:t(r=>i({title:"Could not remove assignment",body:b(r),tone:"error"}),"onError")}),X=D({mutationFn:t(()=>S.reviewProfileNewTools(a,{decisions:c.map(r=>({catalogEntryId:r.catalogEntryId,decision:N[r.catalogEntryId]??"keep_blocked"}))}),"mutationFn"),onSuccess:t(()=>{A(!1),v({}),j.invalidateQueries({queryKey:L.tools.profiles(s)}),j.invalidateQueries({queryKey:L.tools.profileNewTools(a)}),i({title:"New tools reviewed",tone:"success"})},"onSuccess"),onError:t(r=>i({title:"Could not submit review",body:b(r),tone:"error"}),"onError")});if(d.profiles.isLoading)return(0,e.jsx)(te,{label:"Loading profile..."});if(d.profiles.isError)return(0,e.jsx)(ae,{error:d.profiles.error,onRetry:t(()=>d.profiles.refetch(),"onRetry")});if(!p)return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(J,{title:"Profile not found",description:"This access profile may have been deleted."}),(0,e.jsx)(u,{variant:"secondary",onClick:t(()=>m("/apps/advanced/profiles"),"onClick"),children:"Back to profiles"})]});const y=p.status==="archived",re=p.summary.assignmentCount===0;return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsx)(J,{title:p.name,description:p.description??"No description yet.",actions:(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,e.jsxs)(u,{variant:"secondary",disabled:y,onClick:t(()=>h("edit"),"onClick"),children:[(0,e.jsx)(Ce,{className:"mr-1.5 h-4 w-4"}),"Edit"]}),(0,e.jsxs)(u,{variant:"secondary",disabled:y,onClick:t(()=>h("duplicate"),"onClick"),children:[(0,e.jsx)(je,{className:"mr-1.5 h-4 w-4"}),"Duplicate"]}),y?(0,e.jsxs)(u,{variant:"secondary",onClick:t(()=>h("restore"),"onClick"),children:[(0,e.jsx)(ge,{className:"mr-1.5 h-4 w-4"}),"Restore"]}):(0,e.jsx)(u,{variant:"secondary",onClick:t(()=>h("archive"),"onClick"),children:"Archive"}),(0,e.jsxs)(u,{variant:"danger",onClick:t(()=>h("delete"),"onClick"),children:[(0,e.jsx)(ye,{className:"mr-1.5 h-4 w-4"}),"Delete"]})]})}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[(0,e.jsx)(se,{variant:y?"outline":"default",children:Pe[p.status]}),(0,e.jsxs)("span",{className:"text-ink-3",children:["Updated ",(0,e.jsx)(Te,{value:p.updatedAt})]}),(0,e.jsx)("span",{className:"text-ink-3",children:Ie(p.summary)})]}),M?(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-accent/30 bg-accent/5 px-4 py-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-ink",children:"Profile saved"}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:re?"Assign it to agents before it changes their access.":"Assignments are active now."})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(u,{size:"sm",onClick:t(()=>m(`/apps/advanced/profiles/${p.id}/edit?step=3`),"onClick"),children:"Assign"}),(0,e.jsx)(u,{size:"sm",variant:"ghost",onClick:t(()=>v({}),"onClick"),children:"Dismiss"})]})]}):null,y?(0,e.jsx)("div",{className:"rounded-lg border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-950",children:"This profile is archived. It does not apply to agents until it is restored."}):null,k>0?(0,e.jsx)(Be,{count:k,tools:c,loading:w.isLoading,onReview:t(()=>A(!0),"onReview")}):null,(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-ink",children:"What it allows"}),(0,e.jsx)(u,{variant:"secondary",size:"sm",disabled:y,onClick:t(()=>m(`/apps/advanced/profiles/${p.id}/edit?step=2`),"onClick"),children:"Edit tools"})]}),(0,e.jsx)($e,{rows:B,total:p.summary.totalToolCount})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-ink",children:"Who has it"}),(0,e.jsx)(u,{variant:"secondary",size:"sm",disabled:y,onClick:t(()=>m(`/apps/advanced/profiles/${p.id}/edit?step=3`),"onClick"),children:"Assign"})]}),(0,e.jsx)(ze,{profile:p,companyId:s,maps:d.maps,archived:y,onRemove:I})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-ink",children:"New tools that appear later"}),(0,e.jsx)(Fe,{value:p.defaultAction,disabled:y||T.isPending,onChange:t(r=>T.mutate({defaultAction:r}),"onChange")})]}),(0,e.jsxs)(u,{variant:"link",className:"h-auto px-0",onClick:t(()=>m("/apps/advanced/profiles?check=1"),"onClick"),children:[(0,e.jsx)(ve,{className:"mr-1.5 h-4 w-4"}),"Check what an agent can actually do"]}),(0,e.jsx)(Ke,{kind:o,profile:p,allProfiles:d.profiles.data?.profiles??[],pending:T.isPending||H.isPending||Z.isPending,onClose:t(()=>h(null),"onClose"),onUpdate:t(r=>T.mutate(r,{onSuccess:t(()=>h(null),"onSuccess")}),"onUpdate"),onDuplicate:t(r=>H.mutate(r,{onSuccess:t(()=>h(null),"onSuccess")}),"onDuplicate"),onArchive:t(()=>T.mutate({status:"archived"},{onSuccess:t(()=>h(null),"onSuccess")}),"onArchive"),onRestore:t(()=>T.mutate({status:"active"},{onSuccess:t(()=>h(null),"onSuccess")}),"onRestore"),onDelete:t(()=>Z.mutate(void 0,{onSuccess:t(()=>h(null),"onSuccess")}),"onDelete")}),(0,e.jsx)(Oe,{binding:g,label:g?ie(g,s,d.maps):"",pending:G.isPending,onClose:t(()=>I(null),"onClose"),onConfirm:t(()=>g&&G.mutate(g),"onConfirm")}),(0,e.jsx)(_e,{open:E,tools:c,loading:w.isLoading,error:w.error,decisions:N,pending:X.isPending,onClose:t(()=>A(!1),"onClose"),onRetry:t(()=>w.refetch(),"onRetry"),onDecision:t((r,P)=>R(_=>({..._,[r]:P})),"onDecision"),onSubmit:t(()=>X.mutate(),"onSubmit")})]})}t(Re,"ProfileDetail");function Be({count:s,tools:a,loading:n,onReview:l}){const m=We(a);return(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-950",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:n?"New tools need review":`${m} added ${s} new ${s===1?"tool":"tools"} since your last review`}),(0,e.jsx)("p",{className:"text-amber-900/80",children:"Choose which ones this profile should allow."})]}),(0,e.jsx)(u,{size:"sm",onClick:l,children:"Review"})]})}t(Be,"NewToolsReviewBanner");function _e({open:s,tools:a,loading:n,error:l,decisions:m,pending:x,onClose:v,onRetry:j,onDecision:i,onSubmit:d}){return(0,e.jsx)(U,{open:s,onOpenChange:t(o=>!o&&v(),"onOpenChange"),children:(0,e.jsxs)(K,{className:"max-w-2xl",children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(q,{children:"Review new tools"}),(0,e.jsx)(O,{children:"Allow the tools this profile should use. Keep the rest blocked."})]}),n?(0,e.jsx)(te,{label:"Loading new tools..."}):l?(0,e.jsx)(ae,{error:l,onRetry:j}):a.length===0?(0,e.jsx)("div",{className:"rounded-lg border border-dashed border-line px-4 py-6 text-sm text-ink-3",children:"There are no new tools waiting for review."}):(0,e.jsx)("div",{className:"max-h-(--sz-52vh) divide-y divide-line overflow-y-auto rounded-lg border border-line",children:a.map(o=>(0,e.jsxs)("div",{className:"grid gap-3 px-3 py-3 sm:grid-cols-[1fr_auto]",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("p",{className:"truncate text-sm font-medium text-ink",children:o.title||o.toolName}),(0,e.jsx)(se,{variant:"secondary",children:Qe(o)})]}),o.description?(0,e.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:o.description}):null,(0,e.jsxs)("p",{className:"mt-1 text-xs text-ink-3",children:[o.applicationName??o.connectionName??"App tool"," · added ",Y(o.addedAt)]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 sm:justify-end",children:[(0,e.jsxs)("label",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:`review-${o.catalogEntryId}`,checked:(m[o.catalogEntryId]??"keep_blocked")==="allow",onChange:t(()=>i(o.catalogEntryId,"allow"),"onChange")}),"Allow"]}),(0,e.jsxs)("label",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:`review-${o.catalogEntryId}`,checked:(m[o.catalogEntryId]??"keep_blocked")==="keep_blocked",onChange:t(()=>i(o.catalogEntryId,"keep_blocked"),"onChange")}),"Keep blocked"]})]})]},o.catalogEntryId))}),(0,e.jsxs)(F,{children:[(0,e.jsx)(u,{variant:"ghost",onClick:v,children:"Cancel"}),(0,e.jsx)(u,{disabled:x||n||a.length===0,onClick:d,children:"Submit review"})]})]})})}t(_e,"NewToolsReviewDialog");function $e({rows:s,total:a}){return s.length===0?(0,e.jsx)("div",{className:"rounded-lg border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-950",children:"This profile allows 0 tools. Agents with only this profile will not be able to use app tools."}):(0,e.jsxs)("div",{className:"overflow-hidden rounded-lg border border-line",children:[(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-line bg-bg-3/40 text-left text-xs font-medium text-ink-3",children:[(0,e.jsx)("th",{className:"px-3 py-2 font-medium",children:"Tool"}),(0,e.jsx)("th",{className:"px-3 py-2 font-medium",children:"App"}),(0,e.jsx)("th",{className:"px-3 py-2 font-medium",children:"Capabilities"}),(0,e.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"})]})}),(0,e.jsx)("tbody",{children:s.slice(0,80).map(n=>(0,e.jsxs)("tr",{className:ee("border-b border-line last:border-0",n.degraded&&"bg-bg-3/30 text-ink-3"),children:[(0,e.jsx)("td",{className:"px-3 py-2",children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("span",{className:"font-medium text-ink",children:n.tool}),n.degraded?(0,e.jsxs)("a",{className:"mt-0.5 inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline",href:`/apps/${n.connectionId}`,children:[(0,e.jsx)(Ee,{className:"h-3 w-3"}),"Reconnect"]}):null]})}),(0,e.jsxs)("td",{className:"px-3 py-2",children:[(0,e.jsx)("span",{children:n.app}),n.degraded?(0,e.jsxs)("span",{className:"ml-2 text-xs text-ink-3",children:[n.app," is disconnected"]}):null]}),(0,e.jsx)("td",{className:"px-3 py-2 text-ink-3",children:n.capabilities}),(0,e.jsxs)("td",{className:"px-3 py-2",children:[n.source.startsWith("added by rule")?(0,e.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-950",children:n.source}):(0,e.jsx)("span",{className:"text-ink-3",children:n.source}),n.autoAddedAt?(0,e.jsxs)("div",{className:"mt-0.5 text-xs text-ink-3",children:["added automatically · ",Y(n.autoAddedAt)]}):null]})]},n.id))})]}),s.length>80?(0,e.jsxs)("p",{className:"border-t border-line px-3 py-2 text-xs text-ink-3",children:["Showing 80 of ",s.length," allowed tools."]}):(0,e.jsxs)("p",{className:"border-t border-line px-3 py-2 text-xs text-ink-3",children:["Allows ",s.length," of ",a," known tools."]})]})}t($e,"AllowList");function ze({profile:s,companyId:a,maps:n,archived:l,onRemove:m}){return s.bindings.length===0?(0,e.jsxs)("div",{className:"rounded-lg border border-dashed border-line px-4 py-5",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-ink",children:"Not assigned yet"}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Assign this profile before it changes access."})]}):(0,e.jsx)("div",{className:"divide-y divide-line overflow-hidden rounded-lg border border-line",children:s.bindings.map(x=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,e.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-bg-3 text-xs font-semibold text-ink-3",children:x.targetType==="company"?"Or":x.targetType.slice(0,2).toUpperCase()}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"truncate text-sm font-medium text-ink",children:ie(x,a,n)}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:Ze(x.targetType)})]})]}),(0,e.jsxs)(u,{variant:"ghost",size:"sm",disabled:l,onClick:t(()=>m(x),"onClick"),children:[(0,e.jsx)(be,{className:"mr-1.5 h-4 w-4"}),"Remove"]})]},x.id))})}t(ze,"Assignments");function Fe({value:s,disabled:a,onChange:n}){return(0,e.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:[{value:"deny",title:"Stay blocked until reviewed",body:"New tools do not become available automatically."},{value:"allow",title:"Allowed automatically",body:"New tools from selected apps become available right away."}].map(l=>(0,e.jsxs)("label",{className:ee("flex cursor-pointer items-start gap-3 rounded-lg border px-4 py-3",s===l.value?"border-accent bg-accent/5":"border-line",a&&"cursor-not-allowed opacity-60"),children:[(0,e.jsx)("input",{type:"radio",className:"mt-1",disabled:a,checked:s===l.value,onChange:t(()=>n(l.value),"onChange")}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-ink",children:l.title}),(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:l.body})]})]},l.value))})}t(Fe,"NewToolsSetting");function Ke({kind:s,profile:a,allProfiles:n,pending:l,onClose:m,onUpdate:x,onDuplicate:v,onArchive:j,onRestore:i,onDelete:d}){const[o,h]=(0,f.useState)(a.name),[g,I]=(0,f.useState)(a.description??""),[E,A]=(0,f.useState)(a.profileKey),[N,R]=(0,f.useState)(`${a.name} copy`),[p,M]=(0,f.useState)(!1),[k,w]=(0,f.useState)(!1),C=n.some(c=>c.id!==a.id&&c.name.trim().toLowerCase()===o.trim().toLowerCase()),b=n.some(c=>c.name.trim().toLowerCase()===N.trim().toLowerCase());if(!s)return null;const B=!!s;return s==="edit"?(0,e.jsx)(U,{open:B,onOpenChange:t(c=>!c&&m(),"onOpenChange"),children:(0,e.jsxs)(K,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(q,{children:"Edit profile"}),(0,e.jsx)(O,{children:"Update the profile name and description."})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)($,{htmlFor:"edit-profile-name",children:"Name"}),(0,e.jsx)(Q,{id:"edit-profile-name",value:o,onChange:t(c=>h(c.target.value),"onChange")}),C?(0,e.jsx)("p",{className:"text-xs text-bad",children:"Another profile already uses this name."}):null]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)($,{htmlFor:"edit-profile-description",children:"Description"}),(0,e.jsx)(we,{id:"edit-profile-description",value:g,onChange:t(c=>I(c.target.value),"onChange"),rows:3})]}),(0,e.jsx)("button",{type:"button",className:"text-sm font-medium text-ink-3 hover:text-ink",onClick:t(()=>w(c=>!c),"onClick"),children:"Advanced"}),k?(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)($,{htmlFor:"edit-profile-key",children:"Identifier"}),(0,e.jsx)(Q,{id:"edit-profile-key",value:E,onChange:t(c=>A(c.target.value),"onChange"),className:"font-mono text-xs"})]}):null]}),(0,e.jsxs)(F,{children:[(0,e.jsx)(u,{variant:"ghost",onClick:m,children:"Cancel"}),(0,e.jsx)(u,{disabled:!o.trim()||C||l,onClick:t(()=>x({name:o.trim(),description:g.trim()||null,profileKey:E.trim()}),"onClick"),children:"Save"})]})]})}):s==="duplicate"?(0,e.jsx)(U,{open:B,onOpenChange:t(c=>!c&&m(),"onOpenChange"),children:(0,e.jsxs)(K,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(q,{children:"Duplicate profile"}),(0,e.jsx)(O,{children:"The copy starts unassigned unless you choose to copy assignments too."})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)($,{htmlFor:"copy-profile-name",children:"Name"}),(0,e.jsx)(Q,{id:"copy-profile-name",value:N,onChange:t(c=>R(c.target.value),"onChange")}),b?(0,e.jsx)("p",{className:"text-xs text-bad",children:"Another profile already uses this name."}):null]}),(0,e.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)("input",{type:"checkbox",checked:p,onChange:t(c=>M(c.target.checked),"onChange")}),"Also copy assignments?"]})]}),(0,e.jsxs)(F,{children:[(0,e.jsx)(u,{variant:"ghost",onClick:m,children:"Cancel"}),(0,e.jsx)(u,{disabled:!N.trim()||b||l,onClick:t(()=>v({name:N.trim(),includeAssignments:p}),"onClick"),children:"Duplicate"})]})]})}):(0,e.jsx)(Se,{kind:s,profile:a,pending:l,onClose:m,onArchive:j,onRestore:i,onDelete:d})}t(Ke,"ProfileDialogs");function Oe({binding:s,label:a,pending:n,onClose:l,onConfirm:m}){return(0,e.jsx)(U,{open:!!s,onOpenChange:t(x=>!x&&l(),"onOpenChange"),children:(0,e.jsxs)(K,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(q,{children:"Remove assignment"}),(0,e.jsx)(O,{children:s?.targetType==="company"?"Removing the organization default changes access for every agent that relies on it.":`Remove this profile from ${a}.`})]}),(0,e.jsxs)(F,{children:[(0,e.jsx)(u,{variant:"ghost",onClick:l,children:"Cancel"}),(0,e.jsx)(u,{disabled:n,onClick:m,children:"Remove"})]})]})})}t(Oe,"RemoveAssignmentDialog");function qe(s,a,n,l,m){const x=s.entries.filter(i=>i.effect==="exclude"),v=s.entries.filter(i=>i.effect==="include"),j=s.summary.accessMode==="all_except";return a.filter(i=>!x.some(d=>W(d,i))).filter(i=>j||v.some(d=>W(d,i))).map(i=>{const d=j?null:v.find(g=>W(g,i))??null,o=n.get(i.applicationId??"")??l.get(i.connectionId)??"Unknown app",h=m.find(g=>g.id===i.connectionId);return{id:i.id,app:o,tool:i.title||i.toolName,capabilities:Me(i),source:Ue(d,o),autoAddedAt:s.defaultAction==="allow"&&He(i)?i.addedAt??i.firstSeenAt:null,degraded:!!(h&&(h.status!=="active"||h.healthStatus==="error")),connectionId:i.connectionId}})}t(qe,"buildAllowRows");function W(s,a){switch(s.selectorType){case"application":return!!(s.applicationId&&s.applicationId===a.applicationId);case"connection":return!!(s.connectionId&&s.connectionId===a.connectionId);case"catalog_entry":return!!(s.catalogEntryId&&s.catalogEntryId===a.id);case"tool_name":return!!(s.toolName&&s.toolName===a.toolName);case"risk_level":return!!(s.riskLevel&&s.riskLevel===a.riskLevel);default:return!1}}t(W,"entryMatchesTool");function Ue(s,a){return s?s.selectorType==="application"||s.selectorType==="connection"?`added by rule: all ${a}`:s.selectorType==="risk_level"&&s.riskLevel?`added by rule: ${s.riskLevel} tools`:"added directly":"added directly"}t(Ue,"sourceLabel");function Me(s){return s.isDestructive?"Destructive":s.isWrite?"Write":"Read"}t(Me,"capabilityLabel");function Qe(s){return s.riskLevel==="destructive"?"Destructive":s.riskLevel==="write"?"Write":s.riskLevel==="read"?"Read":s.capability}t(Qe,"capabilityText");function We(s){const a=[...new Set(s.map(n=>n.applicationName??n.connectionName).filter(Boolean))];return a.length===0?"An app":a.length===1?a[0]??"An app":a.length===2?`${a[0]} and ${a[1]}`:`${a[0]} and ${a.length-1} more apps`}t(We,"newToolsAppLabel");function He(s){const a=s.addedAt??s.firstSeenAt,n=new Date(a).getTime();return Number.isFinite(n)?Date.now()-n<=2592e6:!1}t(He,"isRecentTool");function ie(s,a,n){return s.targetType==="company"?"Organization default":s.targetType==="agent"?n.agentsById.get(s.targetId)??"Unknown agent":s.targetType==="project"?n.projectsById.get(s.targetId)??"Unknown project":s.targetType==="routine"?n.routinesById.get(s.targetId)??"Unknown routine":s.targetId===a?"Organization":s.targetId}t(ie,"assignmentLabel");function Ze(s){return s==="company"?"Organization default":s==="agent"?"Agent":s==="project"?"Project":s==="routine"?"Routine":"Scoped assignment"}t(Ze,"assignmentTypeLabel");function bs(){const{selectedCompany:s,selectedCompanyId:a}=he(),{setBreadcrumbs:n}=ke(),l=me();return(0,f.useEffect)(()=>(n([{label:s?.name??"Company",href:"/dashboard"},{label:"Apps",href:"/apps"},{label:"Access profiles",href:Ae("profiles")},{label:"Profile detail"}]),()=>n([])),[n,s?.name]),!a||!l.profileId?(0,e.jsx)("div",{className:"p-6 text-sm text-ink-3",children:"Select an organization and profile."}):(0,e.jsx)(Le,{children:(0,e.jsx)("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-5 p-4 sm:p-6",children:(0,e.jsx)(Re,{companyId:a,profileId:l.profileId})})})}t(bs,"ProfileDetailRoute");export{bs as ProfileDetailRoute};
|