.github/9
ISSUE_TEMPLATE/3bug_report.md config.yml feature_request.md
workflows/3ci.yml clean-clone.yml release.yml
CODEOWNERS dependabot.yml pull_request_template.md
apps/630
api/250
src/243
common/30
__tests__/3authorize.test.ts bigint-serialization.interceptor.test.ts files-limits.test.ts
filters/1all-exceptions.filter.ts
guards/3auth.guard.ts internal-service.guard.ts rate-limit.guard.ts
interceptors/2actor-context.interceptor.ts bigint-serialization.interceptor.ts
middleware/2idempotency.test.ts idempotency.ts
pipes/1zod-validation.pipe.ts
actor-context.ts audit.service.ts cache.test.ts cache.ts cookies.ts core.module.ts deprecation.ts email.service.ts errors.ts event-bus.ts log-scrubber.test.ts log-scrubber.ts logger.ts permission-cache-bridge.ts prisma.service.ts redis.service.ts trace-metadata.ts types.ts
config/1env.ts
lib/11
__tests__/5crypto.test.ts filter-builder.test.ts jwt.test.ts pagination.test.ts positions.test.ts
authorize.ts crypto.ts filter-builder.ts jwt.ts pagination.ts positions.ts
modules/197
ai/28
__tests__/4ai-writing.test.ts database-ai.test.ts generate-executor.test.ts prompts.test.ts
generator/4executor.ts generate.controller.ts generate.dto.ts generate.service.ts
ai-chat.service.ts ai-rate-limit.ts ai-writing.controller.ts ai-writing.dto.ts ai-writing.service.ts ai.controller.ts ai.module.ts ai.service.ts budget-guard.service.ts database-ai.controller.ts database-ai.dto.ts database-ai.service.ts db-prompts.ts dto.ts gateway-provider.ts ledger.service.ts prompts.ts rag.controller.ts rag.dto.ts rag.service.ts
api-keys/3api-keys.controller.ts api-keys.module.ts api-keys.service.ts
audit/2audit-log.controller.ts audit.module.ts
auth/4auth.controller.ts auth.module.ts auth.service.ts dto.ts
automations/5automations.controller.ts automations.module.ts automations.service.ts dto.ts webhook-incoming.controller.ts
blocks/5
__tests__/1batch-version-cas.test.ts
block.service.ts blocks.controller.ts blocks.module.ts dto.ts
comments/4comments.controller.ts comments.module.ts comments.service.ts dto.ts
databases/9
__tests__/3normalize-select-options.test.ts option-id-canonicalization.test.ts record-open-query-shape.test.ts
database.service.ts databases.controller.ts databases.module.ts dto.ts property-cache-schema.ts query.service.ts
docs/2docs.controller.ts docs.module.ts
files/10
__tests__/1quota.test.ts
dto.ts files.controller.ts files.module.ts files.service.ts quota.ts record.ts s3.ts uploads.controller.ts uploads.service.ts
forms/18debug.controller.ts form.dto.ts forms.controller.ts forms.module.ts forms.service.ts markdown.test.ts markdown.ts optional-auth.guard.ts public-forms.controller.ts public-forms.service.ts question.dto.ts questions.service.ts rate-limit.ts recaptcha.ts slug.ts submissions.controller.ts submissions.service.ts submit-schema.ts
health/3health.controller.ts health.module.ts health.service.ts
integrations/3integrations.controller.ts integrations.module.ts integrations.service.ts
internal/12
__tests__/2flush-query-shape.test.ts internal.endpoints.test.ts
ai-test-seam.controller.ts ai-test-seam.dto.ts ai-test-seam.service.ts internal.controller.ts internal.dto.ts internal.module.ts internal.service.ts test-seam.controller.ts test-seam.dto.ts test-seam.service.ts
notifications/3notifications.controller.ts notifications.module.ts notifications.service.ts
oauth/6
__tests__/1oauth.scopes.test.ts
oauth.controller.ts oauth.module.ts oauth.service.ts scopes.ts token-keys.ts
org/15audit.service.ts embed-preview.controller.ts guards.ts members.service.ts org-admin.controller.ts org-policy.service.ts org.module.ts overview.service.ts policy-effective.controller.ts policy.schema.ts policy.test.ts retention.service.ts totp.test.ts totp.ts two-factor.service.ts
orgs/5dto.ts orgs.controller.ts orgs.module.ts orgs.service.ts util.ts
pages/4dto.ts page.service.ts pages.controller.ts pages.module.ts
scim/15
__tests__/3email-mapping.test.ts etag.test.ts filters.test.ts
etag.ts filters.ts groups.service.ts schemas.ts scim-admin.controller.ts scim-admin.service.ts scim-auth.guard.ts scim-auth.service.ts scim-errors.ts scim.controller.ts scim.module.ts users.service.ts
search/4
__tests__/1search.service.test.ts
search.controller.ts search.module.ts search.service.ts
sessions/3sessions.controller.ts sessions.module.ts sessions.service.ts
share/3share.controller.ts share.module.ts share.service.ts
sso/16
__tests__/4enforcement.test.ts oidc.verify.test.ts provisioning.test.ts saml.validate.test.ts
enforcement.ts oidc.controller.ts oidc.service.ts oidc.ts provisioning.service.ts saml.controller.ts saml.ts schemas.ts sso-admin.controller.ts sso-admin.service.ts sso-secrets.ts sso.module.ts
teams/4dto.ts teams.controller.ts teams.module.ts teams.service.ts
users/4dto.ts users.controller.ts users.module.ts users.service.ts
webhooks/3webhooks.controller.ts webhooks.module.ts webhooks.service.ts
workspaces/4dto.ts workspaces.controller.ts workspaces.module.ts workspaces.service.ts
types/1xmldom.d.ts
app.module.ts constants.ts main.ts
_probe_rawbody.cjs .env.example Dockerfile package.json README.md tsconfig.json vitest.config.ts
realtime/33
src/17auth.ts comments.ts config.ts event-source.ts http-store.ts index.ts metrics.ts notifications.ts page-updated-source.ts presence.ts prisma-store.ts protocol.ts rate-limit.ts room-key.ts rooms.ts server.ts update-log.ts
test/11auth.test.ts config.test.ts event-source.test.ts http-store.test.ts metrics-merge.test.ts page-updated-source.test.ts presence.test.ts protocol.test.ts rate-limit.test.ts rooms.test.ts task-0094-builders.test.ts
.env.example Dockerfile package.json README.md tsconfig.json
web/255
src/244
app/45
__tests__/1theme-tokens.test.ts
(app)/26
w/25
[workspace]/25
ask/1page.tsx
databases/1
[id]/1page.tsx
favorites/1page.tsx
files/1page.tsx
notifications/1page.tsx
page/4
[id]/4
[block]/1page.tsx
share/1page.tsx
layout.tsx page.tsx
search/1page.tsx
settings/10
appearance/1page.tsx
automations/3
[id]/1page.tsx
new/1page.tsx
page.tsx
billing/1page.tsx
developers/1page.tsx
members/1page.tsx
permissions/1page.tsx
teams/1page.tsx
page.tsx
shared/1page.tsx
templates/1page.tsx
trash/1page.tsx
layout.tsx page.tsx
layout.tsx
(auth)/4
login/1page.tsx
register/1page.tsx
reset-password/1page.tsx
layout.tsx
api/2
metrics/1route.ts
v1/1
health/1route.ts
f/1
[slug]/1page.tsx
health/1
ready/1route.ts
org/2
[orgId]/2
admin/2
integrations/1page.tsx
page.tsx
share/1
[id]/1page.tsx
error.tsx global-error.tsx globals.css layout.tsx not-found.tsx page.tsx providers.tsx
components/118
admin/10
org-admin/8ApiKeysTab.tsx AuditTab.tsx MembersTab.tsx OverviewTab.tsx PoliciesTab.tsx RetentionTab.tsx WebhooksTab.tsx WorkspacePicker.tsx
ScimCard.tsx SsoTabs.tsx
ai/6ai-panel.tsx ask-ai-submenu.tsx db-ai-dialog.tsx generate-page-dialog.tsx writing-actions-menu.tsx writing-diff.tsx
automations/5action-editor.tsx condition-editor.tsx lib.ts run-history.tsx trigger-editor.tsx
collaboration/6CursorLayer.tsx OfflineBanner.tsx PresenceBar.tsx README.md ReviewFailedDialog.tsx StatusChip.tsx
comments/3comment-panel.tsx comment-thread.tsx mention-input.tsx
database/27
__tests__/2cell-editor.test.tsx cell-renderer.test.tsx
AiExtractDialog.tsx AiFormulaDialog.tsx AiGenerateDialog.tsx board-view.tsx buttons-panel.tsx calendar-view.tsx cell-editor.tsx cell-renderer.tsx chart-view.tsx database-page-view.tsx database-toolbar.tsx database-view-renderer.tsx db-embedded.tsx filter-builder.tsx form-builder-view.tsx formula-editor.tsx gallery-view.tsx group-builder.tsx list-view.tsx property-editor.tsx record-header.tsx record-panel.tsx sort-builder.tsx table-view.tsx timeline-view.tsx
dialogs/7
__tests__/1move-to-dialog.test.tsx
create-dialog.tsx dialog.tsx file-permissions-dialog.tsx invite-dialog.tsx move-to-dialog.tsx share-dialog.tsx
editor/19
__tests__/3code-block-text.test.ts code-block.test.tsx expandable.test.tsx
block-card.tsx block-renderer.tsx block-save-queue.ts block-toolbar.tsx context-menu.tsx expandable.tsx history-popover.tsx inline-editor.tsx insert-dialog.tsx page-canvas.tsx page-spinner.tsx page-view.tsx selection-toolbar.tsx slash-menu.tsx template-dialog.tsx type-menu.tsx
files/4FileBlock.tsx FileBrowser.tsx FilePicker.tsx PreviewModal.tsx
form/4form-field.tsx form-renderer.tsx form-responses-view.tsx form-view.tsx
layout/8
__tests__/1page-tree-icon.test.tsx
command-palette.tsx factory-logo.tsx page-tree-node.tsx sidebar.tsx theme-provider.tsx topbar.tsx workspace-shell.tsx
mentions/3
__tests__/1mention-model.test.ts
mention-model.ts MentionPopup.tsx
search/3ask-ai-search.tsx results-list.tsx search-dialog.tsx
settings/10
api-keys/4ApiKeyCreateDialog.tsx ApiKeyRevealDialog.tsx ApiKeyTable.tsx ScopesBadge.tsx
webhooks/5CurlExamples.tsx DeliveryInspector.tsx EventExplorer.tsx OverviewTab.tsx WebhooksTab.tsx
settings-shell.tsx
ui/3confirm-dialog.tsx form.tsx toaster.tsx
hooks/21
__tests__/4realtime-frame-handler.test.ts use-blocks.test.ts use-database-options.test.ts use-workspace.test.tsx
realtime-frame-handler.ts use-ai-stream.ts use-auth.ts use-blocks.ts use-database.ts use-db-ai-stream.ts use-forms.ts use-members.ts use-mention-sources.ts use-notifications.ts use-offline-status.ts use-pages.ts use-presence-announcer.ts use-presence-toasts.ts use-presence.ts use-realtime.ts use-workspace.ts
lib/50
__tests__/21ai-database.test.ts ai-generate.test.ts ai-sse.test.ts ai-writing.test.ts api-keys.test.ts api-members.test.ts auth-refresh.test.ts auth-store.test.ts batch-queue-drop.test.ts block-content.test.ts clipboard-import.test.ts code-highlight.test.ts offline-status.test.ts presence-announcer.test.ts presence-color.test.ts presence-cursor.test.ts presence-emitter.test.ts realtime-url.test.ts search.test.ts utils.test.ts writing-diff.test.ts
files/7
__tests__/2picker.test.ts upload.test.ts
api.ts picker.ts upload-store.ts upload.ts use-file-uploads.ts
ai-database.ts ai.ts api-keys.ts api.ts auth-store.ts batch-queue.ts block-content.ts clipboard-import.ts code-highlight.ts constants.ts offline-status.ts org-admin.ts presence-announcer.ts presence-color.ts presence-cursor.ts presence-editor-views.ts presence-emitter.ts query-client.ts realtime.ts search.ts types.ts utils.ts
stores/8
__tests__/1block-patch-store.test.ts
block-patch-store.ts comment-pill-store.ts database-store.ts editor-store.ts offlineQueue.ts presence-store.ts ui-store.ts
instrumentation.ts middleware.ts
.env.example Dockerfile next-env.d.ts next.config.mjs package.json postcss.config.mjs README.md tailwind.config.ts tsconfig.json tsconfig.tsbuildinfo vitest.config.ts
worker/92
src/87
__tests__/13ai-embedding.test.ts ai-request.test.ts ai-usage-budget.test.ts audit-export.test.ts email-decision.test.ts encrypt.test.ts health-search-index-lag.test.ts mime.test.ts retention.test.ts s3-sign.test.ts search-index.test.ts smtp.test.ts webhook-sign.test.ts
health/1server.ts
lib/12
__tests__/1clamav.test.ts
clamav.ts encrypt.ts job-otel.ts mime.ts notify.ts prisma.ts redis-stream.ts redis.ts s3.ts sharp.ts smtp.ts
processors/56
automations/28
__tests__/3condition-evaluator.spec.ts executors.spec.ts run-pipeline.spec.ts
executors/17assign-user.ts call-integration.ts change-status.ts classify.ts create-notification.ts create-page.ts email-cap.ts helpers.ts integration-registry.ts permission.ts record-write.ts registry.ts run-ai-action.ts send-email.ts send-webhook.ts types.ts update-record.ts
condition-evaluator.ts dead-letter.ts log.ts matcher.ts pipeline.ts run-state.ts schedule.ts watchdog.ts
files/15
__tests__/4errors.test.ts scan-gate.test.ts status.test.ts temp.test.ts
steps/4finalize.ts metadata.ts scan.ts thumbnails.ts
cleanup.ts errors.ts generateThumbs.ts processor.ts status.ts temp.ts types.ts
search-index/4builders.ts grants.ts index.ts processor.ts
ai-embedding.ts ai.processor.ts audit-export.ts automations.processor.ts email-decision.processor.ts email.processor.ts maintenance.processor.ts retention.ts webhooks.processor.ts
config.ts events.ts index.ts logger.ts queues.ts
.env.example Dockerfile package.json README.md tsconfig.json
docs/73
api/17ai.md authentication.md automations.md blocks.md comments.md databases.md files.md forms.md openapi.yaml org-admin.md pages.md scim.md search.md sso.md versioning.md webhooks.md workspaces.md
architecture/10ai-architecture.md automation.md backend-architecture.md database-architecture.md frontend-architecture.md realtime-architecture.md search-architecture.md security-architecture.md storage.md system-architecture.md
database/2database-architecture.md redis-keys.md
development/8admin-guide.md coding-standards.md deployment.md development-guide.md files-pipeline.md perf-report.md performance.md testing.md
product/4functional-requirements.md non-functional-requirements.md product-requirements.md ux-requirements.md
requirements/1requirements-matrix.md
security/5audit-report.md files.md forms.md license-allowlist.md security-architecture.md
tasks/16phase-00-foundation.md phase-01-authentication.md phase-02-workspace.md phase-03-pages.md phase-04-editor.md phase-05-databases.md phase-06-relations.md phase-07-collaboration.md phase-08-search.md phase-09-files.md phase-10-forms.md phase-11-automation.md phase-12-ai.md phase-13-api.md phase-14-enterprise.md phase-15-production.md
ui/9ai.md automations.md design-system.md developers.md files.md forms.md org-admin.md scim.md sso.md
support-matrix.md
infrastructure/71
caddy/1Caddyfile
docker/6
init/101-extensions.sql
opensearch/1init-indices.json
.env.docker docker-compose.yml opensearch-init.sh README.md
kubernetes/40
observability/20
alertmanager/1alertmanager.yaml
grafana/8
dashboards/6ai.json api-overview.json infra.json realtime.json search.json workers-queues.json
provisioning/2
dashboards/1dashboards.yaml
datasources/1datasource.yaml
prometheus/3alerts.yaml recording-rules.yaml scrape.yaml
scripts/1sync-sources.mjs
alertmanager.yaml grafana.yaml kustomization.yaml namespace.yaml node-exporter.yaml otel-collector.yaml prometheus.yaml
postgres/7configmap.yaml cronjob-backup.yaml cronjob-opensearch-snapshot.yaml pgbouncer.yaml replica.yaml statefulset.yaml walg-iam-policy.yaml
api.yaml configmap.yaml ingress.yaml kustomization.yaml namespace.yaml networkpolicy.yaml pdb.yaml README.md realtime.yaml redis.yaml secret.example.yaml web.yaml worker.yaml
nginx/2nginx.conf README.md
observability/14
alertmanager/1alertmanager.yaml
grafana/8
dashboards/6ai.json api-overview.json infra.json realtime.json search.json workers-queues.json
provisioning/2
dashboards/1dashboards.yaml
datasources/1datasource.yaml
prometheus/3alerts.yaml recording-rules.yaml scrape.yaml
scripts/1dashboard-completeness.mjs
README.md
terraform/8compute.tf data.tf main.tf network.tf outputs.tf README.md security.tf variables.tf
packages/289
ai/24
src/20
providers/7anthropic.ts google.ts http.ts index.ts openai-compatible.ts rag.test.ts writing.test.ts
schemas/2database.ts generate.ts
adapters.test.ts config.test.ts config.ts gateway.test.ts gateway.ts index.ts tools.test.ts tools.ts types.ts usage.test.ts usage.ts
package.json README.md tsconfig.json vitest.config.ts
auth/11
src/7index.ts passwords.test.ts passwords.ts sessions.test.ts sessions.ts tokens.test.ts tokens.ts
package.json README.md tsconfig.json vitest.config.ts
collaboration/17
src/13awareness.ts codec.test.ts codec.ts index.ts lww.test.ts lww.ts mapping.ts offline.ts outbox.test.ts outbox.ts provider.test.ts provider.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
config/7
src/4eslint.base.js index.ts prettier.base.json tsconfig.base.json
package.json README.md tsconfig.json
database-client/5
src/2index.test.ts index.ts
package.json README.md tsconfig.json
database-engine/33
src/29
filter/2filter.test.ts index.ts
formula/8evaluator.ts formula.test.ts functions.ts index.ts lexer.ts parser.ts types.ts validate.ts
query/6group.ts index.ts paginate.ts pivot.ts query.test.ts sort.ts
relations/2index.ts relations.test.ts
rollups/2index.ts rollups.test.ts
values/5dates.ts index.ts registry.ts types.ts values.test.ts
views/3buttons.ts index.ts views.test.ts
index.ts
package.json README.md tsconfig.json vitest.config.ts
editor/25
src/21
marks/1highlight.ts
nodes/2equation.ts mention.ts
autosave.test.ts autosave.ts clipboard.test.ts clipboard.ts codec.test.ts codec.ts context-menu.test.ts context-menu.ts diff.test.ts diff.ts factory.ts history.test.ts history.ts index.ts positions.ts slash.test.ts slash.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
observability/20
src/16
__tests__/8db-redis-metrics.test.ts metrics.test.ts otel.test.ts pino-otel.test.ts prometheus.test.ts resource.test.ts scrubber.test.ts traceparent.test.ts
index.ts metrics.ts otel.ts pino-otel.ts prometheus.ts resource.ts scrubber.ts traceparent.ts
package.json README.md tsconfig.json vitest.config.ts
permissions/11
src/7index.ts levels.test.ts levels.ts resolve.test.ts resolve.ts rules.test.ts rules.ts
package.json README.md tsconfig.json vitest.config.ts
search/22
src/18chunking.test.ts chunking.ts client.test.ts client.ts embeddings.test.ts embeddings.ts hybrid.test.ts hybrid.ts index.ts indexer.test.ts indexer.ts mapping.test.ts mapping.ts queries.test.ts queries.ts rrf.test.ts rrf.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
shared/61
src/57
dto/17ai.dto.ts auth.dto.test.ts auth.dto.ts block.dto.ts browser-safety.test.ts comment.dto.ts database.dto.test.ts database.dto.ts file.dto.ts formula-ast.ts index.ts notification.dto.ts page.dto.ts search.dto.ts share.dto.ts webhook.dto.ts workspace.dto.ts
events/8audit-catalog.test.ts audit-catalog.ts audit-csv.test.ts audit-csv.ts audit-scope.test.ts audit-scope.ts catalog.test.ts catalog.ts
realtime/6comment-events.ts frames.test.ts frames.ts notification-policy.ts notification-prefs.ts task-0094.test.ts
automation.test.ts automation.ts constants.ts crypto.test.ts crypto.ts env.ts errors.ts events.test.ts events.ts forms.test.ts forms.ts index.ts markdown.test.ts markdown.ts mentions.test.ts mentions.ts net.test.ts net.ts positions.test.ts positions.ts presence.test.ts presence.ts security-headers.ts webhook-delivery.test.ts webhook-delivery.ts webhook-events.ts
package.json README.md tsconfig.json vitest.config.ts
storage/16
src/12client.test.ts client.ts index.ts keys.test.ts keys.ts mime.test.ts mime.ts presign.test.ts presign.ts thumbnails.test.ts thumbnails.ts types.ts
package.json README.md tsconfig.json vitest.config.ts
ui/37
src/33
components/19avatar.tsx badge.tsx button.tsx checkbox.tsx command.tsx context-menu.tsx dialog.tsx dropdown-menu.tsx empty-state.tsx index.ts popover.tsx separator.tsx skeleton.tsx slider.tsx spinner.tsx switch.tsx tabs.tsx toast.tsx tooltip.tsx
color.ts command-filter.test.ts command-filter.ts focus.test.ts focus.ts formatters.test.ts formatters.ts index.ts theme.test.ts theme.ts toast-store.test.ts toast-store.ts tokens.test.ts tokens.ts
package.json README.md tsconfig.json vitest.config.ts
prisma/16
migrations/13
20260927000000_init/1migration.sql
20260928000000_search_documents_content_hash/1migration.sql
20260929000000_workspace_usage_storage_bytes/1migration.sql
20260930000000_form_submitted_notification_type/1migration.sql
20261001000000_ai_phase12/1migration.sql
20261002000000_webhooks_secret_encrypted_dlq/1migration.sql
20261002111436_webhook_delivery_latency/1migration.sql
20261002120000_org_admin_2fa_retention_unique/1migration.sql
20261002215124_audit_export/1migration.sql
20261003210000_perf_indexes_hot_paths/1migration.sql
20261004004500_perf_indexes_hot_paths_2/1migration.sql
migration_lock.toml README.md
schema.prisma seed.ts verify.ts
scripts/7backup-health.ts docs-completeness.mjs generate-openapi.mjs minio-init.ts opensearch-reindex.ts storage-orphans.ts verify-clean-clone.sh
tests/169
e2e/63
.auth/1user.json
fixtures/7
files/6clip.mp4 clip.wav clip.webm hero-1400.png note.docx note.txt
realtime.ts
mocks/2oidc-issuer.ts saml-idp.ts
playwright-report/3
data/2a6557bae9c2714a658968d4eb8534195c08ebda8.png e3092d07d00a16063e46385c02a559a9054fa847.webm
index.html
reports/1files-security.json
specs/34ai-database.spec.ts ai-generate.spec.ts ai-rag.spec.ts ai-security.spec.ts ai-writing.spec.ts ai.spec.ts api-keys.spec.ts appearance-theme.spec.ts auth.spec.ts automation.spec.ts collab-two-tab.spec.ts comments.spec.ts databases.spec.ts default-workspace-alias.spec.ts developers.spec.ts editor.spec.ts files.spec.ts final-flow.spec.ts forms.spec.ts oauth.spec.ts org-admin.spec.ts pages.spec.ts performance.spec.ts presence-cursors.spec.ts qa-paste-toggle.spec.ts realtime.spec.ts scim.spec.ts search-index-lag.spec.ts search.spec.ts sharing.spec.ts sso.spec.ts task-0094-comments-notifications.spec.ts webhooks.spec.ts workspace.spec.ts
test-results-final-flow/3
final-flow-Release-v1-0-fi-6c06b-w-state-carries-sequential--chromium-desktop/2test-failed-1.png trace.zip
.last-run.json
utils/4api.ts dnd.ts search-lag.ts wait.ts
.gitignore fixtures.ts global-setup.ts package.json playwright.config.ts playwright.final-flow.config.ts README.md tsconfig.json
fixtures/1
files/1make-sparse.ts
integration/60
ai-capability/2ai-app.capability.test.ts gateway.capability.test.ts
drill/2seed-drill.mjs verify-restore.mjs
fixtures/5
files/5clip.mp4 clip.wav doc.pdf hero-1400.png note.txt
helpers/3api.ts containers.ts seed.ts
realtime/11control-channel.test.ts convergence.test.ts flush-rebase-http.test.ts handshake.test.ts heartbeat-limits.test.ts lifecycle.test.ts presence.test.ts rebase.test.ts resume.test.ts rt-helpers.ts task-0094-fanout.test.ts
ai-chat.integration.test.ts ai-database.integration.test.ts ai-generate.integration.test.ts ai-rag.integration.test.ts ai-writing.integration.test.ts api-keys.integration.test.ts audit-completeness.integration.test.ts audit-export-s3.integration.test.ts auth.integration.test.ts automation-pipeline.integration.test.ts automations.integration.test.ts blocks.integration.test.ts cache-invalidation.integration.test.ts comments.integration.test.ts databases.integration.test.ts files-lifecycle.integration.test.ts files-pipeline.integration.test.ts files-security.integration.test.ts files.integration.test.ts forms-responses.integration.test.ts forms.integration.test.ts oauth.integration.test.ts openapi.contract.test.ts org-admin.integration.test.ts package.json pages.integration.test.ts permissions.integration.test.ts README.md replica-routing.integration.test.ts retention-engine.integration.test.ts scim.integration.test.ts search.integration.test.ts sso.integration.test.ts tsconfig.json vitest.config.ts webhooks.integration.test.ts workspace.integration.test.ts
performance/28
fixtures/1search-100k.ts
helpers/2seed-100k.mjs seed-1k-load.mjs
reports/7api-load-smoke.json database-load-smoke.json editor-local.json realtime-load.json search-full.json search-last.json search-reduced.json
api-load.js api.js archive.tar database-load.js database.js editor-local.mjs extract-100k-env.mjs package.json README.md realtime-1k.js realtime-load.js realtime.js run-realtime-load.sh search-search.k6.js search-summary.json seed-100k.mjs threshold-breach-demo.js verify-zero-op-loss.mjs
security/16
helpers/1app.ts
audit-report.test.ts auth-paths.test.ts deps.test.ts formula-fuzz.test.ts gitleaks-config.test.ts headers.test.ts images.test.ts oracle.ts package.json permission-fuzz.test.ts rate-limits.test.ts README.md tsconfig.json upload-abuse.test.ts vitest.config.ts
README.md
.dockerignore .env .env.bak-task0125 .env.example .eslintrc.json .gitignore .npmrc .prettierignore .prettierrc.json AGENTS.md ARCHITECTURE.md CHANGELOG.md CONTRIBUTING.md gitleaks.toml LICENSE package.json pnpm-lock.yaml pnpm-workspace.yaml PRODUCT-SPEC.md README.md ROADMAP.md SECURITY.md tsconfig.json turbo.json
workbench-DFlGYqou.jstests/e2e/playwright-report/trace/assets/workbench-DFlGYqou.jsraw← assets38,039 B← Back to the app
1import{r as h,j as e,f as O,k as qt,l as Yt,n as Jt,o as St,m as B,T as ot,P as Q,C as Kt,L as Qt,p as Zt,u as dt,q as Ct,G as te,v as ee,w as se,x as ie,y as ne,h as wt,z as ae,A as re,B as ce,N as le,S as Nt,D as oe,E as bt,I as he,F as de}from"./inspectorTab-B4Iw34Ow.js";const yt=new Map;function ue({name:t,rootItem:s,render:i,title:a,icon:u,isError:c,isVisible:r,selectedItem:n,onAccepted:d,onSelected:l,onHighlighted:o,treeState:m,setTreeState:x,noItemsMessage:j,dataTestId:N,autoExpandDepth:y}){const T=h.useMemo(()=>me(s,n,m.expandedItems,y||0,r),[s,n,m,y,r]),C=h.useRef(null),[k,L]=h.useState(),[S,w]=h.useState(!1);h.useEffect(()=>{o==null||o(k)},[o,k]),h.useEffect(()=>{const v=C.current;if(!v)return;const b=()=>{yt.set(t,v.scrollTop)};return v.addEventListener("scroll",b,{passive:!0}),()=>v.removeEventListener("scroll",b)},[t]),h.useEffect(()=>{C.current&&(C.current.scrollTop=yt.get(t)||0)},[t]);const R=h.useCallback(v=>{const{expanded:b}=T.get(v);if(b){for(let M=n;M;M=M.parent)if(M===v){l==null||l(v);break}m.expandedItems.set(v.id,!1)}else m.expandedItems.set(v.id,!0);x({...m})},[T,n,l,m,x]);return e.jsx("div",{className:O("tree-view vbox",t+"-tree-view"),role:"tree","data-testid":N||t+"-tree",children:e.jsxs("div",{className:O("tree-view-content"),tabIndex:0,onKeyDown:v=>{if(n&&v.key==="Enter"){d==null||d(n);return}if(v.key!=="ArrowDown"&&v.key!=="ArrowUp"&&v.key!=="ArrowLeft"&&v.key!=="ArrowRight")return;if(v.stopPropagation(),v.preventDefault(),n&&v.key==="ArrowLeft"){const{expanded:M,parent:p}=T.get(n);M?(m.expandedItems.set(n.id,!1),x({...m})):p&&(l==null||l(p));return}if(n&&v.key==="ArrowRight"){n.children.length&&(m.expandedItems.set(n.id,!0),x({...m}));return}let b=n;if(v.key==="ArrowDown"&&(n?b=T.get(n).next:T.size&&(b=[...T.keys()][0])),v.key==="ArrowUp"){if(n)b=T.get(n).prev;else if(T.size){const M=[...T.keys()];b=M[M.length-1]}}o==null||o(void 0),b&&(w(!0),l==null||l(b)),L(void 0)},ref:C,children:[j&&T.size===0&&e.jsx("div",{className:"tree-view-empty",children:j}),s.children.map(v=>T.get(v)&&e.jsx(Lt,{item:v,treeItems:T,selectedItem:n,onSelected:l,onAccepted:d,isError:c,toggleExpanded:R,highlightedItem:k,setHighlightedItem:L,render:i,icon:u,title:a,isKeyboardNavigation:S,setIsKeyboardNavigation:w},v.id))]})})}function Lt({item:t,treeItems:s,selectedItem:i,onSelected:a,highlightedItem:u,setHighlightedItem:c,isError:r,onAccepted:n,toggleExpanded:d,render:l,title:o,icon:m,isKeyboardNavigation:x,setIsKeyboardNavigation:j}){const N=h.useId(),y=h.useRef(null);h.useEffect(()=>{i===t&&x&&y.current&&(qt(y.current),j(!1))},[t,i,x,j]);const T=s.get(t),C=T.depth,k=T.expanded;let L="codicon-blank";typeof k=="boolean"&&(L=k?"codicon-chevron-down":"codicon-chevron-right");const S=l(t),w=k&&t.children.length?t.children:[],R=o==null?void 0:o(t),v=(m==null?void 0:m(t))||"codicon-blank";return e.jsxs("div",{ref:y,role:"treeitem","aria-selected":t===i,"aria-expanded":k,"aria-controls":N,title:R,className:"vbox",style:{flex:"none"},children:[e.jsxs("div",{onDoubleClick:()=>n==null?void 0:n(t),className:O("tree-view-entry",i===t&&"selected",u===t&&"highlighted",(r==null?void 0:r(t))&&"error"),onClick:()=>a==null?void 0:a(t),onMouseEnter:()=>c(t),onMouseLeave:()=>c(void 0),children:[C?new Array(C).fill(0).map((b,M)=>e.jsx("div",{className:"tree-view-indent"},"indent-"+M)):void 0,e.jsx("div",{"aria-hidden":"true",className:"codicon "+L,style:{minWidth:16,marginRight:4},onDoubleClick:b=>{b.preventDefault(),b.stopPropagation()},onClick:b=>{b.stopPropagation(),b.preventDefault(),d(t)}}),m&&e.jsx("div",{className:"codicon "+v,style:{minWidth:16,marginRight:4},"aria-label":"["+v.replace("codicon","icon")+"]"}),typeof S=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:S}):S]}),!!w.length&&e.jsx("div",{id:N,role:"group",children:w.map(b=>s.get(b)&&e.jsx(Lt,{item:b,treeItems:s,selectedItem:i,onSelected:a,onAccepted:n,isError:r,toggleExpanded:d,highlightedItem:u,setHighlightedItem:c,render:l,title:o,icon:m,isKeyboardNavigation:x,setIsKeyboardNavigation:j},b.id))})]})}function me(t,s,i,a,u=()=>!0){if(!u(t))return new Map;const c=new Map,r=new Set;for(let l=s==null?void 0:s.parent;l;l=l.parent)r.add(l.id);let n=null;const d=(l,o)=>{for(const m of l.children){if(!u(m))continue;const x=r.has(m.id)||i.get(m.id),j=a>o&&c.size<25&&x!==!1,N=m.children.length?x??j:void 0,y={depth:o,expanded:N,parent:t===l?null:l,next:null,prev:n};n&&(c.get(n).next=m),n=m,c.set(m,y),N&&d(m,o+1)}};return d(t,0),c}const xe=ue,fe=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:a,sdkLanguage:u,onSelected:c,onHighlighted:r,revealConsole:n,revealAttachment:d,isLive:l})=>{const[o,m]=h.useState({expandedItems:new Map}),{rootItem:x,itemMap:j}=h.useMemo(()=>Yt(t),[t]),{selectedItem:N}=h.useMemo(()=>({selectedItem:s?j.get(s.callId):void 0}),[j,s]),y=h.useCallback(w=>{var R,v;return!!((v=(R=w.action)==null?void 0:R.error)!=null&&v.message)},[]),T=h.useCallback(w=>a({minimum:w.action.startTime,maximum:w.action.endTime}),[a]),C=h.useCallback(w=>ut(w.action,{sdkLanguage:u,revealConsole:n,revealAttachment:d,isLive:l,showDuration:!0,showBadges:!0}),[l,n,d,u]),k=h.useCallback(w=>!i||!w.action||w.action.startTime<=i.maximum&&w.action.endTime>=i.minimum,[i]),L=h.useCallback(w=>{c==null||c(w.action)},[c]),S=h.useCallback(w=>{r==null||r(w==null?void 0:w.action)},[r]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>a(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(xe,{name:"actions",rootItem:x,treeState:o,setTreeState:m,selectedItem:N,onSelected:L,onHighlighted:S,onAccepted:T,isError:y,isVisible:k,render:C})]})},ut=(t,s)=>{var j;const{sdkLanguage:i,revealConsole:a,revealAttachment:u,isLive:c,showDuration:r,showBadges:n}=s,{errors:d,warnings:l}=Jt(t),o=t.params.selector?St(i||"javascript",t.params.selector):void 0,m=!!((j=t.attachments)!=null&&j.length)&&!!u;let x="";return t.endTime?x=B(t.endTime-t.startTime):t.error?x="Timed out":c||(x="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),o&&e.jsx("div",{className:"action-selector",title:o,children:o}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:pe(t.params.url)})]}),(r||n||m)&&e.jsx("div",{className:"spacer"}),m&&e.jsx(ot,{icon:"attach",title:"Open Attachment",onClick:()=>u(t.attachments[0])}),r&&e.jsx("div",{className:"action-duration",children:x||e.jsx("span",{className:"codicon codicon-loading"})}),n&&e.jsxs("div",{className:"action-icons",onClick:()=>a==null?void 0:a(),children:[!!d&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:d})]}),!!l&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:l})]})]})]})};function pe(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ge=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(Q,{text:"No action selected"});const i={...t.params};delete i.info;const a=Object.keys(i),u=t.startTime+(t.context.wallTime-t.context.startTime),c=new Date(u).toLocaleString(),r=t.endTime?B(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),c&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:c,children:c})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:r,children:r})]})]}),!!a.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!a.length&&a.map((n,d)=>Tt(kt(t,n,i[n],s),"param-"+d)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((n,d)=>Tt(kt(t,n,t.result[n],s),"result-"+d))]})};function Tt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:O("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Kt,{value:t.text})]},s)}function kt(t,s,i,a){const u=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&u)&&(i=et(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&u||s==="received"&&t.method==="expect")&&(i=et(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:St(a||"javascript",t.params.selector),type:"locator",name:"locator"};const c=typeof i;return c!=="object"||i===null?{text:String(i),type:c,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function et(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>et(i,s));if(t.o!==void 0){const i={};for(const{k:a,v:u}of t.o)i[a]=et(u,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const ve=Qt,je=({action:t,isLive:s})=>{const i=h.useMemo(()=>{var r;if(!t||!t.log.length)return[];const a=t.log,u=t.context.wallTime-t.context.startTime,c=[];for(let n=0;n<a.length;++n){let d="";if(a[n].time!==-1){const l=(r=a[n])==null?void 0:r.time;n+1<a.length?d=B(a[n+1].time-l):t.endTime>0?d=B(t.endTime-l):s?d=B(Date.now()-u-l):d="-"}c.push({message:a[n].message,time:d})}return c},[t,s]);return i.length?e.jsx(ve,{name:"log",items:i,render:a=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:a.time}),a.message]}),notSelectable:!0}):e.jsx(Q,{text:"No log entries"})},we=({error:t})=>{const s=h.useMemo(()=>Zt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function Ne(t){return h.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const be=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([a,u])=>{var d;let c,r;const n=(d=u.stack)==null?void 0:d[0];return n&&(c=n.file.replace(/.*[/\\](.*)/,"$1")+":"+n.line,r=n.file+":"+n.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[u.action&&ut(u.action,{sdkLanguage:s}),c&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:r,onClick:()=>i(u),children:c})]})]}),e.jsx(we,{error:a})]},a)})}):e.jsx(Q,{text:"No errors"}),zt={width:200,height:45},q=2.5,ye=zt.height+q*2,Te=({model:t,boundaries:s,previewPoint:i})=>{var o,m;const[a,u]=dt(),c=h.useRef(null);let r=0;if(c.current&&i){const x=c.current.getBoundingClientRect();r=(i.clientY-x.top+c.current.scrollTop)/ye|0}const n=(m=(o=t==null?void 0:t.pages)==null?void 0:o[r])==null?void 0:m.screencastFrames;let d,l;if(i!==void 0&&n&&n.length){const x=s.minimum+(s.maximum-s.minimum)*i.x/a.width;d=n[Ct(n,x,Rt)-1];const j={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};l=d?Dt({width:d.width,height:d.height},j):void 0}return e.jsxs("div",{className:"film-strip",ref:u,children:[e.jsx("div",{className:"film-strip-lanes",ref:c,children:t==null?void 0:t.pages.map((x,j)=>x.screencastFrames.length?e.jsx(ke,{boundaries:s,page:x,width:a.width},j):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:a.bottom+5,left:Math.min(i.x,a.width-(l?l.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:ut(i.action,i)}),d&&l&&e.jsx("div",{style:{width:l.width,height:l.height},children:e.jsx("img",{src:`sha1/${d.sha1}`,width:l.width,height:l.height})})]})]})},ke=({boundaries:t,page:s,width:i})=>{const a={width:0,height:0},u=s.screencastFrames;for(const y of u)a.width=Math.max(a.width,y.width),a.height=Math.max(a.height,y.height);const c=Dt(a,zt),r=u[0].timestamp,n=u[u.length-1].timestamp,d=t.maximum-t.minimum,l=(r-t.minimum)/d*i,o=(t.maximum-n)/d*i,x=(n-r)/d*i/(c.width+2*q)|0,j=(n-r)/x,N=[];for(let y=0;r&&j&&y<x;++y){const T=r+j*y,C=Ct(u,T,Rt)-1;N.push(e.jsx("div",{className:"film-strip-frame",style:{width:c.width,height:c.height,backgroundImage:`url(sha1/${u[C].sha1})`,backgroundSize:`${c.width}px ${c.height}px`,margin:q,marginRight:q}},y))}return N.push(e.jsx("div",{className:"film-strip-frame",style:{width:c.width,height:c.height,backgroundImage:`url(sha1/${u[u.length-1].sha1})`,backgroundSize:`${c.width}px ${c.height}px`,margin:q,marginRight:q}},N.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:l+"px",marginRight:o+"px"},children:N})};function Rt(t,s){return t-s.timestamp}function Dt(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const Me=({model:t,boundaries:s,consoleEntries:i,onSelected:a,highlightedAction:u,highlightedEntry:c,highlightedConsoleEntry:r,selectedTime:n,setSelectedTime:d,sdkLanguage:l})=>{const[o,m]=dt(),[x,j]=h.useState(),[N,y]=h.useState(),{offsets:T,curtainLeft:C,curtainRight:k}=h.useMemo(()=>{let p=n||s;if(x&&x.startX!==x.endX){const W=I(o.width,s,x.startX),P=I(o.width,s,x.endX);p={minimum:Math.min(W,P),maximum:Math.max(W,P)}}const f=A(o.width,s,p.minimum),D=A(o.width,s,s.maximum)-A(o.width,s,p.maximum);return{offsets:Se(o.width,s),curtainLeft:f,curtainRight:D}},[n,s,x,o]),L=h.useMemo(()=>{const p=[];for(const f of(t==null?void 0:t.actions)||[])f.class!=="Test"&&p.push({action:f,leftTime:f.startTime,rightTime:f.endTime||s.maximum,leftPosition:A(o.width,s,f.startTime),rightPosition:A(o.width,s,f.endTime||s.maximum),active:!1,error:!!f.error});for(const f of(t==null?void 0:t.resources)||[]){const z=f._monotonicTime,D=f._monotonicTime+f.time;p.push({resource:f,leftTime:z,rightTime:D,leftPosition:A(o.width,s,z),rightPosition:A(o.width,s,D),active:!1,error:!1})}for(const f of i||[])p.push({consoleMessage:f,leftTime:f.timestamp,rightTime:f.timestamp,leftPosition:A(o.width,s,f.timestamp),rightPosition:A(o.width,s,f.timestamp),active:!1,error:f.isError});return p},[t,i,s,o]);h.useMemo(()=>{for(const p of L)u?p.active=p.action===u:c?p.active=p.resource===c:r?p.active=p.consoleMessage===r:p.active=!1},[L,u,c,r]);const S=h.useCallback(p=>{if(y(void 0),!m.current)return;const f=p.clientX-m.current.getBoundingClientRect().left,z=I(o.width,s,f),D=n?A(o.width,s,n.minimum):0,W=n?A(o.width,s,n.maximum):0;n&&Math.abs(f-D)<10?j({startX:W,endX:f,type:"resize"}):n&&Math.abs(f-W)<10?j({startX:D,endX:f,type:"resize"}):n&&z>n.minimum&&z<n.maximum&&p.clientY-m.current.getBoundingClientRect().top<20?j({startX:D,endX:W,pivot:f,type:"move"}):j({startX:f,endX:f,type:"resize"})},[s,o,m,n]),w=h.useCallback(p=>{if(!m.current)return;const f=p.clientX-m.current.getBoundingClientRect().left,z=I(o.width,s,f),D=t==null?void 0:t.actions.findLast(F=>F.startTime<=z);if(!p.buttons){j(void 0);return}if(D&&a(D),!x)return;let W=x;if(x.type==="resize")W={...x,endX:f};else{const F=f-x.pivot;let X=x.startX+F,$=x.endX+F;X<0&&(X=0,$=X+(x.endX-x.startX)),$>o.width&&($=o.width,X=$-(x.endX-x.startX)),W={...x,startX:X,endX:$,pivot:f}}j(W);const P=I(o.width,s,W.startX),H=I(o.width,s,W.endX);P!==H&&d({minimum:Math.min(P,H),maximum:Math.max(P,H)})},[s,x,o,t,a,m,d]),R=h.useCallback(()=>{if(y(void 0),!!x){if(x.startX!==x.endX){const p=I(o.width,s,x.startX),f=I(o.width,s,x.endX);d({minimum:Math.min(p,f),maximum:Math.max(p,f)})}else{const p=I(o.width,s,x.startX),f=t==null?void 0:t.actions.findLast(z=>z.startTime<=p);f&&a(f),d(void 0)}j(void 0)}},[s,x,o,t,d,a]),v=h.useCallback(p=>{if(!m.current)return;const f=p.clientX-m.current.getBoundingClientRect().left,z=I(o.width,s,f),D=t==null?void 0:t.actions.findLast(W=>W.startTime<=z);y({x:f,clientY:p.clientY,action:D,sdkLanguage:l})},[s,o,t,m,l]),b=h.useCallback(()=>{y(void 0)},[]),M=h.useCallback(()=>{d(void 0)},[d]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!x&&e.jsx(te,{cursor:(x==null?void 0:x.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:w,onPaneDoubleClick:M}),e.jsxs("div",{ref:m,className:"timeline-view",onMouseDown:S,onMouseMove:v,onMouseLeave:b,children:[e.jsx("div",{className:"timeline-grid",children:T.map((p,f)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:B(p.time-s.minimum)})},f))}),e.jsx("div",{style:{height:8}}),e.jsx(Te,{model:t,boundaries:s,previewPoint:N}),e.jsx("div",{className:"timeline-bars",children:L.map((p,f)=>e.jsx("div",{className:O("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Ce(p),bottom:0}},f))}),e.jsx("div",{className:"timeline-marker",style:{display:N!==void 0?"block":"none",left:((N==null?void 0:N.x)||0)+"px"}}),n&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:C}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:k}})]})]})]})};function Se(t,s){let a=t/64;const u=s.maximum-s.minimum,c=t/u;let r=u/a;const n=Math.ceil(Math.log(r)/Math.LN10);r=Math.pow(10,n),r*c>=5*64&&(r=r/5),r*c>=2*64&&(r=r/2);const d=s.minimum;let l=s.maximum;l+=64/c,a=Math.ceil((l-d)/r),r||(a=0);const o=[];for(let m=0;m<a;++m){const x=d+r*m;o.push({position:A(t,s,x),time:x})}return o}function A(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function I(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Ce(t){return t.resource?25:20}const Le=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:B(t.endTime-t.startTime),children:B(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,a)=>{s.onload=i,s.onerror=i})),s}const ht={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
2                    linear-gradient(-45deg, #80808020 25%, transparent 25%),
3                    linear-gradient(45deg, transparent 75%, #80808020 75%),
4                    linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
5              rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
6              rgb(0 0 0 / 10%) 0px -2px 4px,
7              rgb(0 0 0 / 15%) 0px -6.1px 12px,
8              rgb(0 0 0 / 25%) 0px 6px 12px`},ze=({diff:t,noTargetBlank:s,hideDetails:i})=>{const[a,u]=h.useState(t.diff?"diff":"actual"),[c,r]=h.useState(!1),[n,d]=h.useState(null),[l,o]=h.useState("Expected"),[m,x]=h.useState(null),[j,N]=h.useState(null),[y,T]=dt();h.useEffect(()=>{(async()=>{var M,p,f,z;d(await lt((M=t.expected)==null?void 0:M.attachment.path)),o(((p=t.expected)==null?void 0:p.title)||"Expected"),x(await lt((f=t.actual)==null?void 0:f.attachment.path)),N(await lt((z=t.diff)==null?void 0:z.attachment.path))})()},[t]);const C=n&&m&&j,k=C?Math.max(n.naturalWidth,m.naturalWidth,200):500,L=C?Math.max(n.naturalHeight,m.naturalHeight,200):500,S=Math.min(1,(y.width-30)/k),w=Math.min(1,(y.width-50)/k/2),R=k*S,v=L*S,b={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return e.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:T,children:C&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&e.jsx("div",{style:{...b,fontWeight:a==="diff"?600:"initial"},onClick:()=>u("diff"),children:"Diff"}),e.jsx("div",{style:{...b,fontWeight:a==="actual"?600:"initial"},onClick:()=>u("actual"),children:"Actual"}),e.jsx("div",{style:{...b,fontWeight:a==="expected"?600:"initial"},onClick:()=>u("expected"),children:l}),e.jsx("div",{style:{...b,fontWeight:a==="sxs"?600:"initial"},onClick:()=>u("sxs"),children:"Side by side"}),e.jsx("div",{style:{...b,fontWeight:a==="slider"?600:"initial"},onClick:()=>u("slider"),children:"Slider"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:v+60},children:[t.diff&&a==="diff"&&e.jsx(U,{image:j,alt:"Diff",hideSize:i,canvasWidth:R,canvasHeight:v,scale:S}),t.diff&&a==="actual"&&e.jsx(U,{image:m,alt:"Actual",hideSize:i,canvasWidth:R,canvasHeight:v,scale:S}),t.diff&&a==="expected"&&e.jsx(U,{image:n,alt:l,hideSize:i,canvasWidth:R,canvasHeight:v,scale:S}),t.diff&&a==="slider"&&e.jsx(Re,{expectedImage:n,actualImage:m,hideSize:i,canvasWidth:R,canvasHeight:v,scale:S,expectedTitle:l}),t.diff&&a==="sxs"&&e.jsxs("div",{style:{display:"flex"},children:[e.jsx(U,{image:n,title:l,hideSize:i,canvasWidth:w*k,canvasHeight:w*L,scale:w}),e.jsx(U,{image:c?j:m,title:c?"Diff":"Actual",onClick:()=>r(!c),hideSize:i,canvasWidth:w*k,canvasHeight:w*L,scale:w})]}),!t.diff&&a==="actual"&&e.jsx(U,{image:m,title:"Actual",hideSize:i,canvasWidth:R,canvasHeight:v,scale:S}),!t.diff&&a==="expected"&&e.jsx(U,{image:n,title:l,hideSize:i,canvasWidth:R,canvasHeight:v,scale:S}),!t.diff&&a==="sxs"&&e.jsxs("div",{style:{display:"flex"},children:[e.jsx(U,{image:n,title:l,canvasWidth:w*k,canvasHeight:w*L,scale:w}),e.jsx(U,{image:m,title:"Actual",canvasWidth:w*k,canvasHeight:w*L,scale:w})]})]}),!i&&e.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[e.jsx("div",{children:t.diff&&e.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),e.jsx("div",{children:e.jsx("a",{target:s?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),e.jsx("div",{children:e.jsx("a",{target:s?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},Re=({expectedImage:t,actualImage:s,canvasWidth:i,canvasHeight:a,scale:u,expectedTitle:c,hideSize:r})=>{const n={position:"absolute",top:0,left:0},[d,l]=h.useState(i/2),o=t.naturalWidth===s.naturalWidth&&t.naturalHeight===s.naturalHeight;return e.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!r&&e.jsxs("div",{style:{margin:5},children:[!o&&e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),e.jsx("span",{children:t.naturalWidth}),e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),e.jsx("span",{children:t.naturalHeight}),!o&&e.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!o&&e.jsx("span",{children:s.naturalWidth}),!o&&e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!o&&e.jsx("span",{children:s.naturalHeight})]}),e.jsxs("div",{style:{position:"relative",width:i,height:a,margin:15,...ht},children:[e.jsx(ee,{orientation:"horizontal",offsets:[d],setOffsets:m=>l(m[0]),resizerColor:"#57606a80",resizerWidth:6}),e.jsx("img",{alt:c,style:{width:t.naturalWidth*u,height:t.naturalHeight*u},draggable:"false",src:t.src}),e.jsx("div",{style:{...n,bottom:0,overflow:"hidden",width:d,...ht},children:e.jsx("img",{alt:"Actual",style:{width:s.naturalWidth*u,height:s.naturalHeight*u},draggable:"false",src:s.src})})]})]})},U=({image:t,title:s,alt:i,hideSize:a,canvasWidth:u,canvasHeight:c,scale:r,onClick:n})=>e.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!a&&e.jsxs("div",{style:{margin:5},children:[s&&e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:s}),e.jsx("span",{children:t.naturalWidth}),e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),e.jsx("span",{children:t.naturalHeight})]}),e.jsx("div",{style:{display:"flex",flex:"none",width:u,height:c,margin:15,...ht},children:e.jsx("img",{width:t.naturalWidth*r,height:t.naturalHeight*r,alt:s||i,style:{cursor:n?"pointer":"initial"},draggable:"false",src:t.src,onClick:n})})]});function De(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const We=({title:t,children:s,setExpanded:i,expanded:a,expandOnTitleClick:u})=>{const c=h.useId();return e.jsxs("div",{className:O("expandable",a&&"expanded"),children:[e.jsxs("div",{role:"button","aria-expanded":a,"aria-controls":c,className:"expandable-title",onClick:()=>u&&i(!a),children:[e.jsx("div",{className:O("codicon",a?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!u&&i(!a)}),t]}),a&&e.jsx("div",{id:c,role:"region",style:{marginLeft:25},children:s})]})};function Wt(t){const s=[];let i=0,a;for(;(a=se.exec(t))!==null;){const c=t.substring(i,a.index);c&&s.push(c);const r=a[0];s.push(Ae(r)),i=a.index+r.length}const u=t.substring(i);return u&&s.push(u),s}function Ae(t){let s=t;return s.startsWith("www.")&&(s="https://"+s),e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",children:t})}const Ee=({attachment:t,reveal:s,highlight:i})=>{const[a,u]=h.useState(!1),[c,r]=h.useState(null),[n,d]=h.useState(null),l=h.useRef(null),o=De(t.contentType),m=!!t.sha1||!!t.path;h.useEffect(()=>{var N;s&&((N=l.current)==null||N.scrollIntoView({behavior:"smooth"}))},[s]),h.useEffect(()=>{a&&c===null&&n===null&&(d("Loading ..."),fetch(mt(t)).then(N=>N.text()).then(N=>{r(N),d(null)}).catch(N=>{d("Failed to load: "+N.message)}))},[a,c,n,t]);const x=h.useMemo(()=>{const N=c?c.split(`
9`).length:0;return Math.min(Math.max(5,N),20)*ie},[c]),j=e.jsxs("span",{style:{marginLeft:5},ref:l,"aria-label":t.name,children:[e.jsx("span",{className:O(i&&"attachment-title-highlight"),children:Wt(t.name)}),m&&e.jsx("a",{style:{marginLeft:5},href:tt(t),children:"download"})]});return!o||!m?e.jsx("div",{style:{marginLeft:20},children:j}):e.jsxs(e.Fragment,{children:[e.jsx(We,{title:j,expanded:a,setExpanded:u,expandOnTitleClick:!0,children:n&&e.jsx("i",{children:n})}),a&&c!==null&&e.jsx("div",{className:"vbox",style:{height:x},children:e.jsx(ne,{text:c,readOnly:!0,mimeType:t.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},Xe=({model:t,selectedAction:s,revealedAttachment:i})=>{const{diffMap:a,screenshots:u,attachments:c}=h.useMemo(()=>{const r=new Set,n=new Set;for(const l of(t==null?void 0:t.actions)||[]){const o=l.context.traceUrl;for(const m of l.attachments||[])r.add({...m,traceUrl:o})}const d=new Map;for(const l of r){if(!l.path&&!l.sha1)continue;const o=l.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(o){const m=o[1],x=o[2],j=d.get(m)||{expected:void 0,actual:void 0,diff:void 0};j[x]=l,d.set(m,j),r.delete(l)}else l.contentType.startsWith("image/")&&(n.add(l),r.delete(l))}return{diffMap:d,attachments:r,screenshots:n}},[t]);return!a.size&&!u.size&&!c.size?e.jsx(Q,{text:"No attachments"}):e.jsxs("div",{className:"attachments-tab",children:[[...a.values()].map(({expected:r,actual:n,diff:d})=>e.jsxs(e.Fragment,{children:[r&&n&&e.jsx("div",{className:"attachments-section",children:"Image diff"}),r&&n&&e.jsx(ze,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...r,path:tt(r)},title:"Expected"},actual:{attachment:{...n,path:tt(n)}},diff:d?{attachment:{...d,path:tt(d)}}:void 0}})]})),u.size?e.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...u.values()].map((r,n)=>{const d=mt(r);return e.jsxs("div",{className:"attachment-item",children:[e.jsx("div",{children:e.jsx("img",{draggable:"false",src:d})}),e.jsx("div",{children:e.jsx("a",{target:"_blank",href:d,rel:"noreferrer",children:r.name})})]},`screenshot-${n}`)}),c.size?e.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...c.values()].map((r,n)=>{var d;return e.jsx("div",{className:"attachment-item",children:e.jsx(Ee,{attachment:r,highlight:((d=s==null?void 0:s.attachments)==null?void 0:d.some(l=>Mt(r,l)))??!1,reveal:!!i&&Mt(r,i)})},Ie(r,n))})]})};function Mt(t,s){return t.name===s.name&&t.path===s.path&&t.sha1===s.sha1}function mt(t,s={}){const i=new URLSearchParams(s);return t.sha1?(i.set("trace",t.traceUrl),"sha1/"+t.sha1+"?"+i.toString()):(i.set("path",t.path),"file?"+i.toString())}function tt(t){const s={dn:t.name};return t.contentType&&(s.dct=t.contentType),mt(t,s)}function Ie(t,s){return s+"-"+(t.sha1?"sha1-"+t.sha1:"path-"+t.path)}const Pe=({annotations:t})=>t.length?e.jsx("div",{className:"annotations-tab",children:t.map((s,i)=>e.jsxs("div",{className:"annotation-item",children:[e.jsx("span",{style:{fontWeight:"bold"},children:s.type}),s.description&&e.jsxs("span",{children:[": ",Wt(s.description)]})]},`annotation-${i}`))}):e.jsx(Q,{text:"No annotations"});function He(t){return t==="scheduled"?"codicon-clock":t==="running"?"codicon-loading":t==="failed"?"codicon-error":t==="passed"?"codicon-check":t==="skipped"?"codicon-circle-slash":"codicon-circle-outline"}function Fe(t){return t==="scheduled"?"Pending":t==="running"?"Running":t==="failed"?"Failed":t==="passed"?"Passed":t==="skipped"?"Skipped":"Did not run"}const Be=({model:t,showSourcesFirst:s,rootDir:i,fallbackLocation:a,isLive:u,hideTimeline:c,status:r,annotations:n,inert:d,openPage:l,onOpenExternally:o,revealSource:m})=>{var jt;const[x,j]=h.useState(void 0),[N,y]=h.useState(void 0),[T,C]=h.useState(void 0),[k,L]=h.useState(),[S,w]=h.useState(),[R,v]=h.useState(),[b,M]=h.useState("actions"),[p,f]=wt("propertiesTab",s?"source":"call"),[z,D]=h.useState(!1),[W,P]=h.useState(""),[H,F]=h.useState(),[X,$]=wt("propertiesSidebarLocation","bottom"),st=h.useCallback(g=>{j(g==null?void 0:g.callId),y(void 0)},[]),it=h.useMemo(()=>t==null?void 0:t.actions.find(g=>g.callId===k),[t,k]),nt=h.useCallback(g=>{L(g==null?void 0:g.callId)},[]),At=h.useMemo(()=>(t==null?void 0:t.sources)||new Map,[t]);h.useEffect(()=>{F(void 0),y(void 0)},[t]);const Y=h.useMemo(()=>{if(x){const K=t==null?void 0:t.actions.find(_=>_.callId===x);if(K)return K}const g=t==null?void 0:t.failedAction();if(g)return g;if(t!=null&&t.actions.length){let K=t.actions.length-1;for(let _=0;_<t.actions.length;++_)if(t.actions[_].apiName==="After Hooks"&&_){K=_-1;break}return t.actions[K]}},[t,x]),V=h.useMemo(()=>it||Y,[Y,it]),Et=h.useMemo(()=>N?N.stack:V==null?void 0:V.stack,[V,N]),xt=h.useCallback(g=>{st(g),nt(void 0)},[st,nt]),E=h.useCallback(g=>{f(g),g!=="inspector"&&D(!1)},[f]),ft=h.useCallback(g=>{!z&&g&&E("inspector"),D(g)},[D,E,z]),Xt=h.useCallback(g=>{P(g),E("inspector")},[E]),It=h.useCallback(g=>{E("attachments"),C(g)},[E]);h.useEffect(()=>{m&&E("source")},[m,E]);const at=ae(t,H),pt=re(t,H),gt=Ne(t),Pt=h.useMemo(()=>(t==null?void 0:t.actions.map(g=>g.attachments||[]).flat())||[],[t]),G=(t==null?void 0:t.sdkLanguage)||"javascript",Ht={id:"inspector",title:"Locator",render:()=>e.jsx(he,{sdkLanguage:G,setIsInspecting:ft,highlightedLocator:W,setHighlightedLocator:P})},Ft={id:"call",title:"Call",render:()=>e.jsx(ge,{action:V,sdkLanguage:G})},Ut={id:"log",title:"Log",render:()=>e.jsx(je,{action:V,isLive:u})},Bt={id:"errors",title:"Errors",errorCount:gt.errors.size,render:()=>e.jsx(be,{errorsModel:gt,sdkLanguage:G,revealInSource:g=>{g.action?st(g.action):y(g),E("source")}})};let vt;!Y&&a&&(vt=(jt=a.source)==null?void 0:jt.errors.length);const rt={id:"source",title:"Source",errorCount:vt,render:()=>e.jsx(de,{stack:Et,sources:At,rootDir:i,stackFrameLocation:X==="bottom"?"right":"bottom",fallbackLocation:a,onOpenExternally:o})},Ot={id:"console",title:"Console",count:at.entries.length,render:()=>e.jsx(ce,{consoleModel:at,boundaries:ct,selectedTime:H,onAccepted:g=>F({minimum:g.timestamp,maximum:g.timestamp}),onEntryHovered:v})},$t={id:"network",title:"Network",count:pt.resources.length,render:()=>e.jsx(le,{boundaries:ct,networkModel:pt,onEntryHovered:w})},Vt={id:"attachments",title:"Attachments",count:Pt.length,render:()=>e.jsx(Xe,{model:t,selectedAction:Y,revealedAttachment:T})},J=[Ht,Ft,Ut,Bt,Ot,$t,rt,Vt];if(n!==void 0){const g={id:"annotations",title:"Annotations",count:n.length,render:()=>e.jsx(Pe,{annotations:n})};J.push(g)}if(s){const g=J.indexOf(rt);J.splice(g,1),J.splice(1,0,rt)}const{boundaries:ct}=h.useMemo(()=>{const g={minimum:(t==null?void 0:t.startTime)||0,maximum:(t==null?void 0:t.endTime)||3e4};return g.minimum>g.maximum&&(g.minimum=0,g.maximum=3e4),g.maximum+=(g.maximum-g.minimum)/20,{boundaries:g}},[t]);let Z=0;!u&&t&&t.endTime>=0?Z=t.endTime-t.startTime:t&&t.wallTime&&(Z=Date.now()-t.wallTime);const _t={id:"actions",title:"Actions",component:e.jsxs("div",{className:"vbox",children:[r&&e.jsxs("div",{className:"workbench-run-status",children:[e.jsx("span",{className:O("codicon",He(r))}),e.jsx("div",{children:Fe(r)}),e.jsx("div",{className:"spacer"}),e.jsx("div",{className:"workbench-run-duration",children:Z?B(Z):""})]}),e.jsx(fe,{sdkLanguage:G,actions:(t==null?void 0:t.actions)||[],selectedAction:t?Y:void 0,selectedTime:H,setSelectedTime:F,onSelected:xt,onHighlighted:nt,revealAttachment:It,revealConsole:()=>E("console"),isLive:u})]})},Gt={id:"metadata",title:"Metadata",component:e.jsx(Le,{model:t})};return e.jsxs("div",{className:"vbox workbench",...d?{inert:"true"}:{},children:[!c&&e.jsx(Me,{model:t,consoleEntries:at.entries,boundaries:ct,highlightedAction:it,highlightedEntry:S,highlightedConsoleEntry:R,onSelected:xt,sdkLanguage:G,selectedTime:H,setSelectedTime:F}),e.jsx(Nt,{sidebarSize:250,orientation:X==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:e.jsx(Nt,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:e.jsx(oe,{action:V,model:t,sdkLanguage:G,testIdAttributeName:(t==null?void 0:t.testIdAttributeName)||"data-testid",isInspecting:z,setIsInspecting:ft,highlightedLocator:W,setHighlightedLocator:Xt,openPage:l}),sidebar:e.jsx(bt,{tabs:[_t,Gt],selectedTab:b,setSelectedTab:M})}),sidebar:e.jsx(bt,{tabs:J,selectedTab:p,setSelectedTab:E,rightToolbar:[X==="bottom"?e.jsx(ot,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{$("right")}}):e.jsx(ot,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{$("bottom")}})],mode:X==="bottom"?"default":"select"})})]})};export{We as E,ue as T,Be as W,He as t};
10