clawmini 0.0.7 → 0.0.9
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/.changeset/README.md +8 -0
- package/.changeset/config.json +14 -0
- package/.github/workflows/release.yml +49 -0
- package/CHANGELOG.md +36 -0
- package/README.md +5 -4
- package/dist/adapter-discord/index.d.mts.map +1 -1
- package/dist/adapter-discord/index.mjs +465 -282
- package/dist/adapter-discord/index.mjs.map +1 -1
- package/dist/adapter-google-chat/index.mjs +367 -243
- package/dist/adapter-google-chat/index.mjs.map +1 -1
- package/dist/cli/index.mjs +684 -24
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lite.mjs +43 -13
- package/dist/cli/lite.mjs.map +1 -1
- package/dist/cli/{propose-policy.mjs → manage-policies.mjs} +270 -47
- package/dist/cli/manage-policies.mjs.map +1 -0
- package/dist/cli/run-host.d.mts +1 -0
- package/dist/cli/run-host.mjs +3090 -0
- package/dist/cli/run-host.mjs.map +1 -0
- package/dist/config-CPFQIGdG.mjs +57 -0
- package/dist/config-CPFQIGdG.mjs.map +1 -0
- package/dist/config-Dvl-Pov4.mjs +76 -0
- package/dist/config-Dvl-Pov4.mjs.map +1 -0
- package/dist/daemon/index.d.mts.map +1 -1
- package/dist/daemon/index.mjs +970 -332
- package/dist/daemon/index.mjs.map +1 -1
- package/dist/supervisor-actions-CiW56eLi.mjs +843 -0
- package/dist/supervisor-actions-CiW56eLi.mjs.map +1 -0
- package/dist/turn-log-buffer-DRgW53gl.mjs +767 -0
- package/dist/turn-log-buffer-DRgW53gl.mjs.map +1 -0
- package/dist/web/_app/immutable/chunks/{Drm9vgeP.js → 3AZlWB6U.js} +1 -1
- package/dist/web/_app/immutable/chunks/BhRSsUCh.js +2 -0
- package/dist/web/_app/immutable/chunks/BiLeM2i1.js +1 -0
- package/{web/.svelte-kit/output/client/_app/immutable/chunks/CME08kGM.js → dist/web/_app/immutable/chunks/BmBj85Ll.js} +1 -1
- package/dist/web/_app/immutable/chunks/BrERcKAH.js +1 -0
- package/dist/web/_app/immutable/chunks/Bv9252RM.js +1 -0
- package/dist/web/_app/immutable/chunks/CIXNBPKi.js +1 -0
- package/dist/web/_app/immutable/chunks/DISKL3GN.js +2 -0
- package/dist/web/_app/immutable/chunks/{Zeh-C-mx.js → DcpaLzmX.js} +1 -1
- package/dist/web/_app/immutable/chunks/DnQ3vS13.js +1 -0
- package/dist/web/_app/immutable/chunks/KsloHTKS.js +1 -0
- package/{web/.svelte-kit/output/client/_app/immutable/chunks/Ck-be5J2.js → dist/web/_app/immutable/chunks/RsHsUj-8.js} +2 -2
- package/dist/web/_app/immutable/chunks/{G_zz-Gou.js → wpfV79dV.js} +1 -1
- package/dist/web/_app/immutable/entry/app.CIw1Qj0n.js +2 -0
- package/dist/web/_app/immutable/entry/start.Di0-Jhte.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.CYS8iApT.js → 0.DYyUA1au.js} +1 -1
- package/dist/web/_app/immutable/nodes/1.D-3QEMMZ.js +1 -0
- package/dist/web/_app/immutable/nodes/{2.BnwnD1Ki.js → 2.4olHnH7U.js} +1 -1
- package/{web/.svelte-kit/output/client/_app/immutable/nodes/3.Dr0ot9sV.js → dist/web/_app/immutable/nodes/3.4w0bE-m2.js} +3 -3
- package/dist/web/_app/immutable/nodes/4.CZvjhVHt.js +60 -0
- package/dist/web/_app/immutable/nodes/{5.BBGQ_i84.js → 5.DLbPVJY2.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +12 -12
- package/dist/workspace-oWmVh5mi.mjs +1001 -0
- package/dist/workspace-oWmVh5mi.mjs.map +1 -0
- package/docs/23_adapter_slash_autocomplete/development_log.md +19 -0
- package/docs/23_adapter_slash_autocomplete/notes.md +18 -0
- package/docs/23_adapter_slash_autocomplete/prd.md +46 -0
- package/docs/23_adapter_slash_autocomplete/questions.md +6 -0
- package/docs/23_adapter_slash_autocomplete/tickets.md +21 -0
- package/docs/24_subagent_job_policy_fixes/development_log.md +22 -0
- package/docs/24_subagent_job_policy_fixes/notes.md +28 -0
- package/docs/24_subagent_job_policy_fixes/prd.md +59 -0
- package/docs/24_subagent_job_policy_fixes/questions.md +3 -0
- package/docs/24_subagent_job_policy_fixes/tickets.md +49 -0
- package/docs/25_e2e_test_improvements/development_log.md +30 -0
- package/docs/25_e2e_test_improvements/notes.md +29 -0
- package/docs/25_e2e_test_improvements/prd.md +43 -0
- package/docs/25_e2e_test_improvements/questions.md +12 -0
- package/docs/25_e2e_test_improvements/tickets-2.md +22 -0
- package/docs/25_e2e_test_improvements/tickets.md +22 -0
- package/docs/25_policy_cwd/development_log.md +30 -0
- package/docs/25_policy_cwd/notes.md +28 -0
- package/docs/25_policy_cwd/prd.md +77 -0
- package/docs/25_policy_cwd/questions.md +6 -0
- package/docs/25_policy_cwd/tickets.md +77 -0
- package/docs/CLI_REFERENCE.md +3 -1
- package/docs/PHILOSOPHY.md +35 -0
- package/docs/adapter-visibility/SPEC.md +461 -0
- package/docs/adapter-visibility/SPEC_v2.md +202 -0
- package/docs/auto-update/SPEC.md +344 -0
- package/docs/backups/SPEC.md +296 -0
- package/docs/backups/clawmini.gitignore +69 -0
- package/docs/guides/assets/clawmini-avatar.png +0 -0
- package/docs/guides/backups.md +332 -0
- package/docs/guides/discord_adapter_setup.md +1 -1
- package/docs/guides/google_chat_adapter_setup.md +81 -0
- package/docs/unified-startup/SPEC.md +203 -0
- package/e2e/_helpers/test-environment.test.ts +49 -0
- package/e2e/_helpers/test-environment.ts +548 -0
- package/e2e/adapters/_google-chat-fixtures.ts +340 -0
- package/{src/cli/e2e → e2e/adapters}/adapter-discord.test.ts +22 -23
- package/e2e/adapters/adapter-google-chat-downtime.test.ts +157 -0
- package/e2e/adapters/adapter-google-chat-inbound.test.ts +697 -0
- package/e2e/adapters/adapter-google-chat-outbound.test.ts +297 -0
- package/e2e/adapters/adapter-google-chat-roundtrip.test.ts +56 -0
- package/e2e/adapters/adapter-google-chat-threads.test.ts +1078 -0
- package/e2e/agents/custom-api-env.test.ts +80 -0
- package/e2e/agents/export-lite-func.test.ts +104 -0
- package/e2e/agents/fallbacks.test.ts +124 -0
- package/e2e/agents/interrupt.test.ts +50 -0
- package/e2e/agents/no-reply-necessary.test.ts +57 -0
- package/e2e/agents/session-timeout-subagents.test.ts +76 -0
- package/e2e/agents/subagent-authorization.test.ts +246 -0
- package/e2e/agents/subagent-env.test.ts +49 -0
- package/e2e/agents/subagent-lifecycle.test.ts +782 -0
- package/e2e/agents/subagents-depth.test.ts +47 -0
- package/e2e/cli/agents.test.ts +176 -0
- package/e2e/cli/auto-update.test.ts +741 -0
- package/e2e/cli/basic.test.ts +44 -0
- package/{src/cli/e2e → e2e/cli}/export-lite.test.ts +16 -12
- package/e2e/cli/init-gitignore.test.ts +86 -0
- package/e2e/cli/init.test.ts +76 -0
- package/e2e/cli/messages.test.ts +363 -0
- package/e2e/cli/serve.test.ts +76 -0
- package/{src/cli/e2e → e2e/cli}/skills.test.ts +11 -10
- package/{src/cli/e2e → e2e/daemon}/daemon.test.ts +57 -195
- package/e2e/jobs/agent-jobs.test.ts +216 -0
- package/e2e/jobs/cron.test.ts +64 -0
- package/e2e/jobs/restart.test.ts +108 -0
- package/e2e/policies/approval-session.test.ts +69 -0
- package/e2e/policies/auto-create-policies-file.test.ts +35 -0
- package/e2e/policies/builtin-manage-policies.test.ts +184 -0
- package/e2e/policies/builtin-run-host.test.ts +180 -0
- package/e2e/policies/environment-policies.test.ts +177 -0
- package/e2e/policies/manage-policies.test.ts +566 -0
- package/e2e/policies/output-size.test.ts +98 -0
- package/e2e/policies/policies-context-cwd.test.ts +160 -0
- package/e2e/policies/relative-script-path.test.ts +60 -0
- package/e2e/policies/requests-show.test.ts +135 -0
- package/e2e/policies/requests.test.ts +208 -0
- package/e2e/policies/slash-policies.test.ts +308 -0
- package/e2e/policies/startup-cleanup.test.ts +48 -0
- package/e2e/routers/session-timeout.test.ts +106 -0
- package/e2e/routers/slash-model.test.ts +152 -0
- package/e2e/routers/slash-new.test.ts +50 -0
- package/e2e/routers/slash-restart-adapter.test.ts +96 -0
- package/e2e/routers/slash-restart.test.ts +114 -0
- package/e2e/routers/slash-shutdown.test.ts +55 -0
- package/e2e/routers/slash-stop.test.ts +232 -0
- package/e2e/routers/slash-upgrade.test.ts +88 -0
- package/{src/cli/e2e → e2e/sandbox}/environments.test.ts +14 -13
- package/eslint.config.js +6 -0
- package/napkin.md +1 -1
- package/package.json +8 -3
- package/src/adapter-discord/commands.test.ts +42 -0
- package/src/adapter-discord/commands.ts +33 -0
- package/src/adapter-discord/config.ts +12 -0
- package/src/adapter-discord/forwarder.test.ts +499 -21
- package/src/adapter-discord/forwarder.ts +343 -124
- package/src/adapter-discord/inbound-cache.test.ts +47 -0
- package/src/adapter-discord/inbound-cache.ts +37 -0
- package/src/adapter-discord/index.test.ts +67 -2
- package/src/adapter-discord/index.ts +84 -216
- package/src/adapter-discord/interactions.test.ts +54 -3
- package/src/adapter-discord/interactions.ts +97 -53
- package/src/adapter-discord/processMessage.ts +239 -0
- package/src/adapter-discord/state.ts +1 -0
- package/src/adapter-google-chat/auth.test.ts +9 -5
- package/src/adapter-google-chat/auth.ts +29 -23
- package/src/adapter-google-chat/cards.ts +7 -2
- package/src/adapter-google-chat/client.test.ts +37 -2
- package/src/adapter-google-chat/client.ts +138 -38
- package/src/adapter-google-chat/config.ts +19 -0
- package/src/adapter-google-chat/forwarder.test.ts +81 -56
- package/src/adapter-google-chat/forwarder.ts +394 -185
- package/src/adapter-google-chat/inbound-cache.test.ts +61 -0
- package/src/adapter-google-chat/inbound-cache.ts +36 -0
- package/src/adapter-google-chat/state.test.ts +1 -0
- package/src/adapter-google-chat/state.ts +9 -1
- package/src/adapter-google-chat/subscriptions.ts +8 -6
- package/src/cli/builtin-policies.ts +44 -0
- package/src/cli/commands/agents.ts +59 -5
- package/src/cli/commands/down.ts +54 -2
- package/src/cli/commands/environments.ts +8 -2
- package/src/cli/commands/init.ts +31 -0
- package/src/cli/commands/logs.ts +116 -0
- package/src/cli/commands/policies.ts +6 -4
- package/src/cli/commands/serve.test.ts +67 -0
- package/src/cli/commands/serve.ts +284 -0
- package/src/cli/commands/up.ts +122 -2
- package/src/cli/commands/web-api/agents.ts +3 -2
- package/src/cli/index.ts +4 -0
- package/src/cli/install-detection.test.ts +72 -0
- package/src/cli/install-detection.ts +48 -0
- package/src/cli/lite.ts +54 -22
- package/src/cli/manage-policies-utils.ts +104 -0
- package/src/cli/manage-policies.ts +291 -0
- package/src/cli/run-host.ts +45 -0
- package/src/cli/supervisor-actions.ts +267 -0
- package/src/cli/supervisor-control.test.ts +129 -0
- package/src/cli/supervisor-control.ts +155 -0
- package/src/cli/supervisor-pid.ts +68 -0
- package/src/cli/supervisor.ts +277 -0
- package/src/daemon/agent/agent-context.ts +11 -11
- package/src/daemon/agent/agent-session.ts +8 -1
- package/src/daemon/agent/chat-logger.test.ts +78 -9
- package/src/daemon/agent/chat-logger.ts +25 -5
- package/src/daemon/agent/turn-registry.test.ts +89 -0
- package/src/daemon/agent/turn-registry.ts +94 -0
- package/src/daemon/agent/types.ts +2 -0
- package/src/daemon/api/agent-policy-endpoints.ts +263 -0
- package/src/daemon/api/agent-router.ts +47 -126
- package/src/daemon/api/index.test.ts +1 -0
- package/src/daemon/api/policy-request.test.ts +7 -5
- package/src/daemon/api/router-utils.ts +6 -5
- package/src/daemon/api/subagent-router.ts +110 -74
- package/src/daemon/api/subagent-utils.test.ts +60 -0
- package/src/daemon/api/subagent-utils.ts +113 -87
- package/src/daemon/api/user-router.ts +34 -8
- package/src/daemon/auth.ts +1 -0
- package/src/daemon/cron.test.ts +62 -4
- package/src/daemon/cron.ts +42 -16
- package/src/daemon/events.ts +65 -0
- package/src/daemon/index.ts +24 -1
- package/src/daemon/message-interruption.test.ts +1 -0
- package/src/daemon/message-jobs.test.ts +1 -0
- package/src/daemon/message.ts +78 -14
- package/src/daemon/observation.test.ts +26 -18
- package/src/daemon/pending-replies.test.ts +112 -0
- package/src/daemon/pending-replies.ts +162 -0
- package/src/daemon/policy-request-service.ts +3 -1
- package/src/daemon/policy-utils.test.ts +66 -1
- package/src/daemon/policy-utils.ts +126 -1
- package/src/daemon/request-store.ts +31 -0
- package/src/daemon/routers/session-timeout.ts +4 -0
- package/src/daemon/routers/slash-model.test.ts +344 -0
- package/src/daemon/routers/slash-model.ts +207 -0
- package/src/daemon/routers/slash-policies.test.ts +38 -32
- package/src/daemon/routers/slash-policies.ts +84 -33
- package/src/daemon/routers/slash-restart.test.ts +69 -0
- package/src/daemon/routers/slash-restart.ts +36 -0
- package/src/daemon/routers/slash-shutdown.test.ts +50 -0
- package/src/daemon/routers/slash-shutdown.ts +28 -0
- package/src/daemon/routers/slash-upgrade.test.ts +116 -0
- package/src/daemon/routers/slash-upgrade.ts +76 -0
- package/src/daemon/routers/types.ts +7 -0
- package/src/daemon/routers.ts +16 -0
- package/src/shared/adapters/blockquote.test.ts +28 -0
- package/src/shared/adapters/blockquote.ts +20 -0
- package/src/shared/adapters/filtering.test.ts +224 -10
- package/src/shared/adapters/filtering.ts +95 -7
- package/src/shared/adapters/inbound-cache.test.ts +48 -0
- package/src/shared/adapters/inbound-cache.ts +54 -0
- package/src/shared/adapters/turn-log-buffer.ts +266 -0
- package/src/shared/adapters/turn-log.test.ts +389 -0
- package/src/shared/adapters/turn-log.ts +357 -0
- package/src/shared/agent-utils.ts +12 -5
- package/src/shared/chats.test.ts +4 -0
- package/src/shared/chats.ts +9 -0
- package/src/shared/config.ts +16 -1
- package/src/shared/lite.ts +76 -2
- package/src/shared/policies.ts +26 -0
- package/src/shared/template-manifest.ts +267 -0
- package/src/shared/utils/shell.ts +61 -0
- package/src/shared/version.ts +34 -0
- package/src/shared/workspace.test.ts +217 -0
- package/src/shared/workspace.ts +626 -48
- package/templates/environments/cladding/allowlist-domain.mjs +125 -0
- package/templates/environments/cladding/env.json +21 -1
- package/templates/environments/cladding/run-with-network.mjs +54 -0
- package/templates/environments/macos-proxy/allowlist-domain.mjs +95 -0
- package/templates/environments/macos-proxy/env.json +8 -1
- package/templates/environments/macos-proxy/proxy.mjs +42 -13
- package/templates/gemini/template.json +5 -0
- package/templates/gemini-claw/template.json +13 -0
- package/templates/skills/clawmini-requests/SKILL.md +69 -10
- package/templates/skills/run-host/SKILL.md +51 -0
- package/templates/skills/skill-creator/SKILL.md +4 -3
- package/templates/skills/skill-creator/scripts/validate.sh +52 -0
- package/tsdown.config.ts +10 -1
- package/vitest.config.ts +2 -2
- package/web/.svelte-kit/ambient.d.ts +292 -176
- package/web/.svelte-kit/generated/server/internal.js +1 -1
- package/web/.svelte-kit/output/client/.vite/manifest.json +127 -137
- package/web/.svelte-kit/output/client/_app/immutable/chunks/{Drm9vgeP.js → 3AZlWB6U.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BhRSsUCh.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BiLeM2i1.js +1 -0
- package/{dist/web/_app/immutable/chunks/CME08kGM.js → web/.svelte-kit/output/client/_app/immutable/chunks/BmBj85Ll.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BrERcKAH.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/Bv9252RM.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/CIXNBPKi.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DISKL3GN.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/{Zeh-C-mx.js → DcpaLzmX.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DnQ3vS13.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/KsloHTKS.js +1 -0
- package/{dist/web/_app/immutable/chunks/Ck-be5J2.js → web/.svelte-kit/output/client/_app/immutable/chunks/RsHsUj-8.js} +2 -2
- package/web/.svelte-kit/output/client/_app/immutable/chunks/{G_zz-Gou.js → wpfV79dV.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/entry/app.CIw1Qj0n.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/entry/start.Di0-Jhte.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.CYS8iApT.js → 0.DYyUA1au.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/nodes/1.D-3QEMMZ.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.BnwnD1Ki.js → 2.4olHnH7U.js} +1 -1
- package/{dist/web/_app/immutable/nodes/3.Dr0ot9sV.js → web/.svelte-kit/output/client/_app/immutable/nodes/3.4w0bE-m2.js} +3 -3
- package/web/.svelte-kit/output/client/_app/immutable/nodes/4.CZvjhVHt.js +60 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/{5.BBGQ_i84.js → 5.DLbPVJY2.js} +1 -1
- package/web/.svelte-kit/output/client/_app/version.json +1 -1
- package/web/.svelte-kit/output/server/.vite/manifest.json +12 -10
- package/web/.svelte-kit/output/server/chunks/Icon.js +1 -1
- package/web/.svelte-kit/output/server/chunks/client.js +1 -1
- package/web/.svelte-kit/output/server/chunks/exports.js +1 -1
- package/web/.svelte-kit/output/server/chunks/index-server.js +2 -1
- package/web/.svelte-kit/output/server/chunks/internal.js +1 -1
- package/web/.svelte-kit/output/server/chunks/render-context.js +77 -0
- package/web/.svelte-kit/output/server/chunks/root.js +739 -788
- package/web/.svelte-kit/output/server/chunks/shared.js +234 -21
- package/web/.svelte-kit/output/server/index.js +126 -90
- package/web/.svelte-kit/output/server/manifest-full.js +1 -1
- package/web/.svelte-kit/output/server/manifest.js +1 -1
- package/web/.svelte-kit/output/server/nodes/0.js +1 -1
- package/web/.svelte-kit/output/server/nodes/1.js +1 -1
- package/web/.svelte-kit/output/server/nodes/2.js +1 -1
- package/web/.svelte-kit/output/server/nodes/3.js +1 -1
- package/web/.svelte-kit/output/server/nodes/4.js +1 -1
- package/web/.svelte-kit/output/server/nodes/5.js +1 -1
- package/web/.svelte-kit/output/server/remote-entry.js +245 -81
- package/web/.svelte-kit/tsconfig.json +4 -1
- package/dist/cli/propose-policy.mjs.map +0 -1
- package/dist/lite-CBxOT1y5.mjs +0 -241
- package/dist/lite-CBxOT1y5.mjs.map +0 -1
- package/dist/routing-D8rTxtaV.mjs +0 -245
- package/dist/routing-D8rTxtaV.mjs.map +0 -1
- package/dist/web/_app/immutable/chunks/B6YN0Nuq.js +0 -1
- package/dist/web/_app/immutable/chunks/BmRlVmv6.js +0 -1
- package/dist/web/_app/immutable/chunks/CK9JZLaG.js +0 -2
- package/dist/web/_app/immutable/chunks/Ck3rYNON.js +0 -1
- package/dist/web/_app/immutable/chunks/DMtIqaiV.js +0 -2
- package/dist/web/_app/immutable/chunks/DhD271EB.js +0 -1
- package/dist/web/_app/immutable/chunks/DpuLqk8d.js +0 -1
- package/dist/web/_app/immutable/chunks/DsIToJCP.js +0 -1
- package/dist/web/_app/immutable/chunks/bBmtyQMj.js +0 -1
- package/dist/web/_app/immutable/entry/app.CJmSwntr.js +0 -2
- package/dist/web/_app/immutable/entry/start.ZpUrT2ak.js +0 -1
- package/dist/web/_app/immutable/nodes/1.Bli0Hqzn.js +0 -1
- package/dist/web/_app/immutable/nodes/4.oBhvQhcA.js +0 -60
- package/dist/workspace-BJmJBfKi.mjs +0 -456
- package/dist/workspace-BJmJBfKi.mjs.map +0 -1
- package/src/cli/e2e/agents.test.ts +0 -140
- package/src/cli/e2e/basic.test.ts +0 -43
- package/src/cli/e2e/cron.test.ts +0 -132
- package/src/cli/e2e/export-lite-func.test.ts +0 -206
- package/src/cli/e2e/fallbacks.test.ts +0 -175
- package/src/cli/e2e/init.test.ts +0 -77
- package/src/cli/e2e/messages.test.ts +0 -332
- package/src/cli/e2e/propose-policy.test.ts +0 -203
- package/src/cli/e2e/requests.test.ts +0 -180
- package/src/cli/e2e/session-timeout.test.ts +0 -192
- package/src/cli/e2e/slash-new.test.ts +0 -93
- package/src/cli/e2e/subagents.test.ts +0 -106
- package/src/cli/e2e/utils.ts +0 -66
- package/src/cli/propose-policy.ts +0 -91
- package/web/.svelte-kit/output/client/_app/immutable/chunks/B6YN0Nuq.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BmRlVmv6.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/CK9JZLaG.js +0 -2
- package/web/.svelte-kit/output/client/_app/immutable/chunks/Ck3rYNON.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DMtIqaiV.js +0 -2
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DhD271EB.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DpuLqk8d.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DsIToJCP.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/bBmtyQMj.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/entry/app.CJmSwntr.js +0 -2
- package/web/.svelte-kit/output/client/_app/immutable/entry/start.ZpUrT2ak.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/nodes/1.Bli0Hqzn.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/nodes/4.oBhvQhcA.js +0 -60
- package/web/.svelte-kit/output/server/chunks/false.js +0 -4
- /package/dist/cli/{propose-policy.d.mts → manage-policies.d.mts} +0 -0
- /package/{src/cli/e2e → e2e/_helpers}/global-setup.ts +0 -0
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
import { B as BROWSER } from "./
|
|
1
|
+
import { a as lifecycle_outside_component, B as BROWSER, d as dynamic_element_invalid_tag, i as invalid_csp, b as await_invalid, g as get_render_context } from "./render-context.js";
|
|
2
2
|
import { clsx as clsx$1 } from "clsx";
|
|
3
3
|
import * as devalue from "devalue";
|
|
4
|
+
var ssr_context = null;
|
|
5
|
+
function set_ssr_context(v) {
|
|
6
|
+
ssr_context = v;
|
|
7
|
+
}
|
|
8
|
+
function getContext(key) {
|
|
9
|
+
const context_map = get_or_init_context_map();
|
|
10
|
+
const result = (
|
|
11
|
+
/** @type {T} */
|
|
12
|
+
context_map.get(key)
|
|
13
|
+
);
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
function setContext(key, context) {
|
|
17
|
+
get_or_init_context_map().set(key, context);
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function hasContext(key) {
|
|
21
|
+
return get_or_init_context_map().has(key);
|
|
22
|
+
}
|
|
23
|
+
function getAllContexts() {
|
|
24
|
+
return get_or_init_context_map();
|
|
25
|
+
}
|
|
26
|
+
function get_or_init_context_map(name) {
|
|
27
|
+
if (ssr_context === null) {
|
|
28
|
+
lifecycle_outside_component();
|
|
29
|
+
}
|
|
30
|
+
return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
|
|
31
|
+
}
|
|
32
|
+
function push$1(fn) {
|
|
33
|
+
ssr_context = { p: ssr_context, c: null, r: null };
|
|
34
|
+
}
|
|
35
|
+
function pop$1() {
|
|
36
|
+
ssr_context = /** @type {SSRContext} */
|
|
37
|
+
ssr_context.p;
|
|
38
|
+
}
|
|
39
|
+
function get_parent_context(ssr_context2) {
|
|
40
|
+
let parent = ssr_context2.p;
|
|
41
|
+
while (parent !== null) {
|
|
42
|
+
const context_map = parent.c;
|
|
43
|
+
if (context_map !== null) {
|
|
44
|
+
return context_map;
|
|
45
|
+
}
|
|
46
|
+
parent = parent.p;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
4
50
|
var is_array = Array.isArray;
|
|
5
51
|
var index_of = Array.prototype.indexOf;
|
|
6
52
|
var includes = Array.prototype.includes;
|
|
@@ -40,15 +86,6 @@ function fallback(value, fallback2, lazy = false) {
|
|
|
40
86
|
fallback2
|
|
41
87
|
) : value;
|
|
42
88
|
}
|
|
43
|
-
function equals(value) {
|
|
44
|
-
return value === this.v;
|
|
45
|
-
}
|
|
46
|
-
function safe_not_equal(a, b) {
|
|
47
|
-
return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
|
|
48
|
-
}
|
|
49
|
-
function safe_equals(value) {
|
|
50
|
-
return !safe_not_equal(value, this.v);
|
|
51
|
-
}
|
|
52
89
|
const DERIVED = 1 << 1;
|
|
53
90
|
const EFFECT = 1 << 2;
|
|
54
91
|
const RENDER_EFFECT = 1 << 3;
|
|
@@ -81,10 +118,186 @@ const STALE_REACTION = new class StaleReactionError extends Error {
|
|
|
81
118
|
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
82
119
|
}();
|
|
83
120
|
const COMMENT_NODE = 8;
|
|
84
|
-
|
|
121
|
+
let controller = null;
|
|
122
|
+
function abort() {
|
|
123
|
+
controller?.abort(STALE_REACTION);
|
|
124
|
+
controller = null;
|
|
125
|
+
}
|
|
126
|
+
let tracing_mode_flag = false;
|
|
127
|
+
const HYDRATION_START = "[";
|
|
128
|
+
const HYDRATION_START_ELSE = "[!";
|
|
129
|
+
const HYDRATION_START_FAILED = "[?";
|
|
130
|
+
const HYDRATION_END = "]";
|
|
131
|
+
const HYDRATION_ERROR = {};
|
|
132
|
+
const ELEMENT_IS_NAMESPACED = 1;
|
|
133
|
+
const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
|
|
134
|
+
const ELEMENT_IS_INPUT = 1 << 2;
|
|
135
|
+
const UNINITIALIZED = /* @__PURE__ */ Symbol();
|
|
136
|
+
const ATTACHMENT_KEY = "@attach";
|
|
137
|
+
function unresolved_hydratable(key, stack) {
|
|
85
138
|
{
|
|
86
|
-
|
|
139
|
+
console.warn(`https://svelte.dev/e/unresolved_hydratable`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
|
|
143
|
+
const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
|
|
144
|
+
const EMPTY_COMMENT = `<!---->`;
|
|
145
|
+
const ATTR_REGEX = /[&"<]/g;
|
|
146
|
+
const CONTENT_REGEX = /[&<]/g;
|
|
147
|
+
function escape_html(value, is_attr) {
|
|
148
|
+
const str = String(value ?? "");
|
|
149
|
+
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
|
|
150
|
+
pattern.lastIndex = 0;
|
|
151
|
+
let escaped = "";
|
|
152
|
+
let last = 0;
|
|
153
|
+
while (pattern.test(str)) {
|
|
154
|
+
const i = pattern.lastIndex - 1;
|
|
155
|
+
const ch = str[i];
|
|
156
|
+
escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<");
|
|
157
|
+
last = i + 1;
|
|
158
|
+
}
|
|
159
|
+
return escaped + str.substring(last);
|
|
160
|
+
}
|
|
161
|
+
const replacements = {
|
|
162
|
+
translate: /* @__PURE__ */ new Map([
|
|
163
|
+
[true, "yes"],
|
|
164
|
+
[false, "no"]
|
|
165
|
+
])
|
|
166
|
+
};
|
|
167
|
+
function attr(name, value, is_boolean = false) {
|
|
168
|
+
if (name === "hidden" && value !== "until-found") {
|
|
169
|
+
is_boolean = true;
|
|
170
|
+
}
|
|
171
|
+
if (value == null || !value && is_boolean) return "";
|
|
172
|
+
const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
|
|
173
|
+
const assignment = is_boolean ? `=""` : `="${escape_html(normalized, true)}"`;
|
|
174
|
+
return ` ${name}${assignment}`;
|
|
175
|
+
}
|
|
176
|
+
function clsx(value) {
|
|
177
|
+
if (typeof value === "object") {
|
|
178
|
+
return clsx$1(value);
|
|
179
|
+
} else {
|
|
180
|
+
return value ?? "";
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const whitespace = [..." \n\r\f \v\uFEFF"];
|
|
184
|
+
function to_class(value, hash, directives) {
|
|
185
|
+
var classname = value == null ? "" : "" + value;
|
|
186
|
+
if (hash) {
|
|
187
|
+
classname = classname ? classname + " " + hash : hash;
|
|
188
|
+
}
|
|
189
|
+
if (directives) {
|
|
190
|
+
for (var key of Object.keys(directives)) {
|
|
191
|
+
if (directives[key]) {
|
|
192
|
+
classname = classname ? classname + " " + key : key;
|
|
193
|
+
} else if (classname.length) {
|
|
194
|
+
var len = key.length;
|
|
195
|
+
var a = 0;
|
|
196
|
+
while ((a = classname.indexOf(key, a)) >= 0) {
|
|
197
|
+
var b = a + len;
|
|
198
|
+
if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) {
|
|
199
|
+
classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
|
|
200
|
+
} else {
|
|
201
|
+
a = b;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return classname === "" ? null : classname;
|
|
208
|
+
}
|
|
209
|
+
function append_styles(styles, important = false) {
|
|
210
|
+
var separator = important ? " !important;" : ";";
|
|
211
|
+
var css = "";
|
|
212
|
+
for (var key of Object.keys(styles)) {
|
|
213
|
+
var value = styles[key];
|
|
214
|
+
if (value != null && value !== "") {
|
|
215
|
+
css += " " + key + ": " + value + separator;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return css;
|
|
219
|
+
}
|
|
220
|
+
function to_css_name(name) {
|
|
221
|
+
if (name[0] !== "-" || name[1] !== "-") {
|
|
222
|
+
return name.toLowerCase();
|
|
223
|
+
}
|
|
224
|
+
return name;
|
|
225
|
+
}
|
|
226
|
+
function to_style(value, styles) {
|
|
227
|
+
if (styles) {
|
|
228
|
+
var new_style = "";
|
|
229
|
+
var normal_styles;
|
|
230
|
+
var important_styles;
|
|
231
|
+
if (Array.isArray(styles)) {
|
|
232
|
+
normal_styles = styles[0];
|
|
233
|
+
important_styles = styles[1];
|
|
234
|
+
} else {
|
|
235
|
+
normal_styles = styles;
|
|
236
|
+
}
|
|
237
|
+
if (value) {
|
|
238
|
+
value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
239
|
+
var in_str = false;
|
|
240
|
+
var in_apo = 0;
|
|
241
|
+
var in_comment = false;
|
|
242
|
+
var reserved_names = [];
|
|
243
|
+
if (normal_styles) {
|
|
244
|
+
reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
|
|
245
|
+
}
|
|
246
|
+
if (important_styles) {
|
|
247
|
+
reserved_names.push(...Object.keys(important_styles).map(to_css_name));
|
|
248
|
+
}
|
|
249
|
+
var start_index = 0;
|
|
250
|
+
var name_index = -1;
|
|
251
|
+
const len = value.length;
|
|
252
|
+
for (var i = 0; i < len; i++) {
|
|
253
|
+
var c = value[i];
|
|
254
|
+
if (in_comment) {
|
|
255
|
+
if (c === "/" && value[i - 1] === "*") {
|
|
256
|
+
in_comment = false;
|
|
257
|
+
}
|
|
258
|
+
} else if (in_str) {
|
|
259
|
+
if (in_str === c) {
|
|
260
|
+
in_str = false;
|
|
261
|
+
}
|
|
262
|
+
} else if (c === "/" && value[i + 1] === "*") {
|
|
263
|
+
in_comment = true;
|
|
264
|
+
} else if (c === '"' || c === "'") {
|
|
265
|
+
in_str = c;
|
|
266
|
+
} else if (c === "(") {
|
|
267
|
+
in_apo++;
|
|
268
|
+
} else if (c === ")") {
|
|
269
|
+
in_apo--;
|
|
270
|
+
}
|
|
271
|
+
if (!in_comment && in_str === false && in_apo === 0) {
|
|
272
|
+
if (c === ":" && name_index === -1) {
|
|
273
|
+
name_index = i;
|
|
274
|
+
} else if (c === ";" || i === len - 1) {
|
|
275
|
+
if (name_index !== -1) {
|
|
276
|
+
var name = to_css_name(value.substring(start_index, name_index).trim());
|
|
277
|
+
if (!reserved_names.includes(name)) {
|
|
278
|
+
if (c !== ";") {
|
|
279
|
+
i++;
|
|
280
|
+
}
|
|
281
|
+
var property = value.substring(start_index, i).trim();
|
|
282
|
+
new_style += " " + property + ";";
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
start_index = i + 1;
|
|
286
|
+
name_index = -1;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (normal_styles) {
|
|
292
|
+
new_style += append_styles(normal_styles);
|
|
293
|
+
}
|
|
294
|
+
if (important_styles) {
|
|
295
|
+
new_style += append_styles(important_styles, true);
|
|
296
|
+
}
|
|
297
|
+
new_style = new_style.trim();
|
|
298
|
+
return new_style === "" ? null : new_style;
|
|
87
299
|
}
|
|
300
|
+
return value == null ? null : String(value);
|
|
88
301
|
}
|
|
89
302
|
function effect_update_depth_exceeded() {
|
|
90
303
|
{
|
|
@@ -116,16 +329,6 @@ function svelte_boundary_reset_onerror() {
|
|
|
116
329
|
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
117
330
|
}
|
|
118
331
|
}
|
|
119
|
-
const HYDRATION_START = "[";
|
|
120
|
-
const HYDRATION_START_ELSE = "[!";
|
|
121
|
-
const HYDRATION_START_FAILED = "[?";
|
|
122
|
-
const HYDRATION_END = "]";
|
|
123
|
-
const HYDRATION_ERROR = {};
|
|
124
|
-
const ELEMENT_IS_NAMESPACED = 1;
|
|
125
|
-
const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
|
|
126
|
-
const ELEMENT_IS_INPUT = 1 << 2;
|
|
127
|
-
const UNINITIALIZED = /* @__PURE__ */ Symbol();
|
|
128
|
-
const ATTACHMENT_KEY = "@attach";
|
|
129
332
|
function hydration_mismatch(location) {
|
|
130
333
|
{
|
|
131
334
|
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
@@ -187,12 +390,20 @@ function skip_nodes(remove = true) {
|
|
|
187
390
|
node = next2;
|
|
188
391
|
}
|
|
189
392
|
}
|
|
190
|
-
|
|
393
|
+
function equals(value) {
|
|
394
|
+
return value === this.v;
|
|
395
|
+
}
|
|
396
|
+
function safe_not_equal(a, b) {
|
|
397
|
+
return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
|
|
398
|
+
}
|
|
399
|
+
function safe_equals(value) {
|
|
400
|
+
return !safe_not_equal(value, this.v);
|
|
401
|
+
}
|
|
191
402
|
let component_context = null;
|
|
192
403
|
function set_component_context(context) {
|
|
193
404
|
component_context = context;
|
|
194
405
|
}
|
|
195
|
-
function push
|
|
406
|
+
function push(props, runes = false, fn) {
|
|
196
407
|
component_context = {
|
|
197
408
|
p: component_context,
|
|
198
409
|
i: false,
|
|
@@ -207,7 +418,7 @@ function push$1(props, runes = false, fn) {
|
|
|
207
418
|
l: null
|
|
208
419
|
};
|
|
209
420
|
}
|
|
210
|
-
function pop
|
|
421
|
+
function pop(component) {
|
|
211
422
|
var context = (
|
|
212
423
|
/** @type {ComponentContext} */
|
|
213
424
|
component_context
|
|
@@ -2403,129 +2614,6 @@ function untrack(fn) {
|
|
|
2403
2614
|
untracking = previous_untracking;
|
|
2404
2615
|
}
|
|
2405
2616
|
}
|
|
2406
|
-
const event_symbol = /* @__PURE__ */ Symbol("events");
|
|
2407
|
-
const all_registered_events = /* @__PURE__ */ new Set();
|
|
2408
|
-
const root_event_handles = /* @__PURE__ */ new Set();
|
|
2409
|
-
function create_event(event_name, dom, handler, options = {}) {
|
|
2410
|
-
function target_handler(event) {
|
|
2411
|
-
if (!options.capture) {
|
|
2412
|
-
handle_event_propagation.call(dom, event);
|
|
2413
|
-
}
|
|
2414
|
-
if (!event.cancelBubble) {
|
|
2415
|
-
return without_reactive_context(() => {
|
|
2416
|
-
return handler?.call(this, event);
|
|
2417
|
-
});
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel") {
|
|
2421
|
-
queue_micro_task(() => {
|
|
2422
|
-
dom.addEventListener(event_name, target_handler, options);
|
|
2423
|
-
});
|
|
2424
|
-
} else {
|
|
2425
|
-
dom.addEventListener(event_name, target_handler, options);
|
|
2426
|
-
}
|
|
2427
|
-
return target_handler;
|
|
2428
|
-
}
|
|
2429
|
-
function on(element2, type, handler, options = {}) {
|
|
2430
|
-
var target_handler = create_event(type, element2, handler, options);
|
|
2431
|
-
return () => {
|
|
2432
|
-
element2.removeEventListener(type, target_handler, options);
|
|
2433
|
-
};
|
|
2434
|
-
}
|
|
2435
|
-
let last_propagated_event = null;
|
|
2436
|
-
function handle_event_propagation(event) {
|
|
2437
|
-
var handler_element = this;
|
|
2438
|
-
var owner_document = (
|
|
2439
|
-
/** @type {Node} */
|
|
2440
|
-
handler_element.ownerDocument
|
|
2441
|
-
);
|
|
2442
|
-
var event_name = event.type;
|
|
2443
|
-
var path = event.composedPath?.() || [];
|
|
2444
|
-
var current_target = (
|
|
2445
|
-
/** @type {null | Element} */
|
|
2446
|
-
path[0] || event.target
|
|
2447
|
-
);
|
|
2448
|
-
last_propagated_event = event;
|
|
2449
|
-
var path_idx = 0;
|
|
2450
|
-
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
2451
|
-
if (handled_at) {
|
|
2452
|
-
var at_idx = path.indexOf(handled_at);
|
|
2453
|
-
if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
|
|
2454
|
-
window)) {
|
|
2455
|
-
event[event_symbol] = handler_element;
|
|
2456
|
-
return;
|
|
2457
|
-
}
|
|
2458
|
-
var handler_idx = path.indexOf(handler_element);
|
|
2459
|
-
if (handler_idx === -1) {
|
|
2460
|
-
return;
|
|
2461
|
-
}
|
|
2462
|
-
if (at_idx <= handler_idx) {
|
|
2463
|
-
path_idx = at_idx;
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
current_target = /** @type {Element} */
|
|
2467
|
-
path[path_idx] || event.target;
|
|
2468
|
-
if (current_target === handler_element) return;
|
|
2469
|
-
define_property(event, "currentTarget", {
|
|
2470
|
-
configurable: true,
|
|
2471
|
-
get() {
|
|
2472
|
-
return current_target || owner_document;
|
|
2473
|
-
}
|
|
2474
|
-
});
|
|
2475
|
-
var previous_reaction = active_reaction;
|
|
2476
|
-
var previous_effect = active_effect;
|
|
2477
|
-
set_active_reaction(null);
|
|
2478
|
-
set_active_effect(null);
|
|
2479
|
-
try {
|
|
2480
|
-
var throw_error;
|
|
2481
|
-
var other_errors = [];
|
|
2482
|
-
while (current_target !== null) {
|
|
2483
|
-
var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
|
|
2484
|
-
current_target.host || null;
|
|
2485
|
-
try {
|
|
2486
|
-
var delegated = current_target[event_symbol]?.[event_name];
|
|
2487
|
-
if (delegated != null && (!/** @type {any} */
|
|
2488
|
-
current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
2489
|
-
// -> the target could not have been disabled because it emits the event in the first place
|
|
2490
|
-
event.target === current_target)) {
|
|
2491
|
-
delegated.call(current_target, event);
|
|
2492
|
-
}
|
|
2493
|
-
} catch (error) {
|
|
2494
|
-
if (throw_error) {
|
|
2495
|
-
other_errors.push(error);
|
|
2496
|
-
} else {
|
|
2497
|
-
throw_error = error;
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
|
|
2501
|
-
break;
|
|
2502
|
-
}
|
|
2503
|
-
current_target = parent_element;
|
|
2504
|
-
}
|
|
2505
|
-
if (throw_error) {
|
|
2506
|
-
for (let error of other_errors) {
|
|
2507
|
-
queueMicrotask(() => {
|
|
2508
|
-
throw error;
|
|
2509
|
-
});
|
|
2510
|
-
}
|
|
2511
|
-
throw throw_error;
|
|
2512
|
-
}
|
|
2513
|
-
} finally {
|
|
2514
|
-
event[event_symbol] = handler_element;
|
|
2515
|
-
delete event.currentTarget;
|
|
2516
|
-
set_active_reaction(previous_reaction);
|
|
2517
|
-
set_active_effect(previous_effect);
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
function assign_nodes(start, end) {
|
|
2521
|
-
var effect = (
|
|
2522
|
-
/** @type {Effect} */
|
|
2523
|
-
active_effect
|
|
2524
|
-
);
|
|
2525
|
-
if (effect.nodes === null) {
|
|
2526
|
-
effect.nodes = { start, end, a: null, t: null };
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
2617
|
const VOID_ELEMENT_NAMES = [
|
|
2530
2618
|
"area",
|
|
2531
2619
|
"base",
|
|
@@ -2595,524 +2683,159 @@ function is_raw_text_element(name) {
|
|
|
2595
2683
|
);
|
|
2596
2684
|
}
|
|
2597
2685
|
const REGEX_VALID_TAG_NAME = /^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]+)*$/u;
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
const target = options.target;
|
|
2605
|
-
const was_hydrating = hydrating;
|
|
2606
|
-
const previous_hydrate_node = hydrate_node;
|
|
2607
|
-
try {
|
|
2608
|
-
var anchor = /* @__PURE__ */ get_first_child(target);
|
|
2609
|
-
while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
|
2610
|
-
anchor.data !== HYDRATION_START)) {
|
|
2611
|
-
anchor = /* @__PURE__ */ get_next_sibling(anchor);
|
|
2612
|
-
}
|
|
2613
|
-
if (!anchor) {
|
|
2614
|
-
throw HYDRATION_ERROR;
|
|
2686
|
+
const INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
|
|
2687
|
+
function element(renderer, tag, attributes_fn = noop, children_fn = noop) {
|
|
2688
|
+
renderer.push("<!---->");
|
|
2689
|
+
if (tag) {
|
|
2690
|
+
if (!REGEX_VALID_TAG_NAME.test(tag)) {
|
|
2691
|
+
dynamic_element_invalid_tag(tag);
|
|
2615
2692
|
}
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
instance
|
|
2626
|
-
);
|
|
2627
|
-
} catch (error) {
|
|
2628
|
-
if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
|
|
2629
|
-
throw error;
|
|
2693
|
+
renderer.push(`<${tag}`);
|
|
2694
|
+
attributes_fn();
|
|
2695
|
+
renderer.push(`>`);
|
|
2696
|
+
if (!is_void(tag)) {
|
|
2697
|
+
children_fn();
|
|
2698
|
+
if (!is_raw_text_element(tag)) {
|
|
2699
|
+
renderer.push(EMPTY_COMMENT);
|
|
2700
|
+
}
|
|
2701
|
+
renderer.push(`</${tag}>`);
|
|
2630
2702
|
}
|
|
2631
|
-
|
|
2632
|
-
|
|
2703
|
+
}
|
|
2704
|
+
renderer.push("<!---->");
|
|
2705
|
+
}
|
|
2706
|
+
function render(component, options = {}) {
|
|
2707
|
+
if (options.csp?.hash && options.csp.nonce) {
|
|
2708
|
+
invalid_csp();
|
|
2709
|
+
}
|
|
2710
|
+
return Renderer.render(
|
|
2711
|
+
/** @type {Component<Props>} */
|
|
2712
|
+
component,
|
|
2713
|
+
options
|
|
2714
|
+
);
|
|
2715
|
+
}
|
|
2716
|
+
function attributes(attrs, css_hash, classes, styles, flags2 = 0) {
|
|
2717
|
+
if (styles) {
|
|
2718
|
+
attrs.style = to_style(attrs.style, styles);
|
|
2719
|
+
}
|
|
2720
|
+
if (attrs.class) {
|
|
2721
|
+
attrs.class = clsx(attrs.class);
|
|
2722
|
+
}
|
|
2723
|
+
if (css_hash || classes) {
|
|
2724
|
+
attrs.class = to_class(attrs.class, css_hash, classes);
|
|
2725
|
+
}
|
|
2726
|
+
let attr_str = "";
|
|
2727
|
+
let name;
|
|
2728
|
+
const is_html = (flags2 & ELEMENT_IS_NAMESPACED) === 0;
|
|
2729
|
+
const lowercase = (flags2 & ELEMENT_PRESERVE_ATTRIBUTE_CASE) === 0;
|
|
2730
|
+
const is_input = (flags2 & ELEMENT_IS_INPUT) !== 0;
|
|
2731
|
+
for (name of Object.keys(attrs)) {
|
|
2732
|
+
if (typeof attrs[name] === "function") continue;
|
|
2733
|
+
if (name[0] === "$" && name[1] === "$") continue;
|
|
2734
|
+
if (INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
|
|
2735
|
+
var value = attrs[name];
|
|
2736
|
+
var lower = name.toLowerCase();
|
|
2737
|
+
if (lowercase) name = lower;
|
|
2738
|
+
if (lower.length > 2 && lower.startsWith("on")) continue;
|
|
2739
|
+
if (is_input) {
|
|
2740
|
+
if (name === "defaultvalue" || name === "defaultchecked") {
|
|
2741
|
+
name = name === "defaultvalue" ? "value" : "checked";
|
|
2742
|
+
if (attrs[name]) continue;
|
|
2743
|
+
}
|
|
2633
2744
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2745
|
+
attr_str += attr(name, value, is_html && is_boolean_attribute(name));
|
|
2746
|
+
}
|
|
2747
|
+
return attr_str;
|
|
2748
|
+
}
|
|
2749
|
+
function spread_props(props) {
|
|
2750
|
+
const merged_props = {};
|
|
2751
|
+
let key;
|
|
2752
|
+
for (let i = 0; i < props.length; i++) {
|
|
2753
|
+
const obj = props[i];
|
|
2754
|
+
if (obj == null) continue;
|
|
2755
|
+
for (key of Object.keys(obj)) {
|
|
2756
|
+
const desc = Object.getOwnPropertyDescriptor(obj, key);
|
|
2757
|
+
if (desc) {
|
|
2758
|
+
Object.defineProperty(merged_props, key, desc);
|
|
2759
|
+
} else {
|
|
2760
|
+
merged_props[key] = obj[key];
|
|
2761
|
+
}
|
|
2636
2762
|
}
|
|
2637
|
-
init_operations();
|
|
2638
|
-
clear_text_content(target);
|
|
2639
|
-
set_hydrating(false);
|
|
2640
|
-
return mount(component, options);
|
|
2641
|
-
} finally {
|
|
2642
|
-
set_hydrating(was_hydrating);
|
|
2643
|
-
set_hydrate_node(previous_hydrate_node);
|
|
2644
2763
|
}
|
|
2764
|
+
return merged_props;
|
|
2645
2765
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
init_operations();
|
|
2649
|
-
var component = void 0;
|
|
2650
|
-
var unmount2 = component_root(() => {
|
|
2651
|
-
var anchor_node = anchor ?? target.appendChild(create_text());
|
|
2652
|
-
boundary(
|
|
2653
|
-
/** @type {TemplateNode} */
|
|
2654
|
-
anchor_node,
|
|
2655
|
-
{
|
|
2656
|
-
pending: () => {
|
|
2657
|
-
}
|
|
2658
|
-
},
|
|
2659
|
-
(anchor_node2) => {
|
|
2660
|
-
push$1({});
|
|
2661
|
-
var ctx = (
|
|
2662
|
-
/** @type {ComponentContext} */
|
|
2663
|
-
component_context
|
|
2664
|
-
);
|
|
2665
|
-
if (context) ctx.c = context;
|
|
2666
|
-
if (events) {
|
|
2667
|
-
props.$$events = events;
|
|
2668
|
-
}
|
|
2669
|
-
if (hydrating) {
|
|
2670
|
-
assign_nodes(
|
|
2671
|
-
/** @type {TemplateNode} */
|
|
2672
|
-
anchor_node2,
|
|
2673
|
-
null
|
|
2674
|
-
);
|
|
2675
|
-
}
|
|
2676
|
-
component = Component(anchor_node2, props) || {};
|
|
2677
|
-
if (hydrating) {
|
|
2678
|
-
active_effect.nodes.end = hydrate_node;
|
|
2679
|
-
if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
|
2680
|
-
hydrate_node.data !== HYDRATION_END) {
|
|
2681
|
-
hydration_mismatch();
|
|
2682
|
-
throw HYDRATION_ERROR;
|
|
2683
|
-
}
|
|
2684
|
-
}
|
|
2685
|
-
pop$1();
|
|
2686
|
-
},
|
|
2687
|
-
transformError
|
|
2688
|
-
);
|
|
2689
|
-
var registered_events = /* @__PURE__ */ new Set();
|
|
2690
|
-
var event_handle = (events2) => {
|
|
2691
|
-
for (var i = 0; i < events2.length; i++) {
|
|
2692
|
-
var event_name = events2[i];
|
|
2693
|
-
if (registered_events.has(event_name)) continue;
|
|
2694
|
-
registered_events.add(event_name);
|
|
2695
|
-
var passive = is_passive_event(event_name);
|
|
2696
|
-
for (const node of [target, document]) {
|
|
2697
|
-
var counts = listeners.get(node);
|
|
2698
|
-
if (counts === void 0) {
|
|
2699
|
-
counts = /* @__PURE__ */ new Map();
|
|
2700
|
-
listeners.set(node, counts);
|
|
2701
|
-
}
|
|
2702
|
-
var count = counts.get(event_name);
|
|
2703
|
-
if (count === void 0) {
|
|
2704
|
-
node.addEventListener(event_name, handle_event_propagation, { passive });
|
|
2705
|
-
counts.set(event_name, 1);
|
|
2706
|
-
} else {
|
|
2707
|
-
counts.set(event_name, count + 1);
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
};
|
|
2712
|
-
event_handle(array_from(all_registered_events));
|
|
2713
|
-
root_event_handles.add(event_handle);
|
|
2714
|
-
return () => {
|
|
2715
|
-
for (var event_name of registered_events) {
|
|
2716
|
-
for (const node of [target, document]) {
|
|
2717
|
-
var counts = (
|
|
2718
|
-
/** @type {Map<string, number>} */
|
|
2719
|
-
listeners.get(node)
|
|
2720
|
-
);
|
|
2721
|
-
var count = (
|
|
2722
|
-
/** @type {number} */
|
|
2723
|
-
counts.get(event_name)
|
|
2724
|
-
);
|
|
2725
|
-
if (--count == 0) {
|
|
2726
|
-
node.removeEventListener(event_name, handle_event_propagation);
|
|
2727
|
-
counts.delete(event_name);
|
|
2728
|
-
if (counts.size === 0) {
|
|
2729
|
-
listeners.delete(node);
|
|
2730
|
-
}
|
|
2731
|
-
} else {
|
|
2732
|
-
counts.set(event_name, count);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2736
|
-
root_event_handles.delete(event_handle);
|
|
2737
|
-
if (anchor_node !== anchor) {
|
|
2738
|
-
anchor_node.parentNode?.removeChild(anchor_node);
|
|
2739
|
-
}
|
|
2740
|
-
};
|
|
2741
|
-
});
|
|
2742
|
-
mounted_components.set(component, unmount2);
|
|
2743
|
-
return component;
|
|
2744
|
-
}
|
|
2745
|
-
let mounted_components = /* @__PURE__ */ new WeakMap();
|
|
2746
|
-
function unmount(component, options) {
|
|
2747
|
-
const fn = mounted_components.get(component);
|
|
2748
|
-
if (fn) {
|
|
2749
|
-
mounted_components.delete(component);
|
|
2750
|
-
return fn(options);
|
|
2751
|
-
}
|
|
2752
|
-
return Promise.resolve();
|
|
2753
|
-
}
|
|
2754
|
-
function asClassComponent$1(component) {
|
|
2755
|
-
return class extends Svelte4Component {
|
|
2756
|
-
/** @param {any} options */
|
|
2757
|
-
constructor(options) {
|
|
2758
|
-
super({
|
|
2759
|
-
component,
|
|
2760
|
-
...options
|
|
2761
|
-
});
|
|
2762
|
-
}
|
|
2763
|
-
};
|
|
2764
|
-
}
|
|
2765
|
-
class Svelte4Component {
|
|
2766
|
-
/** @type {any} */
|
|
2767
|
-
#events;
|
|
2768
|
-
/** @type {Record<string, any>} */
|
|
2769
|
-
#instance;
|
|
2770
|
-
/**
|
|
2771
|
-
* @param {ComponentConstructorOptions & {
|
|
2772
|
-
* component: any;
|
|
2773
|
-
* }} options
|
|
2774
|
-
*/
|
|
2775
|
-
constructor(options) {
|
|
2776
|
-
var sources = /* @__PURE__ */ new Map();
|
|
2777
|
-
var add_source = (key, value) => {
|
|
2778
|
-
var s = /* @__PURE__ */ mutable_source(value, false, false);
|
|
2779
|
-
sources.set(key, s);
|
|
2780
|
-
return s;
|
|
2781
|
-
};
|
|
2782
|
-
const props = new Proxy(
|
|
2783
|
-
{ ...options.props || {}, $$events: {} },
|
|
2784
|
-
{
|
|
2785
|
-
get(target, prop) {
|
|
2786
|
-
return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
2787
|
-
},
|
|
2788
|
-
has(target, prop) {
|
|
2789
|
-
if (prop === LEGACY_PROPS) return true;
|
|
2790
|
-
get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
2791
|
-
return Reflect.has(target, prop);
|
|
2792
|
-
},
|
|
2793
|
-
set(target, prop, value) {
|
|
2794
|
-
set(sources.get(prop) ?? add_source(prop, value), value);
|
|
2795
|
-
return Reflect.set(target, prop, value);
|
|
2796
|
-
}
|
|
2797
|
-
}
|
|
2798
|
-
);
|
|
2799
|
-
this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
|
|
2800
|
-
target: options.target,
|
|
2801
|
-
anchor: options.anchor,
|
|
2802
|
-
props,
|
|
2803
|
-
context: options.context,
|
|
2804
|
-
intro: options.intro ?? false,
|
|
2805
|
-
recover: options.recover,
|
|
2806
|
-
transformError: options.transformError
|
|
2807
|
-
});
|
|
2808
|
-
if (!options?.props?.$$host || options.sync === false) {
|
|
2809
|
-
flushSync();
|
|
2810
|
-
}
|
|
2811
|
-
this.#events = props.$$events;
|
|
2812
|
-
for (const key of Object.keys(this.#instance)) {
|
|
2813
|
-
if (key === "$set" || key === "$destroy" || key === "$on") continue;
|
|
2814
|
-
define_property(this, key, {
|
|
2815
|
-
get() {
|
|
2816
|
-
return this.#instance[key];
|
|
2817
|
-
},
|
|
2818
|
-
/** @param {any} value */
|
|
2819
|
-
set(value) {
|
|
2820
|
-
this.#instance[key] = value;
|
|
2821
|
-
},
|
|
2822
|
-
enumerable: true
|
|
2823
|
-
});
|
|
2824
|
-
}
|
|
2825
|
-
this.#instance.$set = /** @param {Record<string, any>} next */
|
|
2826
|
-
(next2) => {
|
|
2827
|
-
Object.assign(props, next2);
|
|
2828
|
-
};
|
|
2829
|
-
this.#instance.$destroy = () => {
|
|
2830
|
-
unmount(this.#instance);
|
|
2831
|
-
};
|
|
2832
|
-
}
|
|
2833
|
-
/** @param {Record<string, any>} props */
|
|
2834
|
-
$set(props) {
|
|
2835
|
-
this.#instance.$set(props);
|
|
2836
|
-
}
|
|
2837
|
-
/**
|
|
2838
|
-
* @param {string} event
|
|
2839
|
-
* @param {(...args: any[]) => any} callback
|
|
2840
|
-
* @returns {any}
|
|
2841
|
-
*/
|
|
2842
|
-
$on(event, callback) {
|
|
2843
|
-
this.#events[event] = this.#events[event] || [];
|
|
2844
|
-
const cb = (...args) => callback.call(this, ...args);
|
|
2845
|
-
this.#events[event].push(cb);
|
|
2846
|
-
return () => {
|
|
2847
|
-
this.#events[event] = this.#events[event].filter(
|
|
2848
|
-
/** @param {any} fn */
|
|
2849
|
-
(fn) => fn !== cb
|
|
2850
|
-
);
|
|
2851
|
-
};
|
|
2852
|
-
}
|
|
2853
|
-
$destroy() {
|
|
2854
|
-
this.#instance.$destroy();
|
|
2855
|
-
}
|
|
2856
|
-
}
|
|
2857
|
-
const ATTR_REGEX = /[&"<]/g;
|
|
2858
|
-
const CONTENT_REGEX = /[&<]/g;
|
|
2859
|
-
function escape_html(value, is_attr) {
|
|
2860
|
-
const str = String(value ?? "");
|
|
2861
|
-
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
|
|
2862
|
-
pattern.lastIndex = 0;
|
|
2863
|
-
let escaped = "";
|
|
2864
|
-
let last = 0;
|
|
2865
|
-
while (pattern.test(str)) {
|
|
2866
|
-
const i = pattern.lastIndex - 1;
|
|
2867
|
-
const ch = str[i];
|
|
2868
|
-
escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<");
|
|
2869
|
-
last = i + 1;
|
|
2870
|
-
}
|
|
2871
|
-
return escaped + str.substring(last);
|
|
2872
|
-
}
|
|
2873
|
-
const replacements = {
|
|
2874
|
-
translate: /* @__PURE__ */ new Map([
|
|
2875
|
-
[true, "yes"],
|
|
2876
|
-
[false, "no"]
|
|
2877
|
-
])
|
|
2878
|
-
};
|
|
2879
|
-
function attr(name, value, is_boolean = false) {
|
|
2880
|
-
if (name === "hidden" && value !== "until-found") {
|
|
2881
|
-
is_boolean = true;
|
|
2882
|
-
}
|
|
2883
|
-
if (value == null || !value && is_boolean) return "";
|
|
2884
|
-
const normalized = has_own_property.call(replacements, name) && replacements[name].get(value) || value;
|
|
2885
|
-
const assignment = is_boolean ? `=""` : `="${escape_html(normalized, true)}"`;
|
|
2886
|
-
return ` ${name}${assignment}`;
|
|
2766
|
+
function stringify(value) {
|
|
2767
|
+
return typeof value === "string" ? value : value == null ? "" : value + "";
|
|
2887
2768
|
}
|
|
2888
|
-
function
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
} else {
|
|
2892
|
-
return value ?? "";
|
|
2893
|
-
}
|
|
2769
|
+
function attr_class(value, hash, directives) {
|
|
2770
|
+
var result = to_class(value, hash, directives);
|
|
2771
|
+
return result ? ` class="${escape_html(result, true)}"` : "";
|
|
2894
2772
|
}
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
classname = classname ? classname + " " + hash : hash;
|
|
2773
|
+
function slot(renderer, $$props, name, slot_props, fallback_fn) {
|
|
2774
|
+
var slot_fn = $$props.$$slots?.[name];
|
|
2775
|
+
if (slot_fn === true) {
|
|
2776
|
+
slot_fn = $$props["children"];
|
|
2900
2777
|
}
|
|
2901
|
-
if (
|
|
2902
|
-
|
|
2903
|
-
if (directives[key]) {
|
|
2904
|
-
classname = classname ? classname + " " + key : key;
|
|
2905
|
-
} else if (classname.length) {
|
|
2906
|
-
var len = key.length;
|
|
2907
|
-
var a = 0;
|
|
2908
|
-
while ((a = classname.indexOf(key, a)) >= 0) {
|
|
2909
|
-
var b = a + len;
|
|
2910
|
-
if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) {
|
|
2911
|
-
classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
|
|
2912
|
-
} else {
|
|
2913
|
-
a = b;
|
|
2914
|
-
}
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2778
|
+
if (slot_fn !== void 0) {
|
|
2779
|
+
slot_fn(renderer, slot_props);
|
|
2918
2780
|
}
|
|
2919
|
-
return classname === "" ? null : classname;
|
|
2920
2781
|
}
|
|
2921
|
-
function
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
for (
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
css += " " + key + ": " + value + separator;
|
|
2782
|
+
function rest_props(props, rest) {
|
|
2783
|
+
const rest_props2 = {};
|
|
2784
|
+
let key;
|
|
2785
|
+
for (key of Object.keys(props)) {
|
|
2786
|
+
if (!rest.includes(key)) {
|
|
2787
|
+
rest_props2[key] = props[key];
|
|
2928
2788
|
}
|
|
2929
2789
|
}
|
|
2930
|
-
return
|
|
2790
|
+
return rest_props2;
|
|
2931
2791
|
}
|
|
2932
|
-
function
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
}
|
|
2936
|
-
return name;
|
|
2792
|
+
function sanitize_props(props) {
|
|
2793
|
+
const { children, $$slots, ...sanitized } = props;
|
|
2794
|
+
return sanitized;
|
|
2937
2795
|
}
|
|
2938
|
-
function
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
normal_styles = styles[0];
|
|
2945
|
-
important_styles = styles[1];
|
|
2946
|
-
} else {
|
|
2947
|
-
normal_styles = styles;
|
|
2948
|
-
}
|
|
2949
|
-
if (value) {
|
|
2950
|
-
value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
2951
|
-
var in_str = false;
|
|
2952
|
-
var in_apo = 0;
|
|
2953
|
-
var in_comment = false;
|
|
2954
|
-
var reserved_names = [];
|
|
2955
|
-
if (normal_styles) {
|
|
2956
|
-
reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
|
|
2957
|
-
}
|
|
2958
|
-
if (important_styles) {
|
|
2959
|
-
reserved_names.push(...Object.keys(important_styles).map(to_css_name));
|
|
2960
|
-
}
|
|
2961
|
-
var start_index = 0;
|
|
2962
|
-
var name_index = -1;
|
|
2963
|
-
const len = value.length;
|
|
2964
|
-
for (var i = 0; i < len; i++) {
|
|
2965
|
-
var c = value[i];
|
|
2966
|
-
if (in_comment) {
|
|
2967
|
-
if (c === "/" && value[i - 1] === "*") {
|
|
2968
|
-
in_comment = false;
|
|
2969
|
-
}
|
|
2970
|
-
} else if (in_str) {
|
|
2971
|
-
if (in_str === c) {
|
|
2972
|
-
in_str = false;
|
|
2973
|
-
}
|
|
2974
|
-
} else if (c === "/" && value[i + 1] === "*") {
|
|
2975
|
-
in_comment = true;
|
|
2976
|
-
} else if (c === '"' || c === "'") {
|
|
2977
|
-
in_str = c;
|
|
2978
|
-
} else if (c === "(") {
|
|
2979
|
-
in_apo++;
|
|
2980
|
-
} else if (c === ")") {
|
|
2981
|
-
in_apo--;
|
|
2982
|
-
}
|
|
2983
|
-
if (!in_comment && in_str === false && in_apo === 0) {
|
|
2984
|
-
if (c === ":" && name_index === -1) {
|
|
2985
|
-
name_index = i;
|
|
2986
|
-
} else if (c === ";" || i === len - 1) {
|
|
2987
|
-
if (name_index !== -1) {
|
|
2988
|
-
var name = to_css_name(value.substring(start_index, name_index).trim());
|
|
2989
|
-
if (!reserved_names.includes(name)) {
|
|
2990
|
-
if (c !== ";") {
|
|
2991
|
-
i++;
|
|
2992
|
-
}
|
|
2993
|
-
var property = value.substring(start_index, i).trim();
|
|
2994
|
-
new_style += " " + property + ";";
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2997
|
-
start_index = i + 1;
|
|
2998
|
-
name_index = -1;
|
|
2999
|
-
}
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
}
|
|
3003
|
-
if (normal_styles) {
|
|
3004
|
-
new_style += append_styles(normal_styles);
|
|
3005
|
-
}
|
|
3006
|
-
if (important_styles) {
|
|
3007
|
-
new_style += append_styles(important_styles, true);
|
|
2796
|
+
function bind_props(props_parent, props_now) {
|
|
2797
|
+
for (const key of Object.keys(props_now)) {
|
|
2798
|
+
const initial_value = props_parent[key];
|
|
2799
|
+
const value = props_now[key];
|
|
2800
|
+
if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) {
|
|
2801
|
+
props_parent[key] = value;
|
|
3008
2802
|
}
|
|
3009
|
-
new_style = new_style.trim();
|
|
3010
|
-
return new_style === "" ? null : new_style;
|
|
3011
2803
|
}
|
|
3012
|
-
return value == null ? null : String(value);
|
|
3013
|
-
}
|
|
3014
|
-
const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
|
|
3015
|
-
const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
|
|
3016
|
-
const EMPTY_COMMENT = `<!---->`;
|
|
3017
|
-
let controller = null;
|
|
3018
|
-
function abort() {
|
|
3019
|
-
controller?.abort(STALE_REACTION);
|
|
3020
|
-
controller = null;
|
|
3021
|
-
}
|
|
3022
|
-
function await_invalid() {
|
|
3023
|
-
const error = new Error(`await_invalid
|
|
3024
|
-
Encountered asynchronous work while rendering synchronously.
|
|
3025
|
-
https://svelte.dev/e/await_invalid`);
|
|
3026
|
-
error.name = "Svelte error";
|
|
3027
|
-
throw error;
|
|
3028
|
-
}
|
|
3029
|
-
function dynamic_element_invalid_tag(tag) {
|
|
3030
|
-
const error = new Error(`dynamic_element_invalid_tag
|
|
3031
|
-
\`<svelte:element this="${tag}">\` is not a valid element name — the element will not be rendered
|
|
3032
|
-
https://svelte.dev/e/dynamic_element_invalid_tag`);
|
|
3033
|
-
error.name = "Svelte error";
|
|
3034
|
-
throw error;
|
|
3035
|
-
}
|
|
3036
|
-
function invalid_csp() {
|
|
3037
|
-
const error = new Error(`invalid_csp
|
|
3038
|
-
\`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.
|
|
3039
|
-
https://svelte.dev/e/invalid_csp`);
|
|
3040
|
-
error.name = "Svelte error";
|
|
3041
|
-
throw error;
|
|
3042
|
-
}
|
|
3043
|
-
function lifecycle_function_unavailable(name) {
|
|
3044
|
-
const error = new Error(`lifecycle_function_unavailable
|
|
3045
|
-
\`${name}(...)\` is not available on the server
|
|
3046
|
-
https://svelte.dev/e/lifecycle_function_unavailable`);
|
|
3047
|
-
error.name = "Svelte error";
|
|
3048
|
-
throw error;
|
|
3049
|
-
}
|
|
3050
|
-
function server_context_required() {
|
|
3051
|
-
const error = new Error(`server_context_required
|
|
3052
|
-
Could not resolve \`render\` context.
|
|
3053
|
-
https://svelte.dev/e/server_context_required`);
|
|
3054
|
-
error.name = "Svelte error";
|
|
3055
|
-
throw error;
|
|
3056
|
-
}
|
|
3057
|
-
var ssr_context = null;
|
|
3058
|
-
function set_ssr_context(v) {
|
|
3059
|
-
ssr_context = v;
|
|
3060
|
-
}
|
|
3061
|
-
function getContext(key) {
|
|
3062
|
-
const context_map = get_or_init_context_map();
|
|
3063
|
-
const result = (
|
|
3064
|
-
/** @type {T} */
|
|
3065
|
-
context_map.get(key)
|
|
3066
|
-
);
|
|
3067
|
-
return result;
|
|
3068
2804
|
}
|
|
3069
|
-
function
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
}
|
|
3073
|
-
function hasContext(key) {
|
|
3074
|
-
return get_or_init_context_map().has(key);
|
|
3075
|
-
}
|
|
3076
|
-
function getAllContexts() {
|
|
3077
|
-
return get_or_init_context_map();
|
|
3078
|
-
}
|
|
3079
|
-
function get_or_init_context_map(name) {
|
|
3080
|
-
if (ssr_context === null) {
|
|
3081
|
-
lifecycle_outside_component();
|
|
2805
|
+
function ensure_array_like(array_like_or_iterator) {
|
|
2806
|
+
if (array_like_or_iterator) {
|
|
2807
|
+
return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
|
|
3082
2808
|
}
|
|
3083
|
-
return
|
|
3084
|
-
}
|
|
3085
|
-
function push(fn) {
|
|
3086
|
-
ssr_context = { p: ssr_context, c: null, r: null };
|
|
3087
|
-
}
|
|
3088
|
-
function pop() {
|
|
3089
|
-
ssr_context = /** @type {SSRContext} */
|
|
3090
|
-
ssr_context.p;
|
|
2809
|
+
return [];
|
|
3091
2810
|
}
|
|
3092
|
-
function
|
|
3093
|
-
let
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
2811
|
+
function once(get_value) {
|
|
2812
|
+
let value = (
|
|
2813
|
+
/** @type {V} */
|
|
2814
|
+
UNINITIALIZED
|
|
2815
|
+
);
|
|
2816
|
+
return () => {
|
|
2817
|
+
if (value === UNINITIALIZED) {
|
|
2818
|
+
value = get_value();
|
|
3098
2819
|
}
|
|
3099
|
-
|
|
3100
|
-
}
|
|
3101
|
-
return null;
|
|
2820
|
+
return value;
|
|
2821
|
+
};
|
|
3102
2822
|
}
|
|
3103
|
-
function
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
2823
|
+
function props_id(renderer) {
|
|
2824
|
+
const uid2 = renderer.global.uid();
|
|
2825
|
+
renderer.push("<!--$" + uid2 + "-->");
|
|
2826
|
+
return uid2;
|
|
3107
2827
|
}
|
|
3108
|
-
function
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
2828
|
+
function derived(fn) {
|
|
2829
|
+
const get_value = ssr_context === null ? fn : once(fn);
|
|
2830
|
+
let updated_value;
|
|
2831
|
+
return function(new_value) {
|
|
2832
|
+
if (arguments.length === 0) {
|
|
2833
|
+
return updated_value ?? get_value();
|
|
2834
|
+
}
|
|
2835
|
+
updated_value = new_value;
|
|
2836
|
+
return updated_value;
|
|
2837
|
+
};
|
|
3114
2838
|
}
|
|
3115
|
-
let als = null;
|
|
3116
2839
|
let text_encoder;
|
|
3117
2840
|
let crypto;
|
|
3118
2841
|
const obfuscated_import = (module_name) => import(
|
|
@@ -3368,10 +3091,10 @@ class Renderer {
|
|
|
3368
3091
|
* @returns {void}
|
|
3369
3092
|
*/
|
|
3370
3093
|
component(fn, component_fn) {
|
|
3371
|
-
push();
|
|
3094
|
+
push$1();
|
|
3372
3095
|
const child = this.child(fn);
|
|
3373
3096
|
child.#is_component_body = true;
|
|
3374
|
-
pop();
|
|
3097
|
+
pop$1();
|
|
3375
3098
|
}
|
|
3376
3099
|
/**
|
|
3377
3100
|
* @param {Record<string, any>} attrs
|
|
@@ -3873,158 +3596,387 @@ class SSRState {
|
|
|
3873
3596
|
}
|
|
3874
3597
|
}
|
|
3875
3598
|
}
|
|
3876
|
-
const
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3599
|
+
const event_symbol = /* @__PURE__ */ Symbol("events");
|
|
3600
|
+
const all_registered_events = /* @__PURE__ */ new Set();
|
|
3601
|
+
const root_event_handles = /* @__PURE__ */ new Set();
|
|
3602
|
+
function create_event(event_name, dom, handler, options = {}) {
|
|
3603
|
+
function target_handler(event) {
|
|
3604
|
+
if (!options.capture) {
|
|
3605
|
+
handle_event_propagation.call(dom, event);
|
|
3882
3606
|
}
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3607
|
+
if (!event.cancelBubble) {
|
|
3608
|
+
return without_reactive_context(() => {
|
|
3609
|
+
return handler?.call(this, event);
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel") {
|
|
3614
|
+
queue_micro_task(() => {
|
|
3615
|
+
dom.addEventListener(event_name, target_handler, options);
|
|
3616
|
+
});
|
|
3617
|
+
} else {
|
|
3618
|
+
dom.addEventListener(event_name, target_handler, options);
|
|
3619
|
+
}
|
|
3620
|
+
return target_handler;
|
|
3621
|
+
}
|
|
3622
|
+
function on(element2, type, handler, options = {}) {
|
|
3623
|
+
var target_handler = create_event(type, element2, handler, options);
|
|
3624
|
+
return () => {
|
|
3625
|
+
element2.removeEventListener(type, target_handler, options);
|
|
3626
|
+
};
|
|
3627
|
+
}
|
|
3628
|
+
let last_propagated_event = null;
|
|
3629
|
+
function handle_event_propagation(event) {
|
|
3630
|
+
var handler_element = this;
|
|
3631
|
+
var owner_document = (
|
|
3632
|
+
/** @type {Node} */
|
|
3633
|
+
handler_element.ownerDocument
|
|
3634
|
+
);
|
|
3635
|
+
var event_name = event.type;
|
|
3636
|
+
var path = event.composedPath?.() || [];
|
|
3637
|
+
var current_target = (
|
|
3638
|
+
/** @type {null | Element} */
|
|
3639
|
+
path[0] || event.target
|
|
3640
|
+
);
|
|
3641
|
+
last_propagated_event = event;
|
|
3642
|
+
var path_idx = 0;
|
|
3643
|
+
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
3644
|
+
if (handled_at) {
|
|
3645
|
+
var at_idx = path.indexOf(handled_at);
|
|
3646
|
+
if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
|
|
3647
|
+
window)) {
|
|
3648
|
+
event[event_symbol] = handler_element;
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
var handler_idx = path.indexOf(handler_element);
|
|
3652
|
+
if (handler_idx === -1) {
|
|
3653
|
+
return;
|
|
3654
|
+
}
|
|
3655
|
+
if (at_idx <= handler_idx) {
|
|
3656
|
+
path_idx = at_idx;
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
current_target = /** @type {Element} */
|
|
3660
|
+
path[path_idx] || event.target;
|
|
3661
|
+
if (current_target === handler_element) return;
|
|
3662
|
+
define_property(event, "currentTarget", {
|
|
3663
|
+
configurable: true,
|
|
3664
|
+
get() {
|
|
3665
|
+
return current_target || owner_document;
|
|
3666
|
+
}
|
|
3667
|
+
});
|
|
3668
|
+
var previous_reaction = active_reaction;
|
|
3669
|
+
var previous_effect = active_effect;
|
|
3670
|
+
set_active_reaction(null);
|
|
3671
|
+
set_active_effect(null);
|
|
3672
|
+
try {
|
|
3673
|
+
var throw_error;
|
|
3674
|
+
var other_errors = [];
|
|
3675
|
+
while (current_target !== null) {
|
|
3676
|
+
var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
|
|
3677
|
+
current_target.host || null;
|
|
3678
|
+
try {
|
|
3679
|
+
var delegated = current_target[event_symbol]?.[event_name];
|
|
3680
|
+
if (delegated != null && (!/** @type {any} */
|
|
3681
|
+
current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
3682
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
3683
|
+
event.target === current_target)) {
|
|
3684
|
+
delegated.call(current_target, event);
|
|
3685
|
+
}
|
|
3686
|
+
} catch (error) {
|
|
3687
|
+
if (throw_error) {
|
|
3688
|
+
other_errors.push(error);
|
|
3689
|
+
} else {
|
|
3690
|
+
throw_error = error;
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
|
|
3694
|
+
break;
|
|
3695
|
+
}
|
|
3696
|
+
current_target = parent_element;
|
|
3697
|
+
}
|
|
3698
|
+
if (throw_error) {
|
|
3699
|
+
for (let error of other_errors) {
|
|
3700
|
+
queueMicrotask(() => {
|
|
3701
|
+
throw error;
|
|
3702
|
+
});
|
|
3703
|
+
}
|
|
3704
|
+
throw throw_error;
|
|
3705
|
+
}
|
|
3706
|
+
} finally {
|
|
3707
|
+
event[event_symbol] = handler_element;
|
|
3708
|
+
delete event.currentTarget;
|
|
3709
|
+
set_active_reaction(previous_reaction);
|
|
3710
|
+
set_active_effect(previous_effect);
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
function assign_nodes(start, end) {
|
|
3714
|
+
var effect = (
|
|
3715
|
+
/** @type {Effect} */
|
|
3716
|
+
active_effect
|
|
3717
|
+
);
|
|
3718
|
+
if (effect.nodes === null) {
|
|
3719
|
+
effect.nodes = { start, end, a: null, t: null };
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
function mount(component, options) {
|
|
3723
|
+
return _mount(component, options);
|
|
3724
|
+
}
|
|
3725
|
+
function hydrate(component, options) {
|
|
3726
|
+
init_operations();
|
|
3727
|
+
options.intro = options.intro ?? false;
|
|
3728
|
+
const target = options.target;
|
|
3729
|
+
const was_hydrating = hydrating;
|
|
3730
|
+
const previous_hydrate_node = hydrate_node;
|
|
3731
|
+
try {
|
|
3732
|
+
var anchor = /* @__PURE__ */ get_first_child(target);
|
|
3733
|
+
while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
|
3734
|
+
anchor.data !== HYDRATION_START)) {
|
|
3735
|
+
anchor = /* @__PURE__ */ get_next_sibling(anchor);
|
|
3736
|
+
}
|
|
3737
|
+
if (!anchor) {
|
|
3738
|
+
throw HYDRATION_ERROR;
|
|
3739
|
+
}
|
|
3740
|
+
set_hydrating(true);
|
|
3741
|
+
set_hydrate_node(
|
|
3742
|
+
/** @type {Comment} */
|
|
3743
|
+
anchor
|
|
3744
|
+
);
|
|
3745
|
+
const instance = _mount(component, { ...options, anchor });
|
|
3746
|
+
set_hydrating(false);
|
|
3747
|
+
return (
|
|
3748
|
+
/** @type {Exports} */
|
|
3749
|
+
instance
|
|
3750
|
+
);
|
|
3751
|
+
} catch (error) {
|
|
3752
|
+
if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
|
|
3753
|
+
throw error;
|
|
3754
|
+
}
|
|
3755
|
+
if (error !== HYDRATION_ERROR) {
|
|
3756
|
+
console.warn("Failed to hydrate: ", error);
|
|
3757
|
+
}
|
|
3758
|
+
if (options.recover === false) {
|
|
3759
|
+
hydration_failed();
|
|
3760
|
+
}
|
|
3761
|
+
init_operations();
|
|
3762
|
+
clear_text_content(target);
|
|
3763
|
+
set_hydrating(false);
|
|
3764
|
+
return mount(component, options);
|
|
3765
|
+
} finally {
|
|
3766
|
+
set_hydrating(was_hydrating);
|
|
3767
|
+
set_hydrate_node(previous_hydrate_node);
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
3771
|
+
function _mount(Component, { target, anchor, props = {}, events, context, intro = true, transformError }) {
|
|
3772
|
+
init_operations();
|
|
3773
|
+
var component = void 0;
|
|
3774
|
+
var unmount2 = component_root(() => {
|
|
3775
|
+
var anchor_node = anchor ?? target.appendChild(create_text());
|
|
3776
|
+
boundary(
|
|
3777
|
+
/** @type {TemplateNode} */
|
|
3778
|
+
anchor_node,
|
|
3779
|
+
{
|
|
3780
|
+
pending: () => {
|
|
3781
|
+
}
|
|
3782
|
+
},
|
|
3783
|
+
(anchor_node2) => {
|
|
3784
|
+
push({});
|
|
3785
|
+
var ctx = (
|
|
3786
|
+
/** @type {ComponentContext} */
|
|
3787
|
+
component_context
|
|
3788
|
+
);
|
|
3789
|
+
if (context) ctx.c = context;
|
|
3790
|
+
if (events) {
|
|
3791
|
+
props.$$events = events;
|
|
3792
|
+
}
|
|
3793
|
+
if (hydrating) {
|
|
3794
|
+
assign_nodes(
|
|
3795
|
+
/** @type {TemplateNode} */
|
|
3796
|
+
anchor_node2,
|
|
3797
|
+
null
|
|
3798
|
+
);
|
|
3799
|
+
}
|
|
3800
|
+
component = Component(anchor_node2, props) || {};
|
|
3801
|
+
if (hydrating) {
|
|
3802
|
+
active_effect.nodes.end = hydrate_node;
|
|
3803
|
+
if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
|
3804
|
+
hydrate_node.data !== HYDRATION_END) {
|
|
3805
|
+
hydration_mismatch();
|
|
3806
|
+
throw HYDRATION_ERROR;
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
pop();
|
|
3810
|
+
},
|
|
3811
|
+
transformError
|
|
3812
|
+
);
|
|
3813
|
+
var registered_events = /* @__PURE__ */ new Set();
|
|
3814
|
+
var event_handle = (events2) => {
|
|
3815
|
+
for (var i = 0; i < events2.length; i++) {
|
|
3816
|
+
var event_name = events2[i];
|
|
3817
|
+
if (registered_events.has(event_name)) continue;
|
|
3818
|
+
registered_events.add(event_name);
|
|
3819
|
+
var passive = is_passive_event(event_name);
|
|
3820
|
+
for (const node of [target, document]) {
|
|
3821
|
+
var counts = listeners.get(node);
|
|
3822
|
+
if (counts === void 0) {
|
|
3823
|
+
counts = /* @__PURE__ */ new Map();
|
|
3824
|
+
listeners.set(node, counts);
|
|
3825
|
+
}
|
|
3826
|
+
var count = counts.get(event_name);
|
|
3827
|
+
if (count === void 0) {
|
|
3828
|
+
node.addEventListener(event_name, handle_event_propagation, { passive });
|
|
3829
|
+
counts.set(event_name, 1);
|
|
3830
|
+
} else {
|
|
3831
|
+
counts.set(event_name, count + 1);
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
};
|
|
3836
|
+
event_handle(array_from(all_registered_events));
|
|
3837
|
+
root_event_handles.add(event_handle);
|
|
3838
|
+
return () => {
|
|
3839
|
+
for (var event_name of registered_events) {
|
|
3840
|
+
for (const node of [target, document]) {
|
|
3841
|
+
var counts = (
|
|
3842
|
+
/** @type {Map<string, number>} */
|
|
3843
|
+
listeners.get(node)
|
|
3844
|
+
);
|
|
3845
|
+
var count = (
|
|
3846
|
+
/** @type {number} */
|
|
3847
|
+
counts.get(event_name)
|
|
3848
|
+
);
|
|
3849
|
+
if (--count == 0) {
|
|
3850
|
+
node.removeEventListener(event_name, handle_event_propagation);
|
|
3851
|
+
counts.delete(event_name);
|
|
3852
|
+
if (counts.size === 0) {
|
|
3853
|
+
listeners.delete(node);
|
|
3854
|
+
}
|
|
3855
|
+
} else {
|
|
3856
|
+
counts.set(event_name, count);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3890
3859
|
}
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3860
|
+
root_event_handles.delete(event_handle);
|
|
3861
|
+
if (anchor_node !== anchor) {
|
|
3862
|
+
anchor_node.parentNode?.removeChild(anchor_node);
|
|
3863
|
+
}
|
|
3864
|
+
};
|
|
3865
|
+
});
|
|
3866
|
+
mounted_components.set(component, unmount2);
|
|
3867
|
+
return component;
|
|
3895
3868
|
}
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3869
|
+
let mounted_components = /* @__PURE__ */ new WeakMap();
|
|
3870
|
+
function unmount(component, options) {
|
|
3871
|
+
const fn = mounted_components.get(component);
|
|
3872
|
+
if (fn) {
|
|
3873
|
+
mounted_components.delete(component);
|
|
3874
|
+
return fn(options);
|
|
3899
3875
|
}
|
|
3900
|
-
return
|
|
3901
|
-
/** @type {Component<Props>} */
|
|
3902
|
-
component,
|
|
3903
|
-
options
|
|
3904
|
-
);
|
|
3876
|
+
return Promise.resolve();
|
|
3905
3877
|
}
|
|
3906
|
-
function
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
attrs.class = to_class(attrs.class, css_hash, classes);
|
|
3915
|
-
}
|
|
3916
|
-
let attr_str = "";
|
|
3917
|
-
let name;
|
|
3918
|
-
const is_html = (flags2 & ELEMENT_IS_NAMESPACED) === 0;
|
|
3919
|
-
const lowercase = (flags2 & ELEMENT_PRESERVE_ATTRIBUTE_CASE) === 0;
|
|
3920
|
-
const is_input = (flags2 & ELEMENT_IS_INPUT) !== 0;
|
|
3921
|
-
for (name of Object.keys(attrs)) {
|
|
3922
|
-
if (typeof attrs[name] === "function") continue;
|
|
3923
|
-
if (name[0] === "$" && name[1] === "$") continue;
|
|
3924
|
-
if (INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
|
|
3925
|
-
var value = attrs[name];
|
|
3926
|
-
var lower = name.toLowerCase();
|
|
3927
|
-
if (lowercase) name = lower;
|
|
3928
|
-
if (lower.length > 2 && lower.startsWith("on")) continue;
|
|
3929
|
-
if (is_input) {
|
|
3930
|
-
if (name === "defaultvalue" || name === "defaultchecked") {
|
|
3931
|
-
name = name === "defaultvalue" ? "value" : "checked";
|
|
3932
|
-
if (attrs[name]) continue;
|
|
3933
|
-
}
|
|
3878
|
+
function asClassComponent$1(component) {
|
|
3879
|
+
return class extends Svelte4Component {
|
|
3880
|
+
/** @param {any} options */
|
|
3881
|
+
constructor(options) {
|
|
3882
|
+
super({
|
|
3883
|
+
component,
|
|
3884
|
+
...options
|
|
3885
|
+
});
|
|
3934
3886
|
}
|
|
3935
|
-
|
|
3936
|
-
}
|
|
3937
|
-
return attr_str;
|
|
3887
|
+
};
|
|
3938
3888
|
}
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3889
|
+
class Svelte4Component {
|
|
3890
|
+
/** @type {any} */
|
|
3891
|
+
#events;
|
|
3892
|
+
/** @type {Record<string, any>} */
|
|
3893
|
+
#instance;
|
|
3894
|
+
/**
|
|
3895
|
+
* @param {ComponentConstructorOptions & {
|
|
3896
|
+
* component: any;
|
|
3897
|
+
* }} options
|
|
3898
|
+
*/
|
|
3899
|
+
constructor(options) {
|
|
3900
|
+
var sources = /* @__PURE__ */ new Map();
|
|
3901
|
+
var add_source = (key, value) => {
|
|
3902
|
+
var s = /* @__PURE__ */ mutable_source(value, false, false);
|
|
3903
|
+
sources.set(key, s);
|
|
3904
|
+
return s;
|
|
3905
|
+
};
|
|
3906
|
+
const props = new Proxy(
|
|
3907
|
+
{ ...options.props || {}, $$events: {} },
|
|
3908
|
+
{
|
|
3909
|
+
get(target, prop) {
|
|
3910
|
+
return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
3911
|
+
},
|
|
3912
|
+
has(target, prop) {
|
|
3913
|
+
if (prop === LEGACY_PROPS) return true;
|
|
3914
|
+
get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
3915
|
+
return Reflect.has(target, prop);
|
|
3916
|
+
},
|
|
3917
|
+
set(target, prop, value) {
|
|
3918
|
+
set(sources.get(prop) ?? add_source(prop, value), value);
|
|
3919
|
+
return Reflect.set(target, prop, value);
|
|
3920
|
+
}
|
|
3951
3921
|
}
|
|
3922
|
+
);
|
|
3923
|
+
this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
|
|
3924
|
+
target: options.target,
|
|
3925
|
+
anchor: options.anchor,
|
|
3926
|
+
props,
|
|
3927
|
+
context: options.context,
|
|
3928
|
+
intro: options.intro ?? false,
|
|
3929
|
+
recover: options.recover,
|
|
3930
|
+
transformError: options.transformError
|
|
3931
|
+
});
|
|
3932
|
+
if (!options?.props?.$$host || options.sync === false) {
|
|
3933
|
+
flushSync();
|
|
3952
3934
|
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
slot_fn = $$props["children"];
|
|
3967
|
-
}
|
|
3968
|
-
if (slot_fn !== void 0) {
|
|
3969
|
-
slot_fn(renderer, slot_props);
|
|
3970
|
-
}
|
|
3971
|
-
}
|
|
3972
|
-
function rest_props(props, rest) {
|
|
3973
|
-
const rest_props2 = {};
|
|
3974
|
-
let key;
|
|
3975
|
-
for (key of Object.keys(props)) {
|
|
3976
|
-
if (!rest.includes(key)) {
|
|
3977
|
-
rest_props2[key] = props[key];
|
|
3935
|
+
this.#events = props.$$events;
|
|
3936
|
+
for (const key of Object.keys(this.#instance)) {
|
|
3937
|
+
if (key === "$set" || key === "$destroy" || key === "$on") continue;
|
|
3938
|
+
define_property(this, key, {
|
|
3939
|
+
get() {
|
|
3940
|
+
return this.#instance[key];
|
|
3941
|
+
},
|
|
3942
|
+
/** @param {any} value */
|
|
3943
|
+
set(value) {
|
|
3944
|
+
this.#instance[key] = value;
|
|
3945
|
+
},
|
|
3946
|
+
enumerable: true
|
|
3947
|
+
});
|
|
3978
3948
|
}
|
|
3949
|
+
this.#instance.$set = /** @param {Record<string, any>} next */
|
|
3950
|
+
(next2) => {
|
|
3951
|
+
Object.assign(props, next2);
|
|
3952
|
+
};
|
|
3953
|
+
this.#instance.$destroy = () => {
|
|
3954
|
+
unmount(this.#instance);
|
|
3955
|
+
};
|
|
3979
3956
|
}
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
const { children, $$slots, ...sanitized } = props;
|
|
3984
|
-
return sanitized;
|
|
3985
|
-
}
|
|
3986
|
-
function bind_props(props_parent, props_now) {
|
|
3987
|
-
for (const key of Object.keys(props_now)) {
|
|
3988
|
-
const initial_value = props_parent[key];
|
|
3989
|
-
const value = props_now[key];
|
|
3990
|
-
if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) {
|
|
3991
|
-
props_parent[key] = value;
|
|
3992
|
-
}
|
|
3957
|
+
/** @param {Record<string, any>} props */
|
|
3958
|
+
$set(props) {
|
|
3959
|
+
this.#instance.$set(props);
|
|
3993
3960
|
}
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3961
|
+
/**
|
|
3962
|
+
* @param {string} event
|
|
3963
|
+
* @param {(...args: any[]) => any} callback
|
|
3964
|
+
* @returns {any}
|
|
3965
|
+
*/
|
|
3966
|
+
$on(event, callback) {
|
|
3967
|
+
this.#events[event] = this.#events[event] || [];
|
|
3968
|
+
const cb = (...args) => callback.call(this, ...args);
|
|
3969
|
+
this.#events[event].push(cb);
|
|
3970
|
+
return () => {
|
|
3971
|
+
this.#events[event] = this.#events[event].filter(
|
|
3972
|
+
/** @param {any} fn */
|
|
3973
|
+
(fn) => fn !== cb
|
|
3974
|
+
);
|
|
3975
|
+
};
|
|
3976
|
+
}
|
|
3977
|
+
$destroy() {
|
|
3978
|
+
this.#instance.$destroy();
|
|
3998
3979
|
}
|
|
3999
|
-
return [];
|
|
4000
|
-
}
|
|
4001
|
-
function once(get_value) {
|
|
4002
|
-
let value = (
|
|
4003
|
-
/** @type {V} */
|
|
4004
|
-
UNINITIALIZED
|
|
4005
|
-
);
|
|
4006
|
-
return () => {
|
|
4007
|
-
if (value === UNINITIALIZED) {
|
|
4008
|
-
value = get_value();
|
|
4009
|
-
}
|
|
4010
|
-
return value;
|
|
4011
|
-
};
|
|
4012
|
-
}
|
|
4013
|
-
function props_id(renderer) {
|
|
4014
|
-
const uid2 = renderer.global.uid();
|
|
4015
|
-
renderer.push("<!--$" + uid2 + "-->");
|
|
4016
|
-
return uid2;
|
|
4017
|
-
}
|
|
4018
|
-
function derived(fn) {
|
|
4019
|
-
const get_value = ssr_context === null ? fn : once(fn);
|
|
4020
|
-
let updated_value;
|
|
4021
|
-
return function(new_value) {
|
|
4022
|
-
if (arguments.length === 0) {
|
|
4023
|
-
return updated_value ?? get_value();
|
|
4024
|
-
}
|
|
4025
|
-
updated_value = new_value;
|
|
4026
|
-
return updated_value;
|
|
4027
|
-
};
|
|
4028
3980
|
}
|
|
4029
3981
|
function asClassComponent(component) {
|
|
4030
3982
|
const component_constructor = asClassComponent$1(component);
|
|
@@ -4136,7 +4088,6 @@ function Root($$renderer, $$props) {
|
|
|
4136
4088
|
const root = asClassComponent(Root);
|
|
4137
4089
|
export {
|
|
4138
4090
|
ATTACHMENT_KEY as A,
|
|
4139
|
-
safe_not_equal as B,
|
|
4140
4091
|
attributes as a,
|
|
4141
4092
|
bind_props as b,
|
|
4142
4093
|
clsx as c,
|
|
@@ -4159,8 +4110,8 @@ export {
|
|
|
4159
4110
|
getAllContexts as t,
|
|
4160
4111
|
element as u,
|
|
4161
4112
|
ssr_context as v,
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4113
|
+
rest_props as w,
|
|
4114
|
+
fallback as x,
|
|
4115
|
+
noop as y,
|
|
4116
|
+
safe_not_equal as z
|
|
4166
4117
|
};
|