@humwick/server 0.130.0 → 0.130.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/docs/guides/tools-administration.md +6 -1
- package/docs/guides/tools-coordination.md +1 -0
- package/docs/guides/tools-tasks.md +8 -0
- package/docs/guides/workflows.md +58 -0
- package/docs/openapi.json +414 -1
- package/package.json +8 -17
- package/public/assets/{MessageBubble-BWpoBjl4.js → MessageBubble-BWLqMGKG.js} +2 -2
- package/public/assets/{PlanGraphPanel-C0auck3n.js → PlanGraphPanel-3TlIQpjk.js} +2 -2
- package/public/assets/{TraceView-DBnOx7AQ.js → TraceView-Wimm0Czv.js} +2 -2
- package/public/assets/{VaultDecisionCard-0kp2oNBC.js → VaultDecisionCard-Bau_vNax.js} +2 -2
- package/public/assets/{activity-yLztXEBt.js → activity-CrSurn-r.js} +2 -2
- package/public/assets/{agent-lineage-BbJDR1dW.js → agent-lineage-CknAJKcb.js} +2 -2
- package/public/assets/agent-liveness-CaNwK0Zf.js +2 -0
- package/public/assets/{agent-name-CTZBrSD9.js → agent-name-DKbiIhBo.js} +2 -2
- package/public/assets/agent-profiles-DwF6EQ4R.js +2 -0
- package/public/assets/{agent-project-badge-9TqzUUYE.js → agent-project-badge-Diz4Sjjb.js} +2 -2
- package/public/assets/{agent-tools-D4n40pn8.js → agent-tools-CRhpRQza.js} +2 -2
- package/public/assets/{agent-type-icon-D6FUarOf.js → agent-type-icon-LrUEU3lB.js} +2 -2
- package/public/assets/{agents-BYDslkJc.js → agents-B-v66C-4.js} +2 -2
- package/public/assets/{analytics-B-XSbEMC.js → analytics-BqCb-LKi.js} +2 -2
- package/public/assets/{artifact-viewer-DdWIfV6M.js → artifact-viewer-kf4pGuAR.js} +2 -2
- package/public/assets/{artifacts-oBOqks-2.js → artifacts-D32zyw4Y.js} +2 -2
- package/public/assets/{artifacts-DPN1q4pA.js → artifacts-DJevXcvg.js} +2 -2
- package/public/assets/{automation-4KcRFXEu.js → automation-BpRajx_5.js} +2 -2
- package/public/assets/{backlog-Cw9xPTCF.js → backlog-D_UjTdzX.js} +2 -2
- package/public/assets/{busy-health-CTu32MZt.js → busy-health-N3VEh4ao.js} +2 -2
- package/public/assets/{channels-BiXzg1G9.js → channels-9jopungq.js} +2 -2
- package/public/assets/{chat-Ctk2qwvA.js → chat-CSXrTB3C.js} +2 -2
- package/public/assets/{code-preview-Bm1wWqAp.js → code-preview-p1NnmqK0.js} +2 -2
- package/public/assets/{connectors-C36ax4Vw.js → connectors-CZdqlDNL.js} +2 -2
- package/public/assets/{cosmos-Jj9LK2Wf.js → cosmos-BgdsE4dG.js} +2 -2
- package/public/assets/{crate-agent-H6S7-B9T.js → crate-agent-30aXTKva.js} +2 -2
- package/public/assets/{dependency-graph-Cd1E23wa.js → dependency-graph-B_jvw2GE.js} +2 -2
- package/public/assets/{deploys-Bwfq146q.js → deploys-DoN6bAb5.js} +2 -2
- package/public/assets/{display-CfO7rTuF.js → display-BrKWFGJz.js} +2 -2
- package/public/assets/{files-DhhZI2Ih.js → files-D6XEu8Ng.js} +2 -2
- package/public/assets/fleet-C7jQWbw2.js +2 -0
- package/public/assets/{fleet-metrics-BkHP-P3R.js → fleet-metrics-BiDs3MLx.js} +2 -2
- package/public/assets/{formatted-body-Cm1RrzmN.js → formatted-body-CQBwc1fb.js} +3 -3
- package/public/assets/{formatted-body-impl-DQiOuOD1.js → formatted-body-impl-DyG0WsQS.js} +2 -2
- package/public/assets/{host-providers-dialog-CHqwXTov.js → host-providers-dialog-DKaW31dN.js} +2 -2
- package/public/assets/index-CRHep3M9.js +15 -0
- package/public/assets/index-MYAIwYTX.css +2 -0
- package/public/assets/{insights-fH1EL-qZ.js → insights-CzrtkpOE.js} +2 -2
- package/public/assets/{integrations-C5Oix6ng.js → integrations-aVsUmigt.js} +2 -2
- package/public/assets/{issue-ref-chip-ODyondIa.js → issue-ref-chip-BnSlM_95.js} +2 -2
- package/public/assets/{log-viewer-Cvfy6PW7.js → log-viewer-qe7Ee47Z.js} +2 -2
- package/public/assets/{maintenance-D8CDH5wZ.js → maintenance-NfjqFZAk.js} +2 -2
- package/public/assets/{managed-agents-egllbpij.js → managed-agents-BiH0HgaE.js} +2 -2
- package/public/assets/{markdown-preview-CYSFgVgK.js → markdown-preview-BixaT3Xr.js} +3 -3
- package/public/assets/{markdown-preview-impl-BteVIjX4.js → markdown-preview-impl-DNGlWIS3.js} +2 -2
- package/public/assets/{memory-C8WmXsyr.js → memory-DNsCl6UX.js} +2 -2
- package/public/assets/{messages-BzQdqlO6.js → messages-DopU1L1X.js} +2 -2
- package/public/assets/{orchestrators-B1HxzkNw.js → orchestrators-Cq7ckLQT.js} +2 -2
- package/public/assets/{overview-DCUnI4Z7.js → overview-C1DCTzzV.js} +2 -2
- package/public/assets/{pairs-ftCd2XcD.js → pairs-DE_m6rrE.js} +2 -2
- package/public/assets/{profile-icon-B2zH8DMH.js → profile-icon-B3rfh77F.js} +2 -2
- package/public/assets/project-profile-instructions-DQWZE0kA.js +2 -0
- package/public/assets/projects-Br2Bd2h1.js +2 -0
- package/public/assets/{prompt-settings-Bftq9czX.js → prompt-settings-BKvFsvGD.js} +2 -2
- package/public/assets/provider-display-DsuWMvVL.js +2 -0
- package/public/assets/{registry-DWCU5c8q.js → registry-Cw38_6gW.js} +2 -2
- package/public/assets/run-card-CpKqRbhg.js +2 -0
- package/public/assets/scroll-text-BKXS1ahr.js +2 -0
- package/public/assets/{secrets-C7GIUATz.js → secrets-DxI-vzSq.js} +2 -2
- package/public/assets/{service-access-settings-C3aujqTG.js → service-access-settings-D9s_VJbd.js} +2 -2
- package/public/assets/{settings-C6sZ9eBa.js → settings-CKZTVGIx.js} +2 -2
- package/public/assets/{shipping-Bu8p1gEw.js → shipping-B9YtnwtG.js} +2 -2
- package/public/assets/{stats-V9Z-GxUd.js → stats-DyUBKyWI.js} +2 -2
- package/public/assets/{status-dot-CVv0iGHL.js → status-dot-DYqlEUhJ.js} +2 -2
- package/public/assets/{store-BvtFdlGX.js → store-DcClXLH0.js} +3 -3
- package/public/assets/{tasks-CXU75HRF.js → tasks-Bh7Chr4-.js} +2 -2
- package/public/assets/{teams-BPf976zb.js → teams-bowI7qVY.js} +2 -2
- package/public/assets/{terminal-viewer-DE9BOe-8.js → terminal-viewer-BgVLHdsU.js} +3 -3
- package/public/assets/{terminal-viewer-impl-D04pjmGh.js → terminal-viewer-impl-Dz22UPy6.js} +2 -2
- package/public/assets/token-estimate-Co-Jdphh.js +2 -0
- package/public/assets/{use-agent-terminal-B1yR456R.js → use-agent-terminal-DSQQ-iY7.js} +2 -2
- package/public/assets/{use-decisions-D-S4tpDf.js → use-decisions-samMQhQf.js} +2 -2
- package/public/assets/use-project-list-59LheVP7.js +2 -0
- package/public/assets/{use-selectors-CnrAk2YP.js → use-selectors-BZa25xEB.js} +2 -2
- package/public/assets/{user-avatar-nBFIcR4M.js → user-avatar-DHxlvUvV.js} +2 -2
- package/public/assets/versioned-prompt-editor-BmED5DnJ.js +8 -0
- package/public/assets/{work-queue-TCjJxeT-.js → work-queue-CSvpuNLz.js} +2 -2
- package/public/assets/{workflow-marker-Cf3Hf2fN.js → workflow-marker-DAZcj5qt.js} +2 -2
- package/public/assets/{workflows-CXQX20Qj.js → workflows-DdmxRSyg.js} +2 -2
- package/public/assets/{workspaces-qSYzKYMA.js → workspaces-BxeKfVuF.js} +2 -2
- package/public/cosmos.html +4 -4
- package/public/index.html +31 -29
- package/runner/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/runner/plugins/claude/hooks/gate-run-guard.provisioned.mjs +31 -1
- package/runner/src/adapters/claude-effort.ts +2 -4
- package/runner/src/adapters/codex-launch-config.ts +4 -5
- package/runner/src/adapters/codex.ts +1 -1
- package/runner/src/adapters/opencode-provider.ts +7 -22
- package/runner/src/adapters/opencode.ts +4 -4
- package/runner/src/agent-runner/credentials.ts +42 -12
- package/runner/src/agent-runner/inbox.ts +27 -0
- package/runner/src/agent-runner/lifecycle-milestones.ts +0 -2
- package/runner/src/bin/claude.ts +4 -0
- package/runner/src/bin/codex.ts +4 -0
- package/runner/src/bin/opencode.ts +4 -0
- package/runner/src/index.ts +5 -2
- package/runner/src/provider-setup.ts +34 -0
- package/runner/src/providers.ts +2 -1
- package/runner/src/runner-core.ts +18 -23
- package/runner/src/spawn-input.ts +2 -1
- package/runner/src/test-run-dedup.ts +59 -56
- package/scripts/cd-config.ts +24 -3
- package/scripts/gate-run-lease.ts +10 -7
- package/scripts/gate.sh +5 -1
- package/src/branch-land-notice.ts +93 -0
- package/src/branch-landed.ts +7 -76
- package/src/bus.ts +19 -20
- package/src/cd-deploy-notify.ts +30 -2
- package/src/cd-host-lag-notify.ts +7 -6
- package/src/ci/incidents.ts +2 -2
- package/src/ci/monitor.ts +5 -8
- package/src/ci/root-missing.ts +2 -7
- package/src/ci/transition-notify.ts +7 -39
- package/src/cli/cd-pauses.ts +19 -0
- package/src/cli/orchestrator.ts +1 -1
- package/src/cli/state.ts +2 -19
- package/src/cli/task-edit.ts +22 -0
- package/src/cli/task.ts +3 -1
- package/src/cli/workflow.ts +8 -2
- package/src/commands-db.ts +10 -6
- package/src/commands-write.ts +8 -0
- package/src/config-store-write.ts +13 -1
- package/src/config-store.ts +25 -14
- package/src/db/activity-async.ts +6 -1
- package/src/db/activity-write-ops.ts +13 -1
- package/src/db/activity.ts +1 -14
- package/src/db/agent-lifecycle-write-ops.ts +1 -0
- package/src/db/agent-meta.ts +2 -2
- package/src/db/agent-ownership-write-ops.ts +4 -0
- package/src/db/agent-search.ts +1 -15
- package/src/db/agents-async.ts +58 -7
- package/src/db/agents-write-ops.ts +28 -5
- package/src/db/agents.ts +81 -54
- package/src/db/artifacts-write-ops.ts +8 -3
- package/src/db/bus-outbox-write-ops.ts +1 -0
- package/src/db/channels-write-ops.ts +4 -0
- package/src/db/ci-incidents-async.ts +5 -5
- package/src/db/ci-incidents-write-ops.ts +2 -2
- package/src/db/claude-api-budget-ops.ts +5 -5
- package/src/db/claude-app-oauth.ts +4 -4
- package/src/db/codex-reset-consumes-write-ops.ts +3 -0
- package/src/db/command-row.ts +10 -2
- package/src/db/commands-list-query.ts +2 -0
- package/src/db/commands-spawn-read.ts +1 -1
- package/src/db/commands-write-ops.ts +21 -0
- package/src/db/config-store-write-ops.ts +9 -2
- package/src/db/continuation-archives-async.ts +5 -0
- package/src/db/continuation-archives-write-ops.ts +9 -0
- package/src/db/continuations.ts +2 -2
- package/src/db/db-writer-worker.ts +8 -1
- package/src/db/delivery-write-ops.ts +5 -0
- package/src/db/deploy-events-async.ts +1 -0
- package/src/db/deploy-events-read-ops.ts +2 -1
- package/src/db/deploy-events.ts +35 -4
- package/src/db/hosts-registration.ts +10 -2
- package/src/db/hosts-write-ops.ts +14 -0
- package/src/db/hosts.ts +9 -6
- package/src/db/inbox-write-ops.ts +4 -0
- package/src/db/inbox.ts +0 -14
- package/src/db/index.ts +2 -0
- package/src/db/insights-write-ops.ts +1 -0
- package/src/db/integrations-async.ts +8 -0
- package/src/db/integrations-ops.ts +15 -0
- package/src/db/integrations.ts +15 -21
- package/src/db/issue-lifecycle.ts +3 -4
- package/src/db/issue-refs-async.ts +20 -0
- package/src/db/issue-refs-write-ops.ts +29 -0
- package/src/db/issue-refs.ts +7 -8
- package/src/db/long-running-work.ts +2 -2
- package/src/db/macos-privacy.ts +1 -1
- package/src/db/main-connection-writes.ts +23 -2
- package/src/db/maintenance-job-reconcile.ts +61 -0
- package/src/db/maintenance-job-runs-async.ts +14 -0
- package/src/db/maintenance-job-write-ops.ts +9 -0
- package/src/db/mappers.ts +2 -14
- package/src/db/merge-lease.ts +1 -15
- package/src/db/message-reads-write-ops.ts +3 -0
- package/src/db/message-write-ops.ts +4 -0
- package/src/db/migrations.ts +7 -15
- package/src/db/orchestrators-async.ts +7 -3
- package/src/db/orchestrators-write-ops.ts +7 -1
- package/src/db/orchestrators.ts +21 -77
- package/src/db/pairs.ts +1 -13
- package/src/db/project-profile-instructions.ts +50 -0
- package/src/db/prompt-versions-ops.ts +1 -0
- package/src/db/prompt-versions.ts +9 -2
- package/src/db/provider-catalog-write-ops.ts +4 -4
- package/src/db/provider-config-history.ts +8 -3
- package/src/db/provider-flap-messages-write-ops.ts +1 -0
- package/src/db/provider-model-seed.ts +34 -0
- package/src/db/provider-quota-lease-write-ops.ts +1 -0
- package/src/db/provider-quota-write-ops.ts +2 -0
- package/src/db/provisioning-write-ops.ts +9 -8
- package/src/db/read-op-marshaling-fixtures.ts +5 -0
- package/src/db/read-ops.ts +4 -0
- package/src/db/routing-policy.ts +3 -4
- package/src/db/schema.ts +9 -3
- package/src/db/secrets-broker-write-ops.ts +5 -5
- package/src/db/secrets-vault-write.ts +7 -7
- package/src/db/services-write-ops.ts +3 -0
- package/src/db/spawn-delegation-state.ts +11 -4
- package/src/db/spawn-tree-cleanup.ts +3 -0
- package/src/db/stats-async.ts +4 -3
- package/src/db/task-entity.ts +23 -2
- package/src/db/task-list.ts +3 -1
- package/src/db/tasks.ts +1 -17
- package/src/db/team-spawn-delegation.ts +1 -1
- package/src/db/teams-write-ops.ts +4 -4
- package/src/db/timer-cutover-write-ops.ts +7 -0
- package/src/db/timer-ingress-write-ops.ts +9 -0
- package/src/db/timer-ingress.ts +7 -1
- package/src/db/timer-operator-write-ops.ts +14 -0
- package/src/db/timer-transfer-write-ops.ts +4 -0
- package/src/db/timer-write-ops.ts +14 -0
- package/src/db/token-db-write-ops.ts +21 -0
- package/src/db/token-standing.ts +15 -11
- package/src/db/user-settings-write-ops.ts +1 -0
- package/src/db/vault-backup.ts +2 -2
- package/src/db/vault-expiry.ts +2 -2
- package/src/db/vault-health.ts +3 -3
- package/src/db/vault-token-ops.ts +8 -8
- package/src/db/web-tool-call-ops.ts +3 -3
- package/src/db/workflow-contact.ts +1 -1
- package/src/db/workflow-task-read-ops.ts +30 -0
- package/src/db/write-ops.ts +15 -1
- package/src/db/writer-fault-seam.ts +5 -2
- package/src/db/writer-gateway.ts +21 -12
- package/src/dispatch-availability.ts +10 -6
- package/src/ephemeral/{landing-ingress-proof-worker.ts → landing-ingress-proof.test-fixture.ts} +4 -2
- package/src/host/disk-alert.ts +121 -0
- package/src/lifecycle-manager.ts +3 -2
- package/src/maintenance/cd-watcher.ts +3 -3
- package/src/maintenance/critical-job-watchdog.ts +16 -17
- package/src/maintenance/index.ts +1 -0
- package/src/maintenance/jobs.ts +3 -2
- package/src/maintenance/scheduler.ts +84 -128
- package/src/maintenance/stalled-delivery-pager.ts +6 -5
- package/src/maintenance/workspaces.ts +1 -1
- package/src/managed-policy.ts +31 -27
- package/src/mcp/index.ts +5 -2
- package/src/mcp/output-descriptions.ts +8 -8
- package/src/mcp/presentation.ts +4 -4
- package/src/mcp/project-profile-instructions.ts +32 -0
- package/src/mcp/tool-groups.ts +1 -1
- package/src/mcp/tools-spawn.ts +4 -3
- package/src/mcp-agent-action.ts +1 -2
- package/src/mcp-host-tools.ts +1 -1
- package/src/mcp-issue-ref-tools.ts +12 -11
- package/src/mcp-maintenance-tools.ts +2 -2
- package/src/mcp-profile-trust-tools.ts +4 -4
- package/src/mcp-provider-catalog.ts +2 -2
- package/src/mcp-task-tools.ts +11 -5
- package/src/mcp-team-template-tools.ts +3 -3
- package/src/mcp-workflow-tools.ts +10 -3
- package/src/notification-types.ts +2 -1
- package/src/operator-alarm.ts +26 -11
- package/src/package-pack.ts +42 -39
- package/src/project-instructions.ts +4 -0
- package/src/project-profile-instruction-text.ts +6 -0
- package/src/project-profile-instructions.ts +20 -0
- package/src/provider-catalog-store.ts +3 -49
- package/src/provider-config-store.ts +12 -11
- package/src/provider-model-seed.ts +1 -18
- package/src/provider-quota-config-store.ts +5 -4
- package/src/provider-secrets.test-fixture.ts +3 -3
- package/src/recipe-runner.ts +2 -2
- package/src/repo-config-source.ts +10 -4
- package/src/routes/agent-profiles.ts +6 -6
- package/src/routes/agents-spawn.ts +1 -1
- package/src/routes/agents.ts +6 -6
- package/src/routes/commands-listing.ts +4 -0
- package/src/routes/commands.ts +2 -2
- package/src/routes/continuation-archives.ts +2 -2
- package/src/routes/host-resource-control.ts +4 -1
- package/src/routes/index.ts +10 -1
- package/src/routes/integrations.ts +24 -50
- package/src/routes/issue-refs.ts +7 -7
- package/src/routes/orchestrator-bootstrap.ts +3 -3
- package/src/routes/orchestrator-host-registration.ts +2 -2
- package/src/routes/orchestrator-host-utilization.ts +3 -1
- package/src/routes/orchestrator-proxy.ts +2 -2
- package/src/routes/orchestrator.ts +4 -4
- package/src/routes/project-profile-instructions.ts +27 -0
- package/src/routes/project-trust.ts +2 -2
- package/src/routes/provider-config.ts +9 -8
- package/src/routes/provider-quota-config.ts +2 -2
- package/src/routes/settings.ts +5 -5
- package/src/routes/stats.ts +6 -6
- package/src/routes/task-http.ts +15 -1
- package/src/routes/task-issues.ts +11 -26
- package/src/routes/tasks.ts +22 -53
- package/src/routes/team-templates.ts +5 -5
- package/src/routes/teams-config.ts +2 -2
- package/src/routes/tokens.ts +12 -5
- package/src/routes/workflows.ts +20 -5
- package/src/routing-policy-normalize.ts +1 -2
- package/src/routing-step-defaults.ts +0 -2
- package/src/runner-token-mint-limit.ts +63 -0
- package/src/runtime-grant.ts +4 -2
- package/src/runtime-tokens.ts +50 -9
- package/src/security.ts +13 -20
- package/src/server-background.ts +1 -1
- package/src/server.ts +5 -2
- package/src/services/host-utilization.ts +23 -0
- package/src/services/idle-epics.ts +5 -6
- package/src/services/issue-lifecycle.ts +57 -61
- package/src/services/issue-refs.ts +9 -13
- package/src/services/kernel-timers-cutover-chaos-worker.ts +12 -7
- package/src/services/kernel-timers-ingress.ts +1 -1
- package/src/services/kernel-timers-request-key-migration-chaos-worker.ts +4 -1
- package/src/services/landed-ancestry.ts +19 -3
- package/src/services/memory-areas.ts +15 -51
- package/src/services/plan-ci-notice.ts +57 -0
- package/src/services/plan-ci-recovery.ts +2 -55
- package/src/services/plan-wake-digest.ts +1 -0
- package/src/services/profile-trust.ts +4 -3
- package/src/services/project-config-read.ts +70 -0
- package/src/services/project-profile-instructions.ts +54 -0
- package/src/services/provisioning-harness/budget-baseline.json +4 -4
- package/src/services/restart-spawn.ts +61 -49
- package/src/services/self-care-state.ts +2 -1
- package/src/services/self-effort.ts +5 -5
- package/src/services/send-message.ts +5 -1
- package/src/services/spawn-agent.ts +13 -2
- package/src/services/spawn-chain-inspector.ts +6 -13
- package/src/services/spawn-policy.ts +68 -0
- package/src/services/spawn-tree-cleanup.ts +2 -2
- package/src/services/task-dispatch.ts +3 -0
- package/src/services/task-state-reconcile.ts +6 -14
- package/src/services/team-templates.ts +9 -8
- package/src/services/transient-agent-reaper.ts +3 -1
- package/src/services/workflow-auto-start.ts +25 -13
- package/src/services/workflow-ci-main.ts +1 -1
- package/src/services/workflow-deferred-cleanup.ts +4 -2
- package/src/services/workflow-effect-driver.ts +2 -0
- package/src/services/workflow-effects.ts +18 -11
- package/src/services/workflow-land-notice.ts +10 -0
- package/src/services/workflow-pause-text.ts +43 -0
- package/src/services/workflow-reconcile.ts +13 -11
- package/src/services/workflow-run-view.ts +2 -0
- package/src/services/workflow-runs.ts +29 -13
- package/src/services/workflow-supervisor-state.ts +5 -0
- package/src/services/workflow-supervisor.ts +7 -3
- package/src/settings/registry.ts +1 -2
- package/src/spawn-command.ts +4 -4
- package/src/spawn-models.ts +10 -12
- package/src/spawn-placement.ts +1 -1
- package/src/spawn-targets.ts +1 -1
- package/src/startup-context-injection.ts +1 -0
- package/src/state-adoption/cd-cutover.ts +53 -7
- package/src/state-adoption/fleet-cutover.ts +35 -0
- package/src/state-adoption/fleet-plan.ts +36 -0
- package/src/state-adoption/index.ts +2 -2
- package/src/state-adoption/linux-plan.ts +2 -2
- package/src/state-adoption/linux.ts +2 -2
- package/src/state-adoption/macos-plan.ts +2 -2
- package/src/state-adoption/macos.ts +1 -1
- package/src/steward.ts +7 -6
- package/src/task-dispatch-live.ts +1 -1
- package/src/task-dispatcher.ts +1 -1
- package/src/teams-config-store.ts +4 -3
- package/src/token-db-write.ts +10 -0
- package/src/workspace-command-settle.ts +2 -1
- package/src/workspace-steward-wake.ts +2 -2
- package/node_modules/@humwick/kernel/LICENSE +0 -167
- package/node_modules/@humwick/kernel/async-entity-persistence.ts +0 -344
- package/node_modules/@humwick/kernel/async-event-log.ts +0 -107
- package/node_modules/@humwick/kernel/automations.pilot.ts +0 -147
- package/node_modules/@humwick/kernel/config.ts +0 -111
- package/node_modules/@humwick/kernel/contract.ts +0 -572
- package/node_modules/@humwick/kernel/control-authz.ts +0 -281
- package/node_modules/@humwick/kernel/control.ts +0 -645
- package/node_modules/@humwick/kernel/effects.ts +0 -493
- package/node_modules/@humwick/kernel/event-log.ts +0 -319
- package/node_modules/@humwick/kernel/http-transport.ts +0 -384
- package/node_modules/@humwick/kernel/identity-grammar.ts +0 -20
- package/node_modules/@humwick/kernel/identity.ts +0 -248
- package/node_modules/@humwick/kernel/index.ts +0 -28
- package/node_modules/@humwick/kernel/kernel-persistence.ts +0 -181
- package/node_modules/@humwick/kernel/landing-incident.ts +0 -306
- package/node_modules/@humwick/kernel/landing.ts +0 -953
- package/node_modules/@humwick/kernel/manifest-validation.ts +0 -460
- package/node_modules/@humwick/kernel/mcp-transport.ts +0 -109
- package/node_modules/@humwick/kernel/message-authority-chaos-worker.ts +0 -200
- package/node_modules/@humwick/kernel/message-authority.ts +0 -281
- package/node_modules/@humwick/kernel/module-host.ts +0 -722
- package/node_modules/@humwick/kernel/openapi-init.ts +0 -14
- package/node_modules/@humwick/kernel/package.json +0 -47
- package/node_modules/@humwick/kernel/persistence-schema.ts +0 -248
- package/node_modules/@humwick/kernel/persistence.ts +0 -510
- package/node_modules/@humwick/kernel/registry.ts +0 -60
- package/node_modules/@humwick/kernel/sqlite-kernel-persistence.ts +0 -499
- package/node_modules/@humwick/kernel/sqlite-module-host.ts +0 -87
- package/node_modules/@humwick/kernel/timers-chaos-worker.ts +0 -186
- package/node_modules/@humwick/kernel/timers.pilot.ts +0 -1411
- package/node_modules/@humwick/kernel/workflow-activation.ts +0 -25
- package/node_modules/@humwick/kernel/workflow-backstop.ts +0 -40
- package/node_modules/@humwick/kernel/workflow-cancel-tree.ts +0 -20
- package/node_modules/@humwick/kernel/workflow-chaos-worker.ts +0 -213
- package/node_modules/@humwick/kernel/workflow-composition.ts +0 -231
- package/node_modules/@humwick/kernel/workflow-container.ts +0 -72
- package/node_modules/@humwick/kernel/workflow-control.test-fixture.ts +0 -42
- package/node_modules/@humwick/kernel/workflow-control.ts +0 -178
- package/node_modules/@humwick/kernel/workflow-definition.ts +0 -507
- package/node_modules/@humwick/kernel/workflow-dispatch.ts +0 -60
- package/node_modules/@humwick/kernel/workflow-foreach.ts +0 -167
- package/node_modules/@humwick/kernel/workflow-journal-codec.ts +0 -339
- package/node_modules/@humwick/kernel/workflow-journal.ts +0 -922
- package/node_modules/@humwick/kernel/workflow-lane.ts +0 -48
- package/node_modules/@humwick/kernel/workflow-lease-owner.ts +0 -60
- package/node_modules/@humwick/kernel/workflow-recovery.test-fixture.ts +0 -19
- package/node_modules/@humwick/kernel/workflow-runtime.ts +0 -938
- package/node_modules/@humwick/kernel/workflow-script.ts +0 -11
- package/node_modules/@humwick/kernel/workflow-state.ts +0 -299
- package/node_modules/@humwick/kernel/workflow-step-commit.ts +0 -195
- package/node_modules/@humwick/kernel/workflow-transitions.ts +0 -317
- package/node_modules/@humwick/kernel/workflow-values.ts +0 -153
- package/node_modules/@humwick/kernel/workflow.pilot.ts +0 -376
- package/node_modules/@humwick/offload/LICENSE +0 -167
- package/node_modules/@humwick/offload/README.md +0 -57
- package/node_modules/@humwick/offload/dist/async-runner.d.ts +0 -18
- package/node_modules/@humwick/offload/dist/async-runner.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/async-runner.js +0 -158
- package/node_modules/@humwick/offload/dist/async-runner.js.map +0 -1
- package/node_modules/@humwick/offload/dist/envelope.d.ts +0 -25
- package/node_modules/@humwick/offload/dist/envelope.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/envelope.js +0 -80
- package/node_modules/@humwick/offload/dist/envelope.js.map +0 -1
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.d.ts +0 -10
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.js +0 -59
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.js.map +0 -1
- package/node_modules/@humwick/offload/dist/index.d.ts +0 -5
- package/node_modules/@humwick/offload/dist/index.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/index.js +0 -5
- package/node_modules/@humwick/offload/dist/index.js.map +0 -1
- package/node_modules/@humwick/offload/dist/subprocess-runner.d.ts +0 -62
- package/node_modules/@humwick/offload/dist/subprocess-runner.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/subprocess-runner.js +0 -295
- package/node_modules/@humwick/offload/dist/subprocess-runner.js.map +0 -1
- package/node_modules/@humwick/offload/dist/types.d.ts +0 -111
- package/node_modules/@humwick/offload/dist/types.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/types.js +0 -176
- package/node_modules/@humwick/offload/dist/types.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-pool.d.ts +0 -23
- package/node_modules/@humwick/offload/dist/worker-pool.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-pool.js +0 -435
- package/node_modules/@humwick/offload/dist/worker-pool.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-runtime.d.ts +0 -2
- package/node_modules/@humwick/offload/dist/worker-runtime.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-runtime.js +0 -27
- package/node_modules/@humwick/offload/dist/worker-runtime.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker.d.ts +0 -5
- package/node_modules/@humwick/offload/dist/worker.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker.js +0 -1
- package/node_modules/@humwick/offload/dist/worker.js.map +0 -1
- package/node_modules/@humwick/offload/package.json +0 -46
- package/node_modules/@humwick/offload/src/async-runner.ts +0 -170
- package/node_modules/@humwick/offload/src/envelope.ts +0 -92
- package/node_modules/@humwick/offload/src/fixtures/worker-task.ts +0 -49
- package/node_modules/@humwick/offload/src/index.ts +0 -4
- package/node_modules/@humwick/offload/src/subprocess-runner.ts +0 -334
- package/node_modules/@humwick/offload/src/types.ts +0 -235
- package/node_modules/@humwick/offload/src/worker-pool.ts +0 -463
- package/node_modules/@humwick/offload/src/worker-runtime.ts +0 -32
- package/node_modules/@humwick/offload/src/worker.ts +0 -5
- package/public/assets/agent-liveness-DyqxfB-t.js +0 -2
- package/public/assets/agent-profiles-BpI_jTxq.js +0 -2
- package/public/assets/fleet-BL4UXS_k.js +0 -2
- package/public/assets/index-B7ZerHLY.css +0 -2
- package/public/assets/index-BK0WV6hF.js +0 -15
- package/public/assets/projects-B_lmcqfO.js +0 -2
- package/public/assets/provider-display-DbLWpP3j.js +0 -2
- package/public/assets/run-card-CO_bguQf.js +0 -2
- package/public/assets/use-project-list-B-T2Bnnn.js +0 -2
- package/public/assets/versioned-prompt-editor-Diu8BIaM.js +0 -8
- package/runner/src/gate-run-lease-probe.ts +0 -38
- package/src/db/claude-catalog-reconcile.ts +0 -27
- package/src/routing-model-aliases.ts +0 -21
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t,u as n}from"./dist-DeW2Y1R5.js";import{w as r}from"./provider-display-
|
|
2
|
-
//# sourceMappingURL=agent-type-icon-
|
|
1
|
+
import{n as e,o as t,u as n}from"./dist-DeW2Y1R5.js";import{w as r}from"./provider-display-DsuWMvVL.js";import{s as i}from"./display-BrKWFGJz.js";import{t as a}from"./bot-B0NpDNhr.js";import{t as o}from"./messages-square-DVM1ZtcI.js";import{t as s}from"./plug-vIyO9_P8.js";import{t as c}from"./workflow-marker-DAZcj5qt.js";import{t as l}from"./server-CZIRjFyY.js";import{t as u}from"./provider-brand-icon-_67JR7Zh.js";var d=e(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),f=n(),p={codex:`text-tone-info-fg bg-tone-info/10 border-tone-info/25`,claude:`text-tone-orange-fg bg-tone-orange/10 border-tone-orange/25`,opencode:`text-tone-cyan-fg bg-tone-cyan/10 border-tone-cyan/25`,user:`text-tone-success-fg bg-tone-success/10 border-tone-success/25`,system:`text-tone-purple-fg bg-tone-purple/10 border-tone-purple/25`,channel:`text-tone-info-fg bg-tone-info/10 border-tone-info/25`,agent:`text-tone-neutral-fg bg-tone-neutral/10 border-tone-neutral/25`},m={user:d,system:l,channel:o,agent:a};function h({agent:e,className:n}){let o=i(e),l=e?.id===r,d=m[o]||a;return(0,f.jsxs)(`span`,{title:l?`Claude app connector`:void 0,className:t(`relative inline-flex items-center justify-center w-5 h-5 rounded-md border text-sm`,p[o]||p.agent,n),children:[l?(0,f.jsx)(s,{className:`w-3.5 h-3.5`}):(0,f.jsx)(u,{provider:o,fallback:d,className:`w-3.5 h-3.5`}),(0,f.jsx)(c,{agent:e,className:`h-2 w-2`,corner:!0})]})}export{d as n,h as t};
|
|
2
|
+
//# sourceMappingURL=agent-type-icon-LrUEU3lB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{Bt as i,Ct as a,t as o}from"./store-BvtFdlGX.js";import{O as s,r as c,t as l}from"./provider-display-DbLWpP3j.js";import{Z as u,a as d,et as f,f as p,n as m,nt as h,o as g,r as _,rt as v}from"./display-CfO7rTuF.js";import{t as y}from"./api-CIIVBtAV.js";import{a as b,i as x,n as S,r as C,t as w}from"./popover-8w1TWKMG.js";import{t as T}from"./switch-DuCA7mrB.js";import{_ as E,a as ee,h as te,i as D,n as O,o as ne,r as k,s as re,v as A}from"./agent-lineage-BbJDR1dW.js";import{t as j}from"./circle-arrow-up-B432r0Kk.js";import{t as M}from"./circle-UESLMi2-.js";import{t as ie}from"./flag-CnEG9PH-.js";import{t as N}from"./git-commit-horizontal-DS1pJ_SS.js";import{t as ae}from"./link-6RR7Hy3-.js";import{t as P}from"./message-square-C-1G8dMM.js";import{t as oe}from"./minimize-2-BkK6XoMP.js";import{n as se,t as ce}from"./agent-project-badge-9TqzUUYE.js";import{n as F,t as I}from"./pin-DcsKeXxr.js";import{t as L}from"./plus-D5Ek4e2S.js";import{t as le}from"./power-6tZOhYPg.js";import{t as ue}from"./terminal-Bl2u7KxT.js";import{t as de}from"./trash-2-FbcSq927.js";import{t as R}from"./triangle-alert-BBNhfgMi.js";import{t as z}from"./agent-type-icon-D6FUarOf.js";import{t as fe}from"./users-C7B3u9jv.js";import{t as B}from"./wrench-C7-4CgnY.js";import{t as V}from"./x-Bge17hWJ.js";import{t as H}from"./button-Do6Z3vvn.js";import{t as U}from"./badge-DqJRtj_p.js";import{t as pe}from"./copy-button-CjOj4HEf.js";import{t as me}from"./agent-name-CTZBrSD9.js";import{c as W,d as G,f as K,p as q,t as he,u as ge}from"./use-selectors-CnrAk2YP.js";import{t as J}from"./status-dot-CVv0iGHL.js";import{t as _e}from"./terminal-viewer-DE9BOe-8.js";import{n as ve,t as ye}from"./profile-icon-B2zH8DMH.js";import{r as be,t as xe}from"./card-C4QJ4hCW.js";import{t as Y}from"./user-avatar-nBFIcR4M.js";import{t as Se}from"./use-agent-terminal-B1yR456R.js";var X=e(n(),1),Z=r();function Ce({agent:e}){let t=o(e=>e.sessionUser),n=o(e=>e.fetchAgents),[r,i]=(0,X.useState)(!1),[a,c]=(0,X.useState)(``);return t&&t.role!==`admin`&&t.id!==e.principalUserId||e.id===`system`||s(e.id)?null:(0,Z.jsxs)(`div`,{className:`mt-2 text-xs`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(T,{"aria-label":`Share ${e.name||e.id}`,checked:e.visibility===`shared`,disabled:r,onCheckedChange:async t=>{i(!0),c(``);try{await y(`PUT`,`/agents/${encodeURIComponent(e.id)}/visibility`,{visibility:t?`shared`:`private`}),await n()}catch(e){c(e instanceof Error?e.message:`Could not save sharing`)}finally{i(!1)}}}),`Shared with everyone`]}),a&&(0,Z.jsx)(`p`,{role:`alert`,children:a})]})}var Q={idle:{label:`idle`,tip:`Branch worktree — nothing to land yet.`,className:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,Icon:M},changes:{label:`changes`,tip:`Unlanded work in this branch — use "Mark workspace ready" to land it.`,className:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,Icon:N},ready:{label:`ready`,tip:`Handed off — the relay auto-merge will land it (~2 min sweep).`,className:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,Icon:j},steward:{label:`steward`,tip:`Under reconciliation — a steward is landing it. No action needed.`,className:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,Icon:B},blocked:{label:`blocked`,tip:`Escalated — the auto-merge/steward path is stuck. Needs human attention.`,className:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,Icon:R}};function we({state:e,onClick:n,iconOnly:r=!1,className:i}){let a=Q[e],{Icon:o}=a,s=!!n,c=s?`${a.tip} Click to open this workspace.`:a.tip;return(0,Z.jsxs)(`span`,{role:s?`button`:void 0,tabIndex:s?0:void 0,title:c,onClick:n,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n?.(e))}:void 0,className:t(`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium leading-none`,a.className,s&&`cursor-pointer hover:brightness-125 focus:outline-none focus:ring-1 focus:ring-current`,i),children:[(0,Z.jsx)(o,{className:`h-2.5 w-2.5 shrink-0`}),!r&&(0,Z.jsx)(`span`,{children:a.label})]})}function $(e,t){let n=e.keep;return n&&(n.until===void 0||n.until>t)?n:void 0}function Te(e){return`Kept ${e.until?`until ${new Date(e.until).toLocaleString()}`:`until cleared`}${e.reason?` — ${e.reason}`:``}. Excluded from idle digests and automatic cleanup.`}function Ee({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=$(e,t);return r?(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":`true`,title:`${Te(r)} Click to release.`,className:`mt-1 inline-flex h-5 items-center gap-1 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-1.5 text-[10px] font-medium text-tone-sky-fg hover:bg-tone-sky/15`,onClick:t=>{t.stopPropagation(),n(e,!1)},children:[(0,Z.jsx)(I,{className:`h-3 w-3`}),`Kept`]}):null}function De({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=!!$(e,t);return(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,"aria-pressed":r,title:r?`Release keep`:`Keep — exclude from idle digests and automatic cleanup`,onClick:()=>void n(e,!r),children:r?(0,Z.jsx)(F,{className:`w-3 h-3`}):(0,Z.jsx)(I,{className:`w-3 h-3`})})}function Oe({agent:e}){let t=o(e=>e.users.length>1),n=o(t=>e.principalUserId?t.usersById[e.principalUserId]:void 0);if(!t||!e.principalUserId)return null;let r=n?.displayName||n?.handle||e.principalUserId;return(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1 text-[10px] text-muted-foreground`,"data-testid":`agent-principal`,title:`Works for ${r}`,children:[(0,Z.jsx)(Y,{user:n,address:`user:${e.principalUserId}`,distinct:!0,className:`size-3.5 rounded text-[8px]`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`for `,r]})]})}function ke(e,t){return e.agent===t.agent&&e.parentAgent===t.parentAgent&&i(e.childAgents??[],t.childAgents??[])}var Ae=(0,X.memo)(function({agent:e,childAgents:t=[],parentAgent:n}){let r=a();o(e=>e.set);let i=o(e=>e.switchView),c=o(e=>e.openInboxThread),l=o(e=>e.openAgentDetail),y=o(e=>e.openPairInvite),T=o(e=>e.openRename),E=o(e=>e.openConfirm),D=o(e=>e.doAgentAction),O=o(e=>e.doDeleteAgent),k=o(e=>e.openFilesForAgent),A=o(e=>e.workspaceAction),j=o(e=>e.openWorkspaceFocus),{terminalOpen:M,terminalTarget:N,terminalOpening:F,openTerminal:I,closeTerminal:L}=Se(e.id),R=ge(),B=d(r,e,he(e),R[e.id]||null),V=g(e,`shutdown`),W=g(e,`compact`),G=g(e,`clearContext`),K=!!(e.providerCapabilities?.terminal?.live?.read||e.providerCapabilities?.terminal?.attach?.create),q=_(e,K),Y=m(e),X=n?p(n):e.spawnedBy,Q=t.length>0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xe,{className:`group hover:border-tone-neutral transition-colors cursor-pointer`,onClick:()=>l(e),children:(0,Z.jsxs)(be,{className:`p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-2.5`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-0.5`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,Z.jsx)(ye,{profile:ve(e),className:`text-sm shrink-0`}),(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:p(e)})]}),(0,Z.jsx)(`div`,{className:`text-xs mt-0.5 ${h(B.tone)}`,children:B.label}),typeof e.meta?.cwd==`string`&&e.meta.cwd&&(0,Z.jsx)(`button`,{type:`button`,className:`mt-0.5 block max-w-full truncate font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:`Open ${e.meta.cwd} in Files`,onClick:t=>{t.stopPropagation(),k(e)},children:u(e.meta.cwd)}),e.landState&&(0,Z.jsxs)(`div`,{className:`mt-1 text-[10px] text-tone-violet-fg`,children:[e.landState,e.landWaitReason?` · ${e.landWaitReason}`:``]}),(0,Z.jsx)(ce,{agent:e,className:`mt-1`}),(0,Z.jsx)(Ee,{agent:e,now:r}),(0,Z.jsx)(Oe,{agent:e})]}),e.branchState&&e.branchWorkspaceId&&(0,Z.jsx)(we,{state:e.branchState,className:`mt-0.5 shrink-0`,onClick:t=>{t.stopPropagation(),j(e.branchWorkspaceId)}})]}),B.badges.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:B.badges.map(e=>(0,Z.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${e.className}`,children:e.label},e.label))}),(Q||e.spawnedBy&&X)&&(0,Z.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,onClick:e=>e.stopPropagation(),children:[Q&&(0,Z.jsxs)(w,{children:[(0,Z.jsx)(b,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-2 text-[10px] font-medium text-tone-sky-fg transition-colors hover:bg-tone-sky/15`,title:`${t.length} live child ${t.length===1?`agent`:`agents`}`,children:[(0,Z.jsx)(fe,{className:`h-3 w-3`}),(0,Z.jsx)(`span`,{children:t.length}),(0,Z.jsx)(`span`,{className:`flex -space-x-1`,children:t.slice(0,4).map(e=>(0,Z.jsx)(J,{agent:e,now:r,className:`h-2 w-2 ring-1 ring-background`},e.id))})]})}),(0,Z.jsxs)(S,{align:`start`,className:`w-80`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(C,{children:(0,Z.jsx)(x,{children:`Team`})}),(0,Z.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,Z.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-1`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-xs font-medium`,children:p(e)}),(0,Z.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.providerCapabilities?.model?.alias||e.providerCapabilities?.model?.id||e.providerCapabilities?.model?.provider||e.status})]}),(0,Z.jsx)(U,{variant:`outline`,className:`h-4 px-1.5 text-[9px]`,children:e.status})]}),(0,Z.jsxs)(`div`,{className:`mt-2 flex gap-1`,children:[(0,Z.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>l(e),children:`Open`}),(0,Z.jsxs)(H,{size:`xs`,variant:`ghost`,onClick:()=>{c(e.id),i(`chat`)},children:[(0,Z.jsx)(P,{className:`h-3 w-3`}),`Chat`]})]})]},e.id))})]})]}),e.spawnedBy&&X&&(0,Z.jsx)(U,{variant:`outline`,className:`max-w-full text-[10px] text-muted-foreground`,children:(0,Z.jsxs)(`span`,{className:`truncate`,children:[`spawned by `,(0,Z.jsx)(me,{agent:n,fallback:e.spawnedBy})]})})]}),(0,Z.jsx)(Ce,{agent:e}),(e.tags.length>0||v(e.capabilities).length>0)&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:[e.tags.slice(0,3).map(e=>(0,Z.jsx)(U,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e)),v(e.capabilities).slice(0,2).map(e=>(0,Z.jsx)(U,{variant:`secondary`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))]}),(0,Z.jsxs)(`div`,{className:`space-y-2 mb-2`,children:[(0,Z.jsx)(ne,{agent:e}),(0,Z.jsx)(ee,{agent:e,compact:!0}),(0,Z.jsx)(re,{agent:e})]}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:!s(e.id)&&e.id!==`system`&&f(r,e.lastSeen)}),(0,Z.jsxs)(`div`,{className:`flex gap-1 mt-2.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(pe,{value:e.id,label:`Copy agent ID`,size:`icon`,className:`h-7 w-7`,iconClassName:`w-3 h-3`}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Chat`,onClick:()=>{c(e.id),i(`chat`)},children:(0,Z.jsx)(P,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Pair`,onClick:()=>y(e.id),children:(0,Z.jsx)(ae,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Rename`,onClick:()=>T(e),children:(0,Z.jsx)(se,{className:`w-3 h-3`})}),K&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Terminal`,disabled:F,onClick:()=>void I(),children:(0,Z.jsx)(ue,{className:`w-3 h-3`})}),(e.branchState===`changes`||e.branchState===`idle`)&&e.branchWorkspaceId&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-warning-fg hover:text-tone-warning-fg`,title:`Mark workspace ready — hand off to the auto-merge`,onClick:()=>E(`Mark Workspace Ready`,`Mark ${p(e)}'s branch ready to land? The relay auto-merge will rebase and land it.`,()=>A(e.branchWorkspaceId,`ready`)),children:(0,Z.jsx)(ie,{className:`w-3 h-3`})}),e.kind!==`user`&&e.id!==`system`&&(0,Z.jsx)(De,{agent:e,now:r}),W&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Compact`,onClick:()=>E(`Compact Agent`,`Compact context for ${p(e)}?`,()=>D(e,`compact`,`agents-grid`)),children:(0,Z.jsx)(oe,{className:`w-3 h-3`})}),G&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Clear Context`,onClick:()=>E(`Clear Context`,`Clear context for ${p(e)}?`,()=>D(e,`clearContext`,`agents-grid`)),children:(0,Z.jsx)(te,{className:`w-3 h-3`})}),V&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Shutdown`,onClick:()=>E(`Shutdown Agent`,`Shutdown ${p(e)}?`,()=>D(e,`shutdown`,`agents-grid`)),children:(0,Z.jsx)(le,{className:`w-3 h-3`})}),Y&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Forget stale agent`,onClick:()=>E(`Forget Agent`,`Forget ${p(e)}?`,()=>O(e.id)),children:(0,Z.jsx)(de,{className:`w-3 h-3`})})]})]})}),N&&(0,Z.jsx)(_e,{open:M,onOpenChange:L,orchestratorId:N.orchestratorId,session:N.session,interactive:N.interactive||q,canWrite:q,onSessionChanged:()=>void I()})]})},ke);function je(){let e=o(e=>e.agentPresetFilter),t=o(e=>e.agentStatusFilter),n=o(e=>e.agentTagFilter),r=o(e=>e.agentHostFilter),i=o(e=>e.agentSort),s=o(e=>e.agentSortDir),u=o(e=>e.showOffline),d=o(e=>e.setShowOffline),f=W(),p=o(e=>e.set),m=o(e=>e.openAgentSpawn),h=o(e=>e.agentsById),g=a(),_=G(),v=q(),y=K(),b=O(_,g),x=D(_,g),S=e||t||n||r;function C(){p({agentPresetFilter:``,agentStatusFilter:``,agentTagFilter:``,agentHostFilter:``})}function w(){p({agentSortDir:s===`asc`?`desc`:`asc`})}return(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`select`,{value:e,onChange:e=>p({agentPresetFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`All agents`}),(0,Z.jsx)(`option`,{value:`active`,children:`Active`}),l().map(e=>(0,Z.jsx)(`option`,{value:e,children:c(e)},e)),(0,Z.jsx)(`option`,{value:`paired`,children:`Paired`}),(0,Z.jsx)(`option`,{value:`unpaired`,children:`Unpaired`}),(0,Z.jsx)(`option`,{value:`offline_stale`,children:`Offline / Stale`})]}),(0,Z.jsxs)(`select`,{value:t,onChange:e=>p({agentStatusFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any status`}),(0,Z.jsx)(`option`,{value:`online`,children:`Online`}),(0,Z.jsx)(`option`,{value:`idle`,children:`Idle`}),(0,Z.jsx)(`option`,{value:`busy`,children:`Busy`}),(0,Z.jsx)(`option`,{value:`offline`,children:`Offline`}),(0,Z.jsx)(`option`,{value:`starting`,children:`Starting`})]}),v.length>0&&(0,Z.jsxs)(`select`,{value:n,onChange:e=>p({agentTagFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any tag`}),v.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),y.length>1&&(0,Z.jsxs)(`select`,{value:r,onChange:e=>p({agentHostFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any host`}),y.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsxs)(`select`,{value:i,onChange:e=>p({agentSort:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:`status`,children:`Sort: Status`}),(0,Z.jsx)(`option`,{value:`name`,children:`Sort: Name`}),(0,Z.jsx)(`option`,{value:`lastSeen`,children:`Sort: Last seen`}),(0,Z.jsx)(`option`,{value:`created`,children:`Sort: Created`})]}),(0,Z.jsx)(H,{size:`icon`,variant:`outline`,className:`h-8 w-8`,title:`Toggle sort direction`,onClick:w,children:s===`asc`?(0,Z.jsx)(E,{className:`w-3.5 h-3.5`}):(0,Z.jsx)(A,{className:`w-3.5 h-3.5`})}),(0,Z.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer select-none`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked),className:`rounded`}),`Show offline`,f>0?` (${f})`:``]}),S&&(0,Z.jsxs)(H,{size:`sm`,variant:`ghost`,className:`h-8 text-muted-foreground hover:text-foreground gap-1`,onClick:C,children:[(0,Z.jsx)(V,{className:`w-3 h-3`}),`Clear filters`]}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsxs)(H,{size:`sm`,onClick:m,className:`gap-1`,children:[(0,Z.jsx)(L,{className:`w-3.5 h-3.5`}),`Spawn`]})})]}),x.length===0?(0,Z.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:`No agents match the current filters.`}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3`,children:x.map(e=>(0,Z.jsx)(Ae,{agent:e,parentAgent:e.spawnedBy?h[e.spawnedBy]??null:null,childAgents:k(b.get(e.id)??[])},e.id))})]})}export{je as AgentsView};
|
|
2
|
-
//# sourceMappingURL=agents-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{Bt as i,Ct as a,t as o}from"./store-DcClXLH0.js";import{O as s,r as c,t as l}from"./provider-display-DsuWMvVL.js";import{Z as u,a as d,et as f,f as p,n as m,nt as h,o as g,r as _,rt as v}from"./display-BrKWFGJz.js";import{t as y}from"./api-CIIVBtAV.js";import{a as b,i as x,n as S,r as C,t as w}from"./popover-8w1TWKMG.js";import{t as T}from"./switch-DuCA7mrB.js";import{_ as E,a as ee,h as te,i as D,n as O,o as ne,r as k,s as re,v as A}from"./agent-lineage-CknAJKcb.js";import{t as j}from"./circle-arrow-up-B432r0Kk.js";import{t as M}from"./circle-UESLMi2-.js";import{t as ie}from"./flag-CnEG9PH-.js";import{t as N}from"./git-commit-horizontal-DS1pJ_SS.js";import{t as ae}from"./link-6RR7Hy3-.js";import{t as P}from"./message-square-C-1G8dMM.js";import{t as oe}from"./minimize-2-BkK6XoMP.js";import{n as se,t as ce}from"./agent-project-badge-Diz4Sjjb.js";import{n as F,t as I}from"./pin-DcsKeXxr.js";import{t as L}from"./plus-D5Ek4e2S.js";import{t as le}from"./power-6tZOhYPg.js";import{t as ue}from"./terminal-Bl2u7KxT.js";import{t as de}from"./trash-2-FbcSq927.js";import{t as R}from"./triangle-alert-BBNhfgMi.js";import{t as z}from"./agent-type-icon-LrUEU3lB.js";import{t as fe}from"./users-C7B3u9jv.js";import{t as B}from"./wrench-C7-4CgnY.js";import{t as V}from"./x-Bge17hWJ.js";import{t as H}from"./button-Do6Z3vvn.js";import{t as U}from"./badge-DqJRtj_p.js";import{t as pe}from"./copy-button-CjOj4HEf.js";import{t as me}from"./agent-name-DKbiIhBo.js";import{c as W,d as G,f as K,p as q,t as he,u as ge}from"./use-selectors-BZa25xEB.js";import{t as J}from"./status-dot-DYqlEUhJ.js";import{t as _e}from"./terminal-viewer-BgVLHdsU.js";import{n as ve,t as ye}from"./profile-icon-B3rfh77F.js";import{r as be,t as xe}from"./card-C4QJ4hCW.js";import{t as Y}from"./user-avatar-DHxlvUvV.js";import{t as Se}from"./use-agent-terminal-DSQQ-iY7.js";var X=e(n(),1),Z=r();function Ce({agent:e}){let t=o(e=>e.sessionUser),n=o(e=>e.fetchAgents),[r,i]=(0,X.useState)(!1),[a,c]=(0,X.useState)(``);return t&&t.role!==`admin`&&t.id!==e.principalUserId||e.id===`system`||s(e.id)?null:(0,Z.jsxs)(`div`,{className:`mt-2 text-xs`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(T,{"aria-label":`Share ${e.name||e.id}`,checked:e.visibility===`shared`,disabled:r,onCheckedChange:async t=>{i(!0),c(``);try{await y(`PUT`,`/agents/${encodeURIComponent(e.id)}/visibility`,{visibility:t?`shared`:`private`}),await n()}catch(e){c(e instanceof Error?e.message:`Could not save sharing`)}finally{i(!1)}}}),`Shared with everyone`]}),a&&(0,Z.jsx)(`p`,{role:`alert`,children:a})]})}var Q={idle:{label:`idle`,tip:`Branch worktree — nothing to land yet.`,className:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,Icon:M},changes:{label:`changes`,tip:`Unlanded work in this branch — use "Mark workspace ready" to land it.`,className:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,Icon:N},ready:{label:`ready`,tip:`Handed off — the relay auto-merge will land it (~2 min sweep).`,className:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,Icon:j},steward:{label:`steward`,tip:`Under reconciliation — a steward is landing it. No action needed.`,className:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,Icon:B},blocked:{label:`blocked`,tip:`Escalated — the auto-merge/steward path is stuck. Needs human attention.`,className:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,Icon:R}};function we({state:e,onClick:n,iconOnly:r=!1,className:i}){let a=Q[e],{Icon:o}=a,s=!!n,c=s?`${a.tip} Click to open this workspace.`:a.tip;return(0,Z.jsxs)(`span`,{role:s?`button`:void 0,tabIndex:s?0:void 0,title:c,onClick:n,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n?.(e))}:void 0,className:t(`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium leading-none`,a.className,s&&`cursor-pointer hover:brightness-125 focus:outline-none focus:ring-1 focus:ring-current`,i),children:[(0,Z.jsx)(o,{className:`h-2.5 w-2.5 shrink-0`}),!r&&(0,Z.jsx)(`span`,{children:a.label})]})}function $(e,t){let n=e.keep;return n&&(n.until===void 0||n.until>t)?n:void 0}function Te(e){return`Kept ${e.until?`until ${new Date(e.until).toLocaleString()}`:`until cleared`}${e.reason?` — ${e.reason}`:``}. Excluded from idle digests and automatic cleanup.`}function Ee({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=$(e,t);return r?(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":`true`,title:`${Te(r)} Click to release.`,className:`mt-1 inline-flex h-5 items-center gap-1 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-1.5 text-[10px] font-medium text-tone-sky-fg hover:bg-tone-sky/15`,onClick:t=>{t.stopPropagation(),n(e,!1)},children:[(0,Z.jsx)(I,{className:`h-3 w-3`}),`Kept`]}):null}function De({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=!!$(e,t);return(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,"aria-pressed":r,title:r?`Release keep`:`Keep — exclude from idle digests and automatic cleanup`,onClick:()=>void n(e,!r),children:r?(0,Z.jsx)(F,{className:`w-3 h-3`}):(0,Z.jsx)(I,{className:`w-3 h-3`})})}function Oe({agent:e}){let t=o(e=>e.users.length>1),n=o(t=>e.principalUserId?t.usersById[e.principalUserId]:void 0);if(!t||!e.principalUserId)return null;let r=n?.displayName||n?.handle||e.principalUserId;return(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1 text-[10px] text-muted-foreground`,"data-testid":`agent-principal`,title:`Works for ${r}`,children:[(0,Z.jsx)(Y,{user:n,address:`user:${e.principalUserId}`,distinct:!0,className:`size-3.5 rounded text-[8px]`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`for `,r]})]})}function ke(e,t){return e.agent===t.agent&&e.parentAgent===t.parentAgent&&i(e.childAgents??[],t.childAgents??[])}var Ae=(0,X.memo)(function({agent:e,childAgents:t=[],parentAgent:n}){let r=a();o(e=>e.set);let i=o(e=>e.switchView),c=o(e=>e.openInboxThread),l=o(e=>e.openAgentDetail),y=o(e=>e.openPairInvite),T=o(e=>e.openRename),E=o(e=>e.openConfirm),D=o(e=>e.doAgentAction),O=o(e=>e.doDeleteAgent),k=o(e=>e.openFilesForAgent),A=o(e=>e.workspaceAction),j=o(e=>e.openWorkspaceFocus),{terminalOpen:M,terminalTarget:N,terminalOpening:F,openTerminal:I,closeTerminal:L}=Se(e.id),R=ge(),B=d(r,e,he(e),R[e.id]||null),V=g(e,`shutdown`),W=g(e,`compact`),G=g(e,`clearContext`),K=!!(e.providerCapabilities?.terminal?.live?.read||e.providerCapabilities?.terminal?.attach?.create),q=_(e,K),Y=m(e),X=n?p(n):e.spawnedBy,Q=t.length>0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xe,{className:`group hover:border-tone-neutral transition-colors cursor-pointer`,onClick:()=>l(e),children:(0,Z.jsxs)(be,{className:`p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-2.5`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-0.5`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,Z.jsx)(ye,{profile:ve(e),className:`text-sm shrink-0`}),(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:p(e)})]}),(0,Z.jsx)(`div`,{className:`text-xs mt-0.5 ${h(B.tone)}`,children:B.label}),typeof e.meta?.cwd==`string`&&e.meta.cwd&&(0,Z.jsx)(`button`,{type:`button`,className:`mt-0.5 block max-w-full truncate font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:`Open ${e.meta.cwd} in Files`,onClick:t=>{t.stopPropagation(),k(e)},children:u(e.meta.cwd)}),e.landState&&(0,Z.jsxs)(`div`,{className:`mt-1 text-[10px] text-tone-violet-fg`,children:[e.landState,e.landWaitReason?` · ${e.landWaitReason}`:``]}),(0,Z.jsx)(ce,{agent:e,className:`mt-1`}),(0,Z.jsx)(Ee,{agent:e,now:r}),(0,Z.jsx)(Oe,{agent:e})]}),e.branchState&&e.branchWorkspaceId&&(0,Z.jsx)(we,{state:e.branchState,className:`mt-0.5 shrink-0`,onClick:t=>{t.stopPropagation(),j(e.branchWorkspaceId)}})]}),B.badges.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:B.badges.map(e=>(0,Z.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${e.className}`,children:e.label},e.label))}),(Q||e.spawnedBy&&X)&&(0,Z.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,onClick:e=>e.stopPropagation(),children:[Q&&(0,Z.jsxs)(w,{children:[(0,Z.jsx)(b,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-2 text-[10px] font-medium text-tone-sky-fg transition-colors hover:bg-tone-sky/15`,title:`${t.length} live child ${t.length===1?`agent`:`agents`}`,children:[(0,Z.jsx)(fe,{className:`h-3 w-3`}),(0,Z.jsx)(`span`,{children:t.length}),(0,Z.jsx)(`span`,{className:`flex -space-x-1`,children:t.slice(0,4).map(e=>(0,Z.jsx)(J,{agent:e,now:r,className:`h-2 w-2 ring-1 ring-background`},e.id))})]})}),(0,Z.jsxs)(S,{align:`start`,className:`w-80`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(C,{children:(0,Z.jsx)(x,{children:`Team`})}),(0,Z.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,Z.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-1`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-xs font-medium`,children:p(e)}),(0,Z.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.providerCapabilities?.model?.alias||e.providerCapabilities?.model?.id||e.providerCapabilities?.model?.provider||e.status})]}),(0,Z.jsx)(U,{variant:`outline`,className:`h-4 px-1.5 text-[9px]`,children:e.status})]}),(0,Z.jsxs)(`div`,{className:`mt-2 flex gap-1`,children:[(0,Z.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>l(e),children:`Open`}),(0,Z.jsxs)(H,{size:`xs`,variant:`ghost`,onClick:()=>{c(e.id),i(`chat`)},children:[(0,Z.jsx)(P,{className:`h-3 w-3`}),`Chat`]})]})]},e.id))})]})]}),e.spawnedBy&&X&&(0,Z.jsx)(U,{variant:`outline`,className:`max-w-full text-[10px] text-muted-foreground`,children:(0,Z.jsxs)(`span`,{className:`truncate`,children:[`spawned by `,(0,Z.jsx)(me,{agent:n,fallback:e.spawnedBy})]})})]}),(0,Z.jsx)(Ce,{agent:e}),(e.tags.length>0||v(e.capabilities).length>0)&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:[e.tags.slice(0,3).map(e=>(0,Z.jsx)(U,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e)),v(e.capabilities).slice(0,2).map(e=>(0,Z.jsx)(U,{variant:`secondary`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))]}),(0,Z.jsxs)(`div`,{className:`space-y-2 mb-2`,children:[(0,Z.jsx)(ne,{agent:e}),(0,Z.jsx)(ee,{agent:e,compact:!0}),(0,Z.jsx)(re,{agent:e})]}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:!s(e.id)&&e.id!==`system`&&f(r,e.lastSeen)}),(0,Z.jsxs)(`div`,{className:`flex gap-1 mt-2.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(pe,{value:e.id,label:`Copy agent ID`,size:`icon`,className:`h-7 w-7`,iconClassName:`w-3 h-3`}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Chat`,onClick:()=>{c(e.id),i(`chat`)},children:(0,Z.jsx)(P,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Pair`,onClick:()=>y(e.id),children:(0,Z.jsx)(ae,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Rename`,onClick:()=>T(e),children:(0,Z.jsx)(se,{className:`w-3 h-3`})}),K&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Terminal`,disabled:F,onClick:()=>void I(),children:(0,Z.jsx)(ue,{className:`w-3 h-3`})}),(e.branchState===`changes`||e.branchState===`idle`)&&e.branchWorkspaceId&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-warning-fg hover:text-tone-warning-fg`,title:`Mark workspace ready — hand off to the auto-merge`,onClick:()=>E(`Mark Workspace Ready`,`Mark ${p(e)}'s branch ready to land? The relay auto-merge will rebase and land it.`,()=>A(e.branchWorkspaceId,`ready`)),children:(0,Z.jsx)(ie,{className:`w-3 h-3`})}),e.kind!==`user`&&e.id!==`system`&&(0,Z.jsx)(De,{agent:e,now:r}),W&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Compact`,onClick:()=>E(`Compact Agent`,`Compact context for ${p(e)}?`,()=>D(e,`compact`,`agents-grid`)),children:(0,Z.jsx)(oe,{className:`w-3 h-3`})}),G&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Clear Context`,onClick:()=>E(`Clear Context`,`Clear context for ${p(e)}?`,()=>D(e,`clearContext`,`agents-grid`)),children:(0,Z.jsx)(te,{className:`w-3 h-3`})}),V&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Shutdown`,onClick:()=>E(`Shutdown Agent`,`Shutdown ${p(e)}?`,()=>D(e,`shutdown`,`agents-grid`)),children:(0,Z.jsx)(le,{className:`w-3 h-3`})}),Y&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Forget stale agent`,onClick:()=>E(`Forget Agent`,`Forget ${p(e)}?`,()=>O(e.id)),children:(0,Z.jsx)(de,{className:`w-3 h-3`})})]})]})}),N&&(0,Z.jsx)(_e,{open:M,onOpenChange:L,orchestratorId:N.orchestratorId,session:N.session,interactive:N.interactive||q,canWrite:q,onSessionChanged:()=>void I()})]})},ke);function je(){let e=o(e=>e.agentPresetFilter),t=o(e=>e.agentStatusFilter),n=o(e=>e.agentTagFilter),r=o(e=>e.agentHostFilter),i=o(e=>e.agentSort),s=o(e=>e.agentSortDir),u=o(e=>e.showOffline),d=o(e=>e.setShowOffline),f=W(),p=o(e=>e.set),m=o(e=>e.openAgentSpawn),h=o(e=>e.agentsById),g=a(),_=G(),v=q(),y=K(),b=O(_,g),x=D(_,g),S=e||t||n||r;function C(){p({agentPresetFilter:``,agentStatusFilter:``,agentTagFilter:``,agentHostFilter:``})}function w(){p({agentSortDir:s===`asc`?`desc`:`asc`})}return(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`select`,{value:e,onChange:e=>p({agentPresetFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`All agents`}),(0,Z.jsx)(`option`,{value:`active`,children:`Active`}),l().map(e=>(0,Z.jsx)(`option`,{value:e,children:c(e)},e)),(0,Z.jsx)(`option`,{value:`paired`,children:`Paired`}),(0,Z.jsx)(`option`,{value:`unpaired`,children:`Unpaired`}),(0,Z.jsx)(`option`,{value:`offline_stale`,children:`Offline / Stale`})]}),(0,Z.jsxs)(`select`,{value:t,onChange:e=>p({agentStatusFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any status`}),(0,Z.jsx)(`option`,{value:`online`,children:`Online`}),(0,Z.jsx)(`option`,{value:`idle`,children:`Idle`}),(0,Z.jsx)(`option`,{value:`busy`,children:`Busy`}),(0,Z.jsx)(`option`,{value:`offline`,children:`Offline`}),(0,Z.jsx)(`option`,{value:`starting`,children:`Starting`})]}),v.length>0&&(0,Z.jsxs)(`select`,{value:n,onChange:e=>p({agentTagFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any tag`}),v.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),y.length>1&&(0,Z.jsxs)(`select`,{value:r,onChange:e=>p({agentHostFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any host`}),y.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsxs)(`select`,{value:i,onChange:e=>p({agentSort:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:`status`,children:`Sort: Status`}),(0,Z.jsx)(`option`,{value:`name`,children:`Sort: Name`}),(0,Z.jsx)(`option`,{value:`lastSeen`,children:`Sort: Last seen`}),(0,Z.jsx)(`option`,{value:`created`,children:`Sort: Created`})]}),(0,Z.jsx)(H,{size:`icon`,variant:`outline`,className:`h-8 w-8`,title:`Toggle sort direction`,onClick:w,children:s===`asc`?(0,Z.jsx)(E,{className:`w-3.5 h-3.5`}):(0,Z.jsx)(A,{className:`w-3.5 h-3.5`})}),(0,Z.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer select-none`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked),className:`rounded`}),`Show offline`,f>0?` (${f})`:``]}),S&&(0,Z.jsxs)(H,{size:`sm`,variant:`ghost`,className:`h-8 text-muted-foreground hover:text-foreground gap-1`,onClick:C,children:[(0,Z.jsx)(V,{className:`w-3 h-3`}),`Clear filters`]}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsxs)(H,{size:`sm`,onClick:m,className:`gap-1`,children:[(0,Z.jsx)(L,{className:`w-3.5 h-3.5`}),`Spawn`]})})]}),x.length===0?(0,Z.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:`No agents match the current filters.`}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3`,children:x.map(e=>(0,Z.jsx)(Ae,{agent:e,parentAgent:e.spawnedBy?h[e.spawnedBy]??null:null,childAgents:k(b.get(e.id)??[])},e.id))})]})}export{je as AgentsView};
|
|
2
|
+
//# sourceMappingURL=agents-B-v66C-4.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-DcClXLH0.js";import{M as a,r as o,t as s}from"./provider-display-DsuWMvVL.js";import{o as c}from"./artifacts-D32zyw4Y.js";import{t as l}from"./api-CIIVBtAV.js";import{t as u}from"./themes-G5j9m1Ji.js";import{i as d,r as f,t as p}from"./tabs-jZgNvNHr.js";import{t as m}from"./bot-B0NpDNhr.js";import{t as h}from"./clock-BWPPBh1_.js";import{n as g,t as _}from"./repeat-hl4p_Klo.js";import{t as v}from"./message-square-C-1G8dMM.js";import{t as y}from"./wrench-C7-4CgnY.js";import{t as b}from"./agent-name-DKbiIhBo.js";import{o as x,r as S,s as C,t as w}from"./card-C4QJ4hCW.js";import{r as T}from"./shipping-stats-BiMTsA4A.js";var E=[`iterate`,`delivery`,`land`,`mainCi`],D=e(n(),1);function O(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function A(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,ae(r.key),r)}}function N(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function P(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=se(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function F(e){var t=ee();return function(){var n,r=L(e);if(t){var i=L(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return k(e)}(this,n)}}function I(e,t,n){return(t=ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function R(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ne(e,t)}function ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(ee=function(){return!!e})()}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?te(Object(n),!0).forEach((function(t){I(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ne(e,t){return ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ne(e,t)}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||se(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ie(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||se(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ae(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}function oe(e){return oe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},oe(e)}function se(e,t){if(e){if(typeof e==`string`)return O(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}var B=function(){function e(){A(this,e)}return N(e,[{key:`shadeRGBColor`,value:function(e,t){var n=t.split(`,`),r=e<0?0:255,i=e<0?-1*e:e,a=parseInt(n[0].slice(4),10),o=parseInt(n[1],10),s=parseInt(n[2],10);return`rgb(`+(Math.round((r-a)*i)+a)+`,`+(Math.round((r-o)*i)+o)+`,`+(Math.round((r-s)*i)+s)+`)`}},{key:`shadeHexColor`,value:function(e,t){var n=parseInt(t.slice(1),16),r=e<0?0:255,i=e<0?-1*e:e,a=n>>16,o=n>>8&255,s=255&n;return`#`+(16777216+65536*(Math.round((r-a)*i)+a)+256*(Math.round((r-o)*i)+o)+(Math.round((r-s)*i)+s)).toString(16).slice(1)}},{key:`shadeColor`,value:function(t,n){return e.isColorHex(n)?this.shadeHexColor(t,n):this.shadeRGBColor(t,n)}}],[{key:`bind`,value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:`isObject`,value:function(e){return e&&oe(e)===`object`&&!Array.isArray(e)&&e!=null}},{key:`is`,value:function(e,t){return Object.prototype.toString.call(t)===`[object `+e+`]`}},{key:`isSafari`,value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:`listToArray`,value:function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n}},{key:`extend`,value:function(e,t){var n=this;typeof Object.assign!=`function`&&(Object.assign=function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t});var r=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach((function(i){n.isObject(t[i])&&i in e?r[i]=n.extend(e[i],t[i]):Object.assign(r,I({},i,t[i]))})),r}},{key:`extendArray`,value:function(t,n){var r=[];return t.map((function(t){r.push(e.extend(n,t))})),t=r}},{key:`monthMod`,value:function(e){return e%12}},{key:`clone`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e===null||oe(e)!==`object`)return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){t=[],n.set(e,t);for(var r=0;r<e.length;r++)t[r]=this.clone(e[r],n)}else if(e instanceof Date)t=new Date(e.getTime());else for(var i in t={},n.set(e,t),e)e.hasOwnProperty(i)&&(t[i]=this.clone(e[i],n));return t}},{key:`log10`,value:function(e){return Math.log(e)/Math.LN10}},{key:`roundToBase10`,value:function(e){return 10**Math.floor(Math.log10(e))}},{key:`roundToBase`,value:function(e,t){return t**+Math.floor(Math.log(e)/Math.log(t))}},{key:`parseNumber`,value:function(e){return e===null?e:parseFloat(e)}},{key:`stripNumber`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:`randomId`,value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:`noExponents`,value:function(e){return e.toString().includes(`e`)?Math.round(e):e}},{key:`elementExists`,value:function(e){return!(!e||!e.isConnected)}},{key:`getDimensions`,value:function(e){var t=getComputedStyle(e,null),n=e.clientHeight,r=e.clientWidth;return n-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[r-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),n]}},{key:`getBoundingClientRect`,value:function(e){var t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:`getLargestStringFromArr`,value:function(e){return e.reduce((function(e,t){return Array.isArray(t)&&(t=t.reduce((function(e,t){return e.length>t.length?e:t}))),e.length>t.length?e:t}),0)}},{key:`hexToRgba`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`#999999`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;e.substring(0,1)!==`#`&&(e=`#999999`);var n=e.replace(`#`,``);n=n.match(RegExp(`(.{`+n.length/3+`})`,`g`));for(var r=0;r<n.length;r++)n[r]=parseInt(n[r].length===1?n[r]+n[r]:n[r],16);return t!==void 0&&n.push(t),`rgba(`+n.join(`,`)+`)`}},{key:`getOpacityFromRGBA`,value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,`$1`))}},{key:`rgb2hex`,value:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&e.length===4?`#`+(`0`+parseInt(e[1],10).toString(16)).slice(-2)+(`0`+parseInt(e[2],10).toString(16)).slice(-2)+(`0`+parseInt(e[3],10).toString(16)).slice(-2):``}},{key:`isColorHex`,value:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:`getPolygonPos`,value:function(e,t){for(var n=[],r=2*Math.PI/t,i=0;i<t;i++){var a={};a.x=e*Math.sin(i*r),a.y=-e*Math.cos(i*r),n.push(a)}return n}},{key:`polarToCartesian`,value:function(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}},{key:`escapeString`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`x`,n=e.toString().slice();return n=n.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:`negToZero`,value:function(e){return e<0?0:e}},{key:`moveIndexInArray`,value:function(e,t,n){if(n>=e.length)for(var r=n-e.length+1;r--;)e.push(void 0);return e.splice(n,0,e.splice(t,1)[0]),e}},{key:`extractNumber`,value:function(e){return parseFloat(e.replace(/[^\d.]*/g,``))}},{key:`findAncestor`,value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:`setELstyles`,value:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style.key=t[n])}},{key:`preciseAddition`,value:function(e,t){var n=(String(e).split(`.`)[1]||``).length,r=(String(t).split(`.`)[1]||``).length,i=10**Math.max(n,r);return(Math.round(e*i)+Math.round(t*i))/i}},{key:`isNumber`,value:function(e){return!isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:`isFloat`,value:function(e){return Number(e)===e&&e%1!=0}},{key:`isMsEdge`,value:function(){var e=window.navigator.userAgent,t=e.indexOf(`Edge/`);return t>0&&parseInt(e.substring(t+5,e.indexOf(`.`,t)),10)}},{key:`getGCD`,value:function(e,t){var n=10**((arguments.length>2&&arguments[2]!==void 0?arguments[2]:7)-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*n),t=Math.round(Math.abs(t)*n);t;){var r=t;t=e%t,e=r}return e/n}},{key:`getPrimeFactors`,value:function(e){for(var t=[],n=2;e>=2;)e%n==0?(t.push(n),e/=n):n++;return t}},{key:`mod`,value:function(e,t){var n=10**((arguments.length>2&&arguments[2]!==void 0?arguments[2]:7)-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*n))%(t=Math.round(Math.abs(t)*n))/n}}]),e}(),ce=function(){function e(t){A(this,e),this.ctx=t,this.w=t.w}return N(e,[{key:`animateLine`,value:function(e,t,n,r){e.attr(t).animate(r).attr(n)}},{key:`animateMarker`,value:function(e,t,n,r){e.attr({opacity:0}).animate(t).attr({opacity:1}).after((function(){r()}))}},{key:`animateRect`,value:function(e,t,n,r,i){e.attr(t).animate(r).attr(n).after((function(){return i()}))}},{key:`animatePathsGradually`,value:function(e){var t=e.el,n=e.realIndex,r=e.j,i=e.fill,a=e.pathFrom,o=e.pathTo,s=e.speed,c=e.delay,l=this.w,u=0;l.config.chart.animations.animateGradually.enabled&&(u=l.config.chart.animations.animateGradually.delay),l.config.chart.animations.dynamicAnimation.enabled&&l.globals.dataChanged&&l.config.chart.type!==`bar`&&(u=0),this.morphSVG(t,n,r,l.config.chart.type!==`line`||l.globals.comboCharts?i:`stroke`,a,o,s,c*u)}},{key:`showDelayedElements`,value:function(){this.w.globals.delayedElements.forEach((function(e){var t=e.el;t.classList.remove(`apexcharts-element-hidden`),t.classList.add(`apexcharts-hidden-element-shown`)}))}},{key:`animationCompleted`,value:function(e){var t=this.w;t.globals.animationEnded||(t.globals.animationEnded=!0,this.showDelayedElements(),typeof t.config.chart.events.animationEnd==`function`&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:`morphSVG`,value:function(e,t,n,r,i,a,o,s){var c=this,l=this.w;i||=e.attr(`pathFrom`),a||=e.attr(`pathTo`);var u=function(e){return l.config.chart.type===`radar`&&(o=1),`M 0 ${l.globals.gridHeight}`};(!i||i.indexOf(`undefined`)>-1||i.indexOf(`NaN`)>-1)&&(i=u()),(!a.trim()||a.indexOf(`undefined`)>-1||a.indexOf(`NaN`)>-1)&&(a=u()),l.globals.shouldAnimate||(o=1),e.plot(i).animate(1,s).plot(i).animate(o,s).plot(a).after((function(){B.isNumber(n)?n===l.globals.series[l.globals.maxValsInArrayIndex].length-2&&l.globals.shouldAnimate&&c.animationCompleted(e):r!==`none`&&l.globals.shouldAnimate&&(!l.globals.comboCharts&&t===l.globals.series.length-1||l.globals.comboCharts)&&c.animationCompleted(e),c.showDelayedElements()}))}}]),e}(),le={},ue=[];function V(e,t){if(Array.isArray(e))for(let n of e)V(n,t);else if(typeof e!=`object`)fe(Object.getOwnPropertyNames(t)),le[e]=Object.assign(le[e]||{},t);else for(let t in e)V(t,e[t])}function de(e){return le[e]||{}}function fe(e){ue.push(...e)}function pe(e,t){let n,r=e.length,i=[];for(n=0;n<r;n++)i.push(t(e[n]));return i}function me(e){return e%360*Math.PI/180}function he(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ge(e,t,n,r){return t!=null&&n!=null||(r||=e.bbox(),t==null?t=r.width/r.height*n:n??=r.height/r.width*t),{width:t,height:n}}function _e(e,t){let n=e.origin,r=e.ox==null?e.originX==null?`center`:e.originX:e.ox,i=e.oy==null?e.originY==null?`center`:e.originY:e.oy;n!=null&&([r,i]=Array.isArray(n)?n:typeof n==`object`?[n.x,n.y]:[n,n]);let a=typeof r==`string`,o=typeof i==`string`;if(a||o){let{height:e,width:n,x:s,y:c}=t.bbox();a&&(r=r.includes(`left`)?s:r.includes(`right`)?s+n:s+n/2),o&&(i=i.includes(`top`)?c:i.includes(`bottom`)?c+e:c+e/2)}return[r,i]}var ve=new Set([`desc`,`metadata`,`title`]),ye=e=>ve.has(e.nodeName),be=(e,t,n={})=>{let r={...t};for(let e in r)r[e].valueOf()===n[e]&&delete r[e];Object.keys(r).length?e.node.setAttribute(`data-svgjs`,JSON.stringify(r)):(e.node.removeAttribute(`data-svgjs`),e.node.removeAttribute(`svgjs:data`))},xe=`http://www.w3.org/2000/svg`,Se=`http://www.w3.org/2000/xmlns/`,Ce=`http://www.w3.org/1999/xlink`,H={window:typeof window>`u`?null:window,document:typeof document>`u`?null:document};function we(){return H.window}var Te=class{},Ee={},De=`___SYMBOL___ROOT___`;function Oe(e,t=xe){return H.document.createElementNS(t,e)}function ke(e,t=!1){if(e instanceof Te)return e;if(typeof e==`object`)return je(e);if(e==null)return new Ee[De];if(typeof e==`string`&&e.charAt(0)!==`<`)return je(H.document.querySelector(e));let n=t?H.document.createElement(`div`):Oe(`svg`);return n.innerHTML=e,e=je(n.firstChild),n.removeChild(n.firstChild),e}function U(e,t){return t&&(t instanceof H.window.Node||t.ownerDocument&&t instanceof t.ownerDocument.defaultView.Node)?t:Oe(e)}function Ae(e){if(!e)return null;if(e.instance instanceof Te)return e.instance;if(e.nodeName===`#document-fragment`)return new Ee.Fragment(e);let t=he(e.nodeName||`Dom`);return t===`LinearGradient`||t===`RadialGradient`?t=`Gradient`:Ee[t]||(t=`Dom`),new Ee[t](e)}var je=Ae;function W(e,t=e.name,n=!1){return Ee[t]=e,n&&(Ee[De]=e),fe(Object.getOwnPropertyNames(e.prototype)),e}var Me=1e3;function Ne(e){return`Svgjs`+he(e)+Me++}function Pe(e){for(let t=e.children.length-1;t>=0;t--)Pe(e.children[t]);return e.id&&=Ne(e.nodeName),e}function G(e,t){let n,r;for(r=(e=Array.isArray(e)?e:[e]).length-1;r>=0;r--)for(n in t)e[r].prototype[n]=t[n]}function K(e){return function(...t){let n=t[t.length-1];return!n||n.constructor!==Object||n instanceof Array?e.apply(this,t):e.apply(this,t.slice(0,-1)).attr(n)}}V(`Dom`,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){let e=this.position();return this.parent().add(this.remove(),e+1),this},backward:function(){let e=this.position();return this.parent().add(this.remove(),e?e-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(e){(e=ke(e)).remove();let t=this.position();return this.parent().add(e,t),this},after:function(e){(e=ke(e)).remove();let t=this.position();return this.parent().add(e,t+1),this},insertBefore:function(e){return(e=ke(e)).before(this),this},insertAfter:function(e){return(e=ke(e)).after(this),this}});var Fe=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Ie=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Le=/rgb\((\d+),(\d+),(\d+)\)/,Re=/(#[a-z_][a-z0-9\-_]*)/i,ze=/\)\s*,?\s*/,Be=/\s/g,Ve=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,He=/^rgb\(/,Ue=/^(\s+)?$/,We=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ge=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Ke=/[\s,]+/,qe=/[MLHVCSQTAZ]/i;function Je(e){let t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return t.length===1?`0`+t:t}function Ye(e,t){for(let n=t.length;n--;)if(e[t[n]]==null)return!1;return!0}function Xe(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}V(`Dom`,{classes:function(){let e=this.attr(`class`);return e==null?[]:e.trim().split(Ke)},hasClass:function(e){return this.classes().indexOf(e)!==-1},addClass:function(e){if(!this.hasClass(e)){let t=this.classes();t.push(e),this.attr(`class`,t.join(` `))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr(`class`,this.classes().filter((function(t){return t!==e})).join(` `)),this},toggleClass:function(e){return this.hasClass(e)?this.removeClass(e):this.addClass(e)}}),V(`Dom`,{css:function(e,t){let n={};if(arguments.length===0)return this.node.style.cssText.split(/\s*;\s*/).filter((function(e){return!!e.length})).forEach((function(e){let t=e.split(/\s*:\s*/);n[t[0]]=t[1]})),n;if(arguments.length<2){if(Array.isArray(e)){for(let t of e){let e=t;n[t]=this.node.style.getPropertyValue(e)}return n}if(typeof e==`string`)return this.node.style.getPropertyValue(e);if(typeof e==`object`)for(let t in e)this.node.style.setProperty(t,e[t]==null||Ue.test(e[t])?``:e[t])}return arguments.length===2&&this.node.style.setProperty(e,t==null||Ue.test(t)?``:t),this},show:function(){return this.css(`display`,``)},hide:function(){return this.css(`display`,`none`)},visible:function(){return this.css(`display`)!==`none`}}),V(`Dom`,{data:function(e,t,n){if(e==null)return this.data(pe(function(e,t){let n,r=e.length,i=[];for(n=0;n<r;n++)t(e[n])&&i.push(e[n]);return i}(this.node.attributes,(e=>e.nodeName.indexOf(`data-`)===0)),(e=>e.nodeName.slice(5))));if(e instanceof Array){let t={};for(let n of e)t[n]=this.data(n);return t}if(typeof e==`object`)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr(`data-`+e))}catch{return this.attr(`data-`+e)}else this.attr(`data-`+e,t===null?null:!0===n||typeof t==`string`||typeof t==`number`?t:JSON.stringify(t));return this}}),V(`Dom`,{remember:function(e,t){if(typeof arguments[0]==`object`)for(let t in e)this.remember(t,e[t]);else{if(arguments.length===1)return this.memory()[e];this.memory()[e]=t}return this},forget:function(){if(arguments.length===0)this._memory={};else for(let e=arguments.length-1;e>=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory=this._memory||{}}});var Ze=class e{constructor(...e){this.init(...e)}static isColor(t){return t&&(t instanceof e||this.isRgb(t)||this.test(t))}static isRgb(e){return e&&typeof e.r==`number`&&typeof e.g==`number`&&typeof e.b==`number`}static random(t=`vibrant`,n){let{random:r,round:i,sin:a,PI:o}=Math;if(t===`vibrant`){let t=24*r()+57,n=38*r()+45,i=360*r();return new e(t,n,i,`lch`)}if(t===`sine`){let t=i(80*a(2*o*(n??=r())/.5+.01)+150),s=i(50*a(2*o*n/.5+4.6)+200),c=i(100*a(2*o*n/.5+2.3)+150);return new e(t,s,c)}if(t===`pastel`){let t=8*r()+86,n=17*r()+9,i=360*r();return new e(t,n,i,`lch`)}if(t===`dark`){let t=10+10*r(),n=50*r()+86,i=360*r();return new e(t,n,i,`lch`)}if(t===`rgb`){let t=255*r(),n=255*r(),i=255*r();return new e(t,n,i)}if(t===`lab`){let t=100*r(),n=256*r()-128,i=256*r()-128;return new e(t,n,i,`lab`)}if(t===`grey`){let t=255*r();return new e(t,t,t)}throw Error(`Unsupported random color mode`)}static test(e){return typeof e==`string`&&(Ve.test(e)||He.test(e))}cmyk(){let{_a:t,_b:n,_c:r}=this.rgb(),[i,a,o]=[t,n,r].map((e=>e/255)),s=Math.min(1-i,1-a,1-o);return s===1?new e(0,0,0,1,`cmyk`):new e((1-i-s)/(1-s),(1-a-s)/(1-s),(1-o-s)/(1-s),s,`cmyk`)}hsl(){let{_a:t,_b:n,_c:r}=this.rgb(),[i,a,o]=[t,n,r].map((e=>e/255)),s=Math.max(i,a,o),c=Math.min(i,a,o),l=(s+c)/2,u=s===c,d=s-c;return new e(360*(u?0:s===i?((a-o)/d+(a<o?6:0))/6:s===a?((o-i)/d+2)/6:s===o?((i-a)/d+4)/6:0),100*(u?0:l>.5?d/(2-s-c):d/(s+c)),100*l,`hsl`)}init(e=0,t=0,n=0,r=0,i=`rgb`){if(e||=0,this.space)for(let e in this.space)delete this[this.space[e]];if(typeof e==`number`)i=typeof r==`string`?r:i,r=typeof r==`string`?0:r,Object.assign(this,{_a:e,_b:t,_c:n,_d:r,space:i});else if(e instanceof Array)this.space=t||(typeof e[3]==`string`?e[3]:e[4])||`rgb`,Object.assign(this,{_a:e[0],_b:e[1],_c:e[2],_d:e[3]||0});else if(e instanceof Object){let n=function(e,t){let n=Ye(e,`rgb`)?{_a:e.r,_b:e.g,_c:e.b,_d:0,space:`rgb`}:Ye(e,`xyz`)?{_a:e.x,_b:e.y,_c:e.z,_d:0,space:`xyz`}:Ye(e,`hsl`)?{_a:e.h,_b:e.s,_c:e.l,_d:0,space:`hsl`}:Ye(e,`lab`)?{_a:e.l,_b:e.a,_c:e.b,_d:0,space:`lab`}:Ye(e,`lch`)?{_a:e.l,_b:e.c,_c:e.h,_d:0,space:`lch`}:Ye(e,`cmyk`)?{_a:e.c,_b:e.m,_c:e.y,_d:e.k,space:`cmyk`}:{_a:0,_b:0,_c:0,space:`rgb`};return n.space=t||n.space,n}(e,t);Object.assign(this,n)}else if(typeof e==`string`)if(He.test(e)){let t=e.replace(Be,``),[n,r,i]=Le.exec(t).slice(1,4).map((e=>parseInt(e)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:`rgb`})}else{if(!Ve.test(e))throw Error(`Unsupported string format, can't construct Color`);{let[,t,n,r]=Ie.exec(function(e){return e.length===4?[`#`,e.substring(1,2),e.substring(1,2),e.substring(2,3),e.substring(2,3),e.substring(3,4),e.substring(3,4)].join(``):e}(e)).map(e=>parseInt(e,16));Object.assign(this,{_a:t,_b:n,_c:r,_d:0,space:`rgb`})}}let{_a:a,_b:o,_c:s,_d:c}=this,l=this.space===`rgb`?{r:a,g:o,b:s}:this.space===`xyz`?{x:a,y:o,z:s}:this.space===`hsl`?{h:a,s:o,l:s}:this.space===`lab`?{l:a,a:o,b:s}:this.space===`lch`?{l:a,c:o,h:s}:this.space===`cmyk`?{c:a,m:o,y:s,k:c}:{};Object.assign(this,l)}lab(){let{x:t,y:n,z:r}=this.xyz();return new e(116*n-16,500*(t-n),200*(n-r),`lab`)}lch(){let{l:t,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2),a=180*Math.atan2(r,n)/Math.PI;return a<0&&(a*=-1,a=360-a),new e(t,i,a,`lch`)}rgb(){if(this.space===`rgb`)return this;if((t=this.space)===`lab`||t===`xyz`||t===`lch`){let{x:t,y:n,z:r}=this;if(this.space===`lab`||this.space===`lch`){let{l:e,a:i,b:a}=this;if(this.space===`lch`){let{c:e,h:t}=this,n=Math.PI/180;i=e*Math.cos(n*t),a=e*Math.sin(n*t)}let o=(e+16)/116,s=i/500+o,c=o-a/200,l=16/116,u=.008856,d=7.787;t=.95047*(s**3>u?s**3:(s-l)/d),n=1*(o**3>u?o**3:(o-l)/d),r=1.08883*(c**3>u?c**3:(c-l)/d)}let i=3.2406*t+-1.5372*n+-.4986*r,a=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,s=Math.pow,c=.0031308,l=i>c?1.055*s(i,1/2.4)-.055:12.92*i,u=a>c?1.055*s(a,1/2.4)-.055:12.92*a,d=o>c?1.055*s(o,1/2.4)-.055:12.92*o;return new e(255*l,255*u,255*d)}if(this.space===`hsl`){let{h:t,s:n,l:r}=this;if(t/=360,n/=100,r/=100,n===0)return r*=255,new e(r,r,r);let i=r<.5?r*(1+n):r+n-r*n,a=2*r-i,o=255*Xe(a,i,t+1/3),s=255*Xe(a,i,t),c=255*Xe(a,i,t-1/3);return new e(o,s,c)}if(this.space===`cmyk`){let{c:t,m:n,y:r,k:i}=this,a=255*(1-Math.min(1,t*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i)),s=255*(1-Math.min(1,r*(1-i)+i));return new e(a,o,s)}return this;var t}toArray(){let{_a:e,_b:t,_c:n,_d:r,space:i}=this;return[e,t,n,r,i]}toHex(){let[e,t,n]=this._clamped().map(Je);return`#${e}${t}${n}`}toRgb(){let[e,t,n]=this._clamped();return`rgb(${e},${t},${n})`}toString(){return this.toHex()}xyz(){let{_a:t,_b:n,_c:r}=this.rgb(),[i,a,o]=[t,n,r].map((e=>e/255)),s=i>.04045?((i+.055)/1.055)**2.4:i/12.92,c=a>.04045?((a+.055)/1.055)**2.4:a/12.92,l=o>.04045?((o+.055)/1.055)**2.4:o/12.92,u=(.4124*s+.3576*c+.1805*l)/.95047,d=(.2126*s+.7152*c+.0722*l)/1,f=(.0193*s+.1192*c+.9505*l)/1.08883,p=u>.008856?u**(1/3):7.787*u+16/116,m=d>.008856?d**(1/3):7.787*d+16/116,h=f>.008856?f**(1/3):7.787*f+16/116;return new e(p,m,h,`xyz`)}_clamped(){let{_a:e,_b:t,_c:n}=this.rgb(),{max:r,min:i,round:a}=Math;return[e,t,n].map((e=>r(0,i(a(e),255))))}},q=class e{constructor(...e){this.init(...e)}clone(){return new e(this)}init(e,t){let n=Array.isArray(e)?{x:e[0],y:e[1]}:typeof e==`object`?{x:e.x,y:e.y}:{x:e,y:t};return this.x=n.x==null?0:n.x,this.y=n.y==null?0:n.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){J.isMatrixLike(e)||(e=new J(e));let{x:t,y:n}=this;return this.x=e.a*t+e.c*n+e.e,this.y=e.b*t+e.d*n+e.f,this}};function Qe(e,t,n){return Math.abs(t-e)<(n||1e-6)}var J=class e{constructor(...e){this.init(...e)}static formatTransforms(e){let t=e.flip===`both`||!0===e.flip,n=e.flip&&(t||e.flip===`x`)?-1:1,r=e.flip&&(t||e.flip===`y`)?-1:1,i=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,a=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,o=e.scale&&e.scale.length?e.scale[0]*n:isFinite(e.scale)?e.scale*n:isFinite(e.scaleX)?e.scaleX*n:n,s=e.scale&&e.scale.length?e.scale[1]*r:isFinite(e.scale)?e.scale*r:isFinite(e.scaleY)?e.scaleY*r:r,c=e.shear||0,l=e.rotate||e.theta||0,u=new q(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),d=u.x,f=u.y,p=new q(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),m=p.x,h=p.y,g=new q(e.translate||e.tx||e.translateX,e.ty||e.translateY),_=g.x,v=g.y,y=new q(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:o,scaleY:s,skewX:i,skewY:a,shear:c,theta:l,rx:y.x,ry:y.y,tx:_,ty:v,ox:d,oy:f,px:m,py:h}}static fromArray(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}static isMatrixLike(e){return e.a!=null||e.b!=null||e.c!=null||e.d!=null||e.e!=null||e.f!=null}static matrixMultiply(e,t,n){let r=e.a*t.a+e.c*t.b,i=e.b*t.a+e.d*t.b,a=e.a*t.c+e.c*t.d,o=e.b*t.c+e.d*t.d,s=e.e+e.a*t.e+e.c*t.f,c=e.f+e.b*t.e+e.d*t.f;return n.a=r,n.b=i,n.c=a,n.d=o,n.e=s,n.f=c,n}around(e,t,n){return this.clone().aroundO(e,t,n)}aroundO(e,t,n){let r=e||0,i=t||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new e(this)}decompose(e=0,t=0){let n=this.a,r=this.b,i=this.c,a=this.d,o=this.e,s=this.f,c=n*a-r*i,l=c>0?1:-1,u=l*Math.sqrt(n*n+r*r),d=Math.atan2(l*r,l*n),f=180/Math.PI*d,p=Math.cos(d),m=Math.sin(d),h=(n*i+r*a)/c,g=i*u/(h*n-r)||a*u/(h*r+n);return{scaleX:u,scaleY:g,shear:h,rotate:f,translateX:o-e+e*p*u+t*(h*p*u-m*g),translateY:s-t+e*m*u+t*(h*m*u+p*g),originX:e,originY:t,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;let n=new e(t);return Qe(this.a,n.a)&&Qe(this.b,n.b)&&Qe(this.c,n.c)&&Qe(this.d,n.d)&&Qe(this.e,n.e)&&Qe(this.f,n.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return e===`x`?this.scaleO(-1,1,t,0):e===`y`?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(t){let n=e.fromArray([1,0,0,1,0,0]);return t=t instanceof St?t.matrixify():typeof t==`string`?e.fromArray(t.split(Ke).map(parseFloat)):Array.isArray(t)?e.fromArray(t):typeof t==`object`&&e.isMatrixLike(t)?t:typeof t==`object`?new e().transform(t):arguments.length===6?e.fromArray([].slice.call(arguments)):n,this.a=t.a==null?n.a:t.a,this.b=t.b==null?n.b:t.b,this.c=t.c==null?n.c:t.c,this.d=t.d==null?n.d:t.d,this.e=t.e==null?n.e:t.e,this.f=t.f==null?n.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){let e=this.a,t=this.b,n=this.c,r=this.d,i=this.e,a=this.f,o=e*r-t*n;if(!o)throw Error(`Cannot invert `+this);let s=r/o,c=-t/o,l=-n/o,u=e/o,d=-(s*i+l*a),f=-(c*i+u*a);return this.a=s,this.b=c,this.c=l,this.d=u,this.e=d,this.f=f,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(t){let n=t instanceof e?t:new e(t);return e.matrixMultiply(n,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(t){let n=t instanceof e?t:new e(t);return e.matrixMultiply(this,n,this)}rotate(e,t,n){return this.clone().rotateO(e,t,n)}rotateO(e,t=0,n=0){e=me(e);let r=Math.cos(e),i=Math.sin(e),{a,b:o,c:s,d:c,e:l,f:u}=this;return this.a=a*r-o*i,this.b=o*r+a*i,this.c=s*r-c*i,this.d=c*r+s*i,this.e=l*r-u*i+n*i-t*r+t,this.f=u*r+l*i-t*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e,t=e,n=0,r=0){arguments.length===3&&(r=n,n=t,t=e);let{a:i,b:a,c:o,d:s,e:c,f:l}=this;return this.a=i*e,this.b=a*t,this.c=o*e,this.d=s*t,this.e=c*e-n*e+n,this.f=l*t-r*t+r,this}shear(e,t,n){return this.clone().shearO(e,t,n)}shearO(e,t=0,n=0){let{a:r,b:i,c:a,d:o,e:s,f:c}=this;return this.a=r+i*e,this.c=a+o*e,this.e=s+c*e-n*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e,t=e,n=0,r=0){arguments.length===3&&(r=n,n=t,t=e),e=me(e),t=me(t);let i=Math.tan(e),a=Math.tan(t),{a:o,b:s,c,d:l,e:u,f:d}=this;return this.a=o+s*i,this.b=s+o*a,this.c=c+l*i,this.d=l+c*a,this.e=u+d*i-r*i,this.f=d+u*a-n*a,this}skewX(e,t,n){return this.skew(e,0,t,n)}skewY(e,t,n){return this.skew(0,e,t,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return`matrix(`+this.a+`,`+this.b+`,`+this.c+`,`+this.d+`,`+this.e+`,`+this.f+`)`}transform(t){if(e.isMatrixLike(t))return new e(t).multiplyO(this);let n=e.formatTransforms(t),{x:r,y:i}=new q(n.ox,n.oy).transform(this),a=new e().translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){let e=new q(r,i).transform(a),t=isFinite(n.px)?n.px-e.x:0,o=isFinite(n.py)?n.py-e.y:0;a.translateO(t,o)}return a.translateO(n.tx,n.ty),a}translate(e,t){return this.clone().translateO(e,t)}translateO(e,t){return this.e+=e||0,this.f+=t||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function $e(){if(!$e.nodes){let e=ke().size(2,0);e.node.style.cssText=[`opacity: 0`,`position: absolute`,`left: -100%`,`top: -100%`,`overflow: hidden`].join(`;`),e.attr(`focusable`,`false`),e.attr(`aria-hidden`,`true`),$e.nodes={svg:e,path:e.path().node}}if(!$e.nodes.svg.node.parentNode){let e=H.document.body||H.document.documentElement;$e.nodes.svg.addTo(e)}return $e.nodes}function et(e){return!(e.width||e.height||e.x||e.y)}W(J,`Matrix`);var tt=class e{constructor(...e){this.init(...e)}addOffset(){return this.x+=H.window.pageXOffset,this.y+=H.window.pageYOffset,new e(this)}init(e){return e=typeof e==`string`?e.split(Ke).map(parseFloat):Array.isArray(e)?e:typeof e==`object`?[e.left==null?e.x:e.left,e.top==null?e.y:e.top,e.width,e.height]:arguments.length===4?[].slice.call(arguments):[0,0,0,0],this.x=e[0]||0,this.y=e[1]||0,this.width=this.w=e[2]||0,this.height=this.h=e[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return et(this)}merge(t){let n=Math.min(this.x,t.x),r=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-n,a=Math.max(this.y+this.height,t.y+t.height)-r;return new e(n,r,i,a)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+` `+this.y+` `+this.width+` `+this.height}transform(t){t instanceof J||(t=new J(t));let n=1/0,r=-1/0,i=1/0,a=-1/0;return[new q(this.x,this.y),new q(this.x2,this.y),new q(this.x,this.y2),new q(this.x2,this.y2)].forEach((function(e){e=e.transform(t),n=Math.min(n,e.x),r=Math.max(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.y)})),new e(n,i,r-n,a-i)}};function nt(e,t,n){let r;try{if(r=t(e.node),et(r)&&(i=e.node)!==H.document&&!(H.document.documentElement.contains||function(e){for(;e.parentNode;)e=e.parentNode;return e===H.document}).call(H.document.documentElement,i))throw Error(`Element not in the dom`)}catch{r=n(e)}var i;return r}V({viewbox:{viewbox(e,t,n,r){return e==null?new tt(this.attr(`viewBox`)):this.attr(`viewBox`,new tt(e,t,n,r))},zoom(e,t){let{width:n,height:r}=this.attr([`width`,`height`]);if((n||r)&&typeof n!=`string`&&typeof r!=`string`||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw Error(`Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element`);let i=this.viewbox(),a=n/i.width,o=r/i.height,s=Math.min(a,o);if(e==null)return s;let c=s/e;c===1/0&&(c=(2**53-1)/100),t||=new q(n/2/a+i.x,r/2/o+i.y);let l=new tt(i).transform(new J({scale:c,origin:t}));return this.viewbox(l)}}}),W(tt,`Box`);var rt=class extends Array{constructor(e=[],...t){if(super(e,...t),typeof e==`number`)return this;this.length=0,this.push(...e)}};G([rt],{each(e,...t){return typeof e==`function`?this.map(((t,n,r)=>e.call(t,t,n,r))):this.map((n=>n[e](...t)))},toArray(){return Array.prototype.concat.apply([],this)}});var it=[`toArray`,`constructor`,`each`];function at(e,t){return new rt(pe((t||H.document).querySelectorAll(e),(function(e){return Ae(e)})))}rt.extend=function(e){e=e.reduce(((e,t)=>(it.includes(t)||t[0]===`_`||(t in Array.prototype&&(e[`$`+t]=Array.prototype[t]),e[t]=function(...e){return this.each(t,...e)}),e)),{}),G([rt],e)};var ot=0,st={};function ct(e){let t=e.getEventHolder();return t===H.window&&(t=st),t.events||={},t.events}function lt(e){return e.getEventTarget()}function ut(e,t,n,r,i){let a=n.bind(r||e),o=ke(e),s=ct(o),c=lt(o);t=Array.isArray(t)?t:t.split(Ke),n._svgjsListenerId||=++ot,t.forEach((function(e){let t=e.split(`.`)[0],r=e.split(`.`)[1]||`*`;s[t]=s[t]||{},s[t][r]=s[t][r]||{},s[t][r][n._svgjsListenerId]=a,c.addEventListener(t,a,i||!1)}))}function dt(e,t,n,r){let i=ke(e),a=ct(i),o=lt(i);(typeof n!=`function`||(n=n._svgjsListenerId))&&(t=Array.isArray(t)?t:(t||``).split(Ke)).forEach((function(e){let t=e&&e.split(`.`)[0],s=e&&e.split(`.`)[1],c,l;if(n)a[t]&&a[t][s||`*`]&&(o.removeEventListener(t,a[t][s||`*`][n],r||!1),delete a[t][s||`*`][n]);else if(t&&s){if(a[t]&&a[t][s]){for(l in a[t][s])dt(o,[t,s].join(`.`),l);delete a[t][s]}}else if(s)for(e in a)for(c in a[e])s===c&&dt(o,[e,s].join(`.`));else if(t){if(a[t]){for(c in a[t])dt(o,[t,c].join(`.`));delete a[t]}}else{for(e in a)dt(o,e);(function(e){let t=e.getEventHolder();t===H.window&&(t=st),t.events&&={}})(i)}}))}var ft=class extends Te{addEventListener(){}dispatch(e,t,n){return function(e,t,n,r){let i=lt(e);return t instanceof H.window.Event||(t=new H.window.CustomEvent(t,{detail:n,cancelable:!0,...r})),i.dispatchEvent(t),t}(this,e,t,n)}dispatchEvent(e){let t=this.getEventHolder().events;if(!t)return!0;let n=t[e.type];for(let t in n)for(let r in n[t])n[t][r](e);return!e.defaultPrevented}fire(e,t,n){return this.dispatch(e,t,n),this}getEventHolder(){return this}getEventTarget(){return this}off(e,t,n){return dt(this,e,t,n),this}on(e,t,n,r){return ut(this,e,t,n,r),this}removeEventListener(){}};function pt(){}W(ft,`EventTarget`);var mt=400,ht=`>`,gt=0,_t={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":`miter`,"stroke-linecap":`butt`,fill:`#000000`,stroke:`#000000`,opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":`#000000`,"text-anchor":`start`},vt=class extends Array{constructor(...e){super(...e),this.init(...e)}clone(){return new this.constructor(this)}init(e){return typeof e==`number`||(this.length=0,this.push(...this.parse(e))),this}parse(e=[]){return e instanceof Array?e:e.trim().split(Ke).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(` `)}valueOf(){let e=[];return e.push(...this),e}},Y=class e{constructor(...e){this.init(...e)}convert(t){return new e(this.value,t)}divide(t){return t=new e(t),new e(this/t,this.unit||t.unit)}init(t,n){return n=Array.isArray(t)?t[1]:n,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=n||``,typeof t==`number`?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:typeof t==`string`?(n=t.match(Fe))&&(this.value=parseFloat(n[1]),n[5]===`%`?this.value/=100:n[5]===`s`&&(this.value*=1e3),this.unit=n[5]):t instanceof e&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new e(t),new e(this-t,this.unit||t.unit)}plus(t){return t=new e(t),new e(this+t,this.unit||t.unit)}times(t){return t=new e(t),new e(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(this.unit===`%`?~~(1e8*this.value)/1e6:this.unit===`s`?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}},yt=new Set([`fill`,`stroke`,`color`,`bgcolor`,`stop-color`,`flood-color`,`lighting-color`]),bt=[],xt=class e extends ft{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=ke(e)).removeNamespace&&this.node instanceof H.window.SVGElement&&e.removeNamespace(),t==null?this.node.appendChild(e.node):e.node!==this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this}addTo(e,t){return ke(e).put(this,t)}children(){return new rt(pe(this.node.children,(function(e){return Ae(e)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(e=!0,t=!0){this.writeDataToDom();let n=this.node.cloneNode(e);return t&&(n=Pe(n)),new this.constructor(n)}each(e,t){let n=this.children(),r,i;for(r=0,i=n.length;r<i;r++)e.apply(n[r],[r,n]),t&&n[r].each(e,t);return this}element(t,n){return this.put(new e(Oe(t),n))}first(){return Ae(this.node.firstChild)}get(e){return Ae(this.node.childNodes[e])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(e){return this.index(e)>=0}html(e,t){return this.xml(e,t,`http://www.w3.org/1999/xhtml`)}id(e){return e!==void 0||this.node.id||(this.node.id=Ne(this.type)),this.attr(`id`,e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return Ae(this.node.lastChild)}matches(e){let t=this.node,n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return n&&n.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=Ae(t.node.parentNode),!e)return t;do if(typeof e==`string`?t.matches(e):t instanceof e)return t;while(t=Ae(t.node.parentNode));return t}put(e,t){return e=ke(e),this.add(e,t),e}putIn(e,t){return ke(e).add(this,t)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(e){return this.node.removeChild(e.node),this}replace(e){return e=ke(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(e=2,t=null){let n=10**e,r=this.attr(t);for(let e in r)typeof r[e]==`number`&&(r[e]=Math.round(r[e]*n)/n);return this.attr(r),this}svg(e,t){return this.xml(e,t,xe)}toString(){return this.id()}words(e){return this.node.textContent=e,this}wrap(e){let t=this.parent();if(!t)return this.addTo(e);let n=t.index(this);return t.put(e,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(e,t,n){if(typeof e==`boolean`&&(n=t,t=e,e=null),e==null||typeof e==`function`){t=t==null||t,this.writeDataToDom();let n=this;if(e!=null){if(n=Ae(n.node.cloneNode(!0)),t){let t=e(n);if(n=t||n,!1===t)return``}n.each((function(){let t=e(this),n=t||this;!1===t?this.remove():t&&this!==n&&this.replace(n)}),!0)}return t?n.node.outerHTML:n.node.innerHTML}t=t!=null&&t;let r=Oe(`wrapper`,n),i=H.document.createDocumentFragment();r.innerHTML=e;for(let e=r.children.length;e--;)i.appendChild(r.firstElementChild);let a=this.parent();return t?this.replace(i)&&a:this.add(i)}};G(xt,{attr:function(e,t,n){if(e==null){e={},t=this.node.attributes;for(let n of t)e[n.nodeName]=We.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return e}if(e instanceof Array)return e.reduce(((e,t)=>(e[t]=this.attr(t),e)),{});if(typeof e==`object`&&e.constructor===Object)for(t in e)this.attr(t,e[t]);else if(t===null)this.node.removeAttribute(e);else{if(t==null)return(t=this.node.getAttribute(e))==null?_t[e]:We.test(t)?parseFloat(t):t;typeof(t=bt.reduce(((t,n)=>n(e,t,this)),t))==`number`?t=new Y(t):yt.has(e)&&Ze.isColor(t)?t=new Ze(t):t.constructor===Array&&(t=new vt(t)),e===`leading`?this.leading&&this.leading(t):typeof n==`string`?this.node.setAttributeNS(n,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||e!==`font-size`&&e!==`x`||this.rebuild()}return this},find:function(e){return at(e,this.node)},findOne:function(e){return Ae(this.node.querySelector(e))}}),W(xt,`Dom`);var St=class extends xt{constructor(e,t){super(e,t),this.dom={},this.node.instance=this,(e.hasAttribute(`data-svgjs`)||e.hasAttribute(`svgjs:data`))&&this.setData(JSON.parse(e.getAttribute(`data-svgjs`))??JSON.parse(e.getAttribute(`svgjs:data`))??{})}center(e,t){return this.cx(e).cy(t)}cx(e){return e==null?this.x()+this.width()/2:this.x(e-this.width()/2)}cy(e){return e==null?this.y()+this.height()/2:this.y(e-this.height()/2)}defs(){let e=this.root();return e&&e.defs()}dmove(e,t){return this.dx(e).dy(t)}dx(e=0){return this.x(new Y(e).plus(this.x()))}dy(e=0){return this.y(new Y(e).plus(this.y()))}getEventHolder(){return this}height(e){return this.attr(`height`,e)}move(e,t){return this.x(e).y(t)}parents(e=this.root()){let t=typeof e==`string`;t||(e=ke(e));let n=new rt,r=this;for(;(r=r.parent())&&r.node!==H.document&&r.nodeName!==`#document-fragment`&&(n.push(r),t||r.node!==e.node)&&(!t||!r.matches(e));)if(r.node===this.root().node)return null;return n}reference(e){if(!(e=this.attr(e)))return null;let t=(e+``).match(Re);return t?ke(t[1]):null}root(){let e=this.parent(function(e){return Ee[e]}(De));return e&&e.root()}setData(e){return this.dom=e,this}size(e,t){let n=ge(this,e,t);return this.width(new Y(n.width)).height(new Y(n.height))}width(e){return this.attr(`width`,e)}writeDataToDom(){return be(this,this.dom),super.writeDataToDom()}x(e){return this.attr(`x`,e)}y(e){return this.attr(`y`,e)}};G(St,{bbox:function(){return new tt(nt(this,(e=>e.getBBox()),(e=>{try{let t=e.clone().addTo($e().svg).show(),n=t.node.getBBox();return t.remove(),n}catch(t){throw Error(`Getting bbox of element "${e.node.nodeName}" is not possible: ${t.toString()}`)}})))},rbox:function(e){let t=new tt(nt(this,(e=>e.getBoundingClientRect()),(e=>{throw Error(`Getting rbox of element "${e.node.nodeName}" is not possible`)})));return e?t.transform(e.screenCTM().inverseO()):t.addOffset()},inside:function(e,t){let n=this.bbox();return e>n.x&&t>n.y&&e<n.x+n.width&&t<n.y+n.height},point:function(e,t){return new q(e,t).transformO(this.screenCTM().inverseO())},ctm:function(){return new J(this.node.getCTM())},screenCTM:function(){try{if(typeof this.isRoot==`function`&&!this.isRoot()){let e=this.rect(1,1),t=e.node.getScreenCTM();return e.remove(),new J(t)}return new J(this.node.getScreenCTM())}catch{return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new J}}}),W(St,`Element`);var Ct={stroke:[`color`,`width`,`opacity`,`linecap`,`linejoin`,`miterlimit`,`dasharray`,`dashoffset`],fill:[`color`,`opacity`,`rule`],prefix:function(e,t){return t===`color`?e:e+`-`+t}};[`fill`,`stroke`].forEach((function(e){let t={},n;t[e]=function(t){if(t===void 0)return this.attr(e);if(typeof t==`string`||t instanceof Ze||Ze.isRgb(t)||t instanceof St)this.attr(e,t);else for(n=Ct[e].length-1;n>=0;n--)t[Ct[e][n]]!=null&&this.attr(Ct.prefix(e,Ct[e][n]),t[Ct[e][n]]);return this},V([`Element`,`Runner`],t)})),V([`Element`,`Runner`],{matrix:function(e,t,n,r,i,a){return e==null?new J(this):this.attr(`transform`,new J(e,t,n,r,i,a))},rotate:function(e,t,n){return this.transform({rotate:e,ox:t,oy:n},!0)},skew:function(e,t,n,r){return arguments.length===1||arguments.length===3?this.transform({skew:e,ox:t,oy:n},!0):this.transform({skew:[e,t],ox:n,oy:r},!0)},shear:function(e,t,n){return this.transform({shear:e,ox:t,oy:n},!0)},scale:function(e,t,n,r){return arguments.length===1||arguments.length===3?this.transform({scale:e,ox:t,oy:n},!0):this.transform({scale:[e,t],ox:n,oy:r},!0)},translate:function(e,t){return this.transform({translate:[e,t]},!0)},relative:function(e,t){return this.transform({relative:[e,t]},!0)},flip:function(e=`both`,t=`center`){return`xybothtrue`.indexOf(e)===-1&&(t=e,e=`both`),this.transform({flip:e,origin:t},!0)},opacity:function(e){return this.attr(`opacity`,e)}}),V(`radius`,{radius:function(e,t=e){return(this._element||this).type===`radialGradient`?this.attr(`r`,new Y(e)):this.rx(e).ry(t)}}),V(`Path`,{length:function(){return this.node.getTotalLength()},pointAt:function(e){return new q(this.node.getPointAtLength(e))}}),V([`Element`,`Runner`],{font:function(e,t){if(typeof e==`object`){for(t in e)this.font(t,e[t]);return this}return e===`leading`?this.leading(t):e===`anchor`?this.attr(`text-anchor`,t):e===`size`||e===`family`||e===`weight`||e===`stretch`||e===`variant`||e===`style`?this.attr(`font-`+e,t):this.attr(e,t)}}),V(`Element`,[`click`,`dblclick`,`mousedown`,`mouseup`,`mouseover`,`mouseout`,`mousemove`,`mouseenter`,`mouseleave`,`touchstart`,`touchmove`,`touchleave`,`touchend`,`touchcancel`,`contextmenu`,`wheel`,`pointerdown`,`pointermove`,`pointerup`,`pointerleave`,`pointercancel`].reduce((function(e,t){return e[t]=function(e){return e===null?this.off(t):this.on(t,e),this},e}),{})),V(`Element`,{untransform:function(){return this.attr(`transform`,null)},matrixify:function(){return(this.attr(`transform`)||``).split(ze).slice(0,-1).map((function(e){let t=e.trim().split(`(`);return[t[0],t[1].split(Ke).map((function(e){return parseFloat(e)}))]})).reverse().reduce((function(e,t){return t[0]===`matrix`?e.lmultiply(J.fromArray(t[1])):e[t[0]].apply(e,t[1])}),new J)},toParent:function(e,t){if(this===e)return this;if(ye(this.node))return this.addTo(e,t);let n=this.screenCTM(),r=e.screenCTM().inverse();return this.addTo(e,t).untransform().transform(r.multiply(n)),this},toRoot:function(e){return this.toParent(this.root(),e)},transform:function(e,t){if(e==null||typeof e==`string`){let t=new J(this).decompose();return e==null?t:t[e]}J.isMatrixLike(e)||(e={...e,origin:_e(e,this)});let n=new J(!0===t?this:t||!1).transform(e);return this.attr(`transform`,n)}});var wt=class e extends St{flatten(){return this.each((function(){if(this instanceof e)return this.flatten().ungroup()})),this}ungroup(e=this.parent(),t=e.index(this)){return t=t===-1?e.children().length:t,this.each((function(n,r){return r[r.length-n-1].toParent(e,t)})),this.remove()}};W(wt,`Container`);var Tt=class extends wt{constructor(e,t=e){super(U(`defs`,e),t)}flatten(){return this}ungroup(){return this}};W(Tt,`Defs`);var Et=class extends St{};function Dt(e){return this.attr(`rx`,e)}function Ot(e){return this.attr(`ry`,e)}function kt(e){return e==null?this.cx()-this.rx():this.cx(e+this.rx())}function At(e){return e==null?this.cy()-this.ry():this.cy(e+this.ry())}function jt(e){return this.attr(`cx`,e)}function Mt(e){return this.attr(`cy`,e)}function Nt(e){return e==null?2*this.rx():this.rx(new Y(e).divide(2))}function Pt(e){return e==null?2*this.ry():this.ry(new Y(e).divide(2))}W(Et,`Shape`);var Ft=Object.freeze({__proto__:null,cx:jt,cy:Mt,height:Pt,rx:Dt,ry:Ot,width:Nt,x:kt,y:At}),It=class extends Et{constructor(e,t=e){super(U(`ellipse`,e),t)}size(e,t){let n=ge(this,e,t);return this.rx(new Y(n.width).divide(2)).ry(new Y(n.height).divide(2))}};G(It,Ft),V(`Container`,{ellipse:K((function(e=0,t=e){return this.put(new It).size(e,t).move(0,0)}))}),W(It,`Ellipse`);var Lt=class extends xt{constructor(e=H.document.createDocumentFragment()){super(e)}xml(e,t,n){if(typeof e==`boolean`&&(n=t,t=e,e=null),e==null||typeof e==`function`){let e=new xt(Oe(`wrapper`,n));return e.add(this.node.cloneNode(!0)),e.xml(!1,n)}return super.xml(e,!1,n)}};function Rt(e,t){return(this._element||this).type===`radialGradient`?this.attr({fx:new Y(e),fy:new Y(t)}):this.attr({x1:new Y(e),y1:new Y(t)})}function zt(e,t){return(this._element||this).type===`radialGradient`?this.attr({cx:new Y(e),cy:new Y(t)}):this.attr({x2:new Y(e),y2:new Y(t)})}W(Lt,`Fragment`);var Bt=Object.freeze({__proto__:null,from:Rt,to:zt}),Vt=class extends wt{constructor(e,t){super(U(e+`Gradient`,typeof e==`string`?null:e),t)}attr(e,t,n){return e===`transform`&&(e=`gradientTransform`),super.attr(e,t,n)}bbox(){return new tt}targets(){return at(`svg [fill*=`+this.id()+`]`)}toString(){return this.url()}update(e){return this.clear(),typeof e==`function`&&e.call(this,this),this}url(){return`url(#`+this.id()+`)`}};G(Vt,Bt),V({Container:{gradient(...e){return this.defs().gradient(...e)}},Defs:{gradient:K((function(e,t){return this.put(new Vt(e)).update(t)}))}}),W(Vt,`Gradient`);var Ht=class extends wt{constructor(e,t=e){super(U(`pattern`,e),t)}attr(e,t,n){return e===`transform`&&(e=`patternTransform`),super.attr(e,t,n)}bbox(){return new tt}targets(){return at(`svg [fill*=`+this.id()+`]`)}toString(){return this.url()}update(e){return this.clear(),typeof e==`function`&&e.call(this,this),this}url(){return`url(#`+this.id()+`)`}};V({Container:{pattern(...e){return this.defs().pattern(...e)}},Defs:{pattern:K((function(e,t,n){return this.put(new Ht).update(n).attr({x:0,y:0,width:e,height:t,patternUnits:`userSpaceOnUse`})}))}}),W(Ht,`Pattern`);var Ut=class extends Et{constructor(e,t=e){super(U(`image`,e),t)}load(e,t){if(!e)return this;let n=new H.window.Image;return ut(n,`load`,(function(e){let r=this.parent(Ht);this.width()===0&&this.height()===0&&this.size(n.width,n.height),r instanceof Ht&&r.width()===0&&r.height()===0&&r.size(this.width(),this.height()),typeof t==`function`&&t.call(this,e)}),this),ut(n,`load error`,(function(){dt(n)})),this.attr(`href`,n.src=e,Ce)}};bt.push(function(e,t,n){return e!==`fill`&&e!==`stroke`||Ge.test(t)&&(t=n.root().defs().image(t)),t instanceof Ut&&(t=n.root().defs().pattern(0,0,(e=>{e.add(t)}))),t}),V({Container:{image:K((function(e,t){return this.put(new Ut).size(0,0).load(e,t)}))}}),W(Ut,`Image`);var Wt=class extends vt{bbox(){let e=-1/0,t=-1/0,n=1/0,r=1/0;return this.forEach((function(i){e=Math.max(i[0],e),t=Math.max(i[1],t),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new tt(n,r,e-n,t-r)}move(e,t){let n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+e,this[n][1]+t];return this}parse(e=[0,0]){let t=[];(e=e instanceof Array?Array.prototype.concat.apply([],e):e.trim().split(Ke).map(parseFloat)).length%2!=0&&e.pop();for(let n=0,r=e.length;n<r;n+=2)t.push([e[n],e[n+1]]);return t}size(e,t){let n,r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*e/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*t/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){let e=[];for(let t=0,n=this.length;t<n;t++)e.push(this[t].join(`,`));return e.join(` `)}transform(e){return this.clone().transformO(e)}transformO(e){J.isMatrixLike(e)||(e=new J(e));for(let t=this.length;t--;){let[n,r]=this[t];this[t][0]=e.a*n+e.c*r+e.e,this[t][1]=e.b*n+e.d*r+e.f}return this}},Gt=Object.freeze({__proto__:null,MorphArray:Wt,height:function(e){let t=this.bbox();return e==null?t.height:this.size(t.width,e)},width:function(e){let t=this.bbox();return e==null?t.width:this.size(e,t.height)},x:function(e){return e==null?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return e==null?this.bbox().y:this.move(this.bbox().x,e)}}),Kt=class extends Et{constructor(e,t=e){super(U(`line`,e),t)}array(){return new Wt([[this.attr(`x1`),this.attr(`y1`)],[this.attr(`x2`),this.attr(`y2`)]])}move(e,t){return this.attr(this.array().move(e,t).toLine())}plot(e,t,n,r){return e==null?this.array():(e=t===void 0?new Wt(e).toLine():{x1:e,y1:t,x2:n,y2:r},this.attr(e))}size(e,t){let n=ge(this,e,t);return this.attr(this.array().size(n.width,n.height).toLine())}};G(Kt,Gt),V({Container:{line:K((function(...e){return Kt.prototype.plot.apply(this.put(new Kt),e[0]==null?[0,0,0,0]:e)}))}}),W(Kt,`Line`);var qt=class extends wt{constructor(e,t=e){super(U(`marker`,e),t)}height(e){return this.attr(`markerHeight`,e)}orient(e){return this.attr(`orient`,e)}ref(e,t){return this.attr(`refX`,e).attr(`refY`,t)}toString(){return`url(#`+this.id()+`)`}update(e){return this.clear(),typeof e==`function`&&e.call(this,this),this}width(e){return this.attr(`markerWidth`,e)}};function Jt(e,t){return function(n){return n==null?this[e]:(this[e]=n,t&&t.call(this),this)}}V({Container:{marker(...e){return this.defs().marker(...e)}},Defs:{marker:K((function(e,t,n){return this.put(new qt).size(e,t).ref(e/2,t/2).viewbox(0,0,e,t).attr(`orient`,`auto`).update(n)}))},marker:{marker(e,t,n,r){let i=[`marker`];return e!==`all`&&i.push(e),i=i.join(`-`),e=arguments[1]instanceof qt?arguments[1]:this.defs().marker(t,n,r),this.attr(i,e)}}}),W(qt,`Marker`);var Yt={"-":function(e){return e},"<>":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)},bezier:function(e,t,n,r){return function(i){return i<0?e>0?t/e*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):e<1?(1-t)/(1-e)*i+(t-e)/(1-e):1:3*i*(1-i)**2*t+3*i**2*(1-i)*r+i**3}},steps:function(e,t=`end`){t=t.split(`-`).reverse()[0];let n=e;return t===`none`?--n:t===`both`&&++n,(r,i=!1)=>{let a=Math.floor(r*e),o=r*a%1==0;return t!==`start`&&t!==`both`||++a,i&&o&&--a,r>=0&&a<0&&(a=0),r<=1&&a>n&&(a=n),a/n}}},Xt=class{done(){return!1}},Zt=class extends Xt{constructor(e=ht){super(),this.ease=Yt[e]||e}step(e,t,n){return typeof e==`number`?e+(t-e)*this.ease(n):n<1?e:t}},Qt=class extends Xt{constructor(e){super(),this.stepper=e}done(e){return e.done}step(e,t,n,r){return this.stepper(e,t,n,r)}};function $t(){let e=(this._duration||500)/1e3,t=this._overshoot||0,n=Math.PI,r=Math.log(t/100+1e-10),i=-r/Math.sqrt(n*n+r*r),a=3.9/(i*e);this.d=2*i*a,this.k=a*a}G(class extends Qt{constructor(e=500,t=0){super(),this.duration(e).overshoot(t)}step(e,t,n,r){if(typeof e==`string`)return e;if(r.done=n===1/0,n===1/0)return t;if(n===0)return e;n>100&&(n=16),n/=1e3;let i=r.velocity||0,a=-this.d*i-this.k*(e-t),o=e+i*n+a*n*n/2;return r.velocity=i+a*n,r.done=Math.abs(t-o)+Math.abs(i)<.002,r.done?t:o}},{duration:Jt(`_duration`,$t),overshoot:Jt(`_overshoot`,$t)}),G(class extends Qt{constructor(e=.1,t=.01,n=0,r=1e3){super(),this.p(e).i(t).d(n).windup(r)}step(e,t,n,r){if(typeof e==`string`)return e;if(r.done=n===1/0,n===1/0)return t;if(n===0)return e;let i=t-e,a=(r.integral||0)+i*n,o=(i-(r.error||0))/n,s=this._windup;return!1!==s&&(a=Math.max(-s,Math.min(a,s))),r.error=i,r.integral=a,r.done=Math.abs(i)<.001,r.done?t:e+(this.P*i+this.I*a+this.D*o)}},{windup:Jt(`_windup`),p:Jt(`P`),i:Jt(`I`),d:Jt(`D`)});var en={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},tn={M:function(e,t,n){return t.x=n.x=e[0],t.y=n.y=e[1],[`M`,t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],[`L`,e[0],e[1]]},H:function(e,t){return t.x=e[0],[`H`,e[0]]},V:function(e,t){return t.y=e[0],[`V`,e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],[`C`,e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],[`S`,e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],[`Q`,e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],[`T`,e[0],e[1]]},Z:function(e,t,n){return t.x=n.x,t.y=n.y,[`Z`]},A:function(e,t){return t.x=e[5],t.y=e[6],[`A`,e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},nn=`mlhvqtcsaz`.split(``);for(let e=0,t=nn.length;e<t;++e)tn[nn[e]]=function(e){return function(t,n,r){if(e===`H`)t[0]+=n.x;else if(e===`V`)t[0]+=n.y;else if(e===`A`)t[5]+=n.x,t[6]+=n.y;else for(let e=0,r=t.length;e<r;++e)t[e]=t[e]+(e%2?n.y:n.x);return tn[e](t,n,r)}}(nn[e].toUpperCase());function rn(e){return e.segment.length&&e.segment.length-1===en[e.segment[0].toUpperCase()]}function an(e,t){e.inNumber&&on(e,!1);let n=qe.test(t);if(n)e.segment=[t];else{let t=e.lastCommand,n=t.toLowerCase();e.segment=[n===`m`?t===n?`l`:`L`:t]}return e.inSegment=!0,e.lastCommand=e.segment[0],n}function on(e,t){if(!e.inNumber)throw Error(`Parser Error`);e.number&&e.segment.push(parseFloat(e.number)),e.inNumber=t,e.number=``,e.pointSeen=!1,e.hasExponent=!1,rn(e)&&sn(e)}function sn(e){e.inSegment=!1,e.absolute&&(e.segment=function(e){return tn[e.segment[0]](e.segment.slice(1),e.p,e.p0)}(e)),e.segments.push(e.segment)}function cn(e){if(!e.segment.length)return!1;let t=e.segment[0].toUpperCase()===`A`,n=e.segment.length;return t&&(n===4||n===5)}function ln(e){return e.lastToken.toUpperCase()===`E`}var un=new Set([` `,`,`,` `,`
|
|
@@ -907,4 +907,4 @@ rect.legend-mouseover-inactive,
|
|
|
907
907
|
.apexcharts-disable-transitions * {
|
|
908
908
|
transition: none !important;
|
|
909
909
|
}`;var c=e.opts.chart?.nonce||e.w.config.chart.nonce;c&&s.setAttribute(`nonce`,c),a?i.prepend(s):o.head.appendChild(s)}var l=e.create(e.w.config.series,{});if(!l)return t(e);e.mount(l).then((function(){typeof e.w.config.chart.events.mounted==`function`&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent(`mounted`,[e,e.w]),t(l)})).catch((function(e){n(e)}))}else n(Error(`Element not found`))}))}},{key:`create`,value:function(e,t){var n=this,r=this.w;new Ii(this).initModules();var i=this.w.globals;if(i.noData=!1,i.animationEnded=!1,!B.elementExists(this.el)||((this.responsive.checkResponsiveConfig(t),r.config.xaxis.convertedCatToNumeric)&&new mr(r.config).convertCatToNumericXaxis(r.config,this.ctx),this.core.setupElements(),r.config.chart.type===`treemap`&&(r.config.grid.show=!1,r.config.yaxis[0].show=!1),i.svgWidth===0))return i.animationEnded=!0,null;var a=e;e.forEach((function(e,t){e.hidden&&(a=n.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:t}))}));var o=tr.checkComboSeries(a,r.config.chart.type);i.comboCharts=o.comboCharts,i.comboBarCount=o.comboBarCount;var s=a.every((function(e){return e.data&&e.data.length===0}));(a.length===0||s&&i.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(a),this.theme.init(),new yr(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),i.noData&&i.collapsedSeries.length!==i.series.length&&!r.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),i.axisCharts&&(this.core.coreCalculations(),r.config.xaxis.type!==`category`&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=r.globals.minX,this.ctx.toolbar.maxX=r.globals.maxX),this.formatters.heatmapLabelFormatters(),new tr(this).getLargestMarkerSize(),this.dimensions.plotCoords();var c=this.core.xySettings();this.grid.createGridMask();var l=this.core.plotChartType(a,c),u=new xr(this);return u.bringForward(),r.config.dataLabels.background.enabled&&u.dataLabelsBackground(),this.core.shiftGraphPosition(),r.globals.dataPoints>50&&r.globals.dom.elWrap.classList.add(`apexcharts-disable-transitions`),{elGraph:l,xyRatios:c,dimensions:{plot:{left:r.globals.translateX,top:r.globals.translateY,width:r.globals.gridWidth,height:r.globals.gridHeight}}}}},{key:`mount`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=this,r=n.w;return new Promise((function(i,a){if(n.el===null)return a(Error(`Not enough data to display or target element not found`));(t===null||r.globals.allSeriesCollapsed)&&n.series.handleNoData(),n.grid=new Er(n);var o,s,c=n.grid.drawGrid();if((n.annotations=new dr(n),n.annotations.drawImageAnnos(),n.annotations.drawTextAnnos(),r.config.grid.position===`back`)&&(c&&r.globals.dom.elGraphical.add(c.el),c!=null&&(o=c.elGridBorders)!=null&&o.node&&r.globals.dom.elGraphical.add(c.elGridBorders)),Array.isArray(t.elGraph))for(var l=0;l<t.elGraph.length;l++)r.globals.dom.elGraphical.add(t.elGraph[l]);else r.globals.dom.elGraphical.add(t.elGraph);r.config.grid.position===`front`&&(c&&r.globals.dom.elGraphical.add(c.el),c!=null&&(s=c.elGridBorders)!=null&&s.node&&r.globals.dom.elGraphical.add(c.elGridBorders)),r.config.xaxis.crosshairs.position===`front`&&n.crosshairs.drawXCrosshairs(),r.config.yaxis[0].crosshairs.position===`front`&&n.crosshairs.drawYCrosshairs(),r.config.chart.type!==`treemap`&&n.axes.drawAxis(r.config.chart.type,c);var u=new Tr(e.ctx,c),d=new kr(e.ctx,c);if(c!==null&&(u.xAxisLabelCorrections(c.xAxisTickWidth),d.setYAxisTextAlignments(),r.config.yaxis.map((function(e,t){r.globals.ignoreYAxisIndexes.indexOf(t)===-1&&d.yAxisTitleRotate(t,e.opposite)}))),n.annotations.drawAxesAnnotations(),!r.globals.noData){if(r.config.tooltip.enabled&&!r.globals.noData&&n.w.globals.tooltip.drawTooltip(t.xyRatios),r.globals.axisCharts&&(r.globals.isXNumeric||r.config.xaxis.convertedCatToNumeric||r.globals.isRangeBar))(r.config.chart.zoom.enabled||r.config.chart.selection&&r.config.chart.selection.enabled||r.config.chart.pan&&r.config.chart.pan.enabled)&&n.zoomPanSelection.init({xyRatios:t.xyRatios});else{var f=r.config.chart.toolbar.tools;[`zoom`,`zoomin`,`zoomout`,`selection`,`pan`,`reset`].forEach((function(e){f[e]=!1}))}r.config.chart.toolbar.show&&!r.globals.allSeriesCollapsed&&n.toolbar.createToolbar()}r.globals.memory.methodsToExec.length>0&&r.globals.memory.methodsToExec.forEach((function(e){e.method(e.params,!1,e.context)})),r.globals.axisCharts||r.globals.noData||n.core.resizeNonAxisCharts(),i(n)}))}},{key:`destroy`,value:function(){window.removeEventListener(`resize`,this.windowResizeHandler),function(e,t){var n=Ri.get(t);n&&(n.disconnect(),Ri.delete(t))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach((function(t,n){t.id===B.escapeString(e)&&Apex._chartInstances.splice(n,1)})),new Li(this.ctx).clear({isUpdating:!1})}},{key:`updateOptions`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],a=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=this.w;return o.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(this.lastUpdateOptions=B.clone(e),e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((function(e,n){return t.updateHelpers._extendSeries(e,n)}))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,n,r,i,a))}},{key:`updateSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,n)}},{key:`appendSeries`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=this.w.config.series.slice();return r.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(r,t,n)}},{key:`appendData`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this;n.w.globals.dataChanged=!0,n.series.getPreviousPaths();for(var r=n.w.config.series.slice(),i=0;i<r.length;i++)if(e[i]!==null&&e[i]!==void 0)for(var a=0;a<e[i].data.length;a++)r[i].data.push(e[i].data[a]);return n.w.config.series=r,t&&(n.w.globals.initialSeries=B.clone(n.w.config.series)),this.update()}},{key:`update`,value:function(e){var t=this;return new Promise((function(n,r){if(t.lastUpdateOptions&&JSON.stringify(t.lastUpdateOptions)===JSON.stringify(e))return n(t);t.lastUpdateOptions=B.clone(e),new Li(t.ctx).clear({isUpdating:!0});var i=t.create(t.w.config.series,e);if(!i)return n(t);t.mount(i).then((function(){typeof t.w.config.chart.events.updated==`function`&&t.w.config.chart.events.updated(t,t.w),t.events.fireEvent(`updated`,[t,t.w]),t.w.globals.isDirty=!0,n(t)})).catch((function(e){r(e)}))}))}},{key:`getSyncedCharts`,value:function(){var e=this.getGroupedCharts(),t=[this];return e.length&&(t=[],e.forEach((function(e){t.push(e)}))),t}},{key:`getGroupedCharts`,value:function(){var e=this;return Apex._chartInstances.filter((function(e){if(e.group)return!0})).map((function(t){return e.w.config.chart.group===t.group?t.chart:e}))}},{key:`toggleSeries`,value:function(e){return this.series.toggleSeries(e)}},{key:`highlightSeriesOnLegendHover`,value:function(e,t){return this.series.toggleSeriesOnHover(e,t)}},{key:`showSeries`,value:function(e){this.series.showSeries(e)}},{key:`hideSeries`,value:function(e){this.series.hideSeries(e)}},{key:`highlightSeries`,value:function(e){this.series.highlightSeries(e)}},{key:`isSeriesHidden`,value:function(e){this.series.isSeriesHidden(e)}},{key:`resetSeries`,value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,t)}},{key:`addEventListener`,value:function(e,t){this.events.addEventListener(e,t)}},{key:`removeEventListener`,value:function(e,t){this.events.removeEventListener(e,t)}},{key:`addXaxisAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addXaxisAnnotationExternal(e,t,r)}},{key:`addYaxisAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addYaxisAnnotationExternal(e,t,r)}},{key:`addPointAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addPointAnnotationExternal(e,t,r)}},{key:`clearAnnotations`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:`removeAnnotation`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=this;t&&(n=t),n.annotations.removeAnnotation(n,e)}},{key:`getChartArea`,value:function(){return this.w.globals.dom.baseEl.querySelector(`.apexcharts-inner`)}},{key:`getSeriesTotalXRange`,value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:`getHighestValueInSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Or(this.ctx).getMinYMaxY(e).highestY}},{key:`getLowestValueInSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Or(this.ctx).getMinYMaxY(e).lowestY}},{key:`getSeriesTotal`,value:function(){return this.w.globals.seriesTotals}},{key:`toggleDataPointSelection`,value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:`zoomX`,value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:`setLocale`,value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:`dataURI`,value:function(e){return new wr(this.ctx).dataURI(e)}},{key:`getSvgString`,value:function(e){return new wr(this.ctx).getSvgString(e)}},{key:`exportToCSV`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new wr(this.ctx).exportToCSV(e)}},{key:`paper`,value:function(){return this.w.globals.dom.Paper}},{key:`_parentResizeCallback`,value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:`_windowResize`,value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()}),150)}},{key:`_windowResizeHandler`,value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e==`function`&&(e=e()),e&&this._windowResize()}}],[{key:`getChartByID`,value:function(e){var t=B.escapeString(e);if(Apex._chartInstances){var n=Apex._chartInstances.filter((function(e){return e.id===t}))[0];return n&&n.chart}}},{key:`initOnLoad`,value:function(){for(var t=document.querySelectorAll(`[data-apexcharts]`),n=0;n<t.length;n++)new e(t[n],JSON.parse(t[n].getAttribute(`data-options`))).render()}},{key:`exec`,value:function(e,t){var n=this.getChartByID(e);if(n){n.w.globals.isExecCalled=!0;var r=null;if(n.publicMethods.indexOf(t)!==-1){var i=[...arguments].slice(2);r=n[t].apply(n,i)}return r}}},{key:`merge`,value:function(e,t){return B.extend(e,t)}}]),e}(),$=r();function Bi({height:e,children:t}){return(0,$.jsx)(`div`,{className:`flex items-center justify-center text-muted-foreground text-sm`,style:{height:e},children:t})}function Vi(e,t,n,r){let i=(0,D.useRef)(null),a=(0,D.useRef)(null);(0,D.useEffect)(()=>{let n=document.getElementById(e);if((!r||!n||a.current!==n)&&(i.current?.destroy(),i.current=null,a.current=null,!r||!n))return;let o=t();if(i.current)i.current.updateOptions(o,!1,!1);else{o.chart={...o.chart,animations:{enabled:!0,dynamicAnimation:{enabled:!0,speed:300}}};let e=new zi(n,o);e.render(),i.current=e,a.current=n}},n),(0,D.useEffect)(()=>()=>{i.current?.destroy(),i.current=null},[])}var Hi={iterate:`Iterate`,delivery:`Delivery`,land:`Land gate`,mainCi:`Main CI`},Ui=[{name:`gate slot queue avg`,part:`heavySlot`,color:`#f59e0b`}],Wi={iterate:Ui,delivery:Ui,land:[{name:`land lane avg`,part:`lane`,color:`#38bdf8`},{name:`heavy-gate slot avg`,part:`heavySlot`,color:`#f59e0b`}],mainCi:[{name:`CI runner queue avg`,part:`runner`,color:`#38bdf8`}]},Gi={pass:`#10b981`,fail:`#ef4444`,infra:`#f59e0b`,timeout:`#8b5cf6`},Ki={pass:`text-tone-success-fg`,fail:`text-tone-danger-fg`,infra:`text-tone-warning-fg`,timeout:`text-tone-violet-fg`};function qi(e){return e===`7d`?`7d`:e===`14d`||e===`30d`?`30d`:`24h`}var Ji=e=>typeof e==`number`?T(e):`—`,Yi=e=>e===null?null:Math.round(e/6e3)/10;function Xi({label:e,summary:t}){return(0,$.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 text-sm tabular-nums`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e}),[`avg`,`p50`,`p90`,`min`,`max`].map(e=>(0,$.jsx)(`span`,{className:`text-right`,children:Ji(t[e])},e))]})}function Zi({stats:e,isDark:n}){let r=t=>e.buckets.map(e=>({x:e.start,y:t(e)})),i=e.outcomes.pass+e.outcomes.fail+e.outcomes.infra+e.outcomes.timeout,a=n?`rgba(255,255,255,0.45)`:`rgba(0,0,0,0.45)`,o=()=>({theme:{mode:n?`dark`:`light`},grid:{borderColor:n?`rgba(255,255,255,0.06)`:`rgba(0,0,0,0.08)`,strokeDashArray:3},xaxis:{type:`datetime`,labels:{datetimeUTC:!1,style:{colors:a,fontSize:`10px`}}},legend:{labels:{colors:n?`rgba(255,255,255,0.65)`:`rgba(0,0,0,0.65)`},fontSize:`11px`},dataLabels:{enabled:!1},tooltip:{theme:n?`dark`:`light`}}),s={labels:{style:{colors:a},formatter:e=>`${e}m`},min:0},c=e.wait.count>0,l=e.duration.count>0;return Vi(`gates-${e.kind}-outcomes`,()=>({...o(),chart:{type:`bar`,stacked:!0,height:180,background:`transparent`,toolbar:{show:!1},fontFamily:`inherit`},colors:Object.values(Gi),series:Object.keys(Gi).map(e=>({name:e,data:r(t=>t.outcomes[e])})),yaxis:{labels:{style:{colors:a}},forceNiceScale:!0}}),[e,n],i>0),Vi(`gates-${e.kind}-wait`,()=>({...o(),chart:{type:`line`,height:180,background:`transparent`,toolbar:{show:!1},fontFamily:`inherit`},stroke:{width:2,curve:`smooth`},colors:[...(Wi[e.kind]??[]).map(e=>e.color),`#a1a1aa`],series:[...(Wi[e.kind]??[]).map(({name:e,part:t})=>({name:e,data:r(e=>Yi(e.waitParts[t]??null))})),{name:`total p90`,data:r(e=>Yi(e.wait.p90))}],yaxis:s}),[e,n],c),Vi(`gates-${e.kind}-duration`,()=>({...o(),chart:{type:`line`,height:180,background:`transparent`,toolbar:{show:!1},fontFamily:`inherit`},stroke:{width:2,curve:`smooth`},colors:[`#818cf8`,`#22c55e`,`#f43f5e`,`#a1a1aa`],series:[{name:`avg`,data:r(e=>Yi(e.duration.avg))},{name:`p50`,data:r(e=>Yi(e.duration.p50))},{name:`p90`,data:r(e=>Yi(e.duration.p90))},{name:`max`,data:r(e=>Yi(e.duration.max))}],yaxis:s}),[e,n],l),(0,$.jsxs)(w,{"data-testid":`gates-kind-${e.kind}`,children:[(0,$.jsx)(x,{className:`pb-2`,children:(0,$.jsxs)(C,{className:`text-sm font-medium flex flex-wrap items-baseline gap-x-3`,children:[Hi[e.kind],(0,$.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground tabular-nums`,children:[i,` runs · `,Object.keys(Ki).map(n=>(0,$.jsxs)(`span`,{className:t(`ml-2`,Ki[n]),children:[e.outcomes[n],` `,n]},n))]}),e.historySince!==null&&(0,$.jsxs)(`span`,{className:`text-xs font-normal text-tone-warning-fg`,"data-testid":`gates-${e.kind}-history-since`,title:`Older runs were not recorded, or are still being loaded from GitHub`,children:[`history since `,new Date(e.historySince).toLocaleDateString([],{month:`short`,day:`numeric`})]})]})}),(0,$.jsxs)(S,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(`span`,{}),(0,$.jsx)(`span`,{className:`text-right`,children:`avg`}),(0,$.jsx)(`span`,{className:`text-right`,children:`p50`}),(0,$.jsx)(`span`,{className:`text-right`,children:`p90`}),(0,$.jsx)(`span`,{className:`text-right`,children:`min`}),(0,$.jsx)(`span`,{className:`text-right`,children:`max`})]}),(0,$.jsx)(Xi,{label:`Wait`,summary:e.wait}),(0,$.jsx)(Xi,{label:`Duration`,summary:e.duration})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:`Outcomes`}),i>0?(0,$.jsx)(`div`,{id:`gates-${e.kind}-outcomes`}):(0,$.jsx)(Bi,{height:180,children:`No runs`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:`Wait (minutes)`}),c?(0,$.jsx)(`div`,{id:`gates-${e.kind}-wait`}):(0,$.jsx)(Bi,{height:180,children:`Not recorded`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:`Run duration (minutes)`}),l?(0,$.jsx)(`div`,{id:`gates-${e.kind}-duration`}):(0,$.jsx)(Bi,{height:180,children:`Not recorded`})]})]})]})]})}function Qi({stats:e}){return e.runs.length===0?(0,$.jsx)(Bi,{height:80,children:`No gate runs in this period`}):(0,$.jsx)(`div`,{className:`overflow-x-auto`,children:(0,$.jsxs)(`table`,{className:`w-full text-sm`,"data-testid":`gates-runs`,children:[(0,$.jsx)(`thead`,{className:`text-[11px] text-muted-foreground text-left`,children:(0,$.jsx)(`tr`,{children:[`Time`,`Gate`,`Task / branch / sha`,`Host`,`Wait`,`Duration`,`Outcome`,`Failing step`,`Log`].map(e=>(0,$.jsx)(`th`,{className:`px-2 py-1 font-normal`,children:e},e))})}),(0,$.jsx)(`tbody`,{children:e.runs.map(e=>(0,$.jsxs)(`tr`,{className:`border-t border-border/50`,children:[(0,$.jsx)(`td`,{className:`px-2 py-1 whitespace-nowrap tabular-nums`,children:new Date(e.at).toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}),(0,$.jsx)(`td`,{className:`px-2 py-1 whitespace-nowrap`,children:Hi[e.kind]}),(0,$.jsxs)(`td`,{className:`px-2 py-1 max-w-[18rem] truncate`,title:[e.branch,e.sha].filter(Boolean).join(` @ `),children:[e.taskId!==null&&(0,$.jsxs)(`span`,{className:`mr-1`,children:[`T`,e.taskId]}),(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.branch??``,e.sha?` ${e.sha.slice(0,9)}`:``]})]}),(0,$.jsx)(`td`,{className:`px-2 py-1 whitespace-nowrap text-muted-foreground`,children:e.host??`—`}),(0,$.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:Ji(e.waitMs)}),(0,$.jsxs)(`td`,{className:`px-2 py-1 text-right tabular-nums`,children:[Ji(e.durationMs),e.gateTimings?.length?(0,$.jsxs)(`details`,{className:`text-left min-w-[12rem]`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Per gate`}),e.gateTimings.map((e,t)=>(0,$.jsxs)(`div`,{title:`Start: ${e.startedAt===void 0?`unknown`:new Date(e.startedAt).toISOString()} · End: ${e.endedAt===void 0?`unknown`:new Date(e.endedAt).toISOString()}`,children:[e.name,`: `,Ji(e.durationMs),` · exit `,e.exitCode??`unknown`,e.attempt?` · attempt ${e.attempt}`:``]},t))]}):null]}),(0,$.jsx)(`td`,{className:t(`px-2 py-1`,Ki[e.outcome]),children:e.outcome}),(0,$.jsx)(`td`,{className:`px-2 py-1 max-w-[14rem] truncate`,title:e.failingStep??``,children:e.failingStep??``}),(0,$.jsx)(`td`,{className:`px-2 py-1`,children:e.logArtifactId?(0,$.jsx)(`button`,{type:`button`,className:`underline text-muted-foreground hover:text-foreground`,onClick:()=>c(e.logArtifactId),children:`log`}):e.logUrl?(0,$.jsx)(`a`,{className:`underline text-muted-foreground hover:text-foreground`,href:e.logUrl,target:`_blank`,rel:`noreferrer`,children:`log`}):(0,$.jsx)(`span`,{className:`text-muted-foreground`,title:`No log was captured for this run`,children:`—`})})]},`${e.kind}:${e.id}`))})]})})}function $i({period:e,isDark:t}){let n=i(e=>e.connected),r=qi(e),[o,s]=(0,D.useState)([]),[c,u]=(0,D.useState)(``),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(null);return(0,D.useEffect)(()=>{n&&l(`GET`,`/projects`).then(e=>s(e.projects??[])).catch(()=>{})},[n]),(0,D.useEffect)(()=>{if(!n)return;let e=!0;return l(`GET`,`/gates/stats?${new URLSearchParams({period:r,...c?{projectId:c}:{}})}`).then(t=>{e&&(f(t),m(null))}).catch(t=>{e&&m(a(t))}),()=>{e=!1}},[r,c,n]),(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`gates-panel`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,$.jsxs)(`select`,{"aria-label":`Gate project`,className:`h-8 rounded-md border border-border bg-background px-2 text-sm`,value:c,onChange:e=>u(e.target.value),children:[(0,$.jsx)(`option`,{value:``,children:`All projects`}),o.map(e=>(0,$.jsx)(`option`,{value:e.id,children:e.title??e.slug},e.id))]}),(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Window `,r,`. Iterate and delivery count gate runs started through relay_run.`]})]}),p&&(0,$.jsx)(`div`,{role:`alert`,className:`rounded-md border border-tone-danger/40 bg-tone-danger/10 px-3 py-2 text-sm`,children:p}),d&&E.map(e=>{let n=d.kinds.find(t=>t.kind===e);return n?(0,$.jsx)(Zi,{stats:n,isDark:t},e):null}),d&&(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{className:`pb-2`,children:(0,$.jsxs)(C,{className:`text-sm font-medium`,children:[`Last `,d.runs.length,` runs`]})}),(0,$.jsx)(S,{children:(0,$.jsx)(Qi,{stats:d})})]})]})}function ea({inputTokens:e,cacheReadTokens:t}){let n=e+t;return n<=0?null:t/n}function ta(e){return e===null?`—`:`${Math.round(e*100)}%`}var na=30,ra=[{id:`1h`,label:`1h`,ms:36e5},{id:`6h`,label:`6h`,ms:216e5},{id:`24h`,label:`24h`,ms:864e5},{id:`7d`,label:`7d`,ms:6048e5},{id:`14d`,label:`14d`,ms:12096e5},{id:`30d`,label:`30d`,ms:2592e6}];function ia(e){return ra.find(t=>t.id===e)?.ms??864e5}var aa=[`Chat`,`Replies`,`Channel`,`Pair`,`Work items`],oa={Chat:`#3b82f6`,Replies:`#06b6d4`,Channel:`#8b5cf6`,Pair:`#f59e0b`,"Work items":`#10b981`},sa=[`tool`,`reasoning`,`narration`,`response`],ca={tool:`Tool calls`,reasoning:`Reasoning`,narration:`Narration`,response:`Responses`},la={tool:`#3b82f6`,reasoning:`#a855f7`,narration:`#f59e0b`,response:`#10b981`},ua={claude:`#f97316`,"claude-b":`#fb923c`,codex:`#22c55e`},da=[`#3b82f6`,`#a855f7`,`#06b6d4`,`#ec4899`];function fa(e,t){return ua[e]??da[t%da.length]}function pa(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function ma(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return r?`${n}m ${r}s`:`${n}m`}function ha(e,t){let n=ia(t)<=864e5;return e.map(e=>{let t=new Date(e.start);return n?t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})})}function ga({label:e,value:t,sub:n,icon:r,className:i}){return(0,$.jsx)(w,{children:(0,$.jsx)(S,{className:`pt-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-lg ${i}`,children:(0,$.jsx)(r,{className:`w-4 h-4`})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-2xl font-semibold tabular-nums leading-tight`,children:t}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:e}),n&&(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70 truncate`,children:n})]})]})})})}function _a({label:e,value:t,accent:n}){return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/60 bg-muted/30 p-3`,children:[(0,$.jsx)(`p`,{className:`text-xl font-semibold tabular-nums ${n??``}`,children:t}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground mt-0.5`,children:e})]})}function va(){let e=i(e=>e.analyticsPeriod),t=i(e=>e.setAnalyticsPeriod);return(0,$.jsx)(`div`,{className:`flex items-center gap-1 bg-muted rounded-lg p-1`,children:ra.map(n=>(0,$.jsx)(`button`,{onClick:()=>t(n.id),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors ${e===n.id?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`}`,children:n.label},n.id))})}function ya(){let e=i(e=>e.analyticsPeriod),t=i(e=>e.analyticsTab),n=i(e=>e.setAnalyticsTab),r=i(e=>e.theme),a=u.find(e=>e.id===r)?.dark??!0;return(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4 flex-wrap`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Analytics`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Fleet activity over the selected window — not point-in-time status`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,$.jsx)(p,{value:t,onValueChange:e=>n(e),children:(0,$.jsxs)(f,{children:[(0,$.jsx)(d,{value:`overview`,children:`Overview`}),(0,$.jsx)(d,{value:`gates`,children:`Gates`})]})}),(0,$.jsx)(va,{})]})]}),t===`gates`?(0,$.jsx)($i,{period:e,isDark:a}):(0,$.jsx)(ba,{period:e,isDark:a})]})}function ba({period:e,isDark:t}){let n=i(e=>e.analyticsData),r=t?{text:`rgba(255,255,255,0.45)`,grid:`rgba(255,255,255,0.06)`,legend:`rgba(255,255,255,0.65)`}:{text:`rgba(0,0,0,0.45)`,grid:`rgba(0,0,0,0.08)`,legend:`rgba(0,0,0,0.65)`},a={chart:{background:`transparent`,toolbar:{show:!1},fontFamily:`inherit`},theme:{mode:t?`dark`:`light`},grid:{borderColor:r.grid,strokeDashArray:3},tooltip:{theme:t?`dark`:`light`},dataLabels:{enabled:!1}},[c,u]=(0,D.useState)({}),d=i(e=>e.connected),f=i(e=>e.agentsById);(0,D.useEffect)(()=>{if(!d)return;let t=!1,n=Date.now()-ia(e),r=s();return Promise.all(r.map(e=>l(`GET`,`/provider-quotas/history?provider=${e}&sinceMs=${n}&limit=5000`).then(t=>({provider:e,snapshots:t})).catch(()=>({provider:e,snapshots:[]})))).then(e=>{if(t)return;let n={};for(let t of e)n[t.provider]=t.snapshots;u(n)}),()=>{t=!0}},[e,d]);let[p,T]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(!d)return;let e=!1;return l(`GET`,`/metrics/lead-time?windowDays=${na}`).then(t=>{e||T(t)}).catch(()=>{e||T(null)}),()=>{e=!0}},[d]);let[E,O]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(!d)return;let t=!1;return l(`GET`,`/stats/token-usage?period=${e}`).then(e=>{t||O(e)}).catch(()=>{t||O(null)}),()=>{t=!0}},[e,d]);let k=(0,D.useMemo)(()=>{let e=[],t=Object.keys(c).sort();for(let n=0;n<t.length;n++){let r=t[n],i=c[r],a=[];for(let e of i){if(!e.quota)continue;let t=e.quota.windows.find(e=>e.name===`five_hour`||e.name===`primary`);t&&a.push([e.capturedAt,Math.round(t.utilization*100)])}a.length>0&&e.push({name:`${o(r)} 5h`,data:a,color:fa(r,n)})}return e},[c]),A=(0,D.useMemo)(()=>ha(n?.work.buckets??[],e),[n,e]),M=(0,D.useMemo)(()=>sa.flatMap(e=>{let t=(n?.work.buckets??[]).map(t=>t.counts[e]??0);return t.some(e=>e>0)?[{name:ca[e],data:t,color:la[e]}]:[]}),[n]),N=(0,D.useMemo)(()=>aa.flatMap(e=>{let t=(n?.conversation.buckets??[]).map(t=>t.counts[e]??0);return t.some(e=>e>0)?[{name:e,data:t,color:oa[e]}]:[]}),[n]),P=(0,D.useMemo)(()=>{let e=n?.work.totals,t=e?sa.filter(t=>(e[t]??0)>0):[];return{labels:t.map(e=>ca[e]),values:t.map(t=>e[t]),colors:t.map(e=>la[e])}},[n]),F=(0,D.useMemo)(()=>[{name:`Prompts`,data:(n?.user.buckets??[]).map(e=>e.prompts),color:`#06b6d4`}],[n]),I=(0,D.useMemo)(()=>[{name:`Spawns`,data:(n?.fleet.buckets??[]).map(e=>e.registrations),color:`#8b5cf6`}],[n]),L=(0,D.useMemo)(()=>{let e=n?.heatmap??Array.from({length:7},()=>Array(24).fill(0));return[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`].map((t,n)=>({name:t,data:(e[n]??Array(24).fill(0)).map((e,t)=>({x:String(t).padStart(2,`0`),y:e}))}))},[n]),R={categories:A,labels:{style:{colors:r.text,fontSize:`11px`},rotate:-30,hideOverlappingLabels:!0},axisBorder:{show:!1},axisTicks:{show:!1}},ee={labels:{style:{colors:r.text,fontSize:`11px`}}};Vi(`an-work`,()=>({...a,chart:{...a.chart,type:`area`,height:260,stacked:!0},series:M,colors:M.map(e=>e.color),xaxis:R,yaxis:ee,fill:{type:`gradient`,gradient:{shadeIntensity:.8,opacityFrom:.65,opacityTo:.15,stops:[0,100]}},stroke:{curve:`smooth`,width:2},legend:{position:`top`,horizontalAlign:`left`,labels:{colors:r.legend},fontSize:`11px`}}),[M,A,t],M.length>0),Vi(`an-conversation`,()=>({...a,chart:{...a.chart,type:`area`,height:220,stacked:!0},series:N,colors:N.map(e=>e.color),xaxis:R,yaxis:ee,fill:{type:`gradient`,gradient:{shadeIntensity:.8,opacityFrom:.6,opacityTo:.12,stops:[0,100]}},stroke:{curve:`smooth`,width:2},legend:{position:`top`,horizontalAlign:`left`,labels:{colors:r.legend},fontSize:`11px`}}),[N,A,t],N.length>0),Vi(`an-toptools`,()=>({...a,chart:{...a.chart,type:`bar`,height:260},series:[{name:`Calls`,data:(n?.work.topTools??[]).map(e=>e.count)}],colors:[`#3b82f6`],plotOptions:{bar:{horizontal:!0,borderRadius:3,barHeight:`70%`,distributed:!1}},xaxis:{categories:(n?.work.topTools??[]).map(e=>e.name),labels:{style:{colors:r.text,fontSize:`11px`}},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{labels:{style:{colors:r.text,fontSize:`11px`},maxWidth:220}},dataLabels:{enabled:!0,style:{fontSize:`10px`,colors:[t?`white`:`black`]},offsetX:24,formatter:e=>pa(e)},tooltip:{...a.tooltip,y:{formatter:e=>`${e} calls`}}}),[n?.work.topTools,t],(n?.work.topTools.length??0)>0),Vi(`an-composition`,()=>({...a,chart:{...a.chart,type:`donut`,height:260},series:P.values,labels:P.labels,colors:P.colors,legend:{position:`bottom`,labels:{colors:r.legend},fontSize:`11px`},plotOptions:{pie:{donut:{size:`62%`}}},stroke:{width:0}}),[P,t],P.values.length>0),Vi(`an-prompts`,()=>({...a,chart:{...a.chart,type:`area`,height:120,sparkline:{enabled:!0}},series:F,colors:[`#06b6d4`],fill:{type:`gradient`,gradient:{opacityFrom:.45,opacityTo:.05}},stroke:{curve:`smooth`,width:2},tooltip:{...a.tooltip,x:{show:!1}}}),[F,t],(n?.user.prompts??0)>0),Vi(`an-spawns`,()=>({...a,chart:{...a.chart,type:`bar`,height:200},series:I,colors:[`#8b5cf6`],plotOptions:{bar:{borderRadius:3,columnWidth:`60%`}},xaxis:R,yaxis:{...ee,labels:{...ee.labels,formatter:e=>String(Math.round(e))}}}),[I,A,t],(n?.fleet.registrations??0)>0),Vi(`an-heatmap`,()=>({...a,chart:{...a.chart,type:`heatmap`,height:240},series:L,colors:[`#3b82f6`],xaxis:{labels:{style:{colors:r.text,fontSize:`10px`}},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:ee,plotOptions:{heatmap:{radius:3,enableShades:!0,shadeIntensity:.6,colorScale:{ranges:[{from:0,to:0,color:t?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.04)`,name:`idle`}]}}}}),[L,t],(n?.conversation.total??0)+(n?.work.toolCalls??0)>0),Vi(`an-quota`,()=>({...a,chart:{...a.chart,type:`line`,height:240},series:k.map(e=>({name:e.name,data:e.data})),colors:k.map(e=>e.color),xaxis:{type:`datetime`,labels:{style:{colors:r.text,fontSize:`11px`},datetimeUTC:!1},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{min:0,max:100,labels:{style:{colors:r.text,fontSize:`11px`},formatter:e=>`${Math.round(e)}%`}},stroke:{curve:`stepline`,width:2},legend:{position:`top`,horizontalAlign:`left`,labels:{colors:r.legend},fontSize:`11px`},tooltip:{...a.tooltip,x:{format:`MMM dd, HH:mm`},y:{formatter:e=>`${e}%`}},annotations:{yaxis:[{y:93,borderColor:r.grid,strokeDashArray:4,label:{text:`target (93%)`,style:{color:r.text,fontSize:`9px`,background:`transparent`},position:`left`}}]}}),[k,t],k.length>0);let te=n?.user,z=n?.fleet,ne=z?.leaderboard??[],re=Math.max(1,...ne.map(e=>e.toolCalls+e.messages));return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,$.jsx)(ga,{label:`Active agents`,sub:`sent activity this period`,value:z?.activeAgents??0,icon:m,className:`bg-tone-success/10 text-tone-success-fg`}),(0,$.jsx)(ga,{label:`Provider turns`,value:pa(n?.work.turns??0),icon:_,className:`bg-tone-info/10 text-tone-info-fg`}),(0,$.jsx)(ga,{label:`Tool calls`,value:pa(n?.work.toolCalls??0),icon:y,className:`bg-tone-violet/10 text-tone-violet-fg`}),(0,$.jsx)(ga,{label:`Human prompts`,sub:te&&te.prompts>0?`${Math.round(te.replyRate*100)}% replied`:void 0,value:pa(te?.prompts??0),icon:v,className:`bg-tone-cyan/10 text-tone-cyan-fg`}),(0,$.jsx)(ga,{label:`Median idea→proven (${na}d)`,sub:p&&p.ideaToProven.count>0?`${p.ideaToProven.count} sample(s)`:`awaiting proven events`,value:p?.ideaToProven.p50==null?`–`:ma(p.ideaToProven.p50),icon:h,className:`bg-tone-warning/10 text-tone-warning-fg`})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Agent work over time`})}),(0,$.jsx)(S,{children:M.length===0?(0,$.jsx)(Bi,{height:260,children:`No agent activity in this period`}):(0,$.jsx)(`div`,{id:`an-work`})})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Quota utilization`})}),(0,$.jsx)(S,{children:k.length===0?(0,$.jsx)(Bi,{height:240,children:`No quota history in this period`}):(0,$.jsx)(`div`,{id:`an-quota`})})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsxs)(C,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`w-3.5 h-3.5 text-tone-warning-fg`}),` Token usage`]})}),(0,$.jsx)(S,{children:!E||E.total.reports===0?(0,$.jsx)(Bi,{height:140,children:`No token usage reported in this period`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 xl:grid-cols-8 gap-3 mb-4`,children:[(0,$.jsx)(_a,{label:`Total tokens`,value:pa(E.total.totalTokens),accent:`text-tone-warning-fg`}),(0,$.jsx)(_a,{label:`Input`,value:pa(E.total.inputTokens)}),(0,$.jsx)(_a,{label:`Output`,value:pa(E.total.outputTokens)}),(0,$.jsx)(_a,{label:`Cache read`,value:pa(E.total.cacheReadTokens)}),(0,$.jsx)(_a,{label:`Cache hit %`,value:ta(ea(E.total)),accent:`text-tone-success-fg`}),(0,$.jsx)(_a,{label:`Cache write`,value:pa(E.total.cacheWriteTokens)}),(0,$.jsx)(_a,{label:`Reasoning`,value:pa(E.total.reasoningOutputTokens)}),(0,$.jsx)(_a,{label:`Reports`,value:pa(E.total.reports)})]}),(0,$.jsx)(`div`,{className:`overflow-x-auto`,children:(0,$.jsxs)(`div`,{className:`space-y-1.5 min-w-[720px]`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-[1fr_repeat(7,minmax(4.5rem,auto))] gap-3 px-2 text-[11px] text-muted-foreground uppercase tracking-wide`,children:[(0,$.jsx)(`span`,{children:`Provider`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Reports`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Input`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Output`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Cache R`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Cache hit`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Cache W`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Total`})]}),E.providers.map((e,t)=>(0,$.jsxs)(`div`,{className:`relative grid grid-cols-[1fr_repeat(7,minmax(4.5rem,auto))] gap-3 px-2 py-1.5 rounded-md overflow-hidden`,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-0 opacity-10`,style:{width:`${e.totalTokens/Math.max(1,E.total.totalTokens)*100}%`,background:fa(e.provider,t)}}),(0,$.jsxs)(`span`,{className:`relative truncate text-sm font-medium flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:fa(e.provider,t)}}),o(e.provider)]}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm text-muted-foreground`,children:pa(e.reports)}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm`,children:pa(e.inputTokens)}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm`,children:pa(e.outputTokens)}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm text-muted-foreground`,children:pa(e.cacheReadTokens)}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm text-tone-success-fg`,children:ta(ea(e))}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm text-muted-foreground`,children:pa(e.cacheWriteTokens)}),(0,$.jsx)(`span`,{className:`relative text-right tabular-nums text-sm font-medium text-tone-warning-fg`,children:pa(e.totalTokens)})]},e.provider))]})})]})})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Top tools`})}),(0,$.jsx)(S,{children:(n?.work.topTools.length??0)===0?(0,$.jsx)(Bi,{height:260,children:`No tool calls in this period`}):(0,$.jsx)(`div`,{id:`an-toptools`})})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Turn composition`})}),(0,$.jsx)(S,{children:P.values.length===0?(0,$.jsx)(Bi,{height:260,children:`No agent activity in this period`}):(0,$.jsx)(`div`,{id:`an-composition`})})]})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Conversation volume`})}),(0,$.jsx)(S,{children:N.length===0?(0,$.jsx)(Bi,{height:220,children:`No messages in this period`}):(0,$.jsx)(`div`,{id:`an-conversation`})})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`User interaction`})}),(0,$.jsxs)(S,{children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,$.jsx)(_a,{label:`Prompts`,value:pa(te?.prompts??0),accent:`text-tone-cyan-fg`}),(0,$.jsx)(_a,{label:`Reply rate`,value:te&&te.prompts>0?`${Math.round(te.replyRate*100)}%`:`—`}),(0,$.jsx)(_a,{label:`Median reply`,value:te?.latencyMs?ma(te.latencyMs.median):`—`,accent:`text-tone-success-fg`}),(0,$.jsx)(_a,{label:`Avg reply`,value:te?.latencyMs?ma(te.latencyMs.avg):`—`}),(0,$.jsx)(_a,{label:`p90 reply`,value:te?.latencyMs?ma(te.latencyMs.p90):`—`}),(0,$.jsx)(_a,{label:`Replied`,value:pa(te?.replied??0)})]}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground mt-3 mb-1`,children:`Prompts over time`}),(te?.prompts??0)===0?(0,$.jsx)(Bi,{height:120,children:`No prompts in this period`}):(0,$.jsx)(`div`,{id:`an-prompts`})]})]})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Fleet activity`})}),(0,$.jsxs)(S,{children:[(0,$.jsxs)(`div`,{className:`flex gap-6 mb-3 text-sm`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold tabular-nums`,children:z?.registrations??0}),` `,(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`spawns`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xl font-semibold tabular-nums text-tone-violet-fg`,children:z?.spawnedByAgent??0}),` `,(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`by agents`})]})]}),(z?.registrations??0)===0?(0,$.jsx)(Bi,{height:200,children:`No agents started in this period`}):(0,$.jsx)(`div`,{id:`an-spawns`})]})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Busiest hours`})}),(0,$.jsx)(S,{children:(n?.conversation.total??0)+(n?.work.toolCalls??0)===0?(0,$.jsx)(Bi,{height:240,children:`No data for heatmap`}):(0,$.jsx)(`div`,{id:`an-heatmap`})})]})]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{children:(0,$.jsx)(C,{className:`text-sm`,children:`Most active agents`})}),(0,$.jsx)(S,{children:ne.length===0?(0,$.jsx)(Bi,{height:120,children:`No agent activity in this period`}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto_auto] gap-4 px-2 text-[11px] text-muted-foreground uppercase tracking-wide`,children:[(0,$.jsx)(`span`,{children:`Agent`}),(0,$.jsx)(`span`,{className:`text-right w-16`,children:`Turns`}),(0,$.jsx)(`span`,{className:`text-right w-16`,children:`Tools`}),(0,$.jsx)(`span`,{className:`text-right w-16`,children:`Msgs`})]}),ne.map(e=>(0,$.jsxs)(`div`,{className:`relative grid grid-cols-[1fr_auto_auto_auto] gap-4 px-2 py-1.5 rounded-md overflow-hidden`,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-0 bg-tone-info/10`,style:{width:`${(e.toolCalls+e.messages)/re*100}%`}}),(0,$.jsx)(`span`,{className:`relative min-w-0 text-sm font-medium`,children:(0,$.jsx)(b,{agent:f[e.id],fallback:e.label||e.id})}),(0,$.jsx)(`span`,{className:`relative text-right w-16 tabular-nums text-sm`,children:pa(e.turns)}),(0,$.jsx)(`span`,{className:`relative text-right w-16 tabular-nums text-sm text-tone-violet-fg`,children:pa(e.toolCalls)}),(0,$.jsx)(`span`,{className:`relative text-right w-16 tabular-nums text-sm text-muted-foreground`,children:pa(e.messages)})]},e.id))]})})]})]})}export{ya as AnalyticsView};
|
|
910
|
-
//# sourceMappingURL=analytics-
|
|
910
|
+
//# sourceMappingURL=analytics-BqCb-LKi.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,o as n,p as r,u as i}from"./dist-DeW2Y1R5.js";import{t as a,wt as o}from"./store-
|
|
2
|
-
//# sourceMappingURL=artifact-viewer-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,o as n,p as r,u as i}from"./dist-DeW2Y1R5.js";import{t as a,wt as o}from"./store-DcClXLH0.js";import{M as s}from"./provider-display-DsuWMvVL.js";import{i as c,l,n as u,r as d,s as f,t as p}from"./artifacts-D32zyw4Y.js";import{_ as m,et as h,v as g,y as _}from"./display-BrKWFGJz.js";import{a as v,n as y,t as b}from"./api-CIIVBtAV.js";import{a as ee,i as x,n as S,o as C,r as w,s as T,t as E}from"./dialog-uuJ9_geR.js";import{t as D}from"./circle-alert-CryagaZd.js";import{t as O}from"./download-KgtpDbt5.js";import{t as k}from"./file-text-CKuoMR2U.js";import{n as A,t as j}from"./markdown-preview-BixaT3Xr.js";import{t as M}from"./loader-circle-BfPd4kOD.js";import{t as N}from"./minimize-2-BkK6XoMP.js";import{n as P,t as F}from"./pin-DcsKeXxr.js";import{t as I}from"./button-Do6Z3vvn.js";import{t as L}from"./badge-DqJRtj_p.js";import{t as R}from"./copy-button-CjOj4HEf.js";import{n as z,t as B}from"./task-chip-CYj0mpoL.js";import{t as V}from"./agent-name-DKbiIhBo.js";var H=t(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),U=t(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),W=e(r(),1),G=i();function K({artifact:e}){let[t,n]=(0,W.useState)(!!e.pinned),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(null);async function c(){i(!0),o(null);try{let r=await b(`PUT`,`/artifacts/${encodeURIComponent(e.id)}/pin`,{pinned:!t});n(!!r.pinned),d()}catch(e){o(s(e))}finally{i(!1)}}return(0,G.jsxs)(`span`,{className:`inline-flex max-w-full flex-wrap items-center gap-1`,children:[t&&(0,G.jsx)(L,{variant:`secondary`,children:`Pinned`}),(0,G.jsxs)(I,{size:`sm`,variant:`ghost`,disabled:r,onClick:()=>void c(),"aria-label":`${t?`Unpin`:`Pin`} ${e.filename??e.id}`,title:t?`Allow automatic cleanup`:`Keep from automatic cleanup`,children:[t?(0,G.jsx)(P,{className:`h-3.5 w-3.5`}):(0,G.jsx)(F,{className:`h-3.5 w-3.5`}),t?`Unpin`:`Pin`]}),a&&(0,G.jsx)(`span`,{role:`alert`,className:`text-xs text-destructive`,children:a})]})}var q=512*1024,J=e=>`/artifacts/${encodeURIComponent(e)}/content`;function Y(){let e=l();return(0,G.jsx)(E,{open:e!==null,onOpenChange:e=>{e||c()},children:e&&(0,G.jsx)(Q,{id:e},e)})}function X({uploader:e,agentsById:t,className:r}){let i=t[e];return i?(0,G.jsx)(V,{agent:i,className:r}):(0,G.jsx)(`span`,{className:n(`truncate`,r),title:e,children:f(e,t)})}function Z({view:e,className:t}){return(0,G.jsx)(e===`image`?H:e===`binary`?A:k,{"aria-hidden":!0,className:n(`shrink-0`,t)})}function Q({id:e}){let[t,r]=(0,W.useState)(null),[i,c]=(0,W.useState)({state:`loading`}),[l,d]=(0,W.useState)(!1),[f,m]=(0,W.useState)(!1),E=a(e=>e.agentsById),D=o();(0,W.useEffect)(()=>{let t=new AbortController,n=null;return(async()=>{try{let i=await b(`GET`,`/artifacts/${encodeURIComponent(e)}`);if(t.signal.aborted)return;r(i);let a=u(i);if(a===`binary`)return c({state:`binary`});if(a===`image`){let r=await y(J(e));return t.signal.aborted?void 0:(n=URL.createObjectURL(r),c({state:`image`,url:n}))}let o=await v(J(e),q,t.signal);if(t.signal.aborted)return;c(o.text.includes(`\0`)?{state:`binary`}:{state:`text`,text:o.text})}catch(e){t.signal.aborted||c({state:`error`,message:s(e)})}})(),()=>{t.abort(),n&&URL.revokeObjectURL(n)}},[e]);async function k(){if(t){m(!0);try{let n=i.state===`image`?i.url:URL.createObjectURL(await y(J(e))),r=document.createElement(`a`);r.href=n,r.download=p(t),document.body.appendChild(r),r.click(),r.remove(),i.state!==`image`&&setTimeout(()=>URL.revokeObjectURL(n),0)}catch(e){c({state:`error`,message:s(e)})}finally{m(!1)}}}let A=t?u(t):`text`,j=t!==null&&i.state===`text`&&t.size>q;return(0,G.jsxs)(w,{className:`w-[calc(100%-1rem)] max-w-5xl gap-3 sm:w-[calc(100%-2rem)]`,"aria-describedby":void 0,"data-testid":`artifact-viewer`,children:[(0,G.jsxs)(C,{className:`min-w-0 pr-8`,children:[(0,G.jsxs)(T,{className:`flex min-w-0 items-center gap-2 leading-snug`,children:[(0,G.jsx)(Z,{view:A,className:`h-4 w-4 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:t?p(t):e})]}),t&&(0,G.jsx)(x,{asChild:!0,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,G.jsx)(`span`,{className:`font-mono`,children:t.id}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsx)(`span`,{children:t.kind}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsx)(`span`,{className:`tabular-nums`,children:_(t.size)}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsx)(`span`,{className:`min-w-0 break-all`,children:t.mediaType}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsx)(`span`,{title:g(t.createdAt),children:h(D,t.createdAt)}),t.uploader&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:[`by `,(0,G.jsx)(X,{uploader:t.uploader,agentsById:E,className:`font-medium text-foreground`})]})]})]})}),t?.links&&t.links.length>0&&(0,G.jsx)(te,{links:t.links})]}),(0,G.jsx)(S,{className:n(`rounded-md`,i.state===`image`&&l&&`overflow-x-auto`),children:(0,G.jsx)(ne,{artifact:t,view:A,content:i,zoomed:l,onToggleZoom:()=>d(e=>!e)})}),(0,G.jsxs)(ee,{className:`flex-row flex-wrap items-center justify-end gap-2 sm:flex-row`,children:[j&&t&&(0,G.jsxs)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:[`Showing the first `,_(q),` of `,_(t.size)]}),i.state===`image`&&(0,G.jsxs)(I,{variant:`outline`,size:`sm`,onClick:()=>d(e=>!e),children:[l?(0,G.jsx)(N,{}):(0,G.jsx)(U,{}),l?`Fit`:`Actual size`]}),t&&(0,G.jsx)(K,{artifact:t}),(0,G.jsx)(R,{value:e,label:`Copy id`,copiedLabel:`Copied`,showText:!0,size:`sm`,variant:`outline`}),(0,G.jsxs)(I,{size:`sm`,onClick:()=>void k(),disabled:!t||f,children:[f?(0,G.jsx)(M,{className:`animate-spin`}):(0,G.jsx)(O,{}),`Download`]})]})]})}function te({links:e}){let t=a(e=>e.openTaskDetailById);return(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:e.map(e=>{let n=e.id,r=Number(e.entityId);return(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.entityType===`task`&&Number.isSafeInteger(r)?(0,G.jsx)(B,{id:r,title:e.title,onClick:()=>{c(),t(r)}}):(0,G.jsx)(z,{label:e.entityType===`message`?m(e.entityId):`${e.entityType} ${e.entityId}`,title:e.title}),e.role&&(0,G.jsx)(`span`,{children:e.role})]},n)})})}function $({icon:e,children:t}){return(0,G.jsxs)(`div`,{className:`flex min-h-32 flex-col items-center justify-center gap-2 py-8 text-center text-sm text-muted-foreground`,children:[e,t]})}function ne({artifact:e,view:t,content:r,zoomed:i,onToggleZoom:a}){return r.state===`error`?(0,G.jsx)($,{icon:(0,G.jsx)(D,{className:`h-5 w-5 text-tone-danger-fg`}),children:(0,G.jsx)(`span`,{className:`text-tone-danger-fg`,children:r.message})}):!e||r.state===`loading`?(0,G.jsx)($,{icon:(0,G.jsx)(M,{className:`h-5 w-5 animate-spin`}),children:`Loading…`}):r.state===`binary`?(0,G.jsxs)($,{icon:(0,G.jsx)(A,{className:`h-6 w-6`}),children:[`No preview for `,e.mediaType,`. Download it to open it.`]}):r.state===`image`?(0,G.jsx)(`button`,{type:`button`,onClick:a,className:n(`block w-full`,i?`cursor-zoom-out`:`cursor-zoom-in`),title:i?`Fit to screen`:`Actual size`,children:(0,G.jsx)(`img`,{src:r.url,alt:p(e),className:i?`max-w-none`:`mx-auto max-h-[calc(var(--dialog-max-h)-12rem)] max-w-full object-contain`})}):t===`markdown`?(0,G.jsx)(j,{content:r.text,path:e.filename??`${e.id}.md`}):(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-5 [overflow-wrap:anywhere]`,children:t===`json`?re(r.text):r.text})}function re(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}export{U as a,K as i,Y as n,H as o,X as r,Z as t};
|
|
2
|
+
//# sourceMappingURL=artifact-viewer-kf4pGuAR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Vt as e}from"./store-
|
|
2
|
-
//# sourceMappingURL=artifacts-
|
|
1
|
+
import{Vt as e}from"./store-DcClXLH0.js";import"./provider-display-DsuWMvVL.js";import{p as t}from"./display-BrKWFGJz.js";var n=`art_[0-9a-f]{16}`,r=RegExp(`^${n}$`),i=new Set([`application/x-ndjson`,`application/xml`,`application/javascript`,`application/x-sh`,`application/yaml`,`application/toml`]),a=/\.(txt|log|out|err|ndjson|jsonl|csv|tsv|diff|patch|ts|tsx|js|mjs|cjs|py|sh|ya?ml|toml|xml|html|css|sql)$/;function o(e){return r.test(e)}function s(e){let t=e.mediaType.split(`;`)[0].trim().toLowerCase(),n=e.filename?.toLowerCase()??``;return t.startsWith(`image/`)?`image`:t===`text/markdown`||/\.(md|markdown)$/.test(n)?`markdown`:t===`application/json`||n.endsWith(`.json`)?`json`:t.startsWith(`text/`)||i.has(t)||a.test(n)?`text`:`binary`}function c(e){return e.filename||e.id}function l(e,n){return n[e]||e.startsWith(`agent-`)?t(e,n):e}var u=e(()=>({id:null,revision:0}));function d(e){u.setState({id:e})}function f(){u.setState({id:null})}function p(){return u(e=>e.id)}function m(){u.setState(e=>({revision:e.revision+1}))}function h(){return u(e=>e.revision)}export{o as a,h as c,f as i,p as l,s as n,d as o,m as r,l as s,c as t,n as u};
|
|
2
|
+
//# sourceMappingURL=artifacts-D32zyw4Y.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i,wt as a}from"./store-BvtFdlGX.js";import{M as o}from"./provider-display-DbLWpP3j.js";import{c as s,n as c,o as l,s as u,t as d}from"./artifacts-oBOqks-2.js";import{et as f,v as p,y as m}from"./display-CfO7rTuF.js";import{t as h}from"./api-CIIVBtAV.js";import{a as g,n as _,t as v}from"./popover-8w1TWKMG.js";import{a as y,i as b,n as x,r as S,t as C}from"./select-DTQMP4Dk.js";import{t as w}from"./check-B3M9Ug1P.js";import{t as T}from"./chevron-down-BoG3JCZn.js";import{i as E,r as D,t as O}from"./artifact-viewer-DdWIfV6M.js";import{t as k}from"./paperclip-CNpKZKum.js";import{t as ee}from"./refresh-cw-CfpvQcUn.js";import{t as A}from"./search-DjzbnTbf.js";import{t as te}from"./x-Bge17hWJ.js";import{t as j}from"./button-Do6Z3vvn.js";import{t as M}from"./badge-DqJRtj_p.js";import{t as N}from"./task-chip-CYj0mpoL.js";import{t as P}from"./input-CsTB6jIx.js";import{r as F,t as I}from"./card-C4QJ4hCW.js";var L=e(n(),1),R=r(),z={expired:`Expired`,unlinked:`Unlinked retention`,"size-cap":`Storage limit`};function ne({reload:e,agentsById:t}){let[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)([]),[s,c]=(0,L.useState)(!1),[l,u]=(0,L.useState)(null);return(0,L.useEffect)(()=>{let e=!1;return Promise.all([h(`GET`,`/artifacts/usage`),h(`GET`,`/artifacts/deletions?limit=100`)]).then(([t,n])=>{e||(r(t),a(n),u(null))},t=>{e||u(o(t))}),()=>{e=!0}},[e]),(0,R.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border px-3 py-3`,"data-testid":`artifact-retention`,children:[l&&(0,R.jsx)(`div`,{role:`alert`,className:`text-sm text-destructive`,children:l}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`div`,{className:`text-sm text-foreground`,children:[`Blob storage: `,n?m(n.totalBytes):`Loading…`]}),n&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[m(n.unpinnedBytes),` unpinned / `,m(n.maxUnpinnedBytes),` limit; `,m(n.pinnedBytes),` pinned`]}),(0,R.jsxs)(`div`,{children:[`Unlinked files stay `,n.unlinkedRetentionDays,` days unless they expire or storage is full. Pinned files stay until unpinned. Limits are in Settings under Data retention.`]}),n.unpinnedBytes>n.maxUnpinnedBytes&&(0,R.jsx)(`div`,{className:`text-tone-warning-fg`,children:`Over the storage limit. Cleanup removes unlinked files first, then the oldest unpinned files. Pin files to keep them.`})]})]}),(0,R.jsx)(j,{size:`sm`,variant:`outline`,"aria-expanded":s,onClick:()=>c(e=>!e),children:`Recently deleted`})]}),s&&(0,R.jsxs)(`div`,{className:`space-y-2`,"data-testid":`artifact-deletions`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Last `,i.length,` deletions`,n?`; history kept for ${n.deletionLogDays} days`:``,`. Deleted files cannot be restored.`]}),i.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No recent deletions.`}):(0,R.jsx)(`ul`,{className:`divide-y divide-border`,children:i.map(e=>(0,R.jsxs)(`li`,{className:`space-y-1 py-2 text-xs`,children:[(0,R.jsx)(`div`,{className:`break-all font-medium`,children:e.filename??e.artifactId}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.artifactId}),(0,R.jsx)(`span`,{children:m(e.size)}),(0,R.jsx)(D,{uploader:e.createdBy,agentsById:t}),(0,R.jsxs)(`span`,{children:[Math.floor(e.ageMs/864e5),` days old`]}),(0,R.jsx)(`span`,{children:z[e.reason]}),(0,R.jsx)(`time`,{children:p(e.deletedAt)})]})]},e.id))})]})]})}var B=`any`;function re({value:e,onChange:t,agentsById:n}){let[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(``),[l,d]=(0,L.useState)(null),f=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!r)return;let e=!1;return d(null),h(`GET`,`/artifacts/uploaders${s?`?q=${encodeURIComponent(s)}`:``}`).then(t=>{e||d(Array.isArray(t)?t:[])},()=>{e||d([])}),()=>{e=!0}},[r,s]);function p(e){o(e),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>c(e.trim()),250)}function y(e){t(e),i(!1)}return(0,R.jsxs)(v,{open:r,onOpenChange:i,children:[(0,R.jsxs)(g,{"aria-label":`Uploader`,className:`flex h-7 w-44 max-w-full items-center justify-between gap-1.5 rounded-[min(var(--radius-md),10px)] border border-input bg-transparent pr-2 pl-2.5 text-sm dark:bg-input/30 dark:hover:bg-input/50`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e===B?`All uploaders`:u(e,n)}),(0,R.jsx)(T,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(_,{align:`start`,className:`w-72 max-w-[calc(100vw-1rem)] gap-2 p-2`,children:[(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(A,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(P,{value:a,onChange:e=>p(e.target.value),placeholder:`Search uploaders`,"aria-label":`Search uploaders`,className:`h-8 pl-8`,autoFocus:!0})]}),(0,R.jsxs)(`ul`,{className:`max-h-64 overflow-y-auto overscroll-contain`,"aria-label":`Uploaders`,children:[(0,R.jsx)(V,{selected:e===B,onSelect:()=>y(B),label:`All uploaders`}),l===null&&(0,R.jsx)(`li`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`Loading…`}),l?.length===0&&(0,R.jsx)(`li`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No uploader matches`}),l?.map(t=>(0,R.jsx)(V,{selected:e===t.uploader,onSelect:()=>y(t.uploader),label:u(t.uploader,n),content:(0,R.jsx)(D,{uploader:t.uploader,agentsById:n}),detail:`${t.count} · ${m(t.size)}`},t.uploader))]})]})]})}function V({selected:e,onSelect:n,label:r,content:i,detail:a}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":e,title:r,className:t(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted`,e&&`bg-muted`),children:[(0,R.jsx)(w,{"aria-hidden":!0,className:t(`h-3.5 w-3.5 shrink-0`,!e&&`invisible`)}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:i??r}),a&&(0,R.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:a})]})})}var H=50,U=`any`,W=5,G=864e5,ie=[`image`,`document`,`archive`,`video`,`audio`,`avatar`,`other`],K={image:`bg-tone-info`,document:`bg-tone-purple`,archive:`bg-tone-orange`,video:`bg-tone-teal`,audio:`bg-tone-yellow`,avatar:`bg-tone-success`,other:`bg-tone-neutral`},q=[{value:U,label:`Any time`,ms:0},{value:`24h`,label:`Last 24 hours`,ms:G},{value:`7d`,label:`Last 7 days`,ms:7*G},{value:`30d`,label:`Last 30 days`,ms:30*G}],J=[{value:`newest`,label:`Newest first`,sort:`date`,order:`desc`},{value:`oldest`,label:`Oldest first`,sort:`date`,order:`asc`},{value:`largest`,label:`Largest first`,sort:`size`,order:`desc`},{value:`smallest`,label:`Smallest first`,sort:`size`,order:`asc`}],Y={q:``,kind:U,uploader:U,projectId:U,range:U,task:``,sort:`newest`};function ae(e){let t=Number(e.trim().replace(/^T/i,``));return Number.isSafeInteger(t)&&t>0?t:void 0}function X(e,t){let n=new URLSearchParams;e.q&&n.set(`q`,e.q),e.kind!==U&&n.set(`kind`,e.kind),e.uploader!==U&&n.set(`uploader`,e.uploader),e.projectId!==U&&n.set(`projectId`,e.projectId);let r=q.find(t=>t.value===e.range);r?.ms&&n.set(`since`,String(t-r.ms));let i=ae(e.task);return i&&n.set(`taskId`,String(i)),n}function Z(e,t,n){let r=X(e,t),i=J.find(t=>t.value===e.sort)??J[0];return r.set(`sort`,i.sort),r.set(`order`,i.order),r.set(`limit`,String(H)),n&&r.set(`offset`,String(n)),r.toString()}function oe(){let e=a(),n=s(),r=i(e=>e.agentsById),[{filters:c,anchor:l},u]=(0,L.useState)({filters:Y,anchor:Date.now()}),[d,f]=(0,L.useState)(``),[p,m]=(0,L.useState)(``),[g,_]=(0,L.useState)(0),[v,y]=(0,L.useState)(null),[b,x]=(0,L.useState)(null),[S,C]=(0,L.useState)(null),[w,T]=(0,L.useState)(null),E=(0,L.useRef)(null),D=X(c,l).toString(),O=D!==``,N=Z(c,l,0),F=v?.key!==N,I=v?.items??[],z=v?.stats??null;(0,L.useEffect)(()=>{let e=!1;return T(null),Promise.all([h(`GET`,`/artifacts?${N}`),h(`GET`,`/artifacts/stats${D?`?${D}`:``}`)]).then(([t,n])=>{e||(y({key:N,items:t,stats:n}),D||x(n))},t=>{e||(T(o(t)),y({key:N,items:[],stats:null}))}),()=>{e=!0}},[N,D,g,n]),(0,L.useEffect)(()=>{if(!O)return;let e=!1;return h(`GET`,`/artifacts/stats`).then(t=>{e||x(t)},()=>void 0),()=>{e=!0}},[O,g]);function B(e){u(t=>({filters:{...t.filters,...e},anchor:Date.now()}))}function V(){u(e=>({...e,anchor:Date.now()})),_(e=>e+1)}function H(e){E.current&&clearTimeout(E.current),E.current=setTimeout(()=>B(e),250)}function W(){E.current&&clearTimeout(E.current),f(``),m(``),u(e=>({filters:{...Y,sort:e.filters.sort},anchor:Date.now()}))}async function G(){let e=N;C(e);try{let t=await h(`GET`,`/artifacts?${Z(c,l,I.length)}`);y(n=>n?.key===e?{...n,items:[...n.items,...t]}:n)}catch(e){T(o(e))}finally{C(t=>t===e?null:t)}}let K=z?.count??0;return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(k,{className:`h-5 w-5 text-muted-foreground`}),(0,R.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Artifacts`}),b&&(0,R.jsx)(M,{variant:`secondary`,children:b.count})]}),(0,R.jsxs)(j,{size:`sm`,variant:`outline`,onClick:V,children:[(0,R.jsx)(ee,{className:`h-3.5 w-3.5`}),` Refresh`]})]}),(0,R.jsx)(ne,{reload:g+n,agentsById:r}),(0,R.jsx)(se,{stats:z,filtered:O,agentsById:r,onUploader:e=>B({uploader:e}),onKind:e=>B({kind:e})}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,"data-testid":`artifact-filters`,children:[(0,R.jsxs)(`div`,{className:`relative w-full sm:w-64`,children:[(0,R.jsx)(A,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(P,{value:d,onChange:e=>{f(e.target.value),H({q:e.target.value.trim()})},placeholder:`Search name or art_ id`,"aria-label":`Search artifacts`,className:`h-8 pl-8`})]}),(0,R.jsx)(Q,{label:`Type`,value:c.kind,onChange:e=>B({kind:e}),className:`w-32`,options:[{value:U,label:`All types`},...ie.map(e=>({value:e,label:e}))]}),(0,R.jsx)(re,{value:c.uploader,onChange:e=>B({uploader:e}),agentsById:r}),(0,R.jsx)(Q,{label:`Project`,value:c.projectId,onChange:e=>B({projectId:e}),className:`w-36`,options:[{value:U,label:`All projects`},...(b?.projects??[]).map(e=>({value:e.projectId,label:e.slug??e.projectId}))]}),(0,R.jsx)(Q,{label:`Date`,value:c.range,onChange:e=>B({range:e}),className:`w-36`,options:[...q]}),(0,R.jsx)(P,{value:p,onChange:e=>{m(e.target.value),H({task:e.target.value})},placeholder:`Task, e.g. T5328`,"aria-label":`Filter by Task`,className:`h-8 w-32`}),(0,R.jsx)(Q,{label:`Sort`,value:c.sort,onChange:e=>B({sort:e}),className:`w-36`,options:[...J]}),O&&(0,R.jsxs)(j,{size:`sm`,variant:`ghost`,onClick:W,children:[(0,R.jsx)(te,{className:`h-3.5 w-3.5`}),` Clear`]})]}),w&&(0,R.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:w}),F&&I.length===0?(0,R.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading…`}):I.length===0?(0,R.jsx)(`div`,{className:`rounded-md border border-border px-3 py-12 text-center text-sm text-muted-foreground`,children:O?`No artifacts match these filters`:`No artifacts stored yet`}):(0,R.jsx)(`ul`,{className:t(`space-y-1.5`,F&&`opacity-60`),"data-testid":`artifact-list`,children:I.map(t=>(0,R.jsx)(ce,{artifact:t,now:e,agentsById:r},t.id))}),I.length>0&&(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{children:[`Showing `,I.length,` of `,K]}),I.length<K&&(0,R.jsx)(j,{size:`sm`,variant:`outline`,onClick:()=>void G(),disabled:F||S===N,children:S===N?`Loading…`:`Load more`})]})]})}function Q({label:e,value:n,onChange:r,options:i,className:a}){return(0,R.jsxs)(C,{value:n,onValueChange:r,children:[(0,R.jsx)(b,{size:`sm`,"aria-label":e,className:t(`max-w-full`,a),children:(0,R.jsx)(y,{})}),(0,R.jsx)(x,{children:i.map(e=>(0,R.jsx)(S,{value:e.value,children:e.label},e.value))})]})}function se({stats:e,filtered:n,agentsById:r,onUploader:i,onKind:a}){let o=e?.size??0;return(0,R.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_minmax(0,2fr)]`,"data-testid":`artifact-stats`,children:[(0,R.jsx)(I,{size:`sm`,children:(0,R.jsxs)(F,{className:`flex flex-row gap-6 md:flex-col md:gap-3`,children:[(0,R.jsx)($,{label:n?`Matching`:`Artifacts`,value:e?e.count.toLocaleString():`—`}),(0,R.jsx)($,{label:`Total size`,value:e?m(e.size):`—`})]})}),(0,R.jsx)(I,{size:`sm`,children:(0,R.jsxs)(F,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Size by type`}),(0,R.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-muted`,"aria-hidden":!0,children:e?.byKind.map(e=>(0,R.jsx)(`span`,{className:K[e.kind]??K.other,style:{width:`${o?e.size/o*100:0}%`}},e.kind))}),(0,R.jsx)(`ul`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 text-xs sm:grid-cols-2`,children:e?.byKind.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>a(e.kind),className:`flex w-full min-w-0 items-center gap-2 rounded-sm text-left hover:underline`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:t(`h-2 w-2 shrink-0 rounded-full`,K[e.kind]??K.other)}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.kind}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[m(e.size),` · `,e.count]})]})},e.kind))})]})}),(0,R.jsx)(I,{size:`sm`,children:(0,R.jsxs)(F,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Top uploaders`}),(0,R.jsxs)(`ul`,{className:`space-y-0.5 text-xs`,children:[e?.uploaders.slice(0,W).map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>i(e.uploader),className:`flex w-full min-w-0 items-center gap-2 rounded-sm text-left hover:underline`,children:[(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,R.jsx)(D,{uploader:e.uploader,agentsById:r})}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[e.count,` · `,m(e.size)]})]})},e.uploader)),e&&e.uploaders.length===0&&(0,R.jsx)(`li`,{className:`text-muted-foreground`,children:`None`})]})]})})]})}function $({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,R.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums`,children:t})]})}function ce({artifact:e,now:t,agentsById:n}){let r=i(e=>e.openTaskDetailById),a=[...new Set((e.links??[]).filter(e=>e.entityType===`task`).map(e=>Number(e.entityId)))].filter(Number.isSafeInteger);return(0,R.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 rounded-lg border border-border px-3 py-2 transition-colors hover:bg-muted/50`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),className:`flex min-w-0 flex-1 items-start gap-3 text-left`,"aria-label":`Open ${d(e)}`,children:[(0,R.jsx)(O,{view:c(e),className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:d(e)}),(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-mono`,children:e.id}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{children:e.kind}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{title:p(e.createdAt),children:f(t,e.createdAt)}),e.uploader&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{className:`flex min-w-0 max-w-48`,children:(0,R.jsx)(D,{uploader:e.uploader,agentsById:n})})]})]})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:m(e.size)}),(0,R.jsx)(E,{artifact:e},`${e.id}:${e.pinned}`),a.length>0&&(0,R.jsx)(`span`,{className:`flex flex-wrap justify-end gap-1`,children:a.map(e=>(0,R.jsx)(N,{id:e,compact:!0,onClick:()=>r(e)},e))})]})]})}export{oe as ArtifactsView};
|
|
2
|
-
//# sourceMappingURL=artifacts-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i,wt as a}from"./store-DcClXLH0.js";import{M as o}from"./provider-display-DsuWMvVL.js";import{c as s,n as c,o as l,s as u,t as d}from"./artifacts-D32zyw4Y.js";import{et as f,v as p,y as m}from"./display-BrKWFGJz.js";import{t as h}from"./api-CIIVBtAV.js";import{a as g,n as _,t as v}from"./popover-8w1TWKMG.js";import{a as y,i as b,n as x,r as S,t as C}from"./select-DTQMP4Dk.js";import{t as w}from"./check-B3M9Ug1P.js";import{t as T}from"./chevron-down-BoG3JCZn.js";import{i as E,r as D,t as O}from"./artifact-viewer-kf4pGuAR.js";import{t as k}from"./paperclip-CNpKZKum.js";import{t as ee}from"./refresh-cw-CfpvQcUn.js";import{t as A}from"./search-DjzbnTbf.js";import{t as te}from"./x-Bge17hWJ.js";import{t as j}from"./button-Do6Z3vvn.js";import{t as M}from"./badge-DqJRtj_p.js";import{t as N}from"./task-chip-CYj0mpoL.js";import{t as P}from"./input-CsTB6jIx.js";import{r as F,t as I}from"./card-C4QJ4hCW.js";var L=e(n(),1),R=r(),z={expired:`Expired`,unlinked:`Unlinked retention`,"size-cap":`Storage limit`};function ne({reload:e,agentsById:t}){let[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)([]),[s,c]=(0,L.useState)(!1),[l,u]=(0,L.useState)(null);return(0,L.useEffect)(()=>{let e=!1;return Promise.all([h(`GET`,`/artifacts/usage`),h(`GET`,`/artifacts/deletions?limit=100`)]).then(([t,n])=>{e||(r(t),a(n),u(null))},t=>{e||u(o(t))}),()=>{e=!0}},[e]),(0,R.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border px-3 py-3`,"data-testid":`artifact-retention`,children:[l&&(0,R.jsx)(`div`,{role:`alert`,className:`text-sm text-destructive`,children:l}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`div`,{className:`text-sm text-foreground`,children:[`Blob storage: `,n?m(n.totalBytes):`Loading…`]}),n&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[m(n.unpinnedBytes),` unpinned / `,m(n.maxUnpinnedBytes),` limit; `,m(n.pinnedBytes),` pinned`]}),(0,R.jsxs)(`div`,{children:[`Unlinked files stay `,n.unlinkedRetentionDays,` days unless they expire or storage is full. Pinned files stay until unpinned. Limits are in Settings under Data retention.`]}),n.unpinnedBytes>n.maxUnpinnedBytes&&(0,R.jsx)(`div`,{className:`text-tone-warning-fg`,children:`Over the storage limit. Cleanup removes unlinked files first, then the oldest unpinned files. Pin files to keep them.`})]})]}),(0,R.jsx)(j,{size:`sm`,variant:`outline`,"aria-expanded":s,onClick:()=>c(e=>!e),children:`Recently deleted`})]}),s&&(0,R.jsxs)(`div`,{className:`space-y-2`,"data-testid":`artifact-deletions`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Last `,i.length,` deletions`,n?`; history kept for ${n.deletionLogDays} days`:``,`. Deleted files cannot be restored.`]}),i.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No recent deletions.`}):(0,R.jsx)(`ul`,{className:`divide-y divide-border`,children:i.map(e=>(0,R.jsxs)(`li`,{className:`space-y-1 py-2 text-xs`,children:[(0,R.jsx)(`div`,{className:`break-all font-medium`,children:e.filename??e.artifactId}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.artifactId}),(0,R.jsx)(`span`,{children:m(e.size)}),(0,R.jsx)(D,{uploader:e.createdBy,agentsById:t}),(0,R.jsxs)(`span`,{children:[Math.floor(e.ageMs/864e5),` days old`]}),(0,R.jsx)(`span`,{children:z[e.reason]}),(0,R.jsx)(`time`,{children:p(e.deletedAt)})]})]},e.id))})]})]})}var B=`any`;function re({value:e,onChange:t,agentsById:n}){let[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(``),[l,d]=(0,L.useState)(null),f=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!r)return;let e=!1;return d(null),h(`GET`,`/artifacts/uploaders${s?`?q=${encodeURIComponent(s)}`:``}`).then(t=>{e||d(Array.isArray(t)?t:[])},()=>{e||d([])}),()=>{e=!0}},[r,s]);function p(e){o(e),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>c(e.trim()),250)}function y(e){t(e),i(!1)}return(0,R.jsxs)(v,{open:r,onOpenChange:i,children:[(0,R.jsxs)(g,{"aria-label":`Uploader`,className:`flex h-7 w-44 max-w-full items-center justify-between gap-1.5 rounded-[min(var(--radius-md),10px)] border border-input bg-transparent pr-2 pl-2.5 text-sm dark:bg-input/30 dark:hover:bg-input/50`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:e===B?`All uploaders`:u(e,n)}),(0,R.jsx)(T,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(_,{align:`start`,className:`w-72 max-w-[calc(100vw-1rem)] gap-2 p-2`,children:[(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(A,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(P,{value:a,onChange:e=>p(e.target.value),placeholder:`Search uploaders`,"aria-label":`Search uploaders`,className:`h-8 pl-8`,autoFocus:!0})]}),(0,R.jsxs)(`ul`,{className:`max-h-64 overflow-y-auto overscroll-contain`,"aria-label":`Uploaders`,children:[(0,R.jsx)(V,{selected:e===B,onSelect:()=>y(B),label:`All uploaders`}),l===null&&(0,R.jsx)(`li`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`Loading…`}),l?.length===0&&(0,R.jsx)(`li`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No uploader matches`}),l?.map(t=>(0,R.jsx)(V,{selected:e===t.uploader,onSelect:()=>y(t.uploader),label:u(t.uploader,n),content:(0,R.jsx)(D,{uploader:t.uploader,agentsById:n}),detail:`${t.count} · ${m(t.size)}`},t.uploader))]})]})]})}function V({selected:e,onSelect:n,label:r,content:i,detail:a}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":e,title:r,className:t(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted`,e&&`bg-muted`),children:[(0,R.jsx)(w,{"aria-hidden":!0,className:t(`h-3.5 w-3.5 shrink-0`,!e&&`invisible`)}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:i??r}),a&&(0,R.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:a})]})})}var H=50,U=`any`,W=5,G=864e5,ie=[`image`,`document`,`archive`,`video`,`audio`,`avatar`,`other`],K={image:`bg-tone-info`,document:`bg-tone-purple`,archive:`bg-tone-orange`,video:`bg-tone-teal`,audio:`bg-tone-yellow`,avatar:`bg-tone-success`,other:`bg-tone-neutral`},q=[{value:U,label:`Any time`,ms:0},{value:`24h`,label:`Last 24 hours`,ms:G},{value:`7d`,label:`Last 7 days`,ms:7*G},{value:`30d`,label:`Last 30 days`,ms:30*G}],J=[{value:`newest`,label:`Newest first`,sort:`date`,order:`desc`},{value:`oldest`,label:`Oldest first`,sort:`date`,order:`asc`},{value:`largest`,label:`Largest first`,sort:`size`,order:`desc`},{value:`smallest`,label:`Smallest first`,sort:`size`,order:`asc`}],Y={q:``,kind:U,uploader:U,projectId:U,range:U,task:``,sort:`newest`};function ae(e){let t=Number(e.trim().replace(/^T/i,``));return Number.isSafeInteger(t)&&t>0?t:void 0}function X(e,t){let n=new URLSearchParams;e.q&&n.set(`q`,e.q),e.kind!==U&&n.set(`kind`,e.kind),e.uploader!==U&&n.set(`uploader`,e.uploader),e.projectId!==U&&n.set(`projectId`,e.projectId);let r=q.find(t=>t.value===e.range);r?.ms&&n.set(`since`,String(t-r.ms));let i=ae(e.task);return i&&n.set(`taskId`,String(i)),n}function Z(e,t,n){let r=X(e,t),i=J.find(t=>t.value===e.sort)??J[0];return r.set(`sort`,i.sort),r.set(`order`,i.order),r.set(`limit`,String(H)),n&&r.set(`offset`,String(n)),r.toString()}function oe(){let e=a(),n=s(),r=i(e=>e.agentsById),[{filters:c,anchor:l},u]=(0,L.useState)({filters:Y,anchor:Date.now()}),[d,f]=(0,L.useState)(``),[p,m]=(0,L.useState)(``),[g,_]=(0,L.useState)(0),[v,y]=(0,L.useState)(null),[b,x]=(0,L.useState)(null),[S,C]=(0,L.useState)(null),[w,T]=(0,L.useState)(null),E=(0,L.useRef)(null),D=X(c,l).toString(),O=D!==``,N=Z(c,l,0),F=v?.key!==N,I=v?.items??[],z=v?.stats??null;(0,L.useEffect)(()=>{let e=!1;return T(null),Promise.all([h(`GET`,`/artifacts?${N}`),h(`GET`,`/artifacts/stats${D?`?${D}`:``}`)]).then(([t,n])=>{e||(y({key:N,items:t,stats:n}),D||x(n))},t=>{e||(T(o(t)),y({key:N,items:[],stats:null}))}),()=>{e=!0}},[N,D,g,n]),(0,L.useEffect)(()=>{if(!O)return;let e=!1;return h(`GET`,`/artifacts/stats`).then(t=>{e||x(t)},()=>void 0),()=>{e=!0}},[O,g]);function B(e){u(t=>({filters:{...t.filters,...e},anchor:Date.now()}))}function V(){u(e=>({...e,anchor:Date.now()})),_(e=>e+1)}function H(e){E.current&&clearTimeout(E.current),E.current=setTimeout(()=>B(e),250)}function W(){E.current&&clearTimeout(E.current),f(``),m(``),u(e=>({filters:{...Y,sort:e.filters.sort},anchor:Date.now()}))}async function G(){let e=N;C(e);try{let t=await h(`GET`,`/artifacts?${Z(c,l,I.length)}`);y(n=>n?.key===e?{...n,items:[...n.items,...t]}:n)}catch(e){T(o(e))}finally{C(t=>t===e?null:t)}}let K=z?.count??0;return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(k,{className:`h-5 w-5 text-muted-foreground`}),(0,R.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Artifacts`}),b&&(0,R.jsx)(M,{variant:`secondary`,children:b.count})]}),(0,R.jsxs)(j,{size:`sm`,variant:`outline`,onClick:V,children:[(0,R.jsx)(ee,{className:`h-3.5 w-3.5`}),` Refresh`]})]}),(0,R.jsx)(ne,{reload:g+n,agentsById:r}),(0,R.jsx)(se,{stats:z,filtered:O,agentsById:r,onUploader:e=>B({uploader:e}),onKind:e=>B({kind:e})}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,"data-testid":`artifact-filters`,children:[(0,R.jsxs)(`div`,{className:`relative w-full sm:w-64`,children:[(0,R.jsx)(A,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(P,{value:d,onChange:e=>{f(e.target.value),H({q:e.target.value.trim()})},placeholder:`Search name or art_ id`,"aria-label":`Search artifacts`,className:`h-8 pl-8`})]}),(0,R.jsx)(Q,{label:`Type`,value:c.kind,onChange:e=>B({kind:e}),className:`w-32`,options:[{value:U,label:`All types`},...ie.map(e=>({value:e,label:e}))]}),(0,R.jsx)(re,{value:c.uploader,onChange:e=>B({uploader:e}),agentsById:r}),(0,R.jsx)(Q,{label:`Project`,value:c.projectId,onChange:e=>B({projectId:e}),className:`w-36`,options:[{value:U,label:`All projects`},...(b?.projects??[]).map(e=>({value:e.projectId,label:e.slug??e.projectId}))]}),(0,R.jsx)(Q,{label:`Date`,value:c.range,onChange:e=>B({range:e}),className:`w-36`,options:[...q]}),(0,R.jsx)(P,{value:p,onChange:e=>{m(e.target.value),H({task:e.target.value})},placeholder:`Task, e.g. T5328`,"aria-label":`Filter by Task`,className:`h-8 w-32`}),(0,R.jsx)(Q,{label:`Sort`,value:c.sort,onChange:e=>B({sort:e}),className:`w-36`,options:[...J]}),O&&(0,R.jsxs)(j,{size:`sm`,variant:`ghost`,onClick:W,children:[(0,R.jsx)(te,{className:`h-3.5 w-3.5`}),` Clear`]})]}),w&&(0,R.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:w}),F&&I.length===0?(0,R.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading…`}):I.length===0?(0,R.jsx)(`div`,{className:`rounded-md border border-border px-3 py-12 text-center text-sm text-muted-foreground`,children:O?`No artifacts match these filters`:`No artifacts stored yet`}):(0,R.jsx)(`ul`,{className:t(`space-y-1.5`,F&&`opacity-60`),"data-testid":`artifact-list`,children:I.map(t=>(0,R.jsx)(ce,{artifact:t,now:e,agentsById:r},t.id))}),I.length>0&&(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{children:[`Showing `,I.length,` of `,K]}),I.length<K&&(0,R.jsx)(j,{size:`sm`,variant:`outline`,onClick:()=>void G(),disabled:F||S===N,children:S===N?`Loading…`:`Load more`})]})]})}function Q({label:e,value:n,onChange:r,options:i,className:a}){return(0,R.jsxs)(C,{value:n,onValueChange:r,children:[(0,R.jsx)(b,{size:`sm`,"aria-label":e,className:t(`max-w-full`,a),children:(0,R.jsx)(y,{})}),(0,R.jsx)(x,{children:i.map(e=>(0,R.jsx)(S,{value:e.value,children:e.label},e.value))})]})}function se({stats:e,filtered:n,agentsById:r,onUploader:i,onKind:a}){let o=e?.size??0;return(0,R.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_minmax(0,2fr)]`,"data-testid":`artifact-stats`,children:[(0,R.jsx)(I,{size:`sm`,children:(0,R.jsxs)(F,{className:`flex flex-row gap-6 md:flex-col md:gap-3`,children:[(0,R.jsx)($,{label:n?`Matching`:`Artifacts`,value:e?e.count.toLocaleString():`—`}),(0,R.jsx)($,{label:`Total size`,value:e?m(e.size):`—`})]})}),(0,R.jsx)(I,{size:`sm`,children:(0,R.jsxs)(F,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Size by type`}),(0,R.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-muted`,"aria-hidden":!0,children:e?.byKind.map(e=>(0,R.jsx)(`span`,{className:K[e.kind]??K.other,style:{width:`${o?e.size/o*100:0}%`}},e.kind))}),(0,R.jsx)(`ul`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 text-xs sm:grid-cols-2`,children:e?.byKind.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>a(e.kind),className:`flex w-full min-w-0 items-center gap-2 rounded-sm text-left hover:underline`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:t(`h-2 w-2 shrink-0 rounded-full`,K[e.kind]??K.other)}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.kind}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[m(e.size),` · `,e.count]})]})},e.kind))})]})}),(0,R.jsx)(I,{size:`sm`,children:(0,R.jsxs)(F,{className:`space-y-2`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Top uploaders`}),(0,R.jsxs)(`ul`,{className:`space-y-0.5 text-xs`,children:[e?.uploaders.slice(0,W).map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>i(e.uploader),className:`flex w-full min-w-0 items-center gap-2 rounded-sm text-left hover:underline`,children:[(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,R.jsx)(D,{uploader:e.uploader,agentsById:r})}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[e.count,` · `,m(e.size)]})]})},e.uploader)),e&&e.uploaders.length===0&&(0,R.jsx)(`li`,{className:`text-muted-foreground`,children:`None`})]})]})})]})}function $({label:e,value:t}){return(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,R.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums`,children:t})]})}function ce({artifact:e,now:t,agentsById:n}){let r=i(e=>e.openTaskDetailById),a=[...new Set((e.links??[]).filter(e=>e.entityType===`task`).map(e=>Number(e.entityId)))].filter(Number.isSafeInteger);return(0,R.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 rounded-lg border border-border px-3 py-2 transition-colors hover:bg-muted/50`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),className:`flex min-w-0 flex-1 items-start gap-3 text-left`,"aria-label":`Open ${d(e)}`,children:[(0,R.jsx)(O,{view:c(e),className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:d(e)}),(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-mono`,children:e.id}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{children:e.kind}),(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{title:p(e.createdAt),children:f(t,e.createdAt)}),e.uploader&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,R.jsx)(`span`,{className:`flex min-w-0 max-w-48`,children:(0,R.jsx)(D,{uploader:e.uploader,agentsById:n})})]})]})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:m(e.size)}),(0,R.jsx)(E,{artifact:e},`${e.id}:${e.pinned}`),a.length>0&&(0,R.jsx)(`span`,{className:`flex flex-wrap justify-end gap-1`,children:a.map(e=>(0,R.jsx)(N,{id:e,compact:!0,onClick:()=>r(e)},e))})]})]})}export{oe as ArtifactsView};
|
|
2
|
+
//# sourceMappingURL=artifacts-DJevXcvg.js.map
|