studiograph 1.3.48-next.13 → 1.3.48-next.130
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 +7 -7
- package/dist/agent/agent-pool.d.ts +14 -1
- package/dist/agent/agent-pool.js +37 -12
- package/dist/agent/agent-pool.js.map +1 -1
- package/dist/agent/followups.d.ts +34 -0
- package/dist/agent/followups.js +52 -0
- package/dist/agent/followups.js.map +1 -0
- package/dist/agent/orchestrator.d.ts +29 -2
- package/dist/agent/orchestrator.js +239 -38
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/prompts/entity-types-section.d.ts +30 -0
- package/dist/agent/prompts/entity-types-section.js +83 -0
- package/dist/agent/prompts/entity-types-section.js.map +1 -0
- package/dist/agent/prompts/system.md +106 -47
- package/dist/agent/skill-loader.d.ts +30 -17
- package/dist/agent/skill-loader.js +63 -30
- package/dist/agent/skill-loader.js.map +1 -1
- package/dist/agent/skills/entity-schema.md +79 -343
- package/dist/agent/skills/interview/entity-templates.md +38 -37
- package/dist/agent/skills/interview/question-domains.md +54 -49
- package/dist/agent/skills/interview/skill.md +89 -14
- package/dist/agent/tools/capture-tools.d.ts +31 -0
- package/dist/agent/tools/capture-tools.js +40 -0
- package/dist/agent/tools/capture-tools.js.map +1 -0
- package/dist/agent/tools/folder-tools.d.ts +47 -0
- package/dist/agent/tools/folder-tools.js +249 -0
- package/dist/agent/tools/folder-tools.js.map +1 -0
- package/dist/agent/tools/fs-tools.d.ts +6 -5
- package/dist/agent/tools/fs-tools.js +5 -5
- package/dist/agent/tools/fs-tools.js.map +1 -1
- package/dist/agent/tools/graph-tools.d.ts +25 -72
- package/dist/agent/tools/graph-tools.js +362 -366
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/history-tools.d.ts +95 -0
- package/dist/agent/tools/history-tools.js +461 -0
- package/dist/agent/tools/history-tools.js.map +1 -0
- package/dist/agent/tools/load-skill.d.ts +6 -5
- package/dist/agent/tools/load-skill.js +3 -3
- package/dist/agent/tools/load-skill.js.map +1 -1
- package/dist/agent/tools/message-tools.d.ts +13 -11
- package/dist/agent/tools/message-tools.js +31 -39
- package/dist/agent/tools/message-tools.js.map +1 -1
- package/dist/agent/tools/ops-tools.d.ts +5 -4
- package/dist/agent/tools/ops-tools.js +99 -212
- package/dist/agent/tools/ops-tools.js.map +1 -1
- package/dist/agent/tools/permission-tools.d.ts +39 -16
- package/dist/agent/tools/permission-tools.js +66 -41
- package/dist/agent/tools/permission-tools.js.map +1 -1
- package/dist/agent/tools/tool-loader.js +5 -4
- package/dist/agent/tools/tool-loader.js.map +1 -1
- package/dist/agent/tools/web-tools.js +58 -9
- package/dist/agent/tools/web-tools.js.map +1 -1
- package/dist/cli/commands/about.d.ts +1 -0
- package/dist/cli/commands/about.js +55 -3
- package/dist/cli/commands/about.js.map +1 -1
- package/dist/cli/commands/audit.d.ts +21 -0
- package/dist/cli/commands/audit.js +174 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/clear.d.ts +5 -0
- package/dist/cli/commands/clear.js +144 -1
- package/dist/cli/commands/clear.js.map +1 -1
- package/dist/cli/commands/clone.d.ts +1 -1
- package/dist/cli/commands/clone.js +47 -12
- package/dist/cli/commands/clone.js.map +1 -1
- package/dist/cli/commands/deploy.js +79 -18
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/folder.d.ts +11 -0
- package/dist/cli/commands/folder.js +186 -0
- package/dist/cli/commands/folder.js.map +1 -0
- package/dist/cli/commands/index.js +2 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +16 -14
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.d.ts +1 -1
- package/dist/cli/commands/join.js +26 -14
- package/dist/cli/commands/join.js.map +1 -1
- package/dist/cli/commands/mcp.js +12 -4
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/r2.d.ts +3 -0
- package/dist/cli/commands/r2.js +196 -1
- package/dist/cli/commands/r2.js.map +1 -1
- package/dist/cli/commands/redeploy.js +41 -1
- package/dist/cli/commands/redeploy.js.map +1 -1
- package/dist/cli/commands/secrets.d.ts +23 -0
- package/dist/cli/commands/secrets.js +256 -0
- package/dist/cli/commands/secrets.js.map +1 -0
- package/dist/cli/commands/serve.js +143 -24
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/start.js +140 -71
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/sync.d.ts +1 -1
- package/dist/cli/commands/sync.js +509 -163
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/commands/user.js +8 -24
- package/dist/cli/commands/user.js.map +1 -1
- package/dist/cli/index.js +8 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/railway-provisioning.d.ts +53 -0
- package/dist/cli/railway-provisioning.js +85 -0
- package/dist/cli/railway-provisioning.js.map +1 -0
- package/dist/cli/scaffolding.d.ts +4 -2
- package/dist/cli/scaffolding.js +42 -47
- package/dist/cli/scaffolding.js.map +1 -1
- package/dist/cli/setup-wizard.d.ts +30 -49
- package/dist/cli/setup-wizard.js +35 -38
- package/dist/cli/setup-wizard.js.map +1 -1
- package/dist/core/accent-palette.d.ts +22 -0
- package/dist/core/accent-palette.js +47 -0
- package/dist/core/accent-palette.js.map +1 -0
- package/dist/core/entity-body-templates.d.ts +21 -0
- package/dist/core/entity-body-templates.js +48 -0
- package/dist/core/entity-body-templates.js.map +1 -0
- package/dist/core/entity-types-catalog.d.ts +65 -0
- package/dist/core/entity-types-catalog.js +136 -0
- package/dist/core/entity-types-catalog.js.map +1 -0
- package/dist/core/feature-flags.d.ts +22 -0
- package/dist/core/feature-flags.js +15 -0
- package/dist/core/feature-flags.js.map +1 -0
- package/dist/core/features.d.ts +16 -0
- package/dist/core/features.js +48 -0
- package/dist/core/features.js.map +1 -0
- package/dist/core/folder-paths.d.ts +41 -0
- package/dist/core/folder-paths.js +95 -0
- package/dist/core/folder-paths.js.map +1 -0
- package/dist/core/folder-sidecar.d.ts +16 -0
- package/dist/core/folder-sidecar.js +45 -0
- package/dist/core/folder-sidecar.js.map +1 -0
- package/dist/core/graph.d.ts +471 -19
- package/dist/core/graph.js +1411 -284
- package/dist/core/graph.js.map +1 -1
- package/dist/core/schema-registry.js +1 -19
- package/dist/core/schema-registry.js.map +1 -1
- package/dist/core/schemas/connector.d.ts +67 -0
- package/dist/core/schemas/connector.js +100 -0
- package/dist/core/schemas/connector.js.map +1 -0
- package/dist/core/schemas/workspace.d.ts +122 -0
- package/dist/core/schemas/workspace.js +211 -0
- package/dist/core/schemas/workspace.js.map +1 -0
- package/dist/core/secrets/SecretStore.d.ts +77 -0
- package/dist/core/secrets/SecretStore.js +13 -0
- package/dist/core/secrets/SecretStore.js.map +1 -0
- package/dist/core/secrets/SettingsResolver.d.ts +54 -0
- package/dist/core/secrets/SettingsResolver.js +80 -0
- package/dist/core/secrets/SettingsResolver.js.map +1 -0
- package/dist/core/secrets/SettingsStore.d.ts +30 -0
- package/dist/core/secrets/SettingsStore.js +9 -0
- package/dist/core/secrets/SettingsStore.js.map +1 -0
- package/dist/core/secrets/SqliteEncryptedStore.d.ts +78 -0
- package/dist/core/secrets/SqliteEncryptedStore.js +581 -0
- package/dist/core/secrets/SqliteEncryptedStore.js.map +1 -0
- package/dist/core/secrets/audit.d.ts +36 -0
- package/dist/core/secrets/audit.js +60 -0
- package/dist/core/secrets/audit.js.map +1 -0
- package/dist/core/secrets/auth-db-migration.d.ts +129 -0
- package/dist/core/secrets/auth-db-migration.js +653 -0
- package/dist/core/secrets/auth-db-migration.js.map +1 -0
- package/dist/core/secrets/bundle.d.ts +141 -0
- package/dist/core/secrets/bundle.js +435 -0
- package/dist/core/secrets/bundle.js.map +1 -0
- package/dist/core/secrets/dual-write.d.ts +76 -0
- package/dist/core/secrets/dual-write.js +236 -0
- package/dist/core/secrets/dual-write.js.map +1 -0
- package/dist/core/secrets/encryption.d.ts +44 -0
- package/dist/core/secrets/encryption.js +97 -0
- package/dist/core/secrets/encryption.js.map +1 -0
- package/dist/core/secrets/importer.d.ts +94 -0
- package/dist/core/secrets/importer.js +319 -0
- package/dist/core/secrets/importer.js.map +1 -0
- package/dist/core/secrets/index.d.ts +35 -0
- package/dist/core/secrets/index.js +59 -0
- package/dist/core/secrets/index.js.map +1 -0
- package/dist/core/secrets/master-key.d.ts +38 -0
- package/dist/core/secrets/master-key.js +122 -0
- package/dist/core/secrets/master-key.js.map +1 -0
- package/dist/core/secrets/probes/anthropic.d.ts +98 -0
- package/dist/core/secrets/probes/anthropic.js +300 -0
- package/dist/core/secrets/probes/anthropic.js.map +1 -0
- package/dist/core/secrets/probes/brave.d.ts +9 -0
- package/dist/core/secrets/probes/brave.js +15 -0
- package/dist/core/secrets/probes/brave.js.map +1 -0
- package/dist/core/secrets/probes/r2.d.ts +15 -0
- package/dist/core/secrets/probes/r2.js +14 -0
- package/dist/core/secrets/probes/r2.js.map +1 -0
- package/dist/core/secrets/probes/voyage.d.ts +13 -0
- package/dist/core/secrets/probes/voyage.js +52 -0
- package/dist/core/secrets/probes/voyage.js.map +1 -0
- package/dist/core/secrets/read-flip.d.ts +59 -0
- package/dist/core/secrets/read-flip.js +87 -0
- package/dist/core/secrets/read-flip.js.map +1 -0
- package/dist/core/secrets/registry.d.ts +188 -0
- package/dist/core/secrets/registry.js +539 -0
- package/dist/core/secrets/registry.js.map +1 -0
- package/dist/core/types.d.ts +70 -483
- package/dist/core/types.js +6 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-config.d.ts +52 -12
- package/dist/core/user-config.js +119 -14
- package/dist/core/user-config.js.map +1 -1
- package/dist/core/validation.d.ts +603 -1409
- package/dist/core/validation.js +248 -146
- package/dist/core/validation.js.map +1 -1
- package/dist/core/workspace-manager.d.ts +35 -14
- package/dist/core/workspace-manager.js +105 -56
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/core/workspace.d.ts +19 -5
- package/dist/core/workspace.js +66 -39
- package/dist/core/workspace.js.map +1 -1
- package/dist/mcp/connector-manager.d.ts +16 -1
- package/dist/mcp/connector-manager.js +44 -5
- package/dist/mcp/connector-manager.js.map +1 -1
- package/dist/mcp/server.d.ts +11 -3
- package/dist/mcp/server.js +30 -5
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +27 -2
- package/dist/mcp/tools.js +544 -113
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/__tests__/helpers/graph-api.d.ts +18 -0
- package/dist/server/__tests__/helpers/graph-api.js +16 -0
- package/dist/server/__tests__/helpers/graph-api.js.map +1 -0
- package/dist/server/commit-audit.d.ts +26 -0
- package/dist/server/commit-audit.js +30 -0
- package/dist/server/commit-audit.js.map +1 -0
- package/dist/server/index.d.ts +14 -3
- package/dist/server/index.js +388 -177
- package/dist/server/index.js.map +1 -1
- package/dist/server/middleware/sanitize.d.ts +46 -0
- package/dist/server/middleware/sanitize.js +171 -0
- package/dist/server/middleware/sanitize.js.map +1 -0
- package/dist/server/routes/asset-api.js +217 -65
- package/dist/server/routes/asset-api.js.map +1 -1
- package/dist/server/routes/audit-api.d.ts +24 -0
- package/dist/server/routes/audit-api.js +117 -0
- package/dist/server/routes/audit-api.js.map +1 -0
- package/dist/server/routes/auth-api.js +220 -44
- package/dist/server/routes/auth-api.js.map +1 -1
- package/dist/server/routes/capture-api.d.ts +10 -3
- package/dist/server/routes/capture-api.js +180 -24
- package/dist/server/routes/capture-api.js.map +1 -1
- package/dist/server/routes/chat.d.ts +4 -1
- package/dist/server/routes/chat.js +178 -46
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/config-api.d.ts +21 -0
- package/dist/server/routes/config-api.js +256 -0
- package/dist/server/routes/config-api.js.map +1 -0
- package/dist/server/routes/connectors-api.js +24 -18
- package/dist/server/routes/connectors-api.js.map +1 -1
- package/dist/server/routes/event-ingest-api.d.ts +15 -0
- package/dist/server/routes/event-ingest-api.js +125 -0
- package/dist/server/routes/event-ingest-api.js.map +1 -0
- package/dist/server/routes/features-api.d.ts +19 -0
- package/dist/server/routes/features-api.js +28 -0
- package/dist/server/routes/features-api.js.map +1 -0
- package/dist/server/routes/git-http.d.ts +2 -2
- package/dist/server/routes/git-http.js +69 -34
- package/dist/server/routes/git-http.js.map +1 -1
- package/dist/server/routes/graph-api-access.d.ts +35 -0
- package/dist/server/routes/graph-api-access.js +93 -0
- package/dist/server/routes/graph-api-access.js.map +1 -0
- package/dist/server/routes/graph-api.d.ts +3 -2
- package/dist/server/routes/graph-api.js +1014 -315
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/health.d.ts +18 -0
- package/dist/server/routes/health.js +74 -0
- package/dist/server/routes/health.js.map +1 -0
- package/dist/server/routes/insights-api.js +156 -33
- package/dist/server/routes/insights-api.js.map +1 -1
- package/dist/server/routes/mcp.d.ts +6 -3
- package/dist/server/routes/mcp.js +22 -6
- package/dist/server/routes/mcp.js.map +1 -1
- package/dist/server/routes/messages-api.d.ts +3 -3
- package/dist/server/routes/messages-api.js +308 -120
- package/dist/server/routes/messages-api.js.map +1 -1
- package/dist/server/routes/permissions-api.d.ts +9 -2
- package/dist/server/routes/permissions-api.js +87 -31
- package/dist/server/routes/permissions-api.js.map +1 -1
- package/dist/server/routes/secrets-api.d.ts +36 -0
- package/dist/server/routes/secrets-api.js +303 -0
- package/dist/server/routes/secrets-api.js.map +1 -0
- package/dist/server/routes/settings-api.d.ts +29 -0
- package/dist/server/routes/settings-api.js +177 -0
- package/dist/server/routes/settings-api.js.map +1 -0
- package/dist/server/routes/workspace-api.d.ts +2 -1
- package/dist/server/routes/workspace-api.js +131 -20
- package/dist/server/routes/workspace-api.js.map +1 -1
- package/dist/server/routes/ws.d.ts +3 -2
- package/dist/server/routes/ws.js +68 -18
- package/dist/server/routes/ws.js.map +1 -1
- package/dist/server/session-manager.d.ts +48 -5
- package/dist/server/session-manager.js +175 -11
- package/dist/server/session-manager.js.map +1 -1
- package/dist/server/ws-hub.d.ts +134 -22
- package/dist/server/ws-hub.js +0 -0
- package/dist/server/ws-hub.js.map +1 -1
- package/dist/server/yjs-manager.d.ts +107 -7
- package/dist/server/yjs-manager.js +444 -38
- package/dist/server/yjs-manager.js.map +1 -1
- package/dist/server/yjs-persistence.d.ts +143 -0
- package/dist/server/yjs-persistence.js +543 -0
- package/dist/server/yjs-persistence.js.map +1 -0
- package/dist/server/yjs-text-diff.d.ts +32 -0
- package/dist/server/yjs-text-diff.js +61 -0
- package/dist/server/yjs-text-diff.js.map +1 -0
- package/dist/services/access-control.d.ts +53 -0
- package/dist/services/access-control.js +132 -0
- package/dist/services/access-control.js.map +1 -0
- package/dist/services/asset-upload-service.d.ts +53 -0
- package/dist/services/asset-upload-service.js +200 -0
- package/dist/services/asset-upload-service.js.map +1 -0
- package/dist/services/assets/base.d.ts +38 -0
- package/dist/services/assets/base.js +55 -0
- package/dist/services/assets/base.js.map +1 -1
- package/dist/services/assets/index.d.ts +41 -1
- package/dist/services/assets/index.js +65 -0
- package/dist/services/assets/index.js.map +1 -1
- package/dist/services/assets/local.d.ts +7 -1
- package/dist/services/assets/local.js +83 -0
- package/dist/services/assets/local.js.map +1 -1
- package/dist/services/assets/r2.d.ts +28 -1
- package/dist/services/assets/r2.js +75 -1
- package/dist/services/assets/r2.js.map +1 -1
- package/dist/services/auth-service.d.ts +184 -36
- package/dist/services/auth-service.js +763 -138
- package/dist/services/auth-service.js.map +1 -1
- package/dist/services/briefing.d.ts +1 -1
- package/dist/services/briefing.js +12 -35
- package/dist/services/briefing.js.map +1 -1
- package/dist/services/event-processor.d.ts +104 -0
- package/dist/services/event-processor.js +443 -0
- package/dist/services/event-processor.js.map +1 -0
- package/dist/services/folder-creation.d.ts +33 -0
- package/dist/services/folder-creation.js +103 -0
- package/dist/services/folder-creation.js.map +1 -0
- package/dist/services/git.d.ts +44 -0
- package/dist/services/git.js +162 -55
- package/dist/services/git.js.map +1 -1
- package/dist/services/heartbeat.d.ts +19 -12
- package/dist/services/heartbeat.js +162 -107
- package/dist/services/heartbeat.js.map +1 -1
- package/dist/services/import-service.d.ts +37 -2
- package/dist/services/import-service.js +222 -123
- package/dist/services/import-service.js.map +1 -1
- package/dist/services/lint-service.js +7 -14
- package/dist/services/lint-service.js.map +1 -1
- package/dist/services/markdown.js +6 -2
- package/dist/services/markdown.js.map +1 -1
- package/dist/services/message-service.d.ts +62 -21
- package/dist/services/message-service.js +160 -43
- package/dist/services/message-service.js.map +1 -1
- package/dist/services/personal-folder.d.ts +40 -0
- package/dist/services/personal-folder.js +101 -0
- package/dist/services/personal-folder.js.map +1 -0
- package/dist/services/vector-service.d.ts +73 -3
- package/dist/services/vector-service.js +106 -7
- package/dist/services/vector-service.js.map +1 -1
- package/dist/services/workspace-access.d.ts +106 -0
- package/dist/services/workspace-access.js +149 -0
- package/dist/services/workspace-access.js.map +1 -0
- package/dist/utils/git.js +3 -3
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/log.d.ts +42 -0
- package/dist/utils/log.js +137 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/preflight.js +2 -2
- package/dist/utils/preflight.js.map +1 -1
- package/dist/utils/version-checker.d.ts +4 -1
- package/dist/utils/version-checker.js +8 -8
- package/dist/utils/version-checker.js.map +1 -1
- package/dist/web/_app/immutable/assets/0.Bp6xXZUi.css +2 -0
- package/dist/web/_app/immutable/assets/11.DlIf1mKh.css +1 -0
- package/dist/web/_app/immutable/assets/12.Dmlt28l2.css +1 -0
- package/dist/web/_app/immutable/assets/13.CmLrbzZp.css +1 -0
- package/dist/web/_app/immutable/assets/2.oo1ac0x_.css +1 -0
- package/dist/web/_app/immutable/assets/3.DJJsQzDb.css +1 -0
- package/dist/web/_app/immutable/assets/4.CZ-fNJ91.css +1 -0
- package/dist/web/_app/immutable/assets/AgentOverlay.BfWESlQU.css +1 -0
- package/dist/web/_app/immutable/assets/AssetManagerModal.ZfasE2L3.css +1 -0
- package/dist/web/_app/immutable/assets/CalendarView.CeNagvyK.css +1 -0
- package/dist/web/_app/immutable/assets/ChatPanel.po0gYtVH.css +1 -0
- package/dist/web/_app/immutable/assets/FolderMembersPanel.Bepw-r0F.css +1 -0
- package/dist/web/_app/immutable/assets/FolderMutationDialogs.BMRF6Z3z.css +1 -0
- package/dist/web/_app/immutable/assets/FolderPicker.B5KdvRYl.css +1 -0
- package/dist/web/_app/immutable/assets/GalleryView.Dy-qQjEc.css +1 -0
- package/dist/web/_app/immutable/assets/GraphView.BHnGIltS.css +1 -0
- package/dist/web/_app/immutable/assets/KanbanView.G3NZ0uHb.css +1 -0
- package/dist/web/_app/immutable/assets/SettingsDialog.tBn8y9DD.css +1 -0
- package/dist/web/_app/immutable/assets/Spinner.UBfl0pab.css +1 -0
- package/dist/web/_app/immutable/assets/TagFilter.DNipjifq.css +1 -0
- package/dist/web/_app/immutable/assets/TagPickerSheet.DJPuqnTg.css +1 -0
- package/dist/web/_app/immutable/assets/WorkspaceView.B9zA92UB.css +1 -0
- package/dist/web/_app/immutable/assets/button.BlLm4Dg1.css +1 -0
- package/dist/web/_app/immutable/assets/dialog.BxVal_19.css +1 -0
- package/dist/web/_app/immutable/assets/dist.B5hGjnfj.css +1 -0
- package/dist/web/_app/immutable/assets/dist.DDCWxn3B.css +1 -0
- package/dist/web/_app/immutable/assets/dropdown-menu.BSsUUQ3o.css +1 -0
- package/dist/web/_app/immutable/assets/entity-row.Bl5FyNCt.css +1 -0
- package/dist/web/_app/immutable/assets/greeting.Bm7lTneV.css +1 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.CvHOgSBP.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.DMJ8VG8y.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.CB9ihrfo.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.DSY6xOcd.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CZTNEAuW.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CsGl1sm0.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CDDApCn2.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CYLoc0-x.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.BNK2_mGO.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.DpEwFAQM.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.6ng42L7E.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.BgVn5rGT.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.Cu4Hd6ag.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.CuJfVYMP.woff2 +0 -0
- package/dist/web/_app/immutable/assets/inline-list.DORLo4xF.css +1 -0
- package/dist/web/_app/immutable/assets/notifications.clodJdp5.css +1 -0
- package/dist/web/_app/immutable/assets/radio-group.GJJRVPUJ.css +1 -0
- package/dist/web/_app/immutable/assets/select.D_AV992j.css +1 -0
- package/dist/web/_app/immutable/chunks/-KAQXGuI2.js +1 -0
- package/dist/web/_app/immutable/chunks/-wzwcH00.js +1 -0
- package/dist/web/_app/immutable/chunks/07l_1Zpm2.js +1 -0
- package/dist/web/_app/immutable/chunks/1i1V0Z172.js +2 -0
- package/dist/web/_app/immutable/chunks/38oWKNzM2.js +6 -0
- package/dist/web/_app/immutable/chunks/54VmiJfH.js +1 -0
- package/dist/web/_app/immutable/chunks/6LRpFvjo.js +185 -0
- package/dist/web/_app/immutable/chunks/9bCTHkeS.js +1 -0
- package/dist/web/_app/immutable/chunks/B-822WnD2.js +22 -0
- package/dist/web/_app/immutable/chunks/B0HUvliX2.js +2 -0
- package/dist/web/_app/immutable/chunks/B12eXGpE.js +1 -0
- package/dist/web/_app/immutable/chunks/B2-Cx5XA.js +1 -0
- package/dist/web/_app/immutable/chunks/B5af0X0p2.js +1 -0
- package/dist/web/_app/immutable/chunks/B6iYNwo72.js +1 -0
- package/dist/web/_app/immutable/chunks/B7EMtoAB.js +1 -0
- package/dist/web/_app/immutable/chunks/B9qBGxh62.js +3 -0
- package/dist/web/_app/immutable/chunks/B9rVXblv.js +1 -0
- package/dist/web/_app/immutable/chunks/BEpMEjHO.js +1 -0
- package/dist/web/_app/immutable/chunks/BErNpj-S2.js +1 -0
- package/dist/web/_app/immutable/chunks/BHBk4zfV.js +1 -0
- package/dist/web/_app/immutable/chunks/BHH-JGNF.js +1 -0
- package/dist/web/_app/immutable/chunks/BNTlsKDJ.js +1 -0
- package/dist/web/_app/immutable/chunks/BOgcXgis2.js +1 -0
- package/dist/web/_app/immutable/chunks/BOyyDrjn2.js +1 -0
- package/dist/web/_app/immutable/chunks/BPR_ufQ0.js +41 -0
- package/dist/web/_app/immutable/chunks/BRcFsc6v.js +5 -0
- package/dist/web/_app/immutable/chunks/BT3KAag_.js +3 -0
- package/dist/web/_app/immutable/chunks/BX2T6xiZ.js +224 -0
- package/dist/web/_app/immutable/chunks/BZnJ8tbJ.js +1 -0
- package/dist/web/_app/immutable/chunks/Ba1Yzb7u.js +1 -0
- package/dist/web/_app/immutable/chunks/BcsvgA3B2.js +1 -0
- package/dist/web/_app/immutable/chunks/BfbS7rGT.js +1 -0
- package/dist/web/_app/immutable/chunks/BgagL41Z.js +1 -0
- package/dist/web/_app/immutable/chunks/Bk-AcswV.js +1 -0
- package/dist/web/_app/immutable/chunks/Bl9Pzopy.js +1 -0
- package/dist/web/_app/immutable/chunks/BmcU05mO.js +1 -0
- package/dist/web/_app/immutable/chunks/Bmgp0jlT.js +1 -0
- package/dist/web/_app/immutable/chunks/BpDONXUo.js +8 -0
- package/dist/web/_app/immutable/chunks/BpTXLx8I2.js +5 -0
- package/dist/web/_app/immutable/chunks/Bq0-jBGC2.js +1 -0
- package/dist/web/_app/immutable/chunks/BqGj0_GS.js +1 -0
- package/dist/web/_app/immutable/chunks/Bsc9K3Pz.js +1 -0
- package/dist/web/_app/immutable/chunks/Bssb691Q.js +1 -0
- package/dist/web/_app/immutable/chunks/BuzQceOn.js +1 -0
- package/dist/web/_app/immutable/chunks/BzeVNab0.js +1 -0
- package/dist/web/_app/immutable/chunks/C-OaypFN.js +1 -0
- package/dist/web/_app/immutable/chunks/C0fjDjvE2.js +1 -0
- package/dist/web/_app/immutable/chunks/C0pTXwEX.js +2 -0
- package/dist/web/_app/immutable/chunks/C3Enww9L2.js +1 -0
- package/dist/web/_app/immutable/chunks/C3oa0Cks.js +1 -0
- package/dist/web/_app/immutable/chunks/C7GIvT8T.js +2 -0
- package/dist/web/_app/immutable/chunks/CC-YWp-f.js +1 -0
- package/dist/web/_app/immutable/chunks/CGdKvXV92.js +1 -0
- package/dist/web/_app/immutable/chunks/CH0siYFL.js +1 -0
- package/dist/web/_app/immutable/chunks/CIc2MMme2.js +1 -0
- package/dist/web/_app/immutable/chunks/CIchr8Tk2.js +1 -0
- package/dist/web/_app/immutable/chunks/CK_yXDQI.js +1 -0
- package/dist/web/_app/immutable/chunks/CLSxJmTj.js +2 -0
- package/dist/web/_app/immutable/chunks/CMhHc1Bq2.js +2 -0
- package/dist/web/_app/immutable/chunks/CNGba6T4.js +1 -0
- package/dist/web/_app/immutable/chunks/CPt2D5aU.js +1 -0
- package/dist/web/_app/immutable/chunks/CQ-2yccd.js +7 -0
- package/dist/web/_app/immutable/chunks/CS6VEwn7.js +1 -0
- package/dist/web/_app/immutable/chunks/CSsDOIrk.js +1 -0
- package/dist/web/_app/immutable/chunks/CVXvEWhv2.js +1 -0
- package/dist/web/_app/immutable/chunks/CaChtuYU2.js +1 -0
- package/dist/web/_app/immutable/chunks/CbiwvM3R2.js +1 -0
- package/dist/web/_app/immutable/chunks/CdCuBMLm.js +156 -0
- package/dist/web/_app/immutable/chunks/CiyqPsJo.js +1 -0
- package/dist/web/_app/immutable/chunks/CjGzUnEF2.js +1 -0
- package/dist/web/_app/immutable/chunks/Cjgbiel7.js +1 -0
- package/dist/web/_app/immutable/chunks/CnqSKqA62.js +1 -0
- package/dist/web/_app/immutable/chunks/CqyqKPuh2.js +1 -0
- package/dist/web/_app/immutable/chunks/CrnX-oFV.js +1 -0
- package/dist/web/_app/immutable/chunks/CsGahE3a.js +1 -0
- package/dist/web/_app/immutable/chunks/Ct3quP0F.js +1 -0
- package/dist/web/_app/immutable/chunks/CtlAYPxw.js +1 -0
- package/dist/web/_app/immutable/chunks/CvZaxjRC.js +1 -0
- package/dist/web/_app/immutable/chunks/CwD4G56R.js +5 -0
- package/dist/web/_app/immutable/chunks/CwROuREs.js +1 -0
- package/dist/web/_app/immutable/chunks/CxalqrMB.js +1 -0
- package/dist/web/_app/immutable/chunks/D7qgUfnr.js +2487 -0
- package/dist/web/_app/immutable/chunks/D9-_Euza2.js +1 -0
- package/dist/web/_app/immutable/chunks/DC69SASj.js +2 -0
- package/dist/web/_app/immutable/chunks/DCCaoKt42.js +1 -0
- package/dist/web/_app/immutable/chunks/DDKweOZr2.js +23 -0
- package/dist/web/_app/immutable/chunks/DEY60osH.js +1 -0
- package/dist/web/_app/immutable/chunks/DG3QZPgI.js +1 -0
- package/dist/web/_app/immutable/chunks/DHepUItL.js +1 -0
- package/dist/web/_app/immutable/chunks/DNtqqgv32.js +1 -0
- package/dist/web/_app/immutable/chunks/DRl7vwNC2.js +184 -0
- package/dist/web/_app/immutable/chunks/DTc5W_V6.js +1 -0
- package/dist/web/_app/immutable/chunks/DaiJs3St.js +1 -0
- package/dist/web/_app/immutable/chunks/DfITyMKh2.js +1 -0
- package/dist/web/_app/immutable/chunks/DhuJRrEX2.js +1 -0
- package/dist/web/_app/immutable/chunks/DiP2EplP.js +3 -0
- package/dist/web/_app/immutable/chunks/DjlDV2JG.js +1 -0
- package/dist/web/_app/immutable/chunks/Dm25ot5x2.js +1 -0
- package/dist/web/_app/immutable/chunks/DpuSt-SO.js +2 -0
- package/dist/web/_app/immutable/chunks/DqOcb9RX2.js +83 -0
- package/dist/web/_app/immutable/chunks/DrbUJCAE.js +1 -0
- package/dist/web/_app/immutable/chunks/Du2-B3c8.js +1 -0
- package/dist/web/_app/immutable/chunks/DwdkE4UD2.js +1 -0
- package/dist/web/_app/immutable/chunks/DxWesPbn.js +1 -0
- package/dist/web/_app/immutable/chunks/DyYZqUV72.js +1 -0
- package/dist/web/_app/immutable/chunks/HfUnhvrv2.js +1 -0
- package/dist/web/_app/immutable/chunks/Je8-BtCk2.js +1 -0
- package/dist/web/_app/immutable/chunks/MSB7eA4_.js +1 -0
- package/dist/web/_app/immutable/chunks/NPe9WyW1.js +1 -0
- package/dist/web/_app/immutable/chunks/O6IzcxXJ.js +2 -0
- package/dist/web/_app/immutable/chunks/SXhc9rJW.js +1 -0
- package/dist/web/_app/immutable/chunks/SbWhkPMt.js +6 -0
- package/dist/web/_app/immutable/chunks/U40J2SnU.js +1 -0
- package/dist/web/_app/immutable/chunks/VS3l21Gu.js +1 -0
- package/dist/web/_app/immutable/chunks/YEPEvlbU2.js +1 -0
- package/dist/web/_app/immutable/chunks/Z7TNRcgK.js +11 -0
- package/dist/web/_app/immutable/chunks/ZCekGjo6.js +5 -0
- package/dist/web/_app/immutable/chunks/_rnxQ655.js +4 -0
- package/dist/web/_app/immutable/chunks/aALpjBW2.js +1 -0
- package/dist/web/_app/immutable/chunks/gNXLhsdy.js +1 -0
- package/dist/web/_app/immutable/chunks/hKSTEN36.js +1 -0
- package/dist/web/_app/immutable/chunks/jZZTbzL5.js +1 -0
- package/dist/web/_app/immutable/chunks/l4FIBKss.js +1 -0
- package/dist/web/_app/immutable/chunks/l_4snZnh2.js +1 -0
- package/dist/web/_app/immutable/chunks/mz-cgRgP.js +3 -0
- package/dist/web/_app/immutable/chunks/qgprkMcL.js +1 -0
- package/dist/web/_app/immutable/chunks/rOisBLC62.js +14 -0
- package/dist/web/_app/immutable/chunks/t08TznXc2.js +1 -0
- package/dist/web/_app/immutable/chunks/t62M88qj.js +1 -0
- package/dist/web/_app/immutable/chunks/uCohGWC42.js +1 -0
- package/dist/web/_app/immutable/chunks/uqxmB78b.js +1 -0
- package/dist/web/_app/immutable/chunks/vJkT0IPN.js +1 -0
- package/dist/web/_app/immutable/chunks/vwTMEIJQ.js +1 -0
- package/dist/web/_app/immutable/chunks/w1FCELam.js +64 -0
- package/dist/web/_app/immutable/chunks/xEzUlKaR2.js +1 -0
- package/dist/web/_app/immutable/chunks/zumDjcgJ.js +1 -0
- package/dist/web/_app/immutable/entry/app.DtdPIxaY.js +2 -0
- package/dist/web/_app/immutable/entry/start.Cqf8YmDj.js +1 -0
- package/dist/web/_app/immutable/nodes/0.CktqlAe7.js +2 -0
- package/dist/web/_app/immutable/nodes/1.Bs7cz_ba.js +1 -0
- package/dist/web/_app/immutable/nodes/10.CAQtOBqO.js +1 -0
- package/dist/web/_app/immutable/nodes/11.l9TQGnJm.js +1 -0
- package/dist/web/_app/immutable/nodes/12.CttDoIpY.js +1 -0
- package/dist/web/_app/immutable/nodes/13.E5fh69kS.js +1 -0
- package/dist/web/_app/immutable/nodes/2.DnLSJfx-.js +106 -0
- package/dist/web/_app/immutable/nodes/3.Bw8R0Jw5.js +2 -0
- package/dist/web/_app/immutable/nodes/4.Cl0HgeTG.js +2 -0
- package/dist/web/_app/immutable/nodes/5.BpIWwWi9.js +1 -0
- package/dist/web/_app/immutable/nodes/6.jpx6ZgOI.js +1 -0
- package/dist/web/_app/immutable/nodes/7.YTFykZQe.js +1 -0
- package/dist/web/_app/immutable/nodes/8.Chy0HNU1.js +1 -0
- package/dist/web/_app/immutable/nodes/9.D10JpFt2.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/favicon-16.png +0 -0
- package/dist/web/favicon-180.png +0 -0
- package/dist/web/favicon-32.png +0 -0
- package/dist/web/favicon-48.png +0 -0
- package/dist/web/favicon-512.png +0 -0
- package/dist/web/favicon.ico +0 -0
- package/dist/web/favicon.svg +8 -0
- package/dist/web/index.html +64 -21
- package/dist/web/studiograph-logomark.svg +29 -0
- package/package.json +28 -14
- package/dist/agent/role-loader.d.ts +0 -24
- package/dist/agent/role-loader.js +0 -67
- package/dist/agent/role-loader.js.map +0 -1
- package/dist/agent/skills/enrich-entities.md +0 -136
- package/dist/agent/skills/obsidian-source-setup.md +0 -246
- package/dist/agent/skills/skill-loader.d.ts +0 -48
- package/dist/agent/skills/skill-loader.js +0 -166
- package/dist/agent/skills/skill-loader.js.map +0 -1
- package/dist/agent/skills/sync-configuration.md +0 -119
- package/dist/agent/skills/sync-setup.md +0 -82
- package/dist/agent/tools/sync-tools.d.ts +0 -35
- package/dist/agent/tools/sync-tools.js +0 -992
- package/dist/agent/tools/sync-tools.js.map +0 -1
- package/dist/auth/github.d.ts +0 -56
- package/dist/auth/github.js +0 -169
- package/dist/auth/github.js.map +0 -1
- package/dist/cli/commands/access.d.ts +0 -11
- package/dist/cli/commands/access.js +0 -156
- package/dist/cli/commands/access.js.map +0 -1
- package/dist/cli/commands/app.d.ts +0 -7
- package/dist/cli/commands/app.js +0 -268
- package/dist/cli/commands/app.js.map +0 -1
- package/dist/cli/commands/auth.d.ts +0 -10
- package/dist/cli/commands/auth.js +0 -79
- package/dist/cli/commands/auth.js.map +0 -1
- package/dist/cli/commands/collection.d.ts +0 -10
- package/dist/cli/commands/collection.js +0 -185
- package/dist/cli/commands/collection.js.map +0 -1
- package/dist/cli/commands/enrich.d.ts +0 -11
- package/dist/cli/commands/enrich.js +0 -135
- package/dist/cli/commands/enrich.js.map +0 -1
- package/dist/cli/commands/graphrag.d.ts +0 -12
- package/dist/cli/commands/graphrag.js +0 -122
- package/dist/cli/commands/graphrag.js.map +0 -1
- package/dist/cli/commands/members.d.ts +0 -11
- package/dist/cli/commands/members.js +0 -230
- package/dist/cli/commands/members.js.map +0 -1
- package/dist/cli/commands/org.d.ts +0 -10
- package/dist/cli/commands/org.js +0 -132
- package/dist/cli/commands/org.js.map +0 -1
- package/dist/cli/commands/provision.d.ts +0 -8
- package/dist/cli/commands/provision.js +0 -116
- package/dist/cli/commands/provision.js.map +0 -1
- package/dist/cli/commands/resolve.d.ts +0 -8
- package/dist/cli/commands/resolve.js +0 -85
- package/dist/cli/commands/resolve.js.map +0 -1
- package/dist/cli/commands/review.d.ts +0 -19
- package/dist/cli/commands/review.js +0 -128
- package/dist/cli/commands/review.js.map +0 -1
- package/dist/cli/commands/source.d.ts +0 -16
- package/dist/cli/commands/source.js +0 -159
- package/dist/cli/commands/source.js.map +0 -1
- package/dist/cli/commands/sync-collection.d.ts +0 -14
- package/dist/cli/commands/sync-collection.js +0 -355
- package/dist/cli/commands/sync-collection.js.map +0 -1
- package/dist/cli/commands/sync-entities.d.ts +0 -13
- package/dist/cli/commands/sync-entities.js +0 -242
- package/dist/cli/commands/sync-entities.js.map +0 -1
- package/dist/cli/commands/team.d.ts +0 -12
- package/dist/cli/commands/team.js +0 -185
- package/dist/cli/commands/team.js.map +0 -1
- package/dist/cli/sync-review-interactive.d.ts +0 -31
- package/dist/cli/sync-review-interactive.js +0 -393
- package/dist/cli/sync-review-interactive.js.map +0 -1
- package/dist/core/migration-runner.d.ts +0 -42
- package/dist/core/migration-runner.js +0 -232
- package/dist/core/migration-runner.js.map +0 -1
- package/dist/core/migration-types.d.ts +0 -101
- package/dist/core/migration-types.js +0 -21
- package/dist/core/migration-types.js.map +0 -1
- package/dist/core/migrations/20260219-formalize-memory-location.d.ts +0 -2
- package/dist/core/migrations/20260219-formalize-memory-location.js +0 -35
- package/dist/core/migrations/20260219-formalize-memory-location.js.map +0 -1
- package/dist/core/migrations/20260220-add-workspace-metadata.d.ts +0 -12
- package/dist/core/migrations/20260220-add-workspace-metadata.js +0 -65
- package/dist/core/migrations/20260220-add-workspace-metadata.js.map +0 -1
- package/dist/core/migrations/20260220-add-workspace-readme.d.ts +0 -11
- package/dist/core/migrations/20260220-add-workspace-readme.js +0 -82
- package/dist/core/migrations/20260220-add-workspace-readme.js.map +0 -1
- package/dist/core/migrations/20260220-migrate-yaml-to-json.d.ts +0 -9
- package/dist/core/migrations/20260220-migrate-yaml-to-json.js +0 -64
- package/dist/core/migrations/20260220-migrate-yaml-to-json.js.map +0 -1
- package/dist/core/migrations/index.d.ts +0 -11
- package/dist/core/migrations/index.js +0 -23
- package/dist/core/migrations/index.js.map +0 -1
- package/dist/integrations/asana.d.ts +0 -26
- package/dist/integrations/asana.js +0 -78
- package/dist/integrations/asana.js.map +0 -1
- package/dist/integrations/figma-local.d.ts +0 -16
- package/dist/integrations/figma-local.js +0 -10
- package/dist/integrations/figma-local.js.map +0 -1
- package/dist/integrations/figma.d.ts +0 -17
- package/dist/integrations/figma.js +0 -17
- package/dist/integrations/figma.js.map +0 -1
- package/dist/integrations/granola.d.ts +0 -24
- package/dist/integrations/granola.js +0 -60
- package/dist/integrations/granola.js.map +0 -1
- package/dist/integrations/linear.d.ts +0 -14
- package/dist/integrations/linear.js +0 -80
- package/dist/integrations/linear.js.map +0 -1
- package/dist/integrations/paper-local.d.ts +0 -14
- package/dist/integrations/paper-local.js +0 -10
- package/dist/integrations/paper-local.js.map +0 -1
- package/dist/integrations/paper.d.ts +0 -2
- package/dist/integrations/paper.js +0 -10
- package/dist/integrations/paper.js.map +0 -1
- package/dist/integrations/pipedrive.d.ts +0 -26
- package/dist/integrations/pipedrive.js +0 -97
- package/dist/integrations/pipedrive.js.map +0 -1
- package/dist/integrations/registry.d.ts +0 -8
- package/dist/integrations/registry.js +0 -7
- package/dist/integrations/registry.js.map +0 -1
- package/dist/integrations/types.d.ts +0 -43
- package/dist/integrations/types.js +0 -5
- package/dist/integrations/types.js.map +0 -1
- package/dist/lib/lib/utils.d.ts +0 -2
- package/dist/lib/lib/utils.js +0 -6
- package/dist/lib/lib/utils.js.map +0 -1
- package/dist/mcp/connectors/asana.d.ts +0 -2
- package/dist/mcp/connectors/asana.js +0 -20
- package/dist/mcp/connectors/asana.js.map +0 -1
- package/dist/mcp/connectors/definitions.d.ts +0 -45
- package/dist/mcp/connectors/definitions.js +0 -32
- package/dist/mcp/connectors/definitions.js.map +0 -1
- package/dist/mcp/connectors/figma.d.ts +0 -5
- package/dist/mcp/connectors/figma.js +0 -21
- package/dist/mcp/connectors/figma.js.map +0 -1
- package/dist/mcp/connectors/gdrive.d.ts +0 -2
- package/dist/mcp/connectors/gdrive.js +0 -20
- package/dist/mcp/connectors/gdrive.js.map +0 -1
- package/dist/mcp/connectors/granola.d.ts +0 -2
- package/dist/mcp/connectors/granola.js +0 -12
- package/dist/mcp/connectors/granola.js.map +0 -1
- package/dist/mcp/connectors/linear.d.ts +0 -2
- package/dist/mcp/connectors/linear.js +0 -19
- package/dist/mcp/connectors/linear.js.map +0 -1
- package/dist/mcp/connectors/obsidian.d.ts +0 -2
- package/dist/mcp/connectors/obsidian.js +0 -19
- package/dist/mcp/connectors/obsidian.js.map +0 -1
- package/dist/mcp/connectors/pipedrive.d.ts +0 -2
- package/dist/mcp/connectors/pipedrive.js +0 -20
- package/dist/mcp/connectors/pipedrive.js.map +0 -1
- package/dist/mcp/connectors/slack.d.ts +0 -2
- package/dist/mcp/connectors/slack.js +0 -21
- package/dist/mcp/connectors/slack.js.map +0 -1
- package/dist/mcp/server-oauth-provider.d.ts +0 -56
- package/dist/mcp/server-oauth-provider.js +0 -142
- package/dist/mcp/server-oauth-provider.js.map +0 -1
- package/dist/server/agents/agent-loader.d.ts +0 -16
- package/dist/server/agents/agent-loader.js +0 -175
- package/dist/server/agents/agent-loader.js.map +0 -1
- package/dist/server/agents/agent-runner.d.ts +0 -33
- package/dist/server/agents/agent-runner.js +0 -187
- package/dist/server/agents/agent-runner.js.map +0 -1
- package/dist/server/agents/agent-runtime.d.ts +0 -39
- package/dist/server/agents/agent-runtime.js +0 -214
- package/dist/server/agents/agent-runtime.js.map +0 -1
- package/dist/server/agents/base-agent.d.ts +0 -30
- package/dist/server/agents/base-agent.js +0 -88
- package/dist/server/agents/base-agent.js.map +0 -1
- package/dist/server/agents/executive-digest.d.ts +0 -16
- package/dist/server/agents/executive-digest.js +0 -115
- package/dist/server/agents/executive-digest.js.map +0 -1
- package/dist/server/agents/graph-steward.d.ts +0 -16
- package/dist/server/agents/graph-steward.js +0 -59
- package/dist/server/agents/graph-steward.js.map +0 -1
- package/dist/server/agents/meeting-followup.d.ts +0 -16
- package/dist/server/agents/meeting-followup.js +0 -88
- package/dist/server/agents/meeting-followup.js.map +0 -1
- package/dist/server/agents/pipeline-monitor.d.ts +0 -15
- package/dist/server/agents/pipeline-monitor.js +0 -86
- package/dist/server/agents/pipeline-monitor.js.map +0 -1
- package/dist/server/agents/types.d.ts +0 -81
- package/dist/server/agents/types.js +0 -41
- package/dist/server/agents/types.js.map +0 -1
- package/dist/server/chrome/chrome.css +0 -691
- package/dist/server/chrome/chrome.js +0 -374
- package/dist/server/collab-authority.d.ts +0 -70
- package/dist/server/collab-authority.js +0 -218
- package/dist/server/collab-authority.js.map +0 -1
- package/dist/server/collab.d.ts +0 -29
- package/dist/server/collab.js +0 -195
- package/dist/server/collab.js.map +0 -1
- package/dist/server/commit-scheduler.d.ts +0 -39
- package/dist/server/commit-scheduler.js +0 -113
- package/dist/server/commit-scheduler.js.map +0 -1
- package/dist/server/plugin-loader.d.ts +0 -53
- package/dist/server/plugin-loader.js +0 -155
- package/dist/server/plugin-loader.js.map +0 -1
- package/dist/server/routes/agents-api.d.ts +0 -10
- package/dist/server/routes/agents-api.js +0 -25
- package/dist/server/routes/agents-api.js.map +0 -1
- package/dist/server/routes/collab.d.ts +0 -6
- package/dist/server/routes/collab.js +0 -10
- package/dist/server/routes/collab.js.map +0 -1
- package/dist/server/routes/git-api.d.ts +0 -9
- package/dist/server/routes/git-api.js +0 -82
- package/dist/server/routes/git-api.js.map +0 -1
- package/dist/server/routes/meeting-ingest-api.d.ts +0 -14
- package/dist/server/routes/meeting-ingest-api.js +0 -98
- package/dist/server/routes/meeting-ingest-api.js.map +0 -1
- package/dist/server/routes/sync-api.d.ts +0 -26
- package/dist/server/routes/sync-api.js +0 -848
- package/dist/server/routes/sync-api.js.map +0 -1
- package/dist/server/routes/webhook.d.ts +0 -14
- package/dist/server/routes/webhook.js +0 -102
- package/dist/server/routes/webhook.js.map +0 -1
- package/dist/services/batch-processor.d.ts +0 -49
- package/dist/services/batch-processor.js +0 -166
- package/dist/services/batch-processor.js.map +0 -1
- package/dist/services/csv-service.d.ts +0 -36
- package/dist/services/csv-service.js +0 -143
- package/dist/services/csv-service.js.map +0 -1
- package/dist/services/github-provisioner.d.ts +0 -36
- package/dist/services/github-provisioner.js +0 -126
- package/dist/services/github-provisioner.js.map +0 -1
- package/dist/services/github-service.d.ts +0 -99
- package/dist/services/github-service.js +0 -310
- package/dist/services/github-service.js.map +0 -1
- package/dist/services/image-import-service.d.ts +0 -24
- package/dist/services/image-import-service.js +0 -108
- package/dist/services/image-import-service.js.map +0 -1
- package/dist/services/insights.d.ts +0 -38
- package/dist/services/insights.js +0 -269
- package/dist/services/insights.js.map +0 -1
- package/dist/services/meeting-processor.d.ts +0 -91
- package/dist/services/meeting-processor.js +0 -331
- package/dist/services/meeting-processor.js.map +0 -1
- package/dist/services/sync/collection-sync.d.ts +0 -60
- package/dist/services/sync/collection-sync.js +0 -509
- package/dist/services/sync/collection-sync.js.map +0 -1
- package/dist/services/sync/commit.d.ts +0 -60
- package/dist/services/sync/commit.js +0 -354
- package/dist/services/sync/commit.js.map +0 -1
- package/dist/services/sync/context-index.d.ts +0 -69
- package/dist/services/sync/context-index.js +0 -280
- package/dist/services/sync/context-index.js.map +0 -1
- package/dist/services/sync/data-fetcher.d.ts +0 -31
- package/dist/services/sync/data-fetcher.js +0 -12
- package/dist/services/sync/data-fetcher.js.map +0 -1
- package/dist/services/sync/derive.d.ts +0 -34
- package/dist/services/sync/derive.js +0 -164
- package/dist/services/sync/derive.js.map +0 -1
- package/dist/services/sync/enrichment-state.d.ts +0 -31
- package/dist/services/sync/enrichment-state.js +0 -63
- package/dist/services/sync/enrichment-state.js.map +0 -1
- package/dist/services/sync/enrichment.d.ts +0 -25
- package/dist/services/sync/enrichment.js +0 -121
- package/dist/services/sync/enrichment.js.map +0 -1
- package/dist/services/sync/entity-refresh.d.ts +0 -30
- package/dist/services/sync/entity-refresh.js +0 -275
- package/dist/services/sync/entity-refresh.js.map +0 -1
- package/dist/services/sync/frontmatter-extractor.d.ts +0 -40
- package/dist/services/sync/frontmatter-extractor.js +0 -279
- package/dist/services/sync/frontmatter-extractor.js.map +0 -1
- package/dist/services/sync/graph-match-state.d.ts +0 -33
- package/dist/services/sync/graph-match-state.js +0 -61
- package/dist/services/sync/graph-match-state.js.map +0 -1
- package/dist/services/sync/graph-match.d.ts +0 -53
- package/dist/services/sync/graph-match.js +0 -316
- package/dist/services/sync/graph-match.js.map +0 -1
- package/dist/services/sync/graphrag-client.d.ts +0 -43
- package/dist/services/sync/graphrag-client.js +0 -94
- package/dist/services/sync/graphrag-client.js.map +0 -1
- package/dist/services/sync/graphrag-config.d.ts +0 -16
- package/dist/services/sync/graphrag-config.js +0 -39
- package/dist/services/sync/graphrag-config.js.map +0 -1
- package/dist/services/sync/graphrag-context.d.ts +0 -14
- package/dist/services/sync/graphrag-context.js +0 -109
- package/dist/services/sync/graphrag-context.js.map +0 -1
- package/dist/services/sync/graphrag-indexer.d.ts +0 -30
- package/dist/services/sync/graphrag-indexer.js +0 -358
- package/dist/services/sync/graphrag-indexer.js.map +0 -1
- package/dist/services/sync/llm.d.ts +0 -32
- package/dist/services/sync/llm.js +0 -115
- package/dist/services/sync/llm.js.map +0 -1
- package/dist/services/sync/mcp-client.d.ts +0 -71
- package/dist/services/sync/mcp-client.js +0 -299
- package/dist/services/sync/mcp-client.js.map +0 -1
- package/dist/services/sync/model-factory.d.ts +0 -13
- package/dist/services/sync/model-factory.js +0 -38
- package/dist/services/sync/model-factory.js.map +0 -1
- package/dist/services/sync/name-quality.d.ts +0 -31
- package/dist/services/sync/name-quality.js +0 -60
- package/dist/services/sync/name-quality.js.map +0 -1
- package/dist/services/sync/output-schemas.d.ts +0 -92
- package/dist/services/sync/output-schemas.js +0 -43
- package/dist/services/sync/output-schemas.js.map +0 -1
- package/dist/services/sync/prompts.d.ts +0 -19
- package/dist/services/sync/prompts.js +0 -128
- package/dist/services/sync/prompts.js.map +0 -1
- package/dist/services/sync/reconciler.d.ts +0 -48
- package/dist/services/sync/reconciler.js +0 -294
- package/dist/services/sync/reconciler.js.map +0 -1
- package/dist/services/sync/rest-client.d.ts +0 -40
- package/dist/services/sync/rest-client.js +0 -100
- package/dist/services/sync/rest-client.js.map +0 -1
- package/dist/services/sync/source-config.d.ts +0 -67
- package/dist/services/sync/source-config.js +0 -304
- package/dist/services/sync/source-config.js.map +0 -1
- package/dist/services/sync/source-definitions/asana.d.ts +0 -14
- package/dist/services/sync/source-definitions/asana.js +0 -42
- package/dist/services/sync/source-definitions/asana.js.map +0 -1
- package/dist/services/sync/source-definitions/definitions.d.ts +0 -8
- package/dist/services/sync/source-definitions/definitions.js +0 -8
- package/dist/services/sync/source-definitions/definitions.js.map +0 -1
- package/dist/services/sync/source-definitions/gdrive.d.ts +0 -16
- package/dist/services/sync/source-definitions/gdrive.js +0 -68
- package/dist/services/sync/source-definitions/gdrive.js.map +0 -1
- package/dist/services/sync/source-definitions/granola.d.ts +0 -2
- package/dist/services/sync/source-definitions/granola.js +0 -21
- package/dist/services/sync/source-definitions/granola.js.map +0 -1
- package/dist/services/sync/source-definitions/linear.d.ts +0 -2
- package/dist/services/sync/source-definitions/linear.js +0 -62
- package/dist/services/sync/source-definitions/linear.js.map +0 -1
- package/dist/services/sync/source-definitions/obsidian.d.ts +0 -2
- package/dist/services/sync/source-definitions/obsidian.js +0 -55
- package/dist/services/sync/source-definitions/obsidian.js.map +0 -1
- package/dist/services/sync/source-definitions/pipedrive.d.ts +0 -2
- package/dist/services/sync/source-definitions/pipedrive.js +0 -43
- package/dist/services/sync/source-definitions/pipedrive.js.map +0 -1
- package/dist/services/sync/staging.d.ts +0 -53
- package/dist/services/sync/staging.js +0 -130
- package/dist/services/sync/staging.js.map +0 -1
- package/dist/services/sync/structured-extractor.d.ts +0 -57
- package/dist/services/sync/structured-extractor.js +0 -584
- package/dist/services/sync/structured-extractor.js.map +0 -1
- package/dist/services/sync/sync-runner.d.ts +0 -32
- package/dist/services/sync/sync-runner.js +0 -195
- package/dist/services/sync/sync-runner.js.map +0 -1
- package/dist/services/sync/sync-state.d.ts +0 -43
- package/dist/services/sync/sync-state.js +0 -154
- package/dist/services/sync/sync-state.js.map +0 -1
- package/dist/services/sync/types.d.ts +0 -381
- package/dist/services/sync/types.js +0 -8
- package/dist/services/sync/types.js.map +0 -1
- package/dist/services/sync/unstructured-extractor.d.ts +0 -27
- package/dist/services/sync/unstructured-extractor.js +0 -185
- package/dist/services/sync/unstructured-extractor.js.map +0 -1
- package/dist/utils/merge-resolver.d.ts +0 -59
- package/dist/utils/merge-resolver.js +0 -303
- package/dist/utils/merge-resolver.js.map +0 -1
- package/dist/utils/workspace-config.d.ts +0 -8
- package/dist/utils/workspace-config.js +0 -22
- package/dist/utils/workspace-config.js.map +0 -1
- package/dist/web/_app/immutable/assets/0.QUqBcyuu.css +0 -1
- package/dist/web/_app/immutable/assets/11.2jzI3cZY.css +0 -1
- package/dist/web/_app/immutable/assets/12.CT4xL4K3.css +0 -1
- package/dist/web/_app/immutable/assets/13.BUrHkYry.css +0 -1
- package/dist/web/_app/immutable/assets/2.5jNm7Pm1.css +0 -1
- package/dist/web/_app/immutable/assets/3.BxdqT7zi.css +0 -1
- package/dist/web/_app/immutable/assets/4.BjPwtpNd.css +0 -1
- package/dist/web/_app/immutable/assets/5.DFeGxLYf.css +0 -1
- package/dist/web/_app/immutable/assets/6.DXZr_rI_.css +0 -1
- package/dist/web/_app/immutable/assets/GraphView.D9ePpZez.css +0 -1
- package/dist/web/_app/immutable/assets/Toaster.rN8r_Hzv.css +0 -1
- package/dist/web/_app/immutable/assets/ViewToolbar.CZjsdjy4.css +0 -1
- package/dist/web/_app/immutable/assets/WorkspaceView.B-1DbivC.css +0 -1
- package/dist/web/_app/immutable/assets/wikilinks.CtSydmQl.css +0 -1
- package/dist/web/_app/immutable/chunks/3--t-YNA.js +0 -1
- package/dist/web/_app/immutable/chunks/5OU-4caN.js +0 -1
- package/dist/web/_app/immutable/chunks/7S2LGqoP.js +0 -2
- package/dist/web/_app/immutable/chunks/B6FUcAv5.js +0 -1
- package/dist/web/_app/immutable/chunks/B9gDgSlp.js +0 -1
- package/dist/web/_app/immutable/chunks/BB_5th5W.js +0 -3383
- package/dist/web/_app/immutable/chunks/BFtIWl5z.js +0 -1
- package/dist/web/_app/immutable/chunks/BHKpz6_7.js +0 -1
- package/dist/web/_app/immutable/chunks/BNfrhBeA.js +0 -1
- package/dist/web/_app/immutable/chunks/BgO5HlCg.js +0 -2
- package/dist/web/_app/immutable/chunks/BqnODQDb.js +0 -1
- package/dist/web/_app/immutable/chunks/BrebtJNG.js +0 -18
- package/dist/web/_app/immutable/chunks/BvIFhEn7.js +0 -2
- package/dist/web/_app/immutable/chunks/BvfdTHv8.js +0 -1
- package/dist/web/_app/immutable/chunks/BxGm65PH.js +0 -1
- package/dist/web/_app/immutable/chunks/BxyxnEKw.js +0 -1
- package/dist/web/_app/immutable/chunks/BygFIGq4.js +0 -1
- package/dist/web/_app/immutable/chunks/Bz0ZjVQE.js +0 -2
- package/dist/web/_app/immutable/chunks/C0LVZhvn.js +0 -1
- package/dist/web/_app/immutable/chunks/CIb_hHMy.js +0 -1
- package/dist/web/_app/immutable/chunks/CNKK6nZb.js +0 -1
- package/dist/web/_app/immutable/chunks/CQ5FjHZK.js +0 -1
- package/dist/web/_app/immutable/chunks/CSVbGg_b.js +0 -5
- package/dist/web/_app/immutable/chunks/CX_61fY8.js +0 -5
- package/dist/web/_app/immutable/chunks/CYrVHOHA.js +0 -1
- package/dist/web/_app/immutable/chunks/CaEaeeKb.js +0 -1
- package/dist/web/_app/immutable/chunks/Ch6e_wpP.js +0 -1
- package/dist/web/_app/immutable/chunks/Ci4zzCVB.js +0 -2
- package/dist/web/_app/immutable/chunks/CknqBVQE.js +0 -1
- package/dist/web/_app/immutable/chunks/Cmfiirqp.js +0 -4
- package/dist/web/_app/immutable/chunks/CqkleIqs.js +0 -1
- package/dist/web/_app/immutable/chunks/CrFpCC6p.js +0 -1
- package/dist/web/_app/immutable/chunks/CxX8hcT6.js +0 -1
- package/dist/web/_app/immutable/chunks/D0T1ps1G.js +0 -1
- package/dist/web/_app/immutable/chunks/D2ZEj9xD.js +0 -1
- package/dist/web/_app/immutable/chunks/D3sy0IkA.js +0 -2
- package/dist/web/_app/immutable/chunks/DFYOFE3o.js +0 -1
- package/dist/web/_app/immutable/chunks/DHWoAC4y.js +0 -1
- package/dist/web/_app/immutable/chunks/DYYBfXU3.js +0 -1
- package/dist/web/_app/immutable/chunks/DiNPRA8T.js +0 -1
- package/dist/web/_app/immutable/chunks/DkjsqHkM.js +0 -1
- package/dist/web/_app/immutable/chunks/DnL9f0lc.js +0 -7
- package/dist/web/_app/immutable/chunks/DpMCynC3.js +0 -1
- package/dist/web/_app/immutable/chunks/DqrybUuA.js +0 -1
- package/dist/web/_app/immutable/chunks/DsnmJJEf.js +0 -1
- package/dist/web/_app/immutable/chunks/KyjzlWRN.js +0 -2
- package/dist/web/_app/immutable/chunks/O9MAeAgV.js +0 -5
- package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +0 -1
- package/dist/web/_app/immutable/chunks/SKSQ4m85.js +0 -2
- package/dist/web/_app/immutable/chunks/WEBTyD-H.js +0 -1
- package/dist/web/_app/immutable/chunks/WSUKABI_.js +0 -1
- package/dist/web/_app/immutable/chunks/bBXT5iJP.js +0 -1
- package/dist/web/_app/immutable/chunks/vxEtkL8z.js +0 -1
- package/dist/web/_app/immutable/chunks/wDIGUaoU.js +0 -3
- package/dist/web/_app/immutable/chunks/xkNhbnff.js +0 -1
- package/dist/web/_app/immutable/chunks/zoVX1Zab.js +0 -1
- package/dist/web/_app/immutable/entry/app.GfE4z2GO.js +0 -2
- package/dist/web/_app/immutable/entry/start.H-LFJK9u.js +0 -1
- package/dist/web/_app/immutable/nodes/0.Bwi7tTNC.js +0 -2
- package/dist/web/_app/immutable/nodes/1.DgNJPEWk.js +0 -1
- package/dist/web/_app/immutable/nodes/10.BW_XCD2O.js +0 -1
- package/dist/web/_app/immutable/nodes/11.DM7RX3Ms.js +0 -1
- package/dist/web/_app/immutable/nodes/12.DKgssZo8.js +0 -1
- package/dist/web/_app/immutable/nodes/13.DCdmTre-.js +0 -1
- package/dist/web/_app/immutable/nodes/2.DOA5QBVG.js +0 -266
- package/dist/web/_app/immutable/nodes/3.bpoHQwAI.js +0 -5
- package/dist/web/_app/immutable/nodes/4.ye0Vy7A1.js +0 -11
- package/dist/web/_app/immutable/nodes/5.rxpnYrx_.js +0 -4
- package/dist/web/_app/immutable/nodes/6.DP8HSxtc.js +0 -1
- package/dist/web/_app/immutable/nodes/7.C1h4Bf-E.js +0 -1
- package/dist/web/_app/immutable/nodes/8.BzmQ7S7Y.js +0 -1
- package/dist/web/_app/immutable/nodes/9.CEakpXpF.js +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const T=()=>new Map,en=e=>{const t=T();return e.forEach((n,s)=>{t.set(s,n)}),t},R=(e,t,n)=>{let s=e.get(t);return s===void 0&&e.set(t,s=n()),s},Pr=(e,t)=>{const n=[];for(const[s,r]of e)n.push(t(r,s));return n},Zr=(e,t)=>{for(const[n,s]of e)if(t(s,n))return!0;return!1},Et=()=>new Set,He=e=>e[e.length-1],Qr=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},st=Array.from,fn=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},gn=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},ti=(e,t)=>{const n=new Array(e);for(let s=0;s<e;s++)n[s]=t(s,n);return n},Mt=Array.isArray;class pn{constructor(){this._observers=T()}on(t,n){return R(this._observers,t,Et).add(n),n}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return st((this._observers.get(t)||T()).values()).forEach(s=>s(...n))}destroy(){this._observers=T()}}class Ol{constructor(){this._observers=T()}on(t,n){R(this._observers,t,Et).add(n)}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return st((this._observers.get(t)||T()).values()).forEach(s=>s(...n))}destroy(){this._observers=T()}}const q=Math.floor,ge=Math.abs,ks=(e,t)=>e<t?e:t,Tt=(e,t)=>e>t?e:t,ys=e=>e!==0?e<0:1/e<0,Jn=1,Hn=2,Ye=4,Xe=8,Ht=32,et=64,B=128,Ie=31,nn=63,kt=127,ei=2147483647,ye=Number.MAX_SAFE_INTEGER,Yn=Number.MIN_SAFE_INTEGER,ni=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&q(e)===e),si=String.fromCharCode,ri=e=>e.toLowerCase(),ii=/^\s*/g,oi=e=>e.replace(ii,""),ci=/([A-Z])/g,Xn=(e,t)=>oi(e.replace(ci,n=>`${t}${ri(n)}`)),li=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=t.codePointAt(r);return s},Yt=typeof TextEncoder<"u"?new TextEncoder:null,hi=e=>Yt.encode(e),ai=Yt?hi:li;let Jt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Jt&&Jt.decode(new Uint8Array).length===1&&(Jt=null);const _s=(e,t)=>ti(t,()=>e).join("");class oe{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Bt=()=>new oe,ui=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},z=e=>{const t=new Uint8Array(ui(e));let n=0;for(let s=0;s<e.bufs.length;s++){const r=e.bufs[s];t.set(r,n),n+=r.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},di=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Tt(n,t)*2),e.cpos=0)},I=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Xt=I,p=(e,t)=>{for(;t>kt;)I(e,B|kt&t),t=q(t/128);I(e,kt&t)},Te=(e,t)=>{const n=ys(t);for(n&&(t=-t),I(e,(t>nn?B:0)|(n?et:0)|nn&t),t=q(t/64);t>0;)I(e,(t>kt?B:0)|kt&t),t=q(t/128)},sn=new Uint8Array(3e4),fi=sn.length/3,gi=(e,t)=>{if(t.length<fi){const n=Yt.encodeInto(t,sn).written||0;p(e,n);for(let s=0;s<n;s++)I(e,sn[s])}else V(e,ai(t))},pi=(e,t)=>{const n=unescape(encodeURIComponent(t)),s=n.length;p(e,s);for(let r=0;r<s;r++)I(e,n.codePointAt(r))},yt=Yt&&Yt.encodeInto?gi:pi,wi=(e,t)=>ce(e,z(t)),ce=(e,t)=>{const n=e.cbuf.length,s=e.cpos,r=ks(n-s,t.length),i=t.length-r;e.cbuf.set(t.subarray(0,r),s),e.cpos+=r,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Tt(n*2,i)),e.cbuf.set(t.subarray(r)),e.cpos=i)},V=(e,t)=>{p(e,t.byteLength),ce(e,t)},wn=(e,t)=>{di(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},mi=(e,t)=>wn(e,4).setFloat32(0,t,!1),ki=(e,t)=>wn(e,8).setFloat64(0,t,!1),yi=(e,t)=>wn(e,8).setBigInt64(0,t,!1),Kn=new DataView(new ArrayBuffer(4)),_i=e=>(Kn.setFloat32(0,e),Kn.getFloat32(0)===e),Kt=(e,t)=>{switch(typeof t){case"string":I(e,119),yt(e,t);break;case"number":ni(t)&&ge(t)<=ei?(I(e,125),Te(e,t)):_i(t)?(I(e,124),mi(e,t)):(I(e,123),ki(e,t));break;case"bigint":I(e,122),yi(e,t);break;case"object":if(t===null)I(e,126);else if(Mt(t)){I(e,117),p(e,t.length);for(let n=0;n<t.length;n++)Kt(e,t[n])}else if(t instanceof Uint8Array)I(e,116),V(e,t);else{I(e,118);const n=Object.keys(t);p(e,n.length);for(let s=0;s<n.length;s++){const r=n[s];yt(e,r),Kt(e,t[r])}}break;case"boolean":I(e,t?120:121);break;default:I(e,127)}};class Wn extends oe{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&p(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const qn=e=>{e.count>0&&(Te(e.encoder,e.count===1?e.s:-e.s),e.count>1&&p(e.encoder,e.count-2))};class pe{constructor(){this.encoder=new oe,this.s=0,this.count=0}write(t){this.s===t?this.count++:(qn(this),this.count=1,this.s=t)}toUint8Array(){return qn(this),z(this.encoder)}}const Pn=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);Te(e.encoder,t),e.count>1&&p(e.encoder,e.count-2)}};class Ke{constructor(){this.encoder=new oe,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Pn(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Pn(this),z(this.encoder)}}class bi{constructor(){this.sarr=[],this.s="",this.lensE=new pe}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new oe;return this.sarr.push(this.s),this.s="",yt(t,this.sarr.join("")),ce(t,this.lensE.toUint8Array()),z(t)}}const P=e=>new Error(e),X=()=>{throw P("Method unimplemented")},v=()=>{throw P("Unexpected case")},bs=P("Unexpected end of array"),Ss=P("Integer out of Range");class xe{constructor(t){this.arr=t,this.pos=0}}const L=e=>new xe(e),Es=e=>e.pos!==e.arr.length,Si=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},F=e=>Si(e,m(e)),Nt=e=>e.arr[e.pos++],m=e=>{let t=0,n=1;const s=e.arr.length;for(;e.pos<s;){const r=e.arr[e.pos++];if(t=t+(r&kt)*n,n*=128,r<B)return t;if(t>ye)throw Ss}throw bs},Oe=e=>{let t=e.arr[e.pos++],n=t&nn,s=64;const r=(t&et)>0?-1:1;if((t&B)===0)return r*n;const i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&kt)*s,s*=128,t<B)return r*n;if(n>ye)throw Ss}throw bs},Ul=e=>{const t=e.pos,n=m(e);return e.pos=t,n},Ei=e=>{let t=m(e);if(t===0)return"";{let n=String.fromCodePoint(Nt(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Nt(e));else for(;t>0;){const s=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+s);e.pos+=s,n+=String.fromCodePoint.apply(null,r),t-=s}return decodeURIComponent(escape(n))}},Ci=e=>Jt.decode(F(e)),_t=Jt?Ci:Ei,mn=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Di=e=>mn(e,4).getFloat32(0,!1),Ai=e=>mn(e,8).getFloat64(0,!1),Ii=e=>mn(e,8).getBigInt64(0,!1),Ti=[e=>{},e=>null,Oe,Di,Ai,Ii,e=>!1,e=>!0,_t,e=>{const t=m(e),n={};for(let s=0;s<t;s++){const r=_t(e);n[r]=Wt(e)}return n},e=>{const t=m(e),n=[];for(let s=0;s<t;s++)n.push(Wt(e));return n},F],Wt=e=>Ti[127-Nt(e)](e);class Zn extends xe{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Es(this)?this.count=m(this)+1:this.count=-1),this.count--,this.s}}class we extends xe{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=Oe(this);const t=ys(this.s);this.count=1,t&&(this.s=-this.s,this.count=m(this)+2)}return this.count--,this.s}}class We extends xe{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=Oe(this),n=t&1;this.diff=q(t/2),this.count=1,n&&(this.count=m(this)+2)}return this.s+=this.diff,this.count--,this.s}}class xi{constructor(t){this.decoder=new we(t),this.str=_t(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const Oi=crypto.getRandomValues.bind(crypto),Cs=()=>Oi(new Uint32Array(1))[0],Ui="10000000-1000-4000-8000"+-1e11,vi=()=>Ui.replace(/[018]/g,e=>(e^Cs()&15>>e/4).toString(16)),Li=Date.now,Qn=e=>new Promise(e);Promise.all.bind(Promise);const ts=e=>e===void 0?null:e;class Mi{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let Ds=new Mi,Ni=!0;try{typeof localStorage<"u"&&localStorage&&(Ds=localStorage,Ni=!1)}catch{}const Ri=Ds,qt=Symbol("Equality"),As=(e,t)=>e===t||!!e?.[qt]?.(t)||!1,$i=e=>typeof e=="object",Vi=Object.assign,Fi=Object.keys,Bi=(e,t)=>{for(const n in e)t(e[n],n)},_e=e=>Fi(e).length,ji=e=>{for(const t in e)return!1;return!0},le=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},kn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),zi=(e,t)=>e===t||_e(e)===_e(t)&&le(e,(n,s)=>(n!==void 0||kn(t,s))&&As(t[s],n)),Gi=Object.freeze,Is=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&Is(e[t])}return Gi(e)},yn=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&yn(e,t,n+1)}},Ts=e=>e,me=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[qt]!=null)return e[qt](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break}case Set:{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break}case Map:{if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!me(e.get(n),t.get(n)))return!1;break}case void 0:case Object:if(_e(e)!==_e(t))return!1;for(const n in e)if(!kn(e,n)||!me(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!me(e[n],t[n]))return!1;break;default:return!1}return!0},Ji=(e,t)=>t.includes(e);var xs={};const Pt=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let W;const Hi=()=>{if(W===void 0)if(Pt){W=T();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const s=e[n];s[0]==="-"?(t!==null&&W.set(t,""),t=s):t!==null&&(W.set(t,s),t=null)}t!==null&&W.set(t,"")}else typeof location=="object"?(W=T(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){const[t,n]=e.split("=");W.set(`--${Xn(t,"-")}`,n),W.set(`-${Xn(t,"-")}`,n)}})):W=T();return W},rn=e=>Hi().has(e),be=e=>ts(Pt?xs[e.toUpperCase().replaceAll("-","_")]:Ri.getItem(e)),Os=e=>rn("--"+e)||be(e)!==null,Yi=Os("production"),Xi=Pt&&Ji(xs.FORCE_COLOR,["true","1","2"]),Ki=Xi||!rn("--no-colors")&&!Os("no-color")&&(!Pt||process.stdout.isTTY)&&(!Pt||rn("--color")||be("COLORTERM")!==null||(be("TERM")||"").includes("color")),Wi=e=>new Uint8Array(e),qi=e=>{const t=Wi(e.byteLength);return t.set(e),t};class Pi{constructor(t,n){this.left=t,this.right=n}}const tt=(e,t)=>new Pi(e,t),Zi=(e,t)=>e.forEach(n=>t(n.left,n.right)),es=e=>e.next()>=.5,qe=(e,t,n)=>q(e.next()*(n+1-t)+t),Us=(e,t,n)=>q(e.next()*(n+1-t)+t),_n=(e,t,n)=>Us(e,t,n),Qi=e=>si(_n(e,97,122)),to=(e,t=0,n=20)=>{const s=_n(e,t,n);let r="";for(let i=0;i<s;i++)r+=Qi(e);return r},Pe=(e,t)=>t[_n(e,0,t.length-1)],eo=Symbol("0schema");class no{constructor(){this._rerrs=[]}extend(t,n,s,r=null){this._rerrs.push({path:t,expected:n,has:s,message:r})}toString(){const t=[];for(let n=this._rerrs.length-1;n>0;n--){const s=this._rerrs[n];t.push(_s(" ",(this._rerrs.length-n)*2)+`${s.path!=null?`[${s.path}] `:""}${s.has} doesn't match ${s.expected}. ${s.message}`)}return t.join(`
|
|
2
|
-
`)}}const on=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[qt]?As(e,t):Mt(e)?fn(e,n=>gn(t,s=>on(n,s))):$i(e)?le(e,(n,s)=>on(n,t[s])):!1;class N{static _dilutes=!1;extends(t){let[n,s]=[this.shape,t.shape];return this.constructor._dilutes&&([s,n]=[n,s]),on(n,s)}equals(t){return this.constructor===t.constructor&&me(this.shape,t.shape)}[eo](){return!0}[qt](t){return this.equals(t)}validate(t){return this.check(t)}check(t,n){X()}get nullable(){return jt(this,Ne)}get optional(){return new Ms(this)}cast(t){return ns(t,this),t}expect(t){return ns(t,this),t}}class bn extends N{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n=void 0){const s=t?.constructor===this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),s}}const D=(e,t=null)=>new bn(e,t);D(bn);class Sn extends N{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape(t);return!s&&n?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),s}}const x=e=>new Sn(e);D(Sn);class Ue extends N{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape.some(r=>r===t);return!s&&n?.extend(null,this.shape.join(" | "),t.toString()),s}}const ve=(...e)=>new Ue(e),vs=D(Ue),so=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),Ls=e=>{if(Rt.check(e))return[so(e)];if(vs.check(e))return e.shape.map(t=>t+"");if(Gs.check(e))return["[+-]?\\d+.?\\d*"];if(Js.check(e))return[".*"];if(Se.check(e))return e.shape.map(Ls).flat(1);v()};class ro extends N{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(Ls).map(n=>`(${n.join("|")})`).join("")+"$")}check(t,n){const s=this._r.exec(t)!=null;return!s&&n?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),s}}D(ro);const io=Symbol("optional");class Ms extends N{constructor(t){super(),this.shape=t}check(t,n){const s=t===void 0||this.shape.check(t);return!s&&n?.extend(null,"undefined (optional)","()"),s}get[io](){return!0}}const oo=D(Ms);class co extends N{check(t,n){return n?.extend(null,"never",typeof t),!1}}D(co);class Le extends N{constructor(t,n=!1){super(),this.shape=t,this._isPartial=n}static _dilutes=!0;get partial(){return new Le(this.shape,!0)}check(t,n){return t==null?(n?.extend(null,"object","null"),!1):le(this.shape,(s,r)=>{const i=this._isPartial&&!kn(t,r)||s.check(t[r],n);return!i&&n?.extend(r.toString(),s.toString(),typeof t[r],"Object property does not match"),i})}}const lo=e=>new Le(e),ho=D(Le),ao=x(e=>e!=null&&(e.constructor===Object||e.constructor==null));class Ns extends N{constructor(t,n){super(),this.shape={keys:t,values:n}}check(t,n){return t!=null&&le(t,(s,r)=>{const i=this.shape.keys.check(r,n);return!i&&n?.extend(r+"","Record",typeof t,i?"Key doesn't match schema":"Value doesn't match value"),i&&this.shape.values.check(s,n)})}}const Rs=(e,t)=>new Ns(e,t),uo=D(Ns);class $s extends N{constructor(t){super(),this.shape=t}check(t,n){return t!=null&&le(this.shape,(s,r)=>{const i=s.check(t[r],n);return!i&&n?.extend(r.toString(),"Tuple",typeof s),i})}}const fo=(...e)=>new $s(e);D($s);class Vs extends N{constructor(t){super(),this.shape=t.length===1?t[0]:new En(t)}check(t,n){const s=Mt(t)&&fn(t,r=>this.shape.check(r));return!s&&n?.extend(null,"Array",""),s}}const Fs=(...e)=>new Vs(e),go=D(Vs),po=x(e=>Mt(e));class Bs extends N{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n){const s=t instanceof this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name),s}}const wo=(e,t=null)=>new Bs(e,t);D(Bs);const mo=wo(N);class ko extends N{constructor(t){super(),this.len=t.length-1,this.args=fo(...t.slice(-1)),this.res=t[this.len]}check(t,n){const s=t.constructor===Function&&t.length<=this.len;return!s&&n?.extend(null,"function",typeof t),s}}const yo=D(ko),_o=x(e=>typeof e=="function");class bo extends N{constructor(t){super(),this.shape=t}check(t,n){const s=fn(this.shape,r=>r.check(t,n));return!s&&n?.extend(null,"Intersectinon",typeof t),s}}D(bo,e=>e.shape.length>0);class En extends N{static _dilutes=!0;constructor(t){super(),this.shape=t}check(t,n){const s=gn(this.shape,r=>r.check(t,n));return n?.extend(null,"Union",typeof t),s}}const jt=(...e)=>e.findIndex(t=>Se.check(t))>=0?jt(...e.map(t=>Zt(t)).map(t=>Se.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new En(e),Se=D(En),js=()=>!0,Ee=x(js),So=D(Sn,e=>e.shape===js),Cn=x(e=>typeof e=="bigint"),Eo=x(e=>e===Cn),zs=x(e=>typeof e=="symbol");x(e=>e===zs);const Lt=x(e=>typeof e=="number"),Gs=x(e=>e===Lt),Rt=x(e=>typeof e=="string"),Js=x(e=>e===Rt),Me=x(e=>typeof e=="boolean"),Co=x(e=>e===Me),Hs=ve(void 0);D(Ue,e=>e.shape.length===1&&e.shape[0]===void 0);ve(void 0);const Ne=ve(null),Do=D(Ue,e=>e.shape.length===1&&e.shape[0]===null);D(Uint8Array);D(bn,e=>e.shape===Uint8Array);const Ao=jt(Lt,Rt,Ne,Hs,Cn,Me,zs);(()=>{const e=Fs(Ee),t=Rs(Rt,Ee),n=jt(Lt,Rt,Ne,Me,e,t);return e.shape=n,t.shape.values=n,n})();const Zt=e=>{if(mo.check(e))return e;if(ao.check(e)){const t={};for(const n in e)t[n]=Zt(e[n]);return lo(t)}else{if(po.check(e))return jt(...e.map(Zt));if(Ao.check(e))return ve(e);if(_o.check(e))return D(e)}v()},ns=Yi?()=>{}:(e,t)=>{const n=new no;if(!t.check(e,n))throw P(`Expected value to be of type ${t.constructor.name}.
|
|
3
|
-
${n.toString()}`)};class Io{constructor(t){this.patterns=[],this.$state=t}if(t,n){return this.patterns.push({if:Zt(t),h:n}),this}else(t){return this.if(Ee,t)}done(){return(t,n)=>{for(let s=0;s<this.patterns.length;s++){const r=this.patterns[s];if(r.if.check(t))return r.h(t,n)}throw P("Unhandled pattern")}}}const To=e=>new Io(e),Ys=To(Ee).if(Gs,(e,t)=>qe(t,Yn,ye)).if(Js,(e,t)=>to(t)).if(Co,(e,t)=>es(t)).if(Eo,(e,t)=>BigInt(qe(t,Yn,ye))).if(Se,(e,t)=>vt(t,Pe(t,e.shape))).if(ho,(e,t)=>{const n={};for(const s in e.shape){let r=e.shape[s];if(oo.check(r)){if(es(t))continue;r=r.shape}n[s]=Ys(r,t)}return n}).if(go,(e,t)=>{const n=[],s=Us(t,0,42);for(let r=0;r<s;r++)n.push(vt(t,e.shape));return n}).if(vs,(e,t)=>Pe(t,e.shape)).if(Do,(e,t)=>null).if(yo,(e,t)=>{const n=vt(t,e.res);return()=>n}).if(So,(e,t)=>vt(t,Pe(t,[Lt,Rt,Ne,Hs,Cn,Me,Fs(Lt),Rs(jt("a","b","c"),Lt)]))).if(uo,(e,t)=>{const n={},s=qe(t,0,3);for(let r=0;r<s;r++){const i=vt(t,e.shape.keys),o=vt(t,e.shape.values);n[i]=o}return n}).done(),vt=(e,t)=>Ys(Zt(t),e),Q=typeof document<"u"?document:{},xo=e=>Q.createElement(e),Oo=()=>Q.createDocumentFragment();x(e=>e.nodeType===Fo);const Uo=e=>Q.createTextNode(e);typeof DOMParser<"u"&&new DOMParser;const vo=(e,t)=>(Zi(t,(n,s)=>{s===!1?e.removeAttribute(n):s===!0?e.setAttribute(n,""):e.setAttribute(n,s)}),e),Lo=e=>{const t=Oo();for(let n=0;n<e.length;n++)Xs(t,e[n]);return t},Mo=(e,t)=>(Xs(e,Lo(t)),e),vl=(e,t=[],n=[])=>Mo(vo(xo(e),t),n);x(e=>e.nodeType===Ro);const Ll=Uo;x(e=>e.nodeType===$o);const No=e=>Pr(e,(t,n)=>`${n}:${t};`).join(""),Xs=(e,t)=>e.appendChild(t),Ro=Q.ELEMENT_NODE,$o=Q.TEXT_NODE;Q.CDATA_SECTION_NODE;Q.COMMENT_NODE;const Vo=Q.DOCUMENT_NODE;Q.DOCUMENT_TYPE_NODE;const Fo=Q.DOCUMENT_FRAGMENT_NODE;x(e=>e.nodeType===Vo);const ot=Symbol,Ks=ot(),Ws=ot(),Bo=ot(),jo=ot(),zo=ot(),qs=ot(),Go=ot(),Dn=ot(),Jo=ot(),Ho=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let s=0;for(;s<e.length;s++){const r=e[s];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)t.push(r);else if(r.constructor===Object)break}for(s>0&&n.push(t.join(""));s<e.length;s++){const r=e[s];r instanceof Symbol||n.push(r)}return n},Yo={[Ks]:tt("font-weight","bold"),[Ws]:tt("font-weight","normal"),[Bo]:tt("color","blue"),[zo]:tt("color","green"),[jo]:tt("color","grey"),[qs]:tt("color","red"),[Go]:tt("color","purple"),[Dn]:tt("color","orange"),[Jo]:tt("color","black")},Xo=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],s=T();let r=[],i=0;for(;i<e.length;i++){const o=e[i],c=Yo[o];if(c!==void 0)s.set(c.left,c.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const l=No(s);i>0||l.length>0?(t.push("%c"+o),n.push(l)):t.push(o)}else break}}for(i>0&&(r=n,r.unshift(t.join("")));i<e.length;i++){const o=e[i];o instanceof Symbol||r.push(o)}return r},Ps=Ki?Xo:Ho,cn=(...e)=>{console.log(...Ps(e)),Qs.forEach(t=>t.print(e))},Zs=(...e)=>{console.warn(...Ps(e)),e.unshift(Dn),Qs.forEach(t=>t.print(e))},Qs=Et(),tr=e=>({[Symbol.iterator](){return this},next:e}),Ko=(e,t)=>tr(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Ze=(e,t)=>tr(()=>{const{done:n,value:s}=e.next();return{done:n,value:n?void 0:t(s)}});class Wo extends pn{constructor(t,n){super(),this.doc=t,this.awareness=n}}class Re{constructor(t,n){this.clock=t,this.len=n}}class zt{constructor(){this.clients=new Map}}const Ct=(e,t,n)=>t.clients.forEach((s,r)=>{const i=e.doc.store.clients.get(r);if(i!=null){const o=i[i.length-1],c=o.id.clock+o.length;for(let l=0,a=s[l];l<s.length&&a.clock<c;a=s[++l])dr(e,i,a.clock,a.len,n)}}),qo=(e,t)=>{let n=0,s=e.length-1;for(;n<=s;){const r=q((n+s)/2),i=e[r],o=i.clock;if(o<=t){if(t<o+i.len)return r;n=r+1}else s=r-1}return null},xt=(e,t)=>{const n=e.clients.get(t.client);return n!==void 0&&qo(n,t.clock)!==null},An=e=>{e.clients.forEach(t=>{t.sort((r,i)=>r.clock-i.clock);let n,s;for(n=1,s=1;n<t.length;n++){const r=t[s-1],i=t[n];r.clock+r.len>=i.clock?t[s-1]=new Re(r.clock,Tt(r.len,i.clock+i.len-r.clock)):(s<n&&(t[s]=i),s++)}t.length=s})},Dt=e=>{const t=new zt;for(let n=0;n<e.length;n++)e[n].clients.forEach((s,r)=>{if(!t.clients.has(r)){const i=s.slice();for(let o=n+1;o<e.length;o++)Qr(i,e[o].clients.get(r)||[]);t.clients.set(r,i)}});return An(t),t},Qt=(e,t,n,s)=>{R(e.clients,t,()=>[]).push(new Re(n,s))},$e=()=>new zt,In=e=>{const t=$e();return e.clients.forEach((n,s)=>{const r=[];for(let i=0;i<n.length;i++){const o=n[i];if(o.deleted){const c=o.id.clock;let l=o.length;if(i+1<n.length)for(let a=n[i+1];i+1<n.length&&a.deleted;a=n[++i+1])l+=a.length;r.push(new Re(c,l))}}r.length>0&&t.clients.set(s,r)}),t},Z=(e,t)=>{p(e.restEncoder,t.clients.size),st(t.clients.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{e.resetDsCurVal(),p(e.restEncoder,n);const r=s.length;p(e.restEncoder,r);for(let i=0;i<r;i++){const o=s[i];e.writeDsClock(o.clock),e.writeDsLen(o.len)}})},rt=e=>{const t=new zt,n=m(e.restDecoder);for(let s=0;s<n;s++){e.resetDsCurVal();const r=m(e.restDecoder),i=m(e.restDecoder);if(i>0){const o=R(t.clients,r,()=>[]);for(let c=0;c<i;c++)o.push(new Re(e.readDsClock(),e.readDsLen()))}}return t},ss=(e,t,n)=>{const s=new zt,r=m(e.restDecoder);for(let i=0;i<r;i++){e.resetDsCurVal();const o=m(e.restDecoder),c=m(e.restDecoder),l=n.clients.get(o)||[],a=E(n,o);for(let h=0;h<c;h++){const u=e.readDsClock(),d=u+e.readDsLen();if(u<a){a<d&&Qt(s,o,a,d-a);let f=G(l,u),g=l[f];for(!g.deleted&&g.id.clock<u&&(l.splice(f+1,0,Ae(t,g,u-g.id.clock)),f++);f<l.length&&(g=l[f++],g.id.clock<d);)g.deleted||(d<g.id.clock+g.length&&l.splice(f,0,Ae(t,g,d-g.id.clock)),g.delete(t))}else Qt(s,o,u,d-u)}}if(s.clients.size>0){const i=new K;return p(i.restEncoder,0),Z(i,s),i.toUint8Array()}return null},er=(e,t)=>{if(e.clients.size!==t.clients.size)return!1;for(const[n,s]of e.clients.entries()){const r=t.clients.get(n);if(r===void 0||s.length!==r.length)return!1;for(let i=0;i<s.length;i++){const o=s[i],c=r[i];if(o.clock!==c.clock||o.len!==c.len)return!1}}return!0},nr=Cs;class gt extends pn{constructor({guid:t=vi(),collectionid:n=null,gc:s=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super(),this.gc=s,this.gcFilter=r,this.clientID=nr(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new ar,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Qn(a=>{this.on("load",()=>{this.isLoaded=!0,a(this)})});const l=()=>Qn(a=>{const h=u=>{(u===void 0||u===!0)&&(this.off("sync",h),a())};this.on("sync",h)});this.on("sync",a=>{a===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=a===void 0||a===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&_(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(st(this.subdocs).map(t=>t.guid))}transact(t,n=null){return _(this,t,n)}get(t,n=A){const s=R(this.share,t,()=>{const i=new n;return i._integrate(this,null),i}),r=s.constructor;if(n!==A&&r!==n)if(r===A){const i=new n;i._map=s._map,s._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=s._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=s._length,this.share.set(t,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return s}getArray(t=""){return this.get(t,nt)}getText(t=""){return this.get(t,At)}getMap(t=""){return this.get(t,ut)}getXmlElement(t=""){return this.get(t,ft)}getXmlFragment(t=""){return this.get(t,dt)}toJSON(){const t={};return this.share.forEach((n,s)=>{t[s]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,st(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new gt({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,_(t.parent.doc,s=>{const r=n.doc;t.deleted||s.subdocsAdded.add(r),s.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class te{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return m(this.restDecoder)}readDsLen(){return m(this.restDecoder)}}class H extends te{readLeftID(){return w(m(this.restDecoder),m(this.restDecoder))}readRightID(){return w(m(this.restDecoder),m(this.restDecoder))}readClient(){return m(this.restDecoder)}readInfo(){return Nt(this.restDecoder)}readString(){return _t(this.restDecoder)}readParentInfo(){return m(this.restDecoder)===1}readTypeRef(){return m(this.restDecoder)}readLen(){return m(this.restDecoder)}readAny(){return Wt(this.restDecoder)}readBuf(){return qi(F(this.restDecoder))}readJSON(){return JSON.parse(_t(this.restDecoder))}readKey(){return _t(this.restDecoder)}}class sr{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=m(this.restDecoder),this.dsCurrVal}readDsLen(){const t=m(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class j extends sr{constructor(t){super(t),this.keys=[],m(t),this.keyClockDecoder=new We(F(t)),this.clientDecoder=new we(F(t)),this.leftClockDecoder=new We(F(t)),this.rightClockDecoder=new We(F(t)),this.infoDecoder=new Zn(F(t),Nt),this.stringDecoder=new xi(F(t)),this.parentInfoDecoder=new Zn(F(t),Nt),this.typeRefDecoder=new we(F(t)),this.lenDecoder=new we(F(t))}readLeftID(){return new bt(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new bt(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Wt(this.restDecoder)}readBuf(){return F(this.restDecoder)}readJSON(){return Wt(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class $t{constructor(){this.restEncoder=Bt()}toUint8Array(){return z(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){p(this.restEncoder,t)}writeDsLen(t){p(this.restEncoder,t)}}class pt extends $t{writeLeftID(t){p(this.restEncoder,t.client),p(this.restEncoder,t.clock)}writeRightID(t){p(this.restEncoder,t.client),p(this.restEncoder,t.clock)}writeClient(t){p(this.restEncoder,t)}writeInfo(t){Xt(this.restEncoder,t)}writeString(t){yt(this.restEncoder,t)}writeParentInfo(t){p(this.restEncoder,t?1:0)}writeTypeRef(t){p(this.restEncoder,t)}writeLen(t){p(this.restEncoder,t)}writeAny(t){Kt(this.restEncoder,t)}writeBuf(t){V(this.restEncoder,t)}writeJSON(t){yt(this.restEncoder,JSON.stringify(t))}writeKey(t){yt(this.restEncoder,t)}}class Ve{constructor(){this.restEncoder=Bt(),this.dsCurrVal=0}toUint8Array(){return z(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const n=t-this.dsCurrVal;this.dsCurrVal=t,p(this.restEncoder,n)}writeDsLen(t){t===0&&v(),p(this.restEncoder,t-1),this.dsCurrVal+=t}}class K extends Ve{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ke,this.clientEncoder=new pe,this.leftClockEncoder=new Ke,this.rightClockEncoder=new Ke,this.infoEncoder=new Wn(Xt),this.stringEncoder=new bi,this.parentInfoEncoder=new Wn(Xt),this.typeRefEncoder=new pe,this.lenEncoder=new pe}toUint8Array(){const t=Bt();return p(t,0),V(t,this.keyClockEncoder.toUint8Array()),V(t,this.clientEncoder.toUint8Array()),V(t,this.leftClockEncoder.toUint8Array()),V(t,this.rightClockEncoder.toUint8Array()),V(t,z(this.infoEncoder)),V(t,this.stringEncoder.toUint8Array()),V(t,z(this.parentInfoEncoder)),V(t,this.typeRefEncoder.toUint8Array()),V(t,this.lenEncoder.toUint8Array()),ce(t,z(this.restEncoder)),z(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){Kt(this.restEncoder,t)}writeBuf(t){V(this.restEncoder,t)}writeJSON(t){Kt(this.restEncoder,t)}writeKey(t){const n=this.keyMap.get(t);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(n)}}const Po=(e,t,n,s)=>{s=Tt(s,t[0].id.clock);const r=G(t,s);p(e.restEncoder,t.length-r),e.writeClient(n),p(e.restEncoder,s);const i=t[r];i.write(e,s-i.id.clock);for(let o=r+1;o<t.length;o++)t[o].write(e,0)},Tn=(e,t,n)=>{const s=new Map;n.forEach((r,i)=>{E(t,i)>r&&s.set(i,r)}),he(t).forEach((r,i)=>{n.has(i)||s.set(i,0)}),p(e.restEncoder,s.size),st(s.entries()).sort((r,i)=>i[0]-r[0]).forEach(([r,i])=>{Po(e,t.clients.get(r),r,i)})},Zo=(e,t)=>{const n=T(),s=m(e.restDecoder);for(let r=0;r<s;r++){const i=m(e.restDecoder),o=new Array(i),c=e.readClient();let l=m(e.restDecoder);n.set(c,{i:0,refs:o});for(let a=0;a<i;a++){const h=e.readInfo();switch(Ie&h){case 0:{const u=e.readLen();o[a]=new $(w(c,l),u),l+=u;break}case 10:{const u=m(e.restDecoder);o[a]=new M(w(c,l),u),l+=u;break}default:{const u=(h&(et|B))===0,d=new y(w(c,l),null,(h&B)===B?e.readLeftID():null,null,(h&et)===et?e.readRightID():null,u?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,u&&(h&Ht)===Ht?e.readString():null,Kr(e,h));o[a]=d,l+=d.length}}}}return n},Qo=(e,t,n)=>{const s=[];let r=st(n.keys()).sort((f,g)=>f-g);if(r.length===0)return null;const i=()=>{if(r.length===0)return null;let f=n.get(r[r.length-1]);for(;f.refs.length===f.i;)if(r.pop(),r.length>0)f=n.get(r[r.length-1]);else return null;return f};let o=i();if(o===null)return null;const c=new ar,l=new Map,a=(f,g)=>{const k=l.get(f);(k==null||k>g)&&l.set(f,g)};let h=o.refs[o.i++];const u=new Map,d=()=>{for(const f of s){const g=f.id.client,k=n.get(g);k?(k.i--,c.clients.set(g,k.refs.slice(k.i)),n.delete(g),k.i=0,k.refs=[]):c.clients.set(g,[f]),r=r.filter(b=>b!==g)}s.length=0};for(;;){if(h.constructor!==M){const g=R(u,h.id.client,()=>E(t,h.id.client))-h.id.clock;if(g<0)s.push(h),a(h.id.client,h.id.clock-1),d();else{const k=h.getMissing(e,t);if(k!==null){s.push(h);const b=n.get(k)||{refs:[],i:0};if(b.refs.length===b.i)a(k,E(t,k)),d();else{h=b.refs[b.i++];continue}}else(g===0||g<h.length)&&(h.integrate(e,g),u.set(h.id.client,h.id.clock+h.length))}}if(s.length>0)h=s.pop();else if(o!==null&&o.i<o.refs.length)h=o.refs[o.i++];else{if(o=i(),o===null)break;h=o.refs[o.i++]}}if(c.clients.size>0){const f=new K;return Tn(f,c,new Map),p(f.restEncoder,0),{missing:l,update:f.toUint8Array()}}return null},tc=(e,t)=>Tn(e,t.doc.store,t.beforeState),xn=(e,t,n,s=new j(e))=>_(t,r=>{r.local=!1;let i=!1;const o=r.doc,c=o.store,l=Zo(s,o),a=Qo(r,c,l),h=c.pendingStructs;if(h){for(const[d,f]of h.missing)if(f<E(c,d)){i=!0;break}if(a){for(const[d,f]of a.missing){const g=h.missing.get(d);(g==null||g>f)&&h.missing.set(d,f)}h.update=ne([h.update,a.update])}}else c.pendingStructs=a;const u=ss(s,r,c);if(c.pendingDs){const d=new j(L(c.pendingDs));m(d.restDecoder);const f=ss(d,r,c);u&&f?c.pendingDs=ne([u,f]):c.pendingDs=u||f}else c.pendingDs=u;if(i){const d=c.pendingStructs.update;c.pendingStructs=null,Fe(r.doc,d)}},n,!1),ec=(e,t,n)=>xn(e,t,n,new H(e)),Fe=(e,t,n,s=j)=>{const r=L(t);xn(r,e,n,new s(r))},nc=(e,t,n)=>Fe(e,t,n,H),sc=(e,t,n=new Map)=>{Tn(e,t.store,n),Z(e,In(t.store))},rr=(e,t=new Uint8Array([0]),n=new K)=>{const s=On(t);sc(n,e,s);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Rn(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===pt)return yr(r.map((i,o)=>o===0?i:Cr(i)));if(n.constructor===K)return ne(r)}return r[0]},rc=(e,t)=>rr(e,t,new pt),ir=e=>{const t=new Map,n=m(e.restDecoder);for(let s=0;s<n;s++){const r=m(e.restDecoder),i=m(e.restDecoder);t.set(r,i)}return t},On=e=>ir(new te(L(e))),Un=(e,t)=>(p(e.restEncoder,t.size),st(t.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{p(e.restEncoder,n),p(e.restEncoder,s)}),e),ic=(e,t)=>Un(e,he(t.store)),oc=(e,t=new Ve)=>(e instanceof Map?Un(t,e):ic(t,e),t.toUint8Array()),cc=e=>oc(e,new $t);class lc{constructor(){this.l=[]}}const rs=()=>new lc,is=(e,t)=>e.l.push(t),os=(e,t)=>{const n=e.l,s=n.length;e.l=n.filter(r=>t!==r),s===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},or=(e,t,n)=>yn(e.l,[t,n]);class bt{constructor(t,n){this.client=t,this.clock=n}}const mt=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,w=(e,t)=>new bt(e,t),cs=(e,t)=>{p(e,t.client),p(e,t.clock)},ls=e=>w(m(e),m(e)),vn=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw v()},ee=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},hc=e=>{const t=[];let n=e._start;for(;n;)t.push(n),n=n.right;console.log("Children: ",t),console.log("Children content: ",t.filter(s=>!s.deleted).map(s=>s.content))};class ac{constructor(t,n=t.getMap("users")){const s=new Map;this.yusers=n,this.doc=t,this.clients=new Map,this.dss=s;const r=(i,o)=>{const c=i.get("ds"),l=i.get("ids"),a=h=>this.clients.set(h,o);c.observe(h=>{h.changes.added.forEach(u=>{u.content.getContent().forEach(d=>{d instanceof Uint8Array&&this.dss.set(o,Dt([this.dss.get(o)||$e(),rt(new te(L(d)))]))})})}),this.dss.set(o,Dt(c.map(h=>rt(new te(L(h)))))),l.observe(h=>h.changes.added.forEach(u=>u.content.getContent().forEach(a))),l.forEach(a)};n.observe(i=>{i.keysChanged.forEach(o=>r(n.get(o),o))}),n.forEach(r)}setUserMapping(t,n,s,{filter:r=()=>!0}={}){const i=this.yusers;let o=i.get(s);o||(o=new ut,o.set("ids",new nt),o.set("ds",new nt),i.set(s,o)),o.get("ids").push([n]),i.observe(c=>{setTimeout(()=>{const l=i.get(s);if(l!==o){o=l,this.clients.forEach((u,d)=>{s===u&&o.get("ids").push([d])});const a=new $t,h=this.dss.get(s);h&&(Z(a,h),o.get("ds").push([a.toUint8Array()]))}},0)}),t.on("afterTransaction",c=>{setTimeout(()=>{const l=o.get("ds"),a=c.deleteSet;if(c.local&&a.clients.size>0&&r(c,a)){const h=new $t;Z(h,a),l.push([h.toUint8Array()])}})})}getUserByClientId(t){return this.clients.get(t)||null}getUserByDeletedId(t){for(const[n,s]of this.dss.entries())if(xt(s,t))return n;return null}}class Be{constructor(t,n,s,r=0){this.type=t,this.tname=n,this.item=s,this.assoc=r}}const uc=e=>{const t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},dc=e=>new Be(e.type==null?null:w(e.type.client,e.type.clock),e.tname??null,e.item==null?null:w(e.item.client,e.item.clock),e.assoc==null?0:e.assoc);class cr{constructor(t,n,s=0){this.type=t,this.index=n,this.assoc=s}}const fc=(e,t,n=0)=>new cr(e,t,n),ue=(e,t,n)=>{let s=null,r=null;return e._item===null?r=vn(e):s=w(e._item.id.client,e._item.id.clock),new Be(s,r,t,n)},gc=(e,t,n=0)=>{let s=e._start;if(n<0){if(t===0)return ue(e,null,n);t--}for(;s!==null;){if(!s.deleted&&s.countable){if(s.length>t)return ue(e,w(s.id.client,s.id.clock+t),n);t-=s.length}if(s.right===null&&n<0)return ue(e,s.lastId,n);s=s.right}return ue(e,null,n)},pc=(e,t)=>{const{type:n,tname:s,item:r,assoc:i}=t;if(r!==null)p(e,0),cs(e,r);else if(s!==null)Xt(e,1),yt(e,s);else if(n!==null)Xt(e,2),cs(e,n);else throw v();return Te(e,i),e},wc=e=>{const t=Bt();return pc(t,e),z(t)},mc=e=>{let t=null,n=null,s=null;switch(m(e)){case 0:s=ls(e);break;case 1:n=_t(e);break;case 2:t=ls(e)}const r=Es(e)?Oe(e):0;return new Be(t,n,s,r)},kc=e=>mc(L(e)),yc=(e,t)=>{const n=St(e,t),s=t.clock-n.id.clock;return{item:n,diff:s}},_c=(e,t,n=!0)=>{const s=t.store,r=e.item,i=e.type,o=e.tname,c=e.assoc;let l=null,a=0;if(r!==null){if(E(s,r.client)<=r.clock)return null;const h=n?dn(s,r):yc(s,r),u=h.item;if(!(u instanceof y))return null;if(l=u.parent,l._item===null||!l._item.deleted){a=u.deleted||!u.countable?0:h.diff+(c>=0?0:1);let d=u.left;for(;d!==null;)!d.deleted&&d.countable&&(a+=d.length),d=d.left}}else{if(o!==null)l=t.get(o);else if(i!==null){if(E(s,i.client)<=i.clock)return null;const{item:h}=n?dn(s,i):{item:St(s,i)};if(h instanceof y&&h.content instanceof Y)l=h.content.type;else return null}else throw v();c>=0?a=l._length:a=0}return fc(l,a,e.assoc)},bc=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&mt(e.item,t.item)&&mt(e.type,t.type)&&e.assoc===t.assoc;class Ln{constructor(t,n){this.ds=t,this.sv=n}}const Sc=(e,t)=>{const n=e.ds.clients,s=t.ds.clients,r=e.sv,i=t.sv;if(r.size!==i.size||n.size!==s.size)return!1;for(const[o,c]of r.entries())if(i.get(o)!==c)return!1;for(const[o,c]of n.entries()){const l=s.get(o)||[];if(c.length!==l.length)return!1;for(let a=0;a<c.length;a++){const h=c[a],u=l[a];if(h.clock!==u.clock||h.len!==u.len)return!1}}return!0},lr=(e,t=new Ve)=>(Z(t,e.ds),Un(t,e.sv),t.toUint8Array()),Ec=e=>lr(e,new $t),hr=(e,t=new sr(L(e)))=>new Ln(rt(t),ir(t)),Cc=e=>hr(e,new te(L(e))),Mn=(e,t)=>new Ln(e,t),Dc=Mn($e(),new Map),Ac=e=>Mn(In(e.store),he(e.store)),lt=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!xt(t.ds,e.id),ln=(e,t)=>{const n=R(e.meta,ln,Et),s=e.doc.store;n.has(t)||(t.sv.forEach((r,i)=>{r<E(s,i)&&U(e,w(i,r))}),Ct(e,t.ds,r=>{}),n.add(t))},Ic=(e,t,n=new gt)=>{if(e.gc)throw new Error("Garbage-collection must be disabled in `originDoc`!");const{sv:s,ds:r}=t,i=new K;return e.transact(o=>{let c=0;s.forEach(l=>{l>0&&c++}),p(i.restEncoder,c);for(const[l,a]of s){if(a===0)continue;a<E(e.store,l)&&U(o,w(l,a));const h=e.store.clients.get(l)||[],u=G(h,a-1);p(i.restEncoder,u+1),i.writeClient(l),p(i.restEncoder,0);for(let d=0;d<=u;d++)h[d].write(i,0)}Z(i,r)}),Fe(n,i.toUint8Array(),"snapshot"),n},Tc=(e,t,n=j)=>{const s=new n(L(t)),r=new wt(s,!1);for(let o=r.curr;o!==null;o=r.next())if((e.sv.get(o.id.client)||0)<o.id.clock+o.length)return!1;const i=Dt([e.ds,rt(s)]);return er(e.ds,i)},xc=(e,t)=>Tc(e,t,H);class ar{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const he=e=>{const t=new Map;return e.clients.forEach((n,s)=>{const r=n[n.length-1];t.set(s,r.id.clock+r.length)}),t},E=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const s=n[n.length-1];return s.id.clock+s.length},ur=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const s=n[n.length-1];if(s.id.clock+s.length!==t.id.clock)throw v()}n.push(t)},G=(e,t)=>{let n=0,s=e.length-1,r=e[s],i=r.id.clock;if(i===t)return s;let o=q(t/(i+r.length-1)*s);for(;n<=s;){if(r=e[o],i=r.id.clock,i<=t){if(t<i+r.length)return o;n=o+1}else s=o-1;o=q((n+s)/2)}throw v()},Oc=(e,t)=>{const n=e.clients.get(t.client);return n[G(n,t.clock)]},St=Oc,hn=(e,t,n)=>{const s=G(t,n),r=t[s];return r.id.clock<n&&r instanceof y?(t.splice(s+1,0,Ae(e,r,n-r.id.clock)),s+1):s},U=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[hn(e,n,t.clock)]},an=(e,t,n)=>{const s=t.clients.get(n.client),r=G(s,n.clock),i=s[r];return n.clock!==i.id.clock+i.length-1&&i.constructor!==$&&s.splice(r+1,0,Ae(e,i,n.clock-i.id.clock+1)),i},Uc=(e,t,n)=>{const s=e.clients.get(t.id.client);s[G(s,t.id.clock)]=n},dr=(e,t,n,s,r)=>{if(s===0)return;const i=n+s;let o=hn(e,t,n),c;do c=t[o++],i<c.id.clock+c.length&&hn(e,t,i),r(c);while(o<t.length&&t[o].id.clock<i)};class fr{constructor(t,n,s){this.doc=t,this.deleteSet=new zt,this.beforeState=he(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=s,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const hs=(e,t)=>t.deleteSet.clients.size===0&&!Zr(t.afterState,(n,s)=>t.beforeState.get(s)!==n)?!1:(An(t.deleteSet),tc(e,t),Z(e,t.deleteSet),!0),as=(e,t,n)=>{const s=t._item;(s===null||s.id.clock<(e.beforeState.get(s.id.client)||0)&&!s.deleted)&&R(e.changed,t,Et).add(n)},ke=(e,t)=>{let n=e[t],s=e[t-1],r=t;for(;r>0;n=s,s=e[--r-1]){if(s.deleted===n.deleted&&s.constructor===n.constructor&&s.mergeWith(n)){n instanceof y&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,s);continue}break}const i=t-r;return i&&e.splice(t+1-i,i),i},gr=(e,t,n)=>{for(const[s,r]of e.clients.entries()){const i=t.clients.get(s);for(let o=r.length-1;o>=0;o--){const c=r[o],l=c.clock+c.len;for(let a=G(i,c.clock),h=i[a];a<i.length&&h.id.clock<l;h=i[++a]){const u=i[a];if(c.clock+c.len<=u.id.clock)break;u instanceof y&&u.deleted&&!u.keep&&n(u)&&u.gc(t,!1)}}}},pr=(e,t)=>{e.clients.forEach((n,s)=>{const r=t.clients.get(s);for(let i=n.length-1;i>=0;i--){const o=n[i],c=ks(r.length-1,1+G(r,o.clock+o.len-1));for(let l=c,a=r[l];l>0&&a.id.clock>=o.clock;a=r[l])l-=1+ke(r,l)}})},vc=(e,t,n)=>{gr(e,t,n),pr(e,t)},wr=(e,t)=>{if(t<e.length){const n=e[t],s=n.doc,r=s.store,i=n.deleteSet,o=n._mergeStructs;try{An(i),n.afterState=he(n.doc.store),s.emit("beforeObserverCalls",[n,s]);const c=[];n.changed.forEach((l,a)=>c.push(()=>{(a._item===null||!a._item.deleted)&&a._callObserver(n,l)})),c.push(()=>{n.changedParentTypes.forEach((l,a)=>{a._dEH.l.length>0&&(a._item===null||!a._item.deleted)&&(l=l.filter(h=>h.target._item===null||!h.target._item.deleted),l.forEach(h=>{h.currentTarget=a,h._path=null}),l.sort((h,u)=>h.path.length-u.path.length),c.push(()=>{or(a._dEH,l,n)}))}),c.push(()=>s.emit("afterTransaction",[n,s])),c.push(()=>{n._needFormattingCleanup&&sl(n)})}),yn(c,[])}finally{s.gc&&gr(i,r,s.gcFilter),pr(i,r),n.afterState.forEach((h,u)=>{const d=n.beforeState.get(u)||0;if(d!==h){const f=r.clients.get(u),g=Tt(G(f,d),1);for(let k=f.length-1;k>=g;)k-=1+ke(f,k)}});for(let h=o.length-1;h>=0;h--){const{client:u,clock:d}=o[h].id,f=r.clients.get(u),g=G(f,d);g+1<f.length&&ke(f,g+1)>1||g>0&&ke(f,g)}if(!n.local&&n.afterState.get(s.clientID)!==n.beforeState.get(s.clientID)&&(cn(Dn,Ks,"[yjs] ",Ws,qs,"Changed the client-id because another client seems to be using it."),s.clientID=nr()),s.emit("afterTransactionCleanup",[n,s]),s._observers.has("update")){const h=new pt;hs(h,n)&&s.emit("update",[h.toUint8Array(),n.origin,s,n])}if(s._observers.has("updateV2")){const h=new K;hs(h,n)&&s.emit("updateV2",[h.toUint8Array(),n.origin,s,n])}const{subdocsAdded:c,subdocsLoaded:l,subdocsRemoved:a}=n;(c.size>0||a.size>0||l.size>0)&&(c.forEach(h=>{h.clientID=s.clientID,h.collectionid==null&&(h.collectionid=s.collectionid),s.subdocs.add(h)}),a.forEach(h=>s.subdocs.delete(h)),s.emit("subdocs",[{loaded:l,added:c,removed:a},s,n]),a.forEach(h=>h.destroy())),e.length<=t+1?(s._transactionCleanups=[],s.emit("afterAllTransactions",[s,e])):wr(e,t+1)}}},_=(e,t,n=null,s=!0)=>{const r=e._transactionCleanups;let i=!1,o=null;e._transaction===null&&(i=!0,e._transaction=new fr(e,n,s),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{o=t(e._transaction)}finally{if(i){const c=e._transaction===r[0];e._transaction=null,c&&wr(r,0)}}return o};class Lc{constructor(t,n){this.insertions=n,this.deletions=t,this.meta=new Map}}const us=(e,t,n)=>{Ct(e,n.deletions,s=>{s instanceof y&&t.scope.some(r=>r===e.doc||ee(r,s))&&jn(s,!1)})},ds=(e,t,n)=>{let s=null;const r=e.doc,i=e.scope;_(r,c=>{for(;t.length>0&&e.currStackItem===null;){const l=r.store,a=t.pop(),h=new Set,u=[];let d=!1;Ct(c,a.insertions,f=>{if(f instanceof y){if(f.redone!==null){let{item:g,diff:k}=dn(l,f.id);k>0&&(g=U(c,w(g.id.client,g.id.clock+k))),f=g}!f.deleted&&i.some(g=>g===c.doc||ee(g,f))&&u.push(f)}}),Ct(c,a.deletions,f=>{f instanceof y&&i.some(g=>g===c.doc||ee(g,f))&&!xt(a.insertions,f.id)&&h.add(f)}),h.forEach(f=>{d=Xr(c,f,h,a.insertions,e.ignoreRemoteMapChanges,e)!==null||d});for(let f=u.length-1;f>=0;f--){const g=u[f];e.deleteFilter(g)&&(g.delete(c),d=!0)}e.currStackItem=d?a:null}c.changed.forEach((l,a)=>{l.has(null)&&a._searchMarker&&(a._searchMarker.length=0)}),s=c},e);const o=e.currStackItem;if(o!=null){const c=s.changedParentTypes;e.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:c,origin:e},e]),e.currStackItem=null}return o};class Mc extends pn{constructor(t,{captureTimeout:n=500,captureTransaction:s=l=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=Mt(t)?t[0].doc:t instanceof gt?t:t.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(t),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=s,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(b=>l.changedParentTypes.has(b)||b===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const a=this.undoing,h=this.redoing,u=a?this.redoStack:this.undoStack;a?this.stopCapturing():h||this.clear(!1,!0);const d=new zt;l.afterState.forEach((b,S)=>{const zn=l.beforeState.get(S)||0,Gn=b-zn;Gn>0&&Qt(d,S,zn,Gn)});const f=Li();let g=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&u.length>0&&!a&&!h){const b=u[u.length-1];b.deletions=Dt([b.deletions,l.deleteSet]),b.insertions=Dt([b.insertions,d])}else u.push(new Lc(l.deleteSet,d)),g=!0;!a&&!h&&(this.lastChange=f),Ct(l,l.deleteSet,b=>{b instanceof y&&this.scope.some(S=>S===l.doc||ee(S,b))&&jn(b,!0)});const k=[{stackItem:u[u.length-1],origin:l.origin,type:a?"redo":"undo",changedParentTypes:l.changedParentTypes},this];g?this.emit("stack-item-added",k):this.emit("stack-item-updated",k)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){const n=new Set(this.scope);t=Mt(t)?t:[t],t.forEach(s=>{n.has(s)||(n.add(s),(s instanceof A?s.doc!==this.doc:s!==this.doc)&&Zs("[yjs#509] Not same Y.Doc"),this.scope.push(s))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,n=!0){(t&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(s=>{t&&(this.undoStack.forEach(r=>us(s,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>us(s,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=ds(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=ds(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*Nc(e){const t=m(e.restDecoder);for(let n=0;n<t;n++){const s=m(e.restDecoder),r=e.readClient();let i=m(e.restDecoder);for(let o=0;o<s;o++){const c=e.readInfo();if(c===10){const l=m(e.restDecoder);yield new M(w(r,i),l),i+=l}else if((Ie&c)!==0){const l=(c&(et|B))===0,a=new y(w(r,i),null,(c&B)===B?e.readLeftID():null,null,(c&et)===et?e.readRightID():null,l?e.readParentInfo()?e.readString():e.readLeftID():null,l&&(c&Ht)===Ht?e.readString():null,Kr(e,c));yield a,i+=a.length}else{const l=e.readLen();yield new $(w(r,i),l),i+=l}}}}class wt{constructor(t,n){this.gen=Nc(t),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===M);return this.curr}}const Rc=e=>mr(e,H),mr=(e,t=j)=>{const n=[],s=new t(L(e)),r=new wt(s,!1);for(let o=r.curr;o!==null;o=r.next())n.push(o);cn("Structs: ",n);const i=rt(s);cn("DeleteSet: ",i)},$c=e=>kr(e,H),kr=(e,t=j)=>{const n=[],s=new t(L(e)),r=new wt(s,!1);for(let i=r.curr;i!==null;i=r.next())n.push(i);return{structs:n,ds:rt(s)}};class Nn{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}const yr=e=>ne(e,H,pt),_r=(e,t=Ve,n=j)=>{const s=new t,r=new wt(new n(L(e)),!1);let i=r.curr;if(i!==null){let o=0,c=i.id.client,l=i.id.clock!==0,a=l?0:i.id.clock+i.length;for(;i!==null;i=r.next())c!==i.id.client&&(a!==0&&(o++,p(s.restEncoder,c),p(s.restEncoder,a)),c=i.id.client,a=0,l=i.id.clock!==0),i.constructor===M&&(l=!0),l||(a=i.id.clock+i.length);a!==0&&(o++,p(s.restEncoder,c),p(s.restEncoder,a));const h=Bt();return p(h,o),wi(h,s.restEncoder),s.restEncoder=h,s.toUint8Array()}else return p(s.restEncoder,0),s.toUint8Array()},Vc=e=>_r(e,$t,H),br=(e,t=j)=>{const n=new Map,s=new Map,r=new wt(new t(L(e)),!1);let i=r.curr;if(i!==null){let o=i.id.client,c=i.id.clock;for(n.set(o,c);i!==null;i=r.next())o!==i.id.client&&(s.set(o,c),n.set(i.id.client,i.id.clock),o=i.id.client),c=i.id.clock+i.length;s.set(o,c)}return{from:n,to:s}},Fc=e=>br(e,H),Bc=(e,t)=>{if(e.constructor===$){const{client:n,clock:s}=e.id;return new $(w(n,s+t),e.length-t)}else if(e.constructor===M){const{client:n,clock:s}=e.id;return new M(w(n,s+t),e.length-t)}else{const n=e,{client:s,clock:r}=n.id;return new y(w(s,r+t),null,w(s,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},ne=(e,t=j,n=K)=>{if(e.length===1)return e[0];const s=e.map(h=>new t(L(h)));let r=s.map(h=>new wt(h,!0)),i=null;const o=new n,c=new Nn(o);for(;r=r.filter(d=>d.curr!==null),r.sort((d,f)=>{if(d.curr.id.client===f.curr.id.client){const g=d.curr.id.clock-f.curr.id.clock;return g===0?d.curr.constructor===f.curr.constructor?0:d.curr.constructor===M?1:-1:g}else return f.curr.id.client-d.curr.id.client}),r.length!==0;){const h=r[0],u=h.curr.id.client;if(i!==null){let d=h.curr,f=!1;for(;d!==null&&d.id.clock+d.length<=i.struct.id.clock+i.struct.length&&d.id.client>=i.struct.id.client;)d=h.next(),f=!0;if(d===null||d.id.client!==u||f&&d.id.clock>i.struct.id.clock+i.struct.length)continue;if(u!==i.struct.id.client)ht(c,i.struct,i.offset),i={struct:d,offset:0},h.next();else if(i.struct.id.clock+i.struct.length<d.id.clock)if(i.struct.constructor===M)i.struct.length=d.id.clock+d.length-i.struct.id.clock;else{ht(c,i.struct,i.offset);const g=d.id.clock-i.struct.id.clock-i.struct.length;i={struct:new M(w(u,i.struct.id.clock+i.struct.length),g),offset:0}}else{const g=i.struct.id.clock+i.struct.length-d.id.clock;g>0&&(i.struct.constructor===M?i.struct.length-=g:d=Bc(d,g)),i.struct.mergeWith(d)||(ht(c,i.struct,i.offset),i={struct:d,offset:0},h.next())}}else i={struct:h.curr,offset:0},h.next();for(let d=h.curr;d!==null&&d.id.client===u&&d.id.clock===i.struct.id.clock+i.struct.length&&d.constructor!==M;d=h.next())ht(c,i.struct,i.offset),i={struct:d,offset:0}}i!==null&&(ht(c,i.struct,i.offset),i=null),$n(c);const l=s.map(h=>rt(h)),a=Dt(l);return Z(o,a),o.toUint8Array()},Rn=(e,t,n=j,s=K)=>{const r=On(t),i=new s,o=new Nn(i),c=new n(L(e)),l=new wt(c,!1);for(;l.curr;){const h=l.curr,u=h.id.client,d=r.get(u)||0;if(l.curr.constructor===M){l.next();continue}if(h.id.clock+h.length>d)for(ht(o,h,Tt(d-h.id.clock,0)),l.next();l.curr&&l.curr.id.client===u;)ht(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===u&&l.curr.id.clock+l.curr.length<=d;)l.next()}$n(o);const a=rt(c);return Z(i,a),i.toUint8Array()},jc=(e,t)=>Rn(e,t,H,pt),Sr=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:z(e.encoder.restEncoder)}),e.encoder.restEncoder=Bt(),e.written=0)},ht=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Sr(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),p(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},$n=e=>{Sr(e);const t=e.encoder.restEncoder;p(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const s=e.clientStructs[n];p(t,s.written),ce(t,s.restEncoder)}},je=(e,t,n,s)=>{const r=new n(L(e)),i=new wt(r,!1),o=new s,c=new Nn(o);for(let a=i.curr;a!==null;a=i.next())ht(c,t(a),0);$n(c);const l=rt(r);return Z(o,l),o.toUint8Array()},Er=({formatting:e=!0,subdocs:t=!0,yxml:n=!0}={})=>{let s=0;const r=T(),i=T(),o=T(),c=T();return c.set(null,null),l=>{switch(l.constructor){case $:case M:return l;case y:{const a=l,h=a.content;switch(h.constructor){case It:break;case Y:{if(n){const u=h.type;u instanceof ft&&(u.nodeName=R(i,u.nodeName,()=>"node-"+s)),u instanceof Vt&&(u.hookName=R(i,u.hookName,()=>"hook-"+s))}break}case it:{const u=h;u.arr=u.arr.map(()=>s);break}case Ot:{const u=h;u.content=new Uint8Array([s]);break}case Ut:{const u=h;t&&(u.opts={},u.doc.guid=s+"");break}case ct:{const u=h;u.embed={};break}case C:{const u=h;e&&(u.key=R(o,u.key,()=>s+""),u.value=R(c,u.value,()=>({i:s})));break}case Ft:{const u=h;u.arr=u.arr.map(()=>s);break}case J:{const u=h;u.str=_s(s%10+"",u.str.length);break}default:v()}return a.parentSub&&(a.parentSub=R(r,a.parentSub,()=>s+"")),s++,l}default:v()}}},zc=(e,t)=>je(e,Er(t),H,pt),Gc=(e,t)=>je(e,Er(t),j,K),Jc=e=>je(e,Ts,H,K),Cr=e=>je(e,Ts,j,pt),fs="You must not compute changes after the event-handler fired.";class ae{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Hc(this.currentTarget,this.target))}deletes(t){return xt(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw P(fs);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const i=n._map.get(r);let o,c;if(this.adds(i)){let l=i.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(i))if(l!==null&&this.deletes(l))o="delete",c=He(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",c=He(l.content.getContent())):(o="add",c=void 0)}else if(this.deletes(i))o="delete",c=He(i.content.getContent());else return;t.set(r,{action:o,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw P(fs);const n=this.target,s=Et(),r=Et(),i=[];if(t={added:s,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const l=()=>{c&&i.push(c)};for(let a=n._start;a!==null;a=a.right)a.deleted?this.deletes(a)&&!this.adds(a)&&((c===null||c.delete===void 0)&&(l(),c={delete:0}),c.delete+=a.length,r.add(a)):this.adds(a)?((c===null||c.insert===void 0)&&(l(),c={insert:[]}),c.insert=c.insert.concat(a.content.getContent()),s.add(a)):((c===null||c.retain===void 0)&&(l(),c={retain:0}),c.retain+=a.length);c!==null&&c.retain===void 0&&l()}this._changes=t}return t}}const Hc=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let s=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(s+=r.length),r=r.right;n.unshift(s)}t=t._item.parent}return n},O=()=>{Zs("Invalid access: Add Yjs type to a document before reading data.")},Dr=80;let Vn=0;class Yc{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=Vn++}}const Xc=e=>{e.timestamp=Vn++},Ar=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Vn++},Kc=(e,t,n)=>{if(e.length>=Dr){const s=e.reduce((r,i)=>r.timestamp<i.timestamp?r:i);return Ar(s,t,n),s}else{const s=new Yc(t,n);return e.push(s),s}},ze=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((i,o)=>ge(t-i.index)<ge(t-o.index)?i:o);let s=e._start,r=0;for(n!==null&&(s=n.p,r=n.index,Xc(n));s.right!==null&&r<t;){if(!s.deleted&&s.countable){if(t<r+s.length)break;r+=s.length}s=s.right}for(;s.left!==null&&r>t;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);for(;s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);return n!==null&&ge(n.index-r)<s.parent.length/Dr?(Ar(n,s,r),n):Kc(e._searchMarker,s,r)},se=(e,t,n)=>{for(let s=e.length-1;s>=0;s--){const r=e[s];if(n>0){let i=r.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(r.index-=i.length);if(i===null||i.marker===!0){e.splice(s,1);continue}r.p=i,i.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=Tt(t,r.index+n))}},Wc=e=>{e.doc??O();let t=e._start;const n=[];for(;t;)n.push(t),t=t.right;return n},Ge=(e,t,n)=>{const s=e,r=t.changedParentTypes;for(;R(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;or(s._eH,n,t)};class A{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=rs(),this._dEH=rs(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw X()}clone(){throw X()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){is(this._eH,t)}observeDeep(t){is(this._dEH,t)}unobserve(t){os(this._eH,t)}unobserveDeep(t){os(this._dEH,t)}toJSON(){}}const Ir=(e,t,n)=>{e.doc??O(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let s=n-t;const r=[];let i=e._start;for(;i!==null&&s>0;){if(i.countable&&!i.deleted){const o=i.content.getContent();if(o.length<=t)t-=o.length;else{for(let c=t;c<o.length&&s>0;c++)r.push(o[c]),s--;t=0}}i=i.right}return r},Tr=e=>{e.doc??O();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const s=n.content.getContent();for(let r=0;r<s.length;r++)t.push(s[r])}n=n.right}return t},qc=(e,t)=>{const n=[];let s=e._start;for(;s!==null;){if(s.countable&<(s,t)){const r=s.content.getContent();for(let i=0;i<r.length;i++)n.push(r[i])}s=s.right}return n},re=(e,t)=>{let n=0,s=e._start;for(e.doc??O();s!==null;){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let i=0;i<r.length;i++)t(r[i],n++,e)}s=s.right}},xr=(e,t)=>{const n=[];return re(e,(s,r)=>{n.push(t(s,r,e))}),n},Pc=e=>{let t=e._start,n=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),s=0,t=t.right}const r=n[s++];return n.length<=s&&(n=null),{done:!1,value:r}}}},Or=(e,t)=>{e.doc??O();const n=ze(e,t);let s=e._start;for(n!==null&&(s=n.p,t-=n.index);s!==null;s=s.right)if(!s.deleted&&s.countable){if(t<s.length)return s.content.getContent()[t];t-=s.length}},Ce=(e,t,n,s)=>{let r=n;const i=e.doc,o=i.clientID,c=i.store,l=n===null?t._start:n.right;let a=[];const h=()=>{a.length>0&&(r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new it(a)),r.integrate(e,0),a=[])};s.forEach(u=>{if(u===null)a.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:a.push(u);break;default:switch(h(),u.constructor){case Uint8Array:case ArrayBuffer:r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Ot(new Uint8Array(u))),r.integrate(e,0);break;case gt:r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Ut(u)),r.integrate(e,0);break;default:if(u instanceof A)r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Y(u)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},Ur=()=>P("Length exceeded!"),vr=(e,t,n,s)=>{if(n>t._length)throw Ur();if(n===0)return t._searchMarker&&se(t._searchMarker,n,s.length),Ce(e,t,null,s);const r=n,i=ze(t,n);let o=t._start;for(i!==null&&(o=i.p,n-=i.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&U(e,w(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&se(t._searchMarker,r,s.length),Ce(e,t,o,s)},Zc=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return Ce(e,t,r,n)},Lr=(e,t,n,s)=>{if(s===0)return;const r=n,i=s,o=ze(t,n);let c=t._start;for(o!==null&&(c=o.p,n-=o.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&U(e,w(c.id.client,c.id.clock+n)),n-=c.length);for(;s>0&&c!==null;)c.deleted||(s<c.length&&U(e,w(c.id.client,c.id.clock+s)),c.delete(e),s-=c.length),c=c.right;if(s>0)throw Ur();t._searchMarker&&se(t._searchMarker,r,-i+s)},De=(e,t,n)=>{const s=t._map.get(n);s!==void 0&&s.delete(e)},Fn=(e,t,n,s)=>{const r=t._map.get(n)||null,i=e.doc,o=i.clientID;let c;if(s==null)c=new it([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new it([s]);break;case Uint8Array:c=new Ot(s);break;case gt:c=new Ut(s);break;default:if(s instanceof A)c=new Y(s);else throw new Error("Unexpected content type")}new y(w(o,E(i.store,o)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},Bn=(e,t)=>{e.doc??O();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},Mr=e=>{const t={};return e.doc??O(),e._map.forEach((n,s)=>{n.deleted||(t[s]=n.content.getContent()[n.length-1])}),t},Nr=(e,t)=>{e.doc??O();const n=e._map.get(t);return n!==void 0&&!n.deleted},Qc=(e,t,n)=>{let s=e._map.get(t)||null;for(;s!==null&&(!n.sv.has(s.id.client)||s.id.clock>=(n.sv.get(s.id.client)||0));)s=s.left;return s!==null&<(s,n)?s.content.getContent()[s.length-1]:void 0},Rr=(e,t)=>{const n={};return e._map.forEach((s,r)=>{let i=s;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&<(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},de=e=>(e.doc??O(),Ko(e._map.entries(),t=>!t[1].deleted));class $r extends ae{}class nt extends A{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new nt;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new nt}clone(){const t=new nt;return t.insert(0,this.toArray().map(n=>n instanceof A?n.clone():n)),t}get length(){return this.doc??O(),this._length}_callObserver(t,n){super._callObserver(t,n),Ge(this,t,new $r(this,t))}insert(t,n){this.doc!==null?_(this.doc,s=>{vr(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?_(this.doc,n=>{Zc(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?_(this.doc,s=>{Lr(s,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return Or(this,t)}toArray(){return Tr(this)}slice(t=0,n=this.length){return Ir(this,t,n)}toJSON(){return this.map(t=>t instanceof A?t.toJSON():t)}map(t){return xr(this,t)}forEach(t){re(this,t)}[Symbol.iterator](){return Pc(this)}_write(t){t.writeTypeRef(_l)}}const tl=e=>new nt;class Vr extends ae{constructor(t,n,s){super(t,n),this.keysChanged=s}}class ut extends A{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((s,r)=>{this.set(r,s)}),this._prelimContent=null}_copy(){return new ut}clone(){const t=new ut;return this.forEach((n,s)=>{t.set(s,n instanceof A?n.clone():n)}),t}_callObserver(t,n){Ge(this,t,new Vr(this,t,n))}toJSON(){this.doc??O();const t={};return this._map.forEach((n,s)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[s]=r instanceof A?r.toJSON():r}}),t}get size(){return[...de(this)].length}keys(){return Ze(de(this),t=>t[0])}values(){return Ze(de(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return Ze(de(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??O(),this._map.forEach((n,s)=>{n.deleted||t(n.content.getContent()[n.length-1],s,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?_(this.doc,n=>{De(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?_(this.doc,s=>{Fn(s,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return Bn(this,t)}has(t){return Nr(this,t)}clear(){this.doc!==null?_(this.doc,t=>{this.forEach(function(n,s,r){De(t,r,s)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(bl)}}const el=e=>new ut,at=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&zi(e,t);class un{constructor(t,n,s,r){this.left=t,this.right=n,this.index=s,this.currentAttributes=r}forward(){this.right===null&&v(),this.right.content.constructor===C?this.right.deleted||Gt(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const gs=(e,t,n)=>{for(;t.right!==null&&n>0;)t.right.content.constructor===C?t.right.deleted||Gt(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&U(e,w(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},fe=(e,t,n,s)=>{const r=new Map,i=s?ze(t,n):null;if(i){const o=new un(i.p.left,i.p,i.index,r);return gs(e,o,n-i.index)}else{const o=new un(null,t._start,0,r);return gs(e,o,n)}},Fr=(e,t,n,s)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===C&&at(s.get(n.right.content.key),n.right.content.value));)n.right.deleted||s.delete(n.right.content.key),n.forward();const r=e.doc,i=r.clientID;s.forEach((o,c)=>{const l=n.left,a=n.right,h=new y(w(i,E(r.store,i)),l,l&&l.lastId,a,a&&a.id,t,null,new C(c,o));h.integrate(e,0),n.right=h,n.forward()})},Gt=(e,t)=>{const{key:n,value:s}=t;s===null?e.delete(n):e.set(n,s)},Br=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===C&&at(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},jr=(e,t,n,s)=>{const r=e.doc,i=r.clientID,o=new Map;for(const c in s){const l=s[c],a=n.currentAttributes.get(c)??null;if(!at(a,l)){o.set(c,a);const{left:h,right:u}=n;n.right=new y(w(i,E(r.store,i)),h,h&&h.lastId,u,u&&u.id,t,null,new C(c,l)),n.right.integrate(e,0),n.forward()}}return o},Qe=(e,t,n,s,r)=>{n.currentAttributes.forEach((d,f)=>{r[f]===void 0&&(r[f]=null)});const i=e.doc,o=i.clientID;Br(n,r);const c=jr(e,t,n,r),l=s.constructor===String?new J(s):s instanceof A?new Y(s):new ct(s);let{left:a,right:h,index:u}=n;t._searchMarker&&se(t._searchMarker,n.index,l.getLength()),h=new y(w(o,E(i.store,o)),a,a&&a.lastId,h,h&&h.id,t,null,l),h.integrate(e,0),n.right=h,n.index=u,n.forward(),Fr(e,t,n,c)},ps=(e,t,n,s,r)=>{const i=e.doc,o=i.clientID;Br(n,r);const c=jr(e,t,n,r);t:for(;n.right!==null&&(s>0||c.size>0&&(n.right.deleted||n.right.content.constructor===C));){if(!n.right.deleted)switch(n.right.content.constructor){case C:{const{key:l,value:a}=n.right.content,h=r[l];if(h!==void 0){if(at(h,a))c.delete(l);else{if(s===0)break t;c.set(l,a)}n.right.delete(e)}else n.currentAttributes.set(l,a);break}default:s<n.right.length&&U(e,w(n.right.id.client,n.right.id.clock+s)),s-=n.right.length;break}n.forward()}if(s>0){let l="";for(;s>0;s--)l+=`
|
|
4
|
-
`;n.right=new y(w(o,E(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new J(l)),n.right.integrate(e,0),n.forward()}Fr(e,t,n,c)},zr=(e,t,n,s,r)=>{let i=t;const o=T();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===C){const a=i.content;o.set(a.key,a)}i=i.right}let c=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const a=t.content;if(a.constructor===C){const{key:h,value:u}=a,d=s.get(h)??null;(o.get(h)!==a||d===u)&&(t.delete(e),c++,!l&&(r.get(h)??null)===u&&d!==u&&(d===null?r.delete(h):r.set(h,d))),!l&&!t.deleted&&Gt(r,a)}}t=t.right}return c},nl=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===C){const s=t.content.key;n.has(s)?t.delete(e):n.add(s)}t=t.left}},Gr=e=>{let t=0;return _(e.doc,n=>{let s=e._start,r=e._start,i=T();const o=en(i);for(;r;)r.deleted===!1&&(r.content.constructor===C?Gt(o,r.content):(t+=zr(n,s,r,i,o),i=en(o),s=r)),r=r.right}),t},sl=e=>{const t=new Set,n=e.doc;for(const[s,r]of e.afterState.entries()){const i=e.beforeState.get(s)||0;r!==i&&dr(e,n.store.clients.get(s),i,r,o=>{!o.deleted&&o.content.constructor===C&&o.constructor!==$&&t.add(o.parent)})}_(n,s=>{Ct(e,e.deleteSet,r=>{if(r instanceof $||!r.parent._hasFormatting||t.has(r.parent))return;const i=r.parent;r.content.constructor===C?t.add(i):nl(s,r)});for(const r of t)Gr(r)})},ws=(e,t,n)=>{const s=n,r=en(t.currentAttributes),i=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Y:case ct:case J:n<t.right.length&&U(e,w(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&zr(e,i,t.right,r,t.currentAttributes);const o=(t.left||t.right).parent;return o._searchMarker&&se(o._searchMarker,t.index,-s+n),t};class Jr extends ae{constructor(t,n,s){super(t,n),this.childListChanged=!1,this.keysChanged=new Set,s.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];_(t,s=>{const r=new Map,i=new Map;let o=this.target._start,c=null;const l={};let a="",h=0,u=0;const d=()=>{if(c!==null){let f=null;switch(c){case"delete":u>0&&(f={delete:u}),u=0;break;case"insert":(typeof a=="object"||a.length>0)&&(f={insert:a},r.size>0&&(f.attributes={},r.forEach((g,k)=>{g!==null&&(f.attributes[k]=g)}))),a="";break;case"retain":h>0&&(f={retain:h},ji(l)||(f.attributes=Vi({},l))),h=0;break}f&&n.push(f),c=null}};for(;o!==null;){switch(o.content.constructor){case Y:case ct:this.adds(o)?this.deletes(o)||(d(),c="insert",a=o.content.getContent()[0],d()):this.deletes(o)?(c!=="delete"&&(d(),c="delete"),u+=1):o.deleted||(c!=="retain"&&(d(),c="retain"),h+=1);break;case J:this.adds(o)?this.deletes(o)||(c!=="insert"&&(d(),c="insert"),a+=o.content.str):this.deletes(o)?(c!=="delete"&&(d(),c="delete"),u+=o.length):o.deleted||(c!=="retain"&&(d(),c="retain"),h+=o.length);break;case C:{const{key:f,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const k=r.get(f)??null;at(k,g)?g!==null&&o.delete(s):(c==="retain"&&d(),at(g,i.get(f)??null)?delete l[f]:l[f]=g)}}else if(this.deletes(o)){i.set(f,g);const k=r.get(f)??null;at(k,g)||(c==="retain"&&d(),l[f]=k)}else if(!o.deleted){i.set(f,g);const k=l[f];k!==void 0&&(at(k,g)?k!==null&&o.delete(s):(c==="retain"&&d(),g===null?delete l[f]:l[f]=g))}o.deleted||(c==="insert"&&d(),Gt(r,o.content));break}}o=o.right}for(d();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class At extends A{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??O(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(s=>s())}catch(s){console.error(s)}this._pending=null}_copy(){return new At}clone(){const t=new At;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const s=new Jr(this,t,n);Ge(this,t,s),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??O();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===J&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?_(this.doc,s=>{const r=new un(null,this._start,0,new Map);for(let i=0;i<t.length;i++){const o=t[i];if(o.insert!==void 0){const c=!n&&typeof o.insert=="string"&&i===t.length-1&&r.right===null&&o.insert.slice(-1)===`
|
|
5
|
-
`?o.insert.slice(0,-1):o.insert;(typeof c!="string"||c.length>0)&&Qe(s,this,r,c,o.attributes||{})}else o.retain!==void 0?ps(s,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&ws(s,r,o.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,s){this.doc??O();const r=[],i=new Map,o=this.doc;let c="",l=this._start;function a(){if(c.length>0){const u={};let d=!1;i.forEach((g,k)=>{d=!0,u[k]=g});const f={insert:c};d&&(f.attributes=u),r.push(f),c=""}}const h=()=>{for(;l!==null;){if(lt(l,t)||n!==void 0&<(l,n))switch(l.content.constructor){case J:{const u=i.get("ychange");t!==void 0&&!lt(l,t)?(u===void 0||u.user!==l.id.client||u.type!=="removed")&&(a(),i.set("ychange",s?s("removed",l.id):{type:"removed"})):n!==void 0&&!lt(l,n)?(u===void 0||u.user!==l.id.client||u.type!=="added")&&(a(),i.set("ychange",s?s("added",l.id):{type:"added"})):u!==void 0&&(a(),i.delete("ychange")),c+=l.content.str;break}case Y:case ct:{a();const u={insert:l.content.getContent()[0]};if(i.size>0){const d={};u.attributes=d,i.forEach((f,g)=>{d[g]=f})}r.push(u);break}case C:lt(l,t)&&(a(),Gt(i,l.content));break}l=l.right}a()};return t||n?_(o,u=>{t&&ln(u,t),n&&ln(u,n),h()},"cleanup"):h(),r}insert(t,n,s){if(n.length<=0)return;const r=this.doc;r!==null?_(r,i=>{const o=fe(i,this,t,!s);s||(s={},o.currentAttributes.forEach((c,l)=>{s[l]=c})),Qe(i,this,o,n,s)}):this._pending.push(()=>this.insert(t,n,s))}insertEmbed(t,n,s){const r=this.doc;r!==null?_(r,i=>{const o=fe(i,this,t,!s);Qe(i,this,o,n,s||{})}):this._pending.push(()=>this.insertEmbed(t,n,s||{}))}delete(t,n){if(n===0)return;const s=this.doc;s!==null?_(s,r=>{ws(r,fe(r,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,s){if(n===0)return;const r=this.doc;r!==null?_(r,i=>{const o=fe(i,this,t,!1);o.right!==null&&ps(i,this,o,n,s)}):this._pending.push(()=>this.format(t,n,s))}removeAttribute(t){this.doc!==null?_(this.doc,n=>{De(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?_(this.doc,s=>{Fn(s,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return Bn(this,t)}getAttributes(){return Mr(this)}_write(t){t.writeTypeRef(Sl)}}const rl=e=>new At;class tn{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??O()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===ft||n.constructor===dt)&&n._start!==null)t=n._start;else for(;t!==null;){const s=t.next;if(s!==null){t=s;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class dt extends A{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new dt}clone(){const t=new dt;return t.insert(0,this.toArray().map(n=>n instanceof A?n.clone():n)),t}get length(){return this.doc??O(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new tn(this,t)}querySelector(t){t=t.toUpperCase();const s=new tn(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return s.done?null:s.value}querySelectorAll(t){return t=t.toUpperCase(),st(new tn(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){Ge(this,t,new Hr(this,n,t))}toString(){return xr(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},s){const r=t.createDocumentFragment();return s!==void 0&&s._createAssociation(r,this),re(this,i=>{r.insertBefore(i.toDOM(t,n,s),null)}),r}insert(t,n){this.doc!==null?_(this.doc,s=>{vr(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)_(this.doc,s=>{const r=t&&t instanceof A?t._item:t;Ce(s,this,r,n)});else{const s=this._prelimContent,r=t===null?0:s.findIndex(i=>i===t)+1;if(r===0&&t!==null)throw P("Reference item not found");s.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?_(this.doc,s=>{Lr(s,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return Tr(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return Or(this,t)}slice(t=0,n=this.length){return Ir(this,t,n)}forEach(t){re(this,t)}_write(t){t.writeTypeRef(Cl)}}const il=e=>new dt;class ft extends dt{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((s,r)=>{this.setAttribute(r,s)}),this._prelimAttrs=null}_copy(){return new ft(this.nodeName)}clone(){const t=new ft(this.nodeName),n=this.getAttributes();return Bi(n,(s,r)=>{t.setAttribute(r,s)}),t.insert(0,this.toArray().map(s=>s instanceof A?s.clone():s)),t}toString(){const t=this.getAttributes(),n=[],s=[];for(const c in t)s.push(c);s.sort();const r=s.length;for(let c=0;c<r;c++){const l=s[c];n.push(l+'="'+t[l]+'"')}const i=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){this.doc!==null?_(this.doc,n=>{De(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?_(this.doc,s=>{Fn(s,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return Bn(this,t)}hasAttribute(t){return Nr(this,t)}getAttributes(t){return t?Rr(this,t):Mr(this)}toDOM(t=document,n={},s){const r=t.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const c=i[o];typeof c=="string"&&r.setAttribute(o,c)}return re(this,o=>{r.appendChild(o.toDOM(t,n,s))}),s!==void 0&&s._createAssociation(r,this),r}_write(t){t.writeTypeRef(El),t.writeKey(this.nodeName)}}const ol=e=>new ft(e.readKey());class Hr extends ae{constructor(t,n,s){super(t,s),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class Vt extends ut{constructor(t){super(),this.hookName=t}_copy(){return new Vt(this.hookName)}clone(){const t=new Vt(this.hookName);return this.forEach((n,s)=>{t.set(s,n)}),t}toDOM(t=document,n={},s){const r=n[this.hookName];let i;return r!==void 0?i=r.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),s!==void 0&&s._createAssociation(i,this),i}_write(t){t.writeTypeRef(Dl),t.writeKey(this.hookName)}}const cl=e=>new Vt(e.readKey());class ie extends At{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new ie}clone(){const t=new ie;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,s){const r=t.createTextNode(this.toString());return s!==void 0&&s._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const n=[];for(const r in t.attributes){const i=[];for(const o in t.attributes[r])i.push({key:o,value:t.attributes[r][o]});i.sort((o,c)=>o.key<c.key?-1:1),n.push({nodeName:r,attrs:i})}n.sort((r,i)=>r.nodeName<i.nodeName?-1:1);let s="";for(let r=0;r<n.length;r++){const i=n[r];s+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){const c=i.attrs[o];s+=` ${c.key}="${c.value}"`}s+=">"}s+=t.insert;for(let r=n.length-1;r>=0;r--)s+=`</${n[r].nodeName}>`;return s}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(Al)}}const ll=e=>new ie;class Je{constructor(t,n){this.id=t,this.length=n}get deleted(){throw X()}mergeWith(t){return!1}write(t,n,s){throw X()}integrate(t,n){throw X()}}const hl=0;class $ extends Je{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),ur(t.doc.store,this)}write(t,n){t.writeInfo(hl),t.writeLen(this.length-n)}getMissing(t,n){return null}}class Ot{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ot(this.content)}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const al=e=>new Ot(e.readBuf());class It{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new It(this.len)}splice(t){const n=new It(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){Qt(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const ul=e=>new It(e.readLen()),Yr=(e,t)=>new gt({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ut{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ut(Yr(this.doc.guid,this.opts))}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const dl=e=>new Ut(Yr(e.readString(),e.readAny()));class ct{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ct(this.embed)}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const fl=e=>new ct(e.readJSON());class C{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new C(this.key,this.value)}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){const s=n.parent;s._searchMarker=null,s._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const gl=e=>new C(e.readKey(),e.readJSON());class Ft{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Ft(this.arr)}splice(t){const n=new Ft(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}}const pl=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++){const r=e.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new Ft(n)},wl=be("node_env")==="development";class it{constructor(t){this.arr=t,wl&&Is(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new it(this.arr)}splice(t){const n=new it(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeAny(i)}}getRef(){return 8}}const ml=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++)n.push(e.readAny());return new it(n)};class J{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new J(this.str)}splice(t){const n=new J(this.str.slice(t));this.str=this.str.slice(0,t);const s=this.str.charCodeAt(t-1);return s>=55296&&s<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const kl=e=>new J(e.readString()),yl=[tl,el,rl,ol,il,cl,ll],_l=0,bl=1,Sl=2,El=3,Cl=4,Dl=5,Al=6;class Y{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Y(this.type._copy())}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(s=>{s.deleted?s.id.clock<(t.beforeState.get(s.id.client)||0)&&t._mergeStructs.push(s):s.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(s=>{for(;s!==null;)s.gc(t,!0),s=s.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const Il=e=>new Y(yl[e.readTypeRef()](e)),dn=(e,t)=>{let n=t,s=0,r;do s>0&&(n=w(n.client,n.clock+s)),r=St(e,n),s=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof y);return{item:r,diff:s}},jn=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},Ae=(e,t,n)=>{const{client:s,clock:r}=t.id,i=new y(w(s,r+n),t,w(s,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),t.redone!==null&&(i.redone=w(t.redone.client,t.redone.clock+n)),t.right=i,i.right!==null&&(i.right.left=i),e._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),t.length=n,i},ms=(e,t)=>gn(e,n=>xt(n.deletions,t)),Xr=(e,t,n,s,r,i)=>{const o=e.doc,c=o.store,l=o.clientID,a=t.redone;if(a!==null)return U(e,a);let h=t.parent._item,u=null,d;if(h!==null&&h.deleted===!0){if(h.redone===null&&(!n.has(h)||Xr(e,h,n,s,r,i)===null))return null;for(;h.redone!==null;)h=U(e,h.redone)}const f=h===null?t.parent:h.content.type;if(t.parentSub===null){for(u=t.left,d=t;u!==null;){let S=u;for(;S!==null&&S.parent._item!==h;)S=S.redone===null?null:U(e,S.redone);if(S!==null&&S.parent._item===h){u=S;break}u=u.left}for(;d!==null;){let S=d;for(;S!==null&&S.parent._item!==h;)S=S.redone===null?null:U(e,S.redone);if(S!==null&&S.parent._item===h){d=S;break}d=d.right}}else if(d=null,t.right&&!r){for(u=t;u!==null&&u.right!==null&&(u.right.redone||xt(s,u.right.id)||ms(i.undoStack,u.right.id)||ms(i.redoStack,u.right.id));)for(u=u.right;u.redone;)u=U(e,u.redone);if(u&&u.right!==null)return null}else u=f._map.get(t.parentSub)||null;const g=E(c,l),k=w(l,g),b=new y(k,u,u&&u.lastId,d,d&&d.id,f,t.parentSub,t.content.copy());return t.redone=k,jn(b,!0),b.integrate(e,0),b};class y extends Je{constructor(t,n,s,r,i,o,c,l){super(t,l.getLength()),this.origin=s,this.left=n,this.right=r,this.rightOrigin=i,this.parent=o,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?Hn:0}set marker(t){(this.info&Xe)>0!==t&&(this.info^=Xe)}get marker(){return(this.info&Xe)>0}get keep(){return(this.info&Jn)>0}set keep(t){this.keep!==t&&(this.info^=Jn)}get countable(){return(this.info&Hn)>0}get deleted(){return(this.info&Ye)>0}set deleted(t){this.deleted!==t&&(this.info^=Ye)}markDeleted(){this.info|=Ye}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=E(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=E(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===bt&&this.id.client!==this.parent.client&&this.parent.clock>=E(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=an(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=U(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===$||this.right&&this.right.constructor===$)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===y?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===y&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===bt){const s=St(n,this.parent);s.constructor===$?this.parent=null:this.parent=s.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=an(t,t.doc.store,w(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let s=this.left,r;if(s!==null)r=s.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const i=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),i.add(r),mt(this.origin,r.origin)){if(r.id.client<this.id.client)s=r,i.clear();else if(mt(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(St(t.doc.store,r.origin)))i.has(St(t.doc.store,r.origin))||(s=r,i.clear());else break;r=r.right}this.left=s}if(this.left!==null){const s=this.left.right;this.right=s,this.left.right=this}else{let s;if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start,this.parent._start=this;this.right=s}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),ur(t.doc.store,this),this.content.integrate(t,this),as(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new $(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:w(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&mt(t.origin,this.lastId)&&this.right===t&&mt(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const n=this.parent._searchMarker;return n&&n.forEach(s=>{s.p===t&&(s.p=this,!this.deleted&&this.countable&&(s.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Qt(t.deleteSet,this.id.client,this.id.clock,this.length),as(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw v();this.content.gc(t),n?Uc(t,this,new $(this.id,this.length)):this.content=new It(this.length)}write(t,n){const s=n>0?w(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&Ie|(s===null?0:B)|(r===null?0:et)|(i===null?0:Ht);if(t.writeInfo(o),s!==null&&t.writeLeftID(s),r!==null&&t.writeRightID(r),s===null&&r===null){const c=this.parent;if(c._item!==void 0){const l=c._item;if(l===null){const a=vn(c);t.writeParentInfo(!0),t.writeString(a)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else c.constructor===String?(t.writeParentInfo(!0),t.writeString(c)):c.constructor===bt?(t.writeParentInfo(!1),t.writeLeftID(c)):v();i!==null&&t.writeString(i)}this.content.write(t,n)}}const Kr=(e,t)=>Tl[t&Ie](e),Tl=[()=>{v()},ul,pl,al,kl,fl,gl,Il,ml,dl,()=>{v()}],xl=10;class M extends Je{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){v()}write(t,n){t.writeInfo(xl),p(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},qr="__ $YJS$ __";Wr[qr]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Wr[qr]=!0;const Ml=Object.freeze(Object.defineProperty({__proto__:null,AbsolutePosition:cr,AbstractConnector:Wo,AbstractStruct:Je,AbstractType:A,Array:nt,ContentAny:it,ContentBinary:Ot,ContentDeleted:It,ContentDoc:Ut,ContentEmbed:ct,ContentFormat:C,ContentJSON:Ft,ContentString:J,ContentType:Y,Doc:gt,GC:$,ID:bt,Item:y,Map:ut,PermanentUserData:ac,RelativePosition:Be,Skip:M,Snapshot:Ln,Text:At,Transaction:fr,UndoManager:Mc,UpdateDecoderV1:H,UpdateDecoderV2:j,UpdateEncoderV1:pt,UpdateEncoderV2:K,XmlElement:ft,XmlFragment:dt,XmlHook:Vt,XmlText:ie,YArrayEvent:$r,YEvent:ae,YMapEvent:Vr,YTextEvent:Jr,YXmlEvent:Hr,applyUpdate:nc,applyUpdateV2:Fe,cleanupYTextFormatting:Gr,compareIDs:mt,compareRelativePositions:bc,convertUpdateFormatV1ToV2:Jc,convertUpdateFormatV2ToV1:Cr,createAbsolutePositionFromRelativePosition:_c,createDeleteSet:$e,createDeleteSetFromStructStore:In,createDocFromSnapshot:Ic,createID:w,createRelativePositionFromJSON:dc,createRelativePositionFromTypeIndex:gc,createSnapshot:Mn,decodeRelativePosition:kc,decodeSnapshot:Cc,decodeSnapshotV2:hr,decodeStateVector:On,decodeUpdate:$c,decodeUpdateV2:kr,diffUpdate:jc,diffUpdateV2:Rn,emptySnapshot:Dc,encodeRelativePosition:wc,encodeSnapshot:Ec,encodeSnapshotV2:lr,encodeStateAsUpdate:rc,encodeStateAsUpdateV2:rr,encodeStateVector:cc,encodeStateVectorFromUpdate:Vc,encodeStateVectorFromUpdateV2:_r,equalDeleteSets:er,equalSnapshots:Sc,findIndexSS:G,findRootTypeKey:vn,getItem:St,getItemCleanEnd:an,getItemCleanStart:U,getState:E,getTypeChildren:Wc,isDeleted:xt,isParentOf:ee,iterateDeletedStructs:Ct,logType:hc,logUpdate:Rc,logUpdateV2:mr,mergeDeleteSets:Dt,mergeUpdates:yr,mergeUpdatesV2:ne,obfuscateUpdate:zc,obfuscateUpdateV2:Gc,parseUpdateMeta:Fc,parseUpdateMetaV2:br,readUpdate:ec,readUpdateV2:xn,relativePositionToJSON:uc,snapshot:Ac,snapshotContainsUpdate:xc,transact:_,tryGc:vc,typeListToArraySnapshot:qc,typeMapGetAllSnapshot:Rr,typeMapGetSnapshot:Qc},Symbol.toStringTag,{value:"Module"}));export{tt as A,Ml as B,gt as D,Ol as O,Mc as U,yt as a,_t as b,Bt as c,L as d,me as e,q as f,Li as g,V as h,cc as i,nc as j,F as k,rc as l,ui as m,uc as n,dc as o,Ul as p,gc as q,m as r,_c as s,z as t,bc as u,ks as v,p as w,Tt as x,vl as y,Ll as z};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
let re=[],Ee=[];(()=>{let l="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<l.length;e++)(e%2?Ee:re).push(t=t+l[e])})();function Ge(l){if(l<768)return!1;for(let e=0,t=re.length;;){let n=e+t>>1;if(l<re[n])t=n;else if(l>=Ee[n])e=n+1;else return!0;if(e==t)return!1}}function ke(l){return l>=127462&&l<=127487}const ye=8205;function je(l,e,t=!0,n=!0){return(t?Oe:Ze)(l,e,n)}function Oe(l,e,t){if(e==l.length)return e;e&&Me(l.charCodeAt(e))&&Re(l.charCodeAt(e-1))&&e--;let n=ie(l,e);for(e+=Se(n);e<l.length;){let i=ie(l,e);if(n==ye||i==ye||t&&Ge(i))e+=Se(i),n=i;else if(ke(i)){let s=0,r=e-2;for(;r>=0&&ke(ie(l,r));)s++,r-=2;if(s%2==0)break;e+=2}else break}return e}function Ze(l,e,t){for(;e>0;){let n=Oe(l,e-2,t);if(n<e)return n;e--}return 0}function ie(l,e){let t=l.charCodeAt(e);if(!Re(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return Me(n)?(t-55296<<10)+(n-56320)+65536:t}function Me(l){return l>=56320&&l<57344}function Re(l){return l>=55296&&l<56320}function Se(l){return l<65536?1:2}class x{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=J(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),C.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=J(this,e,t);let n=[];return this.decompose(e,t,n,0),C.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new N(this),s=new N(e);for(let r=t,h=t;;){if(i.next(r),s.next(r),r=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(h+=i.value.length,i.done||h>=n)return!0}}iter(e=1){return new N(this,e)}iterRange(e,t=this.length){return new Te(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Be(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?x.empty:e.length<=32?new m(e):C.from(m.split(e,[]))}}class m extends x{constructor(e,t=Ke(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((t?n:h)>=e)return new Qe(i,h,n,r);i=h+1,n++}}decompose(e,t,n,i){let s=e<=0&&t>=this.length?this:new m(Ie(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let r=n.pop(),h=Z(s.text,r.text.slice(),0,s.length);if(h.length<=32)n.push(new m(h,r.length+s.length));else{let o=h.length>>1;n.push(new m(h.slice(0,o)),new m(h.slice(o)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof m))return super.replace(e,t,n);[e,t]=J(this,e,t);let i=Z(this.text,Z(n.text,Ie(this.text,0,e)),t),s=this.length+n.length-(t-e);return i.length<=32?new m(i,s):C.from(m.split(i,[]),s)}sliceString(e,t=this.length,n=`
|
|
2
|
-
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<=t&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>e&&r&&(i+=n),e<o&&t>s&&(i+=h.slice(Math.max(0,e-s),t-s)),s=o+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let s of e)n.push(s),i+=s.length+1,n.length==32&&(t.push(new m(n,i)),n=[],i=-1);return i>-1&&t.push(new m(n,i)),t}}class C extends x{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((t?o:h)>=e)return r.lineInner(e,t,n,i);i=h+1,n=o+1}}decompose(e,t,n,i){for(let s=0,r=0;r<=t&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(e<=o&&t>=r){let a=i&((r<=e?1:0)|(o>=t?2:0));r>=e&&o<=t&&!a?n.push(h):h.decompose(e-r,t-r,n,a)}r=o+1}}replace(e,t,n){if([e,t]=J(this,e,t),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let r=this.children[i],h=s+r.length;if(e>=s&&t<=h){let o=r.replace(e-s,t-s,n),a=this.lines-r.lines+o.lines;if(o.lines<a>>4&&o.lines>a>>6){let u=this.children.slice();return u[i]=o,new C(u,this.length-(t-e)+n.length)}return super.replace(s,h,o)}s=h+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
|
|
3
|
-
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<this.children.length&&r<=t;s++){let h=this.children[s],o=r+h.length;r>e&&s&&(i+=n),e<o&&t>r&&(i+=h.sliceString(e-r,t-r,n)),r=o+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof C))return 0;let n=0,[i,s,r,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==r||s==h)return n;let o=this.children[i],a=e.children[s];if(o!=a)return n+o.scanIdentical(a,t);n+=o.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let c of e)n+=c.lines;if(n<32){let c=[];for(let g of e)g.flatten(c);return new m(c,t)}let i=Math.max(32,n>>5),s=i<<1,r=i>>1,h=[],o=0,a=-1,u=[];function f(c){let g;if(c.lines>s&&c instanceof C)for(let b of c.children)f(b);else c.lines>r&&(o>r||!o)?(d(),h.push(c)):c instanceof m&&o&&(g=u[u.length-1])instanceof m&&c.lines+g.lines<=32?(o+=c.lines,a+=c.length+1,u[u.length-1]=new m(g.text.concat(c.text),g.length+1+c.length)):(o+c.lines>i&&d(),o+=c.lines,a+=c.length+1,u.push(c))}function d(){o!=0&&(h.push(u.length==1?u[0]:C.from(u,a)),a=-1,o=u.length=0)}for(let c of e)f(c);return d(),h.length==1?h[0]:new C(h,t)}}x.empty=new m([""],0);function Ke(l){let e=-1;for(let t of l)e+=t.length+1;return e}function Z(l,e,t=0,n=1e9){for(let i=0,s=0,r=!0;s<l.length&&i<=n;s++){let h=l[s],o=i+h.length;o>=t&&(o>n&&(h=h.slice(0,n-i)),i<t&&(h=h.slice(t-i)),r?(e[e.length-1]+=h,r=!1):e.push(h)),i=o+1}return e}function Ie(l,e,t){return Z(l,[""],e,t)}class N{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof m?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],r=s>>1,h=i instanceof m?i.text.length:i.children.length;if(r==(t>0?h:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
|
-
`,this;e--}else if(i instanceof m){let o=i.text[r+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=e==0?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=i.children[r+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof m?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Te{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new N(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Be{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(x.prototype[Symbol.iterator]=function(){return this.iter()},N.prototype[Symbol.iterator]=Te.prototype[Symbol.iterator]=Be.prototype[Symbol.iterator]=function(){return this});class Qe{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function J(l,e,t){return e=Math.max(0,Math.min(l.length,e)),[e,Math.max(e,Math.min(l.length,t))]}function Q(l,e,t=!0,n=!0){return je(l,e,t,n)}function Xe(l){return l>=56320&&l<57344}function Ye(l){return l>=55296&&l<56320}function ft(l,e){let t=l.charCodeAt(e);if(!Ye(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return Xe(n)?(t-55296<<10)+(n-56320)+65536:t}function ct(l){return l<=65535?String.fromCharCode(l):(l-=65536,String.fromCharCode((l>>10)+55296,(l&1023)+56320))}function dt(l){return l<65536?1:2}const le=/\r\n?|\n/;var O=(function(l){return l[l.Simple=0]="Simple",l[l.TrackDel=1]="TrackDel",l[l.TrackBefore=2]="TrackBefore",l[l.TrackAfter=3]="TrackAfter",l})(O||(O={}));class E{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let s=this.sections[t++],r=this.sections[t++];r<0?(e(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(e,t=!1){he(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new E(e)}composeDesc(e){return this.empty?e:e.empty?this:Fe(this,e)}mapDesc(e,t=!1){return e.empty?this:oe(this,e,t)}mapPos(e,t=-1,n=O.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],a=i+h;if(o<0){if(a>e)return s+(e-i);s+=h}else{if(n!=O.Simple&&a>=e&&(n==O.TrackDel&&i<e&&a>e||n==O.TrackBefore&&i<e||n==O.TrackAfter&&a>e))return null;if(a>e||a==e&&t<0&&!h)return e==i||t<0?s:s+o;s+=o}i=a}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let s=this.sections[n++],r=this.sections[n++],h=i+s;if(r>=0&&i<=t&&h>=e)return i<e&&h>t?"cover":!0;i=h}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new E(e)}static create(e){return new E(e)}}class k extends E{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return he(this,(t,n,i,s,r)=>e=e.replace(i,i+(n-t),r),!1),e}mapDesc(e,t=!1){return oe(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,s=0;i<t.length;i+=2){let r=t[i],h=t[i+1];if(h>=0){t[i]=h,t[i+1]=r;let o=i>>1;for(;n.length<o;)n.push(x.empty);n.push(r?e.slice(s,s+r):x.empty)}s+=r}return new k(t,n)}compose(e){return this.empty?e:e.empty?this:Fe(this,e,!0)}map(e,t=!1){return e.empty?this:oe(this,e,t,!0)}iterChanges(e,t=!1){he(this,e,t)}get desc(){return E.create(this.sections)}filter(e){let t=[],n=[],i=[],s=new q(this);e:for(let r=0,h=0;;){let o=r==e.length?1e9:e[r++];for(;h<o||h==o&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,o-h);y(i,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;y(t,u,f),f>0&&M(n,t,s.text),s.forward(u),h+=u}let a=e[r++];for(;h<a;){if(s.done)break e;let u=Math.min(s.len,a-h);y(t,u,-1),y(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),h+=u}}return{changes:new k(t,n),filtered:E.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):i==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],s=[],r=0,h=null;function o(u=!1){if(!u&&!i.length)return;r<t&&y(i,t-r,-1);let f=new k(i,s);h=h?h.compose(f.map(h)):f,i=[],s=[],r=0}function a(u){if(Array.isArray(u))for(let f of u)a(f);else if(u instanceof k){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);o(),h=h?h.compose(u.map(h)):u}else{let{from:f,to:d=f,insert:c}=u;if(f>d||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let g=c?typeof c=="string"?x.of(c.split(n||le)):c:x.empty,b=g.length;if(f==d&&b==0)return;f<r&&o(),f>r&&y(i,f-r,-1),y(i,d-f,b),M(s,i,g),r=d}}return a(e),o(!h),h}static empty(e){return new k(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((r,h)=>h&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<i;)n.push(x.empty);n[i]=x.of(s.slice(1)),t.push(s[0],n[i].length)}}}return new k(t,n)}static createSet(e,t){return new k(e,t)}}function y(l,e,t,n=!1){if(e==0&&t<=0)return;let i=l.length-2;i>=0&&t<=0&&t==l[i+1]?l[i]+=e:i>=0&&e==0&&l[i]==0?l[i+1]+=t:n?(l[i]+=e,l[i+1]+=t):l.push(e,t)}function M(l,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<l.length)l[l.length-1]=l[l.length-1].append(t);else{for(;l.length<n;)l.push(x.empty);l.push(t)}}function he(l,e,t){let n=l.inserted;for(let i=0,s=0,r=0;r<l.sections.length;){let h=l.sections[r++],o=l.sections[r++];if(o<0)i+=h,s+=h;else{let a=i,u=s,f=x.empty;for(;a+=h,u+=o,o&&n&&(f=f.append(n[r-2>>1])),!(t||r==l.sections.length||l.sections[r+1]<0);)h=l.sections[r++],o=l.sections[r++];e(i,a,s,u,f),i=a,s=u}}}function oe(l,e,t,n=!1){let i=[],s=n?[]:null,r=new q(l),h=new q(e);for(let o=-1;;){if(r.done&&h.len||h.done&&r.len)throw new Error("Mismatched change set lengths");if(r.ins==-1&&h.ins==-1){let a=Math.min(r.len,h.len);y(i,a,-1),r.forward(a),h.forward(a)}else if(h.ins>=0&&(r.ins<0||o==r.i||r.off==0&&(h.len<r.len||h.len==r.len&&!t))){let a=h.len;for(y(i,h.ins,-1);a;){let u=Math.min(r.len,a);r.ins>=0&&o<r.i&&r.len<=u&&(y(i,0,r.ins),s&&M(s,i,r.text),o=r.i),r.forward(u),a-=u}h.next()}else if(r.ins>=0){let a=0,u=r.len;for(;u;)if(h.ins==-1){let f=Math.min(u,h.len);a+=f,u-=f,h.forward(f)}else if(h.ins==0&&h.len<u)u-=h.len,h.next();else break;y(i,a,o<r.i?r.ins:0),s&&o<r.i&&M(s,i,r.text),o=r.i,r.forward(r.len-u)}else{if(r.done&&h.done)return s?k.createSet(i,s):E.create(i);throw new Error("Mismatched change set lengths")}}}function Fe(l,e,t=!1){let n=[],i=t?[]:null,s=new q(l),r=new q(e);for(let h=!1;;){if(s.done&&r.done)return i?k.createSet(n,i):E.create(n);if(s.ins==0)y(n,s.len,0,h),s.next();else if(r.len==0&&!r.done)y(n,0,r.ins,h),i&&M(i,n,r.text),r.next();else{if(s.done||r.done)throw new Error("Mismatched change set lengths");{let o=Math.min(s.len2,r.len),a=n.length;if(s.ins==-1){let u=r.ins==-1?-1:r.off?0:r.ins;y(n,o,u,h),i&&u&&M(i,n,r.text)}else r.ins==-1?(y(n,s.off?0:s.len,o,h),i&&M(i,n,s.textBit(o))):(y(n,s.off?0:s.len,r.off?0:r.ins,h),i&&!r.off&&M(i,n,r.text));h=(s.ins>o||r.ins>=0&&r.len>o)&&(h||n.length>a),s.forward2(o),r.forward(o)}}}}class q{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?x.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?x.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class B{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new B(n,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return p.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return p.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return p.range(e.anchor,e.head)}static create(e,t,n){return new B(e,t,n)}}class p{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:p.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new p([this.main],0)}addRange(e,t=!0){return p.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,p.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new p(e.ranges.map(t=>B.fromJSON(t)),e.main)}static single(e,t=e){return new p([p.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=n:s.from<n)return p.normalized(e.slice(),t);n=s.to}return new p(e,t)}static cursor(e,t=0,n,i){return B.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(e,t,n,i,s){let r=(n??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=t&&(s=t<e?1:-1),t<e?B.create(t,e,48|r):B.create(e,t,(s?s<0?8:16:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(n);for(let i=1;i<e.length;i++){let s=e[i],r=e[i-1];if(s.empty?s.from<=r.to:s.from<r.to){let h=r.from,o=Math.max(s.to,r.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?p.range(o,h):p.range(h,o))}}return new p(e,t)}}function Je(l,e){for(let t of l.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let me=0;class A{constructor(e,t,n,i,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=me++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new A(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:we),!!e.static,e.enables)}of(e){return new K([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function we(l,e){return l==e||l.length==e.length&&l.every((t,n)=>t===e[n])}class K{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=me++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,s=this.id,r=e[s]>>1,h=this.type==2,o=!1,a=!1,u=[];for(let f of this.dependencies)f=="doc"?o=!0:f=="selection"?a=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[r]=n(f),1},update(f,d){if(o&&d.docChanged||a&&(d.docChanged||d.selection)||ae(f,u)){let c=n(f);if(h?!Pe(c,f.values[r],i):!i(c,f.values[r]))return f.values[r]=c,1}return 0},reconfigure:(f,d)=>{let c,g=d.config.address[s];if(g!=null){let b=Y(d,g);if(this.dependencies.every(v=>v instanceof A?d.facet(v)===f.facet(v):v instanceof L?d.field(v,!1)==f.field(v,!1):!0)||(h?Pe(c=n(f),b,i):i(c=n(f),b)))return f.values[r]=b,0}else c=n(f);return f.values[r]=c,1}}}}function Pe(l,e,t){if(l.length!=e.length)return!1;for(let n=0;n<l.length;n++)if(!t(l[n],e[n]))return!1;return!0}function ae(l,e){let t=!1;for(let n of e)$(l,n)&1&&(t=!0);return t}function _e(l,e,t){let n=t.map(o=>l[o.id]),i=t.map(o=>o.type),s=n.filter(o=>!(o&1)),r=l[e.id]>>1;function h(o){let a=[];for(let u=0;u<n.length;u++){let f=Y(o,n[u]);if(i[u]==2)for(let d of f)a.push(d);else a.push(f)}return e.combine(a)}return{create(o){for(let a of n)$(o,a);return o.values[r]=h(o),1},update(o,a){if(!ae(o,s))return 0;let u=h(o);return e.compare(u,o.values[r])?0:(o.values[r]=u,1)},reconfigure(o,a){let u=ae(o,n),f=a.config.facets[e.id],d=a.facet(e);if(f&&!u&&we(t,f))return o.values[r]=d,0;let c=h(o);return e.compare(c,d)?(o.values[r]=d,0):(o.values[r]=c,1)}}}const U=A.define({static:!0});class L{constructor(e,t,n,i,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new L(me++,e.create,e.update,e.compare||((n,i)=>n===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(U).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let s=n.values[t],r=this.updateF(s,i);return this.compareF(s,r)?0:(n.values[t]=r,1)},reconfigure:(n,i)=>{let s=n.facet(U),r=i.facet(U),h;return(h=s.find(o=>o.field==this))&&h!=r.find(o=>o.field==this)?(n.values[t]=h.create(n),1):i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,U.of({field:this,create:e})]}get extension(){return this}}const T={lowest:4,low:3,default:2,high:1,highest:0};function D(l){return e=>new Le(e,l)}const gt={highest:D(T.highest),high:D(T.high),default:D(T.default),low:D(T.low),lowest:D(T.lowest)};class Le{constructor(e,t){this.inner=e,this.prec=t}}class te{of(e){return new ue(this,e)}reconfigure(e){return te.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ue{constructor(e,t){this.compartment=e,this.inner=t}}class X{constructor(e,t,n,i,s,r){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],s=Object.create(null),r=new Map;for(let d of et(e,t,r))d instanceof L?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let h=Object.create(null),o=[],a=[];for(let d of i)h[d.id]=a.length<<1,a.push(c=>d.slot(c));let u=n?.config.facets;for(let d in s){let c=s[d],g=c[0].facet,b=u&&u[d]||[];if(c.every(v=>v.type==0))if(h[g.id]=o.length<<1|1,we(b,c))o.push(n.facet(g));else{let v=g.combine(c.map(ne=>ne.value));o.push(n&&g.compare(v,n.facet(g))?n.facet(g):v)}else{for(let v of c)v.type==0?(h[v.id]=o.length<<1|1,o.push(v.value)):(h[v.id]=a.length<<1,a.push(ne=>v.dynamicSlot(ne)));h[g.id]=a.length<<1,a.push(v=>_e(v,g,c))}}let f=a.map(d=>d(h));return new X(e,r,f,h,o,s)}}function et(l,e,t){let n=[[],[],[],[],[]],i=new Map;function s(r,h){let o=i.get(r);if(o!=null){if(o<=h)return;let a=n[o].indexOf(r);a>-1&&n[o].splice(a,1),r instanceof ue&&t.delete(r.compartment)}if(i.set(r,h),Array.isArray(r))for(let a of r)s(a,h);else if(r instanceof ue){if(t.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=e.get(r.compartment)||r.inner;t.set(r.compartment,a),s(a,h)}else if(r instanceof Le)s(r.inner,r.prec);else if(r instanceof L)n[h].push(r),r.provides&&s(r.provides,h);else if(r instanceof K)n[h].push(r),r.facet.extensions&&s(r.facet.extensions,T.default);else{let a=r.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(a,h)}}return s(l,T.default),n.reduce((r,h)=>r.concat(h))}function $(l,e){if(e&1)return 2;let t=e>>1,n=l.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;l.status[t]=4;let i=l.computeSlot(l,l.config.dynamicSlots[t]);return l.status[t]=2|i}function Y(l,e){return e&1?l.config.staticValues[e>>1]:l.values[e>>1]}const De=A.define(),fe=A.define({combine:l=>l.some(e=>e),static:!0}),Ve=A.define({combine:l=>l.length?l[0]:void 0,static:!0}),Ne=A.define(),$e=A.define(),qe=A.define(),ze=A.define({combine:l=>l.length?l[0]:!1});class H{constructor(e,t){this.type=e,this.value=t}static define(){return new tt}}class tt{of(e){return new H(this,e)}}class nt{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new nt(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let s=i.map(t);s&&n.push(s)}return n}}I.reconfigure=I.define();I.appendConfig=I.define();class P{constructor(e,t,n,i,s,r){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&Je(n,t.newLength),s.some(h=>h.type==P.time)||(this.annotations=s.concat(P.time.of(Date.now())))}static create(e,t,n,i,s,r){return new P(e,t,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(P.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}P.time=H.define();P.userEvent=H.define();P.addToHistory=H.define();P.remote=H.define();function it(l,e){let t=[];for(let n=0,i=0;;){let s,r;if(n<l.length&&(i==e.length||e[i]>=l[n]))s=l[n++],r=l[n++];else if(i<e.length)s=e[i++],r=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,r):t[t.length-1]<r&&(t[t.length-1]=r)}}function We(l,e,t){var n;let i,s,r;return t?(i=e.changes,s=k.empty(e.changes.length),r=l.changes.compose(e.changes)):(i=e.changes.map(l.changes),s=l.changes.mapDesc(e.changes,!0),r=l.changes.compose(i)),{changes:r,selection:e.selection?e.selection.map(s):(n=l.selection)===null||n===void 0?void 0:n.map(i),effects:I.mapEffects(l.effects,i).concat(I.mapEffects(e.effects,s)),annotations:l.annotations.length?l.annotations.concat(e.annotations):e.annotations,scrollIntoView:l.scrollIntoView||e.scrollIntoView}}function ce(l,e,t){let n=e.selection,i=F(e.annotations);return e.userEvent&&(i=i.concat(P.userEvent.of(e.userEvent))),{changes:e.changes instanceof k?e.changes:k.of(e.changes||[],t,l.facet(Ve)),selection:n&&(n instanceof p?n:p.single(n.anchor,n.head)),effects:F(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function He(l,e,t){let n=ce(l,e.length?e[0]:{},l.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let r=!!e[s].sequential;n=We(n,ce(l,e[s],r?n.changes.newLength:l.doc.length),r)}let i=P.create(l,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return rt(t?st(i):i)}function st(l){let e=l.startState,t=!0;for(let i of e.facet(Ne)){let s=i(l);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:it(t,s))}if(t!==!0){let i,s;if(t===!1)s=l.changes.invertedDesc,i=k.empty(e.doc.length);else{let r=l.changes.filter(t);i=r.changes,s=r.filtered.mapDesc(r.changes).invertedDesc}l=P.create(e,i,l.selection&&l.selection.map(s),I.mapEffects(l.effects,s),l.annotations,l.scrollIntoView)}let n=e.facet($e);for(let i=n.length-1;i>=0;i--){let s=n[i](l);s instanceof P?l=s:Array.isArray(s)&&s.length==1&&s[0]instanceof P?l=s[0]:l=He(e,F(s),!1)}return l}function rt(l){let e=l.startState,t=e.facet(qe),n=l;for(let i=t.length-1;i>=0;i--){let s=t[i](l);s&&Object.keys(s).length&&(n=We(n,ce(e,s,l.changes.newLength),!0))}return n==l?l:P.create(e,l.changes,l.selection,n.effects,n.annotations,n.scrollIntoView)}const lt=[];function F(l){return l==null?lt:Array.isArray(l)?l:[l]}var R=(function(l){return l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other",l})(R||(R={}));const ht=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let de;try{de=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ot(l){if(de)return de.test(l);for(let e=0;e<l.length;e++){let t=l[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||ht.test(t)))return!0}return!1}function at(l){return e=>{if(!/\S/.test(e))return R.Space;if(ot(e))return R.Word;for(let t=0;t<l.length;t++)if(e.indexOf(l[t])>-1)return R.Word;return R.Other}}class w{constructor(e,t,n,i,s,r){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let h=0;h<this.config.dynamicSlots.length;h++)$(this,h<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return $(this,n),Y(this,n)}update(...e){return He(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:i}=t;for(let h of e.effects)h.is(te.reconfigure)?(t&&(i=new Map,t.compartments.forEach((o,a)=>i.set(a,o)),t=null),i.set(h.value.compartment,h.value.extension)):h.is(I.reconfigure)?(t=null,n=h.value):h.is(I.appendConfig)&&(t=null,n=F(n).concat(h.value));let s;t?s=e.startState.values.slice():(t=X.resolve(n,i,this),s=new w(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values);let r=e.startState.facet(fe)?e.newSelection:e.newSelection.asSingle();new w(t,e.newDoc,r,s,(h,o)=>o.update(h,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:p.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),s=[n.range],r=F(n.effects);for(let h=1;h<t.ranges.length;h++){let o=e(t.ranges[h]),a=this.changes(o.changes),u=a.map(i);for(let d=0;d<h;d++)s[d]=s[d].map(u);let f=i.mapDesc(a,!0);s.push(o.range.map(f)),i=i.compose(u),r=I.mapEffects(r,u).concat(I.mapEffects(F(o.effects),f))}return{changes:i,selection:p.create(s,t.mainIndex),effects:r}}changes(e=[]){return e instanceof k?e:k.of(e,this.doc.length,this.facet(w.lineSeparator))}toText(e){return x.of(e.split(this.facet(w.lineSeparator)||le))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:($(this,t),Y(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof L&&this.config.address[i.id]!=null&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let r=n[s],h=e[s];i.push(r.init(o=>r.spec.fromJSON(h,o)))}}return w.create({doc:e.doc,selection:p.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=X.resolve(e.extensions||[],new Map),n=e.doc instanceof x?e.doc:x.of((e.doc||"").split(t.staticFacet(w.lineSeparator)||le)),i=e.selection?e.selection instanceof p?e.selection:p.single(e.selection.anchor,e.selection.head):p.single(0);return Je(i,n.length),t.staticFacet(fe)||(i=i.asSingle()),new w(t,n,i,t.dynamicSlots.map(()=>null),(s,r)=>r.create(s),null)}get tabSize(){return this.facet(w.tabSize)}get lineBreak(){return this.facet(w.lineSeparator)||`
|
|
5
|
-
`}get readOnly(){return this.facet(ze)}phrase(e,...t){for(let n of this.facet(w.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let s of this.facet(De))for(let r of s(this,t,n))Object.prototype.hasOwnProperty.call(r,e)&&i.push(r[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return at(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),r=e-n,h=e-n;for(;r>0;){let o=Q(t,r,!1);if(s(t.slice(o,r))!=R.Word)break;r=o}for(;h<i;){let o=Q(t,h);if(s(t.slice(h,o))!=R.Word)break;h=o}return r==h?null:p.range(r+n,h+n)}}w.allowMultipleSelections=fe;w.tabSize=A.define({combine:l=>l.length?l[0]:4});w.lineSeparator=Ve;w.readOnly=ze;w.phrases=A.define({compare(l,e){let t=Object.keys(l),n=Object.keys(e);return t.length==n.length&&t.every(i=>l[i]==e[i])}});w.languageData=De;w.changeFilter=Ne;w.transactionFilter=$e;w.transactionExtender=qe;te.reconfigure=I.define();function pt(l,e,t={}){let n={};for(let i of l)for(let s of Object.keys(i)){let r=i[s],h=n[s];if(h===void 0)n[s]=r;else if(!(h===r||r===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](h,r);else throw new Error("Config merge conflict for field "+s)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class _{eq(e){return this==e}range(e,t=e){return z.create(e,t,this)}}_.prototype.startSide=_.prototype.endSide=0;_.prototype.point=!1;_.prototype.mapMode=O.TrackDel;function ve(l,e){return l==e||l.constructor==e.constructor&&l.eq(e)}class z{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new z(e,t,n)}}function ge(l,e){return l.from-e.from||l.value.startSide-e.value.startSide}class xe{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let o=r+h>>1,a=s[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==r)return a>=0?r:h;a>=0?h=o:r=o+1}}between(e,t,n,i){for(let s=this.findIndex(t,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let a=this.value[o],u=this.from[o]+e,f=this.to[o]+e,d,c;if(u==f){let g=t.mapPos(u,a.startSide,a.mapMode);if(g==null||(d=c=g,a.startSide!=a.endSide&&(c=t.mapPos(u,a.endSide),c<d)))continue}else if(d=t.mapPos(u,a.startSide),c=t.mapPos(f,a.endSide),d>c||d==c&&a.startSide>0&&a.endSide<=0)continue;(c-d||a.endSide-a.startSide)<0||(r<0&&(r=d),a.point&&(h=Math.max(h,c-d)),n.push(a),i.push(d-r),s.push(c-r))}return{mapped:n.length?new xe(i,s,n,h):null,pos:r}}}class S{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new S(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(n&&(t=t.slice().sort(ge)),this.isEmpty)return t.length?S.of(t):this;let h=new Ue(this,null,-1).goto(0),o=0,a=[],u=new ee;for(;h.value||o<t.length;)if(o<t.length&&(h.from-t[o].from||h.startSide-t[o].value.startSide)>=0){let f=t[o++];u.addInner(f.from,f.to,f.value)||a.push(f)}else h.rangeIndex==1&&h.chunkIndex<this.chunk.length&&(o==t.length||this.chunkEnd(h.chunkIndex)<t[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&u.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(u.addInner(h.from,h.to,h.value)||a.push(z.create(h.from,h.to,h.value))),h.next());return u.finishInner(this.nextLayer.isEmpty&&!a.length?S.empty:this.nextLayer.update({add:a,filter:r,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let h=this.chunkPos[r],o=this.chunk[r],a=e.touchesRange(h,h+o.length);if(a===!1)i=Math.max(i,o.maxPoint),t.push(o),n.push(e.mapPos(h));else if(a===!0){let{mapped:u,pos:f}=o.map(h,e);u&&(i=Math.max(i,u.maxPoint),t.push(u),n.push(f))}}let s=this.nextLayer.map(e);return t.length==0?s:new S(n,t,s||S.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(t>=s&&e<=s+r.length&&r.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return W.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return W.from(e).goto(t)}static compare(e,t,n,i,s=-1){let r=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),h=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),o=Ae(r,h,n),a=new V(r,o,s),u=new V(h,o,s);n.iterGaps((f,d,c)=>be(a,f,u,d,c,i)),n.empty&&n.length==0&&be(a,0,u,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),r=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ae(s,r),o=new V(s,h,0).goto(n),a=new V(r,h,0).goto(n);for(;;){if(o.to!=a.to||!pe(o.active,a.active)||o.point&&(!a.point||!ve(o.point,a.point)))return!1;if(o.to>i)return!0;o.next(),a.next()}}static spans(e,t,n,i,s=-1){let r=new V(e,null,s).goto(t),h=t,o=r.openStart;for(;;){let a=Math.min(r.to,n);if(r.point){let u=r.activeForPoint(r.to),f=r.pointFrom<t?u.length+1:r.point.startSide<0?u.length:Math.min(u.length,o);i.point(h,a,r.point,u,f,r.pointRank),o=Math.min(r.openEnd(a),u.length)}else a>h&&(i.span(h,a,r.active,o),o=r.openEnd(a));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(e,t=!1){let n=new ee;for(let i of e instanceof z?[e]:t?ut(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return S.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=S.empty;i=i.nextLayer)t=new S(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}S.empty=new S([],[],null,-1);function ut(l){if(l.length>1)for(let e=l[0],t=1;t<l.length;t++){let n=l[t];if(ge(e,n)>0)return l.slice().sort(ge);e=n}return l}S.empty.nextLayer=S.empty;class ee{finishChunk(e){this.chunks.push(new xe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new ee)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(S.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=S.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ae(l,e,t){let n=new Map;for(let s of l)for(let r=0;r<s.chunk.length;r++)s.chunk[r].maxPoint<=0&&n.set(s.chunk[r],s.chunkPos[r]);let i=new Set;for(let s of e)for(let r=0;r<s.chunk.length;r++){let h=n.get(s.chunk[r]);h!=null&&(t?t.mapPos(h):h)==s.chunkPos[r]&&!t?.touchesRange(h,h+s.chunk[r].length)&&i.add(s.chunk[r])}return i}class Ue{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class W{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let s=0;s<e.length;s++)for(let r=e[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Ue(r,t,n,s));return i.length==1?i[0]:new W(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)se(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)se(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),se(this.heap,0)}}}function se(l,e){for(let t=l[e];;){let n=(e<<1)+1;if(n>=l.length)break;let i=l[n];if(n+1<l.length&&i.compare(l[n+1])>=0&&(i=l[n+1],n++),t.compare(i)<0)break;l[n]=t,l[e]=i,e=n}}class V{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=W.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){G(this.active,e),G(this.activeTo,e),G(this.activeRank,e),this.minActive=Ce(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;j(this.active,t,n),j(this.activeTo,t,i),j(this.activeRank,t,s),e&&j(e,t,this.cursor.from),this.minActive=Ce(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&G(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let i=n.length-1;i>=0&&n[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function be(l,e,t,n,i,s){l.goto(e),t.goto(n);let r=n+i,h=n,o=n-e,a=!!s.boundChange;for(let u=!1;;){let f=l.to+o-t.to,d=f||l.endSide-t.endSide,c=d<0?l.to+o:t.to,g=Math.min(c,r);if(l.point||t.point?(l.point&&t.point&&ve(l.point,t.point)&&pe(l.activeForPoint(l.to),t.activeForPoint(t.to))||s.comparePoint(h,g,l.point,t.point),u=!1):(u&&s.boundChange(h),g>h&&!pe(l.active,t.active)&&s.compareRange(h,g,l.active,t.active),a&&g<r&&(f||l.openEnd(c)!=t.openEnd(c))&&(u=!0)),c>r)break;h=c,d<=0&&l.next(),d>=0&&t.next()}}function pe(l,e){if(l.length!=e.length)return!1;for(let t=0;t<l.length;t++)if(l[t]!=e[t]&&!ve(l[t],e[t]))return!1;return!0}function G(l,e){for(let t=e,n=l.length-1;t<n;t++)l[t]=l[t+1];l.pop()}function j(l,e,t){for(let n=l.length-1;n>=e;n--)l[n+1]=l[n];l[e]=t}function Ce(l,e){let t=-1,n=1e9;for(let i=0;i<e.length;i++)(e[i]-n||l[i].endSide-l[t].endSide)<0&&(t=i,n=e[i]);return t}function mt(l,e,t=l.length){let n=0;for(let i=0;i<t&&i<l.length;)l.charCodeAt(i)==9?(n+=e-n%e,i++):(n++,i=Q(l,i));return n}function wt(l,e,t,n){for(let i=0,s=0;;){if(s>=e)return i;if(i==l.length)break;s+=l.charCodeAt(i)==9?t-s%t:1,i=Q(l,i)}return n===!0?-1:l.length}export{H as Annotation,tt as AnnotationType,E as ChangeDesc,k as ChangeSet,R as CharCategory,te as Compartment,p as EditorSelection,w as EditorState,A as Facet,Qe as Line,O as MapMode,gt as Prec,z as Range,S as RangeSet,ee as RangeSetBuilder,_ as RangeValue,B as SelectionRange,I as StateEffect,nt as StateEffectType,L as StateField,x as Text,P as Transaction,ft as codePointAt,dt as codePointSize,pt as combineConfig,mt as countColumn,Q as findClusterBreak,wt as findColumn,ct as fromCodePoint};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extensions as e,FilterSystem as i,FilterPipe as t}from"./BB_5th5W.js";e.add(i);e.add(t);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ae,E as re,aK as q,au as $,ah as Q,az as W,h as N,ak as se,aL as ue,aM as ie,a0 as ne,aN as fe,aO as oe,aP as le,aQ as ce,g as A,aR as de,aS as ve,aT as L,o as K,aU as _e,aV as he,av as pe,aW as ge,s as n,v as C}from"./BqnODQDb.js";import{B as be}from"./CNKK6nZb.js";import{i as ye,g as Se,d as Ae,j as Te,n as Ee,k as Ne}from"./BgO5HlCg.js";import{t as Oe,a as we,s as Pe}from"./D3sy0IkA.js";import{apiFetch as h}from"./DFYOFE3o.js";function We(e,t,...a){var r=new be(e);ae(()=>{const s=t()??null;r.ensure(s,s&&(c=>s(c,...a)))},re)}function ke(e,t){var a=void 0,r;q(()=>{a!==(a=t())&&(r&&($(r),r=null),a&&(r=Q(()=>{W(()=>a(e))})))})}function H(e,t={},a,r){for(var s in a){var c=a[s];t[s]!==c&&(a[s]==null?e.style.removeProperty(s):e.style.setProperty(s,c,r))}}function Ie(e,t,a,r){var s=e.__style;if(N||s!==t){var c=Oe(t,r);(!N||c!==e.getAttribute("style"))&&(c==null?e.removeAttribute("style"):e.style.cssText=c),e.__style=t}else r&&(Array.isArray(r)?(H(e,a?.[0],r[0]),H(e,a?.[1],r[1],"important")):H(e,a,r));return r}function j(e,t,a=!1){if(e.multiple){if(t==null)return;if(!se(t))return ue();for(var r of e.options)r.selected=t.includes(z(r));return}for(r of e.options){var s=z(r);if(ie(s,t)){r.selected=!0;return}}(!a||t!==void 0)&&(e.selectedIndex=-1)}function Le(e){var t=new MutationObserver(()=>{j(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ne(()=>{t.disconnect()})}function z(e){return"__value"in e?e.__value:e.value}const k=Symbol("class"),I=Symbol("style"),X=Symbol("is custom element"),Z=Symbol("is html"),Ce=L?"link":"LINK",Me=L?"input":"INPUT",me=L?"option":"OPTION",Re=L?"select":"SELECT",Ue=L?"progress":"PROGRESS";function Ge(e){if(N){var t=!1,a=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;U(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var s=e.checked;U(e,"checked",null),e.checked=s}}};e.__on_r=a,pe(a),ge()}}function Xe(e,t){var a=J(e);a.value===(a.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==Ue)||(e.value=t??"")}function He(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function U(e,t,a,r){var s=J(e);N&&(s[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===Ce)||s[t]!==(s[t]=a)&&(t==="loading"&&(e[ce]=a),a==null?e.removeAttribute(t):typeof a!="string"&&x(e).includes(t)?e[t]=a:e.setAttribute(t,a))}function $e(e,t,a,r,s=!1,c=!1){if(N&&s&&e.nodeName===Me){var g=e,G=g.type==="checkbox"?"defaultChecked":"defaultValue";G in a||Ge(g)}var b=J(e),_=b[X],y=!b[Z];let O=N&&_;O&&K(!1);var f=t||{},w=e.nodeName===me;for(var p in t)p in a||(a[p]=null);a.class?a.class=we(a.class):(r||a[k])&&(a.class=null),a[I]&&(a.style??=null);var M=x(e);for(const u in a){let i=a[u];if(w&&u==="value"&&i==null){e.value=e.__value="",f[u]=i;continue}if(u==="class"){var P=e.namespaceURI==="http://www.w3.org/1999/xhtml";Pe(e,P,i,r,t?.[k],a[k]),f[u]=i,f[k]=a[k];continue}if(u==="style"){Ie(e,i,t?.[I],a[I]),f[u]=i,f[I]=a[I];continue}var d=f[u];if(!(i===d&&!(i===void 0&&e.hasAttribute(u)))){f[u]=i;var V=u[0]+u[1];if(V!=="$$")if(V==="on"){const v={},T="$$"+u;let l=u.slice(2);var B=Ne(l);if(ye(l)&&(l=l.slice(0,-7),v.capture=!0),!B&&d){if(i!=null)continue;e.removeEventListener(l,f[T],v),f[T]=null}if(B)Se(l,e,i),Ae([l]);else if(i!=null){let ee=function(te){f[u].call(this,te)};f[T]=Te(l,e,ee,v)}}else if(u==="style")U(e,u,i);else if(u==="autofocus")_e(e,!!i);else if(!_&&(u==="__value"||u==="value"&&i!=null))e.value=e.__value=i;else if(u==="selected"&&w)He(e,i);else{var o=u;y||(o=Ee(o));var F=o==="defaultValue"||o==="defaultChecked";if(i==null&&!_&&!F)if(b[u]=null,o==="value"||o==="checked"){let v=e;const T=t===void 0;if(o==="value"){let l=v.defaultValue;v.removeAttribute(o),v.defaultValue=l,v.value=v.__value=T?l:null}else{let l=v.defaultChecked;v.removeAttribute(o),v.defaultChecked=l,v.checked=T?l:!1}}else e.removeAttribute(u);else F||M.includes(o)&&(_||typeof i!="string")?(e[o]=i,o in b&&(b[o]=he)):typeof i!="function"&&U(e,o,i)}}}return O&&K(!0),f}function Ze(e,t,a=[],r=[],s=[],c,g=!1,G=!1){fe(s,a,r,b=>{var _=void 0,y={},O=e.nodeName===Re,f=!1;if(q(()=>{var p=t(...b.map(A)),M=$e(e,_,p,c,g,G);f&&O&&"value"in p&&j(e,p.value);for(let d of Object.getOwnPropertySymbols(y))p[d]||$(y[d]);for(let d of Object.getOwnPropertySymbols(p)){var P=p[d];d.description===de&&(!_||P!==_[d])&&(y[d]&&$(y[d]),y[d]=Q(()=>ke(e,()=>P))),M[d]=P}_=M}),O){var w=e;W(()=>{j(w,_.value,!0),Le(w)})}f=!0})}function J(e){return e.__attributes??={[X]:e.nodeName.includes("-"),[Z]:e.namespaceURI===oe}}var D=new Map;function x(e){var t=e.getAttribute("is")||e.nodeName,a=D.get(t);if(a)return a;D.set(t,a=[]);for(var r,s=e,c=Element.prototype;c!==s;){r=ve(s);for(var g in r)r[g].set&&a.push(g);s=le(s)}return a}function je(){return h("/api/auth/status")}function Je(){return h("/api/auth/me")}function Ve(e,t){return h("/api/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}function Be(){return h("/api/auth/logout",{method:"POST"})}function Fe(e,t,a){return h("/api/auth/setup",{method:"POST",body:JSON.stringify({email:e,password:t,displayName:a})})}function xe(){return h("/api/auth/users")}function et(e,t,a,r){return h("/api/auth/users",{method:"POST",body:JSON.stringify({email:e,password:t,displayName:a,role:r})})}function tt(e){return h(`/api/auth/users/${e}`,{method:"DELETE"})}function at(e){return h("/api/auth/me",{method:"PATCH",body:JSON.stringify(e)})}function rt(e,t){return h(`/api/auth/users/${e}/password`,{method:"PATCH",body:JSON.stringify({password:t})})}let E=C(null),m=C(!1),R=C(!1),S=C(!0),Y=C("");const Ke={get user(){return A(E)},get authEnabled(){return A(m)},get needsSetup(){return A(R)},get loading(){return A(S)},get workspaceName(){return A(Y)},async checkAuth(){n(S,!0);try{const e=await je();if(n(m,e.authEnabled,!0),n(R,e.userCount===0),e.workspaceName&&n(Y,e.workspaceName,!0),A(R))return n(S,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!e.authEnabled)return n(S,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:t}=await Je();return n(E,t,!0),n(S,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return n(E,null),n(S,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return n(S,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(e,t){const{user:a}=await Ve(e,t);return n(E,a,!0),n(m,!0),a},async setup(e,t,a){const{user:r}=await Fe(e,t,a);return n(E,r,!0),n(m,!0),n(R,!1),r},async logout(){await Be(),n(E,null)}},st=Object.freeze(Object.defineProperty({__proto__:null,auth:Ke},Symbol.toStringTag,{value:"Module"}));export{I as S,Ze as a,Ke as b,Ie as c,We as d,Xe as e,tt as f,rt as g,et as h,st as i,xe as l,Ge as r,U as s,at as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as h,D as K,P as R,g as _,F as g,s as B,G as Y,I as S,J as y,K as M,L as N,M as U,N as j,O as G,Q as $,R as q,S as p,T as m,U as D,V as z,W as C,X as O,Y as I}from"./BqnODQDb.js";import{c as F}from"./bBXT5iJP.js";const J={get(e,r){if(!e.exclude.includes(r))return e.props[r]},set(e,r){return!1},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function H(e,r,s){return new Proxy({props:e,exclude:r},J)}const Q={get(e,r){if(!e.exclude.includes(r))return _(e.version),r in e.special?e.special[r]():e.props[r]},set(e,r,s){if(!(r in e.special)){var n=S;try{I(e.parent_effect),e.special[r]=W({get[r](){return e.props[r]}},r,R)}finally{I(n)}}return e.special[r](s),O(e.version),!0},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},deleteProperty(e,r){return e.exclude.includes(r)||(e.exclude.push(r),O(e.version)),!0},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function k(e,r){return new Proxy({props:e,exclude:r,special:{},version:C(0),parent_effect:S},Q)}const V={get(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(p(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n)return n[r]}},set(e,r,s){let n=e.props.length;for(;n--;){let i=e.props[n];p(i)&&(i=i());const t=h(i,r);if(t&&t.set)return t.set(s),!0}return!1},getOwnPropertyDescriptor(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(p(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n){const i=h(n,r);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,r){if(r===m||r===D)return!1;for(let s of e.props)if(p(s)&&(s=s()),s!=null&&r in s)return!0;return!1},ownKeys(e){const r=[];for(let s of e.props)if(p(s)&&(s=s()),!!s){for(const n in s)r.includes(n)||r.push(n);for(const n of Object.getOwnPropertySymbols(s))r.includes(n)||r.push(n)}return r}};function ee(...e){return new Proxy({props:e},V)}function W(e,r,s,n){var i=!U||(s&j)!==0,t=(s&M)!==0,E=(s&z)!==0,f=n,v=!0,w=()=>(v&&(v=!1,f=E?N(n):n),f),o;if(t){var A=m in e||D in e;o=h(e,r)?.set??(A&&r in e?u=>e[r]=u:void 0)}var a,x=!1;t?[a,x]=F(()=>e[r]):a=e[r],a===void 0&&n!==void 0&&(a=w(),o&&(i&&K(),o(a)));var l;if(i?l=()=>{var u=e[r];return u===void 0?w():(v=!0,u)}:l=()=>{var u=e[r];return u!==void 0&&(f=void 0),u===void 0?f:u},i&&(s&R)===0)return l;if(o){var L=e.$$legacy;return(function(u,d){return arguments.length>0?((!i||!d||L||x)&&o(d?l():u),u):l()})}var P=!1,c=((s&G)!==0?$:q)(()=>(P=!1,l()));t&&_(c);var T=S;return(function(u,d){if(arguments.length>0){const b=d?_(c):i&&t?g(u):u;return B(c,b),P=!0,f!==void 0&&(f=b),u}return Y&&P||(T.f&y)!==0?c.v:_(c)})}export{k as l,W as p,H as r,ee as s};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CrFpCC6p.js","./BqnODQDb.js","./CIb_hHMy.js","./DFYOFE3o.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as L}from"./PPVm8Dsz.js";import{g as S,s as a,v as T}from"./BqnODQDb.js";import{i as V}from"./B6FUcAv5.js";import{w as l}from"./BNfrhBeA.js";import{b as G}from"./CaEaeeKb.js";import{n as h}from"./zoVX1Zab.js";import{u as O}from"./CIb_hHMy.js";import{t as s}from"./B9gDgSlp.js";const Y=800;function q(){let t=T(!1),n=T(null),e=T(null),r=null,i=null,m=!1;function W(u,p,d,c){r&&r.repo===u&&r.type===p&&r.id===d?(c.data!==void 0&&(r.payload.data=c.data),c.content!==void 0&&(r.payload.content=c.content)):r={repo:u,type:p,id:d,payload:{...c}},x()}function x(){i&&clearTimeout(i),i=setTimeout(b,Y)}async function b(){if(i=null,!m&&r){const{repo:u,type:p,id:d,payload:c}=r;r=null,m=!0,a(t,!0),a(e,null);try{if(await O(u,p,d,c),a(n,new Date,!0),c.data?.name){const g=l.repos.find(H=>H.name===u)?.entities.find(H=>H.id===d);g&&(g.title=c.data.name)}}catch(f){a(e,f.message??"Save failed",!0);const g=f.status??f.statusCode;(!g||g>=500)&&(r={repo:u,type:p,id:d,payload:c})}finally{a(t,!1),m=!1,r&&b()}}}function J(){i&&(clearTimeout(i),i=null),r&&b()}async function j(u,p,d,c){a(t,!0),a(e,null);try{const f=await O(u,p,d,c);return a(n,new Date,!0),f}catch(f){return a(e,f.message??"Save failed",!0),null}finally{a(t,!1)}}function F(){a(e,null),a(n,null),r=null,i&&(clearTimeout(i),i=null)}return{get saving(){return S(t)},get lastSaved(){return S(n)},get error(){return S(e)},get hasPending(){return!!(r||m)},scheduleAutoSave:W,flush:J,saveEntity:j,reset:F}}const z=q();let o=null,I=null,N=null,U=null,D=null,P=null,M=null,C=[],w=null,$=1e3,E=T(!1),B=T(null);const y=new Map,_={},A={};function k(t,n){y.delete(t);const e=n.entities.length,r=e===1?`${t} updated ${n.entities[0]}`:`${t} updated ${e} entities`;s(r)}function K(t){for(const[n,e]of y)e.repo===t&&(clearTimeout(e.timer),y.delete(n))}function Q(t){const n=G.user?.displayName;if(t.type==="sync_progress"){const e=_[t.repo];if(e){const r=t.message.trim(),i=r.match(/^Syncing from source:\s*(.+)$/i);i&&(A[t.repo]=`Syncing ${i[1].trim()}…`);const m=A[t.repo]??`Syncing ${t.repo}…`;s.loading(m,{id:e,description:r,duration:36e5})}return}if(t.type==="entity_change"){if(n&&t.actor===n&&t.source==="api"){l.refreshEntities(t.repo);return}if(l.refreshEntities(t.repo),h.selectedRepo===t.repo&&h.selectedType===t.entityType&&h.selectedId===t.entityId){z.hasPending?s(`${t.actor} also saved changes to this entity`):V();return}const r=y.get(t.actor);if(r)clearTimeout(r.timer),r.entities.includes(t.entityId)||r.entities.push(t.entityId),r.timer=setTimeout(()=>k(t.actor,r),1e4);else{const i={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>k(t.actor,i),1e4)};y.set(t.actor,i)}return}if(t.type==="session_commit"){if(n&&t.actor===n){a(B,t.timestamp,!0);return}const e=t.entities.length,r=e===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${e} changes in ${t.repo}`;s(r),l.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(K(t.repo),!_[t.repo]){const e=t.created+t.updated+t.deleted,r=e===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${e} ${e===1?"entity":"entities"} from ${t.source}`;s.success(r)}l.refreshEntities(t.repo);return}if(t.type==="collection_created"){s(`${t.actor} created collection ${t.repo}`),l.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){s(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){s(`${t.actor} pushed to ${t.repo}`),l.refreshEntities(t.repo);return}if(t.type==="collection_message"){U?.(t);return}if(t.type==="message_update"){D?.(t);return}if(t.type==="collection_agent_thinking"){P?.(t);return}if(t.type==="user_mention"){M?.(t);return}if(t.type==="presence"){I?.(t);return}if(t.type==="online"){N?.(t);return}if(t.type==="insights_updated"||t.type==="briefing_updated"){L(()=>import("./CrFpCC6p.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.insightsStore.load());return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&h.selectedRepo===t.repo&&h.deselect(),l.load();return}}function R(){if(typeof window>"u"||o&&(o.readyState===WebSocket.OPEN||o.readyState===WebSocket.CONNECTING))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;o=new WebSocket(n),o.binaryType="arraybuffer",o.onopen=()=>{a(E,!0),$=1e3,l.refreshAll();for(const e of C)e()},o.onmessage=e=>{if(!(e.data instanceof ArrayBuffer))try{const r=JSON.parse(e.data);if(r?.type==="ping"){o?.send(JSON.stringify({type:"pong"}));return}const i=r;i.type&&i.type!=="toast"&&Q(i)}catch{}},o.onclose=()=>{a(E,!1),o=null,w=setTimeout(()=>{$=Math.min($*2,1e4),R()},$)},o.onerror=()=>{}}function X(){w&&(clearTimeout(w),w=null),o&&(o.close(),o=null),a(E,!1);for(const[,t]of y)clearTimeout(t.timer);y.clear()}function Z(t,n=4e3){s(t,{duration:n})}function v(t,n){const e=crypto.randomUUID();return n?.loading?s.loading(t,{id:e,duration:36e5}):s(t,{id:e}),e}function tt(t,n,e){if(e?.loading){s.loading(n,{id:t});return}/failed|error/i.test(n)?s.error(n,{id:t,duration:e?.duration??6e3}):s.success(n,{id:t,duration:e?.duration??4e3})}function et(t){const n=crypto.randomUUID();_[t]=n,s.loading(`Syncing ${t}…`,{id:n,duration:36e5})}function rt(t,n,e){const r=_[t];r&&(delete _[t],delete A[t],e?s.error(n,{id:r,duration:6e3}):s.success(n,{id:r,duration:4e3}))}function nt(t){I=t}function it(t){N=t}function ot(t){U=t}function st(t){D=t}function at(t){P=t}function ct(t){M=t}function lt(t){C.push(t)}function ut(t){o?.readyState===WebSocket.OPEN&&o.send(JSON.stringify(t))}const Tt={get connected(){return S(E)},get lastAutoSaved(){return S(B)},get ws(){return o},connect:R,disconnect:X,showToast:Z,showPersistentToast:v,updateToast:tt,startSyncToast:et,finishSyncToast:rt,send:ut,setPresenceHandler:nt,setOnlineHandler:it,setMessagesHandler:ot,setMessageUpdateHandler:st,setAgentThinkingHandler:at,setUserMentionHandler:ct,addConnectHandler:lt};export{z as e,Tt as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./DsnmJJEf.js";import{i as V}from"./BHKpz6_7.js";import{p as $,l as n,s as c,d as p,g as i,a as A,c as m,n as H,r as _,b as U,m as u,t as k}from"./BqnODQDb.js";import{a as v,s as B,f as b}from"./BgO5HlCg.js";import{i as C}from"./CNKK6nZb.js";import{a as N}from"./CaEaeeKb.js";import{l as g,p as h}from"./Ch6e_wpP.js";var P=b("<title> </title>"),R=b('<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>');function G(x,t){const e=g(t,["children","$$slots","$$events","$$legacy"]),w=g(e,["size","title"]);$(t,!1);const a=u(),d=u();let f=h(t,"size",8,16),s=h(t,"title",8,void 0);n(()=>(p(e),p(s())),()=>{c(a,e["aria-label"]||e["aria-labelledby"]||s())}),n(()=>(i(a),p(e)),()=>{c(d,{"aria-hidden":i(a)?void 0:!0,role:i(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),A(),V();var r=R();N(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...i(d),...w}));var y=m(r);{var z=o=>{var l=P(),M=m(l,!0);_(l),k(()=>B(M,s())),v(o,l)};C(y,o=>{s()&&o(z)})}H(2),_(r),v(x,r),U()}export{G as U};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{w as B,e as me,h as H,k as K,A as he,f as Se,g as u,i as ye,ac as ve,j as ae,o as W,q as U,C as _e,ad as Ie,ae as oe,af as Te,ag as $,ah as G,ai as we,aj as Ae,R as be,ak as Ee,al as se,am as Ce,an as ke,m as Ne,W as ie,ao as Oe,ap as fe,aq as ue,ar as Y,as as xe,at as Re,au as $e,av as Me,z as De,aw as de,ax as Fe,v as x,F as Z,s as b,X as q}from"./BqnODQDb.js";import{i as He,g as ze}from"./B6FUcAv5.js";import{n as R}from"./zoVX1Zab.js";import{w as V}from"./BNfrhBeA.js";import{b as ne}from"./CaEaeeKb.js";function et(e,a){return a}function Pe(e,a,r){for(var n=[],c=a.length,l,d=a.length,h=0;h<c;h++){let T=a[h];ue(T,()=>{if(l){if(l.pending.delete(T),l.done.add(T),l.pending.size===0){var p=e.outrogroups;Q(se(l.done)),p.delete(l),p.size===0&&(e.outrogroups=null)}}else d-=1},!1)}if(d===0){var f=n.length===0&&r!==null;if(f){var g=r,o=g.parentNode;Re(o),o.append(g),e.items.clear()}Q(a,!f)}else l={pending:new Set(a),done:new Set},(e.outrogroups??=new Set).add(l)}function Q(e,a=!0){for(var r=0;r<e.length;r++)$e(e[r],a)}var le;function tt(e,a,r,n,c,l=null){var d=e,h=new Map,f=(a&de)!==0;if(f){var g=e;d=H?K(he(g)):g.appendChild(B())}H&&Se();var o=null,T=be(()=>{var s=r();return Ee(s)?s:s==null?[]:se(s)}),p,I=!0;function k(){t.fallback=o,Je(t,p,d,a,n),o!==null&&(p.length===0?(o.f&$)===0?fe(o):(o.f^=$,J(o,null,d)):ue(o,()=>{o=null}))}var M=me(()=>{p=u(T);var s=p.length;let w=!1;if(H){var S=ye(d)===ve;S!==(s===0)&&(d=ae(),K(d),W(!1),w=!0)}for(var y=new Set,A=Te,C=Ae(),m=0;m<s;m+=1){H&&U.nodeType===_e&&U.data===Ie&&(d=U,w=!0,W(!1));var N=p[m],O=n(N,m),_=I?null:h.get(O);_?(_.v&&oe(_.v,N),_.i&&oe(_.i,m),C&&A.unskip_effect(_.e)):(_=Le(h,I?d:le??=B(),N,O,m,c,a,r),I||(_.e.f|=$),h.set(O,_)),y.add(O)}if(s===0&&l&&!o&&(I?o=G(()=>l(d)):(o=G(()=>l(le??=B())),o.f|=$)),s>y.size&&we(),H&&s>0&&K(ae()),!I)if(C){for(const[i,v]of h)y.has(i)||A.skip_effect(v.e);A.oncommit(k),A.ondiscard(()=>{})}else k();w&&W(!0),u(T)}),t={effect:M,items:h,outrogroups:null,fallback:o};I=!1,H&&(d=U)}function z(e){for(;e!==null&&(e.f&xe)===0;)e=e.next;return e}function Je(e,a,r,n,c){var l=(n&Fe)!==0,d=a.length,h=e.items,f=z(e.effect.first),g,o=null,T,p=[],I=[],k,M,t,s;if(l)for(s=0;s<d;s+=1)k=a[s],M=c(k,s),t=h.get(M).e,(t.f&$)===0&&(t.nodes?.a?.measure(),(T??=new Set).add(t));for(s=0;s<d;s+=1){if(k=a[s],M=c(k,s),t=h.get(M).e,e.outrogroups!==null)for(const _ of e.outrogroups)_.pending.delete(t),_.done.delete(t);if((t.f&$)!==0)if(t.f^=$,t===f)J(t,null,r);else{var w=o?o.next:f;t===e.effect.last&&(e.effect.last=t.prev),t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),F(e,o,t),F(e,t,w),J(t,w,r),o=t,p=[],I=[],f=z(o.next);continue}if((t.f&Y)!==0&&(fe(t),l&&(t.nodes?.a?.unfix(),(T??=new Set).delete(t))),t!==f){if(g!==void 0&&g.has(t)){if(p.length<I.length){var S=I[0],y;o=S.prev;var A=p[0],C=p[p.length-1];for(y=0;y<p.length;y+=1)J(p[y],S,r);for(y=0;y<I.length;y+=1)g.delete(I[y]);F(e,A.prev,C.next),F(e,o,A),F(e,C,S),f=S,o=C,s-=1,p=[],I=[]}else g.delete(t),J(t,f,r),F(e,t.prev,t.next),F(e,t,o===null?e.effect.first:o.next),F(e,o,t),o=t;continue}for(p=[],I=[];f!==null&&f!==t;)(g??=new Set).add(f),I.push(f),f=z(f.next);if(f===null)continue}(t.f&$)===0&&p.push(t),o=t,f=z(t.next)}if(e.outrogroups!==null){for(const _ of e.outrogroups)_.pending.size===0&&(Q(se(_.done)),e.outrogroups?.delete(_));e.outrogroups.size===0&&(e.outrogroups=null)}if(f!==null||g!==void 0){var m=[];if(g!==void 0)for(t of g)(t.f&Y)===0&&m.push(t);for(;f!==null;)(f.f&Y)===0&&f!==e.fallback&&m.push(f),f=z(f.next);var N=m.length;if(N>0){var O=(n&de)!==0&&d===0?r:null;if(l){for(s=0;s<N;s+=1)m[s].nodes?.a?.measure();for(s=0;s<N;s+=1)m[s].nodes?.a?.fix()}Pe(e,m,O)}}l&&Me(()=>{if(T!==void 0)for(t of T)t.nodes?.a?.apply()})}function Le(e,a,r,n,c,l,d,h){var f=(d&Ce)!==0?(d&ke)===0?Ne(r,!1,!1):ie(r):null,g=(d&Oe)!==0?ie(c):null;return{v:f,i:g,e:G(()=>(l(a,f??r,g??c,h),()=>{e.delete(n)}))}}function J(e,a,r){if(e.nodes)for(var n=e.nodes.start,c=e.nodes.end,l=a&&(a.f&$)===0?a.nodes.start:r;n!==null;){var d=De(n);if(l.before(n),n===c)return;n=d}}function F(e,a,r){a===null?e.effect.first=r:a.next=r,r===null?e.effect.last=a:r.prev=a}function Ue(e,a,r){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:r}).then(async n=>{if(!n.ok){a({type:"error",message:`HTTP ${n.status}`});return}const c=n.body?.getReader();if(!c){a({type:"error",message:"No response body"});return}const l=new TextDecoder;let d="";for(;;){const{done:h,value:f}=await c.read();if(h)break;d+=l.decode(f,{stream:!0});const g=d.split(`
|
|
2
|
-
`);d=g.pop()??"";for(const o of g)if(o.startsWith("data: "))try{const T=JSON.parse(o.slice(6));a(T)}catch{}}}).catch(n=>{n.name!=="AbortError"&&a({type:"error",message:n.message})})}function j(){const e=ne.user?.id;return e?`sg-chat-sessions-${e}`:"sg-chat-sessions"}function ee(){const e=ne.user?.id;return e?`sg-chat-version-${e}`:"sg-chat-version"}const qe=14;function Ve(){try{ne.user?.id&&localStorage.getItem("sg-chat-sessions")&&(localStorage.removeItem("sg-chat-sessions"),localStorage.removeItem("sg-chat-version"))}catch{}}function L(){Ve();try{const e=localStorage.getItem(j());if(!e)return[];if(localStorage.getItem(ee())==="2")return JSON.parse(e);const n=JSON.parse(e).map(c=>({id:crypto.randomUUID(),createdAt:c.date+"T00:00:00.000Z",updatedAt:c.date+"T00:00:00.000Z",title:c.messages.find(l=>l.role==="user")?.content.slice(0,50)||"New chat",messages:c.messages}));return localStorage.setItem(j(),JSON.stringify(n)),localStorage.setItem(ee(),"2"),n}catch{return[]}}function te(e){const r=[...e].sort((n,c)=>c.updatedAt.localeCompare(n.updatedAt)).slice(0,qe);try{localStorage.setItem(j(),JSON.stringify(r)),localStorage.setItem(ee(),"2")}catch{}}function P(e,a){const r=L(),n=a.map(({streaming:l,...d})=>d),c=r.findIndex(l=>l.id===e);c>=0&&(r[c].messages=n,r[c].updatedAt=new Date().toISOString()),te(r)}function ce(e){const a=new Date().toISOString().slice(0,10);return e.updatedAt.slice(0,10)===a}function Xe(){const r=L().sort((s,w)=>w.updatedAt.localeCompare(s.updatedAt)).find(ce)??null;let n=x(Z(r?r.messages.map(s=>({...s,streaming:!1})):[])),c=x(Z(r?.id??null)),l=x(!1),d=x(0),h=x(0),f=x(0),g=x(null),o=null,T=x(""),p=x(Z(!!r));const I=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function k(){if(u(c)&&u(p))return u(c);const s=u(c)||crypto.randomUUID();b(c,s,!0);const w=new Date().toISOString(),S=L();return S.push({id:s,createdAt:w,updatedAt:w,title:"New chat",messages:[]}),te(S),b(p,!0),s}function M(s,w){if(!s.trim()||u(l))return;b(g,null);const S=k();w?.silent||u(n).push({role:"user",content:s}),u(n).push({role:"agent",content:"",segments:[],streaming:!0}),b(l,!0);const y=L(),A=y.find(i=>i.id===S);A&&A.title==="New chat"&&(A.title=s.slice(0,50),te(y)),P(S,u(n));let C=!1,m=null;o=new AbortController;const N=R.selectedSubPath?`${R.selectedRepo}/${R.selectedType}/${R.selectedId}/${R.selectedSubPath}`:R.selectedId?`${R.selectedRepo}/${R.selectedType}/${R.selectedId}`:null,O=u(n).slice(0,-2).map(i=>({role:i.role==="agent"?"assistant":i.role,content:i.content})),_={message:s,context:N??void 0,sessionId:S,history:O.length>0?O:void 0};Ue(_,i=>{if(!u(l))return;const v=u(n)[u(n).length-1];if(!v||v.role!=="agent")return;const D=v.segments;switch(i.type){case"token":{v.content+=i.text??"";const E=D[D.length-1];E&&E.type==="text"?E.content+=i.text??"":D.push({type:"text",content:i.text??""}),v.segments=D,q(h);break}case"tool_start":if(i.name){I.has(i.name)&&(C=!0);const E=D[D.length-1];E&&E.type==="tools"?E.names=[...E.names,i.name]:D.push({type:"tools",names:[i.name]}),v.segments=D,q(h)}break;case"mutation":C=!0,i.action==="created"&&i.repo&&i.entityType&&i.entityId&&(m={repo:i.repo,entityType:i.entityType,entityId:i.entityId}),i.repo==="_conversation"&&setTimeout(()=>{b(n,[],!0),u(c)&&u(p)&&P(u(c),u(n))},100),i.repo==="_workspace"&&V.load(),window.StudioChrome?.emitMutation?.({action:i.action,repo:i.repo,entityType:i.entityType,entityId:i.entityId});break;case"highlight":b(g,i.entityIds&&i.entityIds.length>0?new Set(i.entityIds):null,!0);break;case"done":{i.message&&!v.content&&(v.content=i.message,v.segments=[{type:"text",content:i.message}]);const E=/<!--\s*followups:\s*\[.*?\]\s*-->\s*$/s;v.content&&(v.content=v.content.replace(E,"").trimEnd());const re=v.segments??[],X=re[re.length-1];if(X?.type==="text"&&(X.content=X.content.replace(E,"").trimEnd()),i.suggestions?.length&&(v.suggestions=i.suggestions),v.streaming=!1,b(l,!1),P(S,u(n)),C){He().then(()=>{q(d)});const ge=new Set(V.repos.map(pe=>pe.name));(m&&!ge.has(m.repo)?V.load():V.refreshAll()).then(()=>{m&&ze(`/${m.repo}/${m.entityType}/${m.entityId}`)})}break}case"error":v.content+=`
|
|
3
|
-
|
|
4
|
-
Error: ${i.message}`,v.streaming=!1,b(l,!1),P(S,u(n));break}},o.signal)}function t(){if(!u(l))return;fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{}),o?.abort(),o=null,b(l,!1);const s=u(n)[u(n).length-1];s?.streaming&&(s.streaming=!1,u(c)&&P(u(c),u(n)))}return{get messages(){return u(n)},get streaming(){return u(l)},get mutationCount(){return u(d)},get scrollTick(){return u(h)},get forceScroll(){return u(f)},triggerScroll(){q(f)},get highlightedIds(){return u(g)},get activeSessionId(){return u(c)},get draftInput(){return u(T)},set draftInput(s){b(T,s,!0)},send:M,stop:t,reinitialize(){t();const S=L().sort((y,A)=>A.updatedAt.localeCompare(y.updatedAt)).find(ce)??null;b(c,S?.id??null,!0),b(n,S?.messages.map(y=>({...y,streaming:!1}))??[],!0),b(p,!!S)}}}const Be=Xe(),st=Object.freeze(Object.defineProperty({__proto__:null,chatStore:Be},Symbol.toStringTag,{value:"Module"}));export{st as a,Be as c,tt as e,et as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{e as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as r,s as e,v as n}from"./BqnODQDb.js";import{s as c,a as _,b as p}from"./CIb_hHMy.js";function v(){let o=n(null),l=n(null),d=!1,i=n(!1),a=n(""),s=n(null),g=n(!1),u=n(!1);async function b(){try{const[t,f]=await Promise.all([_(),p()]);e(o,t.briefingText??null,!0),e(l,t.generatedAt??null,!0),e(a,f.home_brief??"",!0),e(s,f.accent_color??null,!0),e(g,f.onboarded??!1,!0),e(i,!0),e(u,!0)}catch(t){console.error("Failed to load briefing:",t),e(i,!0),e(u,!0)}}async function h(t){e(a,t,!0),await c({home_brief:t})}async function m(t){e(s,t,!0),await c({accent_color:t})}async function y(){await c({home_brief:""}),e(a,""),e(o,null),e(l,null)}return{get briefingText(){return r(o)},get briefingGeneratedAt(){return r(l)},get loading(){return d},get loaded(){return r(i)},get homeBrief(){return r(a)},get accentColor(){return r(s)},get onboarded(){return r(g)},get briefLoaded(){return r(u)},load:b,saveBrief:h,saveAccentColor:m,reset:y}}const A=v();export{A as insightsStore};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./DsnmJJEf.js";import{i as A}from"./BHKpz6_7.js";import{p as M,l as p,s as c,d,g as i,a as k,c as m,n as B,r as _,b as C,m as u,t as L}from"./BqnODQDb.js";import{a as g,s as N,f as h}from"./BgO5HlCg.js";import{i as P}from"./CNKK6nZb.js";import{a as R}from"./CaEaeeKb.js";import{l as v,p as b}from"./Ch6e_wpP.js";var Y=h("<title> </title>"),j=h('<svg><!><path d="M17 15 17 5 15 5 15 15 5 15 5 17 15 17 15 27 17 27 17 17 27 17 27 15 17 15z"></path></svg>');function J(x,t){const e=v(t,["children","$$slots","$$events","$$legacy"]),w=v(e,["size","title"]);M(t,!1);const a=u(),f=u();let n=b(t,"size",8,16),s=b(t,"title",8,void 0);p(()=>(d(e),d(s())),()=>{c(a,e["aria-label"]||e["aria-labelledby"]||s())}),p(()=>(i(a),d(e)),()=>{c(f,{"aria-hidden":i(a)?void 0:!0,role:i(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),k(),A();var r=j();R(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:n(),height:n(),...i(f),...w}));var y=m(r);{var z=o=>{var l=Y(),$=m(l,!0);_(l),L(()=>N($,s())),g(o,l)};P(y,o=>{s()&&o(z)})}B(),_(r),g(x,r),C()}export{J as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./DsnmJJEf.js";import{p as fe,c as J,r as Y,t as K,b as ve,v as A,F as ye,u as ht,s as r,g as e,L as Xt,aE as we,a3 as Lt,a4 as l,Z as lt,a2 as h}from"./BqnODQDb.js";import{a,b as G,o as xe,g as Ct,e as Me,c as b,d as Ee,t as he,s as Yt,f as Ft}from"./BgO5HlCg.js";import{i as B,b as Ie}from"./CNKK6nZb.js";import{e as ue}from"./Cmfiirqp.js";import{s as y,c as le,d as p,a as Pe,S as Ae}from"./CaEaeeKb.js";import{p as T,s as ce,r as Le}from"./Ch6e_wpP.js";import{a as O,c as it,s as Ce,S as He}from"./B9gDgSlp.js";import{c as Tt}from"./CQ5FjHZK.js";import{a as st,s as rt}from"./D3sy0IkA.js";import"./BHKpz6_7.js";const Oe=Array(12).fill(0);var ke=G('<div class="sonner-loading-bar"></div>'),Ne=G('<div><div class="sonner-spinner"></div></div>');function Re(_,t){fe(t,!0);var L=Ne(),k=J(L);ue(k,23,()=>Oe,($,tt)=>`spinner-bar-${tt}`,($,tt)=>{var ct=ke();a($,ct)}),Y(k),Y(L),K($=>{rt(L,1,$),y(L,"data-visible",t.visible)},[()=>st(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),a(_,L),ve()}function Zt(_){return _.label!==void 0}function Fe(){let _=A(ye(typeof document<"u"?document.hidden:!1));return ht(()=>xe(document,"visibilitychange",()=>{r(_,document.hidden,!0)})),{get current(){return e(_)}}}const be=4e3,ze=14,We=45,Ue=200,Ve=.05,je={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Ke(_){const[t,L]=_.split("-"),k=[];return t&&k.push(t),L&&k.push(L),k}function _e(_){return 1/(1.5+Math.abs(_)/20)}var Ye=G("<div><!></div>"),Ze=G('<button data-close-button=""><!></button>'),Ge=G('<div data-icon=""><!> <!></div>'),Xe=G('<div data-description=""><!></div>'),Qe=G('<button data-button="" data-cancel=""> </button>'),qe=G('<button data-button=""> </button>'),Je=G('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),pe=G('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function $e(_,t){fe(t,!0);const L=s=>{var c=b(),v=h(c);{var w=g=>{var C=Ye(),It=J(C);p(It,()=>t.loadingIcon),Y(C),K(Rt=>{rt(C,1,Rt),y(C,"data-visible",e(S)==="loading")},[()=>st(it(e(j)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),a(g,C)},x=g=>{{let C=l(()=>it(e(j)?.loader,t.toast.classes?.loader)),It=l(()=>e(S)==="loading");Re(g,{get class(){return e(C)},get visible(){return e(It)}})}};B(v,g=>{t.loadingIcon?g(w):g(x,!1)})}a(s,c)};let k=T(t,"cancelButtonStyle",3,""),$=T(t,"actionButtonStyle",3,""),tt=T(t,"descriptionClass",3,""),ct=T(t,"unstyled",3,!1),Bt=T(t,"defaultRichColors",3,!1);const St={...je};let V=A(!1),N=A(!1),Dt=A(!1),Ht=A(!1),Ot=A(!1),W=A(0),dt=A(0),Mt=t.toast.duration||t.duration||be,Z=A(void 0),et=A(null),kt=A(null);const Qt=l(()=>t.index===0),qt=l(()=>t.index+1<=t.visibleToasts),S=l(()=>t.toast.type),U=l(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Et=l(()=>t.toast.class||""),yt=l(()=>t.toast.descriptionClass||""),ut=l(()=>O.heights.findIndex(s=>s.toastId===t.toast.id)||0),ft=l(()=>t.toast.closeButton??t.closeButton),wt=l(()=>t.toast.duration??t.duration??be);let bt=null;const zt=l(()=>t.position.split("-")),Jt=l(()=>O.heights.reduce((s,c,v)=>v>=e(ut)?s:s+c.height,0)),pt=Fe(),$t=l(()=>t.toast.invert||t.invert),Nt=l(()=>e(S)==="loading"),j=l(()=>({...St,...t.classes})),te=l(()=>t.toast.title),ee=l(()=>t.toast.description);let vt=A(0),Wt=A(0);const Pt=l(()=>Math.round(e(ut)*ze+e(Jt)));ht(()=>{e(te),e(ee);let s;t.expanded||t.expandByDefault?s=1:s=1-t.index*Ve;const c=Xt(()=>e(Z));if(c===void 0)return;c.style.setProperty("height","auto");const v=c.offsetHeight,w=c.getBoundingClientRect().height,x=Math.round(w/s+Number.EPSILON&100)/100;c.style.removeProperty("height");let g;Math.abs(x-v)<1?g=x:g=v,r(dt,g,!0),O.setHeight({toastId:t.toast.id,height:g})});function n(){r(N,!0),r(W,e(Pt),!0),O.removeHeight(t.toast.id),setTimeout(()=>{O.remove(t.toast.id)},Ue)}let M;const nt=l(()=>t.toast.promise&&e(S)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function at(){r(vt,new Date().getTime(),!0),M=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),n()},Mt)}function xt(){if(e(Wt)<e(vt)){const s=new Date().getTime()-e(vt);Mt=Mt-s}r(Wt,new Date().getTime(),!0)}ht(()=>{t.toast.updated&&(clearTimeout(M),Mt=e(wt),at())}),ht(()=>(e(nt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&pt.current?xt():at()),()=>clearTimeout(M))),we(()=>{r(V,!0);const s=e(Z)?.getBoundingClientRect().height;return r(dt,s,!0),O.setHeight({toastId:t.toast.id,height:s}),()=>{O.removeHeight(t.toast.id)}}),ht(()=>{t.toast.delete&&Xt(()=>{n(),t.toast.onDismiss?.(t.toast)})});const ne=s=>{if(e(Nt))return;r(W,e(Pt),!0);const c=s.target;c.setPointerCapture(s.pointerId),c.tagName!=="BUTTON"&&(r(Dt,!0),bt={x:s.clientX,y:s.clientY})},me=()=>{if(e(Ht)||!e(U))return;bt=null;const s=Number(e(Z)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),c=Number(e(Z)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),v=new Date().getTime()-0,w=e(et)==="x"?s:c,x=Math.abs(w)/v;if(Math.abs(w)>=We||x>.11){r(W,e(Pt),!0),t.toast.onDismiss?.(t.toast),e(et)==="x"?r(kt,s>0?"right":"left",!0):r(kt,c>0?"down":"up",!0),n(),r(Ht,!0);return}else e(Z)?.style.setProperty("--swipe-amount-x","0px"),e(Z)?.style.setProperty("--swipe-amount-y","0px");r(Ot,!1),r(Dt,!1),r(et,null)},Ut=s=>{if(!bt||!e(U)||(window.getSelection()?.toString().length??-1)>0)return;const v=s.clientY-bt.y,w=s.clientX-bt.x,x=t.swipeDirections??Ke(t.position);!e(et)&&(Math.abs(w)>1||Math.abs(v)>1)&&r(et,Math.abs(w)>Math.abs(v)?"x":"y",!0);let g={x:0,y:0};if(e(et)==="y"){if(x.includes("top")||x.includes("bottom"))if(x.includes("top")&&v<0||x.includes("bottom")&&v>0)g.y=v;else{const C=v*_e(v);g.y=Math.abs(C)<Math.abs(v)?C:v}}else if(e(et)==="x"&&(x.includes("left")||x.includes("right")))if(x.includes("left")&&w<0||x.includes("right")&&w>0)g.x=w;else{const C=w*_e(w);g.x=Math.abs(C)<Math.abs(w)?C:w}(Math.abs(g.x)>0||Math.abs(g.y)>0)&&r(Ot,!0),e(Z)?.style.setProperty("--swipe-amount-x",`${g.x}px`),e(Z)?.style.setProperty("--swipe-amount-y",`${g.y}px`)},ot=()=>{r(Dt,!1),r(et,null),bt=null},mt=l(()=>t.toast.icon?t.toast.icon:e(S)==="success"?t.successIcon:e(S)==="error"?t.errorIcon:e(S)==="warning"?t.warningIcon:e(S)==="info"?t.infoIcon:e(S)==="loading"?t.loadingIcon:null);var i=pe();y(i,"tabindex",0);let At;var Vt=J(i);{var ge=s=>{var c=Ze(),v=J(c);p(v,()=>t.closeIcon??lt),Y(c),K(w=>{y(c,"aria-label",t.closeButtonAriaLabel),y(c,"data-disabled",e(Nt)),rt(c,1,w)},[()=>st(it(e(j)?.closeButton,t.toast?.classes?.closeButton))]),Ct("click",c,()=>{e(Nt)||!e(U)||(n(),t.toast.onDismiss?.(t.toast))}),a(s,c)};B(Vt,s=>{e(ft)&&!t.toast.component&&e(S)!=="loading"&&t.closeIcon!==null&&s(ge)})}var ae=Lt(Vt,2);{var oe=s=>{const c=l(()=>t.toast.component);var v=b(),w=h(v);Tt(w,()=>e(c),(x,g)=>{g(x,ce(()=>t.toast.componentProps,{closeToast:n}))}),a(s,v)},ie=s=>{var c=Je(),v=h(c);{var w=u=>{var m=Ge(),o=J(m);{var I=d=>{var f=b(),z=h(f);{var E=_t=>{var Kt=b(),re=h(Kt);Tt(re,()=>t.toast.icon,(H,F)=>{F(H,{})}),a(_t,Kt)},q=_t=>{L(_t)};B(z,_t=>{t.toast.icon?_t(E):_t(q,!1)})}a(d,f)};B(o,d=>{(t.toast.promise||e(S)==="loading")&&d(I)})}var P=Lt(o,2);{var D=d=>{var f=b(),z=h(f);{var E=H=>{var F=b(),gt=h(F);Tt(gt,()=>t.toast.icon,(Se,De)=>{De(Se,{})}),a(H,F)},q=H=>{var F=b(),gt=h(F);p(gt,()=>t.successIcon??lt),a(H,F)},_t=H=>{var F=b(),gt=h(F);p(gt,()=>t.errorIcon??lt),a(H,F)},Kt=H=>{var F=b(),gt=h(F);p(gt,()=>t.warningIcon??lt),a(H,F)},re=H=>{var F=b(),gt=h(F);p(gt,()=>t.infoIcon??lt),a(H,F)};B(z,H=>{t.toast.icon?H(E):e(S)==="success"?H(q,1):e(S)==="error"?H(_t,2):e(S)==="warning"?H(Kt,3):e(S)==="info"&&H(re,4)})}a(d,f)};B(P,d=>{t.toast.type!=="loading"&&d(D)})}Y(m),K(d=>rt(m,1,d),[()=>st(it(e(j)?.icon,t.toast?.classes?.icon))]),a(u,m)};B(v,u=>{(e(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(mt)!==null||t.toast.icon)&&u(w)})}var x=Lt(v,2),g=J(x),C=J(g);{var It=u=>{var m=b(),o=h(m);{var I=D=>{const d=l(()=>t.toast.title);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.title)),a(D,d)};B(o,D=>{typeof t.toast.title!="string"?D(I):D(P,!1)})}a(u,m)};B(C,u=>{t.toast.title&&u(It)})}Y(g);var Rt=Lt(g,2);{var se=u=>{var m=Xe(),o=J(m);{var I=D=>{const d=l(()=>t.toast.description);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.description)),a(D,d)};B(o,D=>{typeof t.toast.description!="string"?D(I):D(P,!1)})}Y(m),K(D=>rt(m,1,D),[()=>st(it(tt(),e(yt),e(j)?.description,t.toast.classes?.description))]),a(u,m)};B(Rt,u=>{t.toast.description&&u(se)})}Y(x);var jt=Lt(x,2);{var X=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.cancel,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=Qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.cancelButtonStyle??k()),rt(f,1,E),Yt(z,t.toast.cancel.label)},[()=>st(it(e(j)?.cancelButton,t.toast?.classes?.cancelButton))]),Ct("click",f,E=>{Zt(t.toast.cancel)&&e(U)&&(t.toast.cancel?.onClick?.(E),n())}),a(d,f)},D=l(()=>Zt(t.toast.cancel));B(o,d=>{typeof t.toast.cancel=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(jt,u=>{t.toast.cancel&&u(X)})}var R=Lt(jt,2);{var Q=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.action,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.actionButtonStyle??$()),rt(f,1,E),Yt(z,t.toast.action.label)},[()=>st(it(e(j)?.actionButton,t.toast?.classes?.actionButton))]),Ct("click",f,E=>{Zt(t.toast.action)&&(t.toast.action?.onClick(E),!E.defaultPrevented&&n())}),a(d,f)},D=l(()=>Zt(t.toast.action));B(o,d=>{typeof t.toast.action=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(R,u=>{t.toast.action&&u(Q)})}K((u,m)=>{rt(x,1,u),rt(g,1,m)},[()=>st(it(e(j)?.content,t.toast?.classes?.content)),()=>st(it(e(j)?.title,t.toast?.classes?.title))]),a(s,c)};B(ae,s=>{t.toast.component?s(oe):s(ie,!1)})}Y(i),Ie(i,s=>r(Z,s),()=>e(Z)),K((s,c,v)=>{rt(i,1,s),y(i,"aria-live",t.toast.important?"assertive":"polite"),y(i,"data-rich-colors",t.toast.richColors??Bt()),y(i,"data-styled",!(t.toast.component||t.toast.unstyled||ct())),y(i,"data-mounted",e(V)),y(i,"data-promise",c),y(i,"data-swiped",e(Ot)),y(i,"data-removed",e(N)),y(i,"data-visible",e(qt)),y(i,"data-y-position",e(zt)[0]),y(i,"data-x-position",e(zt)[1]),y(i,"data-index",t.index),y(i,"data-front",e(Qt)),y(i,"data-swiping",e(Dt)),y(i,"data-dismissible",e(U)),y(i,"data-type",e(S)),y(i,"data-invert",e($t)),y(i,"data-swipe-out",e(Ht)),y(i,"data-swipe-direction",e(kt)),y(i,"data-expanded",v),At=le(i,`${t.style} ${t.toast.style}`,At,{"--index":t.index,"--toasts-before":t.index,"--z-index":O.toasts.length-t.index,"--offset":`${e(N)?e(W):e(Pt)}px`,"--initial-height":t.expandByDefault?"auto":`${e(dt)}px`})},[()=>st(it(t.class,e(Et),e(j)?.toast,t.toast?.classes?.toast,e(j)?.[e(S)],t.toast?.classes?.[e(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(V))]),Ct("pointermove",i,Ut),Ct("pointerup",i,me),Ct("pointerdown",i,ne),Me("dragend",i,ot),a(_,i),ve()}Ee(["pointermove","pointerup","pointerdown","click"]);var tn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function en(_){var t=tn();a(_,t)}var nn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function an(_){var t=nn();a(_,t)}var on=Ft('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function sn(_){var t=on();a(_,t)}var rn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function ln(_){var t=rn();a(_,t)}var cn=Ft('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function dn(_){var t=cn();a(_,t)}const un=3,Te="24px",Be="16px",fn=4e3,vn=356,mn=14,de="dark",Gt="light";function gn(_,t){const L={};return[_,t].forEach((k,$)=>{const tt=$===1,ct=tt?"--mobile-offset":"--offset",Bt=tt?Be:Te;function St(V){["top","right","bottom","left"].forEach(N=>{L[`${ct}-${N}`]=typeof V=="number"?`${V}px`:V})}typeof k=="number"||typeof k=="string"?St(k):typeof k=="object"?["top","right","bottom","left"].forEach(V=>{const N=k[V];N===void 0?L[`${ct}-${V}`]=Bt:L[`${ct}-${V}`]=typeof N=="number"?`${N}px`:N}):St(Bt)}),L}var hn=G("<ol></ol>"),bn=G('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function Pn(_,t){fe(t,!0);function L(n){return n!=="system"?n:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?de:Gt}let k=T(t,"invert",3,!1),$=T(t,"position",3,"bottom-right"),tt=T(t,"hotkey",19,()=>["altKey","KeyT"]),ct=T(t,"expand",3,!1),Bt=T(t,"closeButton",3,!1),St=T(t,"offset",3,Te),V=T(t,"mobileOffset",3,Be),N=T(t,"theme",3,"light"),Dt=T(t,"richColors",3,!1),Ht=T(t,"duration",3,fn),Ot=T(t,"visibleToasts",3,un),W=T(t,"toastOptions",19,()=>({})),dt=T(t,"dir",7,"auto"),Mt=T(t,"gap",3,mn),Z=T(t,"pauseWhenPageIsHidden",3,!1),et=T(t,"containerAriaLabel",3,"Notifications"),kt=T(t,"closeButtonAriaLabel",3,"Close toast"),Qt=Le(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function qt(){if(dt()!=="auto")return dt();if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?(Xt(()=>dt(window.getComputedStyle(document.documentElement).direction??"ltr")),dt()):(Xt(()=>dt(n)),n)}const S=l(()=>Array.from(new Set([$(),...O.toasts.filter(n=>n.position).map(n=>n.position)].filter(Boolean))));let U=A(!1),Et=A(!1),yt=A(ye(L(N()))),ut=A(void 0),ft=A(null),wt=A(!1);const bt=l(()=>tt().join("+").replace(/Key/g,"").replace(/Digit/g,""));ht(()=>{O.toasts.length<=1&&r(U,!1)}),ht(()=>{const n=O.toasts.filter(M=>M.dismiss&&!M.delete);if(n.length>0){const M=O.toasts.map(nt=>n.find(xt=>xt.id===nt.id)?{...nt,delete:!0}:nt);O.toasts=M}}),ht(()=>()=>{e(ut)&&e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null),r(wt,!1))}),we(()=>(O.reset(),xe(document,"keydown",M=>{tt().every(at=>M[at]||M.code===at)&&(r(U,!0),e(ut)?.focus()),M.code==="Escape"&&(document.activeElement===e(ut)||e(ut)?.contains(document.activeElement))&&r(U,!1)}))),ht(()=>{if(N()!=="system"&&r(yt,N()),typeof window<"u"){N()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?r(yt,de):r(yt,Gt));const n=window.matchMedia("(prefers-color-scheme: dark)"),M=({matches:nt})=>{N()==="system"&&r(yt,nt?de:Gt,!0)};"addEventListener"in n?n.addEventListener("change",M):n.addListener(M)}});const zt=n=>{t.onblur?.(n),e(wt)&&!n.currentTarget.contains(n.relatedTarget)&&(r(wt,!1),e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null)))},Jt=n=>{t.onfocus?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&(e(wt)||(r(wt,!0),r(ft,n.relatedTarget,!0)))},pt=n=>{t.onpointerdown?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&r(Et,!0)},$t=n=>{t.onmouseenter?.(n),r(U,!0)},Nt=n=>{t.onmouseleave?.(n),e(Et)||r(U,!1)},j=n=>{t.onmousemove?.(n),r(U,!0)},te=n=>{t.ondragend?.(n),r(U,!1)},ee=n=>{t.onpointerup?.(n),r(Et,!1)};Ce.set(new He);var vt=bn();y(vt,"tabindex",-1);var Wt=J(vt);{var Pt=n=>{var M=b(),nt=h(M);ue(nt,18,()=>e(S),at=>at,(at,xt,ne,me)=>{const Ut=l(()=>{const[i,At]=xt.split("-");return{y:i,x:At}}),ot=l(()=>gn(St(),V()));var mt=hn();Pe(mt,i=>({tabindex:-1,dir:i,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(yt),"data-y-position":e(Ut).y,"data-x-position":e(Ut).x,style:t.style,onblur:zt,onfocus:Jt,onmouseenter:$t,onmousemove:j,onmouseleave:Nt,ondragend:te,onpointerdown:pt,onpointerup:ee,...Qt,[Ae]:{"--front-toast-height":`${O.heights[0]?.height}px`,"--width":`${vn}px`,"--gap":`${Mt()}px`,"--offset-top":e(ot)["--offset-top"],"--offset-right":e(ot)["--offset-right"],"--offset-bottom":e(ot)["--offset-bottom"],"--offset-left":e(ot)["--offset-left"],"--mobile-offset-top":e(ot)["--mobile-offset-top"],"--mobile-offset-right":e(ot)["--mobile-offset-right"],"--mobile-offset-bottom":e(ot)["--mobile-offset-bottom"],"--mobile-offset-left":e(ot)["--mobile-offset-left"]}}),[qt],void 0,void 0,"svelte-nbs0zk"),ue(mt,23,()=>O.toasts.filter(i=>!i.position&&e(ne)===0||i.position===xt),i=>i.id,(i,At,Vt,ge)=>{{const ae=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.successIcon??lt),a(o,I)},m=o=>{en(o)};B(Q,o=>{t.successIcon?o(u):t.successIcon!==null&&o(m,1)})}a(X,R)},oe=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.errorIcon??lt),a(o,I)},m=o=>{an(o)};B(Q,o=>{t.errorIcon?o(u):t.errorIcon!==null&&o(m,1)})}a(X,R)},ie=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.warningIcon??lt),a(o,I)},m=o=>{sn(o)};B(Q,o=>{t.warningIcon?o(u):t.warningIcon!==null&&o(m,1)})}a(X,R)},s=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.infoIcon??lt),a(o,I)},m=o=>{ln(o)};B(Q,o=>{t.infoIcon?o(u):t.infoIcon!==null&&o(m,1)})}a(X,R)},c=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.closeIcon??lt),a(o,I)},m=o=>{dn(o)};B(Q,o=>{t.closeIcon?o(u):t.closeIcon!==null&&o(m,1)})}a(X,R)};let v=l(()=>W()?.duration??Ht()),w=l(()=>W()?.class??""),x=l(()=>W()?.descriptionClass||""),g=l(()=>W()?.style??""),C=l(()=>W().classes||{}),It=l(()=>W().unstyled??!1),Rt=l(()=>W()?.cancelButtonStyle??""),se=l(()=>W()?.actionButtonStyle??""),jt=l(()=>W()?.closeButtonAriaLabel??kt());$e(i,{get index(){return e(Vt)},get toast(){return e(At)},get defaultRichColors(){return Dt()},get duration(){return e(v)},get class(){return e(w)},get descriptionClass(){return e(x)},get invert(){return k()},get visibleToasts(){return Ot()},get closeButton(){return Bt()},get interacting(){return e(Et)},get position(){return xt},get style(){return e(g)},get classes(){return e(C)},get unstyled(){return e(It)},get cancelButtonStyle(){return e(Rt)},get actionButtonStyle(){return e(se)},get closeButtonAriaLabel(){return e(jt)},get expandByDefault(){return ct()},get expanded(){return e(U)},get pauseWhenPageIsHidden(){return Z()},get loadingIcon(){return t.loadingIcon},successIcon:ae,errorIcon:oe,warningIcon:ie,infoIcon:s,closeIcon:c,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Y(mt),Ie(mt,i=>r(ut,i),()=>e(ut)),K(()=>mt.dir=mt.dir),a(at,mt)}),a(n,M)};B(Wt,n=>{O.toasts.length>0&&n(Pt)})}Y(vt),K(()=>y(vt,"aria-label",`${et()??""} ${e(bt)??""}`)),a(_,vt),ve()}export{Re as L,Pn as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as C,V as S,a as o,W as g}from"./DnL9f0lc.js";import{r as y}from"./DYYBfXU3.js";import{syntaxTree as E}from"./wDIGUaoU.js";class W extends g{toDOM(){const e=document.createElement("span");return e.className="cm-bullet-widget",e.textContent="•",e}}class L extends g{constructor(e){super(),this.num=e}eq(e){return this.num===e.num}toDOM(){const e=document.createElement("span");return e.className="cm-ordered-widget",e.textContent=this.num+" ",e}}class M extends g{toDOM(){const e=document.createElement("div");return e.className="cm-hr-widget",e}}class T extends g{toDOM(){const e=document.createElement("span");return e.textContent="—",e}}class D extends g{constructor(e){super(),this.char=e}eq(e){return this.char===e.char}toDOM(){const e=document.createElement("span");return e.textContent=this.char,e}}class O extends g{constructor(e,l){super(),this.alt=e,this.url=l}eq(e){return this.alt===e.alt&&this.url===e.url}toDOM(){const e=document.createElement("div");e.className="cm-image-widget";const l=document.createElement("img");return l.src=this.url,l.alt=this.alt,l.loading="lazy",l.onerror=()=>{e.textContent=`[Image not found: ${this.alt||this.url}]`,e.className="cm-image-error"},e.appendChild(l),e}ignoreEvent(e){return e.type==="mousedown"}}class F extends g{constructor(e,l,s){super(),this.text=e,this.className=l,this.entityId=s}eq(e){return this.text===e.text&&this.className===e.className&&this.entityId===e.entityId}toDOM(){const e=document.createElement("span");return e.className=this.className,e.textContent=this.text,e.dataset.entityId=this.entityId,e.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),e.dispatchEvent(new CustomEvent("wikilink-click",{bubbles:!0,detail:this.entityId}))}),e}ignoreEvent(e){return e.type==="mousedown"}}function I(r){return r.doc.lineAt(r.selection.main.head).number}function u(r,e,l){const s=r.selection.main.head;return s>=e&&s<=l}function x(r,e,l,s,d=!0){const t=r.from>0?e.doc.sliceString(r.from-1,r.from):"",f=r.to<e.doc.length?e.doc.sliceString(r.to,r.to+1):"";if(t!=="["||f!=="]")return!1;const i=r.from-1,n=r.to+1,a=e.doc.sliceString(r.from+1,r.to-1),m=y(a),c=m?"cm-live-wikilink cm-wikilink-active":"cm-live-wikilink cm-wikilink-inactive",h=s?`${c} ${s}`:c;if(!d||!u(e,i,n)){const p=m?m.title:a.replace(/-/g," ").replace(/\b\w/g,k=>k.toUpperCase());l.push(o.replace({widget:new F(p,h,a)}).range(i,n))}else l.push(o.mark({class:h}).range(i,n));return!0}function b(r){const e=r.state,l=r.hasFocus?I(e):-1,s=[];E(e).iterate({enter(t){const f=e.doc.lineAt(t.from).number;if(t.name.startsWith("ATXHeading")){const n=`cm-live-heading cm-live-heading-${parseInt(t.name.replace("ATXHeading",""),10)||1}`;if(s.push(o.mark({class:n}).range(t.from,t.to)),f!==l){let a=t.node.firstChild;for(;a;){if(a.name==="HeaderMark"){const m=Math.min(a.to+1,t.to);s.push(o.replace({}).range(a.from,m))}else a.name==="Link"&&x(a,e,s,n,r.hasFocus);a=a.nextSibling}}return!1}if(t.name==="HorizontalRule"&&f!==l&&s.push(o.replace({widget:new M}).range(t.from,t.to)),t.name==="ListMark"&&f!==l){const i=Math.min(t.to+1,e.doc.lineAt(t.from).to);if(t.node.parent?.parent?.name==="OrderedList"){const m=e.doc.sliceString(t.from,t.to);s.push(o.replace({widget:new L(m)}).range(t.from,i))}else s.push(o.replace({widget:new W}).range(t.from,i));const a=e.doc.lineAt(t.from);s.push(o.line({class:"cm-list-line"}).range(a.from))}if(t.name==="StrongEmphasis"){if(!r.hasFocus||!u(e,t.from,t.to)){let i=t.node.firstChild,n=!1;for(;i;)i.name==="Link"&&(n=x(i,e,s,"cm-live-strong",r.hasFocus)),i=i.nextSibling;for(n||s.push(o.mark({class:"cm-live-strong"}).range(t.from,t.to)),i=t.node.firstChild;i;)i.name==="EmphasisMark"&&s.push(o.replace({}).range(i.from,i.to)),i=i.nextSibling}else s.push(o.mark({class:"cm-live-strong"}).range(t.from,t.to));return!1}if(t.name==="Emphasis"){if(!r.hasFocus||!u(e,t.from,t.to)){let i=t.node.firstChild,n=!1;for(;i;)i.name==="Link"&&(n=x(i,e,s,"cm-live-em",r.hasFocus)),i=i.nextSibling;for(n||s.push(o.mark({class:"cm-live-em"}).range(t.from,t.to)),i=t.node.firstChild;i;)i.name==="EmphasisMark"&&s.push(o.replace({}).range(i.from,i.to)),i=i.nextSibling}else s.push(o.mark({class:"cm-live-em"}).range(t.from,t.to));return!1}if(t.name==="InlineCode"){if(s.push(o.mark({class:"cm-live-code"}).range(t.from,t.to)),!r.hasFocus||!u(e,t.from,t.to)){let i=t.node.firstChild;for(;i;)i.name==="CodeMark"&&s.push(o.replace({}).range(i.from,i.to)),i=i.nextSibling}return!1}if(t.name==="Link"){const i=e.doc.sliceString(t.from,t.to);if(x(t,e,s,void 0,r.hasFocus))return!1;if(i.includes("](")){let n=t.node.firstChild;const a=[];let m=null;for(;n;)n.name==="LinkMark"&&a.push({from:n.from,to:n.to}),n.name==="URL"&&(m={from:n.from,to:n.to}),n=n.nextSibling;const c=m?e.doc.sliceString(m.from,m.to):"";return s.push(o.mark({class:"cm-live-link",attributes:c?{"data-href":c}:{}}).range(t.from,t.to)),(!r.hasFocus||!u(e,t.from,t.to))&&a.length>=2&&m&&(s.push(o.replace({}).range(a[0].from,a[0].to)),s.push(o.replace({}).range(a[1].from,t.to))),!1}}if(t.name==="Image"){if(!r.hasFocus||!u(e,t.from,t.to)){const n=e.doc.sliceString(t.from,t.to).match(/!\[([^\]]*)\]/),a=n?n[1]:"";let m="",c=t.node.firstChild;for(;c;)c.name==="URL"&&(m=e.doc.sliceString(c.from,c.to)),c=c.nextSibling;m&&s.push(o.replace({widget:new O(a,m)}).range(t.from,t.to))}else s.push(o.mark({class:"cm-image-raw"}).range(t.from,t.to));return!1}}});const d=e.doc;for(let t=1;t<=d.lines;t++){if(t===l)continue;const f=d.line(t),i=f.text,n=i.trim(),a=/^-{3,}$/.test(n)||/^\*{3,}$/.test(n)||/^_{3,}$/.test(n);let m=0;for(;!a&&(m=i.indexOf("--",m))!==-1;){const c=f.from+m,h=c+2;u(e,c,h)||s.push(o.replace({widget:new T}).range(c,h)),m+=2}for(let c=0;c<i.length;c++){const h=i[c];if(h!=='"'&&h!=="'")continue;const p=f.from+c;if(u(e,p,p+1))continue;const k=c>0?i[c-1]:"",v=!k||/[\s([\-—]/.test(k);let w;h==='"'?w=v?"“":"”":w=v?"‘":"’",s.push(o.replace({widget:new D(w)}).range(p,p+1))}}return o.set(s,!0)}const $=S.fromClass(class{decorations;constructor(r){this.decorations=b(r)}update(r){(r.docChanged||r.selectionSet||r.viewportChanged||r.focusChanged)&&(this.decorations=b(r.view))}},{decorations:r=>r.decorations}),A=C.baseTheme({".cm-live-heading":{fontWeight:"600"},".cm-live-heading-1":{fontSize:"1.5em"},".cm-live-heading-2":{fontSize:"1.2em"},".cm-live-heading-3":{fontSize:"1.05em"},".cm-live-strong":{fontWeight:"600"},".cm-live-em":{fontStyle:"italic"},".cm-live-code":{fontFamily:"monospace",fontSize:"0.9em",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(128,128,128,0.12)"},".cm-live-wikilink":{borderRadius:"3px"},".cm-wikilink-active":{color:"var(--color-accent, #e05050)",cursor:"pointer",textDecoration:"none"},".cm-wikilink-active:hover":{textDecoration:"underline"},".cm-wikilink-inactive":{color:"var(--color-text-tertiary)"},".cm-live-link":{color:"var(--color-link, #e07070)",textDecoration:"none",cursor:"pointer"},".cm-live-link:hover":{textDecoration:"underline"},".cm-bullet-widget":{color:"var(--color-text-tertiary)",display:"inline-block",width:"16px",marginLeft:"-16px"},".cm-ordered-widget":{color:"var(--color-text-tertiary)",display:"inline-block",width:"20px",marginLeft:"-20px"},".cm-list-line":{paddingLeft:"20px"},".cm-hr-widget":{borderTop:"1px solid var(--color-border, #333)",margin:"8px 0"},".cm-image-widget":{display:"block",lineHeight:"0"},".cm-image-widget img":{maxWidth:"100%",borderRadius:"4px"},".cm-image-error":{color:"var(--color-text-tertiary)",fontSize:"13px",fontStyle:"italic"},".cm-image-raw":{color:"var(--color-text-tertiary)"}});export{$ as livePreviewPlugin,A as livePreviewTheme};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as v}from"./BqnODQDb.js";function O(r){var t,i,f="";if(typeof r=="string"||typeof r=="number")f+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(t=0;t<u;t++)r[t]&&(i=O(r[t]))&&(f&&(f+=" "),f+=i)}else for(i in r)r[i]&&(f&&(f+=" "),f+=i);return f}function S(){for(var r,t,i=0,f="",u=arguments.length;i<u;i++)(r=arguments[i])&&(t=O(r))&&(f&&(f+=" "),f+=t);return f}function q(r){return typeof r=="object"?S(r):r??""}const A=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function C(r,t,i){var f=r==null?"":""+r;if(t&&(f=f?f+" "+t:t),i){for(var u of Object.keys(i))if(i[u])f=f?f+" "+u:u;else if(f.length)for(var g=u.length,o=0;(o=f.indexOf(u,o))>=0;){var l=o+g;(o===0||A.includes(f[o-1]))&&(l===f.length||A.includes(f[l]))?f=(o===0?"":f.substring(0,o))+f.substring(l+1):o=l}}return f===""?null:f}function j(r,t=!1){var i=t?" !important;":";",f="";for(var u of Object.keys(r)){var g=r[u];g!=null&&g!==""&&(f+=" "+u+": "+g+i)}return f}function h(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function z(r,t){if(t){var i="",f,u;if(Array.isArray(t)?(f=t[0],u=t[1]):f=t,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var g=!1,o=0,l=!1,n=[];f&&n.push(...Object.keys(f).map(h)),u&&n.push(...Object.keys(u).map(h));var c=0,s=-1;const p=r.length;for(var b=0;b<p;b++){var a=r[b];if(l?a==="/"&&r[b-1]==="*"&&(l=!1):g?g===a&&(g=!1):a==="/"&&r[b+1]==="*"?l=!0:a==='"'||a==="'"?g=a:a==="("?o++:a===")"&&o--,!l&&g===!1&&o===0){if(a===":"&&s===-1)s=b;else if(a===";"||b===p-1){if(s!==-1){var N=h(r.substring(c,s).trim());if(!n.includes(N)){a!==";"&&b++;var L=r.substring(c,b).trim();i+=" "+L+";"}}c=b+1,s=-1}}}}return f&&(i+=j(f)),u&&(i+=j(u,!0)),i=i.trim(),i===""?null:i}return r==null?null:String(r)}function B(r,t,i,f,u,g){var o=r.__className;if(v||o!==i||o===void 0){var l=C(i,f,g);(!v||l!==r.getAttribute("class"))&&(l==null?r.removeAttribute("class"):t?r.className=l:r.setAttribute("class",l)),r.__className=i}else if(g&&u!==g)for(var n in g){var c=!!g[n];(u==null||c!==!!u[n])&&r.classList.toggle(n,c)}return g}export{q as a,S as c,B as s,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class r extends Error{constructor(o,s){super(s),this.status=o,this.name="ApiError"}}async function a(n,o){const s={...o?.headers};o?.body&&(s["Content-Type"]=s["Content-Type"]??"application/json");const t=await fetch(`${n}`,{...o,headers:s});if(!t.ok){const e=await t.json().catch(()=>({error:t.statusText}));throw t.status===401&&typeof window<"u"&&!n.startsWith("/api/auth/")&&window.location.pathname!=="/login"&&(window.location.href="/login"),new r(t.status,e.error??t.statusText)}return t.json()}export{r as ApiError,a as apiFetch};
|