@zaip-ai/cli 6.3.0 → 7.5.0
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 +10 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +16 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/services/adapter-codex-config.d.ts +3 -0
- package/dist/services/adapter-codex-config.d.ts.map +1 -0
- package/dist/services/adapter-codex-config.js +119 -0
- package/dist/services/adapter-codex-config.js.map +1 -0
- package/dist/services/adapter-config-overlay.d.ts +8 -0
- package/dist/services/adapter-config-overlay.d.ts.map +1 -0
- package/dist/services/adapter-config-overlay.js +17 -0
- package/dist/services/adapter-config-overlay.js.map +1 -0
- package/dist/services/adapters.d.ts +3 -2
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +34 -143
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/adapters.test.js +12 -0
- package/dist/services/adapters.test.js.map +1 -1
- package/dist/services/agent-adapters.d.ts +2 -98
- package/dist/services/agent-adapters.d.ts.map +1 -1
- package/dist/services/agent-adapters.js +30 -29
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-adapters.test.js +4 -2
- package/dist/services/agent-adapters.test.js.map +1 -1
- package/dist/services/agent-guidance-types.d.ts +98 -0
- package/dist/services/agent-guidance-types.d.ts.map +1 -0
- package/dist/services/agent-guidance-types.js +4 -0
- package/dist/services/agent-guidance-types.js.map +1 -0
- package/dist/services/catalog-toml.d.ts +4 -0
- package/dist/services/catalog-toml.d.ts.map +1 -0
- package/dist/services/catalog-toml.js +10 -0
- package/dist/services/catalog-toml.js.map +1 -0
- package/dist/services/catalog-write-scope.d.ts +4 -0
- package/dist/services/catalog-write-scope.d.ts.map +1 -0
- package/dist/services/catalog-write-scope.js +18 -0
- package/dist/services/catalog-write-scope.js.map +1 -0
- package/dist/services/claude-settings-overlay.d.ts +4 -0
- package/dist/services/claude-settings-overlay.d.ts.map +1 -0
- package/dist/services/claude-settings-overlay.js +58 -0
- package/dist/services/claude-settings-overlay.js.map +1 -0
- package/dist/services/client-selection.d.ts +17 -0
- package/dist/services/client-selection.d.ts.map +1 -0
- package/dist/services/client-selection.js +67 -0
- package/dist/services/client-selection.js.map +1 -0
- package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.js +20 -9
- package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
- package/dist/services/codex-git-publication-template.d.ts +2 -0
- package/dist/services/codex-git-publication-template.d.ts.map +1 -0
- package/dist/services/codex-git-publication-template.js +120 -0
- package/dist/services/codex-git-publication-template.js.map +1 -0
- package/dist/services/codex-github-setup-template.d.ts +3 -0
- package/dist/services/codex-github-setup-template.d.ts.map +1 -0
- package/dist/services/codex-github-setup-template.js +176 -0
- package/dist/services/codex-github-setup-template.js.map +1 -0
- package/dist/services/codex-hook-activation.d.ts +1 -1
- package/dist/services/codex-hook-activation.d.ts.map +1 -1
- package/dist/services/codex-hook-activation.js +55 -10
- package/dist/services/codex-hook-activation.js.map +1 -1
- package/dist/services/codex-host-diagnostic.d.ts +10 -0
- package/dist/services/codex-host-diagnostic.d.ts.map +1 -0
- package/dist/services/codex-host-diagnostic.js +5 -0
- package/dist/services/codex-host-diagnostic.js.map +1 -0
- package/dist/services/codex-host-diagnostic.test.d.ts +2 -0
- package/dist/services/codex-host-diagnostic.test.d.ts.map +1 -0
- package/dist/services/codex-host-diagnostic.test.js +24 -0
- package/dist/services/codex-host-diagnostic.test.js.map +1 -0
- package/dist/services/codex-literal-read-sequence-template.d.ts.map +1 -1
- package/dist/services/codex-literal-read-sequence-template.js +97 -6
- package/dist/services/codex-literal-read-sequence-template.js.map +1 -1
- package/dist/services/codex-native-authority-policy-template.d.ts +2 -0
- package/dist/services/codex-native-authority-policy-template.d.ts.map +1 -0
- package/dist/services/codex-native-authority-policy-template.js +132 -0
- package/dist/services/codex-native-authority-policy-template.js.map +1 -0
- package/dist/services/codex-native-tool-authority-template.d.ts.map +1 -1
- package/dist/services/codex-native-tool-authority-template.js +147 -145
- package/dist/services/codex-native-tool-authority-template.js.map +1 -1
- package/dist/services/codex-node-options-template.d.ts +3 -0
- package/dist/services/codex-node-options-template.d.ts.map +1 -0
- package/dist/services/codex-node-options-template.js +30 -0
- package/dist/services/codex-node-options-template.js.map +1 -0
- package/dist/services/codex-pre-tool-cli-capture-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-cli-capture-template.js +214 -10
- package/dist/services/codex-pre-tool-cli-capture-template.js.map +1 -1
- package/dist/services/codex-pre-tool-cloud-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-cloud-template.js +149 -12
- package/dist/services/codex-pre-tool-cloud-template.js.map +1 -1
- package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-dependencies.test-support.js +12 -0
- package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.js +53 -138
- package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.test.js +13 -7
- package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
- package/dist/services/codex-pre-tool-host-context-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-host-context-template.js +23 -0
- package/dist/services/codex-pre-tool-host-context-template.js.map +1 -1
- package/dist/services/codex-pre-tool-policy-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-policy-template.js +5 -3
- package/dist/services/codex-pre-tool-policy-template.js.map +1 -1
- package/dist/services/codex-pre-tool-release-review-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-release-review-template.js +161 -2
- package/dist/services/codex-pre-tool-release-review-template.js.map +1 -1
- package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-support-template.js +88 -129
- package/dist/services/codex-pre-tool-support-template.js.map +1 -1
- package/dist/services/codex-release-publication-template.d.ts +2 -0
- package/dist/services/codex-release-publication-template.d.ts.map +1 -0
- package/dist/services/codex-release-publication-template.js +127 -0
- package/dist/services/codex-release-publication-template.js.map +1 -0
- package/dist/services/codex-repository-profile-template.d.ts +2 -0
- package/dist/services/codex-repository-profile-template.d.ts.map +1 -0
- package/dist/services/codex-repository-profile-template.js +84 -0
- package/dist/services/codex-repository-profile-template.js.map +1 -0
- package/dist/services/codex-rules.d.ts +1 -1
- package/dist/services/codex-rules.d.ts.map +1 -1
- package/dist/services/codex-rules.js +2 -2
- package/dist/services/codex-storage-handoff-template.d.ts +2 -0
- package/dist/services/codex-storage-handoff-template.d.ts.map +1 -0
- package/dist/services/codex-storage-handoff-template.js +18 -0
- package/dist/services/codex-storage-handoff-template.js.map +1 -0
- package/dist/services/codex-subagent-hook-template.d.ts +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
- package/dist/services/codex-subagent-hook-template.js +7 -6
- package/dist/services/codex-subagent-hook-template.js.map +1 -1
- package/dist/services/codex-task-delivery-authority-template.d.ts +3 -0
- package/dist/services/codex-task-delivery-authority-template.d.ts.map +1 -0
- package/dist/services/codex-task-delivery-authority-template.js +206 -0
- package/dist/services/codex-task-delivery-authority-template.js.map +1 -0
- package/dist/services/codex-validation-runtime-template.js +1 -1
- package/dist/services/codex-windows-hook-command.js +2 -2
- package/dist/services/codex-windows-hook-command.js.map +1 -1
- package/dist/services/developer-identity-fixture.d.ts.map +1 -1
- package/dist/services/developer-identity-fixture.js +3 -2
- package/dist/services/developer-identity-fixture.js.map +1 -1
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +5 -1
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/github-setup-status.d.ts +6 -3
- package/dist/services/github-setup-status.d.ts.map +1 -1
- package/dist/services/github-setup-status.js +9 -5
- package/dist/services/github-setup-status.js.map +1 -1
- package/dist/services/github-setup-status.test.js +69 -3
- package/dist/services/github-setup-status.test.js.map +1 -1
- package/dist/services/global-codex-config.d.ts.map +1 -1
- package/dist/services/global-codex-config.js +3 -0
- package/dist/services/global-codex-config.js.map +1 -1
- package/dist/services/global-codex-project-trust.d.ts +17 -0
- package/dist/services/global-codex-project-trust.d.ts.map +1 -0
- package/dist/services/global-codex-project-trust.js +186 -0
- package/dist/services/global-codex-project-trust.js.map +1 -0
- package/dist/services/global-codex-project-trust.test.d.ts +2 -0
- package/dist/services/global-codex-project-trust.test.d.ts.map +1 -0
- package/dist/services/global-codex-project-trust.test.js +188 -0
- package/dist/services/global-codex-project-trust.test.js.map +1 -0
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +95 -190
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/install-client-selection.d.ts +6 -0
- package/dist/services/install-client-selection.d.ts.map +1 -0
- package/dist/services/install-client-selection.js +24 -0
- package/dist/services/install-client-selection.js.map +1 -0
- package/dist/services/install-result.d.ts +6 -0
- package/dist/services/install-result.d.ts.map +1 -0
- package/dist/services/install-result.js +14 -0
- package/dist/services/install-result.js.map +1 -0
- package/dist/services/install-storage-boundary.d.ts +6 -0
- package/dist/services/install-storage-boundary.d.ts.map +1 -0
- package/dist/services/install-storage-boundary.js +173 -0
- package/dist/services/install-storage-boundary.js.map +1 -0
- package/dist/services/install-storage-boundary.test.d.ts +2 -0
- package/dist/services/install-storage-boundary.test.d.ts.map +1 -0
- package/dist/services/install-storage-boundary.test.js +110 -0
- package/dist/services/install-storage-boundary.test.js.map +1 -0
- package/dist/services/install-template-backup.d.ts +3 -0
- package/dist/services/install-template-backup.d.ts.map +1 -0
- package/dist/services/install-template-backup.js +46 -0
- package/dist/services/install-template-backup.js.map +1 -0
- package/dist/services/install-template-lock.d.ts +2 -0
- package/dist/services/install-template-lock.d.ts.map +1 -0
- package/dist/services/install-template-lock.js +32 -0
- package/dist/services/install-template-lock.js.map +1 -0
- package/dist/services/install-template-policy.d.ts +16 -0
- package/dist/services/install-template-policy.d.ts.map +1 -1
- package/dist/services/install-template-policy.js +73 -1
- package/dist/services/install-template-policy.js.map +1 -1
- package/dist/services/install-template-render.d.ts +11 -0
- package/dist/services/install-template-render.d.ts.map +1 -0
- package/dist/services/install-template-render.js +53 -0
- package/dist/services/install-template-render.js.map +1 -0
- package/dist/services/install-template-rule-files.d.ts +3 -0
- package/dist/services/install-template-rule-files.d.ts.map +1 -0
- package/dist/services/install-template-rule-files.js +24 -0
- package/dist/services/install-template-rule-files.js.map +1 -0
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +35 -10
- package/dist/services/logger.js.map +1 -1
- package/dist/services/logger.test.js +65 -16
- package/dist/services/logger.test.js.map +1 -1
- package/dist/services/project-config-upgrade.d.ts +3 -0
- package/dist/services/project-config-upgrade.d.ts.map +1 -0
- package/dist/services/project-config-upgrade.js +58 -0
- package/dist/services/project-config-upgrade.js.map +1 -0
- package/dist/services/runtime-template-deploy-policy.test.d.ts +2 -0
- package/dist/services/runtime-template-deploy-policy.test.d.ts.map +1 -0
- package/dist/services/runtime-template-deploy-policy.test.js +26 -0
- package/dist/services/runtime-template-deploy-policy.test.js.map +1 -0
- package/dist/services/runtime-template-test-support.d.ts +14 -0
- package/dist/services/runtime-template-test-support.d.ts.map +1 -1
- package/dist/services/runtime-template-test-support.js +18 -0
- package/dist/services/runtime-template-test-support.js.map +1 -1
- package/dist/services/runtime-template.test.js +14 -63
- package/dist/services/runtime-template.test.js.map +1 -1
- package/dist/services/sqlite-bootstrap.js +2 -2
- package/dist/services/sqlite-bootstrap.js.map +1 -1
- package/dist/services/stack-node.js +2 -2
- package/dist/services/stack-node.js.map +1 -1
- package/dist/services/stack-terraform.d.ts.map +1 -1
- package/dist/services/stack-terraform.js +5 -5
- package/dist/services/stack-terraform.js.map +1 -1
- package/dist/services/template-packed-path.test.d.ts +2 -0
- package/dist/services/template-packed-path.test.d.ts.map +1 -0
- package/dist/services/template-packed-path.test.js +30 -0
- package/dist/services/template-packed-path.test.js.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/templates/.agents/README-ENG.md +3 -1
- package/templates/.agents/README.md +3 -1
- package/templates/.agents/architecture/software-architecture.md +7 -1
- package/templates/.agents/config/agents/catalog.yaml +25 -12
- package/templates/.agents/config/agents/discovery.json +2 -2
- package/templates/.agents/config/autonomous-cloud-inputs.json +3 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +4 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +6 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-brand-strategist.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +6 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +5 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +7 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +9 -6
- package/templates/.agents/config/clients/codex/agents/zaip-agent-general-operations.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-governance-compliance.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-growth-strategist.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +5 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +4 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +3 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-sales-specialist.toml +3 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +6 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +7 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +3 -1
- package/templates/.agents/config/project.yaml +7 -2
- package/templates/.agents/dashboard/.zaip-managed.json +282 -142
- package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-DZ2mnR6k.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BQOQCvcJ.js → DashboardHelpDialog-DnxpHJSo.js} +20 -10
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-CGET1J8Q.js → PricingSettingsDialog-DsFTUwhL.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-BCsdQtWG.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-Bw6xnXUN.js → TraceabilityWorkspace-BN8FwP5S.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-C2AFYBu_.css → cost-monitor-BESDS3aE.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-YfoKMzCQ.js +59 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-BZf8HWmm.js → dashboard-localization-BVBhiAAS.js} +3 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-CjGGux6h.js → icons-vendor-DSdQAua1.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-4cl5FQBn.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-uIVtG2ZR.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-B9jZSAKf.js → react-vendor-rGvJzdn5.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-DFpwb0TN.js → traceability-Boz50W9b.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +8 -7
- package/templates/.agents/dashboard/apps/frontend/index.html +1 -0
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/playwright.dom.config.ts +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingPanels.tsx +10 -7
- package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +22 -19
- package/templates/.agents/dashboard/apps/frontend/src/CostCalculationGuidePage.tsx +16 -117
- package/templates/.agents/dashboard/apps/frontend/src/CostCharts.percentages.test.tsx +75 -0
- package/templates/.agents/dashboard/apps/frontend/src/CostTelemetryGuide.tsx +36 -0
- package/templates/.agents/dashboard/apps/frontend/src/DashboardToast.tsx +9 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.dom.test.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +1 -0
- package/templates/.agents/dashboard/apps/frontend/src/ReconciliationFeedback.dom.test.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/ReconciliationFeedback.tsx +22 -19
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.dom.e2e.ts +5 -2
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.dom.test.ts +86 -0
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.test.tsx +44 -0
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.tsx +37 -12
- package/templates/.agents/dashboard/apps/frontend/src/cost-guide-calculations.ts +118 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api-sqlite-view.ts +3 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +15 -31
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-http-transport.ts +30 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-runtime-status.ts +4 -1
- package/templates/.agents/dashboard/apps/frontend/src/main.tsx +1 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +2 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +17 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +0 -20
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-observer.test.ts +112 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-observer.ts +147 -0
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-compact-cost-adapter.ts +100 -0
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.test.ts +20 -0
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.ts +15 -0
- package/templates/.agents/dashboard/apps/frontend/src/styles-pricing.css +265 -0
- package/templates/.agents/dashboard/apps/frontend/src/styles.css +21 -265
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +35 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +11 -87
- package/templates/.agents/dashboard/apps/frontend/src/use-app-effects.ts +26 -199
- package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.navigation.test.tsx +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.test.ts +65 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.ts +17 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/use-operations-detail-export.ts +10 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-runtime-status.dom.test.ts +86 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-runtime-status.ts +4 -5
- package/templates/.agents/dashboard/apps/frontend/src/workspace-status.css +42 -0
- package/templates/.agents/dashboard/apps/frontend/vite.config.ts +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +11 -10
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +39 -15
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.test.ts +27 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.tsx +89 -83
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.tsx +14 -24
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +1 -27
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +12 -63
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.availability.test.ts +60 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +1 -15
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/compact-cost-export-source.ts +85 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/compact-cost-page-range.test.ts +34 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-chart-presentation.ts +74 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-charts.css +117 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-group-table-totals.ts +29 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-export-sources.ts +19 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-state.ts +27 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +6 -117
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +3 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +9 -32
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-metrics.ts +33 -0
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsLocaleMenu.tsx +58 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.navigation.test.tsx +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +16 -47
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.navigation.test.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +4 -100
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +25 -89
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportColumns.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportDuration.test.ts +105 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-duration-rows.ts +91 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +4 -0
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/contracts/package.json +2 -2
- package/templates/.agents/dashboard/packages/contracts/src/export.ts +2 -0
- package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
- package/templates/.agents/dashboard/packages/data-export/src/index.test.ts +30 -0
- package/templates/.agents/dashboard/packages/data-export/src/index.ts +10 -0
- package/templates/.agents/dashboard/packages/data-export/src/ooxml-stream.ts +50 -3
- package/templates/.agents/dashboard/packages/local-runtime/DIAGNOSTICS.md +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/dashboard-build-fingerprint.mjs +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.mjs +4 -2
- package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.test.mjs +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +314 -269
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +266 -222
- package/templates/.agents/dashboard/packages/local-runtime/package.json +3 -3
- package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-dashboard-executable-startup.mjs +4 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-dashboard-reconciliation-executable.mjs +4 -4
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +314 -269
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +51 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +15 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/dashboard-diagnostics.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +3 -40
- package/templates/.agents/dashboard/packages/local-runtime/src/project-stack-labels.ts +40 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/retained-worktree-capture.ts +81 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.ts +11 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-hono-security.test.ts +40 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +33 -14
- package/templates/.agents/dashboard/packages/local-runtime/src/server-project-settings-routes.test.ts +83 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-project-settings-routes.ts +41 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +3 -19
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-diagnostics.test.ts +2 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-refresh.test.ts +61 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-route.ts +2 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-run-range.ts +18 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.ts +3 -36
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-worker-receipt.ts +38 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-work-priority-route.ts +18 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +1 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +6 -32
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-rollup.ts +47 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-financial-consistency.test.ts +133 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-financial-entity-page.ts +159 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-incremental-refresh.test.ts +12 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.ts +17 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-operation-pages.ts +71 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +5 -40
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-temporal-dimension.ts +29 -7
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-view-page.ts +7 -55
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +16 -24
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-fixture.test-support.ts +27 -5
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-filesystem.ts +20 -37
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-keeps-orphan-telemetry-out-kanban-without.test.ts +9 -9
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-marks-token-cost-telemetry-unavailable-when.test.ts +3 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +14 -20
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuilds-disposable-snapshot-serves-zaip-records.test.ts +11 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-financial-summary.ts +38 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/telemetry-reconciliation.integration.test.ts +223 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/work-priority-contract.test.ts +5 -5
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.test.mjs +59 -3
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +1 -1
- package/templates/.agents/dashboard/packages/windows-launcher/build-dashboard-launcher.ps1 +1 -1
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +1 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +11 -15
- package/templates/.agents/dashboard/tests/e2e/specs/work-board-hydration.ts +40 -11
- package/templates/.agents/dashboard/zaip-dashboard-windows.exe +0 -0
- package/templates/.agents/design/.zaip-managed.json +498 -54
- package/templates/.agents/design/apps/catalog/dist/assets/index-BH6Fxbj0.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-BK0aBll9.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-Bzhb1wb_.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-CB-MTaWq.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-CIqfUcy8.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-Ccq-NOLA.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-Ch2eyD9C.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-Cy64ytQr.js +67 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-DfxEbFlq.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-Dqt6mTvD.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-rz8gOc0a.js +76 -0
- package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{CatalogShell-BJ8b4xZr.js → CatalogShell-D2YyQQrT.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-CQLHzznn.js → Color-6AOWCN3U-BmCuNXMg.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-DF9KC_gA.js +158 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFilters.stories-D17Q1egS.js +5 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFiltersSpecimen-CEBrLT2k.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DesignSystem.stories-ED52wFjY.js → DesignSystem.stories-BibuRt_c.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-BcLgM80v.js → DocsRenderer-JROSPFPF-GkfL8_gG.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Maker.stories-Dv9Keun_.js +13 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/MakerSpecimen-DGwAKRi9.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/MakerSpecimen-mkkuFOp_.js +5 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Primitives-DV6Bpudf.js → Primitives-n1UqmNvo.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/ReconciliationSpecimen-BJnfyyG3.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/ReconciliationSpecimen.stories-CH-GF9Rk.js +13 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-BKNiAz_E.js → WithTooltip-7X4HQR7L-BPXo6OoG.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WorkspaceStatus.stories-BL19HGOo.js → WorkspaceStatus.stories-Cie1f_yU.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-GcYWBBSp.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-DZBcXL-p.js → chunk-DRQKCCAG-Cn4_bvJJ.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-W22LQPXL-CF3y2mfo.js → chunk-W22LQPXL-CQrULeB4.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-BVjxMRGq.js → components-uiaDZHE7.js} +5 -5
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-DfjRffT7.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-CTWGZcEe.js → iframe-BgEb-d5o.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-D1JaPXfV.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{react-18-B9_a4mHb.js → react-18-BZ-Ne01c.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-CwpjKEyW.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{syntaxhighlighter-YFXUGROL-F_p8E2xc.js → syntaxhighlighter-YFXUGROL-BvuP8St2.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{theming-fbSD9ZLF.js → theming-BGScn6Yf.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/iframe.html +2 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/index.json +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +3 -3
- package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +3 -3
- package/templates/.agents/design/apps/catalog/package.json +2 -2
- package/templates/.agents/design/apps/catalog/src/components/WorkspaceStatusSpecimen.tsx +32 -1
- package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +14 -3
- package/templates/.agents/design/apps/catalog/src/specimens/MAKER-HANDOFF.md +134 -0
- package/templates/.agents/design/apps/catalog/src/specimens/MakerSpecimen.test.tsx +143 -0
- package/templates/.agents/design/apps/catalog/src/specimens/MakerSpecimen.tsx +132 -0
- package/templates/.agents/design/apps/catalog/src/specimens/maker-fixtures.d.ts +15 -0
- package/templates/.agents/design/apps/catalog/src/specimens/maker-fixtures.js +86 -0
- package/templates/.agents/design/apps/catalog/src/specimens/maker-native.d.ts +1 -0
- package/templates/.agents/design/apps/catalog/src/specimens/maker-native.js +332 -0
- package/templates/.agents/design/apps/catalog/src/stories/Maker.stories.tsx +24 -0
- package/templates/.agents/design/apps/catalog/src/stories/WorkspaceStatus.stories.tsx +1 -0
- package/templates/.agents/design/apps/catalog/src/styles/maker-specimen.css +285 -0
- package/templates/.agents/design/design-system-maker/API.md +468 -0
- package/templates/.agents/design/design-system-maker/NOTICE.md +13 -0
- package/templates/.agents/design/design-system-maker/README.md +138 -0
- package/templates/.agents/design/design-system-maker/SOURCE-PROVENANCE.json +62 -0
- package/templates/.agents/design/design-system-maker/build.json +524 -0
- package/templates/.agents/design/design-system-maker/frontend/ADAPTATION.md +351 -0
- package/templates/.agents/design/design-system-maker/frontend/MAKER-REPAIR-HANDOFF.md +134 -0
- package/templates/.agents/design/design-system-maker/frontend/advanced/examples.js +30 -0
- package/templates/.agents/design/design-system-maker/frontend/advanced/index.html +75 -0
- package/templates/.agents/design/design-system-maker/frontend/advanced/index.js +30 -0
- package/templates/.agents/design/design-system-maker/frontend/catalog/filters.js +132 -0
- package/templates/.agents/design/design-system-maker/frontend/catalog/index.html +17 -0
- package/templates/.agents/design/design-system-maker/frontend/catalog/index.js +82 -0
- package/templates/.agents/design/design-system-maker/frontend/generate.html +74 -0
- package/templates/.agents/design/design-system-maker/frontend/generate.js +226 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/api.js +112 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/components.js +200 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/diagnostic-view.js +218 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/extraction-state.js +38 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/failure-view.js +54 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/frontend-scenarios-2.test.mjs +138 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/frontend.test.mjs +357 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/job-view.js +81 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/model-hydration.js +26 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/model.js +103 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/palette-evidence.js +106 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/palette-evidence.test.mjs +210 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/palette-view.js +149 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/preview.test.mjs +263 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/report-view.js +267 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/reprocess-dialog.js +192 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/specimens.js +231 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/viewer-actions.js +78 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/viewer-detail.js +121 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/viewer-summary.js +91 -0
- package/templates/.agents/design/design-system-maker/frontend/shared/visual-model.js +255 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/advanced.css +128 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/base.css +318 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/catalog-filters.css +114 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/diagnostic.css +298 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/layout.css +320 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/maker.css +7 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/report.css +173 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/reprocess-dialog.css +34 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/specimen-foundations.css +363 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/specimens.css +59 -0
- package/templates/.agents/design/design-system-maker/frontend/styles/viewer-summary.css +308 -0
- package/templates/.agents/design/design-system-maker/frontend/viewer/diagnostic.html +3 -0
- package/templates/.agents/design/design-system-maker/frontend/viewer/index.html +8 -0
- package/templates/.agents/design/design-system-maker/frontend/viewer/index.js +233 -0
- package/templates/.agents/design/design-system-maker/frontend/viewer/preview.html +3 -0
- package/templates/.agents/design/design-system-maker/frontend/viewer/specimen.js +88 -0
- package/templates/.agents/design/design-system-maker/launcher/Program.cs +117 -0
- package/templates/.agents/design/design-system-maker/runtime/chat-cli.mjs +27 -0
- package/templates/.agents/design/design-system-maker/runtime/chat-client.mjs +170 -0
- package/templates/.agents/design/design-system-maker/runtime/chat-contract.mjs +13 -0
- package/templates/.agents/design/design-system-maker/runtime/collection.mjs +269 -0
- package/templates/.agents/design/design-system-maker/runtime/contracts.mjs +383 -0
- package/templates/.agents/design/design-system-maker/runtime/design-codes.mjs +46 -0
- package/templates/.agents/design/design-system-maker/runtime/design-compose.mjs +118 -0
- package/templates/.agents/design/design-system-maker/runtime/design-markdown.mjs +154 -0
- package/templates/.agents/design/design-system-maker/runtime/import.mjs +137 -0
- package/templates/.agents/design/design-system-maker/runtime/io.mjs +121 -0
- package/templates/.agents/design/design-system-maker/runtime/job-progress.mjs +50 -0
- package/templates/.agents/design/design-system-maker/runtime/json-tokens.mjs +88 -0
- package/templates/.agents/design/design-system-maker/runtime/launch-identity.mjs +100 -0
- package/templates/.agents/design/design-system-maker/runtime/launch-protocol.mjs +88 -0
- package/templates/.agents/design/design-system-maker/runtime/launch-server.mjs +51 -0
- package/templates/.agents/design/design-system-maker/runtime/launch.mjs +107 -0
- package/templates/.agents/design/design-system-maker/runtime/local-actions.mjs +184 -0
- package/templates/.agents/design/design-system-maker/runtime/local-artifacts.mjs +228 -0
- package/templates/.agents/design/design-system-maker/runtime/local-request.mjs +100 -0
- package/templates/.agents/design/design-system-maker/runtime/lock.mjs +23 -0
- package/templates/.agents/design/design-system-maker/runtime/presentation.mjs +107 -0
- package/templates/.agents/design/design-system-maker/runtime/repository-source.mjs +200 -0
- package/templates/.agents/design/design-system-maker/runtime/reprocess-mode.mjs +17 -0
- package/templates/.agents/design/design-system-maker/runtime/request-contracts.mjs +121 -0
- package/templates/.agents/design/design-system-maker/runtime/serve.mjs +53 -0
- package/templates/.agents/design/design-system-maker/runtime/server.mjs +363 -0
- package/templates/.agents/design/design-system-maker/runtime/service-actions.mjs +59 -0
- package/templates/.agents/design/design-system-maker/runtime/service-host.mjs +32 -0
- package/templates/.agents/design/design-system-maker/runtime/service-projections.mjs +87 -0
- package/templates/.agents/design/design-system-maker/runtime/service.mjs +393 -0
- package/templates/.agents/design/design-system-maker/runtime/stop.mjs +38 -0
- package/templates/.agents/design/design-system-maker/runtime/trash.mjs +95 -0
- package/templates/.agents/design/design-system-maker/zaip-design-system-maker.exe +0 -0
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/cloud-hostinger-autonomy.md +9 -7
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +3 -3
- package/templates/.agents/requirements/dashboard-launch.md +1 -1
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +3 -3
- package/templates/.agents/requirements/landing-page-forms.md +39 -0
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +4 -4
- package/templates/.agents/requirements/site-performance.md +41 -0
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +1 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/rules/autonomy-decision.md +4 -1
- package/templates/.agents/rules/cloud-hostinger-autonomy.md +4 -1
- package/templates/.agents/rules/core.md +5 -2
- package/templates/.agents/rules/framework-maintenance.md +34 -0
- package/templates/.agents/rules/frontend-lite.md +2 -1
- package/templates/.agents/rules/github-deploy-auth.md +18 -0
- package/templates/.agents/rules/infisical-secrets.md +20 -0
- package/templates/.agents/rules/landing-page-forms.md +28 -0
- package/templates/.agents/rules/lead-measurement.md +20 -0
- package/templates/.agents/rules/local-sqlite-storage.md +2 -2
- package/templates/.agents/rules/local-state-storage.md +15 -0
- package/templates/.agents/rules/production-readiness.md +1 -1
- package/templates/.agents/rules/quality-assurance.md +36 -0
- package/templates/.agents/rules/repository-responsibility.md +38 -0
- package/templates/.agents/rules/security.md +1 -1
- package/templates/.agents/rules/site-performance.md +29 -0
- package/templates/.agents/rules/website-quality.md +31 -0
- package/templates/.agents/rules/workflow.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +2256 -802
- package/templates/.agents/runtime/checksums.sha256 +6 -6
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
- package/templates/.agents/runtime/provenance.json +5 -5
- package/templates/.agents/runtime/sbom.cdx.json +7 -7
- package/templates/.agents/skills/criar-pasta-obsidian/SKILL.md +2 -2
- package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.mjs +7 -24
- package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.test.mjs +4 -2
- package/templates/.agents/skills/criar-pasta-obsidian/scripts/obsidian-format.mjs +20 -0
- package/templates/.agents/skills/zaip-skill-adapters/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-application-observability/references/lead-measurement.md +52 -0
- package/templates/.agents/skills/zaip-skill-architecture-design/SKILL.md +3 -1
- package/templates/.agents/skills/zaip-skill-auth-tenancy/references/lead-measurement.md +42 -0
- package/templates/.agents/skills/zaip-skill-author-skills/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-author-skills/references/engineering-skill-index.md +4 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +3 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/run-skill-tests.mjs +37 -7
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/skill-test-plan.mjs +79 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/skill-test-plan.test.mjs +47 -0
- package/templates/.agents/skills/zaip-skill-backend/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-backend/references/deployment-environments.md +2 -2
- package/templates/.agents/skills/zaip-skill-change/references/observable-evidence.md +3 -3
- package/templates/.agents/skills/zaip-skill-cloud-engineering/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/SKILL.md +16 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/references/account-token.md +90 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/scripts/preview-access.mjs +91 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/scripts/preview-access.test.mjs +44 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/SKILL.md +4 -2
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/references/workers-static-assets.md +1 -1
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/references/workflow-templates.md +5 -5
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/scripts/cloudflare-github-deploy-contract.test.mjs +24 -5
- package/templates/.agents/skills/zaip-skill-config/SKILL.md +33 -8
- package/templates/.agents/skills/zaip-skill-config/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-config/references/repository-profiles.md +83 -0
- package/templates/.agents/skills/zaip-skill-dashboard-sqlite/SKILL.md +2 -2
- package/templates/.agents/skills/zaip-skill-data-modeling/references/lead-measurement.md +37 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/references/lead-measurement.md +35 -0
- package/templates/.agents/skills/zaip-skill-decisions/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-deployment-pipeline/SKILL.md +11 -0
- package/templates/.agents/skills/zaip-skill-design-maker/SKILL.md +28 -0
- package/templates/.agents/skills/zaip-skill-design-maker/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-design-maker/references/chat-contract.md +46 -0
- package/templates/.agents/skills/zaip-skill-design-maker/references/compose.md +20 -0
- package/templates/.agents/skills/zaip-skill-design-maker/references/markdown.md +26 -0
- package/templates/.agents/skills/zaip-skill-design-maker/references/repository.md +24 -0
- package/templates/.agents/skills/zaip-skill-design-maker/references/url.md +24 -0
- package/templates/.agents/skills/zaip-skill-design-redesign/SKILL.md +41 -0
- package/templates/.agents/skills/zaip-skill-design-redesign/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-design-reproduction/SKILL.md +47 -0
- package/templates/.agents/skills/zaip-skill-design-reproduction/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-design-system/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-design-url-extraction/SKILL.md +50 -0
- package/templates/.agents/skills/zaip-skill-design-url-extraction/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-design-url-extraction/references/capture-example.json +11 -0
- package/templates/.agents/skills/zaip-skill-design-url-extraction/references/runtime-workflow.md +127 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/SKILL.md +3 -1
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-fence.mjs +2 -1
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-lease.mjs +3 -1
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-storage.mjs +40 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-storage.test.mjs +87 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/scheduled-ready-queue-contract.test.mjs +1 -1
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +11 -3
- package/templates/.agents/skills/zaip-skill-execution/references/autonomous-continuation.md +2 -0
- package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +10 -4
- package/templates/.agents/skills/zaip-skill-execution/references/conversation-promotion.md +38 -0
- package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +3 -1
- package/templates/.agents/skills/zaip-skill-external-integrations/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-external-integrations/references/kommo.md +71 -0
- package/templates/.agents/skills/zaip-skill-figma-setup/SKILL.md +42 -0
- package/templates/.agents/skills/zaip-skill-figma-setup/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-figma-setup/references/capability-contract.json +40 -0
- package/templates/.agents/skills/zaip-skill-figma-setup/references/figma-connection.md +60 -0
- package/templates/.agents/skills/zaip-skill-figma-setup/references/figma-handoff.md +71 -0
- package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +30 -1
- package/templates/.agents/skills/zaip-skill-frontend-data-flows/SKILL.md +3 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +38 -5
- package/templates/.agents/skills/zaip-skill-github-deploy/references/authentication.md +15 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/authorization.md +35 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +21 -3
- package/templates/.agents/skills/zaip-skill-github-deploy/references/literal-read-sequence.md +28 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +4 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-notes.md +4 -4
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/application-content.mjs +82 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/application-content.test.mjs +184 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-publication-authority.mjs +63 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs +42 -36
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.test.mjs +4 -5
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-auth.mjs +400 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-auth.test.mjs +192 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-constraints.test.mjs +159 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract-cli.test.mjs +32 -24
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract-range.test-support.mjs +51 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +213 -225
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +63 -56
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-idempotent-intent.test.mjs +130 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-publication-intent.test.mjs +112 -5
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request-conditions.test.mjs +117 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request-continuation.test.mjs +44 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request-preservation.test.mjs +58 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request.mjs +291 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-command.mjs +11 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-config-paths.mjs +10 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-destination.mjs +21 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-push-target.mjs +62 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-push-target.test.mjs +78 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +4 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs +132 -42
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight-options.mjs +50 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight-worktree.test.mjs +52 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +70 -119
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +11 -1
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/project-restrictions.mjs +201 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/project-restrictions.test.mjs +154 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-authority-callbacks.test.mjs +46 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-conditions.mjs +193 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-intent.mjs +76 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-plan-binding.mjs +78 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-plan-refusal.mjs +30 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-project-policy.mjs +39 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-2457VC25.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-25VZXDBX.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-2JXOAZ2R.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-2OZK443Y.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3BDTL55L.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3MG57Y6I.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3MQAJ6XX.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3TUUBJPP.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-45Z34LBQ.mjs +140 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-4GJE2IXL.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-4HLOIRQU.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-55PSJJ75.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-5OTFTK2Y.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-7OFWNBZN.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-7R2IP55E.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-7SBOEN6U.mjs +24 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-A35CQWF4.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-A3ZCURGS.mjs +11 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-BC2LX3QU.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-C2Z26E6U.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-CHJGU2RU.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-D4LGE7UI.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-D5OUJS46.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-D6RZM5OT.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-DOK2R3GV.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-EAHVOUKK.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-FZUNFGZV.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-GGBPBQ6D.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-HFDX2GP6.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-HZ2NRMAG.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-IJKPDKXC.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-JEOOTEUX.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-JF3E72HZ.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-KRHOCS3C.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-LG5MJS2A.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-ML4PMB7C.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-MSCWMPU5.mjs +63 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-NJOFXS7P.mjs +137 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-NORNV3B2.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-PBU2HSKP.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-PG6LGVVW.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-PGYGDY3J.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-QFUQW6LE.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-QI32NI7M.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-R4HD7XOO.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-REHSM3G2.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-S22YDVTM.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-S5P4ZNUQ.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-SCK2RF6V.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-SWFLYM3O.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TA7RY5MY.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TM5WG7GR.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TMVJHK37.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TPDQAH7C.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-U2KO7ULM.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-U3ISMYJU.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-UKSDAS73.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-UNTPHSZO.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-V4MIRRUB.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-WNXOXX3Z.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-WQGTDRK7.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-WZJIRYT6.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XED4KYQL.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XEXCFKHI.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XJJFARY4.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XQOFL3K3.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-YAWUSDPM.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-YEUY7TMM.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-Z5X23XXT.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-Z7H2BHYQ.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-ZOGCYGYB.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/lifecycle-records.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ar.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-az.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-be.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-bg.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-bn.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ca.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ckb.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-cs.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-da.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-de.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-el.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-en.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-eo.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-es.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fa.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fi.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fr-CA.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fr.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-gu.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-he.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hi.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hr.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hu.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hy.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-id.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-is.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-it.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ja.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ka.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-kh.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-km.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-kn.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ko.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-lt.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-mk.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ms.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ne.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-nl.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-nn.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-no.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ota.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-pl.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ps.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-pt-BR.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-pt.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ro.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ru.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-sk.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-sl.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-sv.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ta.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-tg.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-th.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-tk.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-tr.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ua.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-uk.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ur.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-uz.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-vi.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-yo.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-zh-CN.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-zh-TW.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/manifest.json +565 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/native-authority.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/proof.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/run-records.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/yaml-runtime.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/zod-runtime.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-schema.mjs +2 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof.test.mjs +79 -0
- package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +14 -11
- package/templates/.agents/skills/zaip-skill-github-setup/references/bounded-setup.md +42 -0
- package/templates/.agents/skills/zaip-skill-github-setup/scripts/setup.mjs +365 -0
- package/templates/.agents/skills/zaip-skill-github-setup-ssh-folder/SKILL.md +13 -3
- package/templates/.agents/skills/zaip-skill-github-setup-ssh-folder/references/operational-procedure.md +4 -4
- package/templates/.agents/skills/zaip-skill-google-ads-conversions/SKILL.md +18 -0
- package/templates/.agents/skills/zaip-skill-google-ads-conversions/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-google-ads-conversions/references/implementation.md +61 -0
- package/templates/.agents/skills/zaip-skill-google-analytics/SKILL.md +24 -0
- package/templates/.agents/skills/zaip-skill-google-analytics/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-google-analytics/references/implementation.md +64 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/SKILL.md +24 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/references/implementation.md +71 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/references/operator-checklist.md +51 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/references/operator-fixtures.json +93 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/scripts/check-runbook-links.mjs +103 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/scripts/google-runbooks.test.mjs +247 -0
- package/templates/.agents/skills/zaip-skill-google-tag-manager/scripts/operator-model.mjs +221 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/SKILL.md +8 -2
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/autonomous-cloud-inputs.example.json +3 -3
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/autonomous-runner.md +4 -2
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/cloudflare-agent-setup.md +23 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/cloudflare-dns.md +36 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/guia-iniciante-hostinger-vps.md +4 -4
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/operational-contract.md +3 -3
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/vps-onboarding.md +97 -0
- package/templates/.agents/skills/zaip-skill-image-optimization/SKILL.md +31 -0
- package/templates/.agents/skills/zaip-skill-image-optimization/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-image-optimization/references/adapters.md +36 -0
- package/templates/.agents/skills/zaip-skill-image-optimization/references/pipeline.md +35 -0
- package/templates/.agents/skills/zaip-skill-image-optimization/scripts/images.mjs +370 -0
- package/templates/.agents/skills/zaip-skill-image-optimization/scripts/images.test.mjs +385 -0
- package/templates/.agents/skills/zaip-skill-infisical/SKILL.md +20 -0
- package/templates/.agents/skills/zaip-skill-infisical/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-infisical/assets/compose.yaml +62 -0
- package/templates/.agents/skills/zaip-skill-infisical/assets/terraform/infisical.tf +57 -0
- package/templates/.agents/skills/zaip-skill-infisical/references/credential-workflow.md +88 -0
- package/templates/.agents/skills/zaip-skill-infisical/references/first-initialization.md +51 -0
- package/templates/.agents/skills/zaip-skill-infisical/references/security-and-edition.md +19 -0
- package/templates/.agents/skills/zaip-skill-infisical/references/self-hosting.md +71 -0
- package/templates/.agents/skills/zaip-skill-infisical/references/terraform.md +54 -0
- package/templates/.agents/skills/zaip-skill-infisical/scripts/prepare-self-host.mjs +92 -0
- package/templates/.agents/skills/zaip-skill-infisical/scripts/prepare-self-host.test.mjs +69 -0
- package/templates/.agents/skills/zaip-skill-infisical/scripts/preview-terraform.mjs +70 -0
- package/templates/.agents/skills/zaip-skill-infisical/scripts/preview-terraform.test.mjs +51 -0
- package/templates/.agents/skills/zaip-skill-infisical/scripts/terraform-plan-integration.test.mjs +83 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/SKILL.md +37 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/accessibility.md +29 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/contact-then-qualification.example.json +83 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/contracts.md +70 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/examples.md +21 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/journey.md +30 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/multistep.example.json +84 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/single-screen.example.json +76 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/references/verification.md +24 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/scripts/validate-plan.mjs +306 -0
- package/templates/.agents/skills/zaip-skill-landing-page-forms/scripts/validate-plan.test.mjs +183 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/SKILL.md +32 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/architecture.md +51 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/authority.md +49 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/bant-contract.md +36 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/consent-contract.md +48 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/delivery-contract.md +65 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/event-contract.md +47 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/examples/escola.json +180 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/examples/moradigna-regression.json +158 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/examples/solar.json +165 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/identity-contract.md +53 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/implementation-plan.md +60 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/kommo-contract.md +83 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/meta-mapping.md +28 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/migration.md +65 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/operations.md +125 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/persistence-reference.md +65 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/questionnaire-v2.schema.json +136 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/synthetic-config.json +24 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/references/synthetic-event.json +19 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/check-questionnaire.mjs +314 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/check-questionnaire.test.mjs +338 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-cases-core.mjs +144 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-cases-privacy.mjs +183 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-fixtures.mjs +60 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-rollback-support.mjs +114 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent.mjs +222 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent.test.mjs +294 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-ledger.mjs +179 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-case-fixtures.mjs +118 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-cases.mjs +6 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-contract-cases.mjs +218 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-contract.mjs +182 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-proof-support.mjs +104 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-proof.mjs +272 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-state-cases.mjs +248 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2.mjs +234 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/lead-measurement.mjs +277 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/lead-measurement.test.mjs +288 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/questionnaire-ast-cases.mjs +127 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/questionnaire-test-support.mjs +25 -0
- package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/questionnaire-validation.mjs +155 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +30 -2
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/empty-usage-lock.md +56 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/late-finalization.md +158 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/local-catalog-closure.md +37 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/post-publication-task-first.md +1 -1
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/scripts/empty-lock-native.cs +113 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/scripts/empty-lock-native.ps1 +9 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/scripts/recover-empty-usage-lock.mjs +194 -0
- package/templates/.agents/skills/zaip-skill-local-credentials/SKILL.md +27 -0
- package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +8 -6
- package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +4 -4
- package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +2 -2
- package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +11 -0
- package/templates/.agents/skills/zaip-skill-marketing/references/search-content.md +17 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/SKILL.md +23 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/references/implementation.md +88 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/references/synthetic-meta.json +27 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/scripts/check-meta-links.mjs +88 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/scripts/meta-model.mjs +369 -0
- package/templates/.agents/skills/zaip-skill-meta-conversions/scripts/meta-model.test.mjs +394 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/SKILL.md +26 -1
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/astro-islands.md +41 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/controlled-runner.md +38 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/google-diagnostics.md +46 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/report-contract.md +99 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/site-budgets.json +25 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/site-performance.md +83 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/references/third-party-performance.md +57 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/assess-reports.mjs +42 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/capture-site.mjs +155 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/local-preview.mjs +84 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/performance-report.mjs +142 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/performance-report.test.mjs +122 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/report-fixtures.test-support.mjs +51 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/report-import.mjs +209 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/report-import.test.mjs +164 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/run-lighthouse.mjs +151 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/series-gate.mjs +225 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/series-gate.test.mjs +143 -0
- package/templates/.agents/skills/zaip-skill-qa/SKILL.md +54 -0
- package/templates/.agents/skills/zaip-skill-qa/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-qa/references/host-protocol.md +125 -0
- package/templates/.agents/skills/zaip-skill-qa/references/landing-page-forms.md +23 -0
- package/templates/.agents/skills/zaip-skill-qa/references/proof-adapters.md +92 -0
- package/templates/.agents/skills/zaip-skill-qa/references/scenarios.md +73 -0
- package/templates/.agents/skills/zaip-skill-qa/references/seo-geo.md +33 -0
- package/templates/.agents/skills/zaip-skill-qa/references/site-performance.md +20 -0
- package/templates/.agents/skills/zaip-skill-qa/scripts/observe-dashboard-ui.mjs +152 -0
- package/templates/.agents/skills/zaip-skill-qa/scripts/observe-dashboard-ui.test.mjs +65 -0
- package/templates/.agents/skills/zaip-skill-qa/scripts/qa-contract.test.mjs +203 -0
- package/templates/.agents/skills/zaip-skill-qa/scripts/run-behavior-tests.mjs +369 -0
- package/templates/.agents/skills/zaip-skill-qa/scripts/run-behavior-tests.test.mjs +168 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/SKILL.md +33 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +42 -62
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-native-window.mjs +115 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-native-window.test.mjs +123 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-optional-timing.test.mjs +34 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-reviewed-pairs-fixture.mjs +130 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-deduplicate-apply.mjs +106 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +22 -45
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +0 -24
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +73 -9
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-reviewed-order.mjs +48 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-reviewed-pairs.mjs +255 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-reviewed-pairs.test.mjs +329 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-token-snapshots.mjs +49 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-token-snapshots.test.mjs +33 -0
- package/templates/.agents/skills/zaip-skill-refactor-landing-page/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +19 -1
- package/templates/.agents/skills/zaip-skill-release-qualification/references/frozen-task-recovery.md +47 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/references/local-catalog.md +136 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +7 -5
- package/templates/.agents/skills/zaip-skill-release-qualification/references/remote-validation.md +147 -0
- package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-sales-methodology/references/bant-discovery.md +28 -0
- package/templates/.agents/skills/zaip-skill-screenshot-intake/SKILL.md +40 -0
- package/templates/.agents/skills/zaip-skill-screenshot-intake/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-screenshot-intake/references/request-example.json +36 -0
- package/templates/.agents/skills/zaip-skill-screenshot-intake/references/runtime-workflow.md +110 -0
- package/templates/.agents/skills/zaip-skill-search-observability/SKILL.md +27 -0
- package/templates/.agents/skills/zaip-skill-search-observability/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-search-observability/references/report-template.md +32 -0
- package/templates/.agents/skills/zaip-skill-search-observability/references/workflow.md +56 -0
- package/templates/.agents/skills/zaip-skill-search-observability/scripts/search-report.mjs +139 -0
- package/templates/.agents/skills/zaip-skill-search-observability/scripts/search-report.test.mjs +72 -0
- package/templates/.agents/skills/zaip-skill-setup/SKILL.md +51 -44
- package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +1 -1
- package/templates/.agents/skills/zaip-skill-setup/references/basic-onboarding.md +41 -0
- package/templates/.agents/skills/zaip-skill-setup/references/codex-activation.md +40 -0
- package/templates/.agents/skills/zaip-skill-setup/scripts/onboarding-contract.test.mjs +41 -0
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/SKILL.md +4 -3
- package/templates/.agents/skills/zaip-skill-task/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-task/references/commit-policy.md +1 -1
- package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +18 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/references/frontend-impact.md +81 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/references/verification-adoption.md +31 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/scripts/validation-plan.mjs +168 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/scripts/validation-plan.test.mjs +146 -0
- package/templates/.agents/skills/zaip-skill-tool-setup/scripts/tool-state.mjs +1 -1
- package/templates/.agents/skills/zaip-skill-use-connectors/SKILL.md +8 -0
- package/templates/.agents/skills/zaip-skill-use-connectors/scripts/select-connector.mjs +73 -0
- package/templates/.agents/skills/zaip-skill-use-connectors/scripts/select-connector.test.mjs +85 -0
- package/templates/.agents/skills/zaip-skill-visual-report/SKILL.md +41 -0
- package/templates/.agents/skills/zaip-skill-visual-report/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-visual-report/references/fidelity-proof.md +56 -0
- package/templates/.agents/skills/zaip-skill-visual-report/references/intake-state.md +64 -0
- package/templates/.agents/skills/zaip-skill-visual-report/references/source-contract.md +79 -0
- package/templates/.agents/skills/zaip-skill-visual-report/references/synthesis-template.md +67 -0
- package/templates/.agents/skills/zaip-skill-visual-report/references/visual-contract.json +40 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/SKILL.md +73 -17
- package/templates/.agents/skills/zaip-skill-website-readiness/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-website-readiness/references/capability-checklist.md +8 -4
- package/templates/.agents/skills/zaip-skill-website-readiness/references/change-discovery.md +22 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/content-and-agents.md +25 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/crawler-policy.md +35 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/schema-matrix.md +23 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/search-evidence.md +36 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/site-quality.example.json +14 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/site-quality.md +109 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/site-validation.md +60 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/sources.md +37 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/visual-preservation.md +84 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/agent-content.mjs +116 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/agent-content.test.mjs +83 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/audit-site.mjs +136 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/html-facts.mjs +56 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/index-directives.mjs +29 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/quality-plan.mjs +62 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/robots-policy.mjs +63 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/search-policy.test.mjs +183 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/site-audit.mjs +243 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/site-audit.test.mjs +287 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/sitemap-policy.mjs +111 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/verify-site-design.mjs +130 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/scripts/visual-preservation.mjs +160 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/SKILL.md +70 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/references/complete-preservation.md +70 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/references/default-policy.md +53 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/references/lifecycle-roots.md +106 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/references/metadata-overlay.md +45 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/references/procedure.md +49 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/complete-preservation.mjs +252 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-local-archive.mjs +162 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-local-git.mjs +111 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-acl.ps1 +37 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-activate.ps1 +66 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-alias.mjs +202 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-batches.mjs +88 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-copy-session.mjs +84 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-cutover.mjs +350 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-files.mjs +109 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-generation-posix.mjs +194 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-generation.mjs +173 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-journal.mjs +88 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-layout.mjs +102 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-lock.mjs +106 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-migration.mjs +234 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-observation-tail.mjs +148 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-permissions.mjs +52 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-plan.mjs +143 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-preparation.mjs +110 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-process-start.ps1 +7 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-quiescence.ps1 +11 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-receipt-lease.mjs +67 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-reuse.mjs +68 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-telemetry-version.mjs +187 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/git-process.mjs +85 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/metadata-overlay.mjs +302 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/metadata-secrets.mjs +44 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/migrate-durable-state.mjs +49 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/recovery.mjs +247 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/retention-marker.mjs +44 -0
- package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/worktree-proof.mjs +148 -0
- package/templates/.agents/tools/api/kommo-crm/README.md +13 -9
- package/templates/.agents/tools/cloud-onboarding-architecture.mjs +273 -0
- package/templates/.agents/tools/cloud-onboarding-bootstrap.test.mjs +176 -0
- package/templates/.agents/tools/cloud-onboarding-configure.mjs +146 -0
- package/templates/.agents/tools/cloud-onboarding-credentials.mjs +279 -0
- package/templates/.agents/tools/cloud-onboarding-files.mjs +190 -0
- package/templates/.agents/tools/cloud-onboarding-files.test.mjs +72 -0
- package/templates/.agents/tools/cloud-onboarding-generation.mjs +161 -0
- package/templates/.agents/tools/cloud-onboarding-generation.test.mjs +129 -0
- package/templates/.agents/tools/cloud-onboarding-policy.mjs +196 -0
- package/templates/.agents/tools/cloud-onboarding-provider.mjs +228 -0
- package/templates/.agents/tools/cloud-onboarding-provider.test.mjs +144 -0
- package/templates/.agents/tools/cloud-onboarding-recovery.test.mjs +306 -0
- package/templates/.agents/tools/cloud-onboarding-ssh.mjs +223 -0
- package/templates/.agents/tools/cloud-onboarding-terraform.mjs +80 -0
- package/templates/.agents/tools/cloud-onboarding-test-fixture.mjs +184 -0
- package/templates/.agents/tools/cloud-onboarding-test-fixtures.mjs +117 -0
- package/templates/.agents/tools/cloud-onboarding.mjs +196 -0
- package/templates/.agents/tools/cloud-onboarding.ssh.integration.test.mjs +391 -0
- package/templates/.agents/tools/cloud-onboarding.test.mjs +237 -0
- package/templates/.agents/tools/cloud-runner-arguments.mjs +37 -0
- package/templates/.agents/tools/cloud-runner-dns.mjs +234 -11
- package/templates/.agents/tools/cloud-runner-dns.test.mjs +256 -0
- package/templates/.agents/tools/cloud-runner-process.mjs +61 -0
- package/templates/.agents/tools/cloud-runner-process.test.mjs +43 -0
- package/templates/.agents/tools/cloud-runner.integration.test.mjs +19 -3
- package/templates/.agents/tools/cloud-runner.mjs +49 -169
- package/templates/.agents/tools/cloud-runner.test.mjs +7 -42
- package/templates/.agents/tools/historical-local-archive.mjs +89 -0
- package/templates/.agents/tools/infisical-bootstrap-windows.test.mjs +12 -0
- package/templates/.agents/tools/infisical-bootstrap.mjs +240 -0
- package/templates/.agents/tools/infisical-bootstrap.test-support.mjs +39 -0
- package/templates/.agents/tools/infisical-bootstrap.test.mjs +193 -0
- package/templates/.agents/tools/infisical-policy.mjs +134 -0
- package/templates/.agents/tools/infisical-runner.mjs +349 -0
- package/templates/.agents/tools/infisical-runner.test.mjs +266 -0
- package/templates/.agents/tools/mcp/infra/cloudflare/README.md +3 -17
- package/templates/.agents/tools/mcp/infra/cloudflare/manifest.yaml +6 -10
- package/templates/.agents/tools/repository-cloud-boundary.test.mjs +41 -0
- package/templates/.agents/tools/repository-policy.mjs +257 -0
- package/templates/.agents/tools/repository-profile.mjs +116 -0
- package/templates/.agents/tools/repository-profile.test.mjs +67 -0
- package/templates/.agents/tools/secret-inventory.mjs +150 -0
- package/templates/.agents/tools/secret-inventory.test.mjs +60 -0
- package/templates/.agents/tools/visual-intake/cli.mjs +72 -0
- package/templates/.agents/tools/visual-intake/fs.mjs +137 -0
- package/templates/.agents/tools/visual-intake/lock.mjs +98 -0
- package/templates/.agents/tools/visual-intake/report.mjs +69 -0
- package/templates/.agents/tools/visual-intake/runtime.mjs +330 -0
- package/templates/.agents/tools/visual-intake/schema.mjs +235 -0
- package/templates/.agents/tools/visual-intake/transaction.mjs +206 -0
- package/templates/.agents/tools/visual-url/browser-cdp.mjs +167 -0
- package/templates/.agents/tools/visual-url/browser-page-evidence.mjs +111 -0
- package/templates/.agents/tools/visual-url/browser-proxy.mjs +194 -0
- package/templates/.agents/tools/visual-url/browser-rendered-sample.mjs +312 -0
- package/templates/.agents/tools/visual-url/browser-source.mjs +398 -0
- package/templates/.agents/tools/visual-url/capture.mjs +119 -0
- package/templates/.agents/tools/visual-url/captured-visual.mjs +301 -0
- package/templates/.agents/tools/visual-url/cli.mjs +29 -0
- package/templates/.agents/tools/visual-url/color-candidates.mjs +161 -0
- package/templates/.agents/tools/visual-url/colors.mjs +98 -0
- package/templates/.agents/tools/visual-url/contrast.mjs +40 -0
- package/templates/.agents/tools/visual-url/css-sample.mjs +109 -0
- package/templates/.agents/tools/visual-url/design-lint.mjs +83 -0
- package/templates/.agents/tools/visual-url/design-score.mjs +217 -0
- package/templates/.agents/tools/visual-url/failure.mjs +56 -0
- package/templates/.agents/tools/visual-url/files.mjs +176 -0
- package/templates/.agents/tools/visual-url/generated-tokens.mjs +369 -0
- package/templates/.agents/tools/visual-url/handoff.mjs +85 -0
- package/templates/.agents/tools/visual-url/icon.mjs +110 -0
- package/templates/.agents/tools/visual-url/local-source.mjs +63 -0
- package/templates/.agents/tools/visual-url/parser.mjs +288 -0
- package/templates/.agents/tools/visual-url/policy.mjs +201 -0
- package/templates/.agents/tools/visual-url/proposal-markdown.mjs +39 -0
- package/templates/.agents/tools/visual-url/proposal.mjs +388 -0
- package/templates/.agents/tools/visual-url/report.mjs +305 -0
- package/templates/.agents/tools/visual-url/runtime.mjs +218 -0
- package/templates/.agents/tools/visual-url/safe-visual-value.mjs +49 -0
- package/templates/.agents/tools/visual-url/transport.mjs +187 -0
- package/templates/.agents/tools/visual-url/visual-model.mjs +393 -0
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/06-execucao.md +1 -1
- package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +1 -1
- package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +2 -2
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +60 -18
- package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +8 -0
- package/templates/.agents/zaip-aios/guides/27-telemetria-git-native.md +2 -2
- package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +2 -2
- package/templates/infra/terraform/README.md +2 -0
- package/templates/infra/terraform/infisical.tf +57 -0
- package/templates/infra/terraform/terraform.tfvars.example +5 -0
- package/templates/infra/terraform/variables.tf +1 -1
- package/templates/scripts/validate-cloud-hostinger-contract.mjs +4 -1
- package/templates/template-manifest.json +3848 -1119
- package/templates/.agents/architecture/hostinger-cloudflare-terraform.md +0 -90
- package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-uR-asJv_.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-1gE8RHel.js +0 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-B0Jwz_rk.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DZhppOIk.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DtLrd13g.js +0 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-kxWwSKin.js +0 -146
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFilters.stories-Chm_dXV7.js +0 -9
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFiltersSpecimen-9CaCbGIZ.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-DQnSS6s9.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Do9sjqiW.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-0W0Gj_Gs.css +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-NrUxok8K.js +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./rolldown-runtime-Bh1tDfsg.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},N={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=N,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),a=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e(r(),1),s=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),c=t(((e,t)=>{t.exports=s()})),l=c(),u=new URL(`/assets/logo_novo_azul-BBx5pA2B.png`,``+import.meta.url).href;function d({filters:e,filtersActive:t=!1,snapshotUpdatedAt:n=null,loading:r,locale:i,onLocaleChange:a,onRefresh:s,repositoryName:c,settings:d,title:p}){let[y,b]=(0,o.useState)(!1),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)(!1),T=i===`pt-BR`?{filters:`Filtros`,language:`Idioma`,refresh:`Atualizar`,refreshing:`Atualizando…`,settings:`Configurações`,updated:`Última Atualização`,waiting:`Atualização indisponível`}:{filters:`Filters`,language:`Language`,refresh:`Refresh`,refreshing:`Refreshing…`,settings:`Settings`,updated:`Last Updated`,waiting:`Update unavailable`},E=n===null?T.waiting:`${T.updated} ${new Intl.DateTimeFormat(i,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(n))}`,D=e=>{a(e),S(!1)},O=c?.includes(`/`)?`https://github.com/${c}`:null;return(0,l.jsxs)(`nav`,{"aria-label":`${c?`${p} ${c}`:p} menu`,className:`dashboard-header`,children:[(0,l.jsxs)(`div`,{className:`dashboard-header-brand`,children:[(0,l.jsxs)(`strong`,{children:[(0,l.jsx)(`span`,{children:p}),c?O?(0,l.jsxs)(`a`,{"aria-label":`Abrir ${c} no GitHub`,className:`dashboard-header-repository`,href:O,rel:`noreferrer`,target:`_blank`,children:[(0,l.jsx)(h,{}),(0,l.jsx)(`span`,{children:c})]}):(0,l.jsxs)(`span`,{className:`dashboard-header-repository`,children:[(0,l.jsx)(h,{}),(0,l.jsx)(`span`,{children:c})]}):null]}),(0,l.jsx)(`small`,{children:E})]}),(0,l.jsx)(`img`,{alt:`ZAIP`,className:`dashboard-header-logo`,src:u}),(0,l.jsxs)(`div`,{className:`dashboard-header-actions`,children:[(0,l.jsx)(`button`,{"aria-label":T.refresh,className:`dashboard-header-icon dashboard-header-refresh`,disabled:r,onClick:s,type:`button`,children:(0,l.jsx)(m,{})}),(0,l.jsxs)(`div`,{className:`dashboard-header-anchor dashboard-header-filter-action`,children:[(0,l.jsxs)(`button`,{className:`dashboard-header-button${y||t?` is-active`:``}`,onClick:()=>{b(e=>!e),S(!1),w(!1)},type:`button`,children:[(0,l.jsx)(g,{}),` `,T.filters]}),y?(0,l.jsx)(`div`,{className:`dashboard-header-popup dashboard-header-filter-popup`,children:e}):null]}),(0,l.jsxs)(`div`,{className:`dashboard-header-anchor dashboard-header-locale-action`,children:[(0,l.jsxs)(`button`,{className:`dashboard-header-button${x?` is-active`:``}`,onClick:()=>{S(e=>!e),b(!1),w(!1)},type:`button`,children:[(0,l.jsx)(f,{locale:i}),i===`pt-BR`?`PT-BR`:`EN-US`,(0,l.jsx)(_,{})]}),x?(0,l.jsxs)(`div`,{className:`dashboard-header-popup dashboard-header-locale-popup`,children:[(0,l.jsxs)(`button`,{onClick:()=>D(`pt-BR`),type:`button`,children:[(0,l.jsx)(f,{locale:`pt-BR`}),` Português do Brasil`,i===`pt-BR`?(0,l.jsx)(`span`,{children:`✓`}):null]}),(0,l.jsxs)(`button`,{onClick:()=>D(`en-US`),type:`button`,children:[(0,l.jsx)(f,{locale:`en-US`}),` English`,i===`en-US`?(0,l.jsx)(`span`,{children:`✓`}):null]})]}):null]}),d===void 0?null:(0,l.jsxs)(`div`,{className:`dashboard-header-anchor dashboard-header-settings-action`,children:[(0,l.jsx)(`button`,{"aria-label":T.settings,className:`dashboard-header-icon${C?` is-active`:``}`,onClick:()=>{w(e=>!e),b(!1),S(!1)},type:`button`,children:(0,l.jsx)(v,{})}),C?(0,l.jsxs)(`div`,{className:`dashboard-header-popup dashboard-header-settings-popup`,children:[(0,l.jsxs)(`div`,{className:`dashboard-header-mobile-settings`,children:[(0,l.jsx)(`small`,{children:E}),(0,l.jsxs)(`button`,{disabled:r,onClick:s,type:`button`,children:[(0,l.jsx)(m,{}),` `,r?T.refreshing:T.refresh]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:T.language}),(0,l.jsxs)(`select`,{onChange:e=>a(e.target.value),value:i,children:[(0,l.jsx)(`option`,{value:`pt-BR`,children:`Português do Brasil`}),(0,l.jsx)(`option`,{value:`en-US`,children:`English`})]})]}),(0,l.jsxs)(`div`,{className:`dashboard-header-mobile-filters`,children:[(0,l.jsx)(`strong`,{children:T.filters}),e]})]}),(0,l.jsx)(`div`,{className:`dashboard-header-settings-content`,children:d})]}):null]})]})]})}function f({locale:e}){return e===`pt-BR`?(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-flag`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,l.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,l.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-flag`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,l.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,l.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`})]})}function p({children:e,className:t=``}){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-svg ${t}`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:e})}function m(){return(0,l.jsxs)(p,{children:[(0,l.jsx)(`path`,{d:`M21 12a9 9 0 0 1-15.2 6.5L3 16`}),(0,l.jsx)(`path`,{d:`M3 21v-5h5`}),(0,l.jsx)(`path`,{d:`M3 12a9 9 0 0 1 15.2-6.5L21 8`}),(0,l.jsx)(`path`,{d:`M21 3v5h-5`})]})}function h(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-github`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`M12 2C6.48 2 2 6.58 2 12.23c0 4.52 2.87 8.35 6.84 9.71.5.1.68-.22.68-.49 0-.24-.01-1.05-.02-1.9-2.78.62-3.37-1.2-3.37-1.2-.45-1.18-1.11-1.49-1.11-1.49-.91-.64.07-.63.07-.63 1 .07 1.53 1.06 1.53 1.06.9 1.57 2.34 1.12 2.91.86.09-.66.35-1.12.64-1.37-2.22-.26-4.56-1.14-4.56-5.06 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.71 0 0 .84-.28 2.75 1.05A9.32 9.32 0 0 1 12 6.97c.85 0 1.7.12 2.5.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.41.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.93-2.34 4.79-4.57 5.05.36.32.68.94.68 1.9 0 1.38-.01 2.49-.01 2.83 0 .27.18.59.69.49A10.25 10.25 0 0 0 22 12.23C22 6.58 17.52 2 12 2Z`,fill:`currentColor`})})}function g(){return(0,l.jsx)(p,{children:(0,l.jsx)(`path`,{d:`M3 6h18M7 12h10m-7 6h4`})})}function _(){return(0,l.jsx)(p,{className:`dashboard-header-chevron`,children:(0,l.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function v(){return(0,l.jsxs)(p,{children:[(0,l.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.09a2 2 0 0 1 1 1.74v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}var y=a();function b({rows:e,columns:t,rowKey:n,onRowClick:r,defaultSort:i=null,sortable:a=!1,showColumnInfo:s=!1,scrollLabel:c,locale:u=`pt-BR`,pageSize:d=100,emptyMessage:f=u===`pt-BR`?`Nenhum dado disponível.`:`No data available.`}){let[p,m]=(0,o.useState)(i),[h,g]=(0,o.useState)(0),[_,v]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(_===null)return;let e=()=>v(null);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[_]);let b=(0,o.useMemo)(()=>t.filter(e=>!e.hidden),[t]),T=(0,o.useMemo)(()=>{if(p===null)return e;let n=t.find(e=>e.key===p.key);return n?[...e].sort((e,t)=>{let r=C(n.sortValue?.(e)??S(n.render(e)),n.sortValue?.(t)??S(n.render(t)));return p.direction===`asc`?r:-r}):e},[t,e,p]),E=d===null||d<=0?1:Math.max(1,Math.ceil(T.length/d)),D=Math.min(h,E-1),O=d===null||d<=0?T:T.slice(D*d,(D+1)*d);return(0,o.useEffect)(()=>g(0),[]),e.length===0?(0,l.jsx)(`p`,{className:`ui-empty`,children:f}):(0,l.jsxs)(`section`,{"aria-label":c,className:`ui-table-wrap`,role:c?`region`:void 0,tabIndex:c?0:void 0,children:[(0,l.jsxs)(`table`,{className:`ui-table`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsx)(`tr`,{children:b.map(e=>(0,l.jsx)(`th`,{"aria-sort":p?.key===e.key?p.direction===`asc`?`ascending`:`descending`:`none`,className:e.align===`right`?`is-number`:void 0,children:e.label&&(a||s)?(0,l.jsxs)(`span`,{className:`ui-table-heading`,children:[(0,l.jsx)(`span`,{className:`ui-table-label`,children:e.label}),a?(0,l.jsx)(`button`,{"aria-label":u===`pt-BR`?`Ordenar por ${e.label}`:`Sort by ${e.label}`,className:`ui-table-sort`,onClick:()=>m(t=>({key:e.key,direction:t?.key===e.key&&t.direction===`asc`?`desc`:`asc`})),type:`button`,children:(0,l.jsx)(`span`,{"aria-hidden":`true`,className:`ui-table-sort-indicator`,children:p?.key===e.key?p.direction===`asc`?`↑`:`↓`:`↕`})}):null,s?(0,l.jsx)(`button`,{"aria-label":u===`pt-BR`?`Informação sobre ${e.label}`:`Information about ${e.label}`,className:`ui-table-info`,onBlur:()=>v(null),onFocus:t=>x(t.currentTarget,e.description??w(e.label,u),v),onMouseEnter:t=>x(t.currentTarget,e.description??w(e.label,u),v),onMouseLeave:()=>v(null),type:`button`,children:`i`}):null]}):e.label},e.key))})}),(0,l.jsx)(`tbody`,{children:O.map(e=>(0,l.jsx)(`tr`,{className:r===void 0?void 0:`ui-table-row-action`,onClick:r===void 0?void 0:()=>r(e),onKeyDown:r===void 0?void 0:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))},tabIndex:r===void 0?void 0:0,children:b.map(t=>(0,l.jsx)(`td`,{className:t.align===`right`?`is-number`:void 0,children:t.render(e)},t.key))},n(e)))}),b.some(e=>e.footer!==void 0)?(0,l.jsx)(`tfoot`,{children:(0,l.jsx)(`tr`,{children:b.map(e=>(0,l.jsx)(`td`,{className:e.align===`right`?`is-number`:void 0,children:e.footer},e.key))})}):null]}),E>1?(0,l.jsxs)(`nav`,{"aria-label":u===`pt-BR`?`Paginação da tabela`:`Table pagination`,className:`ui-table-pagination`,children:[(0,l.jsx)(`button`,{disabled:D===0,onClick:()=>g(e=>Math.max(0,e-1)),type:`button`,children:u===`pt-BR`?`Anterior`:`Previous`}),(0,l.jsxs)(`span`,{children:[u===`pt-BR`?`Página`:`Page`,` `,D+1,` / `,E]}),(0,l.jsx)(`button`,{disabled:D+1>=E,onClick:()=>g(e=>Math.min(E-1,e+1)),type:`button`,children:u===`pt-BR`?`Próxima`:`Next`})]}):null,_&&typeof document<`u`?(0,y.createPortal)((0,l.jsx)(`div`,{className:`ui-table-tooltip`,role:`tooltip`,style:{bottom:_.bottom,left:_.left,top:_.top},children:_.text}),document.body):null]})}function x(e,t,n){let r=e.getBoundingClientRect();n({text:t,left:Math.min(Math.max(r.left+r.width/2,176),window.innerWidth-176),...window.innerHeight-r.bottom<260?{bottom:window.innerHeight-r.top+9}:{top:r.bottom+9}})}function S(e){return typeof e==`number`||typeof e==`string`?e:Array.isArray(e)?e.map(S).filter(Boolean).join(` `):e&&typeof e==`object`&&`props`in e?S(e.props?.children??null):null}function C(e,t){return e===null?t===null?0:1:t===null?-1:typeof e==`number`&&typeof t==`number`?e-t:new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare(String(e),String(t))}function w(e,t){let n=e.toLocaleLowerCase(t);return t===`pt-BR`?`Mostra ${n} para cada linha. Clique no título para ordenar em ordem crescente ou decrescente.`:`Shows ${n} for each row. Click the column title to sort in ascending or descending order.`}function T(e,t=`pt-BR`){return e===null?`0`:e>=36e5?`${new Intl.NumberFormat(t,{maximumFractionDigits:1}).format(e/36e5)} h`:e>=6e4?`${Math.round(e/6e4)} min`:`${Math.round(e/1e3)} ${t===`pt-BR`?`seg`:`sec`}`}function E(e,t=`pt-BR`){return e===null?`0`:e<36e5?T(e,t):`${new Intl.NumberFormat(t,{maximumFractionDigits:1}).format(e/36e5)} h`}function D(e,t=`pt-BR`,n=1){if(e===null)return`0`;let r=[{threshold:0x38d7ea4c68000,suffix:`Q`},{threshold:0xe8d4a51000,suffix:`T`},{threshold:1e9,suffix:`B`},{threshold:1e6,suffix:`M`},{threshold:1e3,suffix:`mil`}].find(({threshold:t})=>Math.abs(e)>=t);return r?`${new Intl.NumberFormat(t,{maximumFractionDigits:n}).format(e/r.threshold)} ${r.suffix}`:new Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:n}).format(e)}function O(e,t=`pt-BR`,n){return e===null?`0`:new Intl.NumberFormat(t,{maximumFractionDigits:n}).format(e)}function k(e,t,n=`pt-BR`){return e===null?`0`:new Intl.NumberFormat(n,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function A(e,t=`pt-BR`){return e===null?t===`pt-BR`?`indisponível`:`unavailable`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(e))}function j(e,t=`pt-BR`){return new Intl.NumberFormat(t,{style:`percent`,maximumFractionDigits:1}).format(e)}function ee({ariaLabel:e,metrics:t}){return(0,l.jsx)(`section`,{"aria-label":e,className:`period-average-summary`,children:(0,l.jsx)(`div`,{className:`period-average-grid`,children:t.map(e=>(0,l.jsxs)(`article`,{children:[(0,l.jsx)(`span`,{children:e.label}),(0,l.jsx)(`strong`,{children:e.value})]},e.label))})})}function M(e,t){return e===null?`0`:e===0?t===`pt-BR`?`0 seg`:`0 sec`:T(e,t)}function te(e){if(typeof e.source_duration_ms==`number`&&e.source_duration_ms>=0)return e.source_duration_ms;let t=e.duration_provenance;return typeof e.duration_ms==`number`&&e.duration_ms>=0&&(t===`observed`||t===`reconciled`||t===`legacy_inferred`)?e.duration_ms:null}function ne(e,t){return e.provenance===`in_progress`?t===`pt-BR`?`Em andamento`:`In progress`:e.durationMs===null||e.provenance===`unavailable`?t===`pt-BR`?`Sem atribuição temporal`:`No temporal attribution`:M(e.durationMs,t)}function re(e){let t=te(e);if(t!==null)return{durationMs:t,provenance:`factual`};if(e.status===`running`)return{durationMs:null,provenance:`in_progress`};let n=ie({...e,status:e.status??``});return n==null?{durationMs:null,provenance:`unavailable`}:{durationMs:n,provenance:`lifecycle_elapsed`}}function N(e){if(e.started_at===null||e.finished_at===null)return null;let t=Date.parse(e.started_at),n=Date.parse(e.finished_at);return Number.isFinite(t)&&Number.isFinite(n)&&n>=t?n-t:null}function ie(e){if([`completed`,`failed`,`cancelled`].includes(e.status))return N(e)}function ae(e,t){return e===void 0?`—`:M(e,t)}function oe({details:e,locale:t,onClose:n}){let r=I(t),i=e.kind===`change`||e.kind===`decision`?e.row.title:e.row.id;return(0,y.createPortal)((0,l.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>e.currentTarget===e.target&&n(),open:!0,children:(0,l.jsxs)(`section`,{"aria-label":`${r.details} ${fe(e.kind,t)}`,"aria-modal":`true`,className:`operations-status-dialog operations-entity-details`,role:`dialog`,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:fe(e.kind,t)}),(0,l.jsx)(`h2`,{children:i}),(0,l.jsx)(`p`,{children:e.row.id})]}),(0,l.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,onClick:n,type:`button`,children:`×`})]}),(0,l.jsxs)(`div`,{className:`operations-entity-details-scroll`,children:[e.kind===`change`?(0,l.jsx)(P,{locale:t,row:e.row}):null,e.kind===`decision`?(0,l.jsx)(F,{locale:t,row:e.row}):null,e.kind===`execution`?(0,l.jsx)(se,{locale:t,row:e.row}):null,e.kind===`run`?(0,l.jsx)(ce,{locale:t,row:e.row}):null]})]})}),document.body)}function P({row:e,locale:t}){let n=I(t);return(0,l.jsx)(le,{items:[[n.status,e.status],[n.risk,e.risk],[n.origin,ue(e.source)],[n.created,A(e.created_at,t)],[n.tasks,String(e.task_ids.length)],[n.requirements,de(e.requirement_ids)],[n.acceptanceCriteria,de(e.acceptance_ids)],[n.result,e.result??`—`],[n.file,e.artifact_path]]})}function F({row:e,locale:t}){let n=I(t);return(0,l.jsx)(le,{items:[[n.origin,e.origin],[n.scopeType,e.scope_type],[n.scope,e.scope_id],[n.created,A(e.created_at,t)],[n.file,e.artifact_path]]})}function se({row:e,locale:t}){let n=I(t);return(0,l.jsx)(le,{items:[[n.status,e.status],[n.workStatus,e.work_status],[n.origin,ue(e.origin)],[n.created,A(e.created_at,t)],[n.tasksInDag,String(e.dag.nodes.length)],[t===`pt-BR`?`Invocações do orquestrador`:`Orchestrator invocations`,String(e.orchestrator_run_count)],[t===`pt-BR`?`Invocações delegadas`:`Delegated invocations`,String(e.subagent_run_count)],[t===`pt-BR`?`Tasks finalizadas`:`Finalized Tasks`,`${e.finalized_task_count}/${e.task_count} (${e.finalizer_run_count} ${t===`pt-BR`?`chamadas finalizadoras`:`finalizer calls`})`],[n.topologicalOrder,de(e.dag.topological_order)],[n.dependencies,e.dag.nodes.map(e=>`${e.task_id}: ${de(e.depends_on)}`).join(`
|
|
2
|
-
`)||`—`],[n.result,e.result??`—`],[n.file,e.artifact_path]]})}function ce({row:e,locale:t}){let n=I(t);return(0,l.jsx)(le,{items:[[n.status,e.status],[n.phase,e.phase],[n.entrypoint,e.entrypoint],[n.type,e.work_type],[t===`pt-BR`?`Tipo da chamada`:`Call type`,e.run_kind===`run`?t===`pt-BR`?`Invocação do orquestrador`:`Orchestrator invocation`:t===`pt-BR`?`Invocação delegada`:`Delegated invocation`],[t===`pt-BR`?`Propósito`:`Purpose`,e.run_purpose],[t===`pt-BR`?`Exige finalizador`:`Requires finalizer`,e.requires_finalizer?`sim`:`não`],[t===`pt-BR`?`Invocação pai`:`Parent invocation`,e.parent_run_id??`—`],[n.client,e.client],[n.agent,e.agent_name],[n.provider,e.provider??`—`],[t===`pt-BR`?`Modelo planejado`:`Planned model`,e.model],[t===`pt-BR`?`Effort planejado`:`Planned effort`,e.reasoning_effort??`—`],[t===`pt-BR`?`Modelo efetivo`:`Effective model`,e.effective_config_mixed?t===`pt-BR`?`Misto`:`Mixed`:e.effective_model??`—`],[t===`pt-BR`?`Effort efetivo`:`Effective effort`,e.effective_config_mixed?t===`pt-BR`?`Misto`:`Mixed`:e.effective_reasoning_effort??`—`],[`Task`,e.task_id??`—`],[`SPEC`,e.spec_id??`—`],[`PRD`,e.prd_id??`—`],[`Change`,e.change_id??`—`],[`Execution`,e.execution_id??`—`],[n.start,A(e.started_at,t)],[n.end,A(e.finished_at,t)],[n.duration,M(te(e),t)],[n.lifecycleElapsed,ae(ie(e),t)],[`Tokens`,D(e.usage.total.tokens.total,t)],[n.costBrl,k(e.usage.total.cost.brl,`BRL`,t)],[n.costUsd,k(e.usage.total.cost.usd,`USD`,t)],[n.file,e.artifact_path]]})}function le({items:e}){return(0,l.jsx)(`dl`,{className:`operations-entity-detail-grid`,children:e.map(([e,t])=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`dt`,{children:e}),(0,l.jsx)(`dd`,{children:t})]},e))})}function ue(e){return e.type===`task`?`Task: ${e.task_id}`:e.type===`spec`?`SPEC: ${e.spec_id}`:e.type===`interaction`?`Conversation: ${e.conversation_id}`:`PRD: ${e.prd_id}${`spec_id`in e&&e.spec_id?` · SPEC: ${e.spec_id}`:``}`}function de(e){return e.length===0?`—`:e.join(`, `)}function fe(e,t){return(t===`pt-BR`?{change:`Mudança`,decision:`Decisão`,execution:`Execução ZAIP`,run:`Invocação de Agente`}:{change:`Change`,decision:`Decision`,execution:`Execution`,run:`Agent Invocation`})[e]}function I(e){return e===`pt-BR`?{details:`Detalhes de`,status:`Status`,risk:`Risco`,origin:`Origem`,created:`Criada`,tasks:`Tasks`,requirements:`Requisitos`,acceptanceCriteria:`Critérios de aceite`,result:`Resultado`,file:`Arquivo`,scopeType:`Tipo de escopo`,scope:`Escopo`,workStatus:`Status do trabalho`,tasksInDag:`Tasks na DAG`,topologicalOrder:`Ordem topológica`,dependencies:`Dependências`,phase:`Fase`,entrypoint:`Entrada`,type:`Tipo`,client:`Cliente`,agent:`Agente`,provider:`Provider`,model:`Modelo`,start:`Início`,end:`Fim`,duration:`Tempo`,lifecycleElapsed:`Tempo decorrido`,costBrl:`Custo BRL`,costUsd:`Custo USD`}:{details:`Details for`,status:`Status`,risk:`Risk`,origin:`Origin`,created:`Created`,tasks:`Tasks`,requirements:`Requirements`,acceptanceCriteria:`Acceptance criteria`,result:`Result`,file:`File`,scopeType:`Scope type`,scope:`Scope`,workStatus:`Work status`,tasksInDag:`Tasks in DAG`,topologicalOrder:`Topological order`,dependencies:`Dependencies`,phase:`Phase`,entrypoint:`Entrypoint`,type:`Type`,client:`Client`,agent:`Agent`,provider:`Provider`,model:`Model`,start:`Start`,end:`End`,duration:`Time`,lifecycleElapsed:`Elapsed time`,costBrl:`Cost BRL`,costUsd:`Cost USD`}}function pe(e,t){let n=e.filter(e=>e.kind===`interaction`&&e.origin.type===`interaction`),r=new Map;for(let e of n){let t=e.origin.type===`interaction`?e.origin.conversation_id:``;r.set(t,[...r.get(t)??[],e])}return[...r].map(([e,n])=>{let r=new Set(n.map(e=>e.id)),i=[...new Map(t.filter(t=>t.conversation_id===e||r.has(t.execution_id??``)).map(e=>[e.id,e])).values()],a=[...n.map(e=>e.created_at),...i.map(e=>e.started_at)].filter(e=>e!==null).sort().at(-1)??``,o=i.filter(e=>e.run_kind!==`subrun`&&e.parent_run_id==null).map(e=>re(e)),s=o.flatMap(({durationMs:e,provenance:t})=>t===`factual`&&e!==null?[e]:[]),c=o.flatMap(({durationMs:e,provenance:t})=>t===`lifecycle_elapsed`&&e!==null?[e]:[]),l=e=>{let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)},u=[...n].sort((e,t)=>(t.created_at??``).localeCompare(e.created_at??``))[0],d=i.map(e=>e.lifecycle_elapsed_ms).find(e=>e!==void 0),f=s.length>0?`factual`:c.length>0?`lifecycle_elapsed`:`unavailable`;return{id:e,latest_started_at:a??``,run_count:i.length,execution_count:n.length,status:u.status,duration_ms:s.length>0?s.reduce((e,t)=>e+t,0):c.length>0?c.reduce((e,t)=>e+t,0):null,duration_provenance:f,total_tokens:l(i.map(e=>e.usage?.total.tokens.total??null)),cost_brl:l(i.map(e=>e.usage?.total.cost.brl??null)),models:R(i.flatMap(e=>me(e.effective_model??e.model))),reasoning_efforts:R(i.flatMap(e=>me(e.effective_reasoning_effort??e.reasoning_effort))),...d===void 0?{}:{lifecycle_elapsed_ms:L(u.status)&&typeof d==`number`?d:null}}}).sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function L(e){return e===`completed`||e===`failed`||e===`cancelled`}function R(e){return[...new Set(e.filter(he))].sort()}function me(e){return typeof e==`string`?e.split(`,`).map(e=>e.trim()):[]}function he(e){return e!==``&&e.toLowerCase()!==`unknown`}function ge(e,t){return e.map((e,n)=>({row:e,index:n,timestamp:Date.parse(t(e)??``)})).sort((e,t)=>{let n=Number.isFinite(e.timestamp)?e.timestamp:-1/0;return(Number.isFinite(t.timestamp)?t.timestamp:-1/0)-n||e.index-t.index}).map(({row:e})=>e)}function _e({status:e}){return(0,l.jsx)(`span`,{className:`operations-table-status is-${e}`,children:e})}function z({risk:e}){return(0,l.jsx)(`span`,{className:`operations-table-risk is-${e}`,children:e})}function ve({entrypoint:e}){let t=e===`prd`?`PRD`:e===`spec`?`SPEC`:e===`task`?`Tarefa`:`Conversa`;return(0,l.jsx)(`span`,{className:`operations-table-entry is-${e}`,children:t})}function B({origin:e}){return(0,l.jsx)(`span`,{className:`operations-table-decision-origin is-${e}`,children:e})}function ye({scopeType:e}){let t=e===`change`?`planning`:`execution`;return(0,l.jsx)(`span`,{className:`operations-table-stage is-${t}`,children:t===`planning`?`Planejamento`:`Execução`})}function V({rows:e,locale:t}){let[n,r]=(0,o.useState)(null);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{columns:[{key:`date`,label:`Data de criação`,render:e=>A(e.created_at)},{key:`title`,label:`Decisão`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`small`,{children:e.id})]})},{key:`origin`,label:`Origem`,render:e=>(0,l.jsx)(B,{origin:e.origin})},{key:`stage`,label:`Fase`,render:e=>(0,l.jsx)(ye,{scopeType:e.scope_type})},{key:`scope`,label:`Escopo`,render:e=>`${e.scope_type}: ${e.scope_id}`}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:ge(e,e=>e.created_at),showColumnInfo:!0,sortable:!0}),n?(0,l.jsx)(oe,{details:{kind:`decision`,row:n},locale:t,onClose:()=>r(null)}):null]})}function be({rows:e,locale:t}){let[n,r]=(0,o.useState)(null);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{columns:[{key:`created`,label:`Criada`,render:e=>A(e.created_at)},{key:`title`,label:`Change`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>(0,l.jsx)(_e,{status:e.status})},{key:`risk`,label:`Risco`,render:e=>(0,l.jsx)(z,{risk:e.risk})},{key:`tasks`,label:`Tasks`,render:e=>e.task_ids.length,align:`right`},{key:`path`,label:`Arquivo`,render:e=>e.artifact_path}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:ge(e,e=>e.created_at),showColumnInfo:!0,sortable:!0}),n?(0,l.jsx)(oe,{details:{kind:`change`,row:n},locale:t,onClose:()=>r(null)}):null]})}function xe({rows:e,locale:t,canonical:n=!0}){let[r,i]=(0,o.useState)(null),[a,s]=(0,o.useState)(`all`);if(!n||!ke(e))return(0,l.jsx)(H,{locale:t,kind:`executions`});let c=ge(e.filter(e=>a===`all`||e.kind===a),e=>e.created_at);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`operations-execution-table`,children:[(0,l.jsx)(`div`,{className:`operations-toolbar operations-run-kind-toolbar`,children:(0,l.jsx)(`nav`,{"aria-label":t===`pt-BR`?`Tipo de execução`:`Execution type`,children:[`all`,`interaction`,`delivery`].map(e=>(0,l.jsx)(`button`,{className:a===e?`is-active`:void 0,onClick:()=>s(e),type:`button`,children:Se(e,t)},e))})}),(0,l.jsx)(b,{columns:[{key:`created`,label:`Data de criação`,render:e=>A(e.created_at)},{key:`id`,label:t===`pt-BR`?`Execução`:`Execution`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:Se(e.kind??`delivery`,t)}),(0,l.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>(0,l.jsx)(_e,{status:e.status})},{key:`origin`,label:`Origem`,render:e=>(0,l.jsx)(ve,{entrypoint:e.origin.type===`interaction`?`conversation`:e.origin.type})},{key:`duration`,label:t===`pt-BR`?`Tempo`:`Time`,render:e=>ne({durationMs:e.duration_ms,provenance:e.duration_ms===null&&e.status===`running`?`in_progress`:`factual`},t),align:`right`},{key:`tokens`,label:`Tokens`,render:e=>D(e.total_tokens??null,t),align:`right`},{key:`cost`,label:t===`pt-BR`?`Custo`:`Cost`,render:e=>k(e.cost_brl??null,`BRL`,t),align:`right`},{key:`runs`,label:t===`pt-BR`?`Invocações do orquestrador`:`Orchestrator invocations`,render:e=>Ce(e.orchestrator_run_count),align:`right`},{key:`finalizers`,label:t===`pt-BR`?`Finalizadores`:`Finalizers`,render:e=>`${Ce(e.finalized_task_count)}/${Ce(e.task_count)}`,align:`right`},{key:`tasks`,label:t===`pt-BR`?`Tarefas`:`Tasks`,render:e=>Ce(e.task_count),align:`right`},{key:`specs`,label:`SPEC`,render:e=>Ce(e.spec_count),align:`right`},{key:`prds`,label:`PRD`,render:e=>Ce(e.prd_count),align:`right`}],locale:t,rowKey:e=>e.id,onRowClick:i,rows:c,showColumnInfo:!0,sortable:!0})]}),r?(0,l.jsx)(oe,{details:{kind:`execution`,row:r},locale:t,onClose:()=>i(null)}):null]})}function Se(e,t){return t===`pt-BR`?e===`all`?`Todas`:e===`interaction`?`Interações`:`Execuções de entrega`:e===`all`?`All`:e===`interaction`?`Interactions`:`Delivery executions`}function Ce(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0}function we(e){return e.agent.toLowerCase()===`codex`?`codex`:e.agent_name||e.agent||`—`}function Te(e){return(e.parent_run_id??e.task_id??e.conversation_id)||`—`}function Ee({rows:e,locale:t}){let[n,r]=(0,o.useState)(null),[i,a]=(0,o.useState)(`all`),s=ge(e.filter(e=>i===`all`||e.run_kind===i),e=>e.started_at),c=e=>e==null?`—`:new Intl.NumberFormat(t,{maximumFractionDigits:3}).format(e),u=e=>e==null?`—`:`${c(e)} / 1M`,d=e=>e==null?`—`:`${c(e)}×`,f=e=>e==null?`—`:k(e,`USD`,t),p=e=>e===`observed`?t===`pt-BR`?`Observada`:`Observed`:e===`reconciled`?t===`pt-BR`?`Reconciliada`:`Reconciled`:e===`estimated`?t===`pt-BR`?`Estimada por tokens`:`Token-estimated`:e===`legacy_inferred`?t===`pt-BR`?`Inferida histórica`:`Legacy inferred`:`—`;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`operations-toolbar operations-run-kind-toolbar`,children:(0,l.jsx)(`nav`,{"aria-label":t===`pt-BR`?`Tipo de chamada de agente`:`Agent call type`,children:[`all`,`run`,`subrun`].map(e=>(0,l.jsx)(`button`,{className:i===e?`is-active`:void 0,onClick:()=>a(e),type:`button`,children:e===`all`?t===`pt-BR`?`Todas`:`All`:e===`run`?t===`pt-BR`?`Invocações do orquestrador`:`Orchestrator invocations`:t===`pt-BR`?`Invocações delegadas`:`Delegated invocations`},e))})}),(0,l.jsx)(b,{columns:[{key:`created`,label:`Data de criação`,render:e=>A(e.started_at)},{key:`id`,label:t===`pt-BR`?`Invocação`:`Agent invocation`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.id}),(0,l.jsx)(`small`,{children:Te(e)})]})},{key:`kind`,label:t===`pt-BR`?`Tipo`:`Type`,render:e=>e.run_kind===`run`?t===`pt-BR`?`Invocação do orquestrador`:`Orchestrator invocation`:t===`pt-BR`?`Invocação delegada`:`Delegated invocation`},{key:`agent`,label:t===`pt-BR`?`Agente`:`Agent`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:we(e)}),(0,l.jsx)(`small`,{children:[e.agent_persona,e.agent_job].filter(Boolean).join(` · `)||`—`})]})},{key:`status`,label:`Status`,render:e=>(0,l.jsx)(_e,{status:e.status})},{key:`origin`,label:t===`pt-BR`?`Origem`:`Origin`,render:e=>(0,l.jsx)(ve,{entrypoint:e.entrypoint})},{key:`phase`,label:t===`pt-BR`?`Propósito`:`Purpose`,render:e=>De(e.run_purpose,t)},{key:`duration`,label:t===`pt-BR`?`Tempo total`:`Total time`,render:e=>ne(re(e),t)},{key:`duration_provenance`,label:t===`pt-BR`?`Fonte do tempo`:`Time source`,render:e=>{let n=re(e);return n.provenance===`lifecycle_elapsed`?t===`pt-BR`?`Tempo decorrido`:`Lifecycle elapsed`:n.provenance===`in_progress`?t===`pt-BR`?`Em andamento`:`In progress`:p(e.duration_provenance)}},{key:`llm_calls`,label:t===`pt-BR`?`Chamadas LLM`:`LLM calls`,render:e=>c(e.llm_call_count??e.call_count),align:`right`},{key:`provider`,label:`Provider`,render:e=>e.provider??`—`},{key:`model`,label:`Modelo`,render:e=>e.model||`—`},{key:`effort`,label:`Effort`,render:e=>e.effective_reasoning_effort??e.reasoning_effort??`—`},{key:`service_tier`,label:t===`pt-BR`?`Velocidade API`:`API speed`,render:e=>e.service_tier??`default`},{key:`input_tokens`,label:`Input`,render:e=>D(e.input_tokens??null,t),align:`right`},{key:`cached_tokens`,label:`Cache`,render:e=>D(e.cached_input_tokens??null,t),align:`right`},{key:`uncached_tokens`,label:t===`pt-BR`?`Input s/ cache`:`Uncached input`,render:e=>D(e.uncached_input_tokens??null,t),align:`right`},{key:`output_tokens`,label:`Output`,render:e=>D(e.output_tokens??null,t),align:`right`},{key:`reasoning_tokens`,label:`Reasoning`,render:e=>D(e.reasoning_tokens??null,t),align:`right`},{key:`tokens`,label:t===`pt-BR`?`Tokens totais`:`Total tokens`,render:e=>D(e.usage.total.tokens.total,t),align:`right`},{key:`input_rate`,label:t===`pt-BR`?`Tarifa input USD`:`Input rate USD`,render:e=>u(e.input_rate_usd_per_million),align:`right`},{key:`cached_rate`,label:t===`pt-BR`?`Tarifa cache USD`:`Cache rate USD`,render:e=>u(e.cached_input_rate_usd_per_million),align:`right`},{key:`output_rate`,label:t===`pt-BR`?`Tarifa output USD`:`Output rate USD`,render:e=>u(e.output_rate_usd_per_million),align:`right`},{key:`context_multiplier`,label:t===`pt-BR`?`Mult. contexto E/S`:`Context mult. I/O`,render:e=>`${d(e.context_input_multiplier)} / ${d(e.context_output_multiplier)}`},{key:`speed_multiplier`,label:t===`pt-BR`?`Mult. velocidade`:`Speed mult.`,render:e=>d(e.speed_cost_multiplier)},{key:`pricing_scenario`,label:t===`pt-BR`?`Cenário de preço`:`Pricing scenario`,render:e=>e.pricing_scenario===`standard_long_context_fallback`?t===`pt-BR`?`Standard (contexto longo)`:`Standard (long context)`:e.pricing_scenario??`—`},{key:`input_cost`,label:t===`pt-BR`?`Custo input USD`:`Input cost USD`,render:e=>f(e.input_cost_usd),align:`right`},{key:`cache_cost`,label:t===`pt-BR`?`Custo cache USD`:`Cache cost USD`,render:e=>f(e.cached_input_cost_usd),align:`right`},{key:`output_cost`,label:t===`pt-BR`?`Custo output USD`:`Output cost USD`,render:e=>f(e.output_cost_usd),align:`right`},{key:`reasoning_cost`,label:t===`pt-BR`?`Custo reasoning USD`:`Reasoning cost USD`,render:e=>f(e.reasoning_cost_usd),align:`right`},{key:`calculated_cost`,label:t===`pt-BR`?`Custo calculado USD`:`Calculated cost USD`,render:e=>f(e.calculated_cost_usd),align:`right`},{key:`canonical_cost`,label:t===`pt-BR`?`Custo canônico USD`:`Canonical cost USD`,render:e=>f(e.cost_usd),align:`right`},{key:`cost_variance`,label:t===`pt-BR`?`Diferença USD`:`Difference USD`,render:e=>f(e.cost_variance_usd),align:`right`},{key:`fx_rate`,label:`USD/BRL`,render:e=>c(e.fx_rate),align:`right`},{key:`cost`,label:t===`pt-BR`?`Custo total BRL`:`Total cost BRL`,render:e=>k(e.usage.total.cost.brl,`BRL`,t),align:`right`}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:s,showColumnInfo:!0,sortable:!0}),n?(0,l.jsx)(oe,{details:{kind:`run`,row:n},locale:t,onClose:()=>r(null)}):null]})}function De(e,t){return t===`pt-BR`?{intake:`Entrada`,orchestration:`Orquestração`,execution:`Execução`,review:`Revisão`,audit:`Auditoria`,finalization:`Finalização`,observation:`Observação`}[e]:e}function Oe({rows:e,executions:t,locale:n,canonical:r=!0}){if(!r||!Ae(t,e))return(0,l.jsx)(H,{locale:n,kind:`conversations`});let i=pe(t,e);return(0,l.jsx)(b,{columns:[{key:`created`,label:n===`pt-BR`?`Data e hora`:`Date and time`,render:e=>A(e.latest_started_at)},{key:`conversation`,label:n===`pt-BR`?`Conversa`:`Conversation`,render:e=>(0,l.jsx)(`strong`,{children:e.id})},{key:`status`,label:`Status`,render:e=>(0,l.jsx)(_e,{status:e.status})},{key:`runs`,label:n===`pt-BR`?`Invocações`:`Invocations`,render:e=>e.run_count,align:`right`},{key:`executions`,label:n===`pt-BR`?`Execuções`:`Executions`,render:e=>e.execution_count,align:`right`},{key:`duration`,label:n===`pt-BR`?`Tempo`:`Time`,render:e=>ne({durationMs:e.duration_ms,provenance:e.duration_ms===null&&e.status===`running`?`in_progress`:e.duration_provenance},n)},{key:`duration_provenance`,label:n===`pt-BR`?`Fonte do tempo`:`Time source`,render:e=>e.duration_provenance===`factual`?`Factual`:e.duration_provenance===`lifecycle_elapsed`?n===`pt-BR`?`Tempo decorrido`:`Lifecycle elapsed`:`—`},{key:`tokens`,label:`Tokens`,render:e=>D(e.total_tokens,n),align:`right`},{key:`cost`,label:n===`pt-BR`?`Custo`:`Cost`,render:e=>k(e.cost_brl,`BRL`,n),align:`right`},{key:`reasoning_efforts`,label:n===`pt-BR`?`Esforços`:`Reasoning efforts`,render:e=>e.reasoning_efforts.length>0?e.reasoning_efforts.join(`, `):`—`},{key:`models`,label:n===`pt-BR`?`Modelos`:`Models`,render:e=>e.models.length>0?e.models.join(`, `):`—`}],locale:n,rowKey:e=>e.id,rows:i,showColumnInfo:!0,sortable:!0})}function ke(e){return e.every(e=>e.id.trim().length>0)}function Ae(e,t){return ke(e)&&e.filter(e=>e.kind===`interaction`&&e.origin.type===`interaction`).every(e=>e.origin.conversation_id.trim().length>0)&&t.every(e=>e.id.trim().length>0&&(e.conversation_id?.trim().length??0)>0)}function H({kind:e,locale:t}){return(0,l.jsx)(`p`,{className:`operations-empty`,role:`status`,children:t===`pt-BR`?`Aguardando linhas canônicas de ${e===`conversations`?`conversas`:`execuções`}.`:`Waiting for canonical ${e} rows.`})}var je;function U(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Me=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ne=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(je=globalThis).__zod_globalConfig??(je.__zod_globalConfig={});var W=globalThis.__zod_globalConfig;function Pe(e){return e&&Object.assign(W,e),W}function Fe(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ie(e,t){return typeof t==`bigint`?t.toString():t}function G(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Le(e){return e==null}function Re(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var ze=Symbol(`evaluating`);function K(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ze)return r===void 0&&(r=ze,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Be(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function q(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ve(e){return JSON.stringify(e)}function He(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ue=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function We(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ge=G(()=>{if(W.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ke(e){if(We(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(We(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function qe(e){return Ke(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Je=new Set([`string`,`number`,`symbol`]);function Ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Xe(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function J(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ze(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function Qe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Xe(e,q(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Be(this,`shape`,e),e},checks:[]}))}function $e(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Xe(e,q(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Be(this,`shape`,r),r},checks:[]}))}function et(e,t){if(!Ke(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Xe(e,q(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Be(this,`shape`,n),n}}))}function tt(e,t){if(!Ke(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Xe(e,q(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Be(this,`shape`,n),n}}))}function nt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Xe(e,q(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Be(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function rt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Xe(t,q(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Be(this,`shape`,i),i},checks:[]}))}function it(e,t,n){return Xe(t,q(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Be(this,`shape`,i),i}}))}function at(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ot(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function st(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ct(e){return typeof e==`string`?e:e?.message}function lt(e,t,n){let r=e.message?e.message:ct(e.inst?._zod.def?.error?.(e))??ct(t?.error?.(e))??ct(n.customError?.(e))??ct(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ut(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function dt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ft=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ie,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},pt=U(`$ZodError`,ft),mt=U(`$ZodError`,ft,{Parent:Error});function ht(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function gt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var _t=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Me;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>lt(e,a,Pe())));throw Ue(t,i?.callee),t}return o.value},vt=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>lt(e,a,Pe())));throw Ue(t,i?.callee),t}return o.value},yt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Me;return a.issues.length?{success:!1,error:new(e??pt)(a.issues.map(e=>lt(e,i,Pe())))}:{success:!0,data:a.value}},bt=yt(mt),xt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>lt(e,i,Pe())))}:{success:!0,data:a.value}},St=xt(mt),Ct=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _t(e)(t,n,i)},wt=e=>(t,n,r)=>_t(e)(t,n,r),Tt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return vt(e)(t,n,i)},Et=e=>async(t,n,r)=>vt(e)(t,n,r),Dt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yt(e)(t,n,i)},Ot=e=>(t,n,r)=>yt(e)(t,n,r),kt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return xt(e)(t,n,i)},At=e=>async(t,n,r)=>xt(e)(t,n,r),jt=/^[cC][0-9a-z]{6,}$/,Mt=/^[0-9a-z]+$/,Nt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Pt=/^[0-9a-vA-V]{20}$/,Ft=/^[A-Za-z0-9]{27}$/,It=/^[a-zA-Z0-9_-]{21}$/,Lt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,zt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Bt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Ht(){return new RegExp(Vt,`u`)}var Ut=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Wt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Gt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jt=/^[A-Za-z0-9_-]*$/,Yt=/^https?$/,Xt=/^\+[1-9]\d{6,14}$/,Zt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Qt=RegExp(`^${Zt}$`);function $t(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function en(e){return RegExp(`^${$t(e)}$`)}function tn(e){let t=$t({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Zt}T(?:${r})$`)}var nn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},rn=/^[^A-Z]*$/,an=/^[^a-z]*$/,on=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sn=U(`$ZodCheckMaxLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Le(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=ut(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cn=U(`$ZodCheckMinLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Le(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ut(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Le(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=ut(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),un=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;on.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),dn=U(`$ZodCheckRegex`,(e,t)=>{un.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fn=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rn,un.init(e,t)}),pn=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=an,un.init(e,t)}),mn=U(`$ZodCheckIncludes`,(e,t)=>{on.init(e,t);let n=Ye(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hn=U(`$ZodCheckStartsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`^${Ye(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),gn=U(`$ZodCheckEndsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`.*${Ye(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_n=U(`$ZodCheckOverwrite`,(e,t)=>{on.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),vn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
-
`))}},yn={major:4,minor:4,patch:3},Y=U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=at(e),i;for(let a of t){if(a._zod.def.when){if(ot(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Me;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=at(e,t))});else{if(e.issues.length===t)continue;r||=at(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(at(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Me;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Me;return o.then(e=>t(e,r,a))}return t(o,r,a)}}K(e,`~standard`,()=>({validate:t=>{try{let n=bt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return St(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),bn=U(`$ZodString`,(e,t)=>{Y.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),X=U(`$ZodStringFormat`,(e,t)=>{un.init(e,t),bn.init(e,t)}),xn=U(`$ZodGUID`,(e,t)=>{t.pattern??=Rt,X.init(e,t)}),Sn=U(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=zt(e)}else t.pattern??=zt();X.init(e,t)}),Cn=U(`$ZodEmail`,(e,t)=>{t.pattern??=Bt,X.init(e,t)}),wn=U(`$ZodURL`,(e,t)=>{X.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Yt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Tn=U(`$ZodEmoji`,(e,t)=>{t.pattern??=Ht(),X.init(e,t)}),En=U(`$ZodNanoID`,(e,t)=>{t.pattern??=It,X.init(e,t)}),Dn=U(`$ZodCUID`,(e,t)=>{t.pattern??=jt,X.init(e,t)}),On=U(`$ZodCUID2`,(e,t)=>{t.pattern??=Mt,X.init(e,t)}),kn=U(`$ZodULID`,(e,t)=>{t.pattern??=Nt,X.init(e,t)}),An=U(`$ZodXID`,(e,t)=>{t.pattern??=Pt,X.init(e,t)}),jn=U(`$ZodKSUID`,(e,t)=>{t.pattern??=Ft,X.init(e,t)}),Mn=U(`$ZodISODateTime`,(e,t)=>{t.pattern??=tn(t),X.init(e,t)}),Nn=U(`$ZodISODate`,(e,t)=>{t.pattern??=Qt,X.init(e,t)}),Pn=U(`$ZodISOTime`,(e,t)=>{t.pattern??=en(t),X.init(e,t)}),Fn=U(`$ZodISODuration`,(e,t)=>{t.pattern??=Lt,X.init(e,t)}),In=U(`$ZodIPv4`,(e,t)=>{t.pattern??=Ut,X.init(e,t),e._zod.bag.format=`ipv4`}),Ln=U(`$ZodIPv6`,(e,t)=>{t.pattern??=Wt,X.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Rn=U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Gt,X.init(e,t)}),zn=U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Kt,X.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Bn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Vn=U(`$ZodBase64`,(e,t)=>{t.pattern??=qt,X.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Bn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Hn(e){if(!Jt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Bn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Un=U(`$ZodBase64URL`,(e,t)=>{t.pattern??=Jt,X.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Hn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Wn=U(`$ZodE164`,(e,t)=>{t.pattern??=Xt,X.init(e,t)});function Gn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Kn=U(`$ZodJWT`,(e,t)=>{X.init(e,t),e._zod.check=n=>{Gn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),qn=U(`$ZodUnknown`,(e,t)=>{Y.init(e,t),e._zod.parse=e=>e}),Jn=U(`$ZodNever`,(e,t)=>{Y.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Yn(e,t,n){e.issues.length&&t.issues.push(...st(n,e.issues)),t.value[n]=e.value}var Xn=U(`$ZodArray`,(e,t)=>{Y.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Yn(t,n,e))):Yn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Zn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...st(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Qn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ze(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $n(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Zn(e,n,i,t,u,d))):Zn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var er=U(`$ZodObject`,(e,t)=>{if(Y.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=G(()=>Qn(t));K(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=We,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Zn(n,t,e,s,r,i))):Zn(a,t,e,s,r,i)}return i?$n(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),tr=U(`$ZodObjectJIT`,(e,t)=>{er.init(e,t);let n=e._zod.parse,r=G(()=>Qn(t)),i=e=>{let t=new vn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Ve(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Ve(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
-
if (${n}.issues.length) {
|
|
6
|
-
if (${o} in input) {
|
|
7
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
-
...iss,
|
|
9
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
-
})));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (${n}.value === undefined) {
|
|
15
|
-
if (${o} in input) {
|
|
16
|
-
newResult[${o}] = undefined;
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
newResult[${o}] = ${n}.value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`):c?t.write(`
|
|
23
|
-
if (${n}.issues.length) {
|
|
24
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
-
})));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (${n}.value === undefined) {
|
|
31
|
-
if (${o} in input) {
|
|
32
|
-
newResult[${o}] = undefined;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
newResult[${o}] = ${n}.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`):t.write(`
|
|
39
|
-
const ${n}_present = ${o} in input;
|
|
40
|
-
if (${n}.issues.length) {
|
|
41
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
-
...iss,
|
|
43
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
-
})));
|
|
45
|
-
}
|
|
46
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
-
payload.issues.push({
|
|
48
|
-
code: "invalid_type",
|
|
49
|
-
expected: "nonoptional",
|
|
50
|
-
input: undefined,
|
|
51
|
-
path: [${o}]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (${n}_present) {
|
|
56
|
-
if (${n}.value === undefined) {
|
|
57
|
-
newResult[${o}] = undefined;
|
|
58
|
-
} else {
|
|
59
|
-
newResult[${o}] = ${n}.value;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=We,s=!W.jitless,c=s&&Ge.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?$n([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function nr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!at(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>lt(e,r,Pe())))}),t)}var rr=U(`$ZodUnion`,(e,t)=>{Y.init(e,t),K(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),K(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),K(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),K(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Re(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>nr(t,r,e,i)):nr(o,r,e,i)}}),ir=U(`$ZodIntersection`,(e,t)=>{Y.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>or(e,t,n)):or(e,i,a)}});function ar(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ke(e)&&Ke(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ar(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ar(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function or(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),at(e))return e;let o=ar(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var sr=U(`$ZodEnum`,(e,t)=>{Y.init(e,t);let n=Fe(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Je.has(typeof e)).map(e=>typeof e==`string`?Ye(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),cr=U(`$ZodLiteral`,(e,t)=>{if(Y.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ye(e):e?Ye(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),lr=U(`$ZodTransform`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ne(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Me;return n.value=i,n.fallback=!0,n}});function ur(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var dr=U(`$ZodOptional`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,K(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Re(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>ur(e,r)):ur(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),fr=U(`$ZodExactOptional`,(e,t)=>{dr.init(e,t),K(e._zod,`values`,()=>t.innerType._zod.values),K(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),pr=U(`$ZodNullable`,(e,t)=>{Y.init(e,t),K(e._zod,`optin`,()=>t.innerType._zod.optin),K(e._zod,`optout`,()=>t.innerType._zod.optout),K(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Re(e.source)}|null)$`):void 0}),K(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),mr=U(`$ZodDefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,K(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>hr(e,t)):hr(r,t)}});function hr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var gr=U(`$ZodPrefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,K(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),_r=U(`$ZodNonOptional`,(e,t)=>{Y.init(e,t),K(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>vr(t,e)):vr(i,e)}});function vr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var yr=U(`$ZodCatch`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,K(e._zod,`optout`,()=>t.innerType._zod.optout),K(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>lt(e,n,Pe()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>lt(e,n,Pe()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),br=U(`$ZodPipe`,(e,t)=>{Y.init(e,t),K(e._zod,`values`,()=>t.in._zod.values),K(e._zod,`optin`,()=>t.in._zod.optin),K(e._zod,`optout`,()=>t.out._zod.optout),K(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>xr(e,t.in,n)):xr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>xr(e,t.out,n)):xr(r,t.out,n)}});function xr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Sr=U(`$ZodReadonly`,(e,t)=>{Y.init(e,t),K(e._zod,`propValues`,()=>t.innerType._zod.propValues),K(e._zod,`values`,()=>t.innerType._zod.values),K(e._zod,`optin`,()=>t.innerType?._zod?.optin),K(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Cr):Cr(r)}});function Cr(e){return e.value=Object.freeze(e.value),e}var wr=U(`$ZodCustom`,(e,t)=>{on.init(e,t),Y.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Tr(t,n,r,e));Tr(i,n,r,e)}});function Tr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(dt(e))}}var Er,Dr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Or(){return new Dr}(Er=globalThis).__zod_globalRegistry??(Er.__zod_globalRegistry=Or());var kr=globalThis.__zod_globalRegistry;function Ar(e,t){return new e({type:`string`,...J(t)})}function jr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...J(t)})}function Mr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...J(t)})}function Nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...J(t)})}function Pr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...J(t)})}function Fr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...J(t)})}function Ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...J(t)})}function Lr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...J(t)})}function Rr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...J(t)})}function zr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...J(t)})}function Br(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...J(t)})}function Vr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...J(t)})}function Hr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...J(t)})}function Ur(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...J(t)})}function Wr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...J(t)})}function Gr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...J(t)})}function Kr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...J(t)})}function qr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...J(t)})}function Jr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...J(t)})}function Yr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...J(t)})}function Xr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...J(t)})}function Zr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...J(t)})}function Qr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...J(t)})}function $r(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...J(t)})}function ei(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...J(t)})}function ti(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...J(t)})}function ni(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...J(t)})}function ri(e){return new e({type:`unknown`})}function ii(e,t){return new e({type:`never`,...J(t)})}function ai(e,t){return new sn({check:`max_length`,...J(t),maximum:e})}function oi(e,t){return new cn({check:`min_length`,...J(t),minimum:e})}function si(e,t){return new ln({check:`length_equals`,...J(t),length:e})}function ci(e,t){return new dn({check:`string_format`,format:`regex`,...J(t),pattern:e})}function li(e){return new fn({check:`string_format`,format:`lowercase`,...J(e)})}function ui(e){return new pn({check:`string_format`,format:`uppercase`,...J(e)})}function di(e,t){return new mn({check:`string_format`,format:`includes`,...J(t),includes:e})}function fi(e,t){return new hn({check:`string_format`,format:`starts_with`,...J(t),prefix:e})}function pi(e,t){return new gn({check:`string_format`,format:`ends_with`,...J(t),suffix:e})}function mi(e){return new _n({check:`overwrite`,tx:e})}function hi(e){return mi(t=>t.normalize(e))}function gi(){return mi(e=>e.trim())}function _i(){return mi(e=>e.toLowerCase())}function vi(){return mi(e=>e.toUpperCase())}function yi(){return mi(e=>He(e))}function bi(e,t,n){return new e({type:`array`,element:t,...J(n)})}function xi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...J(n)})}function Si(e,t){let n=Ci(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(dt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(dt(r))}},e(t.value,t)),t);return n}function Ci(e,t){let n=new on({check:`custom`,...J(t)});return n._zod.check=e,n}function wi(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??kr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Ti(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Ti(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Oi(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ei(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
|
-
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Di(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ai(t,`input`,e.processors),output:Ai(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Oi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Oi(r.element,n);if(r.type===`set`)return Oi(r.valueType,n);if(r.type===`lazy`)return Oi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Oi(r.innerType,n);if(r.type===`intersection`)return Oi(r.left,n)||Oi(r.right,n);if(r.type===`record`||r.type===`map`)return Oi(r.keyType,n)||Oi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Oi(r.in,n)||Oi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Oi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Oi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Oi(e,n))return!0;return!!(r.rest&&Oi(r.rest,n))}return!1}var ki=(e,t={})=>n=>{let r=wi({...n,processors:t});return Ti(e,r),Ei(r,e),Di(r,e)},Ai=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=wi({...i??{},target:a,io:t,processors:n});return Ti(e,o),Ei(o,e),Di(o,e)},ji={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Mi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ji[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ni=(e,t,n,r)=>{n.not={}},Pi=(e,t,n,r)=>{let i=e._zod.def,a=Fe(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Fi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ii=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Li=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ri=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Ti(a.element,t,{...r,path:[...r.path,`items`]})},zi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Ti(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Ti(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Bi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Ti(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Vi=(e,t,n,r)=>{let i=e._zod.def,a=Ti(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Ti(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Hi=(e,t,n,r)=>{let i=e._zod.def,a=Ti(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ui=(e,t,n,r)=>{let i=e._zod.def;Ti(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wi=(e,t,n,r)=>{let i=e._zod.def;Ti(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Gi=(e,t,n,r)=>{let i=e._zod.def;Ti(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ki=(e,t,n,r)=>{let i=e._zod.def;Ti(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},qi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Ti(o,t,r);let s=t.seen.get(e);s.ref=o},Ji=(e,t,n,r)=>{let i=e._zod.def;Ti(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yi=(e,t,n,r)=>{let i=e._zod.def;Ti(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xi=U(`ZodISODateTime`,(e,t)=>{Mn.init(e,t),Z.init(e,t)});function Zi(e){return $r(Xi,e)}var Qi=U(`ZodISODate`,(e,t)=>{Nn.init(e,t),Z.init(e,t)});function $i(e){return ei(Qi,e)}var ea=U(`ZodISOTime`,(e,t)=>{Pn.init(e,t),Z.init(e,t)});function ta(e){return ti(ea,e)}var na=U(`ZodISODuration`,(e,t)=>{Fn.init(e,t),Z.init(e,t)});function ra(e){return ni(na,e)}var ia=U(`ZodError`,(e,t)=>{pt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>gt(e,t)},flatten:{value:t=>ht(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ie,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ie,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),aa=_t(ia),oa=vt(ia),sa=yt(ia),ca=xt(ia),la=Ct(ia),ua=wt(ia),da=Tt(ia),fa=Et(ia),pa=Dt(ia),ma=Ot(ia),ha=kt(ia),ga=At(ia),_a=new WeakMap;function va(e,t,n){let r=Object.getPrototypeOf(e),i=_a.get(r);if(i||(i=new Set,_a.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var ya=U(`ZodType`,(e,t)=>(Y.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ai(e,`input`),output:Ai(e,`output`)}}),e.toJSONSchema=ki(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>aa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sa(e,t,n),e.parseAsync=async(t,n)=>oa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ca(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>la(e,t,n),e.decode=(t,n)=>ua(e,t,n),e.encodeAsync=async(t,n)=>da(e,t,n),e.decodeAsync=async(t,n)=>fa(e,t,n),e.safeEncode=(t,n)=>pa(e,t,n),e.safeDecode=(t,n)=>ma(e,t,n),e.safeEncodeAsync=async(t,n)=>ha(e,t,n),e.safeDecodeAsync=async(t,n)=>ga(e,t,n),va(e,`ZodType`,{check(...e){let t=this.def;return this.clone(q(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Xe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Eo(e,t))},superRefine(e,t){return this.check(Do(e,t))},overwrite(e){return this.check(mi(e))},optional(){return so(this)},exactOptional(){return lo(this)},nullable(){return fo(this)},nullish(){return so(fo(this))},nonoptional(e){return vo(this,e)},array(){return qa(this)},or(e){return Za([this,e])},and(e){return $a(this,e)},transform(e){return So(this,ao(e))},default(e){return mo(this,e)},prefault(e){return go(this,e)},catch(e){return bo(this,e)},pipe(e){return So(this,e)},readonly(){return wo(this)},describe(e){let t=this.clone();return kr.add(t,{description:e}),t},meta(...e){if(e.length===0)return kr.get(this);let t=this.clone();return kr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return kr.get(e)?.description},configurable:!0}),e)),ba=U(`_ZodString`,(e,t)=>{bn.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,va(e,`_ZodString`,{regex(...e){return this.check(ci(...e))},includes(...e){return this.check(di(...e))},startsWith(...e){return this.check(fi(...e))},endsWith(...e){return this.check(pi(...e))},min(...e){return this.check(oi(...e))},max(...e){return this.check(ai(...e))},length(...e){return this.check(si(...e))},nonempty(...e){return this.check(oi(1,...e))},lowercase(e){return this.check(li(e))},uppercase(e){return this.check(ui(e))},trim(){return this.check(gi())},normalize(...e){return this.check(hi(...e))},toLowerCase(){return this.check(_i())},toUpperCase(){return this.check(vi())},slugify(){return this.check(yi())}})}),xa=U(`ZodString`,(e,t)=>{bn.init(e,t),ba.init(e,t),e.email=t=>e.check(jr(Ca,t)),e.url=t=>e.check(Lr(Ea,t)),e.jwt=t=>e.check(Qr(Va,t)),e.emoji=t=>e.check(Rr(Da,t)),e.guid=t=>e.check(Mr(wa,t)),e.uuid=t=>e.check(Nr(Ta,t)),e.uuidv4=t=>e.check(Pr(Ta,t)),e.uuidv6=t=>e.check(Fr(Ta,t)),e.uuidv7=t=>e.check(Ir(Ta,t)),e.nanoid=t=>e.check(zr(Oa,t)),e.guid=t=>e.check(Mr(wa,t)),e.cuid=t=>e.check(Br(ka,t)),e.cuid2=t=>e.check(Vr(Aa,t)),e.ulid=t=>e.check(Hr(ja,t)),e.base64=t=>e.check(Yr(Ra,t)),e.base64url=t=>e.check(Xr(za,t)),e.xid=t=>e.check(Ur(Ma,t)),e.ksuid=t=>e.check(Wr(Na,t)),e.ipv4=t=>e.check(Gr(Pa,t)),e.ipv6=t=>e.check(Kr(Fa,t)),e.cidrv4=t=>e.check(qr(Ia,t)),e.cidrv6=t=>e.check(Jr(La,t)),e.e164=t=>e.check(Zr(Ba,t)),e.datetime=t=>e.check(Zi(t)),e.date=t=>e.check($i(t)),e.time=t=>e.check(ta(t)),e.duration=t=>e.check(ra(t))});function Sa(e){return Ar(xa,e)}var Z=U(`ZodStringFormat`,(e,t)=>{X.init(e,t),ba.init(e,t)}),Ca=U(`ZodEmail`,(e,t)=>{Cn.init(e,t),Z.init(e,t)}),wa=U(`ZodGUID`,(e,t)=>{xn.init(e,t),Z.init(e,t)}),Ta=U(`ZodUUID`,(e,t)=>{Sn.init(e,t),Z.init(e,t)}),Ea=U(`ZodURL`,(e,t)=>{wn.init(e,t),Z.init(e,t)}),Da=U(`ZodEmoji`,(e,t)=>{Tn.init(e,t),Z.init(e,t)}),Oa=U(`ZodNanoID`,(e,t)=>{En.init(e,t),Z.init(e,t)}),ka=U(`ZodCUID`,(e,t)=>{Dn.init(e,t),Z.init(e,t)}),Aa=U(`ZodCUID2`,(e,t)=>{On.init(e,t),Z.init(e,t)}),ja=U(`ZodULID`,(e,t)=>{kn.init(e,t),Z.init(e,t)}),Ma=U(`ZodXID`,(e,t)=>{An.init(e,t),Z.init(e,t)}),Na=U(`ZodKSUID`,(e,t)=>{jn.init(e,t),Z.init(e,t)}),Pa=U(`ZodIPv4`,(e,t)=>{In.init(e,t),Z.init(e,t)}),Fa=U(`ZodIPv6`,(e,t)=>{Ln.init(e,t),Z.init(e,t)}),Ia=U(`ZodCIDRv4`,(e,t)=>{Rn.init(e,t),Z.init(e,t)}),La=U(`ZodCIDRv6`,(e,t)=>{zn.init(e,t),Z.init(e,t)}),Ra=U(`ZodBase64`,(e,t)=>{Vn.init(e,t),Z.init(e,t)}),za=U(`ZodBase64URL`,(e,t)=>{Un.init(e,t),Z.init(e,t)}),Ba=U(`ZodE164`,(e,t)=>{Wn.init(e,t),Z.init(e,t)}),Va=U(`ZodJWT`,(e,t)=>{Kn.init(e,t),Z.init(e,t)}),Ha=U(`ZodUnknown`,(e,t)=>{qn.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ua(){return ri(Ha)}var Wa=U(`ZodNever`,(e,t)=>{Jn.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r)});function Ga(e){return ii(Wa,e)}var Ka=U(`ZodArray`,(e,t)=>{Xn.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.element=t.element,va(e,`ZodArray`,{min(e,t){return this.check(oi(e,t))},nonempty(e){return this.check(oi(1,e))},max(e,t){return this.check(ai(e,t))},length(e,t){return this.check(si(e,t))},unwrap(){return this.element}})});function qa(e,t){return bi(Ka,e,t)}var Ja=U(`ZodObject`,(e,t)=>{tr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),K(e,`shape`,()=>t.shape),va(e,`ZodObject`,{keyof(){return to(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ua()})},loose(){return this.clone({...this._zod.def,catchall:Ua()})},strict(){return this.clone({...this._zod.def,catchall:Ga()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return et(this,e)},safeExtend(e){return tt(this,e)},merge(e){return nt(this,e)},pick(e){return Qe(this,e)},omit(e){return $e(this,e)},partial(...e){return rt(oo,this,e[0])},required(...e){return it(_o,this,e[0])}})});function Ya(e,t){return new Ja({type:`object`,shape:e??{},...J(t)})}var Xa=U(`ZodUnion`,(e,t)=>{rr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.options=t.options});function Za(e,t){return new Xa({type:`union`,options:e,...J(t)})}var Qa=U(`ZodIntersection`,(e,t)=>{ir.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r)});function $a(e,t){return new Qa({type:`intersection`,left:e,right:t})}var eo=U(`ZodEnum`,(e,t)=>{sr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new eo({...t,checks:[],...J(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new eo({...t,checks:[],...J(r),entries:i})}});function to(e,t){return new eo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...J(t)})}var no=U(`ZodLiteral`,(e,t)=>{cr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ro(e,t){return new no({type:`literal`,values:Array.isArray(e)?e:[e],...J(t)})}var io=U(`ZodTransform`,(e,t)=>{lr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ne(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(dt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(dt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function ao(e){return new io({type:`transform`,transform:e})}var oo=U(`ZodOptional`,(e,t)=>{dr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e){return new oo({type:`optional`,innerType:e})}var co=U(`ZodExactOptional`,(e,t)=>{fr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lo(e){return new co({type:`optional`,innerType:e})}var uo=U(`ZodNullable`,(e,t)=>{pr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e){return new uo({type:`nullable`,innerType:e})}var po=U(`ZodDefault`,(e,t)=>{mr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function mo(e,t){return new po({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():qe(t)}})}var ho=U(`ZodPrefault`,(e,t)=>{gr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function go(e,t){return new ho({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():qe(t)}})}var _o=U(`ZodNonOptional`,(e,t)=>{_r.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vo(e,t){return new _o({type:`nonoptional`,innerType:e,...J(t)})}var yo=U(`ZodCatch`,(e,t)=>{yr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bo(e,t){return new yo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var xo=U(`ZodPipe`,(e,t)=>{br.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.in=t.in,e.out=t.out});function So(e,t){return new xo({type:`pipe`,in:e,out:t})}var Co=U(`ZodReadonly`,(e,t)=>{Sr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wo(e){return new Co({type:`readonly`,innerType:e})}var To=U(`ZodCustom`,(e,t)=>{wr.init(e,t),ya.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r)});function Eo(e,t={}){return xi(To,e,t)}function Do(e,t){return Si(e,t)}function Oo(e){if(!Number.isSafeInteger(e.totalRows)||e.totalRows<0)throw TypeError(`totalRows must be a non-negative safe integer`);return Object.freeze({...e,version:2,filters:Object.freeze({...e.filters})})}var ko={health:`/api/v2/health`,snapshot:`/api/v2/snapshot`,refreshProjection:`/api/v2/refresh-projection`,reconcileOpenWork:`/api/v2/reconcile-open-work`,operations:`/api/v2/operations`,costMonitor:`/api/v2/cost-monitor`,agentCatalog:`/api/v2/agent-catalog`,projectSettings:`/api/v2/project-settings`,workPriority:`/api/v2/work-priority`,prd:e=>`/api/v2/prds/${encodeURIComponent(e)}`,spec:e=>`/api/v2/specs/${encodeURIComponent(e)}`,task:e=>`/api/v2/tasks/${encodeURIComponent(e)}`,taskTrace:e=>`/api/v2/tasks/${encodeURIComponent(e)}/trace`};Ya({from:Sa().datetime({offset:!0}).nullable(),to:Sa().datetime({offset:!0}).nullable()}).strict();var Ao=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),jo=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Mo={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},No=(0,o.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:s,...c},l)=>(0,o.createElement)(`svg`,{ref:l,...Mo,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jo(`lucide`,i),...c},[...s.map(([e,t])=>(0,o.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Po=(e,t)=>{let n=(0,o.forwardRef)(({className:n,...r},i)=>(0,o.createElement)(No,{ref:i,iconNode:t,className:jo(`lucide-${Ao(e)}`,n),...r}));return n.displayName=`${e}`,n},Fo=Po(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Io=Po(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Lo=Po(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Ro=Po(`CircleDot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),zo=Po(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),Bo=Po(`Coins`,[[`circle`,{cx:`8`,cy:`8`,r:`6`,key:`3yglwk`}],[`path`,{d:`M18.09 10.37A6 6 0 1 1 10.34 18`,key:`t5s6rm`}],[`path`,{d:`M7 6h1v4`,key:`1obek4`}],[`path`,{d:`m16.71 13.88.7.71-2.82 2.82`,key:`1rbuyh`}]]),Vo=Po(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Ho=Po(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),Uo=Po(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Wo=Po(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Go=Po(`Layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Ko=Po(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),qo=Po(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Jo=Po(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Yo=Po(`Route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Xo=Po(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Zo=Po(`Zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function Qo(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return typeof t.account_id==`string`&&(typeof t.login_snapshot==`string`||t.login_snapshot===null)}function $o(e){if(!Array.isArray(e))return`—`;let t=e.filter(Qo);return t.length===0?`—`:t.map(({account_id:e,login_snapshot:t})=>t===null||t.length===0?e:`${t} (${e})`).join(`; `)}function es({progress:e,keepOpen:t=!0}){return(0,l.jsxs)(`aside`,{"aria-live":`polite`,className:`export-progress`,role:`status`,children:[(0,l.jsx)(`strong`,{children:`Exportação em andamento`}),(0,l.jsx)(`progress`,{max:100,value:e,"aria-label":`Progresso da exportação`}),t&&(0,l.jsx)(`span`,{children:`Mantenha a página aberta.`}),(0,l.jsxs)(`span`,{children:[Math.round(e),`%`]})]})}function ts(){return(0,l.jsx)(`aside`,{"aria-live":`polite`,className:`export-success`,role:`status`,children:`Exportação concluída.`})}var ns=new TextEncoder,rs=4294967295,is=Uint32Array.from({length:256},(e,t)=>{let n=t;for(let e=0;e<8;e++)n=n>>>1^(n&1?3988292384:0);return n>>>0}),as=class{writable;metas=[];offset=0;closed=!1;constructor(e){this.writable=e}entry(e){let t=us(e),n=this.put(fs(t)),r=4294967295,i=0,a=!1;return{ready:n,write:async e=>{if(await n,a)throw Error(`ZIP entry is already closed`);if(i+e.length>rs)throw RangeError(`ZIP32 entry size exceeded`);r=_s(e,r),i+=e.length,await this.put(e)},close:async()=>{if(await n,a)return;a=!0;let o=(r^4294967295)>>>0;await this.put(ps(o,i)),this.metas.push({name:e,crc:o,size:i,offset:this.offset-i-16-t.length-30})},abort:e=>this.writable.abort?.(e)??Promise.resolve()}}async close(){if(this.closed)return;this.closed=!0;let e=this.offset;for(let e of this.metas)await this.put(ms(e));await this.put(hs(this.metas.length,this.offset-e,e)),await this.writable.close()}async abort(e){this.closed=!0,await this.writable.abort?.(e)}async put(e){if(this.offset+e.length>rs)throw RangeError(`ZIP32 size exceeded`);await this.writable.ready,await this.writable.write(e),this.offset+=e.length}};async function os(e){if(e.headers.length===0||e.headers.length>16384)throw RangeError(`XLSX supports columns A through XFD`);let t=cs(ss(e.headers,e.rows));await ls([ds(`[Content_Types].xml`,`<?xml version="1.0"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`),ds(`_rels/.rels`,`<?xml version="1.0"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`),ds(`xl/workbook.xml`,`<?xml version="1.0"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="Export" sheetId="1" r:id="rId1"/></sheets></workbook>`),ds(`xl/_rels/workbook.xml.rels`,`<?xml version="1.0"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`),ds(`xl/styles.xml`,`<?xml version="1.0"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="2"><font/><font><b/></font></fonts><fills count="1"><fill><patternFill patternType="none"/></fill></fills><borders count="1"><border/></borders><cellStyleXfs count="1"><xf/></cellStyleXfs><cellXfs count="2"><xf fontId="0" fillId="0" borderId="0" xfId="0"/><xf fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/></cellXfs></styleSheet>`),{name:`xl/worksheets/sheet1.xml`,chunks:t}],e.writable)}async function*ss(e,t){let n=vs(e.length);yield us(`<?xml version="1.0"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews><sheetData><row r="1">`),yield us(e.map((e,t)=>bs(`${vs(t+1)}1`,e,1)).join(``)),yield us(`</row>`);let r=1;for await(let e of t){if(++r>1000001)throw RangeError(`A worksheet cannot exceed 1,000,000 data rows`);yield us(`<row r="${r}">${e.values.map((e,t)=>bs(`${vs(t+1)}${r}`,e,0)).join(``)}</row>`)}yield us(`</sheetData><autoFilter ref="A1:${n}1"/></worksheet>`)}async function*cs(e,t=64*1024){let n=[],r=0,i=()=>{let e=new Uint8Array(r),t=0;for(let r of n)e.set(r,t),t+=r.length;return n=[],r=0,e};for await(let a of e){if(a.length>=t){r&&(yield i()),yield a;continue}r+a.length>t&&r&&(yield i()),n.push(a),r+=a.length}r&&(yield i())}async function ls(e,t){let n=new as(t);try{for(let t of e){let e=n.entry(t.name);for await(let n of t.chunks)await e.write(n);await e.close()}await n.close()}catch(e){throw await n.abort(e),e}}var us=e=>ns.encode(e),ds=(e,t)=>({name:e,chunks:(async function*(){yield us(t)})()}),fs=e=>gs(30,e,t=>{t.setUint32(0,67324752,!0),t.setUint16(4,20,!0),t.setUint16(6,8,!0),t.setUint16(26,e.length,!0)}),ps=(e,t)=>{let n=new Uint8Array(16),r=new DataView(n.buffer);return r.setUint32(0,134695760,!0),r.setUint32(4,e,!0),r.setUint32(8,t,!0),r.setUint32(12,t,!0),n},ms=e=>gs(46,us(e.name),t=>{t.setUint32(0,33639248,!0),t.setUint16(4,20,!0),t.setUint16(6,20,!0),t.setUint16(8,8,!0),t.setUint32(16,e.crc,!0),t.setUint32(20,e.size,!0),t.setUint32(24,e.size,!0),t.setUint16(28,us(e.name).length,!0),t.setUint32(42,e.offset,!0)}),hs=(e,t,n)=>{let r=new Uint8Array(22),i=new DataView(r.buffer);return i.setUint32(0,101010256,!0),i.setUint16(8,e,!0),i.setUint16(10,e,!0),i.setUint32(12,t,!0),i.setUint32(16,n,!0),r},gs=(e,t,n)=>{let r=new Uint8Array(e+t.length);return n(new DataView(r.buffer)),r.set(t,e),r},_s=(e,t)=>{for(let n of e)t=(is[(t^n)&255]??0)^t>>>8;return t>>>0},vs=e=>{let t=``;for(;e;)e--,t=String.fromCharCode(65+e%26)+t,e=Math.floor(e/26);return t},ys=e=>String(e??``).replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]??e),bs=(e,t,n)=>typeof t==`number`?`<c r="${e}" s="${n}"><v>${t}</v></c>`:`<c r="${e}" s="${n}" t="inlineStr"><is><t>${ys(t)}</t></is></c>`;async function xs(e){let t=e.maxRowsPerFile??1e6;if(!Number.isSafeInteger(t)||t<1||t>1e6)throw TypeError(`maxRowsPerFile must be from 1 through 1,000,000`);let n=Math.max(1,Math.ceil(e.snapshot.totalRows/t)),r=Ss(e.snapshot.pages())[Symbol.asyncIterator](),i=1,a=0,o=-1,s=async()=>{let s=i++,c=0;await os({headers:e.headers,rows:(async function*(){for(;c<t&&a<e.snapshot.totalRows;){let n=await r.next();if(n.done)throw RangeError(`Snapshot ended before totalRows`);c+=1,a+=1,yield{values:e.headers.map(e=>n.value[e])};let i=Math.floor(a/e.snapshot.totalRows*100);(i!==o||a===e.snapshot.totalRows||c===t)&&(o=i,e.progress?.({processed:a,total:e.snapshot.totalRows,percent:i,part:s}))}})(),writable:e.writable(s,n)})};if(e.snapshot.totalRows===0){await s(),e.progress?.({processed:0,total:0,percent:100,part:1});return}for(;a<e.snapshot.totalRows;)await s();if(!(await r.next()).done)throw RangeError(`Snapshot exceeded totalRows`)}async function*Ss(e){for await(let t of e)for(let e of t)yield e}var Cs=!1,ws=0;async function Ts(e,t){let n=globalThis.showSaveFilePicker;if(n===void 0)throw Error(`Seu navegador não suporta salvar o arquivo de exportação.`);let r=e?`.zip`:`.xlsx`;return n({id:`zaip_export_${Date.now().toString(36).slice(-8)}_${(ws++%1679616).toString(36).padStart(4,`0`)}`,startIn:`downloads`,suggestedName:`${t}${r}`,types:[{description:e?`Arquivo ZIP`:`Pasta de trabalho Excel`,accept:{[e?`application/zip`:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`]:[r]}}]})}function Es(e,t=new Date){let n=Object.fromEntries(new Intl.DateTimeFormat(`en-CA`,{timeZone:`America/Sao_Paulo`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).formatToParts(t).filter(e=>e.type!==`literal`).map(e=>[e.type,e.value]));return`${`${n.year}-${n.month}-${n.day}-${n.hour}-${n.minute}`}-${e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/gi,`-`).replace(/^-|-$/g,``).toLowerCase()||`export`}`}function Ds(e,t,n=new Date){return`${Es(e,n)}-part-${t}.xlsx`}function Os(e){let t=e.createWritable().then(e=>e.getWriter());return{get ready(){return t.then(e=>e.ready)},async write(e){await(await t).write(e.slice().buffer)},async close(){await(await t).close()},async abort(e){await(await t).abort(e)}}}function ks(e){return typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`}var As=class{state={status:`idle`,progress:0,error:null,message:null,completedFiles:[]};listeners=new Set;subscribe(e){return this.listeners.add(e),e(this.state),()=>this.listeners.delete(e)}setState(e){this.state=e;for(let t of this.listeners)t(e)}async start(e){if(Cs||this.state.status===`running`)throw Error(`An export is already running`);Cs=!0;let t=!1,n=new Date,r=Es(e.view,n),i=[];try{let a=e.snapshot.totalRows>1e6,o=await Ts(a,r),s=Os(o);t=!0,this.setState({status:`running`,progress:0,error:null,message:`Mantenha a página aberta enquanto a exportação é concluída.`,completedFiles:i});let c=a?new as(s):void 0;await xs({snapshot:e.snapshot,headers:e.headers,writable:t=>{let r=Ds(e.view,t,n),i=c?.entry(r)??s;return{...i,async close(){await i.close()}}},progress:({percent:e})=>{this.setState({...this.state,progress:Math.max(this.state.progress,e)})}}),c!==void 0&&await c.close(),i.push(o.name),Cs=!1,this.setState({...this.state,status:`completed`,progress:100,message:null})}catch(e){throw t?this.setState({...this.state,status:`failed`,error:e instanceof Error?e.message:String(e),message:null}):ks(e)||this.setState({...this.state,status:`failed`,error:e instanceof Error?e.message:String(e)}),e}finally{Cs=!1}}},js=[`key`,`prds`,`specs`,`tasks`,`conversations`,`runs`,`tests`,`evidences`,`tokens`,`cost`,`duration_hours`],Ms=[`type`,`id`,`title`,`status`,`risk`,`developers`,`occurred_at`,`duration_hours`,`tokens`,`cost_brl`],Ns=[`id`,`kind`,`status`,`origin`,`task_id`,`conversation_id`,`created_at`,`finished_at`,`duration_hours`,`tokens`,`cost_brl`,`invocations`],Ps=[`run_id`,`execution_id`,`conversation_id`,`task_id`,`origin`,`run_role`,`run_purpose`,`phase`,`status`,`agent`,`provider`,`model`,`reasoning_effort`,`started_at`,`finished_at`,`duration_hours`,`input_tokens`,`cached_input_tokens`,`output_tokens`,`reasoning_tokens`,`total_tokens`,`estimated_usd`,`estimated_brl`],Fs=[`id`,`title`,`status`,`occurred_at`,`invocations`,`duration_hours`,`tokens`,`cost_brl`],Is=[`key`,`label`,`invocations`,`tasks`,`tokens`,`cost_usd`,`cost_brl`,`duration_hours`],Ls=[`Persona`,`Cargo`,`Zaip Agentes`,`PRDs`,`SPECs`,`Tarefas`,`Runs`,`Testes`,`Evidências`,`Tempo`,`Tokens`,`Custos`],Rs=[`model`,`prds`,`specs`,`tasks`,`conversations`,`runs`,`tests`,`evidences`,`duration_hours`,`tokens`,`costs`],zs=[`account_id`,`login_snapshot`,`prd_count`,`spec_count`,`task_count`,`run_count`,`test_count`,`evidence_count`,`total_duration_hours`,`total_tokens`,`total_cost_brl`,`duration_covered_runs`,`token_covered_runs`,`brl_covered_runs`],Bs=[`conversation_id`,`status`,`risk`,`started_at`,`finished_at`,`model`,`reasoning_effort`,`invocations`,`duration_hours`,`tokens`,`cost_brl`],Vs=[`id`,`title`,`status`,`risk`,`source_type`,`source_id`,`requirement_ids_json`,`acceptance_ids_json`,`task_ids_json`,`occurred_at`],Hs=[`id`,`title`,`origin`,`scope_type`,`scope_id`,`occurred_at`],Us=4e3;async function*Ws(e,t=ic){let n=new Set;for await(let r of e.pages()){let e=r.filter(e=>{let t=typeof e.id==`string`?e.id:typeof e.run_id==`string`?e.run_id:typeof e.agent_invocation_id==`string`?e.agent_invocation_id:typeof e.key==`string`?e.key:JSON.stringify(e);return n.has(t)?!1:(n.add(t),!0)});e.length>0&&(yield t(e))}}function Gs(e){return e.map(e=>{let t=rc(e.telemetry),n=rc(rc(e.usage)?.total),r=rc(n?.tokens),i=rc(n?.cost),a=rc(e.metrics),o=rc(a?.duration),s=rc(a?.total_tokens),c=rc(a?.cost),l=Q(e.duration_ms)??Q(t?.duration_ms)??Q(e.total_duration)??Js(o);return{type:e.kind??e.entity_kind,id:e.id,title:e.title,status:e.work_status??e.status??e.lifecycle_status,risk:e.risk??null,developers:$o(e.developers),occurred_at:e.occurred_at??e.created_at??e.updated_at??null,duration_hours:l===null?null:l/36e5,tokens:Q(e.total_tokens)??Q(t?.tokens)??Q(r?.total)??Js(s),cost_brl:Q(e.cost_brl)??Q(e.total_cost_brl)??Q(t?.cost_brl)??Q(i?.brl)??Js(c)}})}function Ks(e){return e.map(e=>{let t=rc(e.origin),n=typeof t?.type==`string`?t.type:typeof e.origin_type==`string`?e.origin_type:null,r=nc(e);return{id:e.id??e.execution_id??null,kind:e.kind??e.execution_kind??null,status:e.status??null,origin:n,task_id:e.task_id??(n===`task`?t?.task_id??null:null),conversation_id:e.conversation_id??(n===`interaction`?t?.conversation_id??null:null),created_at:e.created_at??e.started_at??null,finished_at:e.finished_at??null,duration_hours:r===null?null:r/36e5,tokens:Q(e.total_tokens),cost_brl:Q(e.cost_brl)??Q(e.total_cost_brl),invocations:Q(e.orchestrator_run_count)??Q(e.invocation_count)??null}})}function qs(e){return e.map(e=>{let t=nc(e);return{run_id:e.run_id??e.agent_invocation_id??e.id??null,execution_id:e.execution_id??null,conversation_id:e.conversation_id??null,task_id:e.task_id??null,origin:e.origin??e.invocation_kind??null,run_role:e.run_role??e.zaip_agent_role??null,run_purpose:e.run_purpose??e.purpose??null,phase:e.phase??null,status:e.status??null,agent:e.agent??e.zaip_agent??null,provider:e.provider??null,model:e.model??null,reasoning_effort:e.reasoning_effort??null,started_at:e.started_at??e.source_started_at??e.occurred_at??null,finished_at:e.finished_at??e.source_finished_at??null,duration_hours:t===null?null:t/36e5,input_tokens:Q(e.input_tokens),cached_input_tokens:Q(e.cached_input_tokens),output_tokens:Q(e.output_tokens),reasoning_tokens:Q(e.reasoning_tokens),total_tokens:Q(e.total_tokens),estimated_usd:Q(e.estimated_usd)??Q(e.cost_usd),estimated_brl:Q(e.estimated_brl)??Q(e.cost_brl)}})}function Js(e){return e?.complete===!1&&e.coverage_ratio===0?null:Q(e?.known_sum)}function Ys(e){return e.map(e=>{let t=rc(e.metrics),n=rc(t?.duration),r=rc(t?.total_tokens),i=rc(t?.cost),a=n===null?Q(e.total_duration):Js(n);return{id:e.id??null,title:e.title??null,status:e.status??null,occurred_at:e.occurred_at??null,invocations:Q(e.run_count)??Q(e.invocation_count),duration_hours:a===null?null:a/36e5,tokens:r===null?Q(e.total_tokens):Js(r),cost_brl:i===null?Q(e.total_cost_brl):Js(i)}})}function Xs(e){return e.map(e=>{let t=Q(e.duration_ms)??Q(e.total_duration);return{key:e.key??null,label:e.label??null,invocations:Q(e.run_count)??Q(e.invocation_count),tasks:Q(e.task_count),tokens:Q(e.total_tokens),cost_usd:Q(e.estimated_usd)??Q(e.total_cost_usd),cost_brl:Q(e.estimated_brl)??Q(e.total_cost_brl),duration_hours:t===null?null:t/36e5}})}function Zs(e){return e.map(e=>{let t=Q(e.duration_ms)??Q(e.total_duration);return{Persona:e.persona??null,Cargo:e.job??null,"Zaip Agentes":e.label??e.key??null,PRDs:Q(e.prd_count)??0,SPECs:Q(e.spec_count)??0,Tarefas:Q(e.task_count)??0,Runs:Q(e.run_count)??Q(e.invocation_count)??0,Testes:Q(e.test_count)??Q(e.validation_count)??0,Evidências:Q(e.evidence_count)??0,Tempo:(t??0)/36e5,Tokens:Q(e.total_tokens)??0,Custos:Q(e.estimated_brl)??Q(e.total_cost_brl)??0}})}function Qs(e){return e.map(e=>{let t=Q(e.duration_ms)??Q(e.total_duration);return{model:e.label??e.model??e.key??null,prds:Q(e.prd_count)??0,specs:Q(e.spec_count)??0,tasks:Q(e.task_count)??0,conversations:Q(e.conversation_count)??0,runs:Q(e.run_count)??Q(e.invocation_count)??0,tests:Q(e.test_count)??Q(e.validation_count)??0,evidences:Q(e.evidence_count)??0,duration_hours:t===null?0:t/36e5,tokens:Q(e.total_tokens)??0,costs:Q(e.estimated_brl)??Q(e.total_cost_brl)??0}})}function $s(e){return e.map(e=>{let t=Q(e.total_duration_ms);return{account_id:e.account_id??null,login_snapshot:e.login_snapshot??null,prd_count:Q(e.prd_count),spec_count:Q(e.spec_count),task_count:Q(e.task_count),run_count:Q(e.run_count),test_count:Q(e.test_count),evidence_count:Q(e.evidence_count),total_duration_hours:t===null?null:t/36e5,total_tokens:Q(e.total_tokens),total_cost_brl:Q(e.total_cost_brl),duration_covered_runs:Q(e.duration_covered_runs),token_covered_runs:Q(e.token_covered_runs),brl_covered_runs:Q(e.brl_covered_runs)}})}function ec(e){return e.map(e=>({conversation_id:e.conversation_id??e.id??null,status:e.status??null,risk:e.risk??null,started_at:e.started_at??null,finished_at:e.finished_at??null,model:e.model??null,reasoning_effort:e.reasoning_effort??null,invocations:Q(e.invocation_count),duration_hours:(Q(e.total_duration)??Q(e.duration_ms))===null?null:Number(Q(e.total_duration)??Q(e.duration_ms))/36e5,tokens:Q(e.total_tokens),cost_brl:Q(e.total_cost_brl)??Q(e.cost_brl)}))}function tc(e,t){return e.map(e=>Object.fromEntries(t.map(t=>[t,e[t]??null])))}function nc(e){return Q(e.duration_ms)??Q(e.source_duration_ms)}function rc(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function Q(e){return typeof e==`number`?e:null}function ic(e){return e.map(e=>Object.fromEntries(ac(e).map(([e,t])=>{let n=sc(e);return n===null?[e,typeof t==`object`&&t?JSON.stringify(t):t]:[n,typeof t==`number`?t/36e5:t]})))}function ac(e){let t=oc(e),n=Object.keys(t);return js.some(e=>n.includes(e))?js.filter(e=>n.includes(e)).map(e=>[e,t[e]]):Object.entries(e)}function oc(e){return(`key`in e||`period_key`in e)&&(`prd_count`in e||`spec_count`in e||`run_count`in e||`total_run_count`in e||`costBrl`in e||`total_cost_brl`in e||`durationMs`in e||`operations_total_duration`in e||`tasksCreated`in e)?{key:e.key??e.period_key,prds:e.prds??e.prd_count,specs:e.specs??e.spec_count,tasks:e.tasks??e.tasksCreated??e.task_count,runs:e.runs??e.run_count??e.total_run_count??e.invocation_count,tests:e.tests??e.test_count??e.validation_count,evidences:e.evidences??e.evidence_count,duration_hours:typeof(e.durationMs??e.duration_ms??e.operations_total_duration??e.total_duration)==`number`?Number(e.durationMs??e.duration_ms??e.operations_total_duration??e.total_duration)/36e5:e.durationMs??e.duration_ms??e.operations_total_duration??e.total_duration??null,tokens:e.tokens??e.total_tokens,cost:e.cost??(`costBrl`in e?e.costBrl:`total_cost_brl`in e?e.total_cost_brl:e.estimated_brl)}:(Object.keys(e).some(e=>e!==`key`&&js.includes(e)),e)}function sc(e){return e===`durationMs`?`durationHours`:e.endsWith(`DurationMs`)?`${e.slice(0,-2)}Hours`:e===`duration_ms`?`duration_hours`:e.endsWith(`_duration_ms`)?`${e.slice(0,-2)}hours`:null}function cc(e,t){let n=[],r=new Set,i=/-(daily|monthly|annual|yearly)$/.test(e),a=/-work-(kanban|list)$/.test(e),o=/-executions$/.test(e),s=e===`cost-executions`,c=/-(?:agentCalls|agent-calls|runs)$/.test(e),l=e===`operations-conversations`,u=/-(?:tasks|specs|prds|conversations)$/.test(e)&&!l,d=e===`cost-models`,f=e===`cost-agents`,p=/-(?:agents|models|providers)$/.test(e),m=e===`cost-developers`,h=e===`operations-changes`,g=e===`operations-decisions`;i&&n.push(...js),a&&n.push(...Ms),o&&!s&&n.push(...Ns),s&&n.push(...Fs),c&&n.push(...Ps),u&&n.push(...Fs),f?n.push(...Ls):d?n.push(...Rs):p&&n.push(...Is),m&&n.push(...zs),l&&n.push(...Bs),h&&n.push(...Vs),g&&n.push(...Hs);for(let e of n)r.add(e);if(!(a||s||o||c||u||p||m||l||h||g))for(let e of t)for(let[t]of ac(e)){let e=sc(t)??t;r.has(e)||(r.add(e),n.push(e))}return n.length===0&&n.push(`result`),n}function lc({filters:e,pageSource:t,rows:n,view:r}){let i=(0,o.useRef)(null);i.current===null&&(i.current=new As);let[a,s]=(0,o.useState)(i.current.state),[c,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(null);(0,o.useEffect)(()=>i.current?.subscribe(s),[]),(0,o.useEffect)(()=>{if(a.status!==`completed`){u(!1);return}u(!0);let e=setTimeout(()=>u(!1),Us);return()=>clearTimeout(e)},[a.status]);let h=cc(r,n),g=/-work-(kanban|list)$/.test(r),_=/-executions$/.test(r),v=r===`cost-executions`,y=/-(?:agentCalls|agent-calls|runs)$/.test(r),b=r===`operations-conversations`,x=/-(?:tasks|specs|prds|conversations)$/.test(r)&&!b,S=r===`cost-models`,C=r===`cost-agents`,w=/-(?:agents|models|providers)$/.test(r),T=r===`cost-developers`,E=r===`operations-changes`,D=r===`operations-decisions`,O=async()=>{let i=t===void 0?void 0:`prepare`in t?await t.prepare():t;return Oo({id:globalThis.crypto?.randomUUID?.()??`export-${Date.now()}`,createdAt:new Date().toISOString(),view:r,filters:e,totalRows:i?.totalRows??n.length,pages:async function*(){if(i!==void 0){yield*Ws(i,g?Gs:b?ec:E?e=>tc(e,Vs):D?e=>tc(e,Hs):v?Ys:_?Ks:y?qs:x?Ys:C?Zs:S?Qs:w?Xs:T?$s:ic);return}for(let e=0;e<n.length;e+=500)yield(g?Gs:b?ec:E?e=>tc(e,Vs):D?e=>tc(e,Hs):v?Ys:_?Ks:y?qs:x?Ys:C?Zs:S?Qs:w?Xs:T?$s:ic)(n.slice(e,e+500))}})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`button`,{"aria-label":`Exportar Excel`,className:`excel-export-action`,disabled:d||a.status===`running`,onClick:()=>{m(null),f(!0),O().then(e=>i.current?.start({snapshot:e,headers:h,view:r})).catch(e=>{m(e instanceof Error?e.message:String(e))}).finally(()=>f(!1))},type:`button`,children:[(0,l.jsx)(Vo,{"aria-hidden":`true`,size:16}),`Exportar Excel`]}),d||a.status===`running`?(0,l.jsx)(es,{progress:a.progress}):null,c?(0,l.jsx)(ts,{}):null,a.status===`failed`?(0,l.jsxs)(`p`,{role:`alert`,children:[`Falha ao exportar: `,a.error]}):null,p===null?null:(0,l.jsxs)(`p`,{role:`alert`,children:[`Falha ao preparar exportação: `,p]})]})}var uc=1e3,dc=60*uc,fc=60*dc,pc=24*fc,mc=7*pc,hc=30*pc,gc=6*fc,_c=new Set([`completed`,`blocked`,`failed`,`cancelled`]);function vc(e,t,n,r=Date.now()){if(e===null||_c.has(t))return null;let i=Date.parse(e);if(!Number.isFinite(i))return null;let a=Math.max(0,r-i),o=t===`executing`||t===`verifying`;return{label:yc(a,o,n),alert:o&&a>gc}}function yc(e,t,n){let r=n===`pt-BR`?`Há`:`Ago`,i=bc(e,t,n);return n===`pt-BR`?`${r} ${i}`:`${i} ${r}`}function bc(e,t,n){let r=Math.max(1,Math.round(e/uc));if(r<60)return`${r} seg`;let i=Math.round(e/dc);if(i<60)return`${i} min`;let a=Math.round(e/fc);if(a<24)return`${a} h`;let o=Math.round(e/pc);if(t||o<7)return`${o} d`;let s=Math.round(e/mc);if(s<4)return n===`pt-BR`?`${s} sem`:`${s} w`;let c=Math.max(1,Math.round(e/hc));return n===`pt-BR`?c===1?`1 mês`:`${c} meses`:`${c} mo`}function xc(e,t){return Sc(e,t,t===`pt-BR`?`Criada`:`Created`)}function Sc(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?``:`${n} · ${new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(r)}`}function Cc(e,t=`pt-BR`){return e>=36e5?`${Math.round(e/36e5)} h`:e>=6e4?`${Math.round(e/6e4)} min`:`${Math.round(e/1e3)} ${t===`pt-BR`?`seg`:`sec`}`}function wc(e){return Cc(e)}function Tc(e,t){return e.filter(e=>e.kind===`spec`&&e.parent_id===t)}function Ec(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i=new Map(e.planned_tasks.map(e=>[e.id,e]));return[...new Set([...e.planned_tasks.map(e=>e.id),...e.task_ids])].map(e=>({id:e,task:r.get(e)??null,preview:i.get(e)??null,usage:n.get(e)}))}var Dc={durationMs:null,tokens:null,costBrl:null};function Oc(e){return{durationMs:e.duration_ms,tokens:e.usage.total.coverage.tokens>0?e.usage.total.tokens.total:null,costBrl:e.usage.total.coverage.brl>0?e.usage.total.cost.brl:null}}function kc({locale:e,usage:t}){return(0,l.jsx)(`dl`,{className:`operations-macro-usage-strip`,children:[{icon:(0,l.jsx)(zo,{size:17}),label:e===`pt-BR`?`Tempo total`:`Total time`,value:t.durationMs===null?`—`:Cc(t.durationMs,e)},{icon:(0,l.jsx)(Zo,{size:17}),label:`Tokens`,value:D(t.tokens,e)},{icon:(0,l.jsx)(Bo,{size:17}),label:e===`pt-BR`?`Custo`:`Cost`,value:k(t.costBrl,`BRL`,e)}].map(e=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),(0,l.jsx)(`dt`,{children:e.label}),(0,l.jsx)(`dd`,{children:e.value})]},e.label))})}function Ac({locale:e,usage:t}){let n=[t.durationMs===null?`—`:Cc(t.durationMs,e),D(t.tokens,e),k(t.costBrl,`BRL`,e)];return(0,l.jsx)(`dl`,{className:`operations-macro-mini-usage`,children:(e===`pt-BR`?[`Tempo`,`Tokens`,`Custo`]:[`Time`,`Tokens`,`Cost`]).map((e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`dt`,{children:e}),(0,l.jsx)(`dd`,{children:n[t]})]},e))})}var jc={"en-US":{draft:`Definition (PRD + Requirements)`,planned:`Planned (SPEC + Changes)`,executing:`Executing (Tasks)`,verifying:`Verifying (Tests + Review)`,completed:`Completed`,blocked:`Blocked`,failed:`Failed`,cancelled:`Cancelled`},"pt-BR":{draft:`Definição (PRD + Requisitos)`,planned:`Planejamento (SPEC + Mudanças)`,executing:`Execução (Tarefas)`,verifying:`Verificação (Testes + Revisão)`,completed:`Concluído`,blocked:`Bloqueado`,failed:`Falhado`,cancelled:`Cancelado`}};function Mc(e,t){return jc[t][e]}function Nc(e,t){return t===`en-US`?e===`lite`?`Lite`:e===`standard`?`Standard`:`Critical`:e===`lite`?`Leve`:e===`standard`?`Padrão`:`Crítico`}var Pc=[`task`,`spec`,`prd`];function Fc(e,t){return t.find(t=>t.id===e.change_id)?.source.type??(e.spec_id===null?`task`:`spec`)}function Ic(e){return e===`task`?`Task-first`:e===`spec`?`SPEC`:`PRD`}function Lc(e,t,n){return t===``||Fc(e,n)===t}function Rc(){let[e,t]=(0,o.useState)(()=>Date.now());return(0,o.useEffect)(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}function zc(e,t=e,n){let[r,i]=(0,o.useState)(10),a=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let o=a.current;if(o===null||r>=e&&e>=t)return;let s=new IntersectionObserver(a=>{a.some(e=>e.isIntersecting)&&(r<e?i(t=>Math.min(e,t+10)):e<t&&n?.())},{rootMargin:`320px 0px`});return s.observe(o),()=>s.disconnect()},[e,t,r,n]),{hasMore:r<e||e<t,sentinelRef:a,visibleCount:Math.min(r,e)}}function Bc(e,t=[]){let n=new Set(t.filter(e=>e.telemetry!==null&&e.telemetry!==void 0).map(e=>e.id)),r=new Map(t.flatMap(e=>e.telemetry===null||e.telemetry===void 0?[]:[[e.id,{durationMs:e.telemetry.duration_ms,tokens:e.telemetry.tokens,costBrl:e.telemetry.cost_brl}]]));for(let t of e){if(t.task_id===null||n.has(t.task_id))continue;let e=r.get(t.task_id)??{durationMs:null,tokens:null,costBrl:null};r.set(t.task_id,{durationMs:Vc(e.durationMs,t.phase===`execution`&&t.parent_run_id==null?te(t):null),tokens:Vc(e.tokens,t.usage.total.tokens.total),costBrl:Vc(e.costBrl,t.usage.total.cost.brl)})}return r}function Vc(e,t){return e===null&&t===null?null:(e??0)+(t??0)}var Hc=[`definition`,`planning`,`ready`,`executing`,`verifying`,`completed`,`blocked`,`cancelled`,`failed`];function Uc(e){return e.status===`completed`?`completed`:e.status===`cancelled`?`cancelled`:e.status===`failed`?`failed`:e.status===`blocked`?`blocked`:e.is_active===!0||e.status===`executing`?`executing`:e.status===`verifying`?`verifying`:(e.attempt_count??0)>0||e.started_at!=null||e.execution_started===!0?`executing`:e.status===`draft`?null:e.status===`planned`?`ready`:null}function Wc(e,t){if(e.lifecycle_status===`cancelled`)return`cancelled`;if(e.lifecycle_status===`failed`)return`failed`;if(e.lifecycle_status===`blocked`)return`blocked`;if(e.lifecycle_status===`delivered`||e.lifecycle_status===`completed`)return`completed`;if(e.lifecycle_status===`ready`)return`ready`;if(e.kind===`prd`&&e.lifecycle_status===`draft`)return`definition`;if(e.kind===`spec`&&e.lifecycle_status===`draft`)return`planning`;if(e.work_status===`cancelled`)return`cancelled`;if(e.work_status===`failed`)return`failed`;if(e.work_status===`blocked`)return`blocked`;if(e.work_status===`completed`)return`completed`;if(e.is_active||t.some(t=>e.task_ids.includes(t.id)&&t.is_active))return`executing`;if(e.lifecycle_status===`verifying`||e.work_status===`verifying`)return`verifying`;if(e.work_status===`executing`){let n=t.filter(t=>e.task_ids.includes(t.id));return n.length>0&&n.every(e=>e.status===`verifying`||e.status===`completed`)?`verifying`:`executing`}return e.lifecycle_status===`active`?`executing`:`planning`}function Gc(e,t){return t===`task`?e.kind===`task`&&e.row.spec_id!==null:t===`standalone-task`?e.kind===`task`&&e.row.spec_id===null:t===`all`||e.kind===t}function Kc(e,t,n){let r=e.kind===`prd`?t.filter(t=>t.parent_id===e.id):[],i=new Set(r.map(e=>e.id)),a=new Set(e.task_ids);if(e.kind===`spec`)for(let t of n)t.spec_id===e.id&&a.add(t.id);else{for(let e of r)for(let t of e.task_ids)a.add(t);for(let e of n)e.spec_id!==null&&i.has(e.spec_id)&&a.add(e.id)}let o=n.filter(e=>a.has(e.id));return{completedSpecs:r.filter(Jc).length,totalSpecs:r.length,completedTasks:Math.max(o.filter(e=>e.status===`completed`).length,e.quality?.completed_tasks??0),totalTasks:Math.max(o.length,a.size,e.planned_tasks.length,e.task_count??0)}}function qc(e,t){let n=`Tasks ${t.completedTasks}/${t.totalTasks}`;return e===`prd`?`SPECs ${t.completedSpecs}/${t.totalSpecs} · ${n}`:n}function Jc(e){return e.lifecycle_status===`delivered`||e.work_status===`completed`}function Yc(e,t){return{"pt-BR":{definition:`Definição (PRD + Requisitos)`,planning:`Planejamento (SPEC + Change)`,ready:`Pronto para Executar`,executing:`Execução`,verifying:`Verificação`,completed:`Concluído`,blocked:`Bloqueado`,cancelled:`Cancelado`,failed:`Falhado`},"en-US":{definition:`Definition (PRDs)`,planning:`Planning`,ready:`Ready to Execute`,executing:`Executing`,verifying:`Verifying`,completed:`Completed`,blocked:`Blocked`,cancelled:`Cancelled`,failed:`Failed`}}[t][e]}function Xc({label:e,locale:t,onClose:n,onOpenDocument:r,onOpenTrace:i,row:a,runs:s,specs:c,tasks:u}){let d=(0,o.useRef)(null),f=(0,o.useRef)(null),[p,m]=(0,o.useState)(e===`SPEC`?a:null),h=(0,o.useMemo)(()=>Tc(c,a.id),[a.id,c]),g=(0,o.useMemo)(()=>Bc(s),[s]);(0,o.useEffect)(()=>{let e=d.current;if(e!==null)return e.open||e.showModal(),()=>{e.open&&e.close()}},[]);let _=e=>{f.current?.scrollTo({top:0}),m(e)},v=e===`PRD`&&p===null,y=p??a,b=Ec(y,u,g);return(0,l.jsx)(`dialog`,{className:`operations-status-dialog-backdrop operations-macro-dialog-backdrop`,onCancel:e=>{e.preventDefault(),n()},onMouseDown:e=>{e.currentTarget===e.target&&n()},ref:d,children:(0,l.jsxs)(`section`,{"aria-label":`${t===`pt-BR`?`Detalhes do`:`Details for`} ${e}`,"aria-modal":`true`,className:`operations-macro-planning-dialog`,"data-kind":v?`prd`:`spec`,role:`dialog`,children:[(0,l.jsxs)(`header`,{className:`operations-macro-dialog-header`,children:[(0,l.jsxs)(`div`,{className:`operations-macro-heading`,children:[(0,l.jsx)(`span`,{className:`operations-macro-heading-icon`,"aria-hidden":`true`,children:v?(0,l.jsx)(Go,{size:23}):(0,l.jsx)(Ho,{size:23})}),(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`operations-macro-kicker`,children:[(0,l.jsx)(`span`,{children:v?`PRD`:`SPEC`}),(0,l.jsx)(`i`,{}),(0,l.jsx)(`span`,{children:Yc(Wc(y,u),t)})]}),(0,l.jsx)(`h2`,{children:y.title}),(0,l.jsx)(`p`,{title:y.id,children:y.id})]})]}),r?(0,l.jsxs)(`button`,{className:`operations-macro-document-open`,onClick:()=>{n(),r(y.kind,y.id)},type:`button`,children:[(0,l.jsx)(Uo,{"aria-hidden":`true`,size:16}),t===`pt-BR`?`Ler ${v?`PRD`:`SPEC`} completa`:`Read full ${v?`PRD`:`SPEC`}`]}):null,(0,l.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,className:`operations-macro-close`,onClick:n,type:`button`,children:(0,l.jsx)(Xo,{"aria-hidden":`true`,size:20})})]}),(0,l.jsxs)(`div`,{className:`operations-macro-dialog-scroll`,ref:f,children:[e===`PRD`&&p!==null?(0,l.jsxs)(`button`,{className:`operations-macro-back`,onClick:()=>_(null),type:`button`,children:[(0,l.jsx)(Fo,{"aria-hidden":`true`,size:16}),(0,l.jsxs)(`span`,{children:[t===`pt-BR`?`Voltar ao PRD`:`Back to PRD`,(0,l.jsx)(`small`,{children:a.title})]})]}):null,(0,l.jsx)(kc,{locale:t,usage:Oc(y)}),(0,l.jsx)(Zc,{locale:t,row:y}),v?(0,l.jsx)($c,{locale:t,onSelectSpec:_,specs:h,tasks:u}):(0,l.jsx)(el,{locale:t,onOpenTrace:i,row:y,tasks:b,...e===`PRD`?{parentPrd:a}:{}})]})]})})}function Zc({locale:e,row:t}){return(0,l.jsx)(`dl`,{className:`operations-macro-overview-cards`,children:[{icon:(0,l.jsx)(Ko,{size:17}),label:`Tasks`,value:t.task_count},{icon:(0,l.jsx)(Yo,{size:17}),label:`Runs`,value:t.run_count},{icon:(0,l.jsx)(Wo,{size:17}),label:e===`pt-BR`?`Execuções`:`Executions`,value:t.execution_count},{icon:(0,l.jsx)(Ro,{size:17}),label:e===`pt-BR`?`Estado`:`State`,value:Qc(t.lifecycle_status,e)}].map(e=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),(0,l.jsx)(`dt`,{children:e.label}),(0,l.jsx)(`dd`,{children:e.value})]},e.label))})}function Qc(e,t){return{"pt-BR":{draft:`Rascunho`,planned:`Planejado`,ready:`Pronto`,active:`Ativo`,executing:`Em execução`,verifying:`Em verificação`,delivered:`Entregue`,completed:`Concluído`,blocked:`Bloqueado`,failed:`Falhado`,cancelled:`Cancelado`},"en-US":{draft:`Draft`,planned:`Planned`,ready:`Ready`,active:`Active`,executing:`Executing`,verifying:`Verifying`,delivered:`Delivered`,completed:`Completed`,blocked:`Blocked`,failed:`Failed`,cancelled:`Cancelled`}}[t][e]??e}function $c({locale:e,onSelectSpec:t,specs:n,tasks:r}){return(0,l.jsxs)(`section`,{className:`operations-macro-section operations-prd-specs`,children:[(0,l.jsx)(tl,{count:n.length,description:e===`pt-BR`?`Selecione uma SPEC para ver suas Tasks e abrir a rastreabilidade completa.`:`Select a SPEC to see its Tasks and open the complete trace.`,icon:(0,l.jsx)(Lo,{size:19}),title:e===`pt-BR`?`SPECs deste PRD`:`SPECs in this PRD`}),n.length>0?(0,l.jsx)(`div`,{className:`operations-prd-spec-grid`,children:n.map((n,i)=>(0,l.jsxs)(`button`,{onClick:()=>t(n),type:`button`,children:[(0,l.jsx)(`span`,{className:`operations-prd-spec-index`,children:String(i+1).padStart(2,`0`)}),(0,l.jsxs)(`div`,{className:`operations-prd-spec-copy`,children:[(0,l.jsx)(`span`,{children:Yc(Wc(n,r),e)}),(0,l.jsx)(`strong`,{children:n.title}),(0,l.jsx)(`code`,{title:n.id,children:n.id})]}),(0,l.jsx)(Ac,{locale:e,usage:Oc(n)}),(0,l.jsxs)(`span`,{className:`operations-prd-spec-action`,children:[(0,l.jsxs)(`small`,{children:[Math.max(n.task_count,n.planned_tasks.length),` Tasks`]}),(0,l.jsx)(Io,{"aria-hidden":`true`,size:18})]})]},n.id))}):(0,l.jsx)(nl,{text:e===`pt-BR`?`Este PRD ainda não possui SPEC vinculada.`:`This PRD does not have a linked SPEC yet.`})]})}function el({locale:e,onOpenTrace:t,parentPrd:n,row:r,tasks:i}){return(0,l.jsxs)(l.Fragment,{children:[n?(0,l.jsxs)(`div`,{className:`operations-spec-parent`,children:[(0,l.jsx)(Go,{"aria-hidden":`true`,size:16}),(0,l.jsx)(`span`,{children:e===`pt-BR`?`Parte do PRD`:`Part of PRD`}),(0,l.jsx)(`strong`,{children:n.title})]}):null,(0,l.jsxs)(`section`,{className:`operations-macro-section operations-spec-tasks`,children:[(0,l.jsx)(tl,{count:i.length,description:e===`pt-BR`?`Cada Task mantém sua telemetria e leva ao Trace completo do ciclo.`:`Each Task preserves its telemetry and opens the full lifecycle trace.`,icon:(0,l.jsx)(Yo,{size:19}),title:e===`pt-BR`?`Fluxo de Tasks`:`Task flow`}),i.length>0?(0,l.jsx)(`div`,{className:`operations-spec-task-list`,children:i.map(({id:n,preview:r,task:i,usage:a},o)=>(0,l.jsxs)(`button`,{disabled:i===null,onClick:()=>{i!==null&&t(n)},type:`button`,children:[(0,l.jsxs)(`span`,{className:`operations-spec-task-sequence`,children:[(0,l.jsx)(`i`,{}),String(o+1).padStart(2,`0`)]}),(0,l.jsxs)(`div`,{className:`operations-spec-task-copy`,children:[(0,l.jsx)(`span`,{children:i?Mc(i.status,e):e===`pt-BR`?`Planejada`:`Planned`}),(0,l.jsx)(`strong`,{children:i?.title??r?.title??n}),i===null&&r?.objective?(0,l.jsx)(`small`,{children:r.objective}):null,(0,l.jsx)(`code`,{title:n,children:n})]}),(0,l.jsx)(Ac,{locale:e,usage:a??Dc}),(0,l.jsxs)(`span`,{className:`operations-spec-task-action`,children:[i?e===`pt-BR`?`Abrir Trace`:`Open Trace`:e===`pt-BR`?`Materializa ao finalizar`:`Materializes when finalized`,i?(0,l.jsx)(Io,{"aria-hidden":`true`,size:17}):null]})]},n))}):(0,l.jsx)(nl,{text:e===`pt-BR`?`Esta SPEC ainda não possui Task materializada.`:`This SPEC does not have a materialized Task yet.`})]}),(0,l.jsxs)(`div`,{className:`operations-macro-document`,children:[(0,l.jsx)(Uo,{"aria-hidden":`true`,size:17}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:e===`pt-BR`?`Documento registrado`:`Registered document`}),(0,l.jsx)(`code`,{title:r.artifact_path,children:r.artifact_path})]})]})]})}function tl({count:e,description:t,icon:n,title:r}){return(0,l.jsxs)(`header`,{className:`operations-macro-section-heading`,children:[(0,l.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h3`,{children:r}),(0,l.jsx)(`p`,{children:t})]}),(0,l.jsx)(`strong`,{children:e})]})}function nl({text:e}){return(0,l.jsxs)(`div`,{className:`operations-macro-empty`,children:[(0,l.jsx)(Ho,{"aria-hidden":`true`,size:21}),(0,l.jsx)(`p`,{children:e})]})}var rl=`America/Sao_Paulo`,il={"2026-08-02":4809511,"2026-08-01":8894527,"2026-07-31":9472804,"2026-07-30":5167818,"2026-07-29":11336221,"2026-07-28":8262282,"2026-07-27":4862150,"2026-07-26":970899,"2026-07-25":7465970,"2026-07-24":9041538,"2026-07-23":19750,"2026-07-22":1371560,"2026-07-21":14992543,"2026-07-20":3168460,"2026-07-19":929990,"2026-07-18":9232700,"2026-07-17":16882853,"2026-07-16":20054785,"2026-07-15":35459620,"2026-07-14":24078852,"2026-07-13":22611635,"2026-07-12":8339738,"2026-07-11":1859980},al={cutoff:`2026-08-02T03:14:00.000Z`,cutoffDay:`2026-08-02`,durationMs:Object.values(il).reduce((e,t)=>e+t,0),costXlsxSha256:`C3EE0495667289FB81DD8F9268697CEB7692433C14CB19934C89B5F39129902A`,operationsXlsxSha256:`94E9577A7CA27F7FDD277D81E34156296CB28FE39CF6D7636B259EBBB7E56BCC`};function ol(e){return e!=null&&Date.parse(e)>=Date.parse(al.cutoff)}function sl(e,t){if(e==null)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;let r=new Intl.DateTimeFormat(`en-CA`,{timeZone:rl,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(n),i=e=>r.find(t=>t.type===e)?.value,a=i(`year`),o=i(`month`),s=i(`day`);return a===void 0||o===void 0||s===void 0?null:t===`year`?a:t===`month`?`${a}-${o}`:`${a}-${o}-${s}`}function cl(e,t,n=new Date){let r=e?.map(e=>e.key).filter((t,n,r)=>/^\d{4}-\d{2}-\d{2}$/.test(t)&&(e[n].estimated_brl!==null||e[n].estimated_usd!==null)).sort()[0];return r===void 0?t:{start:r,end:xl(n)}}function ll(e,t=new Date){let n=e.reduce((e,t)=>Math.min(e,Date.parse(t.created_at)),1/0);return{start:xl(Number.isFinite(n)?new Date(n):t),end:xl(t)}}function ul(e,t,n=new Date){if(e.length>0)return ll(e,n);let r=t.filter(e=>/^\d{4}-\d{2}-\d{2}$/.test(e)).sort();return r.length===0?ll(e,n):{start:r[0],end:r.at(-1)}}function dl(e,t=new Date){let n=_l(t),r=_l(t);if(e===`yesterday`)return r=vl(n,-1),gl(r,r);if(e===`this-week`)return gl(vl(n,-bl(n)),n);if(e===`last-week`){let e=vl(n,-bl(n));return gl(vl(e,-7),vl(e,-1))}return e===`this-month`?gl(new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1,12)),n):e===`last-month`?gl(new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()-1,1,12)),new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),0,12))):e===`last-3-months`?gl(yl(n,-3),n):e===`last-6-months`?gl(yl(n,-6),n):e===`this-year`?gl(new Date(Date.UTC(n.getUTCFullYear(),0,1,12)),n):e===`last-year`?gl(new Date(Date.UTC(n.getUTCFullYear()-1,0,1,12)),new Date(Date.UTC(n.getUTCFullYear()-1,11,31,12))):gl(n,n)}function fl(e,t,n){return pl(e??n,t)}function pl(e,t){if(e==null)return!1;let n=sl(e,`day`);return n!==null&&n>=t.start&&n<=t.end}function ml(e,t,n){return t===`all`||pl(e,n)}function hl(e,t,n){return ml(e.finished_at??e.started_at,t,n)}function gl(e,t){return{start:xl(e),end:xl(t)}}function _l(e){let t=sl(e.toISOString(),`day`);if(t===null)throw RangeError(`Invalid Operations date anchor`);return new Date(`${t}T12:00:00.000Z`)}function vl(e,t){let n=new Date(e);return n.setUTCDate(n.getUTCDate()+t),n}function yl(e,t){let n=e.getUTCDate(),r=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1,12)),i=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+1,0,12)).getUTCDate();return r.setUTCDate(Math.min(n,i)),r}function bl(e){return(e.getUTCDay()+6)%7}function xl(e){let t=sl(e.toISOString(),`day`);if(t===null)throw RangeError(`Invalid Operations date value`);return t}var Sl={"pt-BR":{all:`Todo o Período`,custom:`Personalizado`,today:`Hoje`,yesterday:`Ontem`,"this-week":`Esta Semana`,"last-week":`Semana Passada`,"this-month":`Este Mês`,"last-month":`Mês Passado`,"last-3-months":`Últimos 3 meses`,"last-6-months":`Últimos 6 meses`,"this-year":`Este Ano`,"last-year":`Último ano`},"en-US":{all:`All Time`,custom:`Custom`,today:`Today`,yesterday:`Yesterday`,"this-week":`This Week`,"last-week":`Last Week`,"this-month":`This Month`,"last-month":`Last Month`,"last-3-months":`Last 3 months`,"last-6-months":`Last 6 months`,"this-year":`This Year`,"last-year":`Last year`}},Cl=Object.keys(Sl[`pt-BR`]);function wl(e,t){return e===`all`?{disabled:!0,start:t.start,end:t.end}:{disabled:!1,start:t.start,end:t.end}}function Tl({ariaLabelSuffix:e=``,dateRange:t,defaultDateRange:n,locale:r,onDateRangeChange:i,onPresetChange:a,preset:o}){let s=wl(o,t);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`label`,{className:`operations-toolbar-field operations-date-field`,children:[(0,l.jsx)(`span`,{children:r===`pt-BR`?`Data inicial`:`Start date`}),(0,l.jsx)(`input`,{"aria-label":`${r===`pt-BR`?`Data inicial`:`Start date`}${e}`,disabled:s.disabled,onInput:e=>{let n=e.currentTarget.value;i({start:n,end:n>t.end?n:t.end})},type:`date`,value:s.start})]}),(0,l.jsxs)(`label`,{className:`operations-toolbar-field operations-date-field`,children:[(0,l.jsx)(`span`,{children:r===`pt-BR`?`Data final`:`End date`}),(0,l.jsx)(`input`,{"aria-label":`${r===`pt-BR`?`Data final`:`End date`}${e}`,disabled:s.disabled,onInput:e=>{let n=e.currentTarget.value;i({start:n<t.start?n:t.start,end:n})},type:`date`,value:s.end})]}),(0,l.jsxs)(`label`,{className:`operations-toolbar-field operations-period-field`,children:[(0,l.jsx)(`span`,{children:r===`pt-BR`?`Período`:`Period`}),(0,l.jsx)(`select`,{"aria-label":`${r===`pt-BR`?`Período`:`Period`}${e}`,onChange:e=>{let r=e.target.value;if(r===`all`){a(r,n);return}if(r===`custom`){a(r,t);return}a(r,dl(r))},value:o,children:Cl.map(e=>(0,l.jsx)(`option`,{value:e,children:Sl[r][e]},e))})]})]})}function El({locale:e,query:t,status:n,risk:r,origin:i,onQuery:a,onStatus:o,onRisk:s,onOrigin:c}){let u=e===`pt-BR`?`Todos`:`All`;return(0,l.jsxs)(`div`,{className:`operations-entity-filters`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:e===`pt-BR`?`Busca`:`Search`}),(0,l.jsx)(`input`,{"aria-label":e===`pt-BR`?`Busca`:`Search`,value:t,onChange:e=>a(e.target.value)})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:`Status`}),(0,l.jsxs)(`select`,{"aria-label":`Status`,value:n,onChange:e=>o(e.target.value),children:[(0,l.jsx)(`option`,{value:``,children:u}),Hc.map(t=>(0,l.jsx)(`option`,{value:t,children:Yc(t,e)},t))]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:e===`pt-BR`?`Risco`:`Risk`}),(0,l.jsxs)(`select`,{"aria-label":e===`pt-BR`?`Risco`:`Risk`,value:r,onChange:e=>s(e.target.value),children:[(0,l.jsx)(`option`,{value:``,children:u}),[`lite`,`standard`,`critical`].map(t=>(0,l.jsx)(`option`,{value:t,children:Nc(t,e)},t))]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:e===`pt-BR`?`Origem`:`Origin`}),(0,l.jsxs)(`select`,{"aria-label":e===`pt-BR`?`Origem`:`Origin`,value:i,onChange:e=>c(e.target.value),children:[(0,l.jsx)(`option`,{value:``,children:u}),Pc.map(e=>(0,l.jsx)(`option`,{value:e,children:Ic(e)},e))]})]})]})}function Dl({locale:e}){return e===`pt-BR`?(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`operations-locale-flag`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,l.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,l.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`operations-locale-flag`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,l.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,l.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`})]})}function Ol(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`M20 11a8.1 8.1 0 1 0 2 5.3M20 4v7h-7`})})}function kl(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`M4 6h16M7 12h10m-7 6h4`})})}function Al(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg operations-locale-chevron`,fill:`none`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function jl(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-reset-icon`,fill:`none`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`M3 12a9 9 0 1 0 3-6.7M3 4v6h6`})})}function Ml(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 20 20`,children:(0,l.jsx)(`path`,{d:`m6 6 8 8M14 6l-8 8`})})}var Nl={"pt-BR":{"work-kanban":`Visão de Quadro (Kanban)`,"work-list":`Visão de Lista`,changes:`Mudanças`,executions:`Execuções`,runs:`Invocações de agentes`,conversations:`Conversas`,decisions:`Decisões`,daily:`Diário`,monthly:`Mensal`,yearly:`Anual`},"en-US":{"work-kanban":`Work (Kanban)`,"work-list":`Work (List)`,changes:`Changes`,executions:`Executions`,runs:`Agent invocations`,conversations:`Conversations`,decisions:`Decisions`,daily:`Daily`,monthly:`Monthly`,yearly:`Annual`}};function Pl({locale:e,onChange:t,view:n}){return(0,l.jsx)(`nav`,{"aria-label":`Entidades do ciclo de trabalho`,children:[`work-kanban`,`work-list`].map(r=>(0,l.jsx)(`button`,{"aria-pressed":n===r,className:n===r?`is-active`:void 0,onClick:()=>t(r),type:`button`,children:Nl[e][r]},r))})}function Fl({entityPage:e,locale:t,onChange:n}){return(0,l.jsxs)(`div`,{"aria-live":`polite`,className:`operations-page-controls`,children:[e.error?(0,l.jsx)(`span`,{children:e.error}):null,e.loading?(0,l.jsx)(`span`,{children:t===`pt-BR`?`Carregando…`:`Loading…`}):null,(0,l.jsx)(`button`,{disabled:e.loading||e.offset===0,onClick:()=>n?.(Math.max(0,e.offset-100)),type:`button`,children:t===`pt-BR`?`Anterior`:`Previous`}),(0,l.jsx)(`button`,{disabled:e.loading||e.total===null||e.offset+100>=e.total,onClick:()=>n?.(e.offset+100),type:`button`,children:t===`pt-BR`?`Próxima`:`Next`})]})}function Il({state:e,error:t,locale:n}){return e===`loading`?(0,l.jsxs)(`div`,{"aria-busy":`true`,"aria-label":n===`pt-BR`?`Carregando itens da coluna`:`Loading column items`,className:`operations-column-skeleton`,role:`status`,children:[(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{})]}):e===`error`?(0,l.jsx)(`p`,{className:`operations-empty`,role:`alert`,children:t}):e===`empty`?(0,l.jsx)(`p`,{className:`operations-empty`,children:n===`pt-BR`?`Sem itens`:`No items`}):null}function Ll(e,t){return e===`pt-BR`?`Abrir ${t}`:`Open ${t}`}function Rl(e,t,n){return e>0?`content`:n?.error?`error`:n===void 0||n.loading||t>0?`loading`:`empty`}function zl(e,t){let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>[e.row.id,e.row.title,e.kind].some(e=>e.toLocaleLowerCase().includes(n))):[...e]}function Bl({allPrds:e,allSpecs:t,allTasks:n,boardTotals:r,boardKindTotals:i,boardStates:a,changes:s,locale:c,onOpenDocument:u,onOpenTask:d,onPriorityChange:f,onLoadMore:p,onTypeChange:m,prds:h,runs:g,specs:_,tasks:v}){let y=Rc(),[b,x]=(0,o.useState)(`all`),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(null),[E,D]=(0,o.useState)(``),[O,k]=(0,o.useState)(null),[A,j]=(0,o.useState)(null),ee=(0,o.useMemo)(()=>Bc([],v),[v]),M=(0,o.useMemo)(()=>ql([...e.map(e=>({kind:`prd`,row:e})),...t.map(e=>({kind:`spec`,row:e})),...n.map(e=>({kind:`task`,row:e}))],A),[e,t,n,A]),te=(0,o.useMemo)(()=>M.filter(e=>Gc(e,b)),[M,b]),ne=(0,o.useMemo)(()=>new Map([...h,..._].map(e=>[e.id,Kc(e,t,n)])),[t,n,h,_]),re=S===null?[]:te.filter(e=>Kl(e,n)===S),N=e=>{C(null),e.kind===`task`?d(e.row.id):T(e.row)};return(0,l.jsxs)(`section`,{className:`operations-unified-work`,children:[(0,l.jsx)(Vl,{locale:c,onChange:e=>{x(e),m?.(e)},value:b}),(0,l.jsx)(`section`,{"aria-label":c===`pt-BR`?`Kanban de trabalho`:`Work Kanban`,className:`operations-board operations-work-board`,children:Hc.map(e=>{let t=te.filter(t=>Kl(t,n)===e);return(0,l.jsx)(Hl,{changes:s,globalItems:M,items:t,locale:c,nowMs:y,onOpenColumn:()=>{D(``),C(e)},onLoadMore:p===void 0?void 0:()=>p(e),onOpenItem:N,onPriorityChange:async e=>{let t=A;j(e);try{await f(e)}catch{j(t)}},onDragEnd:()=>k(null),onDragStart:k,draggedId:O,progressByMacro:ne,stage:e,totalItems:b===`all`?i?.[e]?.all??r?.[e]??t.length:b===`task`||b===`standalone-task`||b===`prd`||b===`spec`?i?.[e]?.[b]??t.length:t.length,state:a?.[e],totalsByTask:ee},e)})}),S?(0,l.jsx)(Gl,{items:re,locale:c,onClose:()=>C(null),onOpenItem:N,onQueryChange:D,query:E,stage:S}):null,w?(0,l.jsx)(Xc,{label:w.kind===`prd`?`PRD`:`SPEC`,locale:c,onClose:()=>T(null),onOpenDocument:u,onOpenTrace:e=>{T(null),d(e)},row:w,runs:g,specs:t,tasks:n}):null]})}function Vl({locale:e,onChange:t,value:n}){let r=e===`pt-BR`?{task:`Tarefas`,all:`Tudo`,prd:`PRDs`,spec:`SPECs`,"standalone-task":`Tarefa Avulsa`}:{task:`Tasks`,all:`All`,prd:`PRDs`,spec:`SPECs`,"standalone-task":`Standalone Tasks`};return(0,l.jsx)(`nav`,{"aria-label":e===`pt-BR`?`Filtrar tipo de trabalho`:`Filter work type`,className:`operations-work-type-filters`,children:[`all`,`task`,`standalone-task`,`prd`,`spec`].map(e=>(0,l.jsx)(`button`,{className:n===e?`is-active`:void 0,onClick:()=>t(e),type:`button`,children:r[e]},e))})}function Hl({changes:e,globalItems:t,items:n,totalItems:r,state:i,locale:a,nowMs:o,onOpenColumn:s,onLoadMore:c,onOpenItem:u,onPriorityChange:d,onDragEnd:f,onDragStart:p,draggedId:m,progressByMacro:h,stage:g,totalsByTask:_}){let{hasMore:v,sentinelRef:y,visibleCount:b}=zc(n.length,r,c),x=Rl(n.length,r,i);return(0,l.jsxs)(`article`,{className:`operations-column is-${g}`,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsx)(`button`,{className:`operations-column-trigger`,onClick:s,type:`button`,children:Yc(g,a)}),(0,l.jsx)(`button`,{"aria-label":`${r} — ${Yc(g,a)}`,className:`operations-column-count`,onClick:s,type:`button`,children:r})]}),(0,l.jsxs)(`div`,{className:`operations-column-body`,children:[n.slice(0,b).map((r,i)=>(0,l.jsx)(Ul,{changes:e,item:r,locale:a,nowMs:o,onOpen:()=>u(r),onMove:e=>{let r=i+e;if(r<0||r>=n.length)return;let a=[...n];[a[i],a[r]]=[a[r],a[i]],d(Wl(t,n,a))},onDrop:()=>{let e=n.findIndex(e=>e.row.id===m);if(e<0||e===i)return;let r=[...n],[a]=r.splice(e,1);a!==void 0&&(r.splice(i,0,a),d(Wl(t,n,r)))},onDragEnd:f,onDragStart:()=>p(r.row.id),order:i+1,progress:h.get(r.row.id),stage:g,totalsByTask:_},r.row.id)),(0,l.jsx)(Il,{error:i?.error,locale:a,state:x}),v?(0,l.jsx)(`div`,{"aria-live":`polite`,className:`operations-infinite-sentinel`,ref:y,role:i?.error?`alert`:`status`,children:i?.error?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{children:i.error}),(0,l.jsx)(`button`,{onClick:c,type:`button`,children:`Tentar novamente`})]}):i?.loading?`Carregando mais…`:`${b} de ${r} · carregando mais…`}):null]})]})}function Ul({changes:e,item:t,locale:n,nowMs:r,onOpen:i,onMove:a,onDrop:o,onDragEnd:s,onDragStart:c,order:u,progress:d,stage:f,totalsByTask:p}){let m=vc(t.row.created_at,Xl(f),n,r),h=t.kind===`task`?t.row:null,g=t.kind===`task`?null:t.row,_=h?Fc(h,e):t.kind,v=_===`task`?`Tarefa Avulsa`:t.kind.toUpperCase(),y=h?p.get(h.id):null,b=g?[g.duration_ms,g.usage.total.tokens.total,g.usage.total.cost.brl]:[y?.durationMs??null,y?.tokens??null,y?.costBrl??null];return(0,l.jsxs)(`article`,{className:`operations-task-card operations-work-card is-kind-${_}`,draggable:f===`ready`,onDragEnd:f===`ready`?s:void 0,onDragOver:f===`ready`?e=>e.preventDefault():void 0,onDragStart:f===`ready`?c:void 0,onDrop:f===`ready`?e=>{e.preventDefault(),o()}:void 0,children:[(0,l.jsxs)(`button`,{"aria-label":Ll(n,t.row.title),className:`operations-work-card-open`,onClick:i,type:`button`,children:[f===`ready`?(0,l.jsx)(`span`,{className:`operations-work-card-first-line`,children:(0,l.jsxs)(`span`,{className:`operations-work-order`,children:[`#`,u]})}):null,(0,l.jsx)(`span`,{className:`operations-work-kind is-${t.kind}`,children:v}),u===1&&f===`ready`?(0,l.jsx)(`span`,{className:`operations-work-next`,children:`Próximo`}):null,f===`ready`?null:(0,l.jsx)(`span`,{className:`operations-work-status is-${f}`,children:Zl(f,n)}),h?(0,l.jsx)(`span`,{className:`operations-risk is-${h.risk}`,children:Nc(h.risk,n)}):null,(0,l.jsx)(`strong`,{title:t.row.title,children:t.row.title})]}),f===`ready`?(0,l.jsxs)(`div`,{className:`operations-work-reorder`,children:[(0,l.jsx)(`button`,{"aria-label":n===`pt-BR`?`Mover acima`:`Move up`,onClick:()=>a(-1),type:`button`,children:`↑`}),(0,l.jsx)(`button`,{"aria-label":n===`pt-BR`?`Mover abaixo`:`Move down`,onClick:()=>a(1),type:`button`,children:`↓`})]}):null,(0,l.jsx)(`small`,{title:t.row.id,children:t.row.id}),t.row.created_at?(0,l.jsx)(`small`,{className:`operations-card-created`,children:xc(t.row.created_at,n)}):null,m?(0,l.jsx)(`span`,{className:`operations-elapsed-badge${m.alert?` is-alert`:``}`,children:m.label}):null,g?(0,l.jsx)(`span`,{className:`operations-work-card-counts`,children:qc(g.kind,d??{completedSpecs:0,totalSpecs:0,completedTasks:0,totalTasks:0})}):null,(0,l.jsx)(`dl`,{className:`operations-task-usage operations-macro-usage`,children:[[n===`pt-BR`?`Tempo`:`Time`,b[0]==null?`—`:Cc(b[0])],[`Tokens`,b[1]==null?`—`:D(b[1])],[n===`pt-BR`?`Custo`:`Cost`,b[2]==null?`—`:k(b[2],`BRL`)]].map(([e,t])=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`dt`,{children:e}),(0,l.jsx)(`dd`,{children:t})]},e))})]})}function Wl(e,t,n){let r=new Set(t.map(e=>e.row.id)),i=n.map(e=>e.row.id),a=0;return e.map(e=>r.has(e.row.id)?i[a++]??e.row.id:e.row.id)}function Gl({items:e,locale:t,onClose:n,onOpenItem:r,onQueryChange:i,query:a,stage:o}){let s=zl(e,a);return(0,y.createPortal)((0,l.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>e.currentTarget===e.target&&n(),open:!0,children:(0,l.jsxs)(`section`,{"aria-label":Yc(o,t),"aria-modal":`true`,className:`operations-status-dialog`,role:`dialog`,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:t===`pt-BR`?`Coluna de trabalho`:`Work column`}),(0,l.jsx)(`h2`,{children:Yc(o,t)}),(0,l.jsxs)(`p`,{children:[e.length,` itens`]})]}),(0,l.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,onClick:n,type:`button`,children:`×`})]}),(0,l.jsxs)(`label`,{className:`operations-status-dialog-search`,children:[(0,l.jsx)(`span`,{children:t===`pt-BR`?`Buscar itens`:`Search items`}),(0,l.jsx)(`input`,{autoFocus:!0,onChange:e=>i(e.target.value),placeholder:t===`pt-BR`?`Título, ID ou tipo`:`Title, ID, or type`,type:`search`,value:a})]}),(0,l.jsxs)(`div`,{className:`operations-status-task-list`,children:[s.map(e=>(0,l.jsxs)(`button`,{onClick:()=>r(e),type:`button`,children:[(0,l.jsxs)(`span`,{className:`operations-status-task-main`,children:[(0,l.jsx)(`strong`,{children:e.row.title}),(0,l.jsx)(`small`,{children:e.row.id})]}),(0,l.jsx)(`span`,{className:`operations-work-kind is-${e.kind}`,children:e.kind===`task`?`TASK`:e.kind.toUpperCase()}),(0,l.jsxs)(`span`,{className:`operations-status-task-action`,children:[t===`pt-BR`?`Ver detalhes`:`View details`,` →`]})]},`${e.kind}:${e.row.id}`)),s.length===0?(0,l.jsx)(`p`,{className:`operations-empty`,children:t===`pt-BR`?`Nenhum item encontrado nesta coluna.`:`No items found in this column.`}):null]})]})}),document.body)}function Kl(e,t){return e.kind===`task`?Uc(e.row):Wc(e.row,t)}function ql(e,t=null){let n=t===null?null:new Map(t.map((e,t)=>[e,t]));return e.sort((e,t)=>Jl(n?.get(e.row.id)??e.row.manual_order,n?.get(t.row.id)??t.row.manual_order)||Yl(e).localeCompare(Yl(t))||e.row.id.localeCompare(t.row.id))}function Jl(e,t){return e!=null&&t!=null?e-t:e==null?t==null?0:1:-1}function Yl(e){return e.kind===`task`?e.row.updated_at:e.row.updated_at??e.row.created_at??``}function Xl(e){return e===`definition`?`draft`:e===`planning`||e===`ready`?`planned`:e===`blocked`?`blocked`:e}function Zl(e,t){return{"pt-BR":{definition:`Definição`,planning:`Planejamento`,ready:`Pronto para executar`,executing:`Executando`,verifying:`Em verificação`,completed:`Concluído`,blocked:`Bloqueado`,cancelled:`Cancelado`,failed:`Falhado`},"en-US":{definition:`Definition`,planning:`Planning`,ready:`Ready to execute`,executing:`Running`,verifying:`Verifying`,completed:`Completed`,blocked:`Blocked`,cancelled:`Cancelled`,failed:`Failed`}}[t][e]}function Ql(e,t=`—`){return typeof e==`string`&&e.length>0?e:t}function $l(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function eu(e,t){let n=e.stage??e.status;return n===`draft`?t===`pt-BR`?`Rascunho`:`Draft`:Hc.includes(n)?Yc(n,t):Ql(n)}function tu(e,t){let n=Ql(e,``);return n===`task`||n===`standalone-task`||n===`prd`||n===`spec`?(t===`pt-BR`?{task:`Tarefas`,"standalone-task":`Tarefa Avulsa`,prd:`PRD`,spec:`SPEC`}:{task:`Tasks`,"standalone-task":`Standalone Task`,prd:`PRD`,spec:`SPEC`})[n]:Ql(e)}function nu({loading:e,locale:t,onPageChange:n,onTypeChange:r,page:i}){return(0,l.jsxs)(`section`,{"aria-busy":e||void 0,className:`operations-unified-work operations-work-list`,children:[(0,l.jsx)(Vl,{locale:t,onChange:r,value:i.typeFilter}),(0,l.jsx)(`div`,{className:`operations-work-list-table`,children:(0,l.jsx)(b,{columns:[{key:`item`,label:`Item`,render:e=>(0,l.jsxs)(`span`,{className:`operations-work-list-identity`,children:[(0,l.jsx)(`strong`,{children:Ql(e.title,Ql(e.id))}),(0,l.jsx)(`small`,{children:Ql(e.id)})]}),sortValue:e=>Ql(e.title,Ql(e.id))},{key:`status`,label:`Status`,render:e=>eu(e,t),sortValue:e=>eu(e,t)},{key:`type`,label:t===`pt-BR`?`Tipo`:`Type`,render:e=>tu(e.kind??e.entity_kind,t),sortValue:e=>Ql(e.kind??e.entity_kind)},{key:`risk`,label:t===`pt-BR`?`Risco`:`Risk`,render:e=>Ql(e.risk),sortValue:e=>Ql(e.risk)},{key:`developers`,label:t===`pt-BR`?`Desenvolvedor`:`Developer`,render:e=>$o(e.developers),sortValue:e=>$o(e.developers)},{key:`time`,label:t===`pt-BR`?`Tempo`:`Time`,render:e=>{let t=$l(e.total_duration);return t===null?`—`:Cc(t)},sortValue:e=>$l(e.total_duration),align:`right`},{key:`tokens`,label:`Tokens`,render:e=>{let t=$l(e.total_tokens);return t===null?`—`:D(t)},sortValue:e=>$l(e.total_tokens),align:`right`},{key:`cost`,label:t===`pt-BR`?`Custo`:`Cost`,render:e=>{let t=$l(e.total_cost_brl);return t===null?`—`:k(t,`BRL`)},sortValue:e=>$l(e.total_cost_brl),align:`right`}],defaultSort:{key:`item`,direction:`asc`},emptyMessage:e?t===`pt-BR`?`Carregando itens…`:`Loading items…`:t===`pt-BR`?`Nenhum item de trabalho encontrado.`:`No work items found.`,locale:t,rowKey:e=>Ql(e.id),rows:i.rows,scrollLabel:t===`pt-BR`?`Lista paginada de itens de trabalho.`:`Paged work item list.`,sortable:!0})}),(0,l.jsxs)(`nav`,{"aria-label":t===`pt-BR`?`Paginação da lista de trabalho`:`Work list pagination`,className:`ui-table-pagination`,children:[i.error?(0,l.jsx)(`span`,{role:`alert`,children:i.error}):null,e?(0,l.jsx)(`span`,{role:`status`,children:t===`pt-BR`?`Atualizando…`:`Updating…`}):null,(0,l.jsx)(`button`,{disabled:e||i.offset===0,onClick:()=>n(Math.max(0,i.offset-i.limit)),type:`button`,children:t===`pt-BR`?`Anterior`:`Previous`}),(0,l.jsx)(`output`,{"aria-live":`polite`,children:i.total===null?`…`:`${i.offset+(i.rows.length===0?0:1)}–${Math.min(i.offset+i.limit,i.total)} ${t===`pt-BR`?`de`:`of`} ${i.total}`}),(0,l.jsx)(`button`,{disabled:e||!i.hasMore,onClick:()=>n(i.offset+i.limit),type:`button`,children:t===`pt-BR`?`Próxima`:`Next`})]})]})}function ru(e){let t=new Map;for(let n of e)t.has(n.id)||t.set(n.id,n);return[...t.values()].filter(e=>(e.phase===void 0||e.phase===`execution`)&&(e.parent_run_id===void 0||e.parent_run_id===null))}function iu(e){let t=new Map;for(let n of e)t.has(n.id)||t.set(n.id,n);return[...t.values()]}function au(e){return e!==null&&e>=0?e:null}function ou(e){return au(e.source_duration_ms??null)}function su(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)}function cu(e){let t=ru(e);return{runs:t,durationMs:su(t.map(ou)),tokens:su(t.map(e=>e.usage.total.tokens.total)),costBrl:su(t.map(e=>e.usage.total.cost.brl))}}function lu(e){let t=iu(e);return{runs:t,durationMs:su(t.map(ou)),tokens:su(t.map(e=>e.usage.total.tokens.total)),costBrl:su(t.map(e=>e.usage.total.cost.brl))}}function uu(e){let t=lu(e);return{runs:t.runs,tokens:t.tokens,costBrl:t.costBrl}}function du(e,t,n,r=!1,i){let a=new Map,o=new Map,s=new Map,c=mu(e.runs,t,r,i),l=new Set((e.evidences??[]).map(e=>e.id)),u=e=>{let t=a.get(e);if(t!==void 0)return t;let n={key:e,prds:0,specs:0,tasks:0,tasksCreated:0,tasksActive:0,taskDaysActive:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};return a.set(e,n),o.set(e,new Set),s.set(e,new Set),n},d=e=>{let n=Su(e,t);return n===null?null:u(n)};for(let t of e.prds){let e=d(t.created_at);e!==null&&(e.prds+=1)}for(let t of e.specs){let e=d(t.created_at);e!==null&&(e.specs+=1)}for(let t of e.tasks){let n=d(t.created_at);if(n===null)continue;n.tasks+=1,n.tasksCreated+=1,e.validations===void 0&&(n.tests+=t.test_count??0);let r=o.get(n.key);for(let e of t.result?.evidence_ids??[])l.has(e)||r?.add(e)}for(let t of e.evidences??[]){let e=d(t.observed_at);e!==null&&o.get(e.key)?.add(t.id)}let f=new Map;for(let t of e.validations??[]){let e=d(t.executed_at);if(e===null)continue;let n=f.get(e.key)??new Set;n.add(t.id),f.set(e.key,n)}for(let t of iu(e.runs)){let e=d(t.started_at);e!==null&&(e.runs+=1,t.task_id!==null&&t.task_id!==void 0&&s.get(e.key)?.add(t.task_id),e.tokens=yu(e.tokens,t.usage.total.tokens.total),e.costBrl=yu(e.costBrl,n===void 0?t.usage.total.cost.brl:n(t.id)))}for(let[e,t]of o){let n=a.get(e);n!==void 0&&(n.evidences=t.size)}for(let[e,t]of f){let n=a.get(e);n!==void 0&&(n.tests=t.size)}for(let[e,t]of s){let n=a.get(e);n!==void 0&&(n.tasksActive=t.size,n.taskDaysActive=t.size)}for(let[e,t]of c)u(e).durationMs=t;return[...a.values()].sort((e,t)=>t.key.localeCompare(e.key))}function fu(e,t){let n=new Map;for(let[r,i]of Object.entries(e)){let e=Su(`${r}T12:00:00.000Z`,t);if(e===null)continue;let a=n.get(e)??{key:e,prds:0,specs:0,tasks:0,tasksCreated:0,tasksActive:0,taskDaysActive:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};a.prds+=i.prds,a.specs+=i.specs,a.tasks+=i.tasks,a.tasksCreated+=i.tasks,a.tasksActive=(a.tasksActive??0)+i.tasks,a.taskDaysActive+=i.tasks,a.runs+=i.runs,a.tests+=i.validations,a.evidences+=i.evidences,a.tokens=yu(a.tokens,pu(i.runs,i.usage.total_tokens)),a.costBrl=yu(a.costBrl,pu(i.runs,i.usage.cost)),a.durationMs=yu(a.durationMs,pu(i.runs,i.duration)),n.set(e,a)}return[...n.values()].sort((e,t)=>t.key.localeCompare(e.key))}function pu(e,t){return t===void 0||t.unknown>=e?null:t.known_sum}function mu(e,t,n,r){let i=new Map;for(let r of ru(e)){if(n&&!ol(r.started_at))continue;let e=ou(r);if(e===null)continue;let a=r.source_started_at??r.duration_started_at??r.started_at,o=Date.parse(a);if(!Number.isFinite(o))continue;let s=o+e,c=o;do{let e=Su(new Date(c).toISOString(),t);if(e===null)break;let n=Math.min(s,hu(e,t));if(i.set(e,(i.get(e)??0)+n-c),n>=s)break;c=n}while(c<=s)}if(n)for(let[e,n]of Object.entries(il)){let a=Date.parse(`${e}T12:00:00.000Z`);if(r?.from!==null&&r?.from!==void 0&&a<Date.parse(r.from)||r?.to!==null&&r?.to!==void 0&&a>Date.parse(r.to))continue;let o=Su(`${e}T12:00:00.000Z`,t);o!==null&&i.set(o,(i.get(o)??0)+n)}return i}function hu(e,t){let[n,r=1,i=1]=e.split(`-`).map(Number),a=new Date(Date.UTC(n,r-1,i));return t===`day`?a.setUTCDate(a.getUTCDate()+1):t===`month`?a.setUTCMonth(a.getUTCMonth()+1,1):a.setUTCFullYear(a.getUTCFullYear()+1,0,1),gu(a.getUTCFullYear(),a.getUTCMonth()+1,a.getUTCDate())}function gu(e,t,n){let r=Date.UTC(e,t-1,n),i=new Intl.DateTimeFormat(`en-US`,{timeZone:`America/Sao_Paulo`,timeZoneName:`longOffset`}).formatToParts(new Date(r)).find(e=>e.type===`timeZoneName`)?.value??`GMT`,a=/^GMT([+-])(\d{2}):(\d{2})$/.exec(i);return a===null?r:r-(Number(a[2])*60+Number(a[3]))*6e4*(a[1]===`+`?1:-1)}function _u(e){let t={prds:0,specs:0,tasks:0,tasksCreated:0,tasksActive:null,taskDaysActive:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};for(let n of e)t.prds+=n.prds,t.specs+=n.specs,t.tasks+=n.tasks,t.tasksCreated+=n.tasksCreated,t.taskDaysActive+=n.taskDaysActive,t.runs+=n.runs,t.tests+=n.tests,t.evidences+=n.evidences,t.durationMs=yu(t.durationMs,n.durationMs),t.tokens=yu(t.tokens,n.tokens),t.costBrl=yu(t.costBrl,n.costBrl);return t}function vu(e){let t=e.length;return{tasks:t===0?null:e.reduce((e,t)=>e+t.tasks,0)/t,specs:t===0?null:e.reduce((e,t)=>e+t.specs,0)/t,prds:t===0?null:e.reduce((e,t)=>e+t.prds,0)/t,durationMs:xu(e.map(e=>e.durationMs),t),tokens:bu(e.map(e=>e.tokens)),costBrl:bu(e.map(e=>e.costBrl))}}function yu(e,t){return t===null?e:(e??0)+t}function bu(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function xu(e,t){if(t===0)return null;let n=e.filter(e=>e!==null);return n.length===0?null:n.reduce((e,t)=>e+t,0)/t}function Su(e,t){return sl(e,t)}function Cu({currency:e,data:t,granularity:n,locale:r,resolveRunCost:i,includeLegacyEffort:a=!1,legacyRange:o,manifestDailyPeriods:s,factualCostPeriods:c}){let u=wu(s===void 0||e===`USD`?du(t,n,i,a,o):fu(s,n),e,c?.[n]),d=_u(u),f={...d,durationMs:Eu(d.durationMs,d.tokens)},p=vu(u),m=r===`pt-BR`?`Total geral`:`Grand total`,h=D(f.tokens);return(0,l.jsxs)(`div`,{className:`operations-period-summary`,children:[(0,l.jsx)(ee,{ariaLabel:Du(n,r),metrics:[{label:Ou(r===`pt-BR`?`Tarefas criadas`:`Tasks created`,n,r),value:O(p.tasks,r,1)},{label:Ou(`SPECs`,n,r),value:O(p.specs,r,1)},{label:Ou(`PRDs`,n,r),value:O(p.prds,r,1)},{label:Ou(r===`pt-BR`?`Tempo`:`Time`,n,r),value:E(p.durationMs,r)},{label:Ou(`Tokens`,n,r),value:D(p.tokens,r)},{label:Ou(r===`pt-BR`?`Custo`:`Cost`,n,r),value:k(p.costBrl,e,r)}]}),(0,l.jsx)(b,{columns:[{key:`period`,label:Au(n,r),render:e=>(0,l.jsx)(`strong`,{children:ju(e.key,n,r)}),footer:m,sortValue:e=>e.key},ku(`prds`,`PRDs`,f.prds),ku(`specs`,`SPECs`,f.specs),ku(`tasks`,r===`pt-BR`?`Tarefas criadas`:`Tasks created`,f.tasks),ku(`runs`,`Runs`,f.runs),ku(`tests`,r===`pt-BR`?`Testes`:`Tests`,f.tests),ku(`evidences`,r===`pt-BR`?`Evidências`:`Evidence`,f.evidences),{key:`duration`,label:r===`pt-BR`?`Tempo`:`Time`,align:`right`,render:e=>T(e.durationMs),footer:(0,l.jsx)(`output`,{"aria-label":`${m} — ${r===`pt-BR`?`Tempo`:`Time`}: ${T(f.durationMs)}`,children:T(f.durationMs)}),sortValue:e=>e.durationMs},{key:`tokens`,label:`Tokens`,align:`right`,render:e=>D(e.tokens),footer:(0,l.jsx)(`output`,{"aria-label":`${m} — Tokens: ${h}`,children:h}),sortValue:e=>e.tokens},{key:`cost`,label:r===`pt-BR`?`Custos`:`Costs`,align:`right`,render:t=>k(t.costBrl,e,r),footer:(0,l.jsx)(`output`,{"aria-label":`${m} — ${r===`pt-BR`?`Custos`:`Costs`}: ${k(f.costBrl,e,r)}`,children:k(f.costBrl,e,r)}),sortValue:e=>e.costBrl}],emptyMessage:r===`pt-BR`?`Nenhum dado disponível para o período selecionado.`:`No data available for the selected period.`,defaultSort:{key:`period`,direction:`desc`},locale:r,rowKey:e=>e.key,rows:u,sortable:!0,showColumnInfo:!0})]})}function wu(e,t,n){if(n===void 0)return[...e];let r=new Map(n.map(e=>[e.key,t===`USD`?e.estimated_usd:e.estimated_brl]));return e.map(e=>r.has(e.key)?{...e,costBrl:r.get(e.key)??null}:e)}function Tu(e,t){if(t===void 0)return[...e];let n=new Map(t.map(e=>[e.key,e.duration_ms]));return e.map(e=>{if(e.durationMs!==null)return e;let t=n.get(e.key);return t==null?e:{...e,durationMs:t}})}function Eu(e,t){return e===null&&t===0?0:e}function Du(e,t){return t===`en-US`?e===`day`?`Daily averages`:e===`month`?`Monthly averages`:`Annual averages`:e===`day`?`Médias por dia`:e===`month`?`Médias por mês`:`Médias por ano`}function Ou(e,t,n){return n===`en-US`?`${e} ${t===`day`?`Daily average`:t===`month`?`Monthly average`:`Annual average`}`:`${e} ${t===`day`?`Médio por dia`:t===`month`?`Médio por mês`:`Médio por ano`}`}function ku(e,t,n){return{key:e,label:t,align:`right`,render:t=>t[e],footer:n,sortValue:t=>t[e]}}function Au(e,t){return t===`en-US`?e===`day`?`Day`:e===`month`?`Month`:`Year`:e===`day`?`Dia`:e===`month`?`Mês`:`Ano`}function ju(e,t,n){if(t===`month`||t===`year`)return e;let r=new Date(`${e}T12:00:00`);return new Intl.DateTimeFormat(n,{...t===`day`?{day:`2-digit`}:{},month:t===`day`?`2-digit`:`long`,year:`numeric`}).format(r)}function Mu({allSpecs:e,allTasks:t,changes:n,locale:r,onOpenDocument:i,onOpenTask:a,prds:s,runs:c,specs:u,tasks:d,onTypeChange:f}){let[p,m]=(0,o.useState)(`all`),[h,g]=(0,o.useState)(null),_=(0,o.useMemo)(()=>Fu({allSpecs:e,allTasks:t,changes:n,items:[...s.map(e=>({kind:`prd`,row:e})),...u.map(e=>({kind:`spec`,row:e})),...d.map(e=>({kind:`task`,row:e}))].filter(e=>Gc(e,p)),runs:c}),[e,t,n,s,c,u,d,p]);return(0,l.jsxs)(`section`,{className:`operations-unified-work operations-work-list`,children:[(0,l.jsx)(Vl,{locale:r,onChange:e=>{m(e),f?.(e)},value:p}),(0,l.jsx)(`div`,{className:`operations-work-list-table`,children:(0,l.jsx)(b,{columns:[{key:`item`,label:`Item`,render:({item:e})=>(0,l.jsxs)(`span`,{className:`operations-work-list-identity`,children:[(0,l.jsx)(`strong`,{children:e.row.title}),(0,l.jsx)(`small`,{children:e.row.id})]}),sortValue:({item:e})=>e.row.title},{key:`status`,label:`Status`,render:({stage:e})=>(0,l.jsx)(`span`,{className:`operations-status is-${e}`,children:Pu(e,r)}),sortValue:({stage:e})=>e},{key:`type`,label:r===`pt-BR`?`Tipo`:`Type`,render:({item:e})=>Ru(e.kind,r),sortValue:({item:e})=>e.kind},{key:`risk`,label:r===`pt-BR`?`Risco`:`Risk`,render:({risk:e})=>e?(0,l.jsx)(`span`,{className:`operations-risk is-${e}`,children:Nc(e,r)}):`—`,sortValue:({risk:e})=>e},{key:`developers`,label:r===`pt-BR`?`Desenvolvedor`:`Developer`,render:({item:e})=>$o(e.row.developers),sortValue:({item:e})=>$o(e.row.developers)},{key:`progress`,label:r===`pt-BR`?`Progresso`:`Progress`,render:({progress:e})=>e,sortValue:({item:e})=>e.kind===`task`?e.row.progress:e.row.quality.task_completion_rate},{key:`time`,label:r===`pt-BR`?`Tempo`:`Time`,render:({durationMs:e,stage:t})=>Nu(e,t,r),sortValue:({durationMs:e})=>e,align:`right`},{key:`tokens`,label:`Tokens`,render:({tokens:e})=>e===null?`—`:D(e),sortValue:({tokens:e})=>e,align:`right`},{key:`cost`,label:r===`pt-BR`?`Custo`:`Cost`,render:({costBrl:e})=>e===null?`—`:k(e,`BRL`),sortValue:({costBrl:e})=>e,align:`right`}],defaultSort:{key:`item`,direction:`asc`},emptyMessage:r===`pt-BR`?`Nenhum item de trabalho encontrado.`:`No work items found.`,locale:r,onRowClick:({item:e})=>{e.kind===`task`?a(e.row.id):g(e.row)},rowKey:({item:e})=>`${e.kind}:${e.row.id}`,rows:_,scrollLabel:r===`pt-BR`?`Tabela de itens de trabalho com rolagem horizontal para acessar todas as colunas.`:`Work items table with horizontal scrolling to access all columns.`,showColumnInfo:!0,sortable:!0})}),h?(0,l.jsx)(Xc,{label:h.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>g(null),onOpenDocument:i,onOpenTrace:e=>{g(null),a(e)},row:h,runs:c,specs:e,tasks:t}):null]})}function Nu(e,t,n){return e===null?ne({durationMs:null,provenance:t===`executing`?`in_progress`:`unavailable`},n):Cc(e)}function Pu(e,t){return e===`draft`?t===`pt-BR`?`Rascunho`:`Draft`:e===`unstaged`?t===`pt-BR`?`Sem etapa`:`Unstaged`:Yc(e,t)}function Fu({allSpecs:e,allTasks:t,changes:n,items:r,runs:i}){return r.map(n=>{let r=n.kind===`task`?n.row:null,a=n.kind===`task`?null:n.row,o=i.filter(e=>r?e.task_id===r.id:a!==null&&(a.run_ids.includes(e.id)||e.prd_id===a.id||e.spec_id===a.id||e.task_id!==null&&a.task_ids.includes(e.task_id))),s=r===null?null:zu(r,o),c=a?Kc(a,e,t):null,l=a,u=c;if(r===null){if(l===null||u===null)throw Error(`A non-task work item must include macro progress.`);return{item:n,stage:Wc(l,t),risk:null,progress:qc(l.kind,u),durationMs:l.duration_ms??(Lu(l)?0:null),tokens:l.usage.total.tokens.total??null,costBrl:l.usage.total.cost.brl??null}}return{item:n,stage:Uc(r)??(r.status===`draft`?`draft`:`unstaged`),risk:r.risk??null,progress:`${Math.round(r.progress)}%`,durationMs:s?.durationMs??(Iu(r,o)?0:null),tokens:s?.tokens??null,costBrl:s?.costBrl??null}})}function Iu(e,t){return t.length===0&&e.execution_started===!1&&(e.execution_count===0||e.execution_count===void 0)&&(e.status===`planned`||e.status===`cancelled`)}function Lu(e){return e.task_count===0&&e.execution_count===0&&e.run_count===0&&e.task_ids.length===0&&e.run_ids.length===0}function Ru(e,t){return e===`task`?t===`pt-BR`?`Tarefa`:`Task`:e.toUpperCase()}function zu(e,t){return e.telemetry!==null&&e.telemetry!==void 0?{durationMs:e.telemetry.duration_ms,tokens:e.telemetry.tokens,costBrl:e.telemetry.cost_brl}:t.reduce((e,t)=>({durationMs:Bu(e.durationMs,t.phase===`execution`&&t.parent_run_id===null?te(t):null),tokens:Bu(e.tokens,t.usage.total.tokens.total),costBrl:Bu(e.costBrl,t.usage.total.cost.brl)}),{durationMs:null,tokens:null,costBrl:null})}function Bu(e,t){return e===null&&t===null?null:(e??0)+(t??0)}function Vu({boardKindTotals:e,boardStates:t,boardTotals:n,changes:r,conversationExecutions:i,conversationRuns:a,currency:o,data:s,entityPage:c,executions:u,factualCostPeriods:d,includeLegacyEffort:f,locale:p,onBoardTypeChange:m,onEntityPageChange:h,onLoadMoreBoard:g,onWorkListTypeChange:_,onWorkListPageChange:v,onOpenDocument:y,onOpenTask:b,onPriorityChange:x,prds:S,resolveRunCost:C,runs:w,specs:T,summaryPopulation:E,tasks:D,workListPage:O,view:k}){return(0,l.jsxs)(`section`,{className:`operations-content`,children:[k===`work-kanban`?(0,l.jsx)(Bl,{allPrds:s.prds,allSpecs:s.specs,allTasks:s.tasks,boardTotals:n,boardKindTotals:e,boardStates:t,changes:s.changes,locale:p,onOpenDocument:y,onOpenTask:b,onPriorityChange:x,onLoadMore:g,onTypeChange:m,prds:S,runs:s.runs,specs:T,tasks:D}):null,k===`work-list`?O?(0,l.jsx)(nu,{loading:O.loading,locale:p,onPageChange:e=>v?.(e),onTypeChange:e=>_?.(e),page:O}):(0,l.jsx)(Mu,{allSpecs:s.specs,allTasks:s.tasks,changes:s.changes,locale:p,onOpenDocument:y,onOpenTask:b,prds:S,runs:s.runs,specs:T,tasks:D,onTypeChange:_}):null,k===`changes`?(0,l.jsx)(be,{locale:p,rows:r}):null,k===`executions`?(0,l.jsx)(xe,{canonical:c?.aggregation!==`page_partial`,locale:p,rows:u}):null,k===`runs`?(0,l.jsx)(Ee,{locale:p,rows:w}):null,k===`conversations`?(0,l.jsx)(Oe,{canonical:c?.aggregation!==`page_partial`,executions:i,locale:p,rows:a}):null,c&&[`runs`,`executions`,`conversations`,`changes`,`decisions`].includes(k)?(0,l.jsx)(Fl,{entityPage:c,locale:p,onChange:h}):null,k===`decisions`?(0,l.jsx)(V,{locale:p,rows:s.decisions}):null,k===`daily`||k===`monthly`||k===`yearly`?(0,l.jsx)(Cu,{data:E,currency:o,granularity:k===`daily`?`day`:k===`monthly`?`month`:`year`,locale:p,resolveRunCost:C,includeLegacyEffort:f,...d===void 0?{}:{factualCostPeriods:d},legacyRange:s.filters,...s.summary.periods===void 0?{}:{manifestDailyPeriods:s.summary.periods.daily}}):null]})}function Hu(e,t,n){return new Intl.NumberFormat(n,{style:`currency`,currency:t,maximumFractionDigits:0}).format(e)}function Uu(e,t){return e===null?t===`pt-BR`?`Indisponível`:`Unavailable`:T(e,t)}function Wu(e,t,n,r,i=!1){return e===null?t===0||i?`0`:Uu(null,r):n(e)}function Gu(e,t,n){if(!(e!==null||t===null||t===0))return n===`pt-BR`?`Zero exibido por falta de medição; não é um valor observado.`:`Zero displayed because no measurement was recorded; this is not an observed value.`}function Ku(e,t,n,r){return t!==null||n===null||n===0?e:`${e} (${r===`pt-BR`?`sem medição`:`unmeasured`})`}function qu({averageCost:e,averageDuration:t,averageTokens:n,costLabel:r,count:i,formatCost:a,formatDuration:o,formatTokens:s,locale:c,timeLabel:l,tokensLabel:u}){let d=r??(c===`pt-BR`?`Custo médio`:`Average cost`);return[[Ku(l,t,i,c),Wu(t,i,o,c,!0)],[Ku(u,n,i,c),Wu(n,i,s,c,!0)],[Ku(d,e,i,c),Wu(e,i,a,c,!0)]]}function Ju({eyebrow:e,label:t,locale:n,onClose:r,onOpenTask:i,onOpenDocument:a,items:o,state:s,kind:c=`task`,onLoadMore:u,page:d}){let f=d?.total??o.length,p=Yu(c,f,n);return(0,l.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>{e.currentTarget===e.target&&r()},open:!0,children:(0,l.jsxs)(`section`,{"aria-label":`${t} — ${f} ${p}`,"aria-modal":`true`,className:`operations-status-dialog`,role:`dialog`,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`h2`,{children:t}),(0,l.jsxs)(`p`,{children:[f,` `,p]})]}),(0,l.jsx)(`button`,{"aria-label":n===`pt-BR`?`Fechar`:`Close`,onClick:r,type:`button`,children:`×`})]}),(0,l.jsxs)(`div`,{className:`operations-status-task-list`,children:[(d?.loading??s?.loading)&&o.length===0?(0,l.jsx)(`p`,{"aria-busy":`true`,"aria-live":`polite`,className:`operations-empty`,role:`status`,children:n===`pt-BR`?`Carregando itens…`:`Loading items…`}):null,d?.error??s?.error?(0,l.jsx)(`p`,{"aria-live":`assertive`,className:`operations-empty`,role:`alert`,children:d?.error??s?.error}):null,o.map(e=>(0,l.jsxs)(`button`,{onClick:()=>`change_id`in e?i(e.id):a(e.kind,e.id),type:`button`,children:[(0,l.jsxs)(`span`,{className:`operations-status-task-main`,children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`small`,{children:e.id})]}),(0,l.jsx)(`span`,{className:`change_id`in e?`operations-risk is-${e.risk}`:`operations-work-kind is-macro`,children:`change_id`in e?Nc(e.risk,n):e.kind.toUpperCase()}),(0,l.jsxs)(`span`,{className:`operations-status-task-action`,children:[n===`pt-BR`?`Ver detalhes`:`View details`,` →`]})]},e.id)),o.length===0&&!(d?.loading??s?.loading)?(0,l.jsx)(`p`,{className:`operations-empty`,children:n===`pt-BR`?`Nenhum${c===`task`?`a`:``} ${Yu(c,1,n)} neste status.`:`No ${Yu(c,2,n)} in this status.`}):null,u&&o.length<(d?.total??0)?(0,l.jsx)(`button`,{disabled:d?.loading,onClick:()=>u(o.length),type:`button`,children:d?.loading?n===`pt-BR`?`Carregando…`:`Loading…`:n===`pt-BR`?`Carregar mais`:`Load more`}):null]})]})})}function Yu(e,t,n){return e===`prd`?t===1?`PRD`:`PRDs`:e===`spec`?t===1?`SPEC`:`SPECs`:n===`pt-BR`?t===1?`tarefa`:`tarefas`:t===1?`task`:`tasks`}var Xu={definition:`#a78bfa`,planning:`#3f6fbd`,ready:`#38bdf8`,executing:`#fbbf24`,verifying:`#f87171`,completed:`#34d399`,blocked:`#64748b`,cancelled:`#64748b`,failed:`#64748b`},Zu={lite:`#60a5fa`,standard:`#fbbf24`,critical:`#f87171`},Qu={empty:`#60a5fa`,structured:`#fbbf24`,rework:`#f87171`};function $u(e){return e.reduce((e,t)=>t===null?e:(e??0)+t,null)}function ed(e,t){return t===null||t===0?{durationMs:null,tokens:null,costBrl:null}:{durationMs:e.durationMs===null?null:e.durationMs/t,tokens:e.tokens===null?null:e.tokens/t,costBrl:e.costBrl===null?null:e.costBrl/t}}function td(e){let t=null;for(let n of e){if(n.created_at===null)continue;let e=Date.parse(n.created_at);Number.isNaN(e)||(t===null||e>t.timestamp)&&(t={value:n.created_at,timestamp:e})}return t?.value??null}function nd(e,t,n){let r=new Map(e.map(e=>[e.id,{id:e.id,title:e.title,durationMs:e.telemetry?.duration_ms??null,tokens:e.telemetry?.tokens??null,costBrl:e.telemetry?.cost_brl??null,runCount:e.telemetry===null||e.telemetry===void 0?0:1}]));if(t.length===0)return[...r.values()];for(let e of r.values())e.durationMs=null,e.tokens=null,e.costBrl=null,e.runCount=0;for(let e of ru(t)){if(e.task_id===null)continue;let t=r.get(e.task_id);if(t===void 0)continue;t.runCount+=1;let n=au(e.duration_ms);n!==null&&(t.durationMs=(t.durationMs??0)+n)}for(let e of iu(t)){if(e.task_id===null)continue;let t=r.get(e.task_id);if(t===void 0)continue;e.usage.total.tokens.total!==null&&(t.tokens=(t.tokens??0)+e.usage.total.tokens.total);let i=n?n(e.id):e.usage.total.cost.brl;i!==null&&(t.costBrl=(t.costBrl??0)+i)}return[...r.values()]}function rd(e,t,n){return e.map(e=>{let r=e.lifecycle_duration_coverage??e.duration_coverage;if(r!==void 0){let t=e.observed_lifecycle_duration_ms??e.observed_root_duration_ms??e.duration_ms??null;return{id:e.id,title:e.title,durationMs:t,durationProvenance:e.lifecycle_duration_provenance??(t===null?`unavailable`:`observed`),durationEligible:r.eligible_runs,durationKnown:r.known_runs,tokens:e.usage?.total.tokens.total??null,costBrl:e.usage?.total.cost.brl??null,runCount:e.run_count??e.root_execution_run_ids?.length??0}}if(t.length===0)return{id:e.id,title:e.title,durationMs:e.duration_ms??null,durationProvenance:e.duration_provenance??(e.duration_ms===null?`unavailable`:`observed`),durationEligible:null,durationKnown:null,tokens:e.usage?.total.tokens.total??null,costBrl:e.usage?.total.cost.brl??null,runCount:e.run_count??0};let i=new Set(e.run_ids),a=t=>i.has(t.id)||(e.kind===`spec`?t.spec_id===e.id:t.prd_id===e.id),o=ru(t).filter(a),s=iu(t).filter(a);return{id:e.id,title:e.title,durationMs:su(o.map(e=>e.duration_ms)),durationProvenance:o.some(e=>e.duration_ms!==null)?`observed`:`unavailable`,durationEligible:o.length,durationKnown:o.filter(e=>e.duration_ms!==null).length,tokens:su(s.map(e=>e.usage.total.tokens.total)),costBrl:su(s.map(e=>n?n(e.id):e.usage.total.cost.brl)),runCount:s.length}})}function id(e,t){let n=t===`pt-BR`;return[{key:`empty`,label:n?`Sem tarefas`:`Without tasks`,color:Qu.empty,count:e.filter(e=>e.task_count===0&&e.rework_run_count===0).length},{key:`structured`,label:n?`Com tarefas`:`With tasks`,color:Qu.structured,count:e.filter(e=>e.task_count>0&&e.rework_run_count===0).length},{key:`rework`,label:n?`Com retrabalho`:`With rework`,color:Qu.rework,count:e.filter(e=>e.rework_run_count>0).length}]}function ad(e,t){let n=e.filter(e=>e.durationMs!==null),r=t.filter(e=>e.durationMs!==null),i=n.length===0?null:n.reduce((e,t)=>e+(t.durationMs??0),0),a=r.length===0?null:r.reduce((e,t)=>e+(t.durationMs??0),0);return{durationMs:i,durationShare:i===null||a===null||a===0?0:i/a,runCount:e.reduce((e,t)=>e+t.runCount,0),tokens:su(e.map(e=>e.tokens)),costBrl:su(e.map(e=>e.costBrl))}}function od(e,t=5){return e.toSorted((e,t)=>{let n=Number(t.durationMs!==null)-Number(e.durationMs!==null);if(n!==0)return n;let r=(t.durationMs??0)-(e.durationMs??0);if(r!==0)return r;let i=t.runCount-e.runCount;return i===0?e.id.localeCompare(t.id):i}).slice(0,Math.max(0,t))}function sd(e,t,n){return e===`specs`?t?.selected_counts?.specs??n:e===`prds`?t?.selected_counts?.prds??n:t?.task_count??n}function cd(e){return{durationMs:$u(e.map(e=>e.durationMs)),tokens:$u(e.map(e=>e.tokens)),costBrl:$u(e.map(e=>e.costBrl))}}function ld(e,t,n){return e===`tasks`?n:t??null}function ud(e,t,n){return e?t??null:n}function dd({currency:e,factualSnapshotFact:t,factualSnapshotTotal:n,macroCostTotal:r,overviewView:i,resolvedRunTotal:a,operationsBrlTotal:o}){return i!==void 0&&i!==`tasks`?r??null:t===void 0?n===void 0?a===null?e===`BRL`?o:null:a:n:t.state===`unavailable`?null:t.knownSum}function fd(e,t){return t===`pt-BR`?`Custo Estimado`:`Estimated cost`}function pd(e,t,n){if(e?.state!==`partial`)return null;let{known:r,total:i}=e.coverage;return n===`pt-BR`?`${r} de ${i} runs com custo conhecido. Taxas estimadas: subtotal conhecido dividido pelas ${t}s e horas registradas do recorte; cobertura parcial, sem estimar custos ausentes.`:`${r} of ${i} runs have known cost. Estimated rates: known subtotal divided by the selected ${t}s and recorded hours; partial coverage, missing costs are not estimated.`}function md(e,t,n){let r=n===`pt-BR`?`Custo médio`:`Average cost`;return e?.state===`partial`?`${r} — ${n===`pt-BR`?`cobertura parcial`:`partial coverage`} (${e.coverage.known}/${e.coverage.total} runs)`:r}function hd(e,t){return e?.state===`unavailable`?null:t}function gd(e,t,n,r,i,a,o){let s=t=>e?.state===`unavailable`||t===null||!Number.isFinite(t)?`—`:Hu(t,r,n);return`${s(a)} / ${t} (${s(o)} / ${n===`pt-BR`?`hora`:`hour`})`}function _d(e){return e.summary.overview_metrics}function vd(e,t,n,r){if(e===`tasks`){let e=new Set(t.map(e=>e.id));return r.filter(t=>t.task_id!==null&&e.has(t.task_id))}let i=new Set(n.map(e=>e.id)),a=new Set(n.flatMap(e=>e.run_ids));return r.filter(t=>a.has(t.id)||(e===`specs`?t.spec_id!==null&&i.has(t.spec_id):t.prd_id!==null&&i.has(t.prd_id)))}function yd({label:e,value:t,hint:n,description:r,featured:i=!1,onSelect:a}){let o=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{title:r,children:e}),(0,l.jsx)(`strong`,{children:t}),(0,l.jsx)(`small`,{children:n})]});return a===void 0?(0,l.jsx)(`article`,{"aria-description":r,"aria-label":`${e}: ${t}. ${n}`,className:`operations-kpi${i?` is-featured`:``}`,children:o}):(0,l.jsx)(`button`,{"aria-description":r,"aria-pressed":i,"aria-label":`${e}: ${t}. ${n}`,className:`operations-kpi is-selectable${i?` is-featured`:``}`,onClick:a,type:`button`,children:o})}function bd(e){let t=e===`pt-BR`;return{overview:t?`Visão geral`:`Overview`,tasks:t?`Tarefas`:`Tasks`,completedTasks:t?`concluídas`:`completed`,completedSpecs:t?`concluídas`:`completed`,completedPrds:t?`concluídos`:`completed`,totalExecutionTime:t?`Tempo total de execução`:`Total execution time`,totalRuns:t?`runs totais`:`total runs`,cost:t?`Custo`:`Cost`,showTerminal:t?`Mostrar canceladas, bloqueadas e falhadas`:`Show cancelled, blocked, and failed`,hideTerminal:t?`Esconder canceladas, bloqueadas e falhadas`:`Hide cancelled, blocked, and failed`,statusHint:t?`Distribuição atual do fluxo`:`Current workflow distribution`,averageTime:t?`Tempo médio`:`Average time`,averageTokens:t?`Tokens médios`:`Average tokens`,averageCost:t?`Custo médio`:`Average cost`,topHint:t?`Maiores durações acumuladas`:`Longest accumulated durations`,accumulatedTime:t?`Tempo acumulado`:`Accumulated time`,associatedRuns:t?`runs associadas`:`associated runs`,concentration:t?`Concentração`:`Concentration`,totalMeasuredTime:t?`do tempo total medido`:`of total measured time`,topFiveCost:t?`Custo do Top 5`:`Top 5 cost`,tokensUnavailable:t?`Tokens indisponíveis`:`Tokens unavailable`}}function xd(e){let t=new Set;for(let n of e){if(n.started_at===void 0)continue;let e=new Date(n.started_at);Number.isNaN(e.getTime())||t.add(`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`)}return t.size}function Sd(e,t,n,r){if(t<=0)return`0`;if(e<=0)return r===`pt-BR`?`Sem tempo medido para calcular médias`:`No measured time for averages`;let i=Cc(e/t,r);if(n<=0)return`${i} / item`;let a=wc(e/n),o=r===`pt-BR`?`${n} dias`:`${n} ${n===1?`day`:`days`}`;return r===`pt-BR`?`${i} / tarefa (${a} / dia) (${o})`:`${i} / task (${a} / day) (${o})`}function Cd(e,t){let n=t===`pt-BR`;if(e===`tasks`)return{statusTitle:n?`Status das tarefas`:`Task status`,classificationTitle:n?`Classificação de Tarefa`:`Task classification`,classificationHint:n?`Mix por criticidade`:`Criticality mix`,averageTitle:n?`Média por tarefa`:`Average per task`,averageHint:n?`Runs agregadas`:`Runs aggregated per task`,latestLabel:n?`Última tarefa criada`:`Latest task created`,topTitle:n?`Top 5 tarefas`:`Top 5 tasks`,shortPlural:`tasks`,emptyTop:n?`Nenhuma tarefa com duração registrada.`:`No task has a recorded duration.`};let r=e===`specs`,i=r?`SPEC`:`PRD`,a=r?`SPECs`:`PRDs`;return{statusTitle:n?`Status das ${a}`:`${i} status`,classificationTitle:n?`Classificação de ${i}`:`${i} classification`,classificationHint:n?`Estrutura da entrega`:`Delivery structure`,averageTitle:n?`Média por ${i}`:`Average per ${i}`,averageHint:n?`Runs agregadas por ${i}`:`Runs aggregated per ${i}`,latestLabel:n?`Última ${i} criada`:`Latest ${i} created`,topTitle:`Top 5 ${a}`,shortPlural:a,emptyTop:n?`Nenhuma ${i} com duração registrada.`:`No ${i} has a recorded duration.`}}function wd({title:e,hint:t,action:n}){return(0,l.jsxs)(`header`,{className:`operations-panel-header`,children:[(0,l.jsxs)(`div`,{className:`operations-panel-header-title`,children:[(0,l.jsx)(`h2`,{children:e}),n]}),(0,l.jsx)(`small`,{children:t})]})}function Td(e,t){return Hc.map(n=>({key:n,label:Yc(n,t),color:Xu[n],count:e.filter(e=>Uc(e)===n).length}))}function Ed(e,t,n){return Hc.map(r=>({key:r,label:Yc(r,n),color:Xu[r],count:e.filter(e=>Wc(e,t)===r).length}))}function Dd(e,t){let n=0,r=e.map(e=>{let r=n+e.count/t*100,i=`${e.color} ${n}% ${r}%`;return n=r,i});return n===0?`rgba(36, 52, 72, 0.86)`:`conic-gradient(${r.join(`, `)})`}function Od({costLoading:e=!1,locale:t,copy:n,text:r,statusStats:i,statusTotal:a,classificationStats:o,selectedCount:s,metricStats:c,latestCreatedAt:u,onStatusSelect:d,onClassificationSelect:f}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`article`,{className:`operations-panel operations-panel-wide`,children:[` `,(0,l.jsx)(wd,{hint:r.statusHint,title:n.statusTitle}),` `,(0,l.jsxs)(`div`,{"aria-hidden":`true`,className:`operations-stacked-bar`,children:[` `,i.map(e=>(0,l.jsx)(`i`,{style:{background:e.color,flexGrow:e.count,display:e.count===0?`none`:void 0}},e.key)),` `]}),` `,(0,l.jsxs)(`div`,{className:`operations-legend-grid`,children:[` `,i.map(e=>{let n=(0,l.jsxs)(l.Fragment,{children:[` `,(0,l.jsx)(`i`,{style:{background:e.color}}),(0,l.jsx)(`span`,{children:e.label}),` `,(0,l.jsxs)(`span`,{className:`operations-legend-value`,children:[` `,(0,l.jsx)(`strong`,{children:e.count}),` `,(0,l.jsxs)(`small`,{children:[` `,j(a===0?0:e.count/a,t),` `]}),` `]}),` `]});return e.key===`unclassified`?(0,l.jsxs)(`div`,{className:`operations-legend-row`,children:[` `,n,` `]},e.key):(0,l.jsxs)(`button`,{"aria-label":`${e.label}: ${e.count}, ${j(a===0?0:e.count/a,t)}`,className:`operations-legend-row operations-status-filter`,onClick:()=>d(e.key),type:`button`,children:[` `,n,` `]},e.key)}),` `]})]}),(0,l.jsxs)(`article`,{className:`operations-panel operations-panel-risk`,children:[` `,(0,l.jsx)(wd,{hint:n.classificationHint,title:n.classificationTitle}),` `,(0,l.jsxs)(`div`,{className:`operations-donut-wrap`,children:[` `,(0,l.jsx)(`div`,{"aria-hidden":`true`,className:`operations-donut`,style:{background:Dd(o,Math.max(s??0,1))}}),` `,(0,l.jsxs)(`div`,{children:[` `,(0,l.jsx)(`strong`,{children:s??`—`}),` `,(0,l.jsx)(`span`,{children:n.shortPlural}),` `]}),` `]}),` `,(0,l.jsxs)(`div`,{className:`operations-legend-grid`,children:[` `,o.map(e=>{let n=(0,l.jsxs)(l.Fragment,{children:[` `,(0,l.jsx)(`i`,{style:{background:e.color}}),` `,(0,l.jsx)(`span`,{children:e.label}),` `,(0,l.jsxs)(`span`,{className:`operations-legend-value`,children:[` `,(0,l.jsx)(`strong`,{children:e.count}),` `,(0,l.jsxs)(`small`,{children:[` `,j(s===null||s===0?0:e.count/s,t),` `]}),` `]}),` `]});return e.key===`unclassified`?(0,l.jsxs)(`div`,{className:`operations-legend-row`,children:[` `,n,` `]},e.key):(0,l.jsxs)(`button`,{"aria-label":`${e.label}: ${e.count}, ${j(s===null||s===0?0:e.count/s,t)}`,className:`operations-legend-row operations-status-filter`,onClick:()=>f(e.key),type:`button`,children:[` `,n,` `]},e.key)}),` `]}),` `]}),(0,l.jsxs)(`article`,{className:`operations-panel operations-panel-type${t===`en-US`?` is-en-us`:``}`,children:[` `,(0,l.jsx)(wd,{hint:n.averageHint,title:n.averageTitle}),` `,(0,l.jsxs)(`div`,{className:`operations-type-summary`,children:[` `,c.map(([t,n],r)=>(0,l.jsxs)(`div`,{"aria-busy":e&&r===2||void 0,children:[(0,l.jsx)(`span`,{children:t}),` `,(0,l.jsx)(`strong`,{children:e&&r===2?(0,l.jsx)(`i`,{className:`operations-skeleton-line`,"aria-hidden":`true`}):n}),` `]},t)),` `]}),` `,(0,l.jsxs)(`footer`,{className:`operations-latest-task-created`,children:[` `,(0,l.jsx)(`span`,{children:n.latestLabel}),` `,(0,l.jsxs)(`strong`,{children:[` `,u===null?`—`:A(u,t),` `]}),` `]}),` `]})]})}var kd=(e,t)=>e===null?`0`:T(e,t);function Ad({costLoading:e=!1,copy:t,currency:n,locale:r,maxDuration:i,onOpenMacro:a,onOpenTask:o,summary:s,text:c,topCost:u,topEntities:d,view:f}){let p=f===`specs`?`SPEC`:`PRD`;return(0,l.jsxs)(`article`,{className:`operations-panel`,children:[(0,l.jsxs)(`header`,{className:`operations-panel-header`,children:[(0,l.jsx)(`div`,{className:`operations-panel-header-title`,children:(0,l.jsx)(`h2`,{children:t.title})}),(0,l.jsx)(`small`,{children:t.hint})]}),d.length===0?(0,l.jsx)(`p`,{className:`operations-empty`,children:t.empty}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`operations-run-bars`,children:d.map((e,t)=>{let n=kd(e.durationMs,r);return(0,l.jsxs)(`button`,{"aria-label":f===`tasks`?`${r===`pt-BR`?`Abrir detalhes da tarefa`:`Open task details for`} ${e.title}: ${n}`:`${r===`pt-BR`?`Abrir detalhes da`:`Open details for`} ${p} ${e.title}: ${n}`,className:`operations-run-bar${e.durationMs===null?` is-duration-unavailable`:``}`,onClick:()=>{f===`tasks`?o(e.id):a(f===`specs`?`spec`:`prd`,e.id)},title:`${e.title}: ${n}`,type:`button`,children:[(0,l.jsx)(`strong`,{children:n}),(0,l.jsx)(`i`,{style:{height:e.durationMs===null?`0%`:`${Math.max(8,e.durationMs/i*100)}%`}}),(0,l.jsx)(`span`,{children:`#${t+1} ${e.id.slice(-4)}`})]},e.id)})}),(0,l.jsxs)(`div`,{className:`operations-top-task-metrics`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:c.accumulatedTime}),(0,l.jsx)(`strong`,{children:kd(s.durationMs,r)}),(0,l.jsx)(`small`,{children:`${s.runCount} ${c.associatedRuns}`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:c.concentration}),(0,l.jsx)(`strong`,{children:j(s.durationShare,r)}),(0,l.jsx)(`small`,{children:c.totalMeasuredTime})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:c.topFiveCost}),(0,l.jsx)(`strong`,{"aria-busy":e||void 0,children:e?(0,l.jsx)(`i`,{className:`operations-skeleton-line`,"aria-hidden":`true`}):u===null?kd(null,r):k(u,n,r)}),(0,l.jsx)(`small`,{children:`${D(s.tokens,r)} tokens`})]})]})]})]})}function jd({fact:e,unit:t,locale:n,currency:r,count:i,perItem:a,perHour:o,total:s,label:c,loading:u=!1}){return u?(0,l.jsxs)(`article`,{"aria-busy":`true`,"aria-label":n===`pt-BR`?`Carregando custo estimado`:`Loading estimated cost`,className:`operations-kpi`,role:`status`,children:[(0,l.jsx)(`span`,{children:c??(n===`pt-BR`?`Custo Estimado`:`Estimated Cost`)}),(0,l.jsx)(`strong`,{children:(0,l.jsx)(`i`,{className:`operations-skeleton-line is-value`,"aria-hidden":`true`})}),(0,l.jsx)(`small`,{children:(0,l.jsx)(`i`,{className:`operations-skeleton-line`,"aria-hidden":`true`})})]}):(0,l.jsx)(yd,{hint:gd(e,t,n,r,i,a,o),description:Gu(s,i,n)??pd(e,t,n)??void 0,label:c??fd(e,n),value:Wu(s,i,e=>Hu(e,r,n),n,!0)})}function Md(e,t,n){return e===`tasks`?n:e===`specs`?t===`pt-BR`?`Tempo observado por SPEC.`:`Observed time per SPEC.`:t===`pt-BR`?`Tempo de ciclo de vida (Runs-raiz, todas as fases).`:`Lifecycle time (root Runs, all phases).`}function Nd({currency:e,data:t,datePreset:n,locale:r,onDatePresetChange:i,onOpenTask:a,onOpenDocument:s,onOpenMacro:c,onLoadStatus:u,statusPage:d,onLoadStatusPage:f,classificationPage:p,onLoadClassificationPage:m,onLoadMacroMetrics:h,prds:g=t.prds,runs:_=t.runs,specs:v=t.specs,tasks:y=t.tasks,factualCostTotal:b,factualCostFact:x,costLoading:S=!1,resolveRunCost:C,includeLegacyEffort:w=!1}){let[E,O]=(0,o.useState)(`tasks`),[A,ee]=(0,o.useState)(null),[M,te]=(0,o.useState)(null),ne=y.filter(e=>e.status===`completed`).length,re=v.filter(e=>e.work_status===`completed`).length,N=g.filter(e=>e.work_status===`completed`).length,ie=Cd(E,r),ae=bd(r),oe=E===`specs`?v:g,P=_d(t),F=E===`tasks`?void 0:P?.macro_metrics?.[E],se=sd(E,P,E===`tasks`?y.length:oe.length),ce=vd(E,y,oe,_),le=E===`tasks`?nd(y,ce,C):rd(oe,ce,C),ue=P?.task_status_counts,de=ue?[...Hc.map(e=>({key:e,label:Yc(e,r),color:Xu[e],count:e===`definition`?(ue.draft??0)+(ue.definition??0):e===`ready`?(ue.planned??0)+(ue.ready??0):ue[e]??0})),...ue.unclassified?[{key:`unclassified`,label:r===`pt-BR`?`Não classificado`:`Unclassified`,color:`var(--color-neutral-500)`,count:ue.unclassified}]:[]]:Td(y,r),fe=F?Hc.map(e=>({key:e,label:Yc(e,r),color:Xu[e],count:F.status_counts[e]??0})):Ed(oe,y,r),I=E===`tasks`?de:fe,pe=I.reduce((e,t)=>e+t.count,0),L=P?.task_risk_counts,R=[...Object.entries(Zu).map(([e,t])=>({key:e,label:Nc(e,r),color:t,count:L?L[e]??0:y.filter(t=>t.risk===e).length})),...L?.unclassified??y.filter(e=>e.risk===null).length?[{key:`unclassified`,label:r===`pt-BR`?`Não classificado`:`Unclassified`,color:`var(--color-neutral-500)`,count:L?.unclassified??y.filter(e=>e.risk===null).length}]:[]],me=E===`tasks`?R:F?id([],r).map(e=>({...e,count:F.classification_counts[e.key]??0})):id(oe,r),he=cu(_),ge=uu(_),_e=P?.partial===!0,z=P?.task_count??y.length,ve=P?.spec_count??v.length,B=P?.prd_count??g.length,ye=P?.completed_task_count??ne,V=P?.completed_spec_count??re,be=P?.completed_prd_count??N,xe=z===null||z===0?0:ye/z,Se=ve===null||ve===0?0:V/ve,Ce=B===null||B===0?0:be/B,we=he.runs,Te=cd(le),Ee=E===`tasks`?r===`pt-BR`?`tarefa`:`task`:ie.shortPlural,De=E===`tasks`?null:{durationMs:ud(F!==void 0,F?.total_duration_ms,Te.durationMs),tokens:ud(F!==void 0,F?.total_tokens,Te.tokens),costBrl:ud(F!==void 0,F?.total_cost_brl,Te.costBrl)},Oe=ld(E,De?.durationMs,P?.duration_ms??he.durationMs),ke=E===`tasks`?P?.execution_day_count??xd(we):0,Ae=ld(E,De?.tokens,P?.tokens??ge.tokens),H=E===`tasks`?z:se,je=C===void 0?null:ge.runs.reduce((e,t)=>{let n=C(t.id);return n===null?e:(e??0)+n},null),U=E===`tasks`?void 0:e===`USD`?F?.total_cost_usd:F?.total_cost_brl,Me=E===`tasks`||e===`USD`?null:$u(le.map(e=>e.costBrl)),Ne=dd({currency:e,factualSnapshotFact:E===`tasks`?x:void 0,factualSnapshotTotal:b,macroCostTotal:ud(F!==void 0,U,Me),overviewView:E,resolvedRunTotal:je,operationsBrlTotal:P?.cost_brl??ge.costBrl}),W=hd(E===`tasks`?x:void 0,Ne),Pe=Oe===null||Oe<=0||W===null?null:W*36e5/Oe,Fe=W===null||H===null||H===0?null:W/H,Ie=Ae===null||H===null||H===0?null:Ae/H,G=Oe===null||Oe<=0||Ae===null?null:Ae*36e5/Oe,Le=ed(E===`tasks`?{durationMs:Oe,tokens:Ae,costBrl:W}:{durationMs:ud(F!==void 0,F?.total_duration_ms,Te.durationMs),tokens:ud(F!==void 0,F?.total_tokens,Te.tokens),costBrl:ud(F!==void 0,U,e===`BRL`?Me:Te.costBrl)},se),Re=ud(F!==void 0,F?.average_duration_ms,Le.durationMs),ze=ud(F!==void 0,F?.average_tokens,Le.tokens),K=E===`tasks`?Le.costBrl:ud(F!==void 0,e===`USD`?F?.average_cost_usd:F?.average_cost_brl,Le.costBrl),Be=E===`tasks`?y.length===0?P?.latest_task_created_at??null:td(y):F?.latest_created_at??td(oe),q=qu({averageCost:K,averageDuration:Re,averageTokens:ze,costLabel:md(E===`tasks`?x:void 0,se,r),count:se,formatCost:t=>k(t,e,r),formatDuration:e=>T(e,r),formatTokens:e=>D(e,r),locale:r,timeLabel:ae.averageTime,tokensLabel:ae.averageTokens}),Ve=(P?.top_tasks??[]).map(t=>({id:t.task_id,title:y.find(e=>e.id===t.task_id)?.title??t.task_id,durationMs:t.duration_ms,durationProvenance:t.duration_ms===null?`unavailable`:`observed`,tokens:t.total_tokens,costBrl:e===`USD`?t.total_cost_usd??null:t.cost_brl,runCount:t.run_count})),He=(F?.top_entities??[]).map(t=>({id:t.entity_id,title:t.title,durationMs:t.duration_ms,durationProvenance:t.duration_ms===null?`unavailable`:`observed`,tokens:t.total_tokens,costBrl:e===`USD`?t.total_cost_usd??null:t.cost_brl,runCount:t.run_count})),Ue=E===`tasks`&&_.length===0&&Ve.length>0?Ve:E!==`tasks`&&He.length>0?He:od(le),We=Math.max(1,...Ue.filter(e=>e.durationMs!==null).map(e=>e.durationMs??0)),Ge=E===`tasks`&&_.length===0&&Ve.length>0?{...ad(Ue,Ue),durationShare:Oe===null||Oe===0?0:Ue.reduce((e,t)=>e+(t.durationMs??0),0)/Oe}:E!==`tasks`&&He.length>0?{...ad(Ue,Ue),durationShare:F?.total_duration_ms===null||F?.total_duration_ms===void 0||F.total_duration_ms===0?0:Ue.reduce((e,t)=>e+(t.durationMs??0),0)/F.total_duration_ms}:ad(Ue,le),Ke=E===`tasks`&&_.length===0&&Ve.length>0||E!==`tasks`&&He.length>0,qe=e===`USD`&&!Ke&&(_.length===0||C===void 0)?null:Ge.costBrl,Je=Md(E,r,ae.topHint),Ye=e=>{O(e),ee(null),te(null),e!==`tasks`&&h?.()};return(0,l.jsxs)(`section`,{"aria-label":ae.overview,className:`operations-overview`,children:[` `,(0,l.jsxs)(`div`,{className:`operations-overview-controls`,children:[` `,(0,l.jsxs)(`label`,{className:`operations-overview-period`,children:[` `,(0,l.jsx)(`span`,{children:r===`pt-BR`?`Período`:`Period`}),` `,(0,l.jsxs)(`select`,{"aria-label":r===`pt-BR`?`Período`:`Period`,onChange:e=>i(e.target.value),value:n,children:[` `,(0,l.jsx)(`option`,{value:`today`,children:r===`pt-BR`?`Hoje`:`Today`}),(0,l.jsx)(`option`,{value:`yesterday`,children:r===`pt-BR`?`Ontem`:`Yesterday`}),` `,(0,l.jsx)(`option`,{value:`this-week`,children:r===`pt-BR`?`Esta Semana`:`This Week`}),` `,(0,l.jsx)(`option`,{value:`last-week`,children:r===`pt-BR`?`Semana Passada`:`Last Week`}),(0,l.jsx)(`option`,{value:`this-month`,children:r===`pt-BR`?`Este Mês`:`This Month`}),` `,(0,l.jsx)(`option`,{value:`last-month`,children:r===`pt-BR`?`Mês Passado`:`Last Month`}),` `,(0,l.jsxs)(`option`,{value:`last-3-months`,children:[` `,r===`pt-BR`?`Últimos 3 meses`:`Last 3 months`]}),` `,(0,l.jsxs)(`option`,{value:`last-6-months`,children:[` `,r===`pt-BR`?`Últimos 6 meses`:`Last 6 months`,` `]}),` `,(0,l.jsx)(`option`,{value:`this-year`,children:r===`pt-BR`?`Este Ano`:`This Year`}),(0,l.jsx)(`option`,{value:`last-year`,children:r===`pt-BR`?`Último ano`:`Last year`}),` `,(0,l.jsx)(`option`,{value:`all`,children:r===`pt-BR`?`Todo o Período`:`All Time`}),` `,(0,l.jsxs)(`option`,{disabled:!0,value:`custom`,children:[` `,r===`pt-BR`?`Personalizado`:`Custom`,` `]}),` `]})]}),` `]}),` `,(0,l.jsxs)(`div`,{className:`operations-kpi-grid`,children:[` `,(0,l.jsx)(yd,{featured:E===`tasks`,hint:_e&&ye===null?r===`pt-BR`?`Resumo detalhado carregando…`:`Detailed summary loading…`:`${ye} ${ae.completedTasks} (${j(xe,r)})`,label:ae.tasks,onSelect:()=>Ye(`tasks`),value:z===null?`—`:String(z)}),` `,(0,l.jsx)(yd,{featured:E===`specs`,hint:_e&&V===null?r===`pt-BR`?`Resumo detalhado carregando…`:`Detailed summary loading…`:`${V} ${ae.completedSpecs} (${j(Se,r)})`,label:`SPECs`,onSelect:()=>Ye(`specs`),value:ve===null?`—`:String(ve)}),` `,(0,l.jsx)(yd,{featured:E===`prds`,hint:_e&&be===null?r===`pt-BR`?`Resumo detalhado carregando…`:`Detailed summary loading…`:`${be} ${ae.completedPrds} (${j(Ce,r)})`,label:`PRDs`,onSelect:()=>Ye(`prds`),value:B===null?`—`:String(B)}),` `,(0,l.jsx)(yd,{hint:Sd(Oe??0,H??0,ke,r),label:E===`tasks`?ae.totalExecutionTime:r===`pt-BR`?`${ae.totalExecutionTime} de ${ie.shortPlural}`:`${ie.shortPlural} ${ae.totalExecutionTime.toLowerCase()}`,value:Wu(Oe,H,e=>T(e,r),r,!0),description:Gu(Oe,H,r)}),` `,(0,l.jsx)(yd,{hint:Ie===null||G===null?H===0?r===`pt-BR`?`0 / ${Ee} (0 / hora)`:`0 / ${Ee} (0 / hour)`:r===`pt-BR`?`Sem tokens medidos para calcular médias`:`No measured tokens for averages`:r===`pt-BR`?`${D(Ie,r)} / ${Ee} (${D(G,r,0)} / hora)`:`${D(Ie,r)} / ${Ee} (${D(G,r,0)} / hour)`,label:E===`tasks`?r===`pt-BR`?`Tokens gastos`:`Spent tokens`:r===`pt-BR`?`Tokens gastos por ${ie.shortPlural}`:`${ie.shortPlural} tokens spent`,value:Wu(Ae,H,e=>D(e,r),r,!0),description:Gu(Ae,H,r)}),` `,(0,l.jsx)(jd,{loading:S&&E===`tasks`,fact:E===`tasks`?x:void 0,unit:Ee,locale:r,currency:e,count:H,perItem:Fe,perHour:Pe,total:Ne,label:E===`tasks`?void 0:r===`pt-BR`?`Custo de ${ie.shortPlural}`:`${ie.shortPlural} cost`}),` `]}),(0,l.jsxs)(`div`,{className:`operations-chart-grid`,children:[` `,(0,l.jsx)(Od,{costLoading:S&&E===`tasks`,locale:r,copy:ie,text:ae,statusStats:I,statusTotal:pe,classificationStats:me,selectedCount:se,metricStats:q,latestCreatedAt:Be,onStatusSelect:e=>{ee(e),u?.(e,E===`tasks`?`task`:E===`specs`?`spec`:`prd`,0)},onClassificationSelect:e=>{te(e),m?.(E===`tasks`?`task`:E===`specs`?`spec`:`prd`,e,0)}}),(0,l.jsx)(Ad,{costLoading:S&&E===`tasks`,copy:{empty:ie.emptyTop,hint:Je,title:ie.topTitle},currency:e,locale:r,maxDuration:We,onOpenMacro:c,onOpenTask:a,summary:Ge,text:ae,topCost:qe,topEntities:Ue,view:E}),` `]}),` `,A===null?null:(0,l.jsx)(Ju,{eyebrow:r===`pt-BR`?E===`tasks`?`Status das tarefas`:E===`specs`?`Status das SPECs`:`Status dos PRDs`:`${ie.shortPlural} status`,label:Yc(A,r),locale:r,onClose:()=>ee(null),onOpenTask:e=>{ee(null),a(e)},onOpenDocument:(e,t)=>{ee(null),s(e,t)},items:d?.(A,E===`tasks`?`task`:E===`specs`?`spec`:`prd`)?.items??[],kind:E===`tasks`?`task`:E===`specs`?`spec`:`prd`,onLoadMore:e=>f?.(A,E===`tasks`?`task`:E===`specs`?`spec`:`prd`,e),page:d?.(A,E===`tasks`?`task`:E===`specs`?`spec`:`prd`)}),` `,M===null?null:(0,l.jsx)(Ju,{eyebrow:r===`pt-BR`?ie.classificationTitle:`Classification`,label:E===`tasks`?Nc(M,r):me.find(e=>e.key===M)?.label??M,locale:r,onClose:()=>te(null),onOpenTask:e=>{te(null),a(e)},onOpenDocument:(e,t)=>{te(null),s(e,t)},items:p?.(E===`tasks`?`task`:E===`specs`?`spec`:`prd`,M)?.items??[],kind:E===`tasks`?`task`:E===`specs`?`spec`:`prd`,onLoadMore:e=>m?.(E===`tasks`?`task`:E===`specs`?`spec`:`prd`,M,e),page:p?.(E===`tasks`?`task`:E===`specs`?`spec`:`prd`,M)}),` `]})}function Pd({capabilityNavigation:e,currency:t,data:n,datePreset:r,dateRange:i,defaultDateRange:a,factualCostTotal:o,factualCostFact:s,costLoading:c,includeLegacyEffort:u,locale:d,onOpenTask:f,onOpenDocument:p,onOpenMacro:m,onLoadStatus:h,statusPage:g,onLoadStatusPage:_,classificationPage:v,onLoadClassificationPage:y,onLoadMacroMetrics:b,prds:x,query:S,resolveRunCost:C,runs:w,searchInputRef:T,setQuery:E,showFilterLoading:D,specs:O,tasks:k,updatePeriod:A}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Nd,{data:n,currency:t,factualCostTotal:o,factualCostFact:s,costLoading:c,datePreset:r,dateRange:i,locale:d,onDatePresetChange:e=>{D(),A(e,e===`all`?a:e===`custom`?i:dl(e))},onOpenTask:f,onOpenDocument:p,onOpenMacro:m,onLoadStatus:h,statusPage:g,onLoadStatusPage:_,classificationPage:v,onLoadClassificationPage:y,onLoadMacroMetrics:b,prds:x,runs:w,resolveRunCost:C,includeLegacyEffort:u,specs:O,tasks:k}),(0,l.jsxs)(`section`,{className:`dashboard-global-controls`,children:[e,(0,l.jsxs)(`div`,{className:`operations-toolbar-filters dashboard-global-filters`,children:[(0,l.jsxs)(`label`,{className:`operations-toolbar-field operations-search-field`,children:[(0,l.jsx)(`span`,{children:d===`pt-BR`?`Busca`:`Search`}),(0,l.jsxs)(`div`,{className:`operations-search-control`,children:[(0,l.jsx)(`input`,{"aria-label":d===`pt-BR`?`Busca`:`Search`,onChange:e=>{E(e.target.value)},placeholder:d===`pt-BR`?`Buscar por nome ou ID`:`Search by name or ID`,ref:T,value:S}),S?(0,l.jsx)(`button`,{"aria-label":d===`pt-BR`?`Limpar busca`:`Clear search`,className:`operations-search-clear`,onMouseDown:e=>e.preventDefault(),onClick:()=>{T.current?.focus(),E(``)},type:`button`,children:(0,l.jsx)(Ml,{})}):null]})]}),(0,l.jsx)(Tl,{dateRange:i,defaultDateRange:a,locale:d,onDateRangeChange:e=>{D(),A(`custom`,e)},onPresetChange:(e,t)=>{D(),A(e,t)},preset:r})]})]})]})}function Fd({locale:e}){return(0,l.jsxs)(`section`,{"aria-busy":`true`,"aria-label":e===`pt-BR`?`Carregando o período selecionado`:`Loading selected period`,className:`operations-content-skeleton`,role:`status`,children:[(0,l.jsx)(`div`,{className:`operations-skeleton-kpis`,"aria-hidden":`true`,children:[`tasks`,`specs`,`prds`,`duration`,`tokens`,`cost`].map(e=>(0,l.jsxs)(`article`,{className:`operations-skeleton-block`,children:[(0,l.jsx)(`i`,{className:`operations-skeleton-line is-short`}),(0,l.jsx)(`i`,{className:`operations-skeleton-line is-value`}),(0,l.jsx)(`i`,{className:`operations-skeleton-line`})]},e))}),(0,l.jsx)(`div`,{className:`operations-skeleton-panels`,"aria-hidden":`true`,children:[`status`,`classification`,`average`,`top`].map(e=>(0,l.jsxs)(`article`,{className:`operations-skeleton-block`,children:[(0,l.jsx)(`i`,{className:`operations-skeleton-line is-short`}),(0,l.jsx)(`i`,{className:`operations-skeleton-chart`})]},e))})]})}function Id(e){return!e}function Ld(e){return e===`work-list`?`all`:null}function Rd(e){let t=e.datePreset!==void 0&&e.dateRange!==void 0,n=e.datePreset??e.fallbackPreset;return{controlled:t,datePreset:n,dateRange:n===`all`&&e.allTimeRange!==void 0?e.allTimeRange:e.dateRange??e.fallbackRange}}function zd(){let[e,t]=(0,o.useState)(!1),n=(0,o.useRef)(null),r=(0,o.useCallback)(()=>{t(!0),n.current!==null&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>t(!1),220)},[]);return(0,o.useEffect)(()=>()=>{n.current!==null&&window.clearTimeout(n.current)},[]),{filterLoading:e,showFilterLoading:r}}function Bd(e,t){return(0,o.useMemo)(()=>{let n=ul(e.tasks,Object.keys(e.summary.periods?.daily??{}));return cl(t?.day,n)},[e.summary.periods,e.tasks,t?.day])}function Vd({loading:e,view:t,query:n,statusFilter:r,riskFilter:i,originFilter:a,onBoardFiltersChange:s,onWorkListFiltersChange:c,onEntityFiltersChange:l}){(0,o.useEffect)(()=>{if(e)return;if(t===`work-kanban`||t===`work-list`){let e=window.setTimeout(()=>{let e={query:n,status:r,risk:i,origin:a};t===`work-kanban`?s?.(e):c?.(e)},180);return()=>window.clearTimeout(e)}if(![`runs`,`conversations`,`executions`,`changes`,`decisions`].includes(t))return;let o=window.setTimeout(()=>{l?.(t,{query:n,status:r,risk:i})},180);return()=>window.clearTimeout(o)},[s,c,l,e,a,n,i,r,t])}function Hd(e,t,n){return e===`month`||e===`year`?Tu(t,n):[...t]}function Ud({datePreset:e,matchesSelectedDate:t,prds:n,runs:r,specs:i,tasks:a}){let o=new Set(a.map(e=>e.id)),s=new Set([`completed`,`delivered`,`cancelled`,`failed`]),c=(n,i)=>e===`all`||!s.has(n.lifecycle_status)||t(n.updated_at??n.created_at)||n.task_ids.some(e=>o.has(e))||i===`spec`&&a.some(e=>e.spec_id===n.id)||r.some(e=>n.run_ids.includes(e.id)||(i===`spec`?e.spec_id===n.id:e.prd_id===n.id)),l=i.filter(e=>c(e,`spec`)),u=new Set(l.map(e=>e.id));return{specs:l,prds:n.filter(e=>c(e,`prd`)||i.some(t=>t.parent_id===e.id&&u.has(t.id)))}}function Wd(e,t){let n=e.trim().toLocaleLowerCase();return n.length===0||t.some(e=>e?.toLocaleLowerCase().includes(n))}function Gd(e,t){return{prds:e.prds.filter(e=>t(e.created_at)),specs:e.specs.filter(e=>t(e.created_at)),tasks:e.tasks.filter(e=>t(e.created_at)),runs:e.runs.filter(e=>t(e.started_at)),...e.evidences===void 0?{}:{evidences:e.evidences.filter(e=>t(e.observed_at))},...e.validations===void 0?{}:{validations:e.validations.filter(e=>t(e.executed_at))}}}function Kd(e,t,n){return n.entityFilterActive?e.filter(e=>n.directRunMatch?.(e)===!0||e.task_id!==null&&t.taskIds.has(e.task_id)||e.spec_id!==null&&t.specIds.has(e.spec_id)||e.prd_id!==null&&t.prdIds.has(e.prd_id)):[...e]}function qd({alternateContent:e,boardTotals:t,boardKindTotals:n,boardStates:r,boardExportSource:i,detailExportSource:a,capabilityNavigation:s,currency:c,data:u,dashboardTitle:f=`Dashboard ZAIP AIOS`,lastUpdatedAt:p=u.summary.latest_token_collected_at??null,loading:m,onLoadingChange:h,locale:g,onLocaleChange:_,onOpenDocument:v,onOpenMacro:y,onOpenTask:b,onPriorityChange:x,onLoadMacroMetrics:S,entityPage:C,onEntityPageChange:w,onEntityFiltersChange:T,onBoardFiltersChange:E,onWorkListFiltersChange:D,onBoardTypeChange:O,onWorkListTypeChange:k,onWorkListPageChange:A,workListPage:j,onLoadMoreBoard:ee,onLoadStatusPage:M,statusPage:te,classificationPage:ne,onLoadClassificationPage:re,datePreset:N,dateRange:ie,onDateChange:ae,onPeriodChange:oe,onRefresh:P,repositoryName:F,settings:se,factualCostTotal:ce,factualCostFact:le,costLoading:ue,factualCostPeriods:de,resolveRunCost:fe}){let[I,pe]=(0,o.useState)(`work-kanban`),[L,R]=(0,o.useState)(``),[me,he]=(0,o.useState)(!1),[ge,_e]=(0,o.useState)(!1),[z,ve]=(0,o.useState)(``),[B,ye]=(0,o.useState)(``),[V,be]=(0,o.useState)(``),{filterLoading:xe,showFilterLoading:Se}=zd(),Ce=(0,o.useRef)(null),we=Bd(u,de),Te=(0,o.useMemo)(()=>dl(`this-month`),[]),[Ee,De]=(0,o.useState)(()=>Te),[Oe,ke]=(0,o.useState)(`all`),Ae=Rd({datePreset:N,dateRange:ie,fallbackPreset:Oe,fallbackRange:Ee,allTimeRange:we}),H=Ae.controlled,je=Ae.dateRange,U=Ae.datePreset,Me=(0,o.useCallback)((e,t)=>{H||(ke(e),De(t)),(ae??oe)?.(e,t)},[H,ae,oe]),Ne=typeof e==`function`?e({query:L,datePreset:U,...U===`all`?{}:{dateRange:je}}):e,W=L===``&&z===``&&B===``&&V===``,Pe=()=>{Se(),R(``),ve(``),ye(``),be(``),Me(`all`,Te)},Fe=e=>{Se();let t=Ld(e);t!==null&&k?.(t),pe(e),ve(``),ye(``),be(``)};Vd({loading:m,view:I,query:L,statusFilter:z,riskFilter:B,originFilter:V,onBoardFiltersChange:E,onWorkListFiltersChange:D,onEntityFiltersChange:T});let Ie=(I===`work-kanban`||I===`work-list`)&&Hc.includes(z),G=(0,o.useCallback)(e=>ml(e,U,je),[U,je]),Le=u.tasks.filter(e=>(!Ie||Uc(e)===z)&&(!B||e.risk===B)&&Lc(e,V,u.changes)&&(U===`all`||fl(e.finished_at??e.updated_at,je,e.updated_at))&&Wd(L,[e.id,e.title,e.short_name,e.objective,e.change_id,e.spec_id])),Re=u.changes.filter(e=>(!z||e.status===z)&&(!B||e.risk===B)&&G(e.created_at)&&Wd(L,[e.id,e.title,e.source.type,e.artifact_path])),ze=u.executions.filter(e=>(!z||e.status===z)&&G(e.created_at)&&Wd(L,[e.id,e.status,e.work_status,e.origin.type,e.origin.type===`interaction`?e.origin.conversation_id:null,e.artifact_path])),K=u.runs.filter(e=>(!z||Ie||e.status===z)&&hl(e,U,je)),Be=Ud({datePreset:U,matchesSelectedDate:G,prds:u.prds,runs:K,specs:u.specs,tasks:Le}),q=u.specs.filter(e=>(!Ie||Wc(e,u.tasks)===z)&&!B&&!V&&Be.specs.includes(e)&&Wd(L,[e.id,e.title,e.parent_id])),Ve=u.prds.filter(e=>(!Ie||Wc(e,u.tasks)===z)&&!B&&!V&&Be.prds.includes(e)&&Wd(L,[e.id,e.title,e.parent_id])),He=Kd(K,{taskIds:new Set(Le.map(e=>e.id)),specIds:new Set(q.map(e=>e.id)),prdIds:new Set(Ve.map(e=>e.id))},{entityFilterActive:!!(L||Ie||B||V),directRunMatch:e=>L.trim().length>0&&Wd(L,[e.id,e.task_id,e.spec_id,e.prd_id,e.change_id,e.execution_id,e.conversation_id,e.phase,e.agent,e.agent_name,e.model,e.effective_model])}),Ue=ze.filter(e=>e.kind===`interaction`&&e.origin.type===`interaction`),We=new Set(Ue.map(e=>e.origin.type===`interaction`?e.origin.conversation_id:``)),Ge=He.filter(e=>e.entrypoint===`conversation`&&e.task_id===null&&e.conversation_id!==null&&We.has(e.conversation_id)),Ke=u.decisions.filter(e=>G(e.created_at)&&Wd(L,[e.id,e.title,e.scope_id,e.scope_type,e.artifact_path])),qe=Gd(u,G),Je=u.summary.periods?.daily,Ye=(0,o.useMemo)(()=>{if(I===`daily`||I===`monthly`||I===`yearly`){let e=I===`daily`?`day`:I===`monthly`?`month`:`year`;return Hd(e,wu(Je===void 0||c===`USD`?du(qe,e,fe,W,u.filters):fu(Object.fromEntries(Object.entries(Je).filter(([e])=>G(`${e}T12:00:00.000Z`))),e),c,de?.[e]),de?.[e]).map(e=>({key:e.key,prds:e.prds,specs:e.specs,tasks:e.tasksCreated,runs:e.runs,tests:e.tests,evidences:e.evidences,duration_hours:e.durationMs===null?null:e.durationMs/36e5,tokens:e.tokens,cost:e.costBrl}))}return I===`work-kanban`||I===`work-list`?[...Ve.map(({kind:e,...t})=>({kind:`prd`,...t})),...q.map(({kind:e,...t})=>({kind:`spec`,...t})),...Le.map(e=>({kind:`task`,...e}))]:I===`changes`?Re:I===`decisions`?Ke:I===`executions`?ze:I===`conversations`?Ge:He},[Re,Ge,Ke,ze,de,Ve,fe,He,q,qe,Le,I,W,u.filters,Je,G,c]),Xe=m||xe;return(0,o.useEffect)(()=>h?.(Xe),[Xe,h]),(0,l.jsxs)(`main`,{className:`operations-page`,children:[(0,l.jsx)(d,{filters:(0,l.jsxs)(`div`,{className:`operations-global-filters`,"data-loading":Xe||void 0,children:[(0,l.jsxs)(`div`,{className:`operations-filter-heading`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`strong`,{children:g===`pt-BR`?`Filtrar dashboard`:`Filter dashboard`}),(0,l.jsx)(`small`,{children:g===`pt-BR`?`Os dados exibidos permanecem estáveis até uma atualização manual`:`Displayed data stays stable until a manual refresh`})]}),Xe?(0,l.jsxs)(`span`,{className:`operations-filter-status`,role:`status`,children:[(0,l.jsx)(`i`,{}),` `,g===`pt-BR`?`Atualizando dados`:`Updating data`]}):null]}),Ne?null:(0,l.jsx)(El,{locale:g,query:L,status:z,risk:B,origin:V,onQuery:R,onStatus:ve,onRisk:ye,onOrigin:be}),(0,l.jsx)(Tl,{ariaLabelSuffix:g===`pt-BR`?` nos filtros`:` in filters`,dateRange:je,defaultDateRange:we,locale:g,onDateRangeChange:e=>{Se(),Me(`custom`,e)},onPresetChange:(e,t)=>{Se(),Me(e,t)},preset:U}),(0,l.jsxs)(`button`,{className:`operations-clear-filters`,onClick:Pe,type:`button`,children:[(0,l.jsx)(jl,{}),g===`pt-BR`?`Limpar filtros`:`Clear filters`]})]}),filtersActive:!!(L||z||B||V||je.start!==we.start||je.end!==we.end),lastUpdatedAt:p,snapshotUpdatedAt:u.summary.projection_updated_at??null,loading:Xe,locale:g,onLocaleChange:_,onRefresh:P,...F===void 0?{}:{repositoryName:F},settings:se,title:f}),(0,l.jsx)(`h1`,{className:`operations-sr-only`,children:`Operações`}),(0,l.jsxs)(`header`,{className:`operations-hero`,children:[(0,l.jsx)(`div`,{children:(0,l.jsx)(`small`,{className:`operations-last-updated`,children:p===null?g===`pt-BR`?`Aguardando atualização`:`Waiting for refresh`:`${g===`pt-BR`?`Atualizado`:`Updated`} ${new Intl.DateTimeFormat(g,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(p))}`})}),(0,l.jsxs)(`div`,{className:`operations-actions`,children:[(0,l.jsx)(`button`,{"aria-label":g===`pt-BR`?`Atualizar`:`Refresh`,className:`operations-nav-icon`,disabled:m,onClick:P,type:`button`,children:(0,l.jsx)(Ol,{})}),(0,l.jsxs)(`div`,{className:`operations-nav-popup-anchor`,children:[(0,l.jsxs)(`button`,{className:`operations-nav-button${me?` is-active`:``}`,onClick:()=>{he(e=>!e),_e(!1)},type:`button`,children:[(0,l.jsx)(kl,{}),` `,g===`pt-BR`?`Filtros`:`Filters`]}),me?(0,l.jsxs)(`div`,{className:`operations-nav-popup operations-filter-popup`,children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:g===`pt-BR`?`Busca`:`Search`}),(0,l.jsx)(`input`,{onChange:e=>R(e.target.value),placeholder:g===`pt-BR`?`ID ou nome de ${Nl[g][I]}`:`${Nl[g][I]} ID or name`,value:L})]}),I===`work-kanban`||I===`work-list`?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:`Status`}),(0,l.jsxs)(`select`,{onChange:e=>ve(e.target.value),value:z,children:[(0,l.jsx)(`option`,{value:``,children:g===`pt-BR`?`Todos`:`All`}),Hc.map(e=>(0,l.jsx)(`option`,{value:e,children:Yc(e,g)},e))]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:g===`pt-BR`?`Risco`:`Risk`}),(0,l.jsxs)(`select`,{onChange:e=>ye(e.target.value),value:B,children:[(0,l.jsx)(`option`,{value:``,children:g===`pt-BR`?`Todos`:`All`}),(0,l.jsx)(`option`,{value:`lite`,children:Nc(`lite`,g)}),(0,l.jsx)(`option`,{value:`standard`,children:Nc(`standard`,g)}),(0,l.jsx)(`option`,{value:`critical`,children:Nc(`critical`,g)})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:g===`pt-BR`?`Origem da tarefa`:`Task origin`}),(0,l.jsxs)(`select`,{onChange:e=>be(e.target.value),value:V,children:[(0,l.jsx)(`option`,{value:``,children:g===`pt-BR`?`Todas`:`All`}),Pc.map(e=>(0,l.jsx)(`option`,{value:e,children:Ic(e)},e))]})]})]}):null,(0,l.jsx)(`button`,{onClick:Pe,type:`button`,children:g===`pt-BR`?`Limpar filtros`:`Clear filters`})]}):null]}),(0,l.jsxs)(`div`,{className:`operations-nav-popup-anchor`,children:[(0,l.jsxs)(`button`,{className:`operations-nav-button${ge?` is-active`:``}`,onClick:()=>{_e(e=>!e),he(!1)},type:`button`,children:[(0,l.jsx)(Dl,{locale:g}),g===`pt-BR`?`PT-BR`:`EN-US`,(0,l.jsx)(Al,{})]}),ge?(0,l.jsxs)(`div`,{className:`operations-nav-popup operations-locale-popup`,children:[(0,l.jsxs)(`button`,{onClick:()=>{_(`pt-BR`),_e(!1)},type:`button`,children:[(0,l.jsx)(Dl,{locale:`pt-BR`}),` Português do Brasil`,g===`pt-BR`?(0,l.jsx)(`span`,{children:`✓`}):null]}),(0,l.jsxs)(`button`,{onClick:()=>{_(`en-US`),_e(!1)},type:`button`,children:[(0,l.jsx)(Dl,{locale:`en-US`}),` English`,g===`en-US`?(0,l.jsx)(`span`,{children:`✓`}):null]})]}):null]})]})]}),Xe?(0,l.jsx)(`div`,{"aria-live":`polite`,className:`operations-loading-status`,role:`status`,children:g===`pt-BR`?`Carregando dados atualizados…`:`Loading updated data…`}):null,(0,l.jsx)(`div`,{"aria-busy":Xe,className:Xe?`operations-filtered is-loading`:`operations-filtered`,children:Id(m)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Pd,{capabilityNavigation:s,currency:c,data:u,datePreset:U,dateRange:je,defaultDateRange:we,includeLegacyEffort:W,locale:g,onOpenTask:b,onOpenDocument:v,onOpenMacro:y,onLoadStatus:M,prds:Ve,query:L,factualCostTotal:ce,factualCostFact:le,costLoading:ue,resolveRunCost:fe,runs:He,searchInputRef:Ce,setQuery:R,showFilterLoading:Se,specs:q,tasks:Le,statusPage:te,onLoadStatusPage:M,classificationPage:ne,onLoadClassificationPage:re,onLoadMacroMetrics:S,updatePeriod:Me}),Ne??(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`section`,{className:`operations-toolbar`,children:[(0,l.jsx)(Pl,{locale:g,onChange:Fe,view:I}),(0,l.jsx)(`div`,{className:`operations-tab-export`,children:(0,l.jsx)(lc,{filters:{query:L,status:z,risk:B,origin:V,dateRange:je,datePreset:U},rows:Ye,pageSource:I===`work-kanban`?i?.({query:L,status:z,risk:B,origin:V}):a?.(I,{query:L,status:z,risk:B,origin:V,...I===`work-list`&&j!==void 0&&j.typeFilter!==`all`?{kind:j.typeFilter}:{}}),view:`operations-${I}`})})]}),(0,l.jsx)(Vu,{boardKindTotals:n,boardStates:r,boardTotals:t,changes:Re,conversationExecutions:Ue,conversationRuns:Ge,currency:c,data:u,entityPage:C,executions:ze,factualCostPeriods:de,includeLegacyEffort:W,locale:g,onBoardTypeChange:O,onEntityPageChange:w,onLoadMoreBoard:ee,onWorkListTypeChange:k,onWorkListPageChange:A,onOpenDocument:v,onOpenTask:b,onPriorityChange:x,prds:Ve,resolveRunCost:fe,runs:He,specs:q,summaryPopulation:qe,tasks:Le,workListPage:j,view:I})]})]}):(0,l.jsx)(Fd,{locale:g})})]})}function Jd({detail:e,error:t,label:n,loading:r=!1,locale:i,onClose:a,onRetry:o,preview:s}){let c=i===`pt-BR`;return(0,y.createPortal)((0,l.jsx)(`div`,{className:`operations-prd-document-backdrop`,onMouseDown:e=>{e.currentTarget===e.target&&a()},children:(0,l.jsxs)(`section`,{"aria-label":c?`${n} completa`:`Full ${n}`,"aria-modal":`true`,className:`operations-prd-document-dialog`,role:`dialog`,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`span`,{children:[(0,l.jsx)(Uo,{"aria-hidden":`true`,size:16}),` `,n]}),(0,l.jsx)(`h2`,{children:e?.title??s.title}),(0,l.jsx)(`p`,{children:e?.id??s.id})]}),(0,l.jsx)(`button`,{"aria-label":c?`Fechar`:`Close`,onClick:a,type:`button`,children:(0,l.jsx)(Xo,{"aria-hidden":`true`,size:20})})]}),(0,l.jsxs)(`div`,{className:`operations-prd-document-scroll`,children:[e?(0,l.jsx)(Zd,{content:e.body}):null,r?(0,l.jsx)(Yd,{locale:i}):null,t?(0,l.jsx)(Xd,{error:t,locale:i,onRetry:o}):null]}),(0,l.jsx)(`footer`,{children:e?.artifact_path??s.artifact_path})]})}),document.body)}function Yd({locale:e}){let t=e===`pt-BR`;return(0,l.jsxs)(`section`,{"aria-busy":`true`,"aria-live":`polite`,className:`operations-prd-document-loading`,children:[(0,l.jsxs)(`div`,{className:`operations-prd-document-loading-copy`,children:[(0,l.jsx)(qo,{"aria-hidden":`true`,className:`operations-prd-document-spinner`,size:20}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`strong`,{children:t?`Carregando documento`:`Loading document`}),(0,l.jsx)(`p`,{children:t?`Preparando a leitura completa…`:`Preparing the full reader…`})]})]}),(0,l.jsxs)(`div`,{"aria-hidden":`true`,className:`operations-prd-document-skeleton`,children:[(0,l.jsx)(`i`,{}),(0,l.jsx)(`i`,{}),(0,l.jsx)(`i`,{}),(0,l.jsx)(`i`,{})]})]})}function Xd({error:e,locale:t,onRetry:n}){let r=t===`pt-BR`;return(0,l.jsxs)(`section`,{"aria-live":`assertive`,className:`operations-prd-document-error`,role:`alert`,children:[(0,l.jsx)(`strong`,{children:r?`Não foi possível carregar o documento.`:`Unable to load document.`}),(0,l.jsx)(`p`,{children:e}),n?(0,l.jsxs)(`button`,{onClick:n,type:`button`,children:[(0,l.jsx)(Jo,{"aria-hidden":`true`,size:15}),` `,r?`Tentar novamente`:`Retry`]}):null]})}function Zd({content:e}){return(0,l.jsx)(`article`,{className:`operations-prd-markdown`,children:Qd(e).map((e,t)=>{let n=`${e.kind}-${t}`;return e.kind===`heading`?(0,l.jsx)(`h${e.level}`,{children:tf(e.content)},n):e.kind===`paragraph`?(0,l.jsx)(`p`,{children:tf(e.content)},n):e.kind===`list`?(0,l.jsx)(e.ordered?`ol`:`ul`,{children:e.items.map(e=>(0,l.jsx)(`li`,{children:tf(e)},e))},n):e.kind===`quote`?(0,l.jsx)(`blockquote`,{children:tf(e.content)},n):e.kind===`code`?(0,l.jsx)(`pre`,{children:(0,l.jsx)(`code`,{"data-language":e.language??void 0,children:e.content})},n):e.kind===`table`?(0,l.jsx)(`div`,{className:`operations-prd-markdown-table`,children:(0,l.jsxs)(`table`,{children:[(0,l.jsx)(`thead`,{children:(0,l.jsx)(`tr`,{children:e.headers.map(e=>(0,l.jsx)(`th`,{children:tf(e)},e))})}),(0,l.jsx)(`tbody`,{children:e.rows.map(e=>(0,l.jsx)(`tr`,{children:e.map(e=>(0,l.jsx)(`td`,{children:tf(e)},e))},e.join(`|`)))})]})},n):(0,l.jsx)(`hr`,{},n)})})}function Qd(e){let t=e.replace(/\r\n/g,`
|
|
66
|
-
`).split(`
|
|
67
|
-
`),n=[],r=[],i=()=>{let e=r.join(` `).trim();e&&n.push({kind:`paragraph`,content:e}),r=[]};for(let e=0;e<t.length;e+=1){let a=t[e]??``,o=a.match(/^(#{1,3})\s+(.+)$/);if(o){i(),n.push({kind:`heading`,level:(o[1]??`#`).length,content:o[2]??``});continue}if(/^\s*(```|~~~)/.test(a)){i();let r=a.trim().slice(0,3),o=[],s=a.trim().slice(3).trim()||null;for(;++e<t.length&&!(t[e]??``).trim().startsWith(r);)o.push(t[e]??``);n.push({kind:`code`,content:o.join(`
|
|
68
|
-
`),language:s});continue}if(a.includes(`|`)&&e+1<t.length&&$d(t[e+1]??``)){i();let r=ef(a),o=[];for(e+=2;e<t.length&&(t[e]??``).includes(`|`);)o.push(ef(t[e]??``)),e+=1;--e,n.push({kind:`table`,headers:r,rows:o});continue}let s=a.match(/^\s*(?:([-*+])|(\d+)\.)\s+(.+)$/);if(s){i();let r=!!s[2],a=[s[3]??``];for(;e+1<t.length;){let n=(t[e+1]??``).match(/^\s*(?:([-*+])|(\d+)\.)\s+(.+)$/);if(!n||!!n[2]!==r)break;a.push(n[3]??``),e+=1}n.push({kind:`list`,ordered:r,items:a});continue}if(/^\s*>\s?/.test(a)){i(),n.push({kind:`quote`,content:a.replace(/^\s*>\s?/,``)});continue}if(/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/.test(a)){i(),n.push({kind:`rule`});continue}if(!a.trim()){i();continue}r.push(a.trim())}return i(),n}function $d(e){return ef(e).every(e=>/^:?-{3,}:?$/.test(e.replace(/\s/g,``)))}function ef(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function tf(e){return e.split(/(\*\*[^*]+\*\*|`[^`]+`|\*[^*]+\*|\[[^\]]+\]\([^\s)]+\))/g).map(e=>{if(e.startsWith(`**`)&&e.endsWith(`**`))return(0,l.jsx)(`strong`,{children:e.slice(2,-2)},e);if(e.startsWith("`")&&e.endsWith("`"))return(0,l.jsx)(`code`,{children:e.slice(1,-1)},e);if(e.startsWith(`*`)&&e.endsWith(`*`))return(0,l.jsx)(`em`,{children:e.slice(1,-1)},e);let t=e.match(/^\[([^\]]+)\]\(([^\s)]+)\)$/);return t?(0,l.jsx)(`a`,{href:t[2],rel:`noreferrer`,target:`_blank`,children:t[1]},e):(0,l.jsx)(o.Fragment,{children:e},e)})}function nf(e,t){let n=new Map(e.map(e=>[e.key,e]));for(let e of t??[])n.has(e)||n.set(e,rf(e));return[...n.values()].sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at)||e.label.localeCompare(t.label))}function rf(e){return{key:e,label:e,latest_started_at:``,run_count:0,task_count:0,prd_count:0,spec_count:0,evidence_count:0,test_count:0,event_count:0,total_tokens:0,estimated_usd:0,estimated_brl:0,duration_ms:0,duration:{known_sum:0,unknown:0,complete:!0,coverage_ratio:1},coverage:{events:0,tokens:0,usd:0,brl:0}}}function af(e){let t=e?.trim().toLowerCase();return!t||t===`unknown`||t===`codex`?`openai`:t}function of(e){return e.length===0||e.some(e=>e===null)?null:e.reduce((e,t)=>e+(t??0),0)/e.length}function sf(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)}function cf(e,t=`all_invocations`){let n=new Map;for(let t of e)n.has(t.run_id)||n.set(t.run_id,t);let r=[...n.values()];if(t===`all_invocations`)return r;let i=new Set(r.map(e=>e.run_id));return t===`all_execution`?r.filter(e=>e.phase===`execution`):r.filter(e=>e.phase===`execution`&&(e.parent_run_id===null||!i.has(e.parent_run_id)))}function lf(e,t=`all_invocations`){let n=cf(e,t),r=n.filter(e=>e.duration_ms!==null),i=n.length-r.length;return{known_sum:r.reduce((e,t)=>e+t.duration_ms,0),unknown:i,complete:i===0,coverage_ratio:n.length===0?1:r.length/n.length}}var uf={events:0,tokens:0,usd:0,brl:0};function df(e,t){let n=new Map;for(let e of t)e.task_id!==null&&n.set(e.task_id,[...n.get(e.task_id)??[],e]);let r=e.filter(e=>n.has(e.id)).map(e=>pf(e,n.get(e.id)??[])),i=new Set(e.map(e=>e.id)),a=[...n].filter(([e])=>!i.has(e)).map(([e,t])=>ff(e,t)),o=t.filter(e=>e.task_id===null),s=o.length===0?[]:[ff(`Sem tarefa vinculada`,o)];return[...r,...a,...s].sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function ff(e,t){return{...pf({id:e,title:e,created_at:t[0]?.started_at??``,test_count:0},t),label:`Tarefa histórica: ${e}`,latest_started_at:t.reduce((e,t)=>t.started_at>e?t.started_at:e,``)}}function pf(e,t){let n=lf(t);return{key:e.id,label:e.title,latest_started_at:e.created_at,run_count:t.length,task_count:1,tasksCreated:1,tasksActive:1,prd_count:0,spec_count:0,evidence_count:0,test_count:e.test_count??0,event_count:t.reduce((e,t)=>e+(t.event_count??0),0),total_tokens:sf(t.map(e=>e.total_tokens)),estimated_usd:sf(t.map(e=>e.estimated_usd)),estimated_brl:sf(t.map(e=>e.estimated_brl)),duration_ms:n.known_sum,duration:n,coverage:t.reduce((e,t)=>({events:e.events+t.coverage.events,tokens:e.tokens+t.coverage.tokens,usd:e.usd+t.coverage.usd,brl:e.brl+t.coverage.brl}),uf),coverage_counts:{source:`run_rows`,granularity:`event`,events:t.reduce((e,t)=>e+t.coverage.events,0),tokens:null,usd:null,brl:null,metrics:{tokens:mf(t,e=>e.total_tokens),usd:mf(t,e=>e.estimated_usd),brl:mf(t,e=>e.estimated_brl)}}}}function mf(e,t){let n=e.filter(e=>t(e)!==null).length;return{eligible_runs:e.length,known_runs:n,unknown_runs:e.length-n}}function hf(e,t=`all_invocations`){return cf(e,t)}function gf(e,t){return e===`fast`?t===`pt-BR`?`Priority (derivado de Fast)`:`Priority (derived from Fast)`:e===`priority`?`Priority (API)`:e==="default"?`Standard (API)`:`-`}function _f(e){return{primary:e.model,detail:e.provider===null||e.provider===`unknown`?`-`:e.provider}}function vf(e,t,n){return e===`pt-BR`?t:n}function yf(e){let t=e.filter(e=>typeof e==`number`);return t.length===0?null:t.reduce((e,t)=>e+t,0)}var bf=e=>yf(hf(e).map(e=>e.duration_ms)),xf=(e,t)=>e.some(e=>{let n=t(e);return n!==null&&n!==0&&n!==``}),Sf=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}).format(e??0),Cf=(e,t)=>`R$ ${Sf(e,t)}`,wf=(e,t)=>new Intl.NumberFormat(t,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}).format(e??0),Tf=e=>{let t=e?.trim()??``;return t===``||t.toLowerCase()===`unknown`?null:t},Ef=(e,t,n)=>n===`pt-BR`?{low:`Leve`,medium:`Médio`,high:`Alto`,xhigh:`Extra alto`,max:`Ultra`,default:`Padrão`,priority:`Rápido`}[e]??e:e,Df=(e,t,n)=>e===null||t===null?`0`:`${e.toLocaleString(`en-US`,{maximumFractionDigits:3})}\u00d7 / ${t.toLocaleString(`en-US`,{maximumFractionDigits:3})}\u00d7`,Of=(e,t,n)=>{let r=Tf(e);if(r!==null)return Ef(r,`effort`,n);let i=Tf(t);if(i===null)return`-`;let a=Ef(i,`effort`,n);return n===`pt-BR`?`${a} (solicitado; efetivo -)`:`${a} (requested; effective -)`},kf=(e,t)=>{let n=Tf(e);return n===null?t===`pt-BR`?`Padrão`:`Standard`:Ef(n,`speed`,t)},Af=e=>e===`pt-BR`?`Tabela de custos por invocação com rolagem horizontal`:`Agent invocation costs table with horizontal scrolling`,jf=e=>e===`pt-BR`?`Tabela de custos agrupados com rolagem horizontal`:`Grouped costs table with horizontal scrolling`,Mf=(e,t)=>!e||Number.isNaN(Date.parse(e))?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(e)),Nf=(e,t,n)=>{if(t===`annual`)return e.slice(0,4);if(t===`monthly`)return e.slice(0,7);let r=new Date(`${e}T12:00:00.000Z`);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(n,{dateStyle:`short`,timeZone:`UTC`}).format(r)},Pf=({locale:e,duration:t,tokens:n,cost:r,currency:i})=>e===`pt-BR`?`Total geral \u2014 Tempo: ${t}; Tokens: ${n}; ${i}: ${r}`:`Grand total \u2014 Time: ${t}; Tokens: ${n}; Cost (${i}): ${r}`;function Ff({rows:e,locale:t,pagination:n,subtotal:r,onOpenTrace:i}){let a=(e,n)=>{if(e.known_sum===0&&!e.complete&&e.coverage_ratio===0)return`0`;let r=n(e.known_sum??0);return e.complete?r:`${r} (${t===`pt-BR`?`parcial`:`partial`})`},o=e=>If(e)===null?`0`:a(e.metrics.duration,e=>e===0?`0`:T(e,t)),s=(e,t)=>{if(r!==null)return a(e,t)},c=r!==null&&![r.run_count,r.metrics.duration,r.metrics.total_tokens,r.metrics.cost_brl].every(e=>e.unknown>0&&e.known_sum===0),u=e=>new Intl.NumberFormat(t).format(e),d=c?r===null?`Total`:`${t===`pt-BR`?`Subtotal filtrado`:`Filtered subtotal`} · ${u(r.entity_count)} ${t===`pt-BR`?`registros`:`records`}`:void 0,f=!c||r===null?void 0:s(r.metrics.cost_brl,e=>k(e,`BRL`,t));return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{columns:[{key:`occurredAt`,label:t===`pt-BR`?`Última atividade`:`Last activity`,render:e=>Mf(e.occurred_at,t),footer:d},{key:`entity`,label:t===`pt-BR`?`Registro`:`Record`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`small`,{children:e.id})]}),footer:!c||r===null?void 0:u(r.entity_count)},{key:`status`,label:`Status`,render:e=>e.status??`—`},{key:`runs`,label:t===`pt-BR`?`Invocações`:`Invocations`,render:e=>new Intl.NumberFormat(t).format(e.run_count),align:`right`,footer:!c||r===null?void 0:s(r.run_count,u)},{key:`duration`,label:t===`pt-BR`?`Tempo observado`:`Observed time`,render:o,align:`right`,footer:!c||r===null?void 0:s(r.metrics.duration,e=>e===0?`0`:T(e,t))},{key:`tokens`,label:`Tokens`,render:e=>a(e.metrics.total_tokens,e=>D(e,t)),align:`right`,footer:!c||r===null?void 0:s(r.metrics.total_tokens,e=>D(e,t))},{key:`cost`,label:t===`pt-BR`?`Custo registrado`:`Recorded cost`,render:e=>a(e.metrics.cost,n=>e.cost_currency===`BRL`||e.cost_currency===`USD`?k(n,e.cost_currency,t):new Intl.NumberFormat(t).format(n)),align:`right`,footer:f},...i===void 0?[]:[{key:`trace`,label:``,render:e=>(0,l.jsx)(`button`,{onClick:()=>i(e.id),type:`button`,children:t===`pt-BR`?`Abrir`:`Open`})}]],locale:t,pageSize:null,rowKey:e=>e.id,rows:e,sortable:!0}),(0,l.jsx)(Rf,{locale:t,pagination:n})]})}function If(e){let t=e.metrics.duration;return t.known_sum===0&&!t.complete&&t.coverage_ratio===0?null:t.known_sum}function Lf(e){return e}function Rf({locale:e,pagination:t}){let n=t.total===0?0:t.offset+1,r=t.total===null?t.offset+t.limit:Math.min(t.offset+t.limit,t.total),i=Math.max(0,t.offset-t.limit),a=t.offset+t.limit;return(0,l.jsxs)(`nav`,{"aria-label":e===`pt-BR`?`Paginação dos dados agregados`:`Aggregate data pagination`,className:`ui-table-pagination`,children:[(0,l.jsx)(`button`,{disabled:t.loading||t.offset===0,onClick:()=>t.onChange(i),type:`button`,children:e===`pt-BR`?`Anterior`:`Previous`}),(0,l.jsx)(`span`,{"aria-live":`polite`,children:t.loading?e===`pt-BR`?`Carregando dados…`:`Loading data…`:t.total===null?`${n}–${r}${t.has_more?`+`:``}`:`${n}–${r} ${e===`pt-BR`?`de`:`of`} ${t.total}`}),(0,l.jsx)(`button`,{disabled:t.loading||!t.has_more&&(t.total===null||a>=t.total),onClick:()=>t.onChange(a),type:`button`,children:e===`pt-BR`?`Próxima`:`Next`}),t.error?(0,l.jsxs)(`span`,{role:`status`,children:[t.error,` `,(0,l.jsx)(`button`,{onClick:t.onRetry,type:`button`,children:e===`pt-BR`?`Tentar novamente`:`Retry`})]}):null]})}async function zf({currency:e,filters:t,from:n,refresh:r,to:i,signal:a,fetcher:o=fetch}){let s=new URLSearchParams({currency:e});if(s.set(`scope`,`summary`),n!==void 0&&s.set(`from`,n),i!==void 0&&s.set(`to`,i),t){let e=[[`provider`,t.provider],[`phase`,t.phase],[`agent`,t.agent],[`model`,t.model],[`status`,t.status],[`query`,t.query],[`priority`,t.priority],[`risk`,t.risk],[`origin`,t.origin],[`workType`,t.workType]];for(let[t,n]of e)n&&s.set(t,n)}r&&s.set(`refresh`,r);let c=await o(`/api/v2/cost-monitor?${s.toString()}`,{...a===void 0?{}:{signal:a}});if(!c.ok){let e=(await c.text()).trim();throw Error(e||`Cost Monitor period request failed (${c.status})`)}return await c.json()}async function Bf({currency:e,filters:t,from:n,refresh:r,to:i,signal:a,fetcher:o=fetch}){let s=Hf({currency:e,...t===void 0?{}:{filters:t},...n===void 0?{}:{from:n},...r===void 0?{}:{refresh:r},...i===void 0?{}:{to:i}});s.set(`scope`,`detail`);let c=await o(`/api/v2/cost-monitor?${s.toString()}`,{...a===void 0?{}:{signal:a}});if(!c.ok)throw Error((await c.text()).trim()||`Cost Monitor detail request failed (${c.status})`);return await c.json()}async function Vf({currency:e,filters:t,from:n,limit:r=10,offset:i,refresh:a,to:o,signal:s,fetcher:c=fetch}){let l=Hf({currency:e,...t===void 0?{}:{filters:t},...n===void 0?{}:{from:n},...a===void 0?{}:{refresh:a},...o===void 0?{}:{to:o}});l.set(`scope`,`runs`),l.set(`offset`,String(Math.max(0,i))),l.set(`limit`,String(Math.max(1,r)));let u=await c(`/api/v2/cost-monitor?${l.toString()}`,{...s===void 0?{}:{signal:s}});if(!u.ok){let e=(await u.text()).trim();throw Error(e||`Cost Monitor run page request failed (${u.status})`)}let d=await u.json();return{page_only:!0,runs:d.runs,run_page:d.run_page??{offset:i,limit:r,total:null,has_more:!1}}}function Hf({currency:e,filters:t,from:n,refresh:r,to:i}){let a=new URLSearchParams({currency:e});if(n!==void 0&&a.set(`from`,n),i!==void 0&&a.set(`to`,i),t){let e=[[`provider`,t.provider],[`phase`,t.phase],[`agent`,t.agent],[`model`,t.model],[`status`,t.status]];for(let[t,n]of e)n&&a.set(t,n);t.query&&a.set(`query`,t.query)}return r&&a.set(`refresh`,r),a}var Uf=`month`;function Wf(e,t=new Date){if(Number.isNaN(t.getTime()))throw RangeError(`Invalid Cost Monitor period anchor`);let n=sl(t.toISOString(),`day`);if(n===null)throw RangeError(`Invalid Cost Monitor period anchor`);if(e===`all`)return;if(e===`month`)return{from:`${n.slice(0,7)}-01`,to:n};let r=new Date(`${n}T12:00:00.000Z`);return r.setUTCDate(r.getUTCDate()-(Number(e)-1)),{from:sl(r.toISOString(),`day`)??n,to:n}}function Gf({currency:e,data:t,dateRange:n,filters:r,lastUpdatedAt:i,loadPeriod:a,period:s,snapshotBacked:c=!1}){let[l,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(null),[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(null),_=(0,o.useRef)(!0),v=(0,o.useRef)(0),y=(0,o.useRef)(a);y.current=a;let b=n===void 0?c&&s===`month`?void 0:Wf(s):{from:n.start,to:n.end},x=b?.from,S=b?.to,C=Kf({filters:r,period:s,snapshotBacked:c});return(0,o.useEffect)(()=>{let n=++v.current;if(!C){_.current=!1,m(!1),g(null),u(null),f(null);return}if(_.current&&Object.values(r).every(e=>e===``)){_.current=!1;return}_.current=!1;let a=new AbortController;return m(!0),g(null),y.current({currency:e,filters:r,...x===void 0||S===void 0?{}:{from:x,to:S},refresh:i,signal:a.signal}).then(e=>{a.signal.aborted||(f(t),u(e))}).catch(e=>{a.signal.aborted||g(e instanceof Error?e.message:String(e))}).finally(()=>{!a.signal.aborted&&n===v.current&&m(!1)}),()=>a.abort()},[e,t,r,i,x,S,C]),{activeData:qf(t,l,d),periodError:h,periodLoading:p}}function Kf({filters:e,period:t,snapshotBacked:n}){return!(n&&t===`month`&&Object.values(e).every(e=>e===``))}function qf(e,t,n){return t!==null&&n===e?t:e}var Jf={query:``,provider:``,phase:``,origin:``,workType:``,agent:``,model:``,status:``,priority:``,risk:``};function Yf({available:e,hideQuery:t=!1,locale:n,value:r,onChange:i}){let a=(e,t)=>i({...r,[e]:t}),o=n===`en-US`?{search:`Search costs`,placeholder:`Invocation, task, model…`,agent:`Agent`,model:`Model`,priority:`Priority`,risk:`Risk`,phase:`Phase`,origin:`Origin`,work:`Work`,all:`All`,clear:`Clear`}:{search:`Buscar custos`,placeholder:`Invocação, tarefa, modelo…`,agent:`Agente`,model:`Modelo`,priority:`Prioridade`,risk:`Risco`,phase:`Fase`,origin:`Entrada`,work:`Trabalho`,all:`Todos`,clear:`Limpar`};return(0,l.jsxs)(`section`,{className:`cost-filters`,children:[t?null:(0,l.jsx)(`input`,{"aria-label":o.search,onChange:e=>a(`query`,e.target.value),placeholder:o.placeholder,value:r.query}),(0,l.jsx)(Xf,{allLabel:o.all,label:`Provider`,onChange:e=>a(`provider`,e),options:e.providers,value:r.provider}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.agent,onChange:e=>a(`agent`,e),options:e.agents,value:r.agent}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.model,onChange:e=>a(`model`,e),options:e.models,value:r.model}),(0,l.jsx)(Xf,{label:`Status`,allLabel:o.all,onChange:e=>a(`status`,e),options:e.statuses,value:r.status}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.priority,onChange:e=>a(`priority`,e),options:e.priorities,value:r.priority}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.risk,onChange:e=>a(`risk`,e),options:e.risks,value:r.risk}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.phase,onChange:e=>a(`phase`,e),options:e.phases,value:r.phase}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.origin,onChange:e=>a(`origin`,e),options:e.origins,value:r.origin}),(0,l.jsx)(Xf,{allLabel:o.all,label:o.work,onChange:e=>a(`workType`,e),options:e.work_types,value:r.workType}),(0,l.jsx)(`button`,{onClick:()=>i(Jf),type:`button`,children:o.clear})]})}function Xf({allLabel:e=`Todos`,label:t,value:n,options:r,onChange:i}){return(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:t}),(0,l.jsxs)(`select`,{"aria-label":t,onChange:e=>i(e.target.value),value:n,children:[(0,l.jsx)(`option`,{value:``,children:e}),r.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))]})]})}var Zf=[`#00b0f0`,`#5ea7ff`,`#a78bfa`,`#f5c451`,`#fb7185`,`#94a3b8`];function Qf({rows:e,daily:t,models:n,summaryUsage:r,currency:i,locale:a}){let o=ip(a),s=$f(e,r,o),c=sp(n,i),u=Math.max(1,...c.map(e=>op(e,i)??0)),d=dp(t,i),f=Math.max(1,...d.map(e=>e.value??0)),p=d.map((e,t)=>({...e,x:t/(d.length-1)*100,y:82-(e.value??0)/f*58})),m=p.map(e=>`${e.x},${e.y}`).join(` `);return(0,l.jsxs)(`section`,{className:`cost-chart-grid`,"aria-label":o.analyticsView,children:[(0,l.jsxs)(`article`,{className:`cost-chart cost-chart-trend`,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`small`,{children:o.trend}),(0,l.jsx)(`h2`,{children:o.dailyCost})]}),(0,l.jsx)(`strong`,{children:o.sevenDays})]}),(0,l.jsxs)(`div`,{className:`cost-trend-plot`,children:[(0,l.jsxs)(`svg`,{className:`cost-line-chart`,role:`img`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,children:[(0,l.jsx)(`title`,{children:o.dailyCostChart}),(0,l.jsx)(`defs`,{children:(0,l.jsxs)(`linearGradient`,{id:`cost-area`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,l.jsx)(`stop`,{stopColor:`#00b0f0`,stopOpacity:`.34`}),(0,l.jsx)(`stop`,{offset:`1`,stopColor:`#00b0f0`,stopOpacity:`0`})]})}),(0,l.jsx)(`polygon`,{fill:`url(#cost-area)`,points:`0,100 ${m} 100,100`}),(0,l.jsx)(`polyline`,{fill:`none`,points:m,stroke:`#00b0f0`,strokeWidth:`2`,vectorEffect:`non-scaling-stroke`})]}),p.map((e,t)=>(0,l.jsx)(`span`,{className:`cost-trend-value${t===0?` is-first`:t===p.length-1?` is-last`:``}`,style:{left:`${e.x}%`,top:`${e.y}%`},children:rp(e.value,i,a)},e.key))]}),(0,l.jsx)(`div`,{className:`cost-trend-days`,children:p.map(e=>(0,l.jsx)(`span`,{children:fp(e.date,a)},e.key))})]}),(0,l.jsxs)(`article`,{className:`cost-chart cost-chart-model`,children:[(0,l.jsx)(`header`,{children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`small`,{children:o.distribution}),(0,l.jsx)(`h2`,{children:o.costByModel})]})}),(0,l.jsx)(`div`,{className:`cost-bar-list`,children:c.slice(0,6).map((e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{children:e.label}),(0,l.jsx)(`i`,{children:(0,l.jsx)(`b`,{style:{width:`${(op(e,i)??0)/u*100}%`,background:Zf[t]}})}),(0,l.jsx)(`strong`,{children:rp(op(e,i),i,a)})]},e.key))})]}),(0,l.jsxs)(`article`,{className:`cost-chart`,children:[(0,l.jsx)(`header`,{children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`small`,{children:o.composition}),(0,l.jsx)(`h2`,{children:o.tokenMix})]})}),(0,l.jsx)(`div`,{className:`token-mix`,children:s.map(([e,t],n)=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`i`,{style:{background:Zf[n]}}),(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`strong`,{children:np(t,a)})]},e))})]}),(0,l.jsxs)(`article`,{className:`cost-chart cost-chart-phases`,children:[(0,l.jsx)(`header`,{children:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`small`,{children:o.phases}),(0,l.jsx)(`h2`,{children:o.totalsByPhase})]})}),(0,l.jsx)(`div`,{className:`phase-strip`,children:[`conversation`,`planning`,`execution`].map((t,n)=>{let o=ep(t,e,r,i);return(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`phase-name`,children:[(0,l.jsx)(`i`,{style:{background:Zf[n]}}),(0,l.jsx)(`span`,{children:ap(t,a)})]}),(0,l.jsxs)(`dl`,{className:`phase-metrics`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`dt`,{children:a===`pt-BR`?`Tempo`:`Time`}),(0,l.jsx)(`dd`,{children:tp(o.duration,a)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`dt`,{children:`Tokens`}),(0,l.jsx)(`dd`,{children:np(o.tokens,a)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`dt`,{children:a===`pt-BR`?`Custo`:`Cost`}),(0,l.jsx)(`dd`,{children:rp(o.cost,i,a)})]})]})]},t)})})]})]})}function $f(e,t,n){let r=t?.total.tokens,i=r?.input??pp(e.map(e=>e.input_tokens)),a=cp(r?.cached_input??pp(e.map(e=>e.cached_input_tokens)),i),o=r?.output??pp(e.map(e=>e.output_tokens)),s=cp(r?.reasoning??pp(e.map(e=>e.reasoning_tokens)),o),c=up(i,o,r?.total??pp(e.map(e=>e.total_tokens)));return[[n.inputWithoutCache,lp(i,a)],[n.cachedInput,a],[n.visibleOutput,lp(o,s)],[n.reasoning,s],[n.total,c]]}function ep(e,t,n,r){let i=t.filter(t=>t.phase===e),a=n?.[e];return{duration:a?.duration_ms??pp(i.map(e=>e.duration_provenance===`observed`||e.duration_provenance===`reconciled`||e.duration_provenance===`legacy_inferred`?e.duration_ms:null)),tokens:a?.tokens.total??pp(i.map(e=>e.total_tokens)),cost:(r===`BRL`?a?.cost.brl:a?.cost.usd)??pp(i.map(e=>r===`BRL`?e.estimated_brl:e.estimated_usd))}}function tp(e,t){return e===null||e===0?`0`:T(e,t)}function np(e,t){return D(e??0,t)}function rp(e,t,n){return k(e??0,t,n)}function ip(e){return e===`pt-BR`?{analyticsView:`Visão analítica`,trend:`TENDÊNCIA`,dailyCost:`Custo diário`,sevenDays:`7 dias`,dailyCostChart:`Custo diário dos últimos 7 dias`,distribution:`DISTRIBUIÇÃO`,costByModel:`Custo por modelo`,composition:`COMPOSIÇÃO`,tokenMix:`Mix de tokens`,phases:`FASES`,totalsByPhase:`Totais por fase`,inputWithoutCache:`Input sem cache`,cachedInput:`Cache`,visibleOutput:`Output visível`,reasoning:`Raciocínio`,total:`Total (input + output)`}:{analyticsView:`Analytics overview`,trend:`TREND`,dailyCost:`Daily cost`,sevenDays:`7 days`,dailyCostChart:`Daily cost for the last 7 days`,distribution:`DISTRIBUTION`,costByModel:`Cost by model`,composition:`COMPOSITION`,tokenMix:`Token mix`,phases:`PHASES`,totalsByPhase:`Totals by phase`,inputWithoutCache:`Uncached input`,cachedInput:`Cached input`,visibleOutput:`Visible output`,reasoning:`Reasoning`,total:`Total (input + output)`}}function ap(e,t){return t===`en-US`?e===`conversation`?`Conversation`:e===`planning`?`Planning`:`Execution`:e===`conversation`?`Conversa`:e===`planning`?`Planejamento`:`Execução`}function op(e,t){return t===`BRL`?e.estimated_brl:e.estimated_usd}function sp(e,t){return e.filter(e=>op(e,t)!==null).sort((e,n)=>{let r=(op(n,t)??0)-(op(e,t)??0);return r===0?e.key.localeCompare(n.key):r})}function cp(e,t){return e===null||t===null||e>t?null:e}function lp(e,t){return e===null||t===null?null:e-t}function up(e,t,n){return e!==null&&t!==null?e+t:n}function dp(e,t){let n=new Map(e.map(e=>[e.key,op(e,t)]));return[...n.keys()].sort().slice(-7).map(e=>({date:new Date(`${e}T12:00:00`),key:e,value:n.get(e)}))}function fp(e,t){return new Intl.DateTimeFormat(t,{weekday:`short`,day:`2-digit`,month:`2-digit`}).format(e).replace(`.`,``)}function pp(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0):null}function mp(e,t){let n=e.length;return{tasks:gp(e.map(e=>e.task_count),n),specs:gp(e.map(e=>e.spec_count),n),prds:gp(e.map(e=>e.prd_count),n),durationMs:gp(e.map(e=>e.duration_ms),n),tokens:hp(e.map(e=>e.total_tokens)),cost:hp(e.map(e=>t===`BRL`?e.estimated_brl:e.estimated_usd))}}function hp(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function gp(e,t){return t===0||e.every(e=>e===null)?null:e.reduce((e,t)=>e+(t??0),0)/t}function _p(e,t,n){let r=new Map(e.map(e=>[e.key,{...e,task_count:0,tasksActive:0,taskDaysActive:0,tasksCreated:0}])),i=new Map,a=new Set((t.evidences??[]).map(e=>e.id)),o=e=>{let t=vp(e,n);if(t===null)return null;let i=r.get(t);if(i!==void 0)return i;let a={key:t,label:t,latest_started_at:yp(t,n),run_count:0,task_count:0,tasksCreated:0,tasksActive:0,taskDaysActive:0,event_count:0,total_tokens:null,estimated_usd:null,estimated_brl:null,duration_ms:null,duration:{known_sum:0,unknown:0,complete:!0,coverage_ratio:1},coverage:{events:0,tokens:0,usd:0,brl:0},prd_count:0,spec_count:0,evidence_count:0,test_count:0};return r.set(t,a),a};for(let e of t.prds){let t=o(e.created_at);t!==null&&(t.prd_count=(t.prd_count??0)+1)}for(let e of t.specs){let t=o(e.created_at);t!==null&&(t.spec_count=(t.spec_count??0)+1)}for(let e of t.tasks){let n=o(e.created_at);if(n===null)continue;n.task_count=(n.task_count??0)+1,n.tasksCreated=(n.tasksCreated??0)+1,t.validations===void 0&&(n.test_count=(n.test_count??0)+(e.test_count??0));let r=i.get(n.key)??new Set;for(let t of e.result?.evidence_ids??[])a.has(t)||r.add(t);i.set(n.key,r)}for(let e of t.evidences??[]){let t=o(e.observed_at);if(t===null)continue;let n=i.get(t.key)??new Set;n.add(e.id),i.set(t.key,n)}for(let[e,t]of i){let n=r.get(e);n!==void 0&&(n.evidence_count=t.size)}let s=new Map;for(let e of t.validations??[]){let t=o(e.executed_at);if(t===null)continue;let n=s.get(t.key)??new Set;n.add(e.id),s.set(t.key,n)}for(let[e,t]of s){let n=r.get(e);n!==void 0&&(n.test_count=t.size)}return[...r.values()].sort((e,t)=>t.key.localeCompare(e.key))}function vp(e,t){return sl(e,t===`daily`?`day`:t===`monthly`?`month`:`year`)}function yp(e,t){return t===`annual`?`${e}-01-01T00:00:00.000Z`:t===`monthly`?`${e}-01T00:00:00.000Z`:`${e}T00:00:00.000Z`}function bp({currency:e,locale:t,loading:n=!1,average:r,period:i,rows:a}){if(n)return(0,l.jsx)(`p`,{role:`status`,children:t===`pt-BR`?`Carregando médias…`:`Loading averages…`});let o=r===void 0?mp(a,e):r??{tasks:null,specs:null,prds:null,durationMs:null,tokens:null,cost:null};return(0,l.jsx)(ee,{ariaLabel:xp(i,t),metrics:[{label:Sp(t===`pt-BR`?`Tarefas`:`Tasks`,i,t),value:o.tasks===null?`0`:O(o.tasks,t,1)},{label:Sp(`SPECs`,i,t),value:o.specs===null?`0`:O(o.specs,t,1)},{label:Sp(`PRDs`,i,t),value:o.prds===null?`0`:O(o.prds,t,1)},{label:Sp(t===`pt-BR`?`Tempo`:`Time`,i,t),value:o.durationMs===null?`0`:E(o.durationMs,t)},{label:Sp(`Tokens`,i,t),value:o.tokens===null?`0`:D(o.tokens,t)},{label:Sp(t===`pt-BR`?`Custo`:`Cost`,i,t),value:o.cost===null?`0`:k(o.cost,e,t)}]})}function xp(e,t){return t===`en-US`?e===`daily`?`Daily averages`:e===`monthly`?`Monthly averages`:`Annual averages`:e===`daily`?`Médias por dia`:e===`monthly`?`Médias por mês`:`Médias por ano`}function Sp(e,t,n){return n===`en-US`?`${e} ${t===`daily`?`Daily average`:t===`monthly`?`Monthly average`:`Annual average`}`:`${e} ${t===`daily`?`Médio por dia`:t===`monthly`?`Médio por mês`:`Médio por ano`}`}function $(e,t){let n=e===`pt-BR`?`Valor da projeção SQLite/API desta Invocação de Agente. O zero exibido para um fato não medido não altera o valor canônico nulo.`:`Value from this Agent Invocation's SQLite/API projection. A displayed zero for an unmeasured fact does not change its canonical null value.`;return`${({duration:[`Tempo factual da invocação, quando capturado ou reconciliado.`,`Factual invocation duration, when captured or reconciled.`],inputTokens:[`Input total informado pela fonte; inclui a parcela de cache.`,`Source-reported total input; includes the cached portion.`],cachedInputTokens:[`Parcela de cache já incluída no input total.`,`Cached portion already included in total input.`],outputTokens:[`Output total informado pela fonte; inclui a parcela de raciocínio.`,`Source-reported total output; includes the reasoning portion.`],reasoningTokens:[`Parcela de raciocínio já incluída no output total.`,`Reasoning portion already included in total output.`],totalTokens:[`Soma de entrada e saída quando ambas são conhecidas; caso contrário, total informado pela fonte.`,`Input plus output when both are known; otherwise the source-reported total.`],inputRate:[`Tarifa efetiva de entrada em USD por milhão de tokens.`,`Effective input rate in USD per million tokens.`],cacheRate:[`Tarifa efetiva de entrada em cache em USD por milhão de tokens.`,`Effective cached-input rate in USD per million tokens.`],outputRate:[`Tarifa efetiva de saída em USD por milhão de tokens.`,`Effective output rate in USD per million tokens.`],reasoningRate:[`Tarifa efetiva de raciocínio em USD por milhão de tokens.`,`Effective reasoning rate in USD per million tokens.`],contextMultiplier:[`Multiplicadores de contexto de entrada/saída aplicados aos segmentos internos.`,`Input/output context multipliers applied to internal segments.`],inputCost:[`Custo USD de entrada calculado com tokens e tarifa efetiva.`,`Input USD cost calculated from tokens and the effective rate.`],cacheCost:[`Custo USD da entrada em cache calculado com tokens e tarifa efetiva.`,`Cached-input USD cost calculated with tokens and the effective rate.`],outputCost:[`Custo USD de saída calculado com tokens e tarifa efetiva.`,`Output USD cost calculated with tokens and the effective rate.`],reasoningCost:[`Custo USD de raciocínio calculado com tokens e tarifa efetiva.`,`Reasoning USD cost calculated with tokens and the effective rate.`],standardCost:[`Custo USD no cenário Standard, antes do acréscimo de velocidade.`,`USD cost in the Standard scenario, before the speed uplift.`],speedUplift:[`Acréscimo USD do cenário Priority/Fast, já incluído no custo efetivo.`,`USD uplift from the Priority/Fast scenario, already included in the effective cost.`],finalUsd:[`Custo final estimado da API em USD, somando os componentes de custo desta invocação.`,`Estimated final API cost in USD, summing this invocation's cost components.`],fxRate:[`Câmbio BRL/USD atual aplicado para converter o custo final atual.`,`Current BRL/USD exchange rate used to convert the current final cost.`],recordedFxRate:[`Câmbio BRL/USD registrado no período da atividade.`,`BRL/USD exchange rate recorded for the activity period.`],recordedBrl:[`Custo final BRL registrado no período, preservado para auditoria histórica.`,`Final BRL cost recorded in the period, retained for historical audit.`],cost:[`Custo final atual: USD estimado ou sua conversão BRL pelo câmbio atual selecionado.`,`Current final cost: estimated USD or its BRL conversion at the selected current exchange rate.`]}[t]??[`Métrica numérica desta invocação.`,`Numeric metric for this invocation.`])[e===`pt-BR`?0:1]} ${n}`}function Cp(){return(0,l.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.5`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.5`})]})}function wp({locale:e,pagination:t}){let n=t.total===0?0:t.offset+1,r=t.total===null?t.offset+t.limit:Math.min(t.offset+t.limit,t.total),i=Math.max(0,t.offset-t.limit),a=t.offset+t.limit;return(0,l.jsxs)(`nav`,{"aria-label":e===`pt-BR`?`Paginação das invocações`:`Invocation pagination`,className:`ui-table-pagination`,children:[(0,l.jsx)(`button`,{disabled:t.loading||t.offset===0,onClick:()=>t.onChange(i),type:`button`,children:e===`pt-BR`?`Anterior`:`Previous`}),(0,l.jsx)(`span`,{"aria-live":`polite`,children:t.loading?e===`pt-BR`?`Carregando invocações…`:`Loading invocations…`:t.total===null?`${n}–${r}${t.has_more?`+`:``}`:`${n}–${r} ${e===`pt-BR`?`de`:`of`} ${t.total}`}),(0,l.jsx)(`button`,{disabled:t.loading||!t.has_more&&(t.total===null||a>=t.total),onClick:()=>t.onChange(a),type:`button`,children:e===`pt-BR`?`Próxima`:`Next`}),t.error?(0,l.jsxs)(`span`,{role:`status`,children:[t.error,` `,(0,l.jsx)(`button`,{onClick:t.onRetry,type:`button`,children:e===`pt-BR`?`Tentar novamente`:`Retry`})]}):null]})}var Tp={clip:`rect(0, 0, 0, 0)`,height:1,margin:-1,overflow:`hidden`,position:`absolute`,whiteSpace:`nowrap`,width:1};function Ep(e,t){return e===null?`—`:new Intl.NumberFormat(t,{maximumFractionDigits:0}).format(e)}function Dp(e,t){return e===null||e===0?`0`:T(e,t)}function Op(e,t){return e===null?`—`:k(e,`BRL`,t)}function kp(e,t){return D(e,t)}function Ap(e,t,n,r){if(t>=n)return e;let i=r===`pt-BR`?`Valor parcial: telemetria conhecida em ${t} de ${n} runs.`:`Partial value: telemetry is known for ${t} of ${n} runs.`;return(0,l.jsxs)(`span`,{title:i,children:[(0,l.jsx)(`span`,{"aria-hidden":`true`,children:e}),(0,l.jsx)(`span`,{style:Tp,children:`${i} ${e}`})]})}function jp({locale:e,rows:t}){return(0,l.jsx)(b,{columns:[{key:`developer`,label:e===`pt-BR`?`Desenvolvedor`:`Developer`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.login_snapshot??e.account_id}),(0,l.jsxs)(`small`,{children:[`#`,e.account_id]})]}),sortValue:e=>e.login_snapshot??e.account_id},{key:`prds`,label:`PRDs`,render:t=>Ep(t.prd_count,e),align:`right`},{key:`specs`,label:`SPECs`,render:t=>Ep(t.spec_count,e),align:`right`},{key:`tasks`,label:e===`pt-BR`?`Tarefas`:`Tasks`,render:t=>Ep(t.task_count,e),align:`right`},{key:`runs`,label:`Runs`,render:t=>Ep(t.run_count,e),align:`right`},{key:`tests`,label:e===`pt-BR`?`Testes`:`Tests`,render:t=>Ep(t.test_count,e),align:`right`},{key:`evidences`,label:e===`pt-BR`?`Evidências`:`Evidence`,render:t=>Ep(t.evidence_count,e),align:`right`},{key:`duration`,label:e===`pt-BR`?`Tempo`:`Time`,render:t=>Ap(Dp(t.total_duration_ms,e),t.duration_covered_runs,t.run_count,e),sortValue:e=>e.total_duration_ms,align:`right`},{key:`tokens`,label:`Tokens`,render:t=>Ap(kp(t.total_tokens,e),t.token_covered_runs,t.run_count,e),sortValue:e=>e.total_tokens,align:`right`},{key:`cost`,label:e===`pt-BR`?`Custos`:`Costs`,render:t=>Ap(Op(t.total_cost_brl,e),t.brl_covered_runs,t.run_count,e),sortValue:e=>e.total_cost_brl,align:`right`}],defaultSort:{key:`cost`,direction:`desc`},emptyMessage:e===`pt-BR`?`Nenhum dado disponível.`:`No data available.`,locale:e,pageSize:10,rowKey:e=>e.account_id,rows:t,scrollLabel:e===`pt-BR`?`Métricas por desenvolvedor`:`Developer metrics`,showColumnInfo:!0,sortable:!0})}function Mp(e,t){let n=e.trim().toLowerCase();return n.length===0||n===`unknown`?t===`pt-BR`?`Sem modelo/provedor atribuído`:`No model/provider assigned`:e}function Np(e,t){return e===null?`—`:new Intl.NumberFormat(t,{maximumFractionDigits:0}).format(e)}function Pp(e,t){return Np(e,t)}function Fp(e,t){return e===null?`—`:D(e,t)}function Ip(e,t,n){return e===null?`—`:k(e,t,n)}function Lp(e,t){return e===null?`—`:e===0?`0`:T(e,t)}var Rp=(e,t)=>Np(e,t),zp=(e,t,n)=>Ip(e,t,n),Bp=(e,t)=>Lp(e,t),Vp=(e,t)=>Sf(e,t),Hp=(e,t)=>wf(e,t),Up=(e,t)=>Cf(e,t),Wp=(e,t,n)=>Df(e,t,n);function Gp(e,t){return e.known_sum<=0&&!e.complete||e.known_sum<=0?`0`:T(e.known_sum,t)}function Kp(e){return e.known_sum>0||e.coverage_ratio>0}function qp(e,t){return t?e===`pt-BR`?`Subtotal da página`:`Page subtotal`:`Total`}function Jp(e,t,n){return e===`BRL`?t:n}function Yp(e){return e.prd_id===null?e.spec_id===null?{label:`Tarefa avulsa`,tone:`task`}:{label:`SPEC`,tone:`spec`}:{label:`PRD`,tone:`prd`}}function Xp(e){return e.conversation_count??null}function Zp(e){return{runs:e.reduce((e,t)=>e+t.run_count,0),tasks:yf(e.map(e=>e.task_count)),prds:yf(e.map(e=>e.prd_count)),specs:yf(e.map(e=>e.spec_count)),evidences:yf(e.map(e=>e.evidence_count)),tests:yf(e.map(e=>e.test_count)),conversations:yf(e.map(Xp)),durationKnownMs:e.reduce((e,t)=>e+t.duration.known_sum,0),durationPartial:e.some(e=>!e.duration.complete),tokens:yf(e.map(e=>e.total_tokens)),usd:yf(e.map(e=>e.estimated_usd)),brl:yf(e.map(e=>e.estimated_brl))}}function Qp(e,t,n){let r=t===`pt-BR`?`Zero exibido por falta de medição; não é um valor observado.`:`Zero displayed because no measurement was recorded; this is not an observed value.`,i=e=>(0,l.jsx)(`output`,{"aria-label":`${e}. ${r}`,title:r,children:e});return{description:n===void 0?void 0:r,duration:e=>n!==void 0&&!Kp(e)?`0`:Gp(e,t),currency:r=>Ip(n===void 0?r:r??0,e,t),disclose:(e,t)=>n!==void 0&&t?i(e):e}}function $p({rows:e,currency:t,locale:n,onOpenTrace:r,period:i,showDateTime:a=!0,showAgentIdentity:o=!1,showInvocationTasks:s=!1,showModelLifecycleDetails:c=!1,dateHeading:u,labelHeading:d,totals:f,loading:p=!1}){let m=e=>Pp(o||c?e??0:e,n),h=Qp(t,n,i),g=h.description===void 0?{}:{description:h.description},_=Zp(e),v=f===void 0?_:{runs:f.run_count,tasks:f.task_count,prds:f.prd_count,specs:f.spec_count,evidences:f.evidence_count,tests:f.test_count,conversations:Xp(f)??_.conversations,durationKnownMs:f.duration.known_sum,durationPartial:!f.duration.complete,tokens:f.total_tokens,usd:f.estimated_usd,brl:f.estimated_brl},y=h.duration(f?.duration??{known_sum:v.durationKnownMs,unknown:+!!v.durationPartial,complete:!v.durationPartial,coverage_ratio:+!v.durationPartial}),x=Fp(c?v.tokens??0:v.tokens,n),S=h.currency(t===`BRL`?v.brl:v.usd),C=Pf({locale:n,duration:y,tokens:x,cost:S,currency:t}),w=n===`pt-BR`?`Total geral`:`Grand total`;return(0,l.jsx)(b,{columns:[{key:`latestStartedAt`,label:u??(n===`pt-BR`?`Data e hora`:`Date and time`),render:e=>Mf(e.latest_started_at,n),hidden:!a,footer:a?(0,l.jsx)(`output`,{"aria-label":w,children:`Total`}):void 0},...o?[{key:`persona`,label:`Persona`,render:e=>e.persona??``},{key:`job`,label:n===`pt-BR`?`Cargo`:`Job`,render:e=>e.job??``}]:[],{key:`label`,label:i===void 0?d??(n===`pt-BR`?`Grupo`:`Group`):nm(i,n),render:e=>{if(i!==void 0)return(0,l.jsx)(`strong`,{children:Nf(e.key,i,n)});let t=Mp(e.label,n),r=t!==e.label;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:t}),r||e.key===e.label?null:(0,l.jsx)(`small`,{children:e.key})]})},sortValue:e=>e.key,footer:a?void 0:(0,l.jsx)(`output`,{"aria-label":w,children:`Total`})},...i===void 0&&!o&&!c?[{key:`runs`,label:n===`pt-BR`?`Invocações`:`Agent invocations`,render:e=>e.run_count,align:`right`,footer:v.runs},...o?[]:[{key:`tasks`,label:o||s?n===`pt-BR`?`Tarefas com invocação`:`Tasks with invocations`:n===`pt-BR`?`Tarefas criadas`:`Tasks created`,render:e=>e.task_count??0,align:`right`,footer:v.tasks}]]:[{key:`prds`,label:`PRDs`,render:e=>m(e.prd_count),sortValue:e=>e.prd_count??0,align:`right`,footer:m(v.prds),description:vf(n,o?`PRDs com criação atribuída ao agente por Run registrado. Conta apenas vínculos observados, sem duplicar IDs.`:`PRDs criados por vínculo canônico com um único modelo financeiro observado. Sem essa prova, o indicador exibido é 0.`,`PRDs created through a canonical link to one observed financial model. Without that evidence, the displayed indicator is 0.`)},{key:`specs`,label:`SPECs`,render:e=>m(e.spec_count),sortValue:e=>e.spec_count??0,align:`right`,footer:m(v.specs),description:vf(n,o?`SPECs com criação atribuída ao agente por Run registrado. Conta apenas vínculos observados, sem duplicar IDs.`:`SPECs criadas por vínculo canônico com um único modelo financeiro observado. Sem essa prova, o indicador exibido é 0.`,`SPECs created through a canonical link to one observed financial model. Without that evidence, the displayed indicator is 0.`)},{key:`tasks`,label:o?n===`pt-BR`?`Tarefas`:`Tasks`:c?`Tasks`:n===`pt-BR`?`Tarefas criadas`:`Tasks created`,render:e=>m(e.task_count),sortValue:e=>e.task_count??0,align:`right`,footer:m(v.tasks),description:vf(n,o?`Tasks distintas em que o agente participou no período. Uma Task pode contar em vários agentes; o total soma essas participações entre agentes. Sem participação, mostra 0.`:`Tasks contam apenas quando creation_run_id tem um único modelo financeiro observável. Participação posterior não é criação; ausência ou multi-modelo exibe 0.`,`Tasks count only when creation_run_id has one observed financial model. Later participation is not creation; missing or multi-model linkage displays 0.`)},...c?[{key:`conversations`,label:`Conversations`,render:e=>m(Xp(e)),sortValue:e=>Xp(e)??0,align:`right`,footer:m(v.conversations),description:vf(n,`Conversas canônicas, incluindo turns unassisted legados. Cada ID conta uma vez por modelo; um modelo múltiplo pode repetir. Run com Task e conversa de origem não cria Task adicional.`,`Canonical conversations, including legacy unassisted turns. Each ID counts once per model; a multi-model conversation may repeat. A Run with a Task and source conversation does not create an additional Task.`)}]:[],{key:`runs`,label:`Runs`,render:e=>e.run_count,sortValue:e=>e.run_count,align:`right`,footer:v.runs,description:vf(n,o?`Chamadas observadas atribuídas ao agente no período selecionado.`:`Runs financeiros observados neste modelo, sem distribuir ou duplicar custo, tokens e tempo entre modelos.`,`Observed financial Runs for this model, without allocating or duplicating cost, tokens, or time across models.`)},{key:`tests`,label:n===`pt-BR`?`Testes`:`Tests`,render:e=>m(e.test_count),sortValue:e=>e.test_count??0,align:`right`,footer:m(v.tests),description:vf(n,o?`Registros de testes distintos vinculados ao Run do agente no período. Revisões e outras validações não são contadas como testes.`:`Validações canônicas cuja artifact_run_id coincide com a Run registradora deste modelo; ausência de prova exibe 0.`,`Canonical validations whose artifact_run_id matches this model's registering Run; missing evidence displays 0.`)},{key:`evidences`,label:n===`pt-BR`?`Evidências`:`Evidence`,render:e=>m(e.evidence_count),sortValue:e=>e.evidence_count??0,align:`right`,footer:m(v.evidences),description:vf(n,o?`Evidências distintas vinculadas ao Run do agente no período. Conta apenas vínculos registrados.`:`Evidências canônicas cuja artifact_run_id coincide com a Run registradora deste modelo; o total não duplica a mesma evidência. Sem prova, exibe 0.`,`Canonical evidence whose artifact_run_id matches this model's registering Run; the total does not duplicate the same evidence. Missing proof displays 0.`)}],{key:`duration`,label:`Tempo`,render:e=>i!==void 0&&!Kp(e.duration)?h.disclose(`0`,!0):h.duration(e.duration),sortValue:e=>Kp(e.duration)?e.duration.known_sum:c?0:null,align:`right`,footer:(0,l.jsx)(`output`,{"aria-label":C,children:y}),...g},{key:`tokens`,label:`Tokens`,render:e=>{let t=Fp(c?e.total_tokens??0:e.total_tokens,n);return h.disclose(t,e.total_tokens===null)},sortValue:e=>c?e.total_tokens??0:e.total_tokens,align:`right`,footer:(0,l.jsx)(`output`,{"aria-label":C,children:x}),...g},{key:`cost`,label:o||c||i!==void 0?n===`pt-BR`?`Custos`:`Costs`:i===void 0?n===`pt-BR`?`Custo`:`Cost`:n===`pt-BR`?`Custos`:`Costs`,render:e=>{let n=t===`BRL`?e.estimated_brl:e.estimated_usd;return h.disclose(h.currency(n),n===null)},sortValue:e=>c?Jp(t,e.estimated_brl,e.estimated_usd)??0:Jp(t,e.estimated_brl,e.estimated_usd),align:`right`,footer:(0,l.jsx)(`output`,{"aria-label":C,children:S}),...g},...r?[{key:`trace`,label:``,render:e=>(0,l.jsx)(`button`,{"aria-label":`Abrir detalhes`,className:`cost-row-action`,onClick:t=>{t.stopPropagation(),r(e.key)},type:`button`,children:(0,l.jsx)(Cp,{})})}]:[]],defaultSort:o?{key:`cost`,direction:`desc`}:i===void 0?null:{key:`label`,direction:`desc`},locale:n,emptyMessage:p?n===`pt-BR`?`Carregando…`:`Loading…`:n===`pt-BR`?`Nenhum dado disponível.`:`No data available.`,pageSize:100,rowKey:e=>e.key,onRowClick:r===void 0?void 0:e=>r(e.key),rows:e,scrollLabel:jf(n),showColumnInfo:!0,sortable:!0})}function em({rows:e,onOpenRun:t,currency:n,locale:r,compact:i=!1,pagination:a}){let o=qp(r,a!==void 0),s=t=>yf(e.map(e=>e[t])),c=yf(e.map(tm)),u=bf(e),d=(0,l.jsx)(b,{columns:[{key:`startedAt`,label:r===`pt-BR`?`Data e hora`:`Date and time`,render:e=>Mf(e.started_at,r),footer:o},{key:`run`,label:r===`pt-BR`?`Invocação`:`Agent invocation`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.run_id}),(0,l.jsx)(`small`,{children:e.task_title})]})},{key:`origin`,label:r===`pt-BR`?`Origem`:`Origin`,render:e=>{let t=Yp(e);return(0,l.jsx)(`span`,{className:`cost-run-origin cost-run-origin-${t.tone}`,children:t.label})}},{key:`duration`,label:r===`pt-BR`?`Tempo`:`Time`,description:$(r,`duration`),render:e=>Bp(e.duration_ms,r),sortValue:e=>e.duration_ms,align:`right`,footer:Bp(u,r)},{key:`agent`,label:r===`pt-BR`?`Agente`:`Agent`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.agent_name}),(0,l.jsx)(`small`,{children:`${e.run_kind===`run`?r===`pt-BR`?`Invocação do orquestrador`:`Orchestrator invocation`:r===`pt-BR`?`Invocação delegada`:`Delegated invocation`} · ${e.run_purpose}`})]})},{key:`model`,label:`Modelo`,render:e=>{let t=_f(e);return t.detail===`-`?(0,l.jsx)(`strong`,{children:t.primary}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:t.primary}),(0,l.jsx)(`small`,{children:t.detail})]})}},{key:`effort`,label:r===`pt-BR`?`Esforço`:`Effort`,render:e=>Of(e.effective_reasoning_effort,e.reasoning_effort,r)},{key:`speed`,label:r===`pt-BR`?`Velocidade`:`Speed`,render:e=>kf(e.service_tier,r)},{key:`inputTokens`,label:r===`pt-BR`?`Input total`:`Total input`,description:$(r,`inputTokens`),render:e=>Rp(e.input_tokens,r),sortValue:e=>e.input_tokens,align:`right`,footer:Rp(s(`input_tokens`),r)},{key:`cachedInputTokens`,label:r===`pt-BR`?`Tokens cache`:`Cached tokens`,description:$(r,`cachedInputTokens`),render:e=>Rp(e.cached_input_tokens,r),sortValue:e=>e.cached_input_tokens,align:`right`,footer:Rp(s(`cached_input_tokens`),r)},{key:`outputTokens`,label:r===`pt-BR`?`Output total`:`Total output`,description:$(r,`outputTokens`),render:e=>Rp(e.output_tokens,r),sortValue:e=>e.output_tokens,align:`right`,footer:Rp(s(`output_tokens`),r)},{key:`reasoningTokens`,label:r===`pt-BR`?`Tokens raciocínio`:`Reasoning tokens`,description:$(r,`reasoningTokens`),render:e=>Rp(e.reasoning_tokens,r),sortValue:e=>e.reasoning_tokens,align:`right`,footer:Rp(s(`reasoning_tokens`),r)},{key:`totalTokens`,label:`Total tokens`,description:$(r,`totalTokens`),render:e=>Rp(tm(e),r),sortValue:e=>tm(e),align:`right`,footer:Rp(c,r)},{key:`inputRate`,label:`USD/M entrada`,description:$(r,`inputRate`),render:e=>Vp(e.input_rate_usd_per_million,r),align:`right`},{key:`cacheRate`,label:`USD/M cache`,description:$(r,`cacheRate`),render:e=>Vp(e.cached_input_rate_usd_per_million,r),align:`right`},{key:`outputRate`,label:`USD/M saída`,description:$(r,`outputRate`),render:e=>Vp(e.output_rate_usd_per_million,r),align:`right`},{key:`reasoningRate`,label:`USD/M raciocínio`,description:$(r,`reasoningRate`),render:e=>Vp(e.reasoning_rate_usd_per_million,r),align:`right`},{key:`contextMultiplier`,label:`Mult. contexto E/S`,description:$(r,`contextMultiplier`),render:e=>Wp(e.context_input_multiplier,e.context_output_multiplier,r),align:`right`},{key:`speedMultiplier`,label:r===`pt-BR`?`Cenário velocidade API`:`API speed scenario`,description:vf(r,`Cenário de preço efetivo observado nesta Invocação de Agente. Priority/Fast pode elevar as tarifas em relação ao cenário Standard.`,`Effective pricing scenario observed in this Agent Invocation. Priority/Fast may increase rates compared with the Standard scenario.`),render:e=>gf(e.service_tier,r),align:`right`,hidden:!(t=>!i||xf(e,t))(e=>e.service_tier)},{key:`inputCost`,label:`USD entrada`,description:$(r,`inputCost`),render:e=>Hp(e.input_cost_usd,r),align:`right`,footer:Hp(s(`input_cost_usd`),r)},{key:`cacheCost`,label:`USD cache`,description:$(r,`cacheCost`),render:e=>Hp(e.cached_input_cost_usd,r),align:`right`,footer:Hp(s(`cached_input_cost_usd`),r)},{key:`outputCost`,label:`USD saída`,description:$(r,`outputCost`),render:e=>Hp(e.output_cost_usd,r),align:`right`,footer:Hp(s(`output_cost_usd`),r)},{key:`reasoningCost`,label:`USD raciocínio`,description:$(r,`reasoningCost`),render:e=>Hp(e.reasoning_cost_usd,r),align:`right`,footer:Hp(s(`reasoning_cost_usd`),r)},{key:`standardCost`,label:`USD padrão`,description:$(r,`standardCost`),render:e=>Hp(e.standard_cost_usd,r),align:`right`,footer:Hp(s(`standard_cost_usd`),r)},{key:`speedUplift`,label:`USD acréscimo rápido`,description:$(r,`speedUplift`),render:e=>Hp(e.speed_uplift_usd,r),align:`right`,footer:Hp(s(`speed_uplift_usd`),r)},{key:`finalUsd`,label:r===`pt-BR`?`USD estimado API`:`Estimated API USD`,description:$(r,`finalUsd`),render:e=>Hp(e.estimated_usd,r),align:`right`,footer:Hp(s(`estimated_usd`),r)},{key:`fxRate`,label:r===`pt-BR`?`Cotação atual`:`Current exchange rate`,description:$(r,`fxRate`),render:e=>Up(e.fx_rate,r),align:`right`},{key:`recordedFxRate`,label:r===`pt-BR`?`Cotação no período`:`Period exchange rate`,description:$(r,`recordedFxRate`),render:e=>Up(e.recorded_fx_rate,r),align:`right`},{key:`recordedBrl`,label:r===`pt-BR`?`Custo Final no Período`:`Period final cost`,description:$(r,`recordedBrl`),render:e=>zp(e.recorded_brl,`BRL`,r),align:`right`,footer:zp(s(`recorded_brl`),`BRL`,r)},{key:`cost`,label:r===`pt-BR`?`Custo Final atual`:`Current final cost`,description:$(r,`cost`),render:e=>zp(n===`BRL`?e.estimated_brl:e.estimated_usd,n,r),sortValue:e=>Jp(n,e.estimated_brl,e.estimated_usd),align:`right`,footer:zp(s(n===`BRL`?`estimated_brl`:`estimated_usd`),n,r)},{key:`trace`,label:``,render:e=>(0,l.jsx)(`button`,{"aria-label":`Abrir detalhes da invocação`,className:`cost-row-action`,onClick:n=>{n.stopPropagation(),t(e.run_id)},type:`button`,children:(0,l.jsx)(Cp,{})})}],locale:r,pageSize:a?null:100,rowKey:e=>e.run_id,onRowClick:e=>t(e.run_id),rows:e,scrollLabel:Af(r),showColumnInfo:!0,sortable:!0});return a?(0,l.jsxs)(l.Fragment,{children:[d,(0,l.jsx)(wp,{locale:r,pagination:a})]}):d}function tm(e){return e.input_tokens!==null&&e.output_tokens!==null?e.input_tokens+e.output_tokens:e.total_tokens}function nm(e,t){return t===`en-US`?e===`daily`?`Day`:e===`monthly`?`Month`:`Year`:e===`daily`?`Dia`:e===`monthly`?`Mês`:`Ano`}function rm({rows:e,currency:t,details:n,locale:r,totalDurationMs:i,onOpenTrace:a}){let[s,c]=(0,o.useState)(null),u=e=>c(e),d=e.reduce((e,t)=>e+t.task_count,0),f=e.reduce((e,t)=>e+t.run_count,0),p=om(e.map(e=>e.duration_ms??im(e,n?.runs??[]))),m=e.reduce((e,t)=>e+(t.usage.total.tokens.total??0),0),h=e.reduce((e,n)=>e+(t===`BRL`?n.usage.total.cost.brl??0:n.usage.total.cost.usd??0),0);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b,{columns:[{key:`createdAt`,label:r===`pt-BR`?`Data e hora`:`Date and time`,render:e=>e.created_at?Mf(e.created_at,r):`—`,footer:`Total`},{key:`entity`,label:`Entidade`,render:e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`strong`,{children:e.title}),(0,l.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>e.work_status},{key:`tasks`,label:`Tasks`,render:e=>e.task_count,align:`right`,footer:d},{key:`runs`,label:`Runs`,render:e=>e.run_count,align:`right`,footer:f},{key:`duration`,label:r===`pt-BR`?`Tempo`:`Time`,render:e=>{let t=e.duration_ms??im(e,n?.runs??[]);return t===null||t===0?`0`:T(t,r)},align:`right`,footer:i==null?p===null||p===0?`0`:T(p,r):T(i,r)},{key:`tokens`,label:`Tokens`,render:e=>D(e.usage.total.tokens.total,r),align:`right`,footer:D(m,r)},{key:`cost`,label:`Custo`,render:e=>k(t===`BRL`?e.usage.total.cost.brl:e.usage.total.cost.usd,t,r),sortValue:e=>Jp(t,e.usage.total.cost.brl,e.usage.total.cost.usd),align:`right`,footer:k(h,t,r)},{key:`rework`,label:`Retrabalho`,render:e=>j(e.quality.rework_rate),align:`right`},{key:`actions`,label:``,render:e=>(0,l.jsx)(`button`,{"aria-label":`${r===`pt-BR`?`Abrir detalhes do`:`Open details for`} ${e.kind.toUpperCase()}`,className:`cost-row-action`,onClick:t=>{t.stopPropagation(),u(e)},type:`button`,children:(0,l.jsx)(sm,{})})}],locale:r,pageSize:100,rowKey:e=>e.id,onRowClick:u,rows:e,showColumnInfo:!0,sortable:!0}),s?(0,l.jsx)(Xc,{label:s.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>c(null),onOpenTrace:e=>{c(null),a(e)},row:s,runs:n?.runs??[],specs:n?.specs??e.filter(e=>e.kind===`spec`),tasks:n?.tasks??[]}):null]})}function im(e,t=[]){if(t.length===0)return null;let n=new Set(e.run_ids),r=new Map;for(let e of t)r.has(e.id)||r.set(e.id,e);let i=[...r.values()],a=t=>n.has(t.id)||(e.kind===`prd`?t.prd_id===e.id:t.spec_id===e.id),o=i.filter(e=>e.phase===`execution`&&(e.parent_run_id===null||!r.has(e.parent_run_id))&&a(e)),s=o.map(am);return o.length===0||s.some(e=>e===null)?null:om(s)}function am(e){return typeof e.source_duration_ms==`number`?e.source_duration_ms:(e.duration_provenance===`observed`||e.duration_provenance===`legacy_inferred`||e.duration_provenance===`reconciled`)&&typeof e.duration_ms==`number`?e.duration_ms:null}function om(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)}function sm(){return(0,l.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.5`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.5`})]})}function cm(e,t){return e.query||t}function lm(e,t){return e===t}function um(e,t){return e!==null&&e.slice(0,e.lastIndexOf(`\0`))===t.slice(0,t.lastIndexOf(`\0`))}function dm({locale:e,page:t}){return t.total_count===0?e===`pt-BR`?`Nenhum resultado`:`No results`:`${t.offset+1}–${Math.min(t.offset+t.limit,t.total_count)} ${e===`pt-BR`?`de`:`of`} ${t.total_count}`}function fm({active:e=!0,view:t,range:n,globalQuery:r,limit:i=50,filters:a,revision:s,load:c}){let[l,u]=(0,o.useState)(0),[d,f]=(0,o.useState)(null),[p,m]=(0,o.useState)(null),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(null),[y,b]=(0,o.useState)(0),x=(0,o.useRef)(0),S=(0,o.useRef)(c);S.current=c;let C=cm(a,r),w=`${Object.values(a).join(`\0`)}\u0000${C}`,T=`${t}\u0000${i}\u0000${n?.from??``}\u0000${n?.to??``}\u0000${w}`,E=`${T}\u0000${l}\u0000${s}`,D=(0,o.useRef)({filters:a,limit:i,query:C,range:n,view:t});return D.current={filters:a,limit:i,query:C,range:n,view:t},(0,o.useEffect)(()=>{u(0)},[T]),(0,o.useEffect)(()=>{let t=++x.current;if(!e||!S.current){f(null),m(null),v(null),g(!1);return}let n=new AbortController,r=D.current;return g(!0),v(null),S.current({view:r.view,offset:l,limit:r.limit,...r.query?{query:r.query}:{},filters:r.filters,...r.range??{},signal:n.signal}).then(e=>{!n.signal.aborted&&t===x.current&&(f(e),m(E))}).catch(e=>{!n.signal.aborted&&t===x.current&&v(e instanceof Error?e.message:String(e))}).finally(()=>{!n.signal.aborted&&t===x.current&&g(!1)}),()=>n.abort()},[e,y,l,E]),{error:_,page:lm(p,E)?d:null,stalePage:um(p,E)?d:null,loading:h,offset:l,retry:()=>b(e=>e+1),setOffset:u}}function pm({canonicalDurationTotal:e,compactPage:t,compactPageError:n,compactPageLoading:r,compactPageOffset:i,currency:a,detailError:o,detailLoading:s,developerPanel:c,dimensionalDetailPending:u,dimensionalRows:d,groups:f,groupPage:p,groupPageLoading:m,groupPageOffset:h,locale:g,macroDetails:_,onOpenRun:v,onOpenTrace:y,pagedRunRows:b,retryCompactPage:x,retryRunPage:S,rows:C,runPageData:w,runPageError:T,runPageLoading:E,runPageOffset:D,serverPagingEligible:O,setCompactPageOffset:k,setGroupPageOffset:A,setDetailAttempt:j,setRunPageOffset:ee,summaryUsage:M,summaryTotals:te,useAggregateGroups:ne,usingCompactPage:re,view:N,visibleExecutions:ie,visiblePrds:ae,visibleSpecs:oe}){let P=[`daily`,`monthly`,`annual`,`agents`,`models`,`providers`].includes(N)&&p!==null?(0,l.jsxs)(`nav`,{"aria-label":g===`pt-BR`?`Paginação de grupos`:`Group pagination`,className:`cost-page-controls`,children:[(0,l.jsx)(`button`,{disabled:m||h===0,onClick:()=>A(Math.max(0,h-p.limit)),type:`button`,children:g===`pt-BR`?`Anterior`:`Previous`}),(0,l.jsx)(`output`,{"aria-live":`polite`,children:dm({locale:g,page:p})}),(0,l.jsx)(`button`,{disabled:m||!p.has_more,onClick:()=>A(h+p.limit),type:`button`,children:g===`pt-BR`?`Próxima`:`Next`})]}):null;return(0,l.jsxs)(`section`,{"aria-busy":m||r||E||void 0,className:`cost-content cost-content-${N} ${N===`overview`?`cost-content-overview`:``}`,children:[s||u?(0,l.jsx)(`p`,{role:`status`,children:g===`pt-BR`?`Carregando dados…`:`Loading data…`}):null,o?(0,l.jsxs)(`p`,{role:`status`,children:[o,` `,(0,l.jsx)(`button`,{onClick:()=>j(e=>e+1),type:`button`,children:g===`pt-BR`?`Tentar novamente`:`Retry`})]}):null,N===`overview`&&!u&&!s&&o===null?(0,l.jsx)(Qf,{currency:a,daily:f.daily,locale:g,models:f.models,rows:d,...ne?{summaryUsage:M}:{}}):null,N===`developers`?c:null,N===`agentCalls`?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(em,{currency:a,locale:g,onOpenRun:v,rows:O&&w!==null?b:C,...O&&(w?.run_page!==void 0||E||T!==null)?{pagination:{...w?.run_page??{offset:D,limit:10,total:null,has_more:!1},error:T,loading:E,onChange:ee,onRetry:S}}:{}})}):null,re?(0,l.jsx)(Ff,{locale:g,...N===`tasks`?{onOpenTrace:y}:{},pagination:{offset:t?.offset??i,limit:t?.limit??50,total:t?.total??null,has_more:t?.has_more??!1,loading:r,error:n,onChange:k,onRetry:x},rows:t?.rows??[],subtotal:t?.subtotal??null}):null,N===`executions`&&!re?(0,l.jsx)(xe,{locale:g,rows:ie}):null,N===`conversations`&&!re?(0,l.jsx)($p,{currency:a,labelHeading:g===`pt-BR`?`Conversa`:`Conversation`,locale:g,rows:f.conversations}):null,N===`tasks`&&!re?(0,l.jsx)($p,{currency:a,dateHeading:g===`pt-BR`?`Criada em`:`Created at`,labelHeading:g===`pt-BR`?`Tarefa`:`Task`,locale:g,onOpenTrace:y,rows:f.tasks}):null,N===`prds`&&!re?(0,l.jsx)(rm,{currency:a,locale:g,onOpenTrace:y,rows:ae,totalDurationMs:e,..._?{details:_}:{}}):null,N===`specs`&&!re?(0,l.jsx)(rm,{currency:a,locale:g,onOpenTrace:y,rows:oe,totalDurationMs:e,..._?{details:_}:{}}):null,[`providers`,`agents`,`models`].map(e=>N===e&&!u&&!s&&o===null?(0,l.jsxs)(`div`,{children:[(0,l.jsx)($p,{currency:a,labelHeading:e===`models`?g===`pt-BR`?`Modelo LLM`:`LLM model`:e===`agents`?g===`pt-BR`?`Zaip Agentes`:`ZAIP agents`:g===`pt-BR`?`Provedor`:`Providers`,locale:g,loading:m,rows:f[e],...p?.totals===void 0?{}:{totals:p.totals},...e===`agents`?{showDateTime:!1,showAgentIdentity:!0}:e===`models`?{showDateTime:!1,showModelLifecycleDetails:!0}:e===`providers`?{showDateTime:!1,showInvocationTasks:!0}:{}},e),P]},e):null),N===`daily`||N===`monthly`||N===`annual`?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(bp,{currency:a,locale:g,loading:m,...p===null?{}:{average:p.period_averages?.[a]??null},period:N,rows:f[N]}),(0,l.jsx)($p,{currency:a,locale:g,loading:m,period:N,rows:f[N],showDateTime:!1,totals:p?.totals??te}),P]}):null]})}function mm({groupError:e,locale:t,periodError:n,retryGroup:r}){return(0,l.jsxs)(l.Fragment,{children:[n?(0,l.jsx)(`p`,{className:`cost-period-error`,role:`status`,children:t===`pt-BR`?`Não foi possível carregar o período selecionado: ${n}`:`Could not load the selected period: ${n}`}):null,e?(0,l.jsxs)(`p`,{className:`cost-period-error`,role:`status`,children:[t===`pt-BR`?`Não foi possível carregar esta aba: ${e}`:`Could not load this tab: ${e}`,(0,l.jsx)(`button`,{onClick:r,type:`button`,children:t===`pt-BR`?`Tentar novamente`:`Try again`})]}):null]})}function hm({locale:e}){return e===`pt-BR`?(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`cost-locale-flag`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,l.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,l.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`cost-locale-flag`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,l.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,l.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`}),(0,l.jsx)(`path`,{d:`m2.3 2.1.5 1 .9.1-.7.7.2 1-.9-.5-.9.5.2-1-.7-.7.9-.1.5-1Zm4 0 .5 1 .9.1-.7.7.2 1-.9-.5-.9.5.2-1-.7-.7.9-.1.5-1Z`,fill:`#fff`})]})}function gm(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`cost-locale-chevron`,fill:`none`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`m6 9 6 6 6-6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`})})}function _m(){return(0,l.jsx)(`svg`,{"aria-hidden":`true`,className:`cost-filter-icon`,fill:`none`,viewBox:`0 0 24 24`,children:(0,l.jsx)(`path`,{d:`M3 6h18M7 12h10m-7 6h4`})})}function vm(){return(0,l.jsxs)(`svg`,{"aria-hidden":`true`,className:`cost-settings-icon`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,l.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.09a2 2 0 0 1 1 1.74v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z`}),(0,l.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}var ym=new URL(`/assets/logo_novo_azul-BBx5pA2B.png`,``+import.meta.url).href;function bm(e,t){return e===t?null:t}function xm({currency:e,filters:t,loading:n,locale:r,onCurrencyChange:i,onFiltersChange:a,onLocaleChange:o,onPopupChange:s,onPeriodChange:c,onRefresh:u,period:d,popup:f,text:p,updatedLabel:m,filtersAvailable:h}){let g=f===`filters`,_=f===`locale`,v=f===`settings`,y=e=>{o(e)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`nav`,{"aria-label":`Navegação do Cost Monitor`,className:`cost-monitor-nav`,children:[(0,l.jsxs)(`div`,{className:`cost-monitor-brand`,children:[(0,l.jsx)(`strong`,{className:`cost-monitor-title`,children:p.title}),(0,l.jsx)(`small`,{className:`cost-last-updated`,children:m})]}),(0,l.jsx)(`img`,{alt:`ZAIP`,className:`cost-monitor-logo`,src:ym}),(0,l.jsxs)(`div`,{className:`cost-nav-actions`,children:[(0,l.jsx)(`button`,{"aria-label":p.refresh,className:`cost-nav-icon cost-refresh-action`,disabled:n,onClick:u,type:`button`,children:`↻`}),(0,l.jsxs)(`div`,{className:`cost-nav-popup-anchor cost-filter-action`,children:[(0,l.jsxs)(`button`,{className:g?`cost-nav-button is-active`:`cost-nav-button`,onClick:()=>s(bm(f,`filters`)),type:`button`,children:[(0,l.jsx)(_m,{}),` `,p.filters]}),g?(0,l.jsx)(`div`,{className:`cost-nav-popup cost-nav-filter-popup`,children:(0,l.jsx)(Yf,{available:h,hideQuery:!1,locale:r,onChange:a,value:t})}):null]}),(0,l.jsxs)(`div`,{className:`cost-nav-popup-anchor cost-locale-action`,children:[(0,l.jsxs)(`button`,{className:_?`cost-nav-button is-active`:`cost-nav-button`,onClick:()=>s(bm(f,`locale`)),type:`button`,children:[(0,l.jsx)(hm,{locale:r}),r===`pt-BR`?`PT-BR`:`EN-US`,(0,l.jsx)(gm,{})]}),_?(0,l.jsxs)(`div`,{className:`cost-nav-popup cost-nav-locale-popup`,children:[(0,l.jsxs)(`button`,{onClick:()=>y(`pt-BR`),type:`button`,children:[(0,l.jsx)(hm,{locale:`pt-BR`}),` Português do Brasil `,r===`pt-BR`?`✓`:``]}),(0,l.jsxs)(`button`,{onClick:()=>y(`en-US`),type:`button`,children:[(0,l.jsx)(hm,{locale:`en-US`}),` English `,r===`en-US`?`✓`:``]})]}):null]}),(0,l.jsxs)(`div`,{className:`cost-nav-popup-anchor cost-settings-action`,children:[(0,l.jsx)(`button`,{"aria-label":p.settings,className:v?`cost-nav-icon is-active`:`cost-nav-icon`,onClick:()=>s(bm(f,`settings`)),type:`button`,children:(0,l.jsx)(vm,{})}),v?(0,l.jsxs)(`div`,{className:`cost-nav-popup cost-nav-settings-popup`,children:[(0,l.jsxs)(`div`,{className:`cost-mobile-settings`,children:[(0,l.jsx)(`small`,{className:`cost-mobile-updated`,children:m}),(0,l.jsxs)(`button`,{disabled:n,onClick:u,type:`button`,children:[`↻`,` `,n?r===`pt-BR`?`Atualizando…`:`Refreshing…`:p.refresh]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:r===`pt-BR`?`Idioma`:`Language`}),(0,l.jsxs)(`select`,{onChange:e=>y(e.target.value),value:r,children:[(0,l.jsx)(`option`,{value:`pt-BR`,children:`Português do Brasil`}),(0,l.jsx)(`option`,{value:`en-US`,children:`English`})]})]}),(0,l.jsxs)(`div`,{className:`cost-mobile-filters`,children:[(0,l.jsx)(`strong`,{children:p.filters}),(0,l.jsx)(Yf,{available:h,hideQuery:!1,locale:r,onChange:a,value:t})]})]}),(0,l.jsxs)(`label`,{children:[(0,l.jsx)(`span`,{children:p.currency}),(0,l.jsxs)(`select`,{onChange:e=>i(e.target.value),value:e,children:[(0,l.jsx)(`option`,{value:`BRL`,children:`BRL · R$`}),(0,l.jsx)(`option`,{value:`USD`,children:`USD · $`})]})]})]}):null]})]})]}),(0,l.jsxs)(`header`,{className:`cost-hero`,children:[(0,l.jsx)(`p`,{className:`cost-hero-description`,children:p.subtitle}),(0,l.jsxs)(`label`,{className:`cost-period`,children:[(0,l.jsx)(`span`,{children:p.period}),(0,l.jsxs)(`select`,{onChange:e=>c(e.target.value),value:d,children:[(0,l.jsx)(`option`,{value:`all`,children:p.allTime}),(0,l.jsx)(`option`,{value:`7`,children:p.last7}),(0,l.jsx)(`option`,{value:`30`,children:p.last30}),(0,l.jsx)(`option`,{value:`90`,children:p.last90}),(0,l.jsx)(`option`,{value:`month`,children:p.thisMonth})]})]})]})]})}function Sm({overview:e,currency:t,locale:n}){let r=n===`pt-BR`,i=t===`BRL`?e.estimated_brl:e.estimated_usd;return(0,l.jsx)(`section`,{"aria-label":`Resumo de custos`,className:`cost-summary`,children:[[r?`Custo estimado`:`Estimated cost`,k(i,t,n),r?`Período atual`:`Current period`],[`Tokens`,D(e.total_tokens,n),r?`${D(e.known_tokens_per_cycle,n)} tokens/ciclo`:`${D(e.known_tokens_per_cycle,n)} tokens/cycle`],[r?`BRL registrado`:`Recorded BRL`,k(e.recorded_brl,`BRL`,n),r?`Histórico fixado no registro`:`Historical value fixed when recorded`],[r?`Tarefas criadas`:`Tasks created`,String(e.task_count),r?`${e.task_count} no período`:`${e.task_count} in period`],[r?`Invocações de Agentes`:`Agent Invocations`,String(e.run_count),r?`${e.event_count} segmentos de uso`:`${e.event_count} usage segments`]].map(([e,t,n])=>(0,l.jsxs)(`article`,{children:[(0,l.jsx)(`span`,{children:e}),(0,l.jsx)(`strong`,{children:t}),(0,l.jsx)(`small`,{children:n})]},e))})}function Cm(e,t){let n=t.query.trim().toLowerCase();return(!n||[e.run_id,e.task_title,e.model,e.requested_model,e.agent,e.agent_name].some(e=>e.toLowerCase().includes(n)))&&(!t.provider||af(e.provider)===t.provider)&&(!t.agent||e.agent_name===t.agent)&&(!t.model||e.model===t.model)&&(!t.status||e.task_status===t.status)&&(!t.priority||e.priority===t.priority)&&(!t.risk||e.risk===t.risk)&&(!t.phase||e.phase===t.phase)&&(!t.origin||e.origin===t.origin)&&(!t.workType||e.work_type===t.workType)}function wm(e,t){if(!t)return!0;let n=t.query.trim().toLocaleLowerCase(),r=!n||[e.run_id,e.task_id,e.task_title,e.provider,e.agent,e.agent_name,e.model,e.requested_model,e.phase].some(e=>e?.toLocaleLowerCase().includes(n));if(t.dateRange===void 0)return r;let i=sl(e.started_at,`day`)??e.started_at.slice(0,10);return i>=t.dateRange.start&&i<=t.dateRange.end&&r}function Tm(e,t,n=t,r=`all_invocations`){let i=hf(e,r),a=new Map;for(let n of e)a.set(t(n),[...a.get(t(n))??[],n]);return[...a].map(([e,t])=>{let a=lf(i.filter(e=>t.includes(e)),r===`all_execution`?`all_execution`:`all_invocations`),o=new Set(t.flatMap(e=>e.task_id?[e.task_id]:[])).size;return{duration_ms:a.complete?a.known_sum:null,duration:a,key:e,label:n(t[0]),latest_started_at:t.reduce((e,t)=>t.started_at>e?t.started_at:e,t[0]?.started_at??``),run_count:t.length,task_count:o,tasksActive:o,taskDaysActive:o,prd_count:0,spec_count:0,evidence_count:0,test_count:0,event_count:t.reduce((e,t)=>e+(t.event_count??0),0),total_tokens:sf(t.map(e=>e.total_tokens)),estimated_usd:sf(t.map(e=>e.estimated_usd)),estimated_brl:sf(t.map(e=>e.estimated_brl)),coverage:t.reduce((e,t)=>({events:e.events+t.coverage.events,tokens:e.tokens+t.coverage.tokens,usd:e.usd+t.coverage.usd,brl:e.brl+t.coverage.brl}),{events:0,tokens:0,usd:0,brl:0})}}).sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function Em(e,t){if(t===void 0)return!0;let n=t.query.trim().toLowerCase();if(n&&![e.id??``,e.title??``].some(e=>e.toLowerCase().includes(n)))return!1;if(t.dateRange===void 0)return!0;if(e.created_at===null)return!1;let r=sl(e.created_at,`day`)??e.created_at.slice(0,10);return r>=t.dateRange.start&&r<=t.dateRange.end}async function Dm({from:e,to:t,signal:n,fetcher:r=fetch}){let i=new URLSearchParams;e&&i.set(`from`,e),t&&i.set(`to`,t);let a=await r(`/api/v2/developers${i.size===0?``:`?${i}`}`,{...n===void 0?{}:{signal:n}});if(!a.ok)throw Error(`HTTP ${a.status}`);return(await a.json()).rows??[]}function Om({from:e,to:t,locale:n}){let[r,i]=(0,o.useState)({loading:!0,error:null,rows:[]});return(0,o.useEffect)(()=>{let n=new AbortController;return i(e=>({...e,loading:!0,error:null})),Dm({...e===void 0?{}:{from:e},...t===void 0?{}:{to:t},signal:n.signal}).then(e=>i({loading:!1,error:null,rows:e})).catch(e=>{e.name!==`AbortError`&&i({loading:!1,error:e instanceof Error?e.message:`unknown`,rows:[]})}),()=>n.abort()},[e,t]),r.loading?(0,l.jsx)(`p`,{className:`operations-empty`,role:`status`,children:n===`pt-BR`?`Carregando desenvolvedores…`:`Loading developers…`}):r.error?(0,l.jsxs)(`p`,{className:`operations-empty`,role:`alert`,children:[n===`pt-BR`?`Não foi possível carregar desenvolvedores.`:`Could not load developers.`,` `,r.error]}):(0,l.jsx)(jp,{locale:n,rows:r.rows})}function km({locale:e,range:t,view:n}){return n===`developers`?(0,l.jsx)(Om,{locale:e,...t===void 0?{}:t}):null}function Am({locale:e,selectedRun:t,onClose:n}){return t?(0,l.jsx)(oe,{details:{kind:`run`,row:t},locale:e,onClose:n}):null}var jm={"pt-BR":{back:`Voltar - Dashboard`,title:`ZAIP Cost Monitor`,subtitle:`Visão Git-native de Custos, Tokens e Tempo de cada Tarefa, SPEC ou PRD.`,refresh:`Atualizar`,refreshing:`Atualizando…`,filters:`Filtros`,settings:`Configurações`,language:`Idioma`,currency:`Moeda`,kicker:`ZAIP-AIOS • COST MONITOR`,heading:`Custos e tokens`,intro:`Telemetria derivada localmente, atribuída por invocação de agente, tarefa, fase e origem.`,period:`Período`,allTime:`Todo o período`,last7:`Últimos 7 dias`,last30:`Últimos 30 dias`,last90:`Últimos 90 dias`,thisMonth:`Este mês`,noData:`Sem dados no filtro atual.`,tabs:{overview:`Visão geral`,models:`Modelos LLM`,agentCalls:`Invocações de Agentes`,executions:`Execuções`,conversations:`Conversas`,tasks:`Tarefas`,prds:`PRD`,specs:`SPEC`,providers:`Provedores`,agents:`Zaip Agentes`,daily:`Diário`,monthly:`Mensal`,annual:`Anual`,developers:`Desenvolvedores`}},"en-US":{back:`Back - Dashboard`,title:`ZAIP Cost Monitor`,subtitle:`Git-native view of Costs, Tokens and Time for each Task, SPEC, or PRD.`,refresh:`Refresh`,refreshing:`Refreshing…`,filters:`Filters`,settings:`Settings`,language:`Language`,currency:`Currency`,kicker:`ZAIP-AIOS • COST MONITOR`,heading:`Costs and tokens`,intro:`Locally derived telemetry attributed by agent invocation, task, phase, and origin.`,period:`Period`,allTime:`All time`,last7:`Last 7 days`,last30:`Last 30 days`,last90:`Last 90 days`,thisMonth:`This month`,noData:`No data for the current filter.`,tabs:{overview:`Overview`,models:`Models`,agentCalls:`Agent Invocations`,executions:`Executions`,conversations:`Conversations`,tasks:`Tasks`,prds:`PRDs`,specs:`SPECs`,providers:`Providers`,agents:`Agents`,daily:`Daily`,monthly:`Monthly`,annual:`Annual`,developers:`Developers`}}};function Mm(e){return e===`pt-BR`?`BRL`:`USD`}function Nm(e){let{developerAttributionRange:t,filters:n,globalFilters:r,groupPageRange:i,loadGroupPage:a,view:o}=e;return{developerExportSource:o===`developers`?{prepare:async()=>{let e=await Dm({...t===void 0?{}:t});return{totalRows:e.length,pages:async function*(){yield e}}}}:void 0,costGroupExportSource:(o===`daily`||o===`monthly`||o===`annual`||o===`agents`||o===`models`||o===`providers`)&&a!==void 0?{prepare:async()=>{let e=n.query||r?.query||``,t=await a({view:o,offset:0,limit:50,filters:n,...e?{query:e}:{},...i===void 0?{}:i});return{totalRows:t.total_count,pages:async function*(){let r=t;for(;;){if(r.rows.length===0)return;yield r.rows;let t=r.offset+r.rows.length;if(t>=r.total_count||!r.has_more)return;r=await a({view:o,offset:t,limit:r.limit,filters:n,...e?{query:e}:{},...i===void 0?{}:i})}}}}}:void 0}}function Pm(e,t){return e.find(e=>e.id===t)??null}function Fm(e,t){return e===t}function Im(e,t){return t??e}function Lm(e,t,n){t(e),n(Mm(e))}function Rm(e,t,n){let r=Pm(t,e);r&&n(r)}function zm(e,t){if(e.length===0)return{...t,run_count:0,task_count:0,event_count:0,total_tokens:null,estimated_usd:null,estimated_brl:null,recorded_usd:null,recorded_brl:null,average_run_cost_usd:null,average_run_cost_brl:null,average_run_duration_ms:null,known_tokens_per_cycle:null,top_10_token_share:null,coverage:{events:0,tokens:0,usd:0,brl:0}};let n=e.reduce((e,t)=>({events:e.events+t.coverage.events,tokens:e.tokens+t.coverage.tokens,usd:e.usd+t.coverage.usd,brl:e.brl+t.coverage.brl}),{events:0,tokens:0,usd:0,brl:0}),r=e.filter(e=>e.total_tokens!==null),i=r.reduce((e,t)=>e+(t.total_tokens??0),0),a=r.reduce((e,t)=>e+(t.event_count??0),0),o=[...r].sort((e,t)=>(t.total_tokens??0)-(e.total_tokens??0)).slice(0,10).reduce((e,t)=>e+(t.total_tokens??0),0);return{task_count:new Set(e.flatMap(e=>e.task_id?[e.task_id]:[])).size,run_count:e.length,event_count:e.reduce((e,t)=>e+(t.event_count??0),0),total_tokens:sf(e.map(e=>e.total_tokens)),estimated_usd:sf(e.map(e=>e.estimated_usd)),estimated_brl:sf(e.map(e=>e.estimated_brl)),recorded_usd:sf(e.map(e=>e.recorded_usd)),recorded_brl:sf(e.map(e=>e.recorded_brl)),average_run_cost_usd:of(e.map(e=>e.estimated_usd)),average_run_cost_brl:of(e.map(e=>e.estimated_brl)),average_run_duration_ms:Bm(hf(e).map(e=>e.duration_ms)),known_tokens_per_cycle:a===0?null:i/a,top_10_token_share:i===0?null:o/i,coverage:n}}function Bm(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0)/t.length:null}var Vm=`daily`,Hm=[`daily`,`monthly`,`annual`,`developers`,`overview`,`executions`,`agentCalls`,`agents`,`models`,`providers`,`tasks`,`specs`,`prds`,`conversations`];function Um({embedded:e,globalDateRange:t,period:n,runPageRange:r}){if(!(e&&t===void 0&&n===`month`))return r}function Wm(e){return Um(e)}function Gm(e){return e===`tasks`||e===`specs`||e===`prds`||e===`executions`||e===`conversations`?e:null}function Km(e,t){return e!==null&&e.slice(0,e.lastIndexOf(`\0`))===t.slice(0,t.lastIndexOf(`\0`))}function qm({view:e,load:t,limit:n=50,range:r,query:i,filters:a,revision:s}){let[c,l]=(0,o.useState)(0),[u,d]=(0,o.useState)(null),[f,p]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(null),[v,y]=(0,o.useState)(0),b=(0,o.useRef)(0),x=(0,o.useRef)(t);x.current=t;let S=t!==void 0,C=r?.from,w=r?.to,T=Object.values(a).join(`\0`),E=`${e}\u0000${n}\u0000${i??``}\u0000${C??``}\u0000${w??``}\u0000${T}`,D=`${E}\u0000${c}\u0000${s}`,O=(0,o.useRef)({filters:a,limit:n,query:i,rangeFrom:C,rangeTo:w});return O.current={filters:a,limit:n,query:i,rangeFrom:C,rangeTo:w},(0,o.useEffect)(()=>{l(0)},[E]),(0,o.useEffect)(()=>{let t=Gm(e);if(t===null||!S){d(null),_(null),h(!1);return}let n=new AbortController,r=++b.current;h(!0),_(null);let i=x.current;if(i===void 0)return;let a=O.current;return i({kind:t,offset:c,limit:a.limit,...a.rangeFrom===void 0||a.rangeTo===void 0?{}:{from:a.rangeFrom,to:a.rangeTo},...a.query?{query:a.query}:{},filters:a.filters,signal:n.signal}).then(e=>{!n.signal.aborted&&r===b.current&&(d({...e,rows:e.rows.map(Lf)}),p(D))}).catch(e=>{!n.signal.aborted&&r===b.current&&_(e instanceof Error?e.message:String(e))}).finally(()=>{!n.signal.aborted&&r===b.current&&h(!1)}),()=>n.abort()},[v,S,c,D,e]),{compactPageOffset:c,setCompactPageOffset:l,compactPage:f===D?u:null,staleCompactPage:Km(f,D)?u:null,compactPageLoading:m,compactPageError:g,retryCompactPage:()=>y(e=>e+1)}}function Jm({view:e,eligible:t,currency:n,filters:r,globalQuery:i,limit:a=10,range:s,refresh:c,revision:l,load:u}){let[d,f]=(0,o.useState)(0),[p,m]=(0,o.useState)(null),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(null),[y,b]=(0,o.useState)(0),x=(0,o.useRef)(0),S=(0,o.useRef)(u);S.current=u;let C=s?.from,w=s?.to,T={...r,query:r.query||i},E=`${Object.values(T).join(`\0`)}\u0000${C??``}\u0000${w??``}`,D=`${e}\u0000${t}\u0000${n}\u0000${a}\u0000${E}\u0000${c??``}\u0000${l}`,O=(0,o.useRef)({view:e,eligible:t,currency:n,effectiveFilters:T,rangeFrom:C,rangeTo:w,refresh:c,limit:a});return O.current={view:e,eligible:t,currency:n,effectiveFilters:T,rangeFrom:C,rangeTo:w,refresh:c,limit:a},(0,o.useEffect)(()=>{f(0)},[E]),(0,o.useEffect)(()=>{let e=O.current;if(e.view!==`agentCalls`||!e.eligible){m(null),v(null),g(!1);return}let t=new AbortController,n=++x.current;return g(!0),v(null),(S.current??Vf)({currency:e.currency,filters:e.effectiveFilters,...e.rangeFrom===void 0||e.rangeTo===void 0?{}:{from:e.rangeFrom,to:e.rangeTo},offset:d,limit:e.limit,refresh:e.refresh,signal:t.signal}).then(e=>{!t.signal.aborted&&Fm(n,x.current)&&m(e)}).catch(e=>{!t.signal.aborted&&Fm(n,x.current)&&v(e instanceof Error?e.message:String(e))}).finally(()=>{!t.signal.aborted&&Fm(n,x.current)&&g(!1)}),()=>t.abort()},[y,d,D]),{runPageOffset:d,setRunPageOffset:f,runPageData:p,runPageLoading:h,runPageError:_,retryRunPage:()=>b(e=>e+1)}}function Ym(e){return e!==`overview`}function Xm({embedded:e,globalDateRange:t,runPageRange:n}){return e&&t===void 0?void 0:n}function Zm(e,t){let n=new Set(t.flatMap(e=>e.execution_id===null?[]:[e.execution_id]));return e.filter(e=>n.has(e.id))}function Qm(e,t=``){return t===``||e.query===``}function $m({capabilityNavigation:e,data:t,dashboardTitle:n=`Dashboard ZAIP AIOS`,embedded:r=!1,globalFilters:i,lastUpdatedAt:a,locale:s,loading:c,onLoadingChange:u,onLocaleChange:f,onOpenTrace:p,onActiveDataChange:m,onRefresh:h,loadDetail:g=Bf,loadRunPage:_,loadReadModelPage:v,loadGroupPage:y,loadPeriod:b=zf,operations:x,repositoryName:S,currency:C,onCurrencyChange:w}){let[T,E]=(0,o.useState)(Vm),[D,O]=(0,o.useState)(Jf),[k,A]=(0,o.useState)(`BRL`),j=C??k,ee=e=>{A(e),w?.(e)},[M,te]=(0,o.useState)(Uf),[ne,re]=(0,o.useState)(null),[N,ie]=(0,o.useState)(null),[ae,oe]=(0,o.useState)(null),[P,F]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(null),[le,ue]=(0,o.useState)(0),de=(0,o.useRef)({data:t,revision:0});de.current.data!==t&&(de.current={data:t,revision:de.current.revision+1});let fe=de.current.revision,I=(0,o.useRef)(g);I.current=g;let pe=jm[s],L=(0,o.useMemo)(()=>({...D,query:D.query||i?.query||``}),[D,i?.query]),{activeData:R,periodError:me,periodLoading:he}=Gf({currency:j,data:t,...i===void 0?{}:{dateRange:i.dateRange},filters:L,lastUpdatedAt:a,loadPeriod:b,period:M,snapshotBacked:r}),ge=Object.values(D).some(e=>e!==``),_e=i?.dateRange===void 0?Wf(M):{from:i.dateRange.start,to:i.dateRange.end},z=Um({embedded:r,globalDateRange:i?.dateRange,hasLocalCostFilters:ge,period:M,runPageRange:_e}),ve=Xm({embedded:r,...i?.dateRange===void 0?{}:{globalDateRange:i.dateRange},..._e===void 0?{}:{runPageRange:_e}}),B=Wm({embedded:r,globalDateRange:i?.dateRange,hasLocalCostFilters:ge,period:M,runPageRange:_e}),ye=(e=>e===`daily`||e===`monthly`||e===`annual`||e===`agents`||e===`models`||e===`providers`?e:null)(T),V=fm({active:ye!==null,view:ye??`daily`,...z===void 0?{}:{range:z},globalQuery:i?.query??``,filters:D,limit:10,revision:fe,...ye===null?{}:{load:y}}),be=V.page??V.stalePage,{compactPageOffset:xe,setCompactPageOffset:Se,compactPage:Ce,staleCompactPage:we,compactPageLoading:Te,compactPageError:Ee,retryCompactPage:De}=qm({view:T,load:v,limit:10,range:B,query:i?.query,filters:D,revision:fe}),Oe=Qm(D,i?.query??``),{runPageOffset:ke,setRunPageOffset:Ae,runPageData:H,runPageLoading:je,runPageError:U,retryRunPage:Me}=Jm({view:T,eligible:T===`agentCalls`&&Oe,currency:j,filters:D,globalQuery:i?.query??``,limit:10,range:z,refresh:a,revision:fe,load:_});(0,o.useEffect)(()=>u?.(c||he||je||V.loading||Te||P),[Te,P,V.loading,c,u,he,je]),(0,o.useEffect)(()=>()=>u?.(!1),[u]),(0,o.useEffect)(()=>{ge||m?.(R)},[R,ge,m]);let Ne=a===null?s===`pt-BR`?`Aguardando atualização`:`Waiting for refresh`:`${s===`pt-BR`?`Atualizado`:`Updated`} ${new Intl.DateTimeFormat(s,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(a))}`,W=(0,o.useMemo)(()=>R.runs.filter(e=>Cm(e,D)&&wm(e,i)).sort((e,t)=>t.started_at.localeCompare(e.started_at)),[R.runs,D,i]),Pe=_e?.from,Fe=_e?.to;(0,o.useEffect)(()=>{oe(null),F(!1),ce(null)},[j,le,D,a,Pe,Fe]);let Ie=(0,o.useMemo)(()=>H?.runs??[],[H?.runs]),G=(0,o.useMemo)(()=>Im(W,ae?.runs).filter(e=>Cm(e,D)&&wm(e,i)).sort((e,t)=>t.started_at.localeCompare(e.started_at)),[ae?.runs,D,i,W]),Le=(0,o.useMemo)(()=>{if(x===void 0)return;let e=new Set(W.map(e=>e.run_id));return{...x,runs:x.runs.filter(t=>e.has(t.id))}},[x,W]),Re=(0,o.useMemo)(()=>({prds:R.prds.filter(e=>Em(e,i)),specs:R.specs.filter(e=>Em(e,i)),tasks:(x?.tasks??[]).filter(e=>Em(e,i)),evidences:(x?.evidences??[]).filter(e=>Em({created_at:e.observed_at},i)),validations:(x?.validations??[]).filter(e=>Em({created_at:e.executed_at},i))}),[R.prds,R.specs,i,x?.evidences,x?.tasks,x?.validations]),ze=Re.prds,K=Re.specs,Be=R.aggregate_only===!0&&G.length===0,q=(0,o.useMemo)(()=>Be?R.groups:{conversations:Tm(G,e=>e.conversation_id??e.task_title??e.run_id,void 0,`all_invocations`),tasks:df(Re.tasks,G),providers:Tm(G,e=>af(e.provider),void 0,`all_invocations`),agents:nf(Tm(G,e=>e.agent_name),R.configured_agents),models:Tm(G,e=>e.model),daily:_p(Tm(W,e=>{let t=e.finished_at??e.started_at;return sl(t,`day`)??t.slice(0,10)},void 0,`all_invocations`),Re,`daily`),monthly:_p(Tm(W,e=>{let t=e.finished_at??e.started_at;return sl(t,`month`)??t.slice(0,7)},void 0,`all_invocations`),Re,`monthly`),annual:_p(Tm(W,e=>{let t=e.finished_at??e.started_at;return sl(t,`year`)??t.slice(0,4)},void 0,`all_invocations`),Re,`annual`)},[R.configured_agents,Re,G,W,Be,R.groups]),Ve=(0,o.useMemo)(()=>ye===null?q:{...q,[ye]:be===null?[]:ye===`agents`&&y===void 0?nf(be.rows,R.configured_agents):[...be.rows]},[R.configured_agents,be,q,ye,y]),He=Be?R.overview:{...zm(W,R.overview),task_count:Re.tasks.length},Ue=q.annual.reduce((e,t)=>e+t.duration.known_sum,0),We=x?.summary.overview_metrics,Ge=We?We.duration_ms:Ue,Ke={run_count:He.run_count,task_count:We?.task_count??He.task_count,prd_count:We?.prd_count??We?.selected_counts?.prds??0,spec_count:We?.spec_count??We?.selected_counts?.specs??0,evidence_count:0,test_count:0,event_count:He.event_count,total_tokens:We?.tokens??He.total_tokens,estimated_usd:He.estimated_usd,estimated_brl:We?.cost_brl??He.estimated_brl,duration_ms:Ge,duration:{known_sum:Ge??0,unknown:+(Ge===null),complete:Ge!==null,coverage_ratio:Ge===null?0:1}},qe=(0,o.useMemo)(()=>Zm(x?.executions??[],W),[x?.executions,W]),Je=Gm(T),Ye=Je!==null&&v!==void 0,Xe=(0,o.useMemo)(()=>Ye?Ce?.rows??we?.rows??[]:T===`developers`?[]:T===`executions`?qe:T===`conversations`?q.conversations:T===`tasks`?q.tasks:T===`prds`?ze:T===`specs`?K:T===`providers`||T===`agents`||T===`daily`||T===`monthly`||T===`annual`?q[T]:W,[Ce?.rows,q,W,Ye,we?.rows,T,qe,ze,K]),J=Ye&&Je!==null&&v!==void 0?{prepare:async()=>{let e=await v({kind:Je,offset:0,limit:50,filters:D,...B===void 0?{}:B,...i?.query?{query:i.query}:{}});return{totalRows:e.total,pages:async function*(){let t=e,n=new Set;for(;;){let e=t.rows.filter(e=>n.has(e.id)?!1:(n.add(e.id),!0)).map(Lf);e.length>0&&(yield e);let r=t.offset+t.rows.length;if(r>=t.total||!t.has_more)return;t=await v({kind:Je,offset:r,limit:t.limit,filters:D,...B===void 0?{}:B,...i?.query?{query:i.query}:{}})}}}}}:void 0,Ze=T===`agentCalls`&&Oe&&_!==void 0?{prepare:async()=>{let e={...D,query:D.query||i?.query||``},t=await _({currency:j,filters:e,...z===void 0?{}:z,limit:100,offset:0,refresh:a});return{totalRows:t.run_page.total??t.runs.length,pages:async function*(){let n=t;for(;;){if(n.runs.length===0)return;yield n.runs;let t=n.run_page.offset+n.runs.length;if(n.run_page.total!==null&&t>=n.run_page.total||!n.run_page.has_more)return;n=await _({currency:j,filters:e,...z===void 0?{}:z,limit:100,offset:t,refresh:a})}}}}}:void 0,{developerExportSource:Qe,costGroupExportSource:$e}=Nm({developerAttributionRange:ve,filters:D,globalFilters:i,groupPageRange:z,loadGroupPage:y,view:T}),et=e=>Lm(e,f,ee),tt=e=>Rm(e,x?.runs??[],ie);return(0,l.jsxs)(r?`section`:`main`,{className:r?`cost-page cost-page-embedded`:`cost-page`,children:[r?null:(0,l.jsx)(d,{filters:(0,l.jsx)(Yf,{available:t.filters_available,hideQuery:r,locale:s,onChange:O,value:D}),filtersActive:Object.values(D).some(Boolean),lastUpdatedAt:a,snapshotUpdatedAt:x?.summary.projection_updated_at??null,loading:c||he,locale:s,onLocaleChange:et,onRefresh:h,settings:(0,l.jsxs)(`label`,{children:[` `,(0,l.jsx)(`span`,{children:pe.currency}),` `,(0,l.jsxs)(`select`,{onChange:e=>ee(e.target.value),value:j,children:[(0,l.jsx)(`option`,{value:`BRL`,children:`BRL · R$`}),` `,(0,l.jsx)(`option`,{value:`USD`,children:`USD · $`}),` `]}),` `]}),...S===void 0?{}:{repositoryName:S},title:n}),` `,(0,l.jsx)(mm,{groupError:ye===null?null:V.error,locale:s,periodError:me,retryGroup:V.retry}),` `,r?null:(0,l.jsx)(xm,{currency:j,filters:D,filtersAvailable:t.filters_available,loading:c,locale:s,onCurrencyChange:ee,onFiltersChange:O,onLocaleChange:et,onPopupChange:re,onPeriodChange:te,onRefresh:h,period:M,popup:ne,text:pe,updatedLabel:Ne}),` `,r?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Sm,{currency:j,locale:s,overview:He}),` `,e,` `]}),` `,(0,l.jsxs)(`div`,{className:`cost-tabs-bar`,children:[` `,(0,l.jsxs)(`nav`,{"aria-label":`Visões de custo`,className:`cost-tabs`,children:[` `,Hm.map(e=>(0,l.jsxs)(`button`,{"aria-pressed":T===e,className:T===e?`is-active`:void 0,onClick:()=>{E(e)},type:`button`,children:[` `,pe.tabs[e],` `]},e)),` `]}),` `,Ym(T)?(0,l.jsxs)(`div`,{className:`cost-tab-export`,children:[` `,(0,l.jsx)(lc,{filters:{...i,...L,period:M},pageSource:J??Ze??Qe??$e,rows:Xe,view:`cost-${T}`}),` `]}):null]}),` `,(0,l.jsx)(pm,{canonicalDurationTotal:Ue,compactPage:Ce??we,compactPageError:Ee,compactPageLoading:Te,compactPageOffset:xe,currency:j,detailError:se,detailLoading:P,developerPanel:(0,l.jsx)(km,{locale:s,range:ve,view:T}),dimensionalDetailPending:!1,dimensionalRows:G,groups:Ve,groupPage:ye===null?null:be,groupPageLoading:ye!==null&&V.loading,groupPageOffset:V.offset,setGroupPageOffset:V.setOffset,locale:s,macroDetails:Le,onOpenRun:tt,onOpenTrace:p,pagedRunRows:Ie,retryCompactPage:De,retryRunPage:Me,rows:W,runPageData:H,runPageError:U,runPageLoading:je,runPageOffset:ke,serverPagingEligible:Oe,setCompactPageOffset:Se,setDetailAttempt:ue,setRunPageOffset:Ae,summaryUsage:R.usage,summaryTotals:Ke,useAggregateGroups:Be,usingCompactPage:Ye,view:T,visibleExecutions:qe,visiblePrds:ze,visibleSpecs:K}),` `,(0,l.jsx)(Am,{locale:s,onClose:()=>ie(null),selectedRun:N}),` `]})}export{T as C,r as E,k as S,a as T,to as _,sl as a,oe as b,Yo as c,zo as d,Lo as f,ko as g,Po as h,dl as i,qo as l,Fo as m,Jd as n,Xc as o,Io as p,qd as r,Xo as s,$m as t,Wo as u,ro as v,c as w,D as x,Ya as y};
|