swayrouter 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +43 -0
- package/CHANGELOG.md +132 -0
- package/LICENSE +30 -0
- package/README.id.md +633 -0
- package/README.md +628 -0
- package/cli/cli.js +388 -0
- package/cli/package.json +4 -0
- package/cli/src/cli/commands/xaiVideo.js +280 -0
- package/cli/src/cli/tray/SwayAvatar.svg +20 -0
- package/cli/src/cli/tray/autostart.js +351 -0
- package/cli/src/cli/tray/icon.ico +0 -0
- package/cli/src/cli/tray/icon.png +0 -0
- package/cli/src/cli/tray/tray.js +258 -0
- package/cli/src/cli/tray/tray.ps1 +129 -0
- package/cli/src/cli/tray/trayHost.js +157 -0
- package/cli/src/cli/tray/trayWin.js +83 -0
- package/cli/src/cli/utils/display.js +123 -0
- package/cli/src/cli/utils/input.js +138 -0
- package/cli/src/runtime/discover.js +153 -0
- package/cli/src/runtime/lifecycle.js +333 -0
- package/cli/src/runtime/runMenu.js +250 -0
- package/cli/src/runtime/uiAdapters.js +12 -0
- package/cli/src/runtime/update.js +130 -0
- package/dashboard/dist/assets/CliTools-Ch3gKuNw.js +24 -0
- package/dashboard/dist/assets/Combo-BBCldjWi.js +1 -0
- package/dashboard/dist/assets/ConsoleLog-wywAYcPT.js +6 -0
- package/dashboard/dist/assets/Dashboard-DxzyF41b.js +1 -0
- package/dashboard/dist/assets/Header-C_9Su9BF.js +1 -0
- package/dashboard/dist/assets/Keys-D0ufgcsc.js +1 -0
- package/dashboard/dist/assets/Login-BeKpipS_.js +1 -0
- package/dashboard/dist/assets/ManageApiKey-CVXsmW2B.js +1 -0
- package/dashboard/dist/assets/OAuthCallback-D_UZYcF6.js +1 -0
- package/dashboard/dist/assets/Provider-BU7JfTqm.js +4 -0
- package/dashboard/dist/assets/ProviderModelAccordion-BAifkfVR.js +1 -0
- package/dashboard/dist/assets/Proxy-CU15VJ--.js +1 -0
- package/dashboard/dist/assets/QuotaMonitor-HzGK7bcc.js +1 -0
- package/dashboard/dist/assets/Settings-Dt4y2dC0.js +1 -0
- package/dashboard/dist/assets/Setup-DSDUwU7N.js +1 -0
- package/dashboard/dist/assets/StatusBadge-1nAOyHU2.js +1 -0
- package/dashboard/dist/assets/SwayChat-Bup7up6D.js +10 -0
- package/dashboard/dist/assets/Usage-eWnrPQ_v.js +4 -0
- package/dashboard/dist/assets/accordion-DOOPDDgt.js +1 -0
- package/dashboard/dist/assets/admin-extras-api-CCdu5TFM.js +1 -0
- package/dashboard/dist/assets/api-keys-api-ifAC2Ok3.js +1 -0
- package/dashboard/dist/assets/card-CC0Omjcv.js +1 -0
- package/dashboard/dist/assets/chatStudio-C0zPz_Z_.js +2 -0
- package/dashboard/dist/assets/checkbox-7SZBrmbN.js +1 -0
- package/dashboard/dist/assets/connections-api-_N54UD3S.js +1 -0
- package/dashboard/dist/assets/copy-button-qBvM6H9z.js +1 -0
- package/dashboard/dist/assets/currency-api-SV9CBf5e.js +1 -0
- package/dashboard/dist/assets/flip-button-BGgkjtl0.js +1 -0
- package/dashboard/dist/assets/frame-cUiti6Lq.js +1 -0
- package/dashboard/dist/assets/icons-vendor-CUx7SB5V.js +541 -0
- package/dashboard/dist/assets/index-B6j-9zHy.js +10 -0
- package/dashboard/dist/assets/index-C-_l0yYz.css +1 -0
- package/dashboard/dist/assets/live-mode-CHShLY4E.js +1 -0
- package/dashboard/dist/assets/markdown-vendor-BY8e1gQ8.js +29 -0
- package/dashboard/dist/assets/motion-vendor-g5fpGzmJ.js +9 -0
- package/dashboard/dist/assets/oauth-callback-CqYQzyd7.js +1 -0
- package/dashboard/dist/assets/query-vendor-DVevaSVS.js +1 -0
- package/dashboard/dist/assets/react-vendor-xnYrwzsL.js +61 -0
- package/dashboard/dist/assets/ripple-button-l8aMiVVG.js +1 -0
- package/dashboard/dist/assets/segmented-CqmEnQjZ.js +1 -0
- package/dashboard/dist/assets/select-D8pUtMXp.js +1 -0
- package/dashboard/dist/assets/skeleton-7uJDiIXe.js +1 -0
- package/dashboard/dist/assets/table-D0M60Tu1.js +1 -0
- package/dashboard/dist/assets/tabs-C6YkuulG.js +1 -0
- package/dashboard/dist/assets/tunnel-api-DDPsBaDV.js +1 -0
- package/dashboard/dist/assets/ui-vendor-BuM9f2NY.js +17 -0
- package/dashboard/dist/image2/SwayAvatar.svg +20 -0
- package/dashboard/dist/index.html +32 -0
- package/dashboard/dist/logo/avatar.svg +1 -0
- package/dashboard/dist/logo/sway.svg +20 -0
- package/dashboard/dist/logo/swaychat.svg +20 -0
- package/dashboard/dist/providers/SwayCustom.svg +19 -0
- package/dashboard/dist/providers/alicode.svg +12 -0
- package/dashboard/dist/providers/anthropic.svg +11 -0
- package/dashboard/dist/providers/antigravity.svg +3 -0
- package/dashboard/dist/providers/azure.svg +5 -0
- package/dashboard/dist/providers/baidu.svg +3 -0
- package/dashboard/dist/providers/blackbox.svg +5 -0
- package/dashboard/dist/providers/byteplus.svg +3 -0
- package/dashboard/dist/providers/cerebras.svg +4 -0
- package/dashboard/dist/providers/chutes.svg +4 -0
- package/dashboard/dist/providers/claude.svg +3 -0
- package/dashboard/dist/providers/cline.svg +11 -0
- package/dashboard/dist/providers/cloudflare-ai.svg +4 -0
- package/dashboard/dist/providers/codebuddy.svg +11 -0
- package/dashboard/dist/providers/codex.svg +10 -0
- package/dashboard/dist/providers/commandcode.svg +3 -0
- package/dashboard/dist/providers/cursor.svg +3 -0
- package/dashboard/dist/providers/deepseek.svg +10 -0
- package/dashboard/dist/providers/featherless.svg +3 -0
- package/dashboard/dist/providers/fireworks.svg +3 -0
- package/dashboard/dist/providers/gemini.svg +3 -0
- package/dashboard/dist/providers/geminicli.svg +11 -0
- package/dashboard/dist/providers/github.svg +3 -0
- package/dashboard/dist/providers/grok.svg +3 -0
- package/dashboard/dist/providers/groq.svg +3 -0
- package/dashboard/dist/providers/hermesagent.svg +1 -0
- package/dashboard/dist/providers/kilocode.svg +15 -0
- package/dashboard/dist/providers/kimchi.svg +3 -0
- package/dashboard/dist/providers/kimi.svg +4 -0
- package/dashboard/dist/providers/kiro.svg +10 -0
- package/dashboard/dist/providers/meta.svg +3 -0
- package/dashboard/dist/providers/mimo.svg +10 -0
- package/dashboard/dist/providers/minimax.svg +3 -0
- package/dashboard/dist/providers/mistral.svg +3 -0
- package/dashboard/dist/providers/morph.svg +3 -0
- package/dashboard/dist/providers/nebius.svg +4 -0
- package/dashboard/dist/providers/nvidia.svg +3 -0
- package/dashboard/dist/providers/ollama.svg +3 -0
- package/dashboard/dist/providers/omp.svg +5 -0
- package/dashboard/dist/providers/openai.svg +3 -0
- package/dashboard/dist/providers/opencode.svg +3 -0
- package/dashboard/dist/providers/openrouter.svg +3 -0
- package/dashboard/dist/providers/perplexity.svg +3 -0
- package/dashboard/dist/providers/poolside.svg +36 -0
- package/dashboard/dist/providers/qoder.svg +11 -0
- package/dashboard/dist/providers/sumopod.svg +3 -0
- package/dashboard/dist/providers/tencent.svg +5 -0
- package/dashboard/dist/providers/together.svg +12 -0
- package/dashboard/dist/providers/trae.svg +3 -0
- package/dashboard/dist/providers/venice.svg +4 -0
- package/dashboard/dist/providers/vercel.svg +3 -0
- package/dashboard/dist/providers/vertex.svg +17 -0
- package/dashboard/dist/providers/windsurf.svg +10 -0
- package/dashboard/dist/providers/zai.svg +3 -0
- package/dashboard/tsconfig.json +13 -0
- package/package.json +87 -0
- package/src/config/appConstants.js +153 -0
- package/src/config/defaultThinkingSignature.js +7 -0
- package/src/config/errorConfig.js +117 -0
- package/src/config/grokCli.js +9 -0
- package/src/config/kiroConstants.js +235 -0
- package/src/config/mediaConfig.js +20 -0
- package/src/config/ollamaModels.js +18 -0
- package/src/config/providerModels.js +109 -0
- package/src/config/providers.js +17 -0
- package/src/config/runtimeConfig.js +84 -0
- package/src/dashboardGuard.js +254 -0
- package/src/executors/antigravity.js +389 -0
- package/src/executors/azure.js +49 -0
- package/src/executors/base.js +225 -0
- package/src/executors/codebuddy-cn.js +23 -0
- package/src/executors/codebuddy-intl.js +60 -0
- package/src/executors/codex.js +436 -0
- package/src/executors/commandcode.js +83 -0
- package/src/executors/cursor.js +1075 -0
- package/src/executors/default.js +294 -0
- package/src/executors/gemini-cli.js +88 -0
- package/src/executors/github.js +393 -0
- package/src/executors/grok-cli.js +510 -0
- package/src/executors/grok-web.js +342 -0
- package/src/executors/index.js +86 -0
- package/src/executors/kimchi.js +116 -0
- package/src/executors/kiro.js +1155 -0
- package/src/executors/ollama-local.js +14 -0
- package/src/executors/opencode-go.js +47 -0
- package/src/executors/opencode.js +31 -0
- package/src/executors/qoder.js +433 -0
- package/src/executors/trae.js +318 -0
- package/src/executors/vertex.js +151 -0
- package/src/executors/windsurf.js +555 -0
- package/src/executors/xiaomi-tokenplan.js +16 -0
- package/src/handlers/chatCore/nonStreamingHandler.js +370 -0
- package/src/handlers/chatCore/requestDetail.js +130 -0
- package/src/handlers/chatCore/sseToJsonHandler.js +318 -0
- package/src/handlers/chatCore/streamingHandler.js +250 -0
- package/src/handlers/chatCore.js +652 -0
- package/src/lib/auth/dashboardSession.js +83 -0
- package/src/lib/auth/loginLimiter.js +99 -0
- package/src/lib/cache/ttlCache.js +153 -0
- package/src/lib/consoleLogBuffer.js +127 -0
- package/src/lib/dataDir.js +45 -0
- package/src/lib/db/adapters/betterSqliteAdapter.js +36 -0
- package/src/lib/db/adapters/bunSqliteAdapter.js +47 -0
- package/src/lib/db/adapters/nodeSqliteAdapter.js +65 -0
- package/src/lib/db/adapters/runtimeHelpers.js +23 -0
- package/src/lib/db/adapters/sqljsAdapter.js +103 -0
- package/src/lib/db/backup.js +75 -0
- package/src/lib/db/driver.js +110 -0
- package/src/lib/db/helpers/jsonCol.js +18 -0
- package/src/lib/db/helpers/kvStore.js +48 -0
- package/src/lib/db/helpers/metaStore.js +32 -0
- package/src/lib/db/index.js +473 -0
- package/src/lib/db/migrate.js +267 -0
- package/src/lib/db/migrations/001-initial.js +12 -0
- package/src/lib/db/migrations/002-prune-headroom-pxpipe-settings.js +32 -0
- package/src/lib/db/migrations/004-request-details-trace-id.js +12 -0
- package/src/lib/db/migrations/005-request-details-payload-capture.js +11 -0
- package/src/lib/db/migrations/007-headroom-readd-settings.js +35 -0
- package/src/lib/db/migrations/008-account-model-locks.js +22 -0
- package/src/lib/db/migrations/009-warp-pool-lifecycle.js +5 -0
- package/src/lib/db/migrations/010-api-key-file-permissions.js +7 -0
- package/src/lib/db/migrations/011-remove-upstream-user-agent-profile.js +41 -0
- package/src/lib/db/migrations/012-remove-headroom-settings.js +33 -0
- package/src/lib/db/migrations/013-default-fill-first-routing.js +20 -0
- package/src/lib/db/migrations/014-normalize-fill-first-routing.js +37 -0
- package/src/lib/db/migrations/015-remove-ip-ban-tables.js +8 -0
- package/src/lib/db/migrations/016-prune-legacy-codebuddy-intl-models.js +25 -0
- package/src/lib/db/migrations/index.js +20 -0
- package/src/lib/db/nineRouterMigration.js +785 -0
- package/src/lib/db/paths.js +23 -0
- package/src/lib/db/repos/accountModelLocksRepo.js +74 -0
- package/src/lib/db/repos/aliasRepo.js +108 -0
- package/src/lib/db/repos/apiKeysRepo.js +204 -0
- package/src/lib/db/repos/combosRepo.js +85 -0
- package/src/lib/db/repos/connectionsRepo.js +522 -0
- package/src/lib/db/repos/disabledModelsRepo.js +63 -0
- package/src/lib/db/repos/nodesRepo.js +127 -0
- package/src/lib/db/repos/pricingRepo.js +108 -0
- package/src/lib/db/repos/proxyPoolsRepo.js +104 -0
- package/src/lib/db/repos/requestDetailsRepo.js +345 -0
- package/src/lib/db/repos/settingsRepo.js +135 -0
- package/src/lib/db/repos/usageRepo.js +1335 -0
- package/src/lib/db/schema.js +179 -0
- package/src/lib/db/version.js +32 -0
- package/src/lib/db/writeBehind.js +174 -0
- package/src/lib/disabledModelsDb.js +3 -0
- package/src/lib/env.ts +175 -0
- package/src/lib/errors/publicError.js +18 -0
- package/src/lib/grokBuildConfig.js +243 -0
- package/src/lib/guardRequest.js +51 -0
- package/src/lib/localDb.js +21 -0
- package/src/lib/mcp/stdioSseBridge.js +174 -0
- package/src/lib/network/connectionProxy.js +200 -0
- package/src/lib/network/proxyTest.js +158 -0
- package/src/lib/network/proxyUrl.js +76 -0
- package/src/lib/network/relay.js +71 -0
- package/src/lib/oauth/constants/oauth.js +152 -0
- package/src/lib/oauth/constants/xai.js +43 -0
- package/src/lib/oauth/kiroExternalIdp.js +167 -0
- package/src/lib/oauth/providerHelpers.js +90 -0
- package/src/lib/oauth/providers/_shared.js +12 -0
- package/src/lib/oauth/providers/antigravity.js +126 -0
- package/src/lib/oauth/providers/claude.js +60 -0
- package/src/lib/oauth/providers/cline.js +62 -0
- package/src/lib/oauth/providers/clinepass.js +62 -0
- package/src/lib/oauth/providers/codebuddy-cn.js +75 -0
- package/src/lib/oauth/providers/codebuddy-intl.js +73 -0
- package/src/lib/oauth/providers/codex.js +72 -0
- package/src/lib/oauth/providers/cursor.js +18 -0
- package/src/lib/oauth/providers/gemini-cli.js +84 -0
- package/src/lib/oauth/providers/github.js +96 -0
- package/src/lib/oauth/providers/grok-cli.js +123 -0
- package/src/lib/oauth/providers/index.js +233 -0
- package/src/lib/oauth/providers/kilocode.js +60 -0
- package/src/lib/oauth/providers/kimchi.js +79 -0
- package/src/lib/oauth/providers/kimi.js +79 -0
- package/src/lib/oauth/providers/kiro.js +147 -0
- package/src/lib/oauth/providers/qoder.js +90 -0
- package/src/lib/oauth/providers/trae.js +244 -0
- package/src/lib/oauth/providers/windsurf.js +123 -0
- package/src/lib/oauth/providers/xai.js +95 -0
- package/src/lib/oauth/providers.js +16 -0
- package/src/lib/oauth/services/cursor.js +132 -0
- package/src/lib/oauth/services/kiro.js +351 -0
- package/src/lib/oauth/services/oauth.js +135 -0
- package/src/lib/oauth/services/qoder.js +151 -0
- package/src/lib/oauth/services/xai.js +204 -0
- package/src/lib/oauth/utils/ideDetect.js +55 -0
- package/src/lib/oauth/utils/pkce.js +25 -0
- package/src/lib/oauth/utils/server.js +732 -0
- package/src/lib/oauth/utils/ui.js +43 -0
- package/src/lib/providerNormalization.js +40 -0
- package/src/lib/qoder/constants.js +1 -0
- package/src/lib/requestDetailsDb.js +3 -0
- package/src/lib/resourceProfile.ts +124 -0
- package/src/lib/runtimeSecrets.ts +130 -0
- package/src/lib/security/payloadCapture.js +87 -0
- package/src/lib/tunnel/cloudflare/cloudflared.js +436 -0
- package/src/lib/tunnel/cloudflare/config.js +8 -0
- package/src/lib/tunnel/cloudflare/healthCheck.js +37 -0
- package/src/lib/tunnel/cloudflare/manager.js +149 -0
- package/src/lib/tunnel/cloudflare/pid.js +31 -0
- package/src/lib/tunnel/cloudflare/publicUrl.js +41 -0
- package/src/lib/tunnel/cloudflare/requirements.js +12 -0
- package/src/lib/tunnel/index.js +26 -0
- package/src/lib/tunnel/shared/dnsResolver.js +16 -0
- package/src/lib/tunnel/shared/internetCheck.js +30 -0
- package/src/lib/tunnel/shared/state.js +45 -0
- package/src/lib/tunnel/shared/watchdogConfig.js +6 -0
- package/src/lib/update/installer.js +52 -0
- package/src/lib/update/version.js +116 -0
- package/src/lib/usageDb.js +6 -0
- package/src/lib/usageRefresh.js +88 -0
- package/src/lifecycle/appLifecycle.ts +99 -0
- package/src/models.js +36 -0
- package/src/next/headers.js +12 -0
- package/src/next/server.js +74 -0
- package/src/observability/metrics.js +439 -0
- package/src/observability/tracing.js +107 -0
- package/src/open-sse-index.js +70 -0
- package/src/providers/capabilities.js +299 -0
- package/src/providers/display.ts +142 -0
- package/src/providers/index.js +27 -0
- package/src/providers/models/helpers.js +19 -0
- package/src/providers/models/namePatterns.js +27 -0
- package/src/providers/models/schema.js +32 -0
- package/src/providers/pricing.js +248 -0
- package/src/providers/registry/agentrouter.js +52 -0
- package/src/providers/registry/alicode-intl.js +32 -0
- package/src/providers/registry/alicode.js +33 -0
- package/src/providers/registry/alims-intl.js +30 -0
- package/src/providers/registry/anthropic.js +29 -0
- package/src/providers/registry/antigravity.js +139 -0
- package/src/providers/registry/azure.js +23 -0
- package/src/providers/registry/baidu.js +35 -0
- package/src/providers/registry/blackbox.js +41 -0
- package/src/providers/registry/byteplus.js +36 -0
- package/src/providers/registry/cerebras.js +33 -0
- package/src/providers/registry/chutes.js +26 -0
- package/src/providers/registry/claude.js +80 -0
- package/src/providers/registry/cline.js +53 -0
- package/src/providers/registry/clinepass.js +62 -0
- package/src/providers/registry/cloudflare-ai.js +84 -0
- package/src/providers/registry/codebuddy-cn.js +95 -0
- package/src/providers/registry/codebuddy-intl.js +91 -0
- package/src/providers/registry/codex.js +145 -0
- package/src/providers/registry/commandcode.js +45 -0
- package/src/providers/registry/cursor.js +61 -0
- package/src/providers/registry/deepseek.js +55 -0
- package/src/providers/registry/featherless.js +36 -0
- package/src/providers/registry/fireworks.js +34 -0
- package/src/providers/registry/gemini-cli.js +59 -0
- package/src/providers/registry/gemini.js +76 -0
- package/src/providers/registry/github.js +131 -0
- package/src/providers/registry/glm-cn.js +35 -0
- package/src/providers/registry/glm.js +58 -0
- package/src/providers/registry/grok-cli.js +87 -0
- package/src/providers/registry/grok-web.js +41 -0
- package/src/providers/registry/groq.js +38 -0
- package/src/providers/registry/index.js +77 -0
- package/src/providers/registry/kilo-gateway.js +34 -0
- package/src/providers/registry/kilocode.js +48 -0
- package/src/providers/registry/kimchi.js +49 -0
- package/src/providers/registry/kimi.js +82 -0
- package/src/providers/registry/kiro.js +132 -0
- package/src/providers/registry/meta.js +34 -0
- package/src/providers/registry/minimax-cn.js +90 -0
- package/src/providers/registry/minimax.js +90 -0
- package/src/providers/registry/mistral.js +36 -0
- package/src/providers/registry/morph.js +31 -0
- package/src/providers/registry/nebius.js +26 -0
- package/src/providers/registry/nvidia.js +55 -0
- package/src/providers/registry/ollama-local.js +18 -0
- package/src/providers/registry/ollama.js +38 -0
- package/src/providers/registry/openai.js +114 -0
- package/src/providers/registry/opencode-go.js +41 -0
- package/src/providers/registry/opencode.js +26 -0
- package/src/providers/registry/openrouter.js +36 -0
- package/src/providers/registry/perplexity.js +56 -0
- package/src/providers/registry/poolside.js +30 -0
- package/src/providers/registry/qoder.js +58 -0
- package/src/providers/registry/sumopod.js +84 -0
- package/src/providers/registry/tencent.js +29 -0
- package/src/providers/registry/together.js +38 -0
- package/src/providers/registry/trae.js +71 -0
- package/src/providers/registry/venice.js +69 -0
- package/src/providers/registry/vercel-ai-gateway.js +37 -0
- package/src/providers/registry/vertex-partner.js +31 -0
- package/src/providers/registry/vertex.js +33 -0
- package/src/providers/registry/windsurf.js +129 -0
- package/src/providers/registry/xai.js +46 -0
- package/src/providers/registry/xiaomi-mimo.js +66 -0
- package/src/providers/registry/xiaomi-tokenplan.js +58 -0
- package/src/providers/registryEntry.js +3 -0
- package/src/providers/schema.js +33 -0
- package/src/providers/shared.js +114 -0
- package/src/providers/thinkingLevels.js +49 -0
- package/src/routes/api/auth/login/route.js +82 -0
- package/src/routes/api/auth/logout/route.js +9 -0
- package/src/routes/api/auth/reset-password/route.js +12 -0
- package/src/routes/api/auth/status/route.js +33 -0
- package/src/routes/api/auth/verify-password/route.js +39 -0
- package/src/routes/api/chat/tools/curl/route.js +100 -0
- package/src/routes/api/chat/tools/router/route.js +215 -0
- package/src/routes/api/chat/tools/search/route.js +362 -0
- package/src/routes/api/chat/tools/shell/route.js +228 -0
- package/src/routes/api/cli-tools/all-statuses/route.js +37 -0
- package/src/routes/api/cli-tools/claude-settings/route.js +261 -0
- package/src/routes/api/cli-tools/codex-settings/route.js +220 -0
- package/src/routes/api/cli-tools/cowork-mcp-registry/route.js +80 -0
- package/src/routes/api/cli-tools/cowork-mcp-tools/route.js +96 -0
- package/src/routes/api/cli-tools/cowork-settings/route.js +380 -0
- package/src/routes/api/cli-tools/grok-build-settings/route.js +152 -0
- package/src/routes/api/cli-tools/hermes-settings/route.js +169 -0
- package/src/routes/api/cli-tools/kilo-settings/route.js +131 -0
- package/src/routes/api/cli-tools/model-mappings/route.js +43 -0
- package/src/routes/api/cli-tools/omp-settings/route.js +266 -0
- package/src/routes/api/cli-tools/opencode-settings/route.js +243 -0
- package/src/routes/api/combos/[id]/route.js +73 -0
- package/src/routes/api/combos/route.js +43 -0
- package/src/routes/api/health/live/route.js +7 -0
- package/src/routes/api/health/ready/route.js +19 -0
- package/src/routes/api/health/route.js +17 -0
- package/src/routes/api/inflight/stream/route.js +24 -0
- package/src/routes/api/init/route.js +3 -0
- package/src/routes/api/keys/[id]/route.js +71 -0
- package/src/routes/api/keys/route.js +41 -0
- package/src/routes/api/logs/route.js +19 -0
- package/src/routes/api/mcp/[plugin]/message/route.js +23 -0
- package/src/routes/api/mcp/[plugin]/sse/route.js +35 -0
- package/src/routes/api/models/availability/route.js +104 -0
- package/src/routes/api/models/custom/route.js +58 -0
- package/src/routes/api/models/disabled/route.js +47 -0
- package/src/routes/api/models/route.js +64 -0
- package/src/routes/api/models/test/ping.js +236 -0
- package/src/routes/api/models/test/route.js +14 -0
- package/src/routes/api/oauth/[provider]/[action]/route.js +491 -0
- package/src/routes/api/oauth/codex/bulk-import/route.js +105 -0
- package/src/routes/api/oauth/codex/import-token/route.js +82 -0
- package/src/routes/api/oauth/cursor/auto-import/route.js +250 -0
- package/src/routes/api/oauth/cursor/import/route.js +86 -0
- package/src/routes/api/oauth/kiro/api-key/route.js +60 -0
- package/src/routes/api/oauth/kiro/auto-import/route.js +120 -0
- package/src/routes/api/oauth/kiro/import/route.js +72 -0
- package/src/routes/api/oauth/kiro/import-cli-proxy/route.js +42 -0
- package/src/routes/api/oauth/kiro/social-authorize/route.js +40 -0
- package/src/routes/api/oauth/kiro/social-exchange/route.js +62 -0
- package/src/routes/api/pricing/route.js +96 -0
- package/src/routes/api/provider-nodes/[id]/route.js +106 -0
- package/src/routes/api/provider-nodes/route.js +110 -0
- package/src/routes/api/provider-nodes/validate/route.js +197 -0
- package/src/routes/api/providers/[id]/models/route.js +716 -0
- package/src/routes/api/providers/[id]/route.js +195 -0
- package/src/routes/api/providers/[id]/test/route.js +27 -0
- package/src/routes/api/providers/[id]/test/testUtils.js +912 -0
- package/src/routes/api/providers/[id]/test-models/route.js +211 -0
- package/src/routes/api/providers/catalog/route.js +58 -0
- package/src/routes/api/providers/client/route.js +133 -0
- package/src/routes/api/providers/counts/route.js +43 -0
- package/src/routes/api/providers/kilo/free-models/route.js +58 -0
- package/src/routes/api/providers/route.js +361 -0
- package/src/routes/api/providers/suggested-models/filters.js +24 -0
- package/src/routes/api/providers/suggested-models/route.js +34 -0
- package/src/routes/api/providers/test-batch/route.js +145 -0
- package/src/routes/api/providers/validate/route.js +633 -0
- package/src/routes/api/proxy-pools/[id]/route.js +129 -0
- package/src/routes/api/proxy-pools/[id]/test/route.js +64 -0
- package/src/routes/api/proxy-pools/cloudflare-deploy/route.js +183 -0
- package/src/routes/api/proxy-pools/route.js +85 -0
- package/src/routes/api/proxy-pools/vercel-deploy/route.js +181 -0
- package/src/routes/api/settings/currency/route.js +29 -0
- package/src/routes/api/settings/database/path/route.js +8 -0
- package/src/routes/api/settings/database/route.js +89 -0
- package/src/routes/api/settings/migrate-9router/route.js +81 -0
- package/src/routes/api/settings/require-login/route.js +14 -0
- package/src/routes/api/settings/route.js +186 -0
- package/src/routes/api/shutdown/route.js +25 -0
- package/src/routes/api/tags/route.js +17 -0
- package/src/routes/api/translator/console-logs/route.js +28 -0
- package/src/routes/api/translator/console-logs/stream/route.js +95 -0
- package/src/routes/api/tunnel/disable/route.js +18 -0
- package/src/routes/api/tunnel/enable/route.js +32 -0
- package/src/routes/api/tunnel/status/route.js +23 -0
- package/src/routes/api/update/route.js +42 -0
- package/src/routes/api/usage/[connectionId]/codex-reset-credits/route.js +169 -0
- package/src/routes/api/usage/[connectionId]/route.js +222 -0
- package/src/routes/api/usage/chart/route.js +27 -0
- package/src/routes/api/usage/history/route.js +94 -0
- package/src/routes/api/usage/logs/route.js +14 -0
- package/src/routes/api/usage/providers/route.js +36 -0
- package/src/routes/api/usage/request-details/route.js +61 -0
- package/src/routes/api/usage/request-logs/route.js +15 -0
- package/src/routes/api/usage/stats/route.js +23 -0
- package/src/routes/api/usage/stream/route.js +78 -0
- package/src/routes/api/v1/api/chat/route.js +36 -0
- package/src/routes/api/v1/chat/completions/route.js +28 -0
- package/src/routes/api/v1/images/edits/route.js +70 -0
- package/src/routes/api/v1/images/generations/route.js +50 -0
- package/src/routes/api/v1/images/imageValidation.js +45 -0
- package/src/routes/api/v1/messages/count_tokens/route.js +87 -0
- package/src/routes/api/v1/messages/route.js +26 -0
- package/src/routes/api/v1/models/route.js +440 -0
- package/src/routes/api/v1/responses/compact/route.js +34 -0
- package/src/routes/api/v1/responses/route.js +26 -0
- package/src/routes/api/v1/route.js +1 -0
- package/src/routes/api/version/route.js +11 -0
- package/src/routes/table.js +1141 -0
- package/src/rtk/applyFilter.js +13 -0
- package/src/rtk/autodetect.js +104 -0
- package/src/rtk/caveman.js +6 -0
- package/src/rtk/cavemanPrompts.js +107 -0
- package/src/rtk/constants.js +51 -0
- package/src/rtk/filters/buildOutput.js +120 -0
- package/src/rtk/filters/dedupLog.js +43 -0
- package/src/rtk/filters/find.js +47 -0
- package/src/rtk/filters/gitDiff.js +90 -0
- package/src/rtk/filters/gitLog.js +88 -0
- package/src/rtk/filters/gitStatus.js +101 -0
- package/src/rtk/filters/grep.js +45 -0
- package/src/rtk/filters/ls.js +73 -0
- package/src/rtk/filters/readNumbered.js +22 -0
- package/src/rtk/filters/searchList.js +49 -0
- package/src/rtk/filters/smartTruncate.js +13 -0
- package/src/rtk/filters/tree.js +28 -0
- package/src/rtk/index.js +143 -0
- package/src/rtk/ponytail.js +6 -0
- package/src/rtk/ponytailPrompt.js +49 -0
- package/src/rtk/systemInject.js +89 -0
- package/src/server.ts +474 -0
- package/src/services/accountFallback.js +241 -0
- package/src/services/accountPool.js +389 -0
- package/src/services/capacityAdapter.js +140 -0
- package/src/services/cliModelMapping.js +84 -0
- package/src/services/clinepassModels.js +60 -0
- package/src/services/codebuddyModels.js +250 -0
- package/src/services/combo.js +482 -0
- package/src/services/copilotModels.js +126 -0
- package/src/services/currencyRate.js +56 -0
- package/src/services/cursorModels.js +197 -0
- package/src/services/grokCliModels.js +130 -0
- package/src/services/kimchiModels.js +175 -0
- package/src/services/kiroModels.js +246 -0
- package/src/services/model.js +83 -0
- package/src/services/oauthCredentialManager.js +153 -0
- package/src/services/projectId.js +240 -0
- package/src/services/provider.js +145 -0
- package/src/services/qoderModels.js +274 -0
- package/src/services/tokenRefresh/dedup.js +70 -0
- package/src/services/tokenRefresh/providers.js +626 -0
- package/src/services/tokenRefresh.js +274 -0
- package/src/services/usage/claude.js +134 -0
- package/src/services/usage/codebuddy-cn.js +212 -0
- package/src/services/usage/codex.js +193 -0
- package/src/services/usage/deepseek.js +103 -0
- package/src/services/usage/github.js +94 -0
- package/src/services/usage/google.js +218 -0
- package/src/services/usage/grok-cli.js +368 -0
- package/src/services/usage/grokCliQuotaFrame.js +170 -0
- package/src/services/usage/kimi.js +185 -0
- package/src/services/usage/kiro.js +172 -0
- package/src/services/usage/minimax.js +215 -0
- package/src/services/usage/misc.js +264 -0
- package/src/services/usage/shared.js +59 -0
- package/src/services/usage.js +56 -0
- package/src/shared/clineAuth.js +37 -0
- package/src/shared/constants/config.js +80 -0
- package/src/shared/constants/coworkPlugins.js +69 -0
- package/src/shared/constants/models.js +41 -0
- package/src/shared/constants/providers.js +128 -0
- package/src/shared/constants/providersDisplay.js +1 -0
- package/src/shared/qoder/constants.js +50 -0
- package/src/shared/qoder/cosy.js +134 -0
- package/src/shared/qoder/encoding.js +36 -0
- package/src/shared/services/initializeApp.js +226 -0
- package/src/shared/services/quotaAutoPing.js +310 -0
- package/src/shared/utils/apiKey.js +65 -0
- package/src/shared/utils/clineAuth.js +1 -0
- package/src/shared/utils/index.js +3 -0
- package/src/shared/utils/machineId.js +60 -0
- package/src/shared/utils/ssrfGuard.js +280 -0
- package/src/sse/handlers/chat.js +426 -0
- package/src/sse/oauthLease.js +32 -0
- package/src/sse/recovery.js +235 -0
- package/src/sse/services/auth.js +489 -0
- package/src/sse/services/backgroundTokenRefresh.js +173 -0
- package/src/sse/services/model.js +129 -0
- package/src/sse/services/requestCancellation.js +4 -0
- package/src/sse/services/tokenRefresh.js +264 -0
- package/src/sse/utils/logger.js +142 -0
- package/src/staticServe.ts +95 -0
- package/src/transformer/streamToJsonConverter.js +87 -0
- package/src/translator/canonical.js +81 -0
- package/src/translator/concerns/chunk.js +9 -0
- package/src/translator/concerns/compatFallback.js +147 -0
- package/src/translator/concerns/finishReason.js +59 -0
- package/src/translator/concerns/image.js +105 -0
- package/src/translator/concerns/json.js +4 -0
- package/src/translator/concerns/kiroConversation.js +428 -0
- package/src/translator/concerns/message.js +5 -0
- package/src/translator/concerns/modality.js +134 -0
- package/src/translator/concerns/paramSupport.js +97 -0
- package/src/translator/concerns/prefetch.js +86 -0
- package/src/translator/concerns/reasoning.js +18 -0
- package/src/translator/concerns/thinking.js +40 -0
- package/src/translator/concerns/thinkingUnified.js +319 -0
- package/src/translator/concerns/toolCall.js +134 -0
- package/src/translator/concerns/usage.js +61 -0
- package/src/translator/detection.js +42 -0
- package/src/translator/formats/claude.js +323 -0
- package/src/translator/formats/gemini.js +366 -0
- package/src/translator/formats/maxTokens.js +19 -0
- package/src/translator/formats/openai.js +116 -0
- package/src/translator/formats/responsesApi.js +117 -0
- package/src/translator/formats.js +28 -0
- package/src/translator/index.js +237 -0
- package/src/translator/request/antigravity-to-openai.js +217 -0
- package/src/translator/request/claude-to-kiro.js +288 -0
- package/src/translator/request/claude-to-openai.js +199 -0
- package/src/translator/request/gemini-to-openai.js +142 -0
- package/src/translator/request/openai-responses.js +373 -0
- package/src/translator/request/openai-to-claude.js +260 -0
- package/src/translator/request/openai-to-commandcode.js +161 -0
- package/src/translator/request/openai-to-cursor.js +175 -0
- package/src/translator/request/openai-to-gemini.js +422 -0
- package/src/translator/request/openai-to-kiro.js +360 -0
- package/src/translator/request/openai-to-ollama.js +152 -0
- package/src/translator/request/openai-to-vertex.js +36 -0
- package/src/translator/response/claude-to-openai.js +185 -0
- package/src/translator/response/commandcode-to-openai.js +164 -0
- package/src/translator/response/cursor-to-openai.js +18 -0
- package/src/translator/response/gemini-to-openai.js +127 -0
- package/src/translator/response/kiro-to-claude.js +230 -0
- package/src/translator/response/kiro-to-openai.js +136 -0
- package/src/translator/response/ollama-to-openai.js +106 -0
- package/src/translator/response/openai-responses.js +534 -0
- package/src/translator/response/openai-to-antigravity.js +107 -0
- package/src/translator/response/openai-to-claude.js +231 -0
- package/src/translator/schema/blocks.js +40 -0
- package/src/translator/schema/defaults.js +3 -0
- package/src/translator/schema/finishReasons.js +22 -0
- package/src/translator/schema/index.js +7 -0
- package/src/translator/schema/roles.js +12 -0
- package/src/transport/requestBoundary.ts +223 -0
- package/src/transport/routerAdmission.ts +380 -0
- package/src/types/provider.ts +59 -0
- package/src/utils/bypassHandler.js +272 -0
- package/src/utils/claudeCloaking.js +10 -0
- package/src/utils/claudeSignature.js +35 -0
- package/src/utils/clientDetector.js +183 -0
- package/src/utils/cursorChecksum.js +104 -0
- package/src/utils/cursorProtobuf.js +801 -0
- package/src/utils/debugLog.js +12 -0
- package/src/utils/error.js +120 -0
- package/src/utils/inflight.js +127 -0
- package/src/utils/kiroSessionReplay.js +139 -0
- package/src/utils/ollamaTransform.js +83 -0
- package/src/utils/proxyFetch.js +308 -0
- package/src/utils/reasoningContentInjector.js +71 -0
- package/src/utils/requestLogger.js +272 -0
- package/src/utils/responsesStreamHelpers.js +46 -0
- package/src/utils/sessionManager.js +205 -0
- package/src/utils/sse.js +13 -0
- package/src/utils/sseConstants.js +21 -0
- package/src/utils/stream.js +511 -0
- package/src/utils/streamHandler.js +256 -0
- package/src/utils/streamHelpers.js +113 -0
- package/src/utils/toolDeduper.js +44 -0
- package/src/utils/usageTracking.js +329 -0
- package/tsconfig.json +45 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as v,j as J}from"./react-vendor-xnYrwzsL.js";const ln=v.createContext({});function At(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ko=typeof window<"u",de=Ko?v.useLayoutEffect:v.useEffect,pe=v.createContext(null);function un(t,e){t.indexOf(e)===-1&&t.push(e)}function se(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const tt=(t,e,n)=>n>e?e:n<t?t:n;let me=()=>{};const at={},ti=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ei=t=>typeof t=="object"&&t!==null,ni=t=>/^0[^.\s]+$/u.test(t);function si(t){let e;return()=>(e===void 0&&(e=t()),e)}const z=t=>t,Ut=(...t)=>t.reduce((e,n)=>s=>n(e(s))),Bt=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class cn{constructor(){this.subscriptions=[]}add(e){return un(this.subscriptions,e),()=>se(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const W=t=>t*1e3,$=t=>t/1e3,ii=(t,e)=>e?t*(1e3/e):0,oi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,$o=1e-7,zo=12;function Go(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=oi(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>$o&&++a<zo);return o}function Wt(t,e,n,s){if(t===e&&n===s)return z;const i=r=>Go(r,0,1,t,n);return r=>r===0||r===1?r:oi(i(r),e,s)}const ri=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ai=t=>e=>1-t(1-e),li=Wt(.33,1.53,.69,.99),hn=ai(li),ui=ri(hn),ci=t=>t>=1?1:(t*=2)<1?.5*hn(t):.5*(2-Math.pow(2,-10*(t-1))),fn=t=>1-Math.sin(Math.acos(t)),hi=ai(fn),fi=ri(fn),Ho=Wt(.42,0,1,1),_o=Wt(0,0,.58,1),di=Wt(.42,0,.58,1),Xo=t=>Array.isArray(t)&&typeof t[0]!="number",pi=t=>Array.isArray(t)&&typeof t[0]=="number",Yo={linear:z,easeIn:Ho,easeInOut:di,easeOut:_o,circIn:fn,circInOut:fi,circOut:hi,backIn:hn,backInOut:ui,backOut:li,anticipate:ci},qo=t=>typeof t=="string",Fn=t=>{if(pi(t)){me(t.length===4);const[e,n,s,i]=t;return Wt(e,n,s,i)}else if(qo(t))return Yo[t];return t},zt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zo(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){r.has(c)&&(l.schedule(c),t()),c(o)}const l={schedule:(c,u=!1,h=!1)=>{const d=h&&s?e:n;return u&&r.add(c),d.add(c),c},cancel:c=>{n.delete(c),r.delete(c)},process:c=>{if(o=c,s){i=!0;return}s=!0;const u=e;e=n,n=u,e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const Jo=40;function mi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=zt.reduce((x,T)=>(x[T]=Zo(r),x),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:p}=o,g=()=>{const x=at.useManualTiming,T=x?i.timestamp:performance.now();n=!1,x||(i.delta=s?1e3/60:Math.max(Math.min(T-i.timestamp,Jo),1)),i.timestamp=T,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},m=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:zt.reduce((x,T)=>{const b=o[T];return x[T]=(M,V=!1,P=!1)=>(n||m(),b.schedule(M,V,P)),x},{}),cancel:x=>{for(let T=0;T<zt.length;T++)o[zt[T]].cancel(x)},state:i,steps:o}}const{schedule:D,cancel:it,state:j,steps:Te}=mi(typeof requestAnimationFrame<"u"?requestAnimationFrame:z,!0);let Yt;function Qo(){Yt=void 0}const N={now:()=>(Yt===void 0&&N.set(j.isProcessing||at.useManualTiming?j.timestamp:performance.now()),Yt),set:t=>{Yt=t,queueMicrotask(Qo)}},gi=t=>e=>typeof e=="string"&&e.startsWith(t),yi=gi("--"),tr=gi("var(--"),dn=t=>tr(t)?er.test(t.split("/*")[0].trim()):!1,er=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function On(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const bt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft={...bt,transform:t=>tt(0,1,t)},Gt={...bt,default:1},Et=t=>Math.round(t*1e5)/1e5,pn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function nr(t){return t==null}const sr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mn=(t,e)=>n=>!!(typeof n=="string"&&sr.test(n)&&n.startsWith(t)||e&&!nr(n)&&Object.prototype.hasOwnProperty.call(n,e)),vi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(pn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ir=t=>tt(0,255,t),we={...bt,transform:t=>Math.round(ir(t))},ft={test:mn("rgb","red"),parse:vi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+we.transform(t)+", "+we.transform(e)+", "+we.transform(n)+", "+Et(Ft.transform(s))+")"};function or(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Oe={test:mn("#"),parse:or,transform:ft.transform},Kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=Kt("deg"),Q=Kt("%"),S=Kt("px"),rr=Kt("vh"),ar=Kt("vw"),jn={...Q,parse:t=>Q.parse(t)/100,transform:t=>Q.transform(t*100)},Tt={test:mn("hsl","hue"),parse:vi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Q.transform(Et(e))+", "+Q.transform(Et(n))+", "+Et(Ft.transform(s))+")"},k={test:t=>ft.test(t)||Oe.test(t)||Tt.test(t),parse:t=>ft.test(t)?ft.parse(t):Tt.test(t)?Tt.parse(t):Oe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ft.transform(t):Tt.transform(t),getAnimatableNone:t=>{const e=k.parse(t);return e.alpha=0,k.transform(e)}},lr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ur(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(pn))==null?void 0:e.length)||0)+(((n=t.match(lr))==null?void 0:n.length)||0)>0}const xi="number",Ti="color",cr="var",hr="var(",Nn="${}",fr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(fr,l=>(k.test(l)?(s.color.push(r),i.push(Ti),n.push(k.parse(l))):l.startsWith(hr)?(s.var.push(r),i.push(cr),n.push(l)):(s.number.push(r),i.push(xi),n.push(parseFloat(l))),++r,Nn)).split(Nn);return{values:n,split:a,indexes:s,types:i}}function dr(t){return Pt(t).values}function wi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===xi?i+=Et(s[r]):o===Ti?i+=k.transform(s[r]):i+=s[r]}return i}}function pr(t){return wi(Pt(t))}const mr=t=>typeof t=="number"?0:k.test(t)?k.getAnimatableNone(t):t,gr=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:mr(t);function yr(t){const e=Pt(t);return wi(e)(e.values.map((s,i)=>gr(s,e.split[i])))}const _={test:ur,parse:dr,createTransformer:pr,getAnimatableNone:yr};function Se(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function vr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Se(l,a,t+1/3),r=Se(l,a,t),o=Se(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function ie(t,e){return n=>n>0?e:t}const E=(t,e,n)=>t+(e-t)*n,Pe=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},xr=[Oe,ft,Tt],Tr=t=>xr.find(e=>e.test(t));function Un(t){const e=Tr(t);if(!e)return!1;let n=e.parse(t);return e===Tt&&(n=vr(n)),n}const Wn=(t,e)=>{const n=Un(t),s=Un(e);if(!n||!s)return ie(t,e);const i={...n};return r=>(i.red=Pe(n.red,s.red,r),i.green=Pe(n.green,s.green,r),i.blue=Pe(n.blue,s.blue,r),i.alpha=E(n.alpha,s.alpha,r),ft.transform(i))},je=new Set(["none","hidden"]);function wr(t,e){return je.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Sr(t,e){return n=>E(t,e,n)}function gn(t){return typeof t=="number"?Sr:typeof t=="string"?dn(t)?ie:k.test(t)?Wn:br:Array.isArray(t)?Si:typeof t=="object"?k.test(t)?Wn:Pr:ie}function Si(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>gn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Pr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=gn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Ar(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const br=(t,e)=>{const n=_.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?je.has(t)&&!i.values.length||je.has(e)&&!s.values.length?wr(t,e):Ut(Si(Ar(s,i),i.values),n):ie(t,e)};function Pi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?E(t,e,n):gn(t)(t,e)}const Vr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>D.update(e,n),stop:()=>it(e),now:()=>j.isProcessing?j.timestamp:N.now()}},Ai=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},oe=2e4;function yn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<oe;)e+=n,s=t.next(e);return e>=oe?1/0:e}function Cr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(yn(s),oe);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:$(i)}}const L={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ne(t,e){return t*Math.sqrt(1-e*e)}const Mr=12;function Dr(t,e,n){let s=n;for(let i=1;i<Mr;i++)s=s-t(s)/e(s);return s}const Ae=.001;function Er({duration:t=L.duration,bounce:e=L.bounce,velocity:n=L.velocity,mass:s=L.mass}){let i,r,o=1-e;o=tt(L.minDamping,L.maxDamping,o),t=tt(L.minDuration,L.maxDuration,$(t)),o<1?(i=c=>{const u=c*o,h=u*t,f=u-n,d=Ne(c,o),p=Math.exp(-h);return Ae-f/d*p},r=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),g=Ne(Math.pow(c,2),o);return(-i(c)+Ae>0?-1:1)*((f-d)*p)/g}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-Ae+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=Dr(i,r,a);if(t=W(t),isNaN(l))return{stiffness:L.stiffness,damping:L.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:t}}}const Rr=["duration","bounce"],Lr=["stiffness","damping","mass"];function Kn(t,e){return e.some(n=>t[n]!==void 0)}function kr(t){let e={velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1,...t};if(!Kn(t,Lr)&&Kn(t,Rr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*tt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:L.mass,stiffness:i,damping:r}}else{const n=Er({...t,velocity:0});e={...e,...n,mass:L.mass},e.isResolvedFromDuration=!0}return e}function re(t=L.visualDuration,e=L.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=kr({...n,velocity:-$(n.velocity||0)}),p=f||0,g=c/(2*Math.sqrt(l*u)),m=o-r,y=$(Math.sqrt(l/u)),w=Math.abs(m)<5;s||(s=w?L.restSpeed.granular:L.restSpeed.default),i||(i=w?L.restDelta.granular:L.restDelta.default);let x,T,b,M,V,P;if(g<1)b=Ne(y,g),M=(p+g*y*m)/b,x=A=>{const R=Math.exp(-g*y*A);return o-R*(M*Math.sin(b*A)+m*Math.cos(b*A))},V=g*y*M+m*b,P=g*y*m-M*b,T=A=>Math.exp(-g*y*A)*(V*Math.sin(b*A)+P*Math.cos(b*A));else if(g===1){x=R=>o-Math.exp(-y*R)*(m+(p+y*m)*R);const A=p+y*m;T=R=>Math.exp(-y*R)*(y*A*R-p)}else{const A=y*Math.sqrt(g*g-1);x=X=>{const nt=Math.exp(-g*y*X),Y=Math.min(A*X,300);return o-nt*((p+g*y*m)*Math.sinh(Y)+A*m*Math.cosh(Y))/A};const R=(p+g*y*m)/A,F=g*y*R-m*A,et=g*y*m-R*A;T=X=>{const nt=Math.exp(-g*y*X),Y=Math.min(A*X,300);return nt*(F*Math.sinh(Y)+et*Math.cosh(Y))}}const C={calculatedDuration:d&&h||null,velocity:A=>W(T(A)),next:A=>{if(!d&&g<1){const F=Math.exp(-g*y*A),et=Math.sin(b*A),X=Math.cos(b*A),nt=o-F*(M*et+m*X),Y=W(F*(V*et+P*X));return a.done=Math.abs(Y)<=s&&Math.abs(o-nt)<=i,a.value=a.done?o:nt,a}const R=x(A);if(d)a.done=A>=h;else{const F=W(T(A));a.done=Math.abs(F)<=s&&Math.abs(o-R)<=i}return a.value=a.done?o:R,a},toString:()=>{const A=Math.min(yn(C),oe),R=Ai(F=>C.next(A*F).value,A,30);return A+"ms "+R},toTransition:()=>{}};return C}re.applyToOptions=t=>{const e=Cr(t,100,re);return t.ease=e.ease,t.duration=W(e.duration),t.type="keyframes",t};const Ir=5;function bi(t,e,n){const s=Math.max(e-Ir,0);return ii(n-t(s),e-s)}function Ue({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=P=>a!==void 0&&P<a||l!==void 0&&P>l,p=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let g=n*e;const m=h+g,y=o===void 0?m:o(m);y!==m&&(g=y-h);const w=P=>-g*Math.exp(-P/s),x=P=>y+w(P),T=P=>{const C=w(P),A=x(P);f.done=Math.abs(C)<=c,f.value=f.done?y:A};let b,M;const V=P=>{d(f.value)&&(b=P,M=re({keyframes:[f.value,p(f.value)],velocity:bi(x,P,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return V(0),{calculatedDuration:null,next:P=>{let C=!1;return!M&&b===void 0&&(C=!0,T(P),V(P)),b!==void 0&&P>=b?M.next(P-b):(!C&&T(P),f)}}}function Br(t,e,n){const s=[],i=n||at.mix||Pi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||z:e;a=Ut(l,a)}s.push(a)}return s}function Vi(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(me(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Br(e,s,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Bt(t[h],t[h+1],u);return a[h](f)};return n?u=>c(tt(t[0],t[r-1],u)):c}function Fr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Bt(0,e,s);t.push(E(n,1,i))}}function Or(t){const e=[0];return Fr(e,t.length-1),e}function jr(t,e){return t.map(n=>n*e)}function Nr(t,e){return t.map(()=>e||di).splice(0,t.length-1)}function Rt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Xo(s)?s.map(Fn):Fn(s),r={done:!1,value:e[0]},o=jr(n&&n.length===e.length?n:Or(e),t),a=Vi(o,e,{ease:Array.isArray(i)?i:Nr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Ur=t=>t!==null;function ge(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ur),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Wr={decay:Ue,inertia:Ue,tween:Rt,keyframes:Rt,spring:re};function Ci(t){typeof t.type=="string"&&(t.type=Wr[t.type])}class vn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Kr=t=>t/100;class Ot extends vn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ci(e);const{type:n=Rt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Rt;l!==Rt&&typeof a[0]!="number"&&(this.mixKeyframes=Ut(Kr,Pi(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=yn(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:g,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,T=s;if(h){const P=Math.min(this.currentTime,i)/a;let C=Math.floor(P),A=P%1;!A&&P>=1&&(A=1),A===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(f==="reverse"?(A=1-A,d&&(A-=d/a)):f==="mirror"&&(T=o)),x=tt(0,1,A)*a}let b;w?(this.delayState.value=u[0],b=this.delayState):b=T.next(x),r&&!w&&(b.value=r(b.value));let{done:M}=b;!w&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return V&&p!==Ue&&(b.value=ge(u,this.options,m,this.speed)),g&&g(b.value),V&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return $(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(this.currentTime)}set time(e){e=W(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return bi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=$(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:e=Vr,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function $r(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const dt=t=>t*180/Math.PI,We=t=>{const e=dt(Math.atan2(t[1],t[0]));return Ke(e)},zr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:We,rotateZ:We,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ke=t=>(t=t%360,t<0&&(t+=360),t),$n=We,zn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Gn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Gr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:zn,scaleY:Gn,scale:t=>(zn(t)+Gn(t))/2,rotateX:t=>Ke(dt(Math.atan2(t[6],t[5]))),rotateY:t=>Ke(dt(Math.atan2(-t[2],t[0]))),rotateZ:$n,rotate:$n,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $e(t){return t.includes("scale")?1:0}function ze(t,e){if(!t||t==="none")return $e(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Gr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=zr,i=a}if(!i)return $e(e);const r=s[e],o=i[1].split(",").map(_r);return typeof r=="function"?r(o):o[r]}const Hr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ze(n,e)};function _r(t){return parseFloat(t.trim())}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ct=new Set([...Vt,"pathRotation"]),Hn=t=>t===bt||t===S,Xr=new Set(["x","y","z"]),Yr=Vt.filter(t=>!Xr.has(t));function qr(t){const e=[];return Yr.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const rt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ze(e,"x"),y:(t,{transform:e})=>ze(e,"y")};rt.translateX=rt.x;rt.translateY=rt.y;const pt=new Set;let Ge=!1,He=!1,_e=!1;function Mi(){if(He){const t=Array.from(pt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=qr(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}He=!1,Ge=!1,pt.forEach(t=>t.complete(_e)),pt.clear()}function Di(){pt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(He=!0)})}function Zr(){_e=!0,Di(),Mi(),_e=!1}class xn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(pt.add(this),Ge||(Ge=!0,D.read(Di),D.resolveKeyframes(Mi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i==null?void 0:i.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}$r(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),pt.delete(this)}cancel(){this.state==="scheduled"&&(pt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Jr=t=>t.startsWith("--");function Ei(t,e,n){Jr(e)?t.style.setProperty(e,n):t.style[e]=n}const Qr={};function Ri(t,e){const n=si(t);return()=>Qr[e]??n()}const ta=Ri(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Li=Ri(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,_n={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dt([0,.65,.55,1]),circOut:Dt([.55,0,1,.45]),backIn:Dt([.31,.01,.66,-.59]),backOut:Dt([.33,1.53,.69,.99])};function ki(t,e){if(t)return typeof t=="function"?Li()?Ai(t,e):"ease-out":pi(t)?Dt(t):Array.isArray(t)?t.map(n=>ki(n,e)||_n.easeOut):_n[t]}function ea(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=ki(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function Ii(t){return typeof t=="function"&&"applyToOptions"in t}function na({type:t,...e}){return Ii(t)&&Li()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Bi extends vn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,me(typeof e.type!="string");const c=na(e);this.animation=ea(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=ge(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Ei(n,s,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return $(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=W(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&ta()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),z):i(this)}}const Fi={anticipate:ci,backInOut:ui,circInOut:fi};function sa(t){return t in Fi}function ia(t){typeof t.ease=="string"&&sa(t.ease)&&(t.ease=Fi[t.ease])}const be=10;class oa extends Bi{constructor(e){ia(e),Ci(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Ot({...o,autoplay:!1}),l=Math.max(be,N.now()-this.startTime),c=tt(0,be,l-be),u=a.sample(l).value,{name:h}=this.options;r&&h&&Ei(r,h,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Xn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function ra(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function aa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Xn(i,e),a=Xn(r,e);return!o||!a?!1:ra(t)||(n==="spring"||Ii(n))&&s}function Xe(t){t.duration=0,t.type="keyframes"}const Oi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),la=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ua(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&la.test(t[e]))return!0;return!1}const ca=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ha=si(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fa(t){var h;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t,l=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ha()&&n&&(Oi.has(n)||ca.has(n)&&ua(a))&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const da=40;class pa extends vn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){var p;super(),this.stop=()=>{var g,m;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||xn;this.keyframeResolver=new d(a,(g,m,y)=>this.onKeyframesResolved(g,m,f,!y),l,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){var y,w;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=N.now();let h=!0;aa(e,r,o,a)||(h=!1,(at.instantAnimations||!l)&&(u==null||u(ge(e,s,n))),e[0]=e[e.length-1],Xe(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>da?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=h&&!c&&fa(d),g=(w=(y=d.motionValue)==null?void 0:y.owner)==null?void 0:w.current;let m;if(p)try{m=new oa({...d,element:g})}catch{m=new Ot(d)}else m=new Ot(d);m.finished.then(()=>{this.notifyFinished()}).catch(z),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Zr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function ji(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const Yn=30,ma=t=>!isNaN(parseFloat(t)),Lt={current:void 0};class ga{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=N.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ma(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new cn);const s=this.events[e].add(n);return e==="change"?()=>{s(),D.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Lt.current&&Lt.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Yn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Yn);return ii(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gt(t,e){return new ga(t,e)}function Tn(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function wn(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Tn(n,t):n}const ya={type:"spring",stiffness:500,damping:25,restSpeed:10},va=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),xa={type:"keyframes",duration:.8},Ta={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wa=(t,{keyframes:e})=>e.length>2?xa:Ct.has(t)?t.startsWith("scale")?va(e[1]):ya:Ta,Sa=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Pa(t){for(const e in t)if(!Sa.has(e))return!0;return!1}const Sn=(t,e,n,s={},i,r)=>o=>{const a=wn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-W(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Pa(a)||Object.assign(u,wa(t,u)),u.duration&&(u.duration=W(u.duration)),u.repeatDelay&&(u.repeatDelay=W(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Xe(u),u.delay===0&&(h=!0)),(at.instantAnimations||at.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Xe(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=ge(u.keyframes,a);if(f!==void 0){D.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Ot(u):new pa(u)},Aa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ba(t){const e=Aa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Ni(t,e,n=1){const[s,i]=ba(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return ti(o)?parseFloat(o):o}return dn(i)?Ni(i,e,n+1):i}function qn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Pn(t,e,n,s){if(typeof e=="function"){const[i,r]=qn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=qn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function mt(t,e,n){const s=t.getProps();return Pn(s,e,n!==void 0?n:s.custom,t)}const Ui=new Set(["width","height","top","left","right","bottom",...Vt]),Ye=t=>Array.isArray(t);function Va(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,gt(n))}function Ca(t){return Ye(t)?t[t.length-1]||0:t}function Ma(t,e){const n=mt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Ca(r[o]);Va(t,o,a)}}const B=t=>!!(t&&t.getVelocity);function Da(t){return!!(B(t)&&t.add)}function qe(t,e){const n=t.getValue("willChange");if(Da(n))return n.add(e);if(!n&&at.WillChange){const s=new at.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function An(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ea="framerAppearId",Wi="data-"+An(Ea);function Ki(t){return t.props[Wi]}function Ra({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function $i(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?Tn(r,l):l;const c=r==null?void 0:r.reduceMotion,u=r==null?void 0:r.skipAnimations;s&&(r=s);const h=[],f=i&&t.animationState&&t.animationState.getState()[i],d=r==null?void 0:r.path;d&&d.animateVisualElement(t,a,r,n,h);for(const p in a){const g=t.getValue(p,t.latestValues[p]??null),m=a[p];if(m===void 0||f&&Ra(f,p))continue;const y={delay:n,...wn(r||{},p)};u&&(y.skipAnimations=!0);const w=g.get();if(w!==void 0&&!g.isAnimating()&&!Array.isArray(m)&&m===w&&!y.velocity){D.update(()=>g.set(m));continue}let x=!1;if(window.MotionHandoffAnimation){const M=Ki(t);if(M){const V=window.MotionHandoffAnimation(M,p,D);V!==null&&(y.startTime=V,x=!0)}}qe(t,p);const T=c??t.shouldReduceMotion;g.start(Sn(p,g,m,T&&Ui.has(p)?{type:!1}:y,t,x));const b=g.animation;b&&h.push(b)}if(o){const p=()=>D.update(()=>{o&&Ma(t,o)});h.length?Promise.all(h).then(p):p()}return h}function Ze(t,e,n={}){var l;const s=mt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all($i(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=i;return La(t,e,c,u,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function La(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Ze(l,e,{...o,delay:n+(typeof s=="function"?0:s)+ji(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function ka(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ze(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ze(t,e,n);else{const i=typeof e=="function"?mt(t,e,n.custom):e;s=Promise.all($i(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ia={test:t=>t==="auto",parse:t=>t},zi=t=>e=>e.test(t),Gi=[bt,S,Q,st,ar,rr,Ia],Zn=t=>Gi.find(zi(t));function Ba(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ni(t):!0}const Fa=new Set(["brightness","contrast","saturate","opacity"]);function Oa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(pn)||[];if(!s)return t;const i=n.replace(s,"");let r=Fa.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ja=/\b([a-z-]*)\(.*?\)/gu,Je={..._,getAnimatableNone:t=>{const e=t.match(ja);return e?e.map(Oa).join(" "):t}},Qe={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Jn={...bt,transform:Math.round},Na={rotate:st,pathRotation:st,rotateX:st,rotateY:st,rotateZ:st,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:st,skewX:st,skewY:st,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Ft,originX:jn,originY:jn,originZ:S},ae={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...Na,zIndex:Jn,fillOpacity:Ft,strokeOpacity:Ft,numOctaves:Jn},Ua={...ae,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:Je,WebkitFilter:Je,mask:Qe,WebkitMask:Qe},Hi=t=>Ua[t],Wa=new Set([Je,Qe]);function _i(t,e){let n=Hi(t);return Wa.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ka=new Set(["auto","none","0"]);function $a(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Ka.has(r)&&Pt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=_i(n,i)}class za extends xn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),dn(h))){const f=Ni(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Ui.has(s)||e.length!==2)return;const[i,r]=e,o=Zn(i),a=Zn(r),l=On(i),c=On(r);if(l!==c&&rt[s]){this.needsMeasurement=!0;return}if(o!==a)if(Hn(o)&&Hn(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else rt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ba(e[i]))&&s.push(i);s.length&&$a(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=rt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=rt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const bn=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Xi(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const tn=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function qt(t){return ei(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Vn}=mi(queueMicrotask,!1),H={x:!1,y:!1};function Yi(){return H.x||H.y}function Ga(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function qi(t,e){const n=Xi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ha(t){return!(t.pointerType==="touch"||Yi())}function _a(t,e,n={}){const[s,i,r]=qi(t,n);return s.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",p)},h=m=>{c&&(c(m),c=void 0),u()},f=m=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(m))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=m=>{if(m.pointerType!=="touch"){if(a){l=!0;return}h(m)}},g=m=>{if(!Ha(m))return;l=!1;const y=e(o,m);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",d,i)}),r}const Zi=(t,e)=>e?t===e?!0:Zi(t,e.parentElement):!1,Cn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Xa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ya(t){return Xa.has(t.tagName)||t.isContentEditable===!0}const qa=new Set(["INPUT","SELECT","TEXTAREA"]);function Za(t){return qa.has(t.tagName)||t.isContentEditable===!0}const Zt=new WeakSet;function Qn(t){return e=>{e.key==="Enter"&&t(e)}}function Ve(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ja=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Qn(()=>{if(Zt.has(n))return;Ve(n,"down");const i=Qn(()=>{Ve(n,"up")}),r=()=>Ve(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ts(t){return Cn(t)&&!Yi()}const es=new WeakSet;function Qa(t,e,n={}){const[s,i,r]=qi(t,n),o=a=>{const l=a.currentTarget;if(!ts(a)||es.has(a))return;Zt.add(l),n.stopPropagation&&es.add(a);const c=e(l,a),u={...i,capture:!0},h=(p,g)=>{window.removeEventListener("pointerup",f,u),window.removeEventListener("pointercancel",d,u),Zt.has(l)&&Zt.delete(l),ts(p)&&typeof c=="function"&&c(p,{success:g})},f=p=>{h(p,l===window||l===document||n.useGlobalTarget||Zi(l,p.target))},d=p=>{h(p,!1)};window.addEventListener("pointerup",f,u),window.addEventListener("pointercancel",d,u)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),qt(a)&&(a.addEventListener("focus",c=>Ja(c,i)),!Ya(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Mn(t){return ei(t)&&"ownerSVGElement"in t}const Jt=new WeakMap;let ot;const Ji=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Mn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],tl=Ji("inline","width","offsetWidth"),el=Ji("block","height","offsetHeight");function nl({target:t,borderBoxSize:e}){var n;(n=Jt.get(t))==null||n.forEach(s=>{s(t,{get width(){return tl(t,e)},get height(){return el(t,e)}})})}function sl(t){t.forEach(nl)}function il(){typeof ResizeObserver>"u"||(ot=new ResizeObserver(sl))}function ol(t,e){ot||il();const n=Xi(t);return n.forEach(s=>{let i=Jt.get(s);i||(i=new Set,Jt.set(s,i)),i.add(e),ot==null||ot.observe(s)}),()=>{n.forEach(s=>{const i=Jt.get(s);i==null||i.delete(e),i!=null&&i.size||ot==null||ot.unobserve(s)})}}const Qt=new Set;let wt;function rl(){wt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Qt.forEach(e=>e(t))},window.addEventListener("resize",wt)}function al(t){return Qt.add(t),wt||rl(),()=>{Qt.delete(t),!Qt.size&&typeof wt=="function"&&(window.removeEventListener("resize",wt),wt=void 0)}}function ns(t,e){return typeof t=="function"?al(t):ol(t,e)}function ll(t){return Mn(t)&&t.tagName==="svg"}function ul(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Vi(i,r,o);return e?a(s):a}function cl(t,e,n={}){const s=t.get();let i=null,r=s,o;const a=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,l=()=>{i&&(i.stop(),i=null),t.animation=void 0},c=()=>{const h=ss(t.get()),f=ss(r);if(h===f){l();return}const d=i?i.getGeneratorVelocity():t.getVelocity();l(),i=new Ot({keyframes:[h,f],velocity:d,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},u=()=>{var h;c(),t.animation=i??void 0,(h=t.events.animationStart)==null||h.notify(),i==null||i.then(()=>{var f;t.animation=void 0,(f=t.events.animationComplete)==null||f.notify()})};if(t.attach((h,f)=>{r=h,o=d=>f(Ce(d,a)),D.postRender(u)},l),B(e)){let h=n.skipInitialAnimation===!0;const f=e.on("change",p=>{h?(h=!1,t.jump(Ce(p,a),!1)):t.set(Ce(p,a))}),d=t.on("destroy",f);return()=>{f(),d()}}return l}function Ce(t,e){return e?t+e:t}function ss(t){return typeof t=="number"?t:parseFloat(t)}const hl=[...Gi,k,_],fl=t=>hl.find(zi(t)),is=()=>({translate:0,scale:1,origin:0,originPoint:0}),St=()=>({x:is(),y:is()}),os=()=>({min:0,max:0}),I=()=>({x:os(),y:os()}),dl=new WeakMap;function ye(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function jt(t){return typeof t=="string"||Array.isArray(t)}const Dn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],En=["initial",...Dn];function ve(t){return ye(t.animate)||En.some(e=>jt(t[e]))}function Qi(t){return!!(ve(t)||t.variants)}function pl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(B(i))t.addValue(s,i);else if(B(r))t.addValue(s,gt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const le={current:null},Rn={current:!1},ml=typeof window<"u";function to(){if(Rn.current=!0,!!ml)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>le.current=t.matches;t.addEventListener("change",e),e()}else le.current=!1}const rs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ue={};function eo(t){ue=t}function gl(){return ue}class yl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=xn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=N.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,D.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=ve(n),this.isVariantNode=Qi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];c[d]!==void 0&&B(p)&&p.set(c[d])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,dl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Rn.current||to(),this.shouldReduceMotion=le.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Oi.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,h=new Bi({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:W(u)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=Ct.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&D.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ue){const n=ue[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):I()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<rs.length;s++){const i=rs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=pl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=gt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(ti(s)||ni(s))?s=parseFloat(s):!fl(s)&&_.test(n)&&(s=_i(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Pn(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new cn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Vn.render(this.render)}}class no extends yl{constructor(){super(...arguments),this.KeyframeResolver=za}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function so({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function vl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function xl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Me(t){return t===void 0||t===1}function en({scale:t,scaleX:e,scaleY:n}){return!Me(t)||!Me(e)||!Me(n)}function ht(t){return en(t)||io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function io(t){return as(t.x)||as(t.y)}function as(t){return t&&t!=="0%"}function ce(t,e,n){const s=t-n,i=e*s;return n+i}function ls(t,e,n,s,i){return i!==void 0&&(t=ce(t,i,s)),ce(t,n,s)+e}function nn(t,e=0,n=1,s,i){t.min=ls(t.min,e,n,s,i),t.max=ls(t.max,e,n,s,i)}function oo(t,{x:e,y:n}){nn(t.x,e.translate,e.scale,e.originPoint),nn(t.y,n.translate,n.scale,n.originPoint)}const us=.999999999999,cs=1.0000000000001;function Tl(t,e,n,s=!1){var a;const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let l=0;l<i;l++){r=n[l],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(Z(t.x,-r.scroll.offset.x),Z(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,oo(t,o)),s&&ht(r.latestValues)&&te(t,r.latestValues,(a=r.layout)==null?void 0:a.layoutBox))}e.x<cs&&e.x>us&&(e.x=1),e.y<cs&&e.y>us&&(e.y=1)}function Z(t,e){t.min+=e,t.max+=e}function hs(t,e,n,s,i=.5){const r=E(t.min,t.max,i);nn(t,e,n,r,s)}function fs(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function te(t,e,n){const s=n??t;hs(t.x,fs(e.x,s.x),e.scaleX,e.scale,e.originX),hs(t.y,fs(e.y,s.y),e.scaleY,e.scale,e.originY)}function ro(t,e){return so(xl(t.getBoundingClientRect(),e))}function wl(t,e,n){const s=ro(t,n),{scroll:i}=e;return i&&(Z(s.x,i.offset.x),Z(s.y,i.offset.y)),s}const Sl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pl=Vt.length;function Al(t,e,n){let s="",i=!0;for(let o=0;o<Pl;o++){const a=Vt[o],l=t[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=tn(l,ae[a]);if(!c){i=!1;const h=Sl[a]||a;s+=`${h}(${u}) `}n&&(e[a]=u)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${tn(r,ae.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Ln(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(Ct.has(l)){o=!0;continue}else if(yi(l)){i[l]=c;continue}else{const u=tn(c,ae[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(e.transform||(o||n?s.transform=Al(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}function ao(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function ds(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Mt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(S.test(t))t=parseFloat(t);else return t;const n=ds(t,e.target.x),s=ds(t,e.target.y);return`${n}% ${s}%`}},bl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const r=_.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=E(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),r(i)}},sn={borderRadius:{...Mt,applyTo:[...bn]},borderTopLeftRadius:Mt,borderTopRightRadius:Mt,borderBottomLeftRadius:Mt,borderBottomRightRadius:Mt,boxShadow:bl};function lo(t,{layout:e,layoutId:n}){return Ct.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!sn[t]||t==="opacity")}function kn(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,r={};if(!s)return r;for(const a in s)(B(s[a])||i&&B(i[a])||lo(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function Vl(t){return window.getComputedStyle(t)}class Cl extends no{constructor(){super(...arguments),this.type="html",this.renderInstance=ao}mount(e){me(!!e.style),super.mount(e)}readValueFromInstance(e,n){var s;if(Ct.has(n))return(s=this.projection)!=null&&s.isProjecting?$e(n):Hr(e,n);{const i=Vl(e),r=(yi(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ro(e,n)}build(e,n,s){Ln(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return kn(e,n,s)}}const Ml={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dl={offset:"strokeDashoffset",array:"strokeDasharray"};function El(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ml:Dl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Rl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function uo(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(Ln(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const d of Rl)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&El(h,i,r,o,!1)}const co=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ho=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Ll(t,e,n,s){ao(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(co.has(i)?i:An(i),e.attrs[i])}function fo(t,e,n){const s=kn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const r=Vt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class kl extends no{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=I}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ct.has(n)){const s=Hi(n);return s&&s.default||0}return n=co.has(n)?n:An(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return fo(e,n,s)}build(e,n,s){uo(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Ll(e,n,s,i)}mount(e){this.isSVGTag=ho(e.tagName),super.mount(e)}}const Il=En.length;function po(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?po(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Il;n++){const s=En[n],i=t.props[s];(jt(i)||i===!1)&&(e[s]=i)}return e}function mo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Bl=[...Dn].reverse(),Fl=Dn.length;function Ol(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ka(t,n,s)))}function jl(t){let e=Ol(t),n=ps(),s=!0,i=!1;const r=c=>(u,h)=>{var d;const f=mt(t,h,c==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:g,...m}=f;u={...u,...m,...g}}return u};function o(c){e=c(t)}function a(c){const{props:u}=t,h=po(t.parent)||{},f=[],d=new Set;let p={},g=1/0;for(let y=0;y<Fl;y++){const w=Bl[y],x=n[w],T=u[w]!==void 0?u[w]:h[w],b=jt(T),M=w===c?x.isActive:null;M===!1&&(g=y);let V=T===h[w]&&T!==u[w]&&b;if(V&&(s||i)&&t.manuallyAnimateOnMount&&(V=!1),x.protectedKeys={...p},!x.isActive&&M===null||!T&&!x.prevProp||ye(T)||typeof T=="boolean")continue;if(w==="exit"&&x.isActive&&M!==!0){x.prevResolvedValues&&(p={...p,...x.prevResolvedValues});continue}const P=Nl(x.prevProp,T);let C=P||w===c&&x.isActive&&!V&&b||y>g&&b,A=!1;const R=Array.isArray(T)?T:[T];let F=R.reduce(r(w),{});M===!1&&(F={});const{prevResolvedValues:et={}}=x,X={...et,...F},nt=O=>{C=!0,d.has(O)&&(A=!0,d.delete(O)),x.needsAnimating[O]=!0;const K=t.getValue(O);K&&(K.liveStyle=!1)};for(const O in X){const K=F[O],ut=et[O];if(p.hasOwnProperty(O))continue;let vt=!1;Ye(K)&&Ye(ut)?vt=!mo(K,ut)||P:vt=K!==ut,vt?K!=null?nt(O):d.add(O):K!==void 0&&d.has(O)?nt(O):x.protectedKeys[O]=!0}x.prevProp=T,x.prevResolvedValues=F,x.isActive&&(p={...p,...F}),(s||i)&&t.blockInitialAnimation&&(C=!1);const Y=V&&P;C&&(!Y||A)&&f.push(...R.map(O=>{const K={type:w};if(typeof O=="string"&&(s||i)&&!Y&&t.manuallyAnimateOnMount&&t.parent){const{parent:ut}=t,vt=mt(ut,O);if(ut.enteringChildren&&vt){const{delayChildren:Wo}=vt.transition||{};K.delay=ji(ut.enteringChildren,t,Wo)}}return{animation:O,options:K}}))}if(d.size){const y={};if(typeof u.initial!="boolean"){const w=mt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(y.transition=w.transition)}d.forEach(w=>{const x=t.getBaseTarget(w),T=t.getValue(w);T&&(T.liveStyle=!0),y[w]=x??null}),f.push({animation:y})}let m=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,i=!1,m?e(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(c,u)}),n[c].isActive=u;const h=a(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ps(),i=!0}}}function Nl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!mo(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ps(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function on(t,e){t.min=e.min,t.max=e.max}function G(t,e){on(t.x,e.x),on(t.y,e.y)}function ms(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const go=1e-4,Ul=1-go,Wl=1+go,yo=.01,Kl=0-yo,$l=0+yo;function U(t){return t.max-t.min}function zl(t,e,n){return Math.abs(t-e)<=n}function gs(t,e,n,s=.5){t.origin=s,t.originPoint=E(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=E(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ul&&t.scale<=Wl||isNaN(t.scale))&&(t.scale=1),(t.translate>=Kl&&t.translate<=$l||isNaN(t.translate))&&(t.translate=0)}function kt(t,e,n,s){gs(t.x,e.x,n.x,s?s.originX:void 0),gs(t.y,e.y,n.y,s?s.originY:void 0)}function ys(t,e,n,s=0){const i=s?E(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+U(e)}function Gl(t,e,n,s){ys(t.x,e.x,n.x,s==null?void 0:s.x),ys(t.y,e.y,n.y,s==null?void 0:s.y)}function vs(t,e,n,s=0){const i=s?E(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+U(e)}function he(t,e,n,s){vs(t.x,e.x,n.x,s==null?void 0:s.x),vs(t.y,e.y,n.y,s==null?void 0:s.y)}function xs(t,e,n,s,i){return t-=e,t=ce(t,1/n,s),i!==void 0&&(t=ce(t,1/i,s)),t}function Hl(t,e=0,n=1,s=.5,i,r=t,o=t){if(Q.test(e)&&(e=parseFloat(e),e=E(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=E(r.min,r.max,s);t===r&&(a-=e),t.min=xs(t.min,e,n,a,i),t.max=xs(t.max,e,n,a,i)}function Ts(t,e,[n,s,i],r,o){Hl(t,e[n],e[s],e[i],e.scale,r,o)}const _l=["x","scaleX","originX"],Xl=["y","scaleY","originY"];function ws(t,e,n,s){Ts(t.x,e,_l,n?n.x:void 0,s?s.x:void 0),Ts(t.y,e,Xl,n?n.y:void 0,s?s.y:void 0)}function Ss(t){return t.translate===0&&t.scale===1}function vo(t){return Ss(t.x)&&Ss(t.y)}function Ps(t,e){return t.min===e.min&&t.max===e.max}function Yl(t,e){return Ps(t.x,e.x)&&Ps(t.y,e.y)}function As(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function xo(t,e){return As(t.x,e.x)&&As(t.y,e.y)}function bs(t){return U(t.x)/U(t.y)}function Vs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function q(t){return[t("x"),t("y")]}function ql(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:h,rotateX:f,rotateY:d,skewX:p,skewY:g}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotate(${h}deg) `),f&&(s+=`rotateX(${f}deg) `),d&&(s+=`rotateY(${d}deg) `),p&&(s+=`skewX(${p}deg) `),g&&(s+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Zl=bn.length,Cs=t=>typeof t=="string"?parseFloat(t):t,Ms=t=>typeof t=="number"||S.test(t);function Jl(t,e,n,s,i,r){i?(t.opacity=E(0,n.opacity??1,Ql(s)),t.opacityExit=E(e.opacity??1,0,tu(s))):r&&(t.opacity=E(e.opacity??1,n.opacity??1,s));for(let o=0;o<Zl;o++){const a=bn[o];let l=Ds(e,a),c=Ds(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ms(l)===Ms(c)?(t[a]=Math.max(E(Cs(l),Cs(c),s),0),(Q.test(c)||Q.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=E(e.rotate||0,n.rotate||0,s))}function Ds(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ql=To(0,.5,hi),tu=To(.5,.95,z);function To(t,e,n){return s=>s<t?0:s>e?1:n(Bt(t,e,s))}function eu(t,e,n){const s=B(t)?t:gt(t);return s.start(Sn("",s,e,n)),s.animation}function Nt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const nu=(t,e)=>t.depth-e.depth;class su{constructor(){this.children=[],this.isDirty=!1}add(e){un(this.children,e),this.isDirty=!0}remove(e){se(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nu),this.isDirty=!1,this.children.forEach(e)}}function iu(t,e){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(it(s),t(r-e))};return D.setup(s,!0),()=>it(s)}function ee(t){return B(t)?t.get():t}class ou{constructor(){this.members=[]}add(e){un(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(se(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(se(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,r,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const ne={hasAnimatedSinceResize:!0,hasEverUpdated:!1},De=["","X","Y","Z"],ru=1e3;let au=0;function Ee(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function wo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ki(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",D,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&wo(s)}function So({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=au++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(cu),this.nodes.forEach(gu),this.nodes.forEach(yu),this.nodes.forEach(hu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new su)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new cn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Mn(o)&&!ll(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;D.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=iu(f,250),ne.hasAnimatedSinceResize&&(ne.hasAnimatedSinceResize=!1,this.nodes.forEach(Ls)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Su,{onLayoutAnimationStart:g,onLayoutAnimationComplete:m}=c.getProps(),y=!this.targetLayout||!xo(this.targetLayout,d),w=!h&&f;if(this.options.layoutRoot||this.resumeFrom||w||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...wn(p,"layout"),onPlay:g,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,w,x.path)}else h||Ls(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),it(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(vu),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(du),this.nodes.forEach(Es);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Rs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(pu),this.nodes.forEach(mu),this.nodes.forEach(lu),this.nodes.forEach(uu)):this.nodes.forEach(Rs),this.clearAllSnapshots();const a=N.now();j.delta=tt(0,1e3/60,a-j.timestamp),j.timestamp=a,j.isProcessing=!0,Te.update.process(j),Te.preRender.process(j),Te.render.process(j),j.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fu),this.sharedNodes.forEach(xu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,D.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){D.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=I()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!vo(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ht(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Pu(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return I();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Au))){const{scroll:u}=this.root;u&&(Z(a.x,u.offset.x),Z(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=I();if(G(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&G(a,o),Z(a.x,h.offset.x),Z(a.y,h.offset.y))}return a}applyTransform(o,a=!1,l){var u,h;const c=l||I();G(c,o);for(let f=0;f<this.path.length;f++){const d=this.path[f];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(Z(c.x,-d.scroll.offset.x),Z(c.y,-d.scroll.offset.y)),ht(d.latestValues)&&te(c,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return ht(this.latestValues)&&te(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(o){var l;const a=I();G(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ht(u.latestValues))continue;let h;u.instance&&(en(u.latestValues)&&u.updateSnapshot(),h=I(),G(h,u.measurePageBox())),ws(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,h)}return ht(this.latestValues)&&ws(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==j.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=j.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=I(),this.targetWithTransforms=I()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Gl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):G(this.target,this.layout.layoutBox),oo(this.target,this.targetDelta)):G(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||en(this.parent.latestValues)||io(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I(),this.relativeTargetOrigin=I(),he(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),G(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===j.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;G(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Tl(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=I());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ms(this.prevProjectionDelta.x,this.projectionDelta.x),ms(this.prevProjectionDelta.y,this.projectionDelta.y)),kt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Vs(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=St(),this.projectionDelta=St(),this.projectionDeltaWithTransform=St()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},h={...this.latestValues},f=St();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=I(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,m=p!==g,y=this.getStack(),w=!y||y.members.length<=1,x=!!(m&&!w&&this.options.crossfade===!0&&!this.path.some(wu));this.animationProgress=0;let T;const b=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=M=>{const V=M/1e3,P=b==null?void 0:b(V);P?(f.x.translate=P.x,f.x.scale=E(o.x.scale,1,V),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=P.y,f.y.scale=E(o.y.scale,1,V),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(ks(f.x,o.x,V),ks(f.y,o.y,V)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(he(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Tu(this.relativeTarget,this.relativeTargetOrigin,d,V),T&&Yl(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=I()),G(T,this.relativeTarget)),m&&(this.animationValues=h,Jl(h,u,this.latestValues,V,x,w)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(it(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=D.update(()=>{ne.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gt(0)),this.motionValue.jump(0,!1),this.currentAnimation=eu(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ru),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Po(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||I();const h=U(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=U(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}G(a,l),te(a,u),kt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ou),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Ee("z",o,c,this.animationValues);for(let u=0;u<De.length;u++)Ee(`rotate${De[u]}`,o,c,this.animationValues),Ee(`skew${De[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=ee(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=ee(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ht(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=ql(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in sn){if(u[p]===void 0)continue;const{correct:g,applyTo:m,isCSSVariable:y}=sn[p],w=h==="none"?u[p]:g(u[p],c);if(m){const x=m.length;for(let T=0;T<x;T++)o[m[T]]=w}else y?this.options.visualElement.renderState.vars[p]=w:o[p]=w}this.options.layoutId&&(o.pointerEvents=c===this?ee(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Es),this.root.sharedNodes.clear()}}}function lu(t){t.updateLayout()}function uu(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")q(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=U(f);f.min=s[h].min,f.max=f.min+d});else if(r==="x"||r==="y"){const h=r==="x"?"y":"x";on(o?e.measuredBox[h]:e.layoutBox[h],s[h])}else Po(r,e.layoutBox,s)&&q(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=U(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=St();kt(a,s,e.layoutBox);const l=St();o?kt(l,t.applyTransform(i,!0),e.measuredBox):kt(l,s,e.layoutBox);const c=!vo(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=t.options.layoutAnchor||void 0,g=I();he(g,e.layoutBox,f.layoutBox,p);const m=I();he(m,s,d.layoutBox,p),xo(g,m)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function cu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function hu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function fu(t){t.clearSnapshot()}function Es(t){t.clearMeasurements()}function du(t){t.isLayoutDirty=!0,t.updateLayout()}function Rs(t){t.isLayoutDirty=!1}function pu(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function mu(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ls(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function gu(t){t.resolveTargetDelta()}function yu(t){t.calcProjection()}function vu(t){t.resetSkewAndRotation()}function xu(t){t.removeLeadSnapshot()}function ks(t,e,n){t.translate=E(e.translate,0,n),t.scale=E(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Is(t,e,n,s){t.min=E(e.min,n.min,s),t.max=E(e.max,n.max,s)}function Tu(t,e,n,s){Is(t.x,e.x,n.x,s),Is(t.y,e.y,n.y,s)}function wu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Su={duration:.45,ease:[.4,0,.1,1]},Bs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Fs=Bs("applewebkit/")&&!Bs("chrome/")?Math.round:z;function Os(t){t.min=Fs(t.min),t.max=Fs(t.max)}function Pu(t){Os(t.x),Os(t.y)}function Po(t,e,n){return t==="position"||t==="preserve-aspect"&&!zl(bs(e),bs(n),.2)}function Au(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const bu=So({attachResizeListener:(t,e)=>Nt(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Re={current:void 0},Ao=So({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Re.current){const t=new bu({});t.mount(window),t.setOptions({layoutScroll:!0}),Re.current=t}return Re.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),yt=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function js(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Vu(...t){return e=>{let n=!1;const s=t.map(i=>{const r=js(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():js(t[i],null)}}}}function Cu(...t){return v.useCallback(Vu(...t),t)}class Mu extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(qt(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=qt(s)&&s.offsetWidth||0,r=qt(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Du({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){var f;const o=v.useId(),a=v.useRef(null),l=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=v.useContext(yt),u=r!==!1?((f=t.props)==null?void 0:f.ref)??(t==null?void 0:t.ref):void 0,h=Cu(a,u);return v.useInsertionEffect(()=>{const{width:d,height:p,top:g,left:m,right:y,bottom:w,direction:x}=l.current;if(e||r===!1||!a.current||!d||!p)return;const T=x==="rtl",b=n==="left"?T?`right: ${y}`:`left: ${m}`:T?`left: ${m}`:`right: ${y}`,M=s==="bottom"?`bottom: ${w}`:`top: ${g}`;a.current.dataset.motionPopId=o;const V=document.createElement("style");c&&(V.nonce=c);const P=i??document.head;return P.appendChild(V),V.sheet&&V.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${d}px !important;
|
|
5
|
+
height: ${p}px !important;
|
|
6
|
+
${b}px !important;
|
|
7
|
+
${M}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{var C;(C=a.current)==null||C.removeAttribute("data-motion-pop-id"),P.contains(V)&&P.removeChild(V)}},[e]),J.jsx(Mu,{isPresent:e,childRef:a,sizeRef:l,pop:r,children:r===!1?t:v.cloneElement(t,{ref:h})})}const Eu=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=At(Ru),h=v.useId(),f=v.useRef(n),d=v.useRef(s);de(()=>{f.current=n,d.current=s});let p=!0,g=v.useMemo(()=>(p=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;s&&s()},register:m=>(u.set(m,!1),()=>{var y;u.delete(m),!f.current&&!u.size&&((y=d.current)==null||y.call(d))})}),[n,u,s]);return r&&p&&(g={...g}),v.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),t=J.jsx(Du,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:t}),J.jsx(pe.Provider,{value:g,children:t})};function Ru(){return new Map}function bo(t=!0){const e=v.useContext(pe);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=v.useId();v.useEffect(()=>{if(t)return i(r)},[t]);const o=v.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Ht=t=>t.key||"";function Ns(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const Gc=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,h]=bo(o),f=v.useMemo(()=>Ns(t),[t]),d=o&&!u?[]:f.map(Ht),p=v.useRef(!0),g=v.useRef(f),m=At(()=>new Map),y=v.useRef(new Set),[w,x]=v.useState(f),[T,b]=v.useState(f);de(()=>{p.current=!1,g.current=f;for(let P=0;P<T.length;P++){const C=Ht(T[P]);d.includes(C)?(m.delete(C),y.current.delete(C)):m.get(C)!==!0&&m.set(C,!1)}},[T,d.length,d.join("-")]);const M=[];if(f!==w){let P=[...f];for(let C=0;C<T.length;C++){const A=T[C],R=Ht(A);d.includes(R)||(P.splice(C,0,A),M.push(A))}return r==="wait"&&M.length&&(P=M),b(Ns(P)),x(f),null}const{forceRender:V}=v.useContext(ln);return J.jsx(J.Fragment,{children:T.map(P=>{const C=Ht(P),A=o&&!u?!1:f===T||d.includes(C),R=()=>{if(y.current.has(C))return;if(m.has(C))y.current.add(C),m.set(C,!0);else return;let F=!0;m.forEach(et=>{et||(F=!1)}),F&&(V==null||V(),b(g.current),o&&(h==null||h()),s&&s())};return J.jsx(Eu,{isPresent:A,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:A?void 0:R,anchorX:a,anchorY:l,children:P},C)})})},Vo=v.createContext({strict:!1}),Us={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ws=!1;function Lu(){if(Ws)return;const t={};for(const e in Us)t[e]={isEnabled:n=>Us[e].some(s=>!!n[s])};eo(t),Ws=!0}function Co(){return Lu(),gl()}function ku(t){const e=Co();for(const n in t)e[n]={...e[n],...t[n]};eo(e)}const Iu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function fe(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Iu.has(t)}let Mo=t=>!fe(t);function Do(t){typeof t=="function"&&(Mo=e=>e.startsWith("on")?!fe(e):t(e))}try{Do(require("@emotion/is-prop-valid").default)}catch{}function Bu(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||B(t[i])||(Mo(i)||n===!0&&fe(i)||!e&&!fe(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function Hc({children:t,isValidProp:e,...n}){e&&Do(e);const s=v.useContext(yt);n={...s,...n},n.transition=Tn(n.transition,s.transition),n.isStatic=At(()=>n.isStatic);const i=v.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return J.jsx(yt.Provider,{value:i,children:t})}const xe=v.createContext({});function Fu(t,e){if(ve(t)){const{initial:n,animate:s}=t;return{initial:n===!1||jt(n)?n:void 0,animate:jt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Ou(t){const{initial:e,animate:n}=Fu(t,v.useContext(xe));return v.useMemo(()=>({initial:e,animate:n}),[Ks(e),Ks(n)])}function Ks(t){return Array.isArray(t)?t.join(" "):t}const In=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Eo(t,e,n){for(const s in e)!B(e[s])&&!lo(s,n)&&(t[s]=e[s])}function ju({transformTemplate:t},e){return v.useMemo(()=>{const n=In();return Ln(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Nu(t,e){const n=t.style||{},s={};return Eo(s,n,t),Object.assign(s,ju(t,e)),s}function Uu(t,e){const n={},s=Nu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ro=()=>({...In(),attrs:{}});function Wu(t,e,n,s){const i=v.useMemo(()=>{const r=Ro();return uo(r,e,ho(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Eo(r,t.style,t),i.style={...r,...i.style}}return i}const Ku=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bn(t){return typeof t!="string"||t.includes("-")?!1:!!(Ku.indexOf(t)>-1||/[A-Z]/u.test(t))}function $u(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??Bn(t)?Wu:Uu)(e,s,i,t),c=Bu(e,typeof t=="string",r),u=t!==v.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=v.useMemo(()=>B(h)?h.get():h,[h]);return v.createElement(t,{...u,children:f})}function zu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Gu(n,s,i,t),renderState:e()}}function Gu(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=ee(r[f]);let{initial:o,animate:a}=t;const l=ve(t),c=Qi(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!ye(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=Pn(t,f[d]);if(p){const{transitionEnd:g,transition:m,...y}=p;for(const w in y){let x=y[w];if(Array.isArray(x)){const T=u?x.length-1:0;x=x[T]}x!==null&&(i[w]=x)}for(const w in g)i[w]=g[w]}}}return i}const Lo=t=>(e,n)=>{const s=v.useContext(xe),i=v.useContext(pe),r=()=>zu(t,e,s,i);return n?r():At(r)},Hu=Lo({scrapeMotionValuesFromProps:kn,createRenderState:In}),_u=Lo({scrapeMotionValuesFromProps:fo,createRenderState:Ro}),Xu=Symbol.for("motionComponentSymbol");function Yu(t,e,n){const s=v.useRef(n);v.useInsertionEffect(()=>{s.current=n});const i=v.useRef(null);return v.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r)),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const ko=v.createContext({});function xt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qu(t,e,n,s,i,r){var x,T;const{visualElement:o}=v.useContext(xe),a=v.useContext(Vo),l=v.useContext(pe),c=v.useContext(yt),u=c.reducedMotion,h=c.skipAnimations,f=v.useRef(null),d=v.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,g=v.useContext(ko);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Zu(f.current,n,i,g);const m=v.useRef(!1);v.useInsertionEffect(()=>{p&&m.current&&p.update(n,l)});const y=n[Wi],w=v.useRef(!!y&&typeof window<"u"&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,y))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,y)));return de(()=>{d.current=!0,p&&(m.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),w.current&&p.animationState&&p.animationState.animateChanges())}),v.useEffect(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)==null||b.call(window,y)}),w.current=!1),p.enteringChildren=void 0)}),p}function Zu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Io(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&xt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function Io(t){if(t)return t.options.allowProjection!==!1?t.projection:Io(t.parent)}function Le(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&ku(s);const r=n?n==="svg":Bn(t),o=r?_u:Hu;function a(c,u){let h;const f={...v.useContext(yt),...c,layoutId:Ju(c)},{isStatic:d}=f,p=Ou(c),g=o(c,d);if(!d&&typeof window<"u"){Qu();const m=tc(f);h=m.MeasureLayout,p.visualElement=qu(t,g,f,i,m.ProjectionNode,r)}return J.jsxs(xe.Provider,{value:p,children:[h&&p.visualElement?J.jsx(h,{visualElement:p.visualElement,...f}):null,$u(t,c,Yu(g,p.visualElement,u),g,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=v.forwardRef(a);return l[Xu]=t,l}function Ju({layoutId:t}){const e=v.useContext(ln).id;return e&&t!==void 0?e+"-"+t:t}function Qu(t,e){v.useContext(Vo).strict}function tc(t){const e=Co(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function ec(t,e){if(typeof Proxy>"u")return Le;const n=new Map,s=(r,o)=>Le(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Le(o,void 0,t,e)),n.get(o))})}const nc=(t,e)=>e.isSVG??Bn(t)?new kl(e):new Cl(e,{allowProjection:t!==v.Fragment});class sc extends lt{constructor(e){super(e),e.animationState||(e.animationState=jl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ye(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let ic=0;class oc extends lt{constructor(){super(...arguments),this.id=ic++,this.isExitComplete=!1}update(){var r;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=mt(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...h}=l;for(const f in h)(r=this.node.getValue(f))==null||r.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const rc={animation:{Feature:sc},exit:{Feature:oc}};function $t(t){return{point:{x:t.pageX,y:t.pageY}}}const ac=t=>e=>Cn(e)&&t(e,$t(e));function It(t,e,n,s){return Nt(t,e,ac(n),s)}const Bo=({current:t})=>t?t.ownerDocument.defaultView:null,$s=(t,e)=>Math.abs(t-e);function lc(t,e){const n=$s(t.x,e.x),s=$s(t.y,e.y);return Math.sqrt(n**2+s**2)}const zs=new Set(["auto","scroll"]);class Fo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=_t(this.lastRawMoveEventInfo,this.transformPagePoint));const p=ke(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,m=lc(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!m)return;const{point:y}=p,{timestamp:w}=j;this.history.push({...y,timestamp:w});const{onStart:x,onMove:T}=this.handlers;g||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=_t(g,this.transformPagePoint),D.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=ke(p.type==="pointercancel"?this.lastMoveEventInfo:_t(g,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,x),y&&y(p,x)},!Cn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=$t(e),c=_t(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=j;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,ke(c,this.history));const d={passive:!0,capture:!0};this.removeListeners=Ut(It(this.contextWindow,"pointermove",this.handlePointerMove,d),It(this.contextWindow,"pointerup",this.handlePointerUp,d),It(this.contextWindow,"pointercancel",this.handlePointerUp,d)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(zs.has(s.overflowX)||zs.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),D.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),it(this.updatePoint)}}function _t(t,e){return e?{point:e(t.point)}:t}function Gs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ke({point:t},e){return{point:t,delta:Gs(t,Oo(e)),offset:Gs(t,uc(e)),velocity:cc(e,.1)}}function uc(t){return t[0]}function Oo(t){return t[t.length-1]}function cc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Oo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function hc(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?E(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?E(n,t,s.max):Math.min(t,n)),t}function Hs(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function fc(t,{top:e,left:n,bottom:s,right:i}){return{x:Hs(t.x,n,i),y:Hs(t.y,e,s)}}function _s(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function dc(t,e){return{x:_s(t.x,e.x),y:_s(t.y,e.y)}}function pc(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=Bt(e.min,e.max-s,t.min):s>i&&(n=Bt(t.min,t.max-i,e.min)),tt(0,1,n)}function mc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const rn=.35;function gc(t=rn){return t===!1?t=0:t===!0&&(t=rn),{x:Xs(t,"left","right"),y:Xs(t,"top","bottom")}}function Xs(t,e,n){return{min:Ys(t,e),max:Ys(t,n)}}function Ys(t,e){return typeof t=="number"?t:t[e]||0}const yc=new WeakMap;class vc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=I(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor($t(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ga(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),q(y=>{let w=this.getAxisMotionValue(y).get()||0;if(Q.test(w)){const{projection:x}=this.visualElement;if(x&&x.layout){const T=x.layout.layoutBox[y];T&&(w=U(T)*(parseFloat(w)/100))}}this.originPoint[y]=w}),g&&D.update(()=>g(h,f),!1,!0),qe(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:m}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=Tc(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),m&&D.update(()=>m(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Fo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:Bo(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&D.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Xt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=hc(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&xt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=fc(s.layoutBox,e):this.constraints=!1,this.elastic=gc(n),i!==this.constraints&&!xt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=mc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!xt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=wl(s,i.root,this.visualElement.getTransformPagePoint());let o=dc(i.layout.layoutBox,r);if(n){const a=n(vl(o));this.hasMutatedConstraints=!!a,a&&(o=so(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=q(u=>{if(!Xt(u,n,this.currentDirection))return;let h=l&&l[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return qe(this.visualElement,e),s.start(Sn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){q(n=>{const{drag:s}=this.getProps();if(!Xt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-E(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!xt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=pc({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(o=>{if(!Xt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(E(l,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yc.set(this.visualElement,this);const e=this.visualElement.current,n=It(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&Za(f);u&&h&&!d&&this.start(c)});let s;const i=()=>{const{dragConstraints:c}=this.getProps();xt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=xc(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),D.read(i);const a=Nt(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=rn,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function qs(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function xc(t,e,n){const s=ns(t,qs(n)),i=ns(e,qs(n));return()=>{s(),i()}}function Xt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Tc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class wc extends lt{constructor(e){super(e),this.removeGroupControls=z,this.removeListeners=z,this.controls=new vc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||z}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ie=t=>(e,n)=>{t&&D.update(()=>t(e,n),!1,!0)};class Sc extends lt{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(e){this.session=new Fo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ie(e),onStart:Ie(n),onMove:Ie(s),onEnd:(r,o)=>{delete this.session,i&&D.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=It(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Be=!1;class Pc extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Be&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ne.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Be=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||D.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),Vn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Be=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function jo(t){const[e,n]=bo(),s=v.useContext(ln);return J.jsx(Pc,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(ko),isPresent:e,safeToRemove:n})}const Ac={pan:{Feature:Sc},drag:{Feature:wc,ProjectionNode:Ao,MeasureLayout:jo}};function Zs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&D.postRender(()=>r(e,$t(e)))}class bc extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=_a(e,(n,s)=>(Zs(this.node,s,"Start"),i=>Zs(this.node,i,"End"))))}unmount(){}}class Vc extends lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ut(Nt(this.node.current,"focus",()=>this.onFocus()),Nt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Js(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&D.postRender(()=>r(e,$t(e)))}class Cc extends lt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Qa(e,(i,r)=>(Js(this.node,r,"Start"),(o,{success:a})=>Js(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const an=new WeakMap,Fe=new WeakMap,Mc=t=>{const e=an.get(t.target);e&&e(t)},Dc=t=>{t.forEach(Mc)};function Ec({root:t,...e}){const n=t||document;Fe.has(n)||Fe.set(n,{});const s=Fe.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Dc,{root:t,...e})),s[i]}function Rc(t,e,n){const s=Ec(e);return an.set(t,n),s.observe(t),()=>{an.delete(t),s.unobserve(t)}}const Lc={some:0,all:1};class kc extends lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Lc[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=Rc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ic(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Ic({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Bc={inView:{Feature:kc},tap:{Feature:Cc},focus:{Feature:Vc},hover:{Feature:bc}},Fc={layout:{ProjectionNode:Ao,MeasureLayout:jo}},Oc={...rc,...Bc,...Ac,...Fc},jc=ec(Oc,nc);function No(t){const e=At(()=>gt(t)),{isStatic:n}=v.useContext(yt);if(n){const[,s]=v.useState(t);v.useEffect(()=>e.on("change",s),[])}return e}function Uo(t,e){const n=No(e()),s=()=>n.set(e());return s(),de(()=>{const i=()=>D.preRender(s,!1,!0),r=t.map(o=>o.on("change",i));return()=>{r.forEach(o=>o()),it(s)}}),n}function Nc(t){Lt.current=[],t();const e=Uo(Lt.current,t);return Lt.current=void 0,e}function Uc(t,e,n,s){if(typeof t=="function")return Nc(t);const r=typeof e=="function"?e:ul(e,n,s),o=Array.isArray(t)?Qs(t,r):Qs([t],([l])=>r(l)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(s==null?void 0:s.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function Qs(t,e){const n=At(()=>[]);return Uo(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}function Wc(t,e={}){const{isStatic:n}=v.useContext(yt),s=()=>B(t)?t.get():t;if(n)return Uc(s);const i=No(s());return v.useInsertionEffect(()=>cl(i,t,e),[i,JSON.stringify(e)]),i}function _c(t,e={}){return Wc(t,{type:"spring",...e})}function Xc(){!Rn.current&&to();const[t]=v.useState(le.current);return t}const Yc=jc;export{Gc as A,Hc as M,_c as a,Uc as b,Yc as m,Xc as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const u="sway-oauth",l="oauth_callback",d="sway-oauth-callback:",A="sway-oauth-provider:";function a(r){return typeof r!="string"?void 0:r.trim()||void 0}function i(r){if(!r||typeof r!="object")return{};const t=r;return{code:a(t.code),state:a(t.state),provider:a(t.provider),error:a(t.error),errorDescription:a(t.errorDescription??t.error_description)}}function c(r){return`${d}${encodeURIComponent(r)}`}function s(r){return`${A}${encodeURIComponent(r)}`}function g(r,t){if(!(!r.trim()||!t.trim()))try{window.localStorage.setItem(s(r),JSON.stringify({provider:t.trim(),storedAt:Date.now()}))}catch{}}function w(r){if(r.trim())try{const t=window.localStorage.getItem(s(r));if(!t)return;const e=JSON.parse(t);return typeof e.storedAt!="number"||Date.now()-e.storedAt>6e5||Date.now()-e.storedAt<-6e5?void 0:a(e.provider)}catch{return}}function C(r){if(r.trim())try{window.localStorage.removeItem(s(r))}catch{}}function O(r){if(!r.state||!(r.code||r.error))return!1;try{return window.localStorage.setItem(c(r.state),JSON.stringify({payload:r,storedAt:Date.now()})),!0}catch{return!1}}function h(r,t=Date.now()){if(!r)return null;try{const e=JSON.parse(r);if(typeof e.storedAt!="number"||t-e.storedAt>6e5||t-e.storedAt<-6e5)return null;const o=i(e.payload);return o.state&&(o.code||o.error)?o:null}catch{return null}}function _(r){try{return h(window.localStorage.getItem(c(r)))}catch{return null}}function m(r){try{window.localStorage.removeItem(c(r))}catch{}}function b(r){return c(r)}function f(r){const t=new URLSearchParams(r),e=a(t.get("error")),o=a(t.get("provider"));return{code:a(t.get("code")),state:a(t.get("state")),...o?{provider:o}:{},error:e,errorDescription:a(t.get("error_description"))}}function L(r,t){const e=r.trim();if(!e)throw new Error("Paste the authorization code or callback URL");let o=null;try{o=new URL(e)}catch{return{code:e,...t?{state:t}:{}}}if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error("The callback URL must use HTTP or HTTPS");const n=f(o.search);if(n.error)throw new Error(n.errorDescription||n.error);if(!n.code)throw new Error("The callback URL does not contain an authorization code");if(!n.state)throw new Error("The callback URL does not contain the OAuth state");if(t&&n.state!==t)throw new Error("The callback URL belongs to a different OAuth session. Start again and use the newest callback.");return{code:n.code,state:n.state}}function y(r){try{const t=new URL(r),e=[t.origin];if(t.protocol!=="http:")return e;const o=new URL(t.origin);if(t.hostname==="localhost")o.hostname="127.0.0.1";else if(t.hostname==="127.0.0.1")o.hostname="localhost";else return e;return e.includes(o.origin)||e.push(o.origin),e}catch{return[]}}function S(r){return{source:u,type:l,...r,data:r}}function p(r){if(!r||typeof r!="object")return null;const t=r;if(t.source!==u||t.type!==void 0&&t.type!==l)return null;const e=i(t),o=i(t.data),n={code:e.code||o.code,state:e.state||o.state,provider:e.provider||o.provider,error:e.error||o.error,errorDescription:e.errorDescription||o.errorDescription};return n.code||n.error?n:null}function v(r,t){if(t.eventOrigin!==t.origin||t.expectedSource&&t.eventSource!==t.expectedSource)return null;const e=p(r);return!e||!t.expectedState||e.state!==t.expectedState||e.provider&&t.expectedProvider&&e.provider!==t.expectedProvider?null:e}export{S as a,g as b,C as c,_ as d,L as e,h as f,y as g,m as h,b as i,f as p,w as r,O as s,v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Ge=s=>{throw TypeError(s)};var pe=(s,t,e)=>t.has(s)||Ge("Cannot "+e);var r=(s,t,e)=>(pe(s,t,"read from private field"),e?e.call(s):t.get(s)),v=(s,t,e)=>t.has(s)?Ge("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),d=(s,t,e,i)=>(pe(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e),C=(s,t,e)=>(pe(s,t,"access private method"),e);var ue=(s,t,e,i)=>({set _(n){d(s,t,n,e)},get _(){return r(s,t,i)}});import{r as T,j as ks,a as Ls}from"./react-vendor-xnYrwzsL.js";var Pt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ot,lt,zt,as,Ks=(as=class extends Pt{constructor(){super();v(this,Ot);v(this,lt);v(this,zt);d(this,zt,t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}onSubscribe(){r(this,lt)||this.setEventListener(r(this,zt))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,lt))==null||t.call(this),d(this,lt,void 0))}setEventListener(t){var e;d(this,zt,t),(e=r(this,lt))==null||e.call(this),d(this,lt,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){r(this,Ot)!==t&&(d(this,Ot,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return typeof r(this,Ot)=="boolean"?r(this,Ot):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ot=new WeakMap,lt=new WeakMap,zt=new WeakMap,as),Ke=new Ks,Us={setTimeout:(s,t)=>setTimeout(s,t),clearTimeout:s=>clearTimeout(s),setInterval:(s,t)=>setInterval(s,t),clearInterval:s=>clearInterval(s)},ht,Le,ls,qs=(ls=class{constructor(){v(this,ht,Us);v(this,Le,!1)}setTimeoutProvider(s){d(this,ht,s)}setTimeout(s,t){return r(this,ht).setTimeout(s,t)}clearTimeout(s){r(this,ht).clearTimeout(s)}setInterval(s,t){return r(this,ht).setInterval(s,t)}clearInterval(s){r(this,ht).clearInterval(s)}},ht=new WeakMap,Le=new WeakMap,ls),St=new qs;function Ws(s){setTimeout(s,0)}var Hs=typeof window>"u"||"Deno"in globalThis;function L(){}function Ns(s,t){return typeof s=="function"?s(t):s}function ve(s){return typeof s=="number"&&s>=0&&s!==1/0}function bs(s,t){return Math.max(s+(t||0)-Date.now(),0)}function vt(s,t){return typeof s=="function"?s(t):s}function V(s,t){return typeof s=="function"?s(t):s}function $e(s,t){const{type:e="all",exact:i,fetchStatus:n,predicate:o,queryKey:l,stale:a}=s;if(l){if(i){if(t.queryHash!==Ue(l,t.options))return!1}else if(!$t(t.queryKey,l))return!1}if(e!=="all"){const h=t.isActive();if(e==="active"&&!h||e==="inactive"&&h)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||n&&n!==t.state.fetchStatus||o&&!o(t))}function Je(s,t){const{exact:e,status:i,predicate:n,mutationKey:o}=s;if(o){if(!t.options.mutationKey)return!1;if(e){if(Ft(t.options.mutationKey)!==Ft(o))return!1}else if(!$t(t.options.mutationKey,o))return!1}return!(i&&t.state.status!==i||n&&!n(t))}function Ue(s,t){return((t==null?void 0:t.queryKeyHashFn)||Ft)(s)}function Ft(s){return JSON.stringify(s,(t,e)=>be(e)?Object.keys(e).sort().reduce((i,n)=>(i[n]=e[n],i),{}):e)}function $t(s,t){if(s===t)return!0;if(typeof s!=typeof t)return!1;if(s&&t&&typeof s=="object"&&typeof t=="object"){if(Array.isArray(s)&&Array.isArray(t)){for(let i=0;i<t.length;i++)if(!$t(s[i],t[i]))return!1;return!0}const e=Object.keys(t);for(const i of e)if(!$t(s[i],t[i]))return!1;return!0}return!1}var Bs=Object.prototype.hasOwnProperty;function qe(s,t,e=0){if(s===t)return s;if(e>500)return t;const i=Xe(s)&&Xe(t);if(!i&&!(be(s)&&be(t)))return t;const o=(i?s:Object.keys(s)).length,l=i?t:Object.keys(t),a=l.length,h=i?new Array(a):{};let p=0;for(let c=0;c<a;c++){const u=i?c:l[c],f=s[u],m=t[u];if(f===m){h[u]=f,(i?c<o:Bs.call(s,u))&&p++;continue}if(f===null||m===null||typeof f!="object"||typeof m!="object"){h[u]=m;continue}const w=qe(f,m,e+1);h[u]=w,w===f&&p++}return o===a&&p===o?s:h}function Zt(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}function Xe(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function be(s){if(!Ze(s))return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(!Ze(e)||!e.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function Ze(s){return Object.prototype.toString.call(s)==="[object Object]"}function Vs(s){return new Promise(t=>{St.setTimeout(t,s)})}function Se(s,t,e){return typeof e.structuralSharing=="function"?e.structuralSharing(s,t):e.structuralSharing!==!1?qe(s,t):t}function Gs(s,t,e=0){const i=[...s,t];return e&&i.length>e?i.slice(1):i}function $s(s,t,e=0){const i=[t,...s];return e&&i.length>e?i.slice(0,-1):i}var We=Symbol();function Ss(s,t){return!s.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!s.queryFn||s.queryFn===We?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function He(s,t){return typeof s=="function"?s(...t):!!s}function Js(s,t,e){let i=!1,n;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(n??(n=t()),i||(i=!0,n.aborted?e():n.addEventListener("abort",e,{once:!0})),n)}),s}var Yt=(()=>{let s=()=>Hs;return{isServer(){return s()},setIsServer(t){s=t}}})();function Oe(){let s,t;const e=new Promise((n,o)=>{s=n,t=o});e.status="pending",e.catch(()=>{});function i(n){Object.assign(e,n),delete e.resolve,delete e.reject}return e.resolve=n=>{i({status:"fulfilled",value:n}),s(n)},e.reject=n=>{i({status:"rejected",reason:n}),t(n)},e}var Xs=Ws;function Zs(){let s=[],t=0,e=a=>{a()},i=a=>{a()},n=Xs;const o=a=>{t?s.push(a):n(()=>{e(a)})},l=()=>{const a=s;s=[],a.length&&n(()=>{i(()=>{a.forEach(h=>{e(h)})})})};return{batch:a=>{let h;t++;try{h=a()}finally{t--,t||l()}return h},batchCalls:a=>(...h)=>{o(()=>{a(...h)})},schedule:o,setNotifyFunction:a=>{e=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{n=a}}}var F=Zs(),Dt,ut,Qt,hs,Ys=(hs=class extends Pt{constructor(){super();v(this,Dt,!0);v(this,ut);v(this,Qt);d(this,Qt,t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,ut)||this.setEventListener(r(this,Qt))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,ut))==null||t.call(this),d(this,ut,void 0))}setEventListener(t){var e;d(this,Qt,t),(e=r(this,ut))==null||e.call(this),d(this,ut,t(this.setOnline.bind(this)))}setOnline(t){r(this,Dt)!==t&&(d(this,Dt,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return r(this,Dt)}},Dt=new WeakMap,ut=new WeakMap,Qt=new WeakMap,hs),fe=new Ys;function ti(s){return Math.min(1e3*2**s,3e4)}function Os(s){return(s??"online")==="online"?fe.isOnline():!0}var we=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function ws(s){let t=!1,e=0,i;const n=Oe(),o=()=>n.status!=="pending",l=y=>{var S;if(!o()){const g=new we(y);f(g),(S=s.onCancel)==null||S.call(s,g)}},a=()=>{t=!0},h=()=>{t=!1},p=()=>Ke.isFocused()&&(s.networkMode==="always"||fe.isOnline())&&s.canRun(),c=()=>Os(s.networkMode)&&s.canRun(),u=y=>{o()||(i==null||i(),n.resolve(y))},f=y=>{o()||(i==null||i(),n.reject(y))},m=()=>new Promise(y=>{var S;i=g=>{(o()||p())&&y(g)},(S=s.onPause)==null||S.call(s)}).then(()=>{var y;i=void 0,o()||(y=s.onContinue)==null||y.call(s)}),w=()=>{if(o())return;let y;const S=e===0?s.initialPromise:void 0;try{y=S??s.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(u).catch(g=>{var z;if(o())return;const O=s.retry??(Yt.isServer()?0:3),E=s.retryDelay??ti,b=typeof E=="function"?E(e,g):E,M=O===!0||typeof O=="number"&&e<O||typeof O=="function"&&O(e,g);if(t||!M){f(g);return}e++,(z=s.onFail)==null||z.call(s,e,g),Vs(b).then(()=>p()?void 0:m()).then(()=>{t?f(g):w()})})};return{promise:n,status:()=>n.status,cancel:l,continue:()=>(i==null||i(),n),cancelRetry:a,continueRetry:h,canStart:c,start:()=>(c()?w():m().then(w),n)}}var wt,us,Cs=(us=class{constructor(){v(this,wt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ve(this.gcTime)&&d(this,wt,St.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Yt.isServer()?1/0:300*1e3))}clearGcTimeout(){r(this,wt)!==void 0&&(St.clearTimeout(r(this,wt)),d(this,wt,void 0))}},wt=new WeakMap,us);function ei(s){return{onFetch:(t,e)=>{var c,u,f,m,w;const i=t.options,n=(f=(u=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let a={pages:[],pageParams:[]},h=0;const p=async()=>{let y=!1;const S=E=>{Js(E,()=>t.signal,()=>y=!0)},g=Ss(t.options,t.fetchOptions),O=async(E,b,M)=>{if(y)return Promise.reject(t.signal.reason);if(b==null&&E.pages.length)return Promise.resolve(E);const U=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:b,direction:M?"backward":"forward",meta:t.options.meta};return S(j),j})(),I=await g(U),{maxPages:P}=t.options,_=M?$s:Gs;return{pages:_(E.pages,I,P),pageParams:_(E.pageParams,b,P)}};if(n&&o.length){const E=n==="backward",b=E?si:Ye,M={pages:o,pageParams:l},z=b(i,M);a=await O(M,z,E)}else{const E=s??o.length;do{const b=h===0?l[0]??i.initialPageParam:Ye(i,a);if(h>0&&b==null)break;a=await O(a,b),h++}while(h<E)}return a};t.options.persister?t.fetchFn=()=>{var y,S;return(S=(y=t.options).persister)==null?void 0:S.call(y,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e)}:t.fetchFn=p}}}function Ye(s,{pages:t,pageParams:e}){const i=t.length-1;return t.length>0?s.getNextPageParam(t[i],t,e[i],e):void 0}function si(s,{pages:t,pageParams:e}){var i;return t.length>0?(i=s.getPreviousPageParam)==null?void 0:i.call(s,t[0],t,e[0],e):void 0}var jt,Ct,kt,G,Et,Q,te,Mt,B,Es,tt,cs,ii=(cs=class extends Cs{constructor(t){super();v(this,B);v(this,jt);v(this,Ct);v(this,kt);v(this,G);v(this,Et);v(this,Q);v(this,te);v(this,Mt);d(this,Mt,!1),d(this,te,t.defaultOptions),this.setOptions(t.options),this.observers=[],d(this,Et,t.client),d(this,G,r(this,Et).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,d(this,Ct,es(this.options)),this.state=t.state??r(this,Ct),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return r(this,jt)}get promise(){var t;return(t=r(this,Q))==null?void 0:t.promise}setOptions(t){if(this.options={...r(this,te),...t},t!=null&&t._type&&d(this,jt,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=es(this.options);e.data!==void 0&&(this.setState(ts(e.data,e.dataUpdatedAt)),d(this,Ct,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,G).remove(this)}setData(t,e){const i=Se(this.state.data,t,this.options);return C(this,B,tt).call(this,{data:i,type:"success",dataUpdatedAt:e==null?void 0:e.updatedAt,manual:e==null?void 0:e.manual}),i}setState(t){C(this,B,tt).call(this,{type:"setState",state:t})}cancel(t){var i,n;const e=(i=r(this,Q))==null?void 0:i.promise;return(n=r(this,Q))==null||n.cancel(t),e?e.then(L).catch(L):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return r(this,Ct)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>V(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===We||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!bs(this.state.dataUpdatedAt,t)}onFocus(){var e;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(e=r(this,Q))==null||e.continue()}onOnline(){var e;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(e=r(this,Q))==null||e.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),r(this,G).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(r(this,Q)&&(r(this,Mt)||C(this,B,Es).call(this)?r(this,Q).cancel({revert:!0}):r(this,Q).cancelRetry()),this.scheduleGc()),r(this,G).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||C(this,B,tt).call(this,{type:"invalidate"})}async fetch(t,e){var p,c,u,f,m,w,y,S,g,O,E;if(this.state.fetchStatus!=="idle"&&((p=r(this,Q))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(e!=null&&e.cancelRefetch))this.cancel({silent:!0});else if(r(this,Q))return r(this,Q).continueRetry(),r(this,Q).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(M=>M.options.queryFn);b&&this.setOptions(b.options)}const i=new AbortController,n=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(d(this,Mt,!0),i.signal)})},o=()=>{const b=Ss(this.options,e),z=(()=>{const U={client:r(this,Et),queryKey:this.queryKey,meta:this.meta};return n(U),U})();return d(this,Mt,!1),this.options.persister?this.options.persister(b,z,this):b(z)},a=(()=>{const b={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:r(this,Et),state:this.state,fetchFn:o};return n(b),b})(),h=r(this,jt)==="infinite"?ei(this.options.pages):this.options.behavior;h==null||h.onFetch(a,this),d(this,kt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&C(this,B,tt).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta}),d(this,Q,ws({initialPromise:e==null?void 0:e.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof we&&b.revert&&this.setState({...r(this,kt),fetchStatus:"idle"}),i.abort()},onFail:(b,M)=>{C(this,B,tt).call(this,{type:"failed",failureCount:b,error:M})},onPause:()=>{C(this,B,tt).call(this,{type:"pause"})},onContinue:()=>{C(this,B,tt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await r(this,Q).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(m=(f=r(this,G).config).onSuccess)==null||m.call(f,b,this),(y=(w=r(this,G).config).onSettled)==null||y.call(w,b,this.state.error,this),b}catch(b){if(b instanceof we){if(b.silent)return r(this,Q).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw C(this,B,tt).call(this,{type:"error",error:b}),(g=(S=r(this,G).config).onError)==null||g.call(S,b,this),(E=(O=r(this,G).config).onSettled)==null||E.call(O,this.state.data,b,this),b}finally{this.scheduleGc()}}},jt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,G=new WeakMap,Et=new WeakMap,Q=new WeakMap,te=new WeakMap,Mt=new WeakMap,B=new WeakSet,Es=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},tt=function(t){const e=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Ms(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,...ts(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return d(this,kt,t.manual?n:void 0),n;case"error":const o=t.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=e(this.state),F.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,G).notify({query:this,type:"updated",action:t})})},cs);function Ms(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Os(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function ts(s,t){return{data:s,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function es(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,e=t!==void 0,i=e?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:e?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:e?"success":"pending",fetchStatus:"idle"}}var q,R,ee,K,Rt,Lt,et,ct,se,Kt,Ut,It,xt,dt,qt,x,Xt,Ce,Ee,Me,Re,Ie,xe,Te,Rs,ds,Ne=(ds=class extends Pt{constructor(t,e){super();v(this,x);v(this,q);v(this,R);v(this,ee);v(this,K);v(this,Rt);v(this,Lt);v(this,et);v(this,ct);v(this,se);v(this,Kt);v(this,Ut);v(this,It);v(this,xt);v(this,dt);v(this,qt,new Set);this.options=e,d(this,q,t),d(this,ct,null),d(this,et,Oe()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,R).addObserver(this),ss(r(this,R),this.options)?C(this,x,Xt).call(this):this.updateResult(),C(this,x,Re).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ae(r(this,R),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ae(r(this,R),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,C(this,x,Ie).call(this),C(this,x,xe).call(this),r(this,R).removeObserver(this)}setOptions(t){const e=this.options,i=r(this,R);if(this.options=r(this,q).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof V(this.options.enabled,r(this,R))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");C(this,x,Te).call(this),r(this,R).setOptions(this.options),e._defaulted&&!Zt(this.options,e)&&r(this,q).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,R),observer:this});const n=this.hasListeners();n&&is(r(this,R),i,this.options,e)&&C(this,x,Xt).call(this),this.updateResult(),n&&(r(this,R)!==i||V(this.options.enabled,r(this,R))!==V(e.enabled,r(this,R))||vt(this.options.staleTime,r(this,R))!==vt(e.staleTime,r(this,R)))&&C(this,x,Ce).call(this);const o=C(this,x,Ee).call(this);n&&(r(this,R)!==i||V(this.options.enabled,r(this,R))!==V(e.enabled,r(this,R))||o!==r(this,dt))&&C(this,x,Me).call(this,o)}getOptimisticResult(t){const e=r(this,q).getQueryCache().build(r(this,q),t),i=this.createResult(e,t);return ri(this,i)&&(d(this,K,i),d(this,Lt,this.options),d(this,Rt,r(this,R).state)),i}getCurrentResult(){return r(this,K)}trackResult(t,e){return new Proxy(t,{get:(i,n)=>(this.trackProp(n),e==null||e(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&r(this,et).status==="pending"&&r(this,et).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,n))})}trackProp(t){r(this,qt).add(t)}getCurrentQuery(){return r(this,R)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=r(this,q).defaultQueryOptions(t),i=r(this,q).getQueryCache().build(r(this,q),e);return i.fetch().then(()=>this.createResult(i,e))}fetch(t){return C(this,x,Xt).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,K)))}createResult(t,e){var P;const i=r(this,R),n=this.options,o=r(this,K),l=r(this,Rt),a=r(this,Lt),p=t!==i?t.state:r(this,ee),{state:c}=t;let u={...c},f=!1,m;if(e._optimisticResults){const _=this.hasListeners(),j=!_&&ss(t,e),bt=_&&is(t,i,e,n);(j||bt)&&(u={...u,...Ms(c.data,t.options)}),e._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:w,errorUpdatedAt:y,status:S}=u;m=u.data;let g=!1;if(e.placeholderData!==void 0&&m===void 0&&S==="pending"){let _;o!=null&&o.isPlaceholderData&&e.placeholderData===(a==null?void 0:a.placeholderData)?(_=o.data,g=!0):_=typeof e.placeholderData=="function"?e.placeholderData((P=r(this,Ut))==null?void 0:P.state.data,r(this,Ut)):e.placeholderData,_!==void 0&&(S="success",m=Se(o==null?void 0:o.data,_,e),f=!0)}if(e.select&&m!==void 0&&!g)if(o&&m===(l==null?void 0:l.data)&&e.select===r(this,se))m=r(this,Kt);else try{d(this,se,e.select),m=e.select(m),m=Se(o==null?void 0:o.data,m,e),d(this,Kt,m),d(this,ct,null)}catch(_){d(this,ct,_)}r(this,ct)&&(w=r(this,ct),m=r(this,Kt),y=Date.now(),S="error");const O=u.fetchStatus==="fetching",E=S==="pending",b=S==="error",M=E&&O,z=m!==void 0,I={status:S,fetchStatus:u.fetchStatus,isPending:E,isSuccess:S==="success",isError:b,isInitialLoading:M,isLoading:M,data:m,dataUpdatedAt:u.dataUpdatedAt,error:w,errorUpdatedAt:y,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>p.dataUpdateCount||u.errorUpdateCount>p.errorUpdateCount,isFetching:O,isRefetching:O&&!E,isLoadingError:b&&!z,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&z,isStale:Be(t,e),refetch:this.refetch,promise:r(this,et),isEnabled:V(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const _=I.data!==void 0,j=I.status==="error"&&!_,bt=he=>{j?he.reject(I.error):_&&he.resolve(I.data)},Y=()=>{const he=d(this,et,I.promise=Oe());bt(he)},ot=r(this,et);switch(ot.status){case"pending":t.queryHash===i.queryHash&&bt(ot);break;case"fulfilled":(j||I.data!==ot.value)&&Y();break;case"rejected":(!j||I.error!==ot.reason)&&Y();break}}return I}updateResult(){const t=r(this,K),e=this.createResult(r(this,R),this.options);if(d(this,Rt,r(this,R).state),d(this,Lt,this.options),r(this,Rt).data!==void 0&&d(this,Ut,r(this,R)),Zt(e,t))return;d(this,K,e);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,o=typeof n=="function"?n():n;if(o==="all"||!o&&!r(this,qt).size)return!0;const l=new Set(o??r(this,qt));return this.options.throwOnError&&l.add("error"),Object.keys(r(this,K)).some(a=>{const h=a;return r(this,K)[h]!==t[h]&&l.has(h)})};C(this,x,Rs).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&C(this,x,Re).call(this)}},q=new WeakMap,R=new WeakMap,ee=new WeakMap,K=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,et=new WeakMap,ct=new WeakMap,se=new WeakMap,Kt=new WeakMap,Ut=new WeakMap,It=new WeakMap,xt=new WeakMap,dt=new WeakMap,qt=new WeakMap,x=new WeakSet,Xt=function(t){C(this,x,Te).call(this);let e=r(this,R).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(L)),e},Ce=function(){C(this,x,Ie).call(this);const t=vt(this.options.staleTime,r(this,R));if(Yt.isServer()||r(this,K).isStale||!ve(t))return;const i=bs(r(this,K).dataUpdatedAt,t)+1;d(this,It,St.setTimeout(()=>{r(this,K).isStale||this.updateResult()},i))},Ee=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,R)):this.options.refetchInterval)??!1},Me=function(t){C(this,x,xe).call(this),d(this,dt,t),!(Yt.isServer()||V(this.options.enabled,r(this,R))===!1||!ve(r(this,dt))||r(this,dt)===0)&&d(this,xt,St.setInterval(()=>{(this.options.refetchIntervalInBackground||Ke.isFocused())&&C(this,x,Xt).call(this)},r(this,dt)))},Re=function(){C(this,x,Ce).call(this),C(this,x,Me).call(this,C(this,x,Ee).call(this))},Ie=function(){r(this,It)!==void 0&&(St.clearTimeout(r(this,It)),d(this,It,void 0))},xe=function(){r(this,xt)!==void 0&&(St.clearInterval(r(this,xt)),d(this,xt,void 0))},Te=function(){const t=r(this,q).getQueryCache().build(r(this,q),this.options);if(t===r(this,R))return;const e=r(this,R);d(this,R,t),d(this,ee,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},Rs=function(t){F.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(r(this,K))}),r(this,q).getQueryCache().notify({query:r(this,R),type:"observerResultsUpdated"})})},ds);function ni(s,t){return V(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&V(t.retryOnMount,s)===!1)}function ss(s,t){return ni(s,t)||s.state.data!==void 0&&Ae(s,t,t.refetchOnMount)}function Ae(s,t,e){if(V(t.enabled,s)!==!1&&vt(t.staleTime,s)!=="static"){const i=typeof e=="function"?e(s):e;return i==="always"||i!==!1&&Be(s,t)}return!1}function is(s,t,e,i){return(s!==t||V(i.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&Be(s,e)}function Be(s,t){return V(t.enabled,s)!==!1&&s.isStaleByTime(vt(t.staleTime,s))}function ri(s,t){return!Zt(s.getCurrentResult(),t)}var ie,J,k,Tt,X,at,fs,oi=(fs=class extends Cs{constructor(t){super();v(this,X);v(this,ie);v(this,J);v(this,k);v(this,Tt);d(this,ie,t.client),this.mutationId=t.mutationId,d(this,k,t.mutationCache),d(this,J,[]),this.state=t.state||Is(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){r(this,J).includes(t)||(r(this,J).push(t),this.clearGcTimeout(),r(this,k).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){d(this,J,r(this,J).filter(e=>e!==t)),this.scheduleGc(),r(this,k).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){r(this,J).length||(this.state.status==="pending"?this.scheduleGc():r(this,k).remove(this))}continue(){var t;return((t=r(this,Tt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,h,p,c,u,f,m,w,y,S,g,O,E,b,M,z,U;const e=()=>{C(this,X,at).call(this,{type:"continue"})},i={client:r(this,ie),meta:this.options.meta,mutationKey:this.options.mutationKey};d(this,Tt,ws({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(I,P)=>{C(this,X,at).call(this,{type:"failed",failureCount:I,error:P})},onPause:()=>{C(this,X,at).call(this,{type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,k).canRun(this)}));const n=this.state.status==="pending",o=!r(this,Tt).canStart();try{if(n)e();else{C(this,X,at).call(this,{type:"pending",variables:t,isPaused:o}),r(this,k).config.onMutate&&await r(this,k).config.onMutate(t,this,i);const P=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,i));P!==this.state.context&&C(this,X,at).call(this,{type:"pending",context:P,variables:t,isPaused:o})}const I=await r(this,Tt).start();return await((p=(h=r(this,k).config).onSuccess)==null?void 0:p.call(h,I,t,this.state.context,this,i)),await((u=(c=this.options).onSuccess)==null?void 0:u.call(c,I,t,this.state.context,i)),await((m=(f=r(this,k).config).onSettled)==null?void 0:m.call(f,I,null,this.state.variables,this.state.context,this,i)),await((y=(w=this.options).onSettled)==null?void 0:y.call(w,I,null,t,this.state.context,i)),C(this,X,at).call(this,{type:"success",data:I}),I}catch(I){try{await((g=(S=r(this,k).config).onError)==null?void 0:g.call(S,I,t,this.state.context,this,i))}catch(P){Promise.reject(P)}try{await((E=(O=this.options).onError)==null?void 0:E.call(O,I,t,this.state.context,i))}catch(P){Promise.reject(P)}try{await((M=(b=r(this,k).config).onSettled)==null?void 0:M.call(b,void 0,I,this.state.variables,this.state.context,this,i))}catch(P){Promise.reject(P)}try{await((U=(z=this.options).onSettled)==null?void 0:U.call(z,void 0,I,t,this.state.context,i))}catch(P){Promise.reject(P)}throw C(this,X,at).call(this,{type:"error",error:I}),I}finally{r(this,k).runNext(this)}}},ie=new WeakMap,J=new WeakMap,k=new WeakMap,Tt=new WeakMap,X=new WeakSet,at=function(t){const e=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),F.batch(()=>{r(this,J).forEach(i=>{i.onMutationUpdate(t)}),r(this,k).notify({mutation:this,type:"updated",action:t})})},fs);function Is(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var st,$,ne,ms,ai=(ms=class extends Pt{constructor(t={}){super();v(this,st);v(this,$);v(this,ne);this.config=t,d(this,st,new Set),d(this,$,new Map),d(this,ne,0)}build(t,e,i){const n=new oi({client:t,mutationCache:this,mutationId:++ue(this,ne)._,options:t.defaultMutationOptions(e),state:i});return this.add(n),n}add(t){r(this,st).add(t);const e=ce(t);if(typeof e=="string"){const i=r(this,$).get(e);i?i.push(t):r(this,$).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(r(this,st).delete(t)){const e=ce(t);if(typeof e=="string"){const i=r(this,$).get(e);if(i)if(i.length>1){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}else i[0]===t&&r(this,$).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=ce(t);if(typeof e=="string"){const i=r(this,$).get(e),n=i==null?void 0:i.find(o=>o.state.status==="pending");return!n||n===t}else return!0}runNext(t){var i;const e=ce(t);if(typeof e=="string"){const n=(i=r(this,$).get(e))==null?void 0:i.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){F.batch(()=>{r(this,st).forEach(t=>{this.notify({type:"removed",mutation:t})}),r(this,st).clear(),r(this,$).clear()})}getAll(){return Array.from(r(this,st))}find(t){const e={exact:!0,...t};return this.getAll().find(i=>Je(e,i))}findAll(t={}){return this.getAll().filter(e=>Je(t,e))}notify(t){F.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return F.batch(()=>Promise.all(t.map(e=>e.continue().catch(L))))}},st=new WeakMap,$=new WeakMap,ne=new WeakMap,ms);function ce(s){var t;return(t=s.options.scope)==null?void 0:t.id}var it,ft,W,nt,rt,de,Fe,ps,li=(ps=class extends Pt{constructor(t,e){super();v(this,rt);v(this,it);v(this,ft);v(this,W);v(this,nt);d(this,it,t),this.setOptions(e),this.bindMethods(),C(this,rt,de).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const e=this.options;this.options=r(this,it).defaultMutationOptions(t),Zt(this.options,e)||r(this,it).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,W),observer:this}),e!=null&&e.mutationKey&&this.options.mutationKey&&Ft(e.mutationKey)!==Ft(this.options.mutationKey)?this.reset():((i=r(this,W))==null?void 0:i.state.status)==="pending"&&r(this,W).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,W))==null||t.removeObserver(this)}onMutationUpdate(t){C(this,rt,de).call(this),C(this,rt,Fe).call(this,t)}getCurrentResult(){return r(this,ft)}reset(){var t;(t=r(this,W))==null||t.removeObserver(this),d(this,W,void 0),C(this,rt,de).call(this),C(this,rt,Fe).call(this)}mutate(t,e){var i;return d(this,nt,e),(i=r(this,W))==null||i.removeObserver(this),d(this,W,r(this,it).getMutationCache().build(r(this,it),this.options)),r(this,W).addObserver(this),r(this,W).execute(t)}},it=new WeakMap,ft=new WeakMap,W=new WeakMap,nt=new WeakMap,rt=new WeakSet,de=function(){var e;const t=((e=r(this,W))==null?void 0:e.state)??Is();d(this,ft,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Fe=function(t){F.batch(()=>{var e,i,n,o,l,a,h,p;if(r(this,nt)&&this.hasListeners()){const c=r(this,ft).variables,u=r(this,ft).context,f={client:r(this,it),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=(e=r(this,nt)).onSuccess)==null||i.call(e,t.data,c,u,f)}catch(m){Promise.reject(m)}try{(o=(n=r(this,nt)).onSettled)==null||o.call(n,t.data,null,c,u,f)}catch(m){Promise.reject(m)}}else if((t==null?void 0:t.type)==="error"){try{(a=(l=r(this,nt)).onError)==null||a.call(l,t.error,c,u,f)}catch(m){Promise.reject(m)}try{(p=(h=r(this,nt)).onSettled)==null||p.call(h,void 0,t.error,c,u,f)}catch(m){Promise.reject(m)}}}this.listeners.forEach(c=>{c(r(this,ft))})})},ps);function ns(s,t){const e=new Set(t);return s.filter(i=>!e.has(i))}function hi(s,t,e){const i=s.slice(0);return i[t]=e,i}var Wt,H,Ht,At,N,mt,re,oe,ae,le,D,Pe,_e,xs,ze,De,Qe,gs,ui=(gs=class extends Pt{constructor(t,e,i){super();v(this,D);v(this,Wt);v(this,H);v(this,Ht);v(this,At);v(this,N);v(this,mt);v(this,re);v(this,oe);v(this,ae);v(this,le,[]);d(this,Wt,t),d(this,At,i),d(this,Ht,[]),d(this,N,[]),d(this,H,[]),this.setQueries(e)}onSubscribe(){this.listeners.size===1&&r(this,N).forEach(t=>{t.subscribe(e=>{C(this,D,De).call(this,t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,r(this,N).forEach(t=>{t.destroy()})}setQueries(t,e){d(this,Ht,t),d(this,At,e),F.batch(()=>{const i=r(this,N),n=C(this,D,ze).call(this,r(this,Ht));n.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const o=n.map(u=>u.observer),l=o.map(u=>u.getCurrentResult()),a=i.length!==o.length,h=o.some((u,f)=>u!==i[f]),p=a||h,c=p?!0:l.some((u,f)=>{const m=r(this,H)[f];return!m||!Zt(u,m)});!p&&!c||(p&&(d(this,le,n),d(this,N,o)),d(this,H,l),this.hasListeners()&&(p&&(ns(i,o).forEach(u=>{u.destroy()}),ns(o,i).forEach(u=>{u.subscribe(f=>{C(this,D,De).call(this,u,f)})})),C(this,D,Qe).call(this)))})}getCurrentResult(){return r(this,H)}getQueries(){return r(this,N).map(t=>t.getCurrentQuery())}getObservers(){return r(this,N)}getOptimisticResult(t,e){const i=C(this,D,ze).call(this,t),n=i.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),o=i.map(l=>l.defaultedQueryOptions.queryHash);return[n,l=>C(this,D,_e).call(this,l??n,e,o),()=>C(this,D,Pe).call(this,n,i)]}},Wt=new WeakMap,H=new WeakMap,Ht=new WeakMap,At=new WeakMap,N=new WeakMap,mt=new WeakMap,re=new WeakMap,oe=new WeakMap,ae=new WeakMap,le=new WeakMap,D=new WeakSet,Pe=function(t,e){return e.map((i,n)=>{const o=t[n];return i.defaultedQueryOptions.notifyOnChangeProps?o:i.observer.trackResult(o,l=>{e.forEach(a=>{a.observer.trackProp(l)})})})},_e=function(t,e,i){if(e){const n=r(this,ae),o=i!==void 0&&n!==void 0&&(n.length!==i.length||i.some((l,a)=>l!==n[a]));return(!r(this,mt)||r(this,H)!==r(this,oe)||o||e!==r(this,re))&&(d(this,re,e),d(this,oe,r(this,H)),i!==void 0&&d(this,ae,i),d(this,mt,qe(r(this,mt),e(t)))),r(this,mt)}return t},xs=function(){var t;return((t=r(this,At))==null?void 0:t.combine)!==void 0&&r(this,N).some((e,i)=>{var n;return e.options.suspense&&((n=r(this,H)[i])==null?void 0:n.data)===void 0})},ze=function(t){const e=new Map;r(this,N).forEach(n=>{const o=n.options.queryHash;if(!o)return;const l=e.get(o);l?l.push(n):e.set(o,[n])});const i=[];return t.forEach(n=>{var h;const o=r(this,Wt).defaultQueryOptions(n),a=((h=e.get(o.queryHash))==null?void 0:h.shift())??new Ne(r(this,Wt),o);i.push({defaultedQueryOptions:o,observer:a})}),i},De=function(t,e){const i=r(this,N).indexOf(t);i!==-1&&(d(this,H,hi(r(this,H),i,e)),C(this,D,Qe).call(this))},Qe=function(){var t;if(this.hasListeners()){const e=C(this,D,Pe).call(this,r(this,H),r(this,le)),i=C(this,D,xs).call(this),n=r(this,mt),o=i?n:C(this,D,_e).call(this,e,(t=r(this,At))==null?void 0:t.combine);(i||n!==o)&&F.batch(()=>{this.listeners.forEach(l=>{l(r(this,H))})})}},gs),Z,ys,ci=(ys=class extends Pt{constructor(t={}){super();v(this,Z);this.config=t,d(this,Z,new Map)}build(t,e,i){const n=e.queryKey,o=e.queryHash??Ue(n,e);let l=this.get(o);return l||(l=new ii({client:t,queryKey:n,queryHash:o,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(n)}),this.add(l)),l}add(t){r(this,Z).has(t.queryHash)||(r(this,Z).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=r(this,Z).get(t.queryHash);e&&(t.destroy(),e===t&&r(this,Z).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){F.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return r(this,Z).get(t)}getAll(){return[...r(this,Z).values()]}find(t){const e={exact:!0,...t};return this.getAll().find(i=>$e(e,i))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(i=>$e(t,i)):e}notify(t){F.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){F.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Z=new WeakMap,ys),A,pt,gt,Nt,Bt,yt,Vt,Gt,vs,zi=(vs=class{constructor(s={}){v(this,A);v(this,pt);v(this,gt);v(this,Nt);v(this,Bt);v(this,yt);v(this,Vt);v(this,Gt);d(this,A,s.queryCache||new ci),d(this,pt,s.mutationCache||new ai),d(this,gt,s.defaultOptions||{}),d(this,Nt,new Map),d(this,Bt,new Map),d(this,yt,0)}mount(){ue(this,yt)._++,r(this,yt)===1&&(d(this,Vt,Ke.subscribe(async s=>{s&&(await this.resumePausedMutations(),r(this,A).onFocus())})),d(this,Gt,fe.subscribe(async s=>{s&&(await this.resumePausedMutations(),r(this,A).onOnline())})))}unmount(){var s,t;ue(this,yt)._--,r(this,yt)===0&&((s=r(this,Vt))==null||s.call(this),d(this,Vt,void 0),(t=r(this,Gt))==null||t.call(this),d(this,Gt,void 0))}isFetching(s){return r(this,A).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return r(this,pt).findAll({...s,status:"pending"}).length}getQueryData(s){var e;const t=this.defaultQueryOptions({queryKey:s});return(e=r(this,A).get(t.queryHash))==null?void 0:e.state.data}ensureQueryData(s){const t=this.defaultQueryOptions(s),e=r(this,A).build(this,t),i=e.state.data;return i===void 0?this.fetchQuery(s):(s.revalidateIfStale&&e.isStaleByTime(vt(t.staleTime,e))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(s){return r(this,A).findAll(s).map(({queryKey:t,state:e})=>{const i=e.data;return[t,i]})}setQueryData(s,t,e){const i=this.defaultQueryOptions({queryKey:s}),n=r(this,A).get(i.queryHash),o=n==null?void 0:n.state.data,l=Ns(t,o);if(l!==void 0)return r(this,A).build(this,i).setData(l,{...e,manual:!0})}setQueriesData(s,t,e){return F.batch(()=>r(this,A).findAll(s).map(({queryKey:i})=>[i,this.setQueryData(i,t,e)]))}getQueryState(s){var e;const t=this.defaultQueryOptions({queryKey:s});return(e=r(this,A).get(t.queryHash))==null?void 0:e.state}removeQueries(s){const t=r(this,A);F.batch(()=>{t.findAll(s).forEach(e=>{t.remove(e)})})}resetQueries(s,t){const e=r(this,A);return F.batch(()=>(e.findAll(s).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...s},t)))}cancelQueries(s,t={}){const e={revert:!0,...t},i=F.batch(()=>r(this,A).findAll(s).map(n=>n.cancel(e)));return Promise.all(i).then(L).catch(L)}invalidateQueries(s,t={}){return F.batch(()=>(r(this,A).findAll(s).forEach(e=>{e.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},t)))}refetchQueries(s,t={}){const e={...t,cancelRefetch:t.cancelRefetch??!0},i=F.batch(()=>r(this,A).findAll(s).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let o=n.fetch(void 0,e);return e.throwOnError||(o=o.catch(L)),n.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(L)}fetchQuery(s){const t=this.defaultQueryOptions(s);t.retry===void 0&&(t.retry=!1);const e=r(this,A).build(this,t);return e.isStaleByTime(vt(t.staleTime,e))?e.fetch(t):Promise.resolve(e.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(L).catch(L)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(L).catch(L)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return fe.isOnline()?r(this,pt).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,A)}getMutationCache(){return r(this,pt)}getDefaultOptions(){return r(this,gt)}setDefaultOptions(s){d(this,gt,s)}setQueryDefaults(s,t){r(this,Nt).set(Ft(s),{queryKey:s,defaultOptions:t})}getQueryDefaults(s){const t=[...r(this,Nt).values()],e={};return t.forEach(i=>{$t(s,i.queryKey)&&Object.assign(e,i.defaultOptions)}),e}setMutationDefaults(s,t){r(this,Bt).set(Ft(s),{mutationKey:s,defaultOptions:t})}getMutationDefaults(s){const t=[...r(this,Bt).values()],e={};return t.forEach(i=>{$t(s,i.mutationKey)&&Object.assign(e,i.defaultOptions)}),e}defaultQueryOptions(s){if(s._defaulted)return s;const t={...r(this,gt).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return t.queryHash||(t.queryHash=Ue(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===We&&(t.enabled=!1),t}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...r(this,gt).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){r(this,A).clear(),r(this,pt).clear()}},A=new WeakMap,pt=new WeakMap,gt=new WeakMap,Nt=new WeakMap,Bt=new WeakMap,yt=new WeakMap,Vt=new WeakMap,Gt=new WeakMap,vs),Ts=T.createContext(void 0),Ve=s=>{const t=T.useContext(Ts);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Di=({client:s,children:t})=>(T.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),ks.jsx(Ts.Provider,{value:s,children:t})),As=T.createContext(!1),Fs=()=>T.useContext(As);As.Provider;function di(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var fi=T.createContext(di()),Ps=()=>T.useContext(fi),_s=(s,t,e)=>{const i=e!=null&&e.state.error&&typeof s.throwOnError=="function"?He(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||i)&&(t.isReset()||(s.retryOnMount=!1))},zs=s=>{T.useEffect(()=>{s.clearReset()},[s])},Ds=({result:s,errorResetBoundary:t,throwOnError:e,query:i,suspense:n})=>s.isError&&!t.isReset()&&!s.isFetching&&i&&(n&&s.data===void 0||He(e,[s.error,i])),Qs=s=>{if(s.suspense){const e=n=>n==="static"?n:Math.max(n??1e3,1e3),i=s.staleTime;s.staleTime=typeof i=="function"?(...n)=>e(i(...n)):e(i),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},mi=(s,t)=>s.isLoading&&s.isFetching&&!t,je=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,ke=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Qi({queries:s,...t},e){const i=Ve(),n=Fs(),o=Ps(),l=T.useMemo(()=>s.map(y=>{const S=i.defaultQueryOptions(y);return S._optimisticResults=n?"isRestoring":"optimistic",S}),[s,i,n]);l.forEach(y=>{Qs(y);const S=i.getQueryCache().get(y.queryHash);_s(y,o,S)}),zs(o);const[a]=T.useState(()=>new ui(i,l,t)),[h,p,c]=a.getOptimisticResult(l,t.combine),u=!n&&t.subscribed!==!1;T.useSyncExternalStore(T.useCallback(y=>u?a.subscribe(F.batchCalls(y)):L,[a,u]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),T.useEffect(()=>{a.setQueries(l,t)},[l,t,a]);const m=h.some((y,S)=>je(l[S],y))?h.flatMap((y,S)=>{const g=l[S];if(g&&je(g,y)){const O=new Ne(i,g);return ke(g,O,o)}return[]}):[];if(m.length>0)throw Promise.all(m);const w=h.find((y,S)=>{const g=l[S];return g&&Ds({result:y,errorResetBoundary:o,throwOnError:g.throwOnError,query:i.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(w!=null&&w.error)throw w.error;return p(c())}function pi(s,t,e){var m,w,y,S;const i=Fs(),n=Ps(),o=Ve(),l=o.defaultQueryOptions(s);(w=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||w.call(m,l);const a=o.getQueryCache().get(l.queryHash),h=s.subscribed!==!1;l._optimisticResults=i?"isRestoring":h?"optimistic":void 0,Qs(l),_s(l,n,a),zs(n);const p=!o.getQueryCache().get(l.queryHash),[c]=T.useState(()=>new t(o,l)),u=c.getOptimisticResult(l),f=!i&&h;if(T.useSyncExternalStore(T.useCallback(g=>{const O=f?c.subscribe(F.batchCalls(g)):L;return c.updateResult(),O},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),T.useEffect(()=>{c.setOptions(l)},[l,c]),je(l,u))throw ke(l,c,n);if(Ds({result:u,errorResetBoundary:n,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw u.error;if((S=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||S.call(y,l,u),l.experimental_prefetchInRender&&!Yt.isServer()&&mi(u,i)){const g=p?ke(l,c,n):a==null?void 0:a.promise;g==null||g.catch(L).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?u:c.trackResult(u)}function ji(s,t){return pi(s,Ne)}function ki(s,t){const e=Ve(),[i]=T.useState(()=>new li(e,s));T.useEffect(()=>{i.setOptions(s)},[i,s]);const n=T.useSyncExternalStore(T.useCallback(l=>i.subscribe(F.batchCalls(l)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=T.useCallback((l,a)=>{i.mutate(l,a).catch(L)},[i]);if(n.error&&He(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:o,mutateAsync:n.mutate}}function gi(s,t,e){const i=new Array(s);return new Proxy(i,{get(n,o,l){if(typeof o=="string"){const a=o.charCodeAt(0);if(a>=48&&a<=57){const h=+o;if(Number.isInteger(h)&&h>=0&&h<s){let p=n[h];if(!p){const c=t[h*2];p=n[h]={index:h,key:e(h),start:c,size:t[h*2+1],end:c+t[h*2+1],lane:0}}return p}}if(o==="length")return s}return Reflect.get(n,o,l)}})}function _t(s,t,e){let i=e.initialDeps??[],n,o=!0;function l(){const a=s();return(a.length!==i.length||a.some((p,c)=>i[c]!==p))&&(i=a,n=t(...a),e!=null&&e.onChange&&!(o&&e.skipInitialOnChange)&&e.onChange(n),o=!1),n}return l.updateDeps=a=>{i=a},l}function rs(s,t){if(s===void 0)throw new Error("Unexpected undefined");return s}const yi=(s,t)=>Math.abs(s-t)<1.01,vi=(s,t,e)=>{let i;return function(...n){s.clearTimeout(i),i=s.setTimeout(()=>t.apply(this,n),e)}};let Jt;const ge=()=>{if(Jt!==void 0)return Jt;if(typeof navigator>"u")return Jt=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Jt=!0;const s=navigator.maxTouchPoints;return Jt=navigator.platform==="MacIntel"&&s!==void 0&&s>0},os=s=>{const{offsetWidth:t,offsetHeight:e}=s;return{width:t,height:e}},bi=s=>s,Si=s=>{const t=Math.max(s.startIndex-s.overscan,0),i=Math.min(s.endIndex+s.overscan,s.count-1)-t+1,n=new Array(i);for(let o=0;o<i;o++)n[o]=t+o;return n},Oi=(s,t)=>{const e=s.scrollElement;if(!e)return;const i=s.targetWindow;if(!i)return;const n=l=>{const{width:a,height:h}=l;t({width:Math.round(a),height:Math.round(h)})};if(n(os(e)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(l=>{const a=()=>{const h=l[0];if(h!=null&&h.borderBoxSize){const p=h.borderBoxSize[0];if(p){n({width:p.inlineSize,height:p.blockSize});return}}n(os(e))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(e,{box:"border-box"}),()=>{o.unobserve(e)}},me={passive:!0},wi=typeof window>"u"?!0:"onscrollend"in window,Ci=(s,t,e)=>{const i=s.scrollElement;if(!i)return;const n=s.targetWindow;if(!n)return;const o=s.options.useScrollendEvent&&wi;let l=0;const a=o?null:vi(n,()=>t(l,!1),s.options.isScrollingResetDelay),h=u=>()=>{l=e(i),a==null||a(),t(l,u)},p=h(!0),c=h(!1);return i.addEventListener("scroll",p,me),o&&i.addEventListener("scrollend",c,me),()=>{i.removeEventListener("scroll",p),o&&i.removeEventListener("scrollend",c)}},Ei=(s,t)=>Ci(s,t,e=>{const{horizontal:i,isRtl:n}=s.options;return i?e.scrollLeft*(n&&-1||1):e.scrollTop}),Mi=(s,t,e)=>{if(e.options.useCachedMeasurements){const i=e.indexFromElement(s),n=e.options.getItemKey(i);return e.itemSizeCache.get(n)??e.options.estimateSize(i)}if(t!=null&&t.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[e.options.horizontal?"inlineSize":"blockSize"])}if(!t){const i=e.indexFromElement(s),n=e.options.getItemKey(i),o=e.itemSizeCache.get(n);if(o!==void 0)return o}return s[e.options.horizontal?"offsetWidth":"offsetHeight"]},Ri=(s,{adjustments:t=0,behavior:e},i)=>{var n,o;(o=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[i.options.horizontal?"left":"top"]:s+t,behavior:e})},Ii=Ri;class xi{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e,i,n;return((n=(i=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:i.now)==null?void 0:n.call(i))??Date.now()},this.observer=(()=>{let e=null;const i=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const l=()=>{const a=o.target,h=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[p,c]of this.elementsCache)if(c===a){this.elementsCache.delete(p);break}return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),e=null},observe:n=>{var o;return(o=i())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=i())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=e=>{var i,n;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bi,rangeExtractor:Si,onChange:()=>{},measureElement:Mi,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const f in e){const m=e[f];m!==void 0&&(o[f]=m)}const l=this.options;let a=null,h=null,p=!1;if(l!==void 0&&l.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const f=l.count,m=o.count,w=this.getMeasurements(),y=f>0?((i=w[0])==null?void 0:i.key)??l.getItemKey(0):null,S=f>0?((n=w[f-1])==null?void 0:n.key)??l.getItemKey(f-1):null;if(m!==f||f>0&&m>0&&(o.getItemKey(0)!==y||o.getItemKey(m-1)!==S)){p=!0;const E=f>0?this.getVirtualItemForOffset(this.getScrollOffset())??w[0]:null;E&&(a=[E.key,this.getScrollOffset()-E.start]);const b=o.followOnAppend===!0?"auto":o.followOnAppend||null;b&&m>f&&this.isAtEnd(l.scrollEndThreshold)&&(f===0||o.getItemKey(m-1)!==S)&&(h=b)}}this.options=o,p&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,u=0;if(a&&this.scrollOffset!==null){const[f,m]=a,w=this.getMeasurements(),{count:y,getItemKey:S}=this.options;let g=0;for(;g<y&&S(g)!==f;)g++;if(g<y){const O=w[g];if(O){const E=Math.max(0,O.start+m);E!==this.scrollOffset&&(u=E-this.scrollOffset,this.scrollOffset=E,c=!0)}}}(c||h)&&(this.pendingScrollAnchor=[c?a[0]:null,c?a[1]:0,h,u])},this.notify=e=>{var i,n;(n=(i=this.options).onChange)==null||n.call(i,this,e)},this.maybeNotify=_t(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{if(l&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===o?this.scrollDirection:a<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!ge()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",l,me),o.addEventListener("touchend",a,me),this.unsubs.push(()=>{o.removeEventListener("touchstart",l),o.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[o,l,a,h]=n;o!==null&&!a&&(ge()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?h!==0&&(this._iosDeferredAdjustment+=h):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const e=this.getScrollOffset(),i=this.getMaxScrollOffset();if(e<0||e>i)return;if(this._iosDeferredAdjustment<0&&e>=i-1){this._iosDeferredAdjustment=0;return}const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_t(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,i,n,o,l,a,h,p)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:l,lanes:a,laneAssignmentMode:h,gap:p}),{key:!1}),this.getMeasurements=_t(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:l,lanes:a,laneAssignmentMode:h,gap:p},c)=>{const u=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const g of this.laneAssignments.keys())g>=e&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){const g=e*2;let O=this._flatMeasurements;if(!O||O.length<g){const M=new Float64Array(g);O&&f>0&&M.set(O.subarray(0,f*2)),O=M,this._flatMeasurements=O}let E;if(f===0)E=i+n;else{const M=f-1;E=O[M*2]+O[M*2+1]+p}for(let M=f;M<e;M++){const z=o(M),U=u.get(z),I=typeof U=="number"?U:this.options.estimateSize(M);O[M*2]=E,O[M*2+1]=I,E+=I+p}const b=gi(e,O,o);return this.measurementsCache=b,b}const m=this.measurementsCache.slice(0,f),w=new Array(a).fill(void 0),y=new Float64Array(a);let S=0;for(let g=0;g<f;g++){const O=m[g];O&&(w[O.lane]===void 0&&S++,w[O.lane]=g,y[O.lane]=O.end)}for(let g=f;g<e;g++){const O=o(g),E=this.laneAssignments.get(g);let b,M;const z=h==="estimate"||u.has(O);if(E!==void 0&&this.options.lanes>1){b=E;const _=w[b],j=_!==void 0?m[_]:void 0;M=j?j.end+p:i+n}else if(S===a){let _=0,j=y[0],bt=w[0];for(let Y=1;Y<a;Y++){const ot=y[Y];(ot<j||ot===j&&w[Y]<bt)&&(_=Y,j=ot,bt=w[Y])}b=_,M=j+p,z&&this.laneAssignments.set(g,b)}else b=g%this.options.lanes,M=i+n,z&&this.laneAssignments.set(g,b);const U=u.get(O),I=typeof U=="number"?U:this.options.estimateSize(g),P=M+I;m[g]={index:g,start:M,size:I,end:P,key:O,lane:b},w[b]===void 0&&S++,w[b]=g,y[b]=P}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_t(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,i,n,o)=>e.length===0||i===0?(this.range=null,null):(this.range=Ai(e,i,n,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_t(()=>{let e=null,i=null;const n=this.calculateRange();return n&&(e=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,i]},(e,i,n,o,l)=>o===null||l===null?[]:e({startIndex:o,endIndex:l,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const i=this.options.indexAttribute,n=e.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,n-o),a=Math.min(this.options.count-1,n+o);return e>=l&&e<=a}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((l,a)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(a))});return}const i=this.indexFromElement(e),n=this.options.getItemKey(i),o=this.elementsCache.get(n);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,i)=>{var n,o;if(e<0||e>=this.options.count)return;let l,a,h;const p=this._flatMeasurements;if(this.options.lanes===1&&p!==null)h=this.options.getItemKey(e),a=p[e*2],l=p[e*2+1];else{const f=this.measurementsCache[e];if(!f)return;h=f.key,a=f.start,l=f.size}const c=this.itemSizeCache.get(h)??l,u=i-c;if(u!==0){const f=this.options.anchorTo==="end"&&((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=f?this.getTotalSize():0,w=this.getScrollOffset()+this.scrollAdjustments,S=!this.itemSizeCache.has(h)?a<w:a+c<=w&&this.scrollDirection!=="backward",g=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:h,start:a,size:l,end:a+l,lane:0},u,this):S);(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(h,i),this.itemSizeCacheVersion++;let O=!1;f?O=this.applyScrollAdjustment(this.getTotalSize()-m):g&&(O=this.applyScrollAdjustment(u)),this.notify(O)}},this.getVirtualItems=_t(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,i)=>{const n=[];for(let o=0,l=e.length;o<l;o++){const a=e[o],h=i[a];n.push(h)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const i=this.getMeasurements();if(i.length===0)return;const n=this._flatMeasurements,o=this.options.lanes===1&&n!=null,l=js(0,i.length-1,o?a=>n[a*2]:a=>rs(i[a]).start,e);return rs(i[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,i,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),l=this.getScrollOffset();i==="auto"&&(i=e>=l+o?"end":"start"),i==="center"?e+=(n-o)/2:i==="end"&&(e-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,i="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),l=this.measurementsCache[e];if(!l)return;if(i==="auto")if(l.end>=o+n-this.options.scrollPaddingEnd)i="end";else if(l.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),i];const a=i==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i,l.size),i]},this.scrollToOffset=(e,{align:i="start",behavior:n="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(e,i),l=this.now();this.scrollState={index:null,align:i,behavior:n,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:i="auto",behavior:n="auto"}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));const o=this.getOffsetForIndex(e,i);if(!o)return;const[l,a]=o,h=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:h,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:i="auto"}={})=>{const n=this.getScrollOffset()+e,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,l=this._flatMeasurements;l!=null?n=l[o*2]+l[o*2+1]:n=((e=i[o])==null?void 0:e.end)??0}else{const o=Array(this.options.lanes).fill(null);let l=i.length-1;for(;l>=0&&o.some(a=>a===null);){const a=i[l];o[a.lane]===null&&(o[a.lane]=a.end),l--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const e=[];if(this.itemSizeCache.size===0)return e;const i=this.getMeasurements();for(const n of i)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:i,behavior:n})=>{this._intendedScrollOffset=e+(i??0),this.options.scrollToFn(e,{behavior:n,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,e){return t===0?!1:ge()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:e}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=i?i[0]:this.scrollState.lastTargetOffset,o=1,l=n!==this.scrollState.lastTargetOffset;if(!l&&yi(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==n&&this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,h=Math.abs(n-this.getScrollOffset()),p=this.scrollState.behavior==="smooth"&&h>a;this.scrollState.lastTargetOffset=n,p||(this.scrollState.behavior="auto"),this._scrollToOffset(n,{adjustments:void 0,behavior:p?"smooth":"auto"})}this.scheduleScrollReconcile()}}const js=(s,t,e,i)=>{for(;s<=t;){const n=(s+t)/2|0,o=e(n);if(o<i)s=n+1;else if(o>i)t=n-1;else return n}return s>0?s-1:0};function Ti(s,t,e){let i=0;for(;i<=t;){const n=(i+t)/2|0,o=s[n*2];if(o<e)i=n+1;else if(o>e)t=n-1;else return n}return i>0?i-1:0}function Ai(s,t,e,i,n){const o=s.length-1;if(s.length<=i)return{startIndex:0,endIndex:o};if(i===1&&n!==null){const p=Ti(n,o,e);let c=p;const u=e+t;for(;c<o&&n[c*2]+n[c*2+1]<u;)c++;return{startIndex:p,endIndex:c}}let a=js(0,o,p=>s[p].start,e),h=a;if(i===1)for(;h<o&&s[h].end<e+t;)h++;else if(i>1){const p=Array(i).fill(0);for(;h<o&&p.some(u=>u<e+t);){const u=s[h];p[u.lane]=u.end,h++}const c=Array(i).fill(e+t);for(;a>=0&&c.some(u=>u>=e);){const u=s[a];c[u.lane]=u.start,a--}a=Math.max(0,a-a%i),h=Math.min(o,h+(i-1-h%i))}return{startIndex:a,endIndex:h}}const ye=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Fi({useFlushSync:s=!0,directDomUpdates:t=!1,directDomUpdatesMode:e="transform",...i}){const n=T.useReducer(c=>c+1,0)[1],o=T.useRef({enabled:t,mode:e,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=e;const l=c=>{const u=o.current;if(!u.enabled||!u.container)return;const f=c.getTotalSize();if(f!==u.lastSize){u.lastSize=f;const m=c.options.horizontal?"width":"height";u.container.style[m]=`${f}px`}},a=c=>{const u=o.current;if(!u.enabled||!u.container)return;l(c);const f=!!c.options.horizontal,m=u.mode==="transform",w=f?"left":"top",y=c.options.scrollMargin,S=c.getVirtualItems();for(const g of S){const O=g.start-y,E=c.elementsCache.get(g.key);E&&u.lastPositions.get(E)!==O&&(u.lastPositions.set(E,O),m?E.style.transform=f?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:E.style[w]=`${O}px`)}},h={...i,onChange:(c,u)=>{var f;const m=o.current;let w=!0;if(m.enabled){a(c);const y=c.range,S=m.prevRange;w=!S||S.isScrolling!==c.isScrolling||S.startIndex!==(y==null?void 0:y.startIndex)||S.endIndex!==(y==null?void 0:y.endIndex),w&&(m.prevRange=y?{startIndex:y.startIndex,endIndex:y.endIndex,isScrolling:c.isScrolling}:null)}w&&(s&&u?Ls.flushSync(n):n()),(f=i.onChange)==null||f.call(i,c,u)}},[p]=T.useState(()=>{const c=new xi(h);return Object.assign(c,{containerRef:u=>{const f=o.current;if(f.container=u,f.lastSize=null,u&&f.enabled){const m=c.getTotalSize();f.lastSize=m;const w=c.options.horizontal?"width":"height";u.style[w]=`${m}px`}}})});return p.setOptions(h),ye(()=>p._didMount(),[]),ye(()=>(l(p),p._willUpdate())),ye(()=>{a(p)}),p}function Li(s){return Fi({observeElementRect:Oi,observeElementOffset:Ei,scrollToFn:Ii,...s})}export{zi as Q,ji as a,ki as b,Di as c,Li as d,Qi as e,Ve as u};
|